Skip to content

Commit fff2dc7

Browse files
chore(build): remove redundant build:types step (#1636)
## Summary `rollup-plugin-typescript2` already emits all `.d.ts` files into `dist/typings/` as part of the standard Rollup build. The separate `build:types` step added in #1574 produces identical output, making it redundant. Also improves the `verify-types` CI job to use `npm pack --dry-run` which directly catches the failure mode from #1573 (typings missing from published package) rather than just checking local file existence. ## Changes - Remove `build:types` script from `package.json` - Simplify `prepack` to `npm run build` only - Delete `tsconfig.types.json` (no longer referenced) - Update `verify-types` CI job to verify typings are included in the published package via `npm pack --dry-run` ## Test plan - [x] `npm run build` generates 44 `.d.ts` files in `dist/typings/` - [x] `npm pack --dry-run` shows 44 typings files included in package - [x] All 998 unit tests pass
1 parent 1c90d6a commit fff2dc7

3 files changed

Lines changed: 6 additions & 17 deletions

File tree

.github/workflows/test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,11 @@ jobs:
9999
path: .
100100
key: ${{ env.CACHE_KEY }}
101101

102-
- name: Generate type declarations
103-
run: npm run build:types
102+
- name: Verify type declarations
103+
run: |
104+
count=$(npm pack --dry-run 2>&1 | grep -c "dist/typings/" || true)
105+
echo "Found $count typings files in package"
106+
test "$count" -gt 0 || { echo "typings not included in package!"; exit 1; }
104107
105108
gatsby:
106109
needs: test

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"start": "npm run dev",
3434
"docs": "typedoc --options ./typedoc.js src",
3535
"build": "rimraf dist && rollup -m -c --environment NODE_ENV:production && npm run test:es-check",
36-
"build:types": "tsc --project tsconfig.types.json",
3736
"build:stats": "rimraf dist && rollup -m -c --environment NODE_ENV:production --environment WITH_STATS:true && npm run test:es-check && open bundle-stats/index.html",
3837
"lint": "eslint --ext .jsx,.js src/",
3938
"lint:security": "eslint ./src --ext ts --no-eslintrc --config ./.eslintrc.security",
@@ -51,7 +50,7 @@
5150
"serve:coverage": "serve coverage/lcov-report -n",
5251
"serve:stats": "serve bundle-stats -n",
5352
"print-bundle-size": "node ./scripts/print-bundle-size.mjs",
54-
"prepack": "npm run build && npm run build:types",
53+
"prepack": "npm run build",
5554
"publish:cdn": "ccu --trace"
5655
},
5756
"devDependencies": {

tsconfig.types.json

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)