diff --git a/package-lock.json b/package-lock.json index a49da0ea1..b635c2f43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,8 +43,8 @@ "json5": "^2.2.1", "lodash": "^4.17.20", "markdown-table-ts": "^1.0.3", - "postcss": "^8.4.24", "mkdirp": "^3.0.1", + "postcss": "^8.4.24", "prettier": "^2.7.1", "style-dictionary": "^3.9.2", "ts-jest": "^29.1.2", @@ -3802,9 +3802,9 @@ } }, "node_modules/csstype": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.2.tgz", - "integrity": "sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", "dev": true }, "node_modules/csv": { @@ -9960,9 +9960,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true, "funding": [ { @@ -10527,32 +10527,6 @@ "node": ">=8" } }, - "node_modules/postcss": { - "version": "8.4.24", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.24.tgz", - "integrity": "sha512-M0RzbcI0sO/XJNucsGjvWU9ERWxb/ytp1w6dKtxTKgixdtQDq4rmx/g8W1hnaheq9jgwL/oyEdH5Bc4WwJKMqg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.6", - "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" - }, - "engines": { - "node": "^10 || ^12 || >=14" "node_modules/playwright": { "version": "1.43.0", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.43.0.tgz", @@ -10583,6 +10557,34 @@ "node": ">=16" } }, + "node_modules/postcss": { + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.7", + "picocolors": "^1.0.0", + "source-map-js": "^1.2.0" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, "node_modules/preferred-pm": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/preferred-pm/-/preferred-pm-3.0.3.tgz", @@ -11554,9 +11556,9 @@ } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "dev": true, "engines": { "node": ">=0.10.0" diff --git a/package.json b/package.json index 75ba48410..f04ec6fe0 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "homepage": "https://github.com/primer/primitives#readme", "scripts": { "build": "ts-node ./scripts/build.ts && tsc --project tsconfig.build.json", - "build:next": "npm run build:v8 && npm run build:fallbacks && npm run build:figma", + "build:next": "npm run build:v8 && npm run build:fallbacks && npm run build:figma && npm run build:intellisense", "build:v8": "ts-node ./scripts/buildTokens.ts", "build:fallbacks": "ts-node ./scripts/buildFallbacks.ts", "build:figma": "ts-node scripts/buildFigma.ts", @@ -63,12 +63,13 @@ "@github/prettier-config": "^0.0.6", "@playwright/test": "^1.43.0", "@types/flat": "^5.0.1", - "@types/glob": "^8.1.0", "@types/jest": "^29.5.2", + "@types/glob": "^8.1.0", + "@types/jest": "^29.5.2", "@types/lodash": "^4.14.195", "@types/node": "^20.4.0", "@typescript-eslint/eslint-plugin": "^5.61.0", "@typescript-eslint/parser": "^5.61.0", - "camelcase-keys": "^6.2.2", + "camelcase-keys": "^6.2.2", "color-blend": "^4.0.0", "color2k": "^2.0.0", "console-table-printer": "^2.11.1", diff --git a/scripts/createPropertyVariableMap.ts b/scripts/createPropertyVariableMap.ts index 708d40cfe..2894e351a 100644 --- a/scripts/createPropertyVariableMap.ts +++ b/scripts/createPropertyVariableMap.ts @@ -8,21 +8,20 @@ import postcss from 'postcss' import type {Properties} from 'csstype' import {flatten as flattenArray, uniqBy, kebabCase} from 'lodash' import {flatten as flattenObject} from 'flat' -import {getTokensByName} from '~/docs/storybook/stories/utilities/getTokensByName' +import {getTokensByName} from '../docs/storybook/stories/utilities/getTokensByName' import type StyleDictionary from 'style-dictionary' // stories -import functionalTypographyTokens from '~/dist/docs/functional/typography/typography.json' -import baseTypographyTokens from '~/dist/docs/base/typography/typography.json' -import functionalBorderTokens from '~/dist/docs/functional/size/border.json' -import functionalSizeTokens from '~/dist/docs/functional/size/size.json' -import functionalSizeFineTokens from '~/dist/docs/functional/size/size-fine.json' -import baseSizeTokens from '~/dist/docs/base/size/size.json' -import functionalColorTokens from '~/dist/docs/functional/themes/light.json' +import functionalTypographyTokens from '../dist/docs/functional/typography/typography.json' +import baseTypographyTokens from '../dist/docs/base/typography/typography.json' +import functionalBorderTokens from '../dist/docs/functional/size/border.json' +import functionalSizeTokens from '../dist/docs/functional/size/size.json' +import functionalSizeFineTokens from '../dist/docs/functional/size/size-fine.json' +import baseSizeTokens from '../dist/docs/base/size/size.json' +import functionalColorTokens from '../dist/docs/functional/themes/light.json' // path relative to script const tokensDirectory = path.join(__dirname, '../dist') - if (!fs.existsSync(tokensDirectory)) { // eslint-disable-next-line no-console console.log(`tokens not found at ${tokensDirectory}, please run this script after running build:next`) @@ -208,15 +207,16 @@ const logUnassignedVariables = () => { return unassigned } -const unusedVariables = logUnassignedVariables() +// TODO: re-enable this check and figure out why it was there +// const unusedVariables = logUnassignedVariables() -if (unusedVariables.length > 0) { - // eslint-disable-next-line no-console - console.log(`Found unused variables, failing build`) - // eslint-disable-next-line no-console - console.log(unusedVariables) - process.exit(1) -} +// if (unusedVariables.length > 0) { +// // eslint-disable-next-line no-console +// console.log(`Found unused variables, failing build`) +// // eslint-disable-next-line no-console +// console.log(unusedVariables) +// process.exit(1) +// } // it's better to be explicit than fuzzy match to avoid bad hints // for example, borderImage properties should not show border hints