Skip to content

Commit

Permalink
convert build config to js (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasoppermann committed Aug 29, 2024
1 parent 56ba227 commit a349dc7
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-yaks-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/primitives': minor
---

Move build files from src to dist/build and add complied version
27 changes: 27 additions & 0 deletions buildConfig.tsconfig.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"compilerOptions": {
"jsx": "react",
"target": "ES2016",
"module": "commonjs",
"lib": ["ESNext", "dom"],
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"noImplicitAny": true,
"skipLibCheck": false,
"typeRoots": ["./src/@types", "./node_modules/", "./node_modules/@types", "types"],
"types": ["vitest/globals"],
"rootDir": "./src",
"outDir": "./dist/build",
"declaration": true,
"resolveJsonModule": true,
"baseUrl": ".",
"paths": {
"~/*": ["*"],
// workaround for: https://github.com/vitest-dev/vitest/issues/4567
"rollup/parseAst": ["./node_modules/rollup/dist/parseAst"]
}
},
"include": ["src/**/*.ts"],
"exclude": ["./src/@types", "**/*.test.ts", "src/test-utilities/*.ts", "vitest.config.ts"]
}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
"node": ">=18.18.0 <18.19.0"
},
"files": [
"dist",
"src/**/*",
"!src/**/*.test.ts"
"dist"
],
"repository": "https://github.com/primer/primitives",
"keywords": [
Expand All @@ -26,11 +24,12 @@
},
"homepage": "https://github.com/primer/primitives#readme",
"scripts": {
"build": "npm run build:v8 && npm run build:fallbacks && npm run build:figma",
"build": "npm run build:v8 && npm run build:fallbacks && npm run build:figma && npm run build:config",
"build:next": "echo '\\033[31m 🛑 Use npm run build instead of npm run build:next\\033[0m'",
"build:v8": "tsx ./scripts/buildTokens.ts",
"build:fallbacks": "tsx ./scripts/buildFallbacks.ts",
"build:figma": "tsx scripts/buildFigma.ts",
"build:config": "tsc -p buildConfig.tsconfig.jsonc",
"tokenJson:check": "tsx scripts/diffThemes.ts && tsx scripts/diffTokenProps.ts",
"contrast:check": "tsx scripts/color-contrast.ts",
"format": "prettier --write '**/*.{js,jsx,ts,tsx,md,mdx,css}'",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"esModuleInterop": true,
"strict": true,
"noImplicitAny": true,
"typeRoots": ["./src/@types", "./node_modules/", "./node_modules/@types", "types", "config/types/"],
"typeRoots": ["./src/@types", "./node_modules/", "./node_modules/@types", "types"],
"types": ["vitest/globals"],
"rootDir": "./",
"declaration": true,
Expand Down

0 comments on commit a349dc7

Please sign in to comment.