Skip to content

Commit a349dc7

Browse files
convert build config to js (#1032)
1 parent 56ba227 commit a349dc7

File tree

4 files changed

+36
-5
lines changed

4 files changed

+36
-5
lines changed

.changeset/wicked-yaks-hear.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@primer/primitives': minor
3+
---
4+
5+
Move build files from src to dist/build and add complied version

buildConfig.tsconfig.jsonc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"compilerOptions": {
3+
"jsx": "react",
4+
"target": "ES2016",
5+
"module": "commonjs",
6+
"lib": ["ESNext", "dom"],
7+
"moduleResolution": "node",
8+
"esModuleInterop": true,
9+
"strict": true,
10+
"noImplicitAny": true,
11+
"skipLibCheck": false,
12+
"typeRoots": ["./src/@types", "./node_modules/", "./node_modules/@types", "types"],
13+
"types": ["vitest/globals"],
14+
"rootDir": "./src",
15+
"outDir": "./dist/build",
16+
"declaration": true,
17+
"resolveJsonModule": true,
18+
"baseUrl": ".",
19+
"paths": {
20+
"~/*": ["*"],
21+
// workaround for: https://github.com/vitest-dev/vitest/issues/4567
22+
"rollup/parseAst": ["./node_modules/rollup/dist/parseAst"]
23+
}
24+
},
25+
"include": ["src/**/*.ts"],
26+
"exclude": ["./src/@types", "**/*.test.ts", "src/test-utilities/*.ts", "vitest.config.ts"]
27+
}

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
"node": ">=18.18.0 <18.19.0"
77
},
88
"files": [
9-
"dist",
10-
"src/**/*",
11-
"!src/**/*.test.ts"
9+
"dist"
1210
],
1311
"repository": "https://github.com/primer/primitives",
1412
"keywords": [
@@ -26,11 +24,12 @@
2624
},
2725
"homepage": "https://github.com/primer/primitives#readme",
2826
"scripts": {
29-
"build": "npm run build:v8 && npm run build:fallbacks && npm run build:figma",
27+
"build": "npm run build:v8 && npm run build:fallbacks && npm run build:figma && npm run build:config",
3028
"build:next": "echo '\\033[31m 🛑 Use npm run build instead of npm run build:next\\033[0m'",
3129
"build:v8": "tsx ./scripts/buildTokens.ts",
3230
"build:fallbacks": "tsx ./scripts/buildFallbacks.ts",
3331
"build:figma": "tsx scripts/buildFigma.ts",
32+
"build:config": "tsc -p buildConfig.tsconfig.jsonc",
3433
"tokenJson:check": "tsx scripts/diffThemes.ts && tsx scripts/diffTokenProps.ts",
3534
"contrast:check": "tsx scripts/color-contrast.ts",
3635
"format": "prettier --write '**/*.{js,jsx,ts,tsx,md,mdx,css}'",

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"esModuleInterop": true,
99
"strict": true,
1010
"noImplicitAny": true,
11-
"typeRoots": ["./src/@types", "./node_modules/", "./node_modules/@types", "types", "config/types/"],
11+
"typeRoots": ["./src/@types", "./node_modules/", "./node_modules/@types", "types"],
1212
"types": ["vitest/globals"],
1313
"rootDir": "./",
1414
"declaration": true,

0 commit comments

Comments
 (0)