Skip to content

Commit 9f3451d

Browse files
markwhitfeldclaude
andauthored
fix(build): simplify package build pipeline and fix windows pipeline issue (#2458)
* build: stop emitting .d.ts for schematics Schematics ship as Angular CLI generators executed as runtime JavaScript; their TypeScript types are not part of the public API surface. Up to now the schematics tsconfig was emitting per-source `.d.ts` files, which the postbuild had to strip from the build output before publish. Flip declaration to false in both tsconfig.schematics.json files so the files are never emitted in the first place. Net effect on the published tarball is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * build: drop rollup-based .d.ts flattening postbuild ng-packagr 20.x already emits a single flattened `.d.ts` per entry point, so `rollup-plugin-dts` has nothing left to bundle (running it against the current output only reorders named-import members on one line). With the previous commit stopping schematics `.d.ts` emission, `remove-dts.mjs` also has nothing left to clean up. The remove-dts step additionally carried a Windows-only path-separator bug: `path.resolve` returns backslash paths while `glob.sync` returns forward-slash paths, so the entry-point filter never matched on Windows and every flattened entry-point d.ts was deleted along with the rest. The bug went undetected because publishes ran from Linux CI. Remove `yarn rollup -c rollup.config.mjs && node ./build/remove-dts.mjs` from the postbuild script, delete the rollup config and the two helper scripts, and drop the now-unused rollup / rollup-plugin-dts devDeps. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * build: exclude jest snapshot artifacts from schematics output The storage-plugin schematics source contains a jest snapshot at `schematics/src/ng-generate/__snapshots__/keys-migration.spec.ts.snap` that lives alongside the spec file for the snapshot mechanism. The file-copy step in build-schematics.mjs only filtered out `.ts` source files, so the snapshot artifact was being copied into the publishable output and shipped on npm. Filter `.snap` files and `__snapshots__` directories out of the copy. Store schematics output is unaffected (its source has no jest snapshots). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * chore: update changelog --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent f62a3bf commit 9f3451d

9 files changed

Lines changed: 16 additions & 70 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ $ npm install @ngxs/store@dev
3131
- Fix(storage-plugin): Guard against environments that do not provide `ngServerMode` [#2400](https://github.com/ngxs/store/pull/2400)
3232
- Fix(storage-plugin): Improve dependency ranges for security fixes [#2404](https://github.com/ngxs/store/pull/2404)
3333
- Fix(storage-plugin): Treat missing version key as 0 when matching migrations [#2422](https://github.com/ngxs/store/pull/2422)
34-
- Build: use trusted npm publishing for provenance signed builds [#2454](https://github.com/ngxs/store/pull/2454)
34+
- Build: Simplify package build pipeline and fix windows pipeline issue [#2458](https://github.com/ngxs/store/pull/2458)
35+
- Build: Use trusted npm publishing for provenance signed builds [#2454](https://github.com/ngxs/store/pull/2454)
3536

3637
### 21.0.0 2025-12-17
3738

build/collect-dts.mjs

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

build/remove-dts.mjs

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

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"serve:integration:ssr": "node dist-integration/server/server.mjs",
7474
"// - BUILDING": "Run Apps in dev and with packaged modules",
7575
"build": "yarn build:packages",
76-
"postbuild": "yarn rollup -c rollup.config.mjs && node ./build/remove-dts.mjs && node ./build/copy-license.mjs",
76+
"postbuild": "node ./build/copy-license.mjs",
7777
"build:packages": "yarn nx run-many --target=build --all && ts-node tools/set-metadata",
7878
"// - INTEGRATION BUILDS": "#requires yarn build",
7979
"build:integration": "nx build integration -c production",
@@ -159,8 +159,6 @@
159159
"npm-run-all": "^4.1.5",
160160
"nx": "22.7.5",
161161
"prettier": "3.2.5",
162-
"rollup": "^4",
163-
"rollup-plugin-dts": "^6.1.0",
164162
"rxjs": "^7.4.0",
165163
"serve": "^14.2.5",
166164
"start-server-and-test": "^3.0.11",

packages/storage-plugin/tsconfig.schematics.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"baseUrl": ".",
44
"lib": ["es2018", "dom"],
5-
"declaration": true,
5+
"declaration": false,
66
"module": "commonjs",
77
"moduleResolution": "node",
88
"noEmitOnError": true,

packages/store/tsconfig.schematics.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"baseUrl": ".",
44
"lib": ["es2018", "dom"],
5-
"declaration": true,
5+
"declaration": false,
66
"module": "commonjs",
77
"moduleResolution": "node",
88
"noEmitOnError": true,

rollup.config.mjs

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

tools/build-schematics.mjs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import yargs from 'yargs';
2-
import { join } from 'path';
2+
import { basename, join } from 'path';
33
import { execSync } from 'child_process';
44
import fse from 'fs-extra';
55

@@ -21,10 +21,15 @@ console.log(`Running "${cmd}"`);
2121
execSync(cmd, { stdio: 'inherit' });
2222

2323
fse.copySync(schematicsSrc, join(distPath, 'schematics', 'src'), src => {
24-
// skip not compiled files
24+
// TypeScript sources are compiled separately by tsc above.
2525
if (src.endsWith('.ts')) {
2626
return false;
2727
}
28+
// Jest snapshot artifacts live alongside spec files in source but must
29+
// never ship in the published package.
30+
if (src.endsWith('.snap') || basename(src) === '__snapshots__') {
31+
return false;
32+
}
2833
return true;
2934
});
3035

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9301,7 +9301,7 @@ hasown@2.0.2, hasown@^2.0.2:
93019301
dependencies:
93029302
function-bind "^1.1.2"
93039303

9304-
hasown@^2.0.3, hasown@^2.0.4:
9304+
hasown@^2.0.3:
93059305
version "2.0.4"
93069306
resolved "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz#8c62d8cb90beb2aad5d0a5b67581ad9854c3f003"
93079307
integrity sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==
@@ -11772,7 +11772,7 @@ mime-types@2.1.18:
1177211772
dependencies:
1177311773
mime-db "~1.33.0"
1177411774

11775-
mime-types@2.1.35, mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@^2.1.35, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34:
11775+
mime-types@2.1.35, mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34:
1177611776
version "2.1.35"
1177711777
resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a"
1177811778
integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==
@@ -13869,7 +13869,7 @@ rimraf@^3.0.2:
1386913869
dependencies:
1387013870
glob "^7.1.3"
1387113871

13872-
rollup-plugin-dts@^6.1.0, rollup-plugin-dts@^6.2.0:
13872+
rollup-plugin-dts@^6.2.0:
1387313873
version "6.2.1"
1387413874
resolved "https://registry.npmjs.org/rollup-plugin-dts/-/rollup-plugin-dts-6.2.1.tgz#120a40734f740115da44931d7915a370fe420701"
1387513875
integrity sha512-sR3CxYUl7i2CHa0O7bA45mCrgADyAQ0tVtGSqi3yvH28M+eg1+g5d7kQ9hLvEz5dorK3XVsH5L2jwHLQf72DzA==
@@ -13912,7 +13912,7 @@ rollup@4.59.0:
1391213912
"@rollup/rollup-win32-x64-msvc" "4.59.0"
1391313913
fsevents "~2.3.2"
1391413914

13915-
rollup@^4, rollup@^4.24.0:
13915+
rollup@^4.24.0:
1391613916
version "4.61.1"
1391713917
resolved "https://registry.npmjs.org/rollup/-/rollup-4.61.1.tgz#4a053204912e9083e51cb3a0bf02ffdc397264fb"
1391813918
integrity sha512-I4KW6iuRpuu2uHBLraZ1wNZe0DP7lnRha+VJ9tNaYVaVgKhW0aI3h4RYnoRPeql0flHm/Co55b7snEDcOfOJrA==

0 commit comments

Comments
 (0)