@vitus-labs/tools-rollup 2.2.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/lib/scripts/build.js +5 -2
- package/lib/scripts/build.js.map +1 -1
- package/lib/types/scripts/build.d.ts.map +1 -1
- package/package.json +6 -7
- package/src/scripts/build.test.ts +1 -1
- package/src/scripts/build.ts +5 -2
- package/tsconfig.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 2.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#132](https://github.com/vitus-labs/tools/pull/132) [`fd69af8`](https://github.com/vitus-labs/tools/commit/fd69af88a779007c4697ad77620d7d6dfed18b81) Thanks [@vitbokisch](https://github.com/vitbokisch)! - Audit fixes — three proven issues, each measured and regression-tested.
|
|
8
|
+
|
|
9
|
+
**1. atlas: scanner N+1 `statSync` (perf)** — `listDirectories` called `statSync` once per directory entry. Now uses `readdirSync(base, { withFileTypes: true })` and only falls back to `statSync` for symbolic links (which `Dirent.isDirectory()` can't resolve). Measured on a 65-entry workspace: **65 → 5 syscalls (92% fewer)**, identical directory output including symlinked package dirs (regression-tested).
|
|
10
|
+
|
|
11
|
+
**2. rolldown: temp-dir leak on error path (resource leak)** — `buildDtsIsolated` removed its `__dts_tmp_*` directory only on the success path. If the DTS build or any post-processing step threw, the temp dir leaked into `lib/` and shipped in the published package (`files: ["lib"]`). Cleanup is now in a `finally` block. Proven by a test that fails on the old code (0 cleanup calls) and passes after.
|
|
12
|
+
|
|
13
|
+
**3. rolldown + rollup: drop the `rimraf` dependency** — both packages require Node ≥ 22, where the built-in `fs.rmSync(path, { recursive: true, force: true })` does exactly what `rimraf.sync` did. Removed `rimraf` as a direct dependency from both packages — one fewer runtime dependency and supply-chain surface, zero behavior change.
|
|
14
|
+
|
|
15
|
+
No memory leaks were found. Four separately-reported correctness concerns (depth-map inversion, cycle self-loop handling, bundle-size I/O, transitive-size dedup) were investigated and disproven by tracing the actual code — no changes made there.
|
|
16
|
+
|
|
17
|
+
- [#134](https://github.com/vitus-labs/tools/pull/134) [`0a8a65b`](https://github.com/vitus-labs/tools/commit/0a8a65bf010aed4944317fa2c6617ca30118769c) Thanks [@vitbokisch](https://github.com/vitbokisch)! - Update all dependencies to latest and bump CI actions.
|
|
18
|
+
|
|
19
|
+
**Runtime/dev deps**: rolldown 1.0.0-rc.17 → 1.0.1, rolldown-plugin-dts 0.23.2 → 0.25.1, rollup 4.60.2 → 4.60.4, ts-patch 3.3.0 → 4.0.1 (major — verified, no code changes needed), storybook 10.3.5 → 10.4, vite 8.0.10 → 8.0.13, next 16.2.4 → 16.2.6, @types/node 25.6 → 25.8, biome 2.4.13 → 2.4.15, vitest 4.1.5 → 4.1.6, react 19.2.5 → 19.2.6, `@vitus-labs/tools-lint` 1.15.5 → 2.3.0.
|
|
20
|
+
|
|
21
|
+
**zod held at `~4.3.6`** (was `^4.4.3` candidate): zod 4.4.x changed `ZodString`/`ZodEnum` internals so they no longer satisfy the MCP SDK's `AnySchema` type. `@modelcontextprotocol/sdk` is already at its latest (1.29.0) and its published types were built against zod 4.3.x. Pinned to `~4.3.6` (4.3.x patches allowed, 4.4 blocked) until the SDK ships zod-4.4-compatible types. Not a fixable-on-our-side rewrite — the incompatibility is entirely between two third-party packages' type definitions.
|
|
22
|
+
|
|
23
|
+
**Storybook peer ranges restored**: `bun update --latest` again narrowed `react`/`react-dom`/`react-native`/`react-native-web` peers; reverted to the intended wide ranges (`>=19`, `>=0.74`, `>=0.19`).
|
|
24
|
+
|
|
25
|
+
**CI actions**: setup-node v6.3.0 → v6.4.0, changesets/action v1.7.0 → v1.8.0, step-security/harden-runner v2.17.0 → v2.19.3, github/codeql-action v4.35.1 → v4.35.5 (all SHA-pinned).
|
|
26
|
+
|
|
27
|
+
Verified e2e: 565 tests pass, typecheck + lint clean across all 10 packages, all 10 packages build.
|
|
28
|
+
|
|
29
|
+
- Updated dependencies []:
|
|
30
|
+
- @vitus-labs/tools-core@2.3.1
|
|
31
|
+
|
|
32
|
+
## 2.3.0
|
|
33
|
+
|
|
34
|
+
### Patch Changes
|
|
35
|
+
|
|
36
|
+
- Updated dependencies []:
|
|
37
|
+
- @vitus-labs/tools-core@2.3.0
|
|
38
|
+
|
|
3
39
|
## 2.2.0
|
|
4
40
|
|
|
5
41
|
### Patch Changes
|
package/lib/scripts/build.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { rmSync } from 'node:fs';
|
|
1
2
|
import chalk from 'chalk';
|
|
2
|
-
import { rimraf } from 'rimraf';
|
|
3
3
|
import { rollup } from 'rollup';
|
|
4
4
|
import { CONFIG } from "../config/index.js";
|
|
5
5
|
import { createBuildPipeline, config as rollupConfig } from "../rollup/index.js";
|
|
@@ -45,7 +45,10 @@ const runBuild = async () => {
|
|
|
45
45
|
// (1) delete build folder first
|
|
46
46
|
// --------------------------------------------------------
|
|
47
47
|
log(`${chalk.bold.bgBlue.black('[1/4]')} ${chalk.blue('✂️ Cleaning up old build folder...')}`);
|
|
48
|
-
|
|
48
|
+
rmSync(`${process.cwd()}/${CONFIG.outputDir}`, {
|
|
49
|
+
recursive: true,
|
|
50
|
+
force: true,
|
|
51
|
+
});
|
|
49
52
|
log(`${chalk.bold.bgBlue.black('[2/4]')} ${chalk.blue('☑️ Old build removed')}`);
|
|
50
53
|
// --------------------------------------------------------
|
|
51
54
|
// (2) build
|
package/lib/scripts/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/scripts/build.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/scripts/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA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AuB,CAAC,EAAE,CAC7E,CAAA;IAED,2DAA2D;IAC3D,YAAY;IACZ,2DAA2D;IAC3D,GAAG,CACD,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,IAAI,CAC/C,kBAAkB,cAAc,qBAAqB,CACtD,EAAE,CACJ,CAAA;IAED,GAAG,CAAC,IAAI,CAAC,CAAA;IAET,MAAM,OAAO,CAAC,OAAO,EAAE;SACpB,IAAI,CAAC,GAAG,EAAE,CAAC,YAAY,EAAE,CAAC;SAC1B,IAAI,CAAC,GAAG,EAAE;QACT,GAAG,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;IACvE,CAAC,CAAC,CAAA;AACN,CAAC,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA","sourcesContent":["import { rmSync } from 'node:fs'\nimport chalk from 'chalk'\nimport { rollup } from 'rollup'\nimport { CONFIG } from '../config/index.ts'\nimport { createBuildPipeline, config as rollupConfig } from '../rollup/index.ts'\n\nconst { log } = console\nconst allBuilds = createBuildPipeline()\nconst allBuildsCount = allBuilds.length\n\nconst MODULE_TYPES: Record<string, string> = {\n cjs: 'CommonJS',\n es: 'ES Module',\n umd: 'UMD module',\n}\n\n// --------------------------------------------------------\n// BUILD rollup\n// --------------------------------------------------------\nasync function build({\n inputOptions,\n outputOptions,\n}: {\n inputOptions: any\n outputOptions: any\n}) {\n const bundle = await rollup(inputOptions)\n\n await bundle.write(outputOptions)\n}\n\n// --------------------------------------------------------\n// SERIALIZE ALL BUILDS\n// --------------------------------------------------------\nconst createBuilds = async () => {\n let p = Promise.resolve() // Q() in q\n\n // serialize builds\n allBuilds.forEach((item, i) => {\n const { output, ...input } = rollupConfig(item)\n const type = output.format\n\n p = p.then(() => {\n log(\n chalk.green(`🚧 Creating a build ${i + 1}/${allBuildsCount}`),\n chalk.gray(`(format: ${MODULE_TYPES[type]})`),\n )\n\n return build({ inputOptions: input, outputOptions: output }).catch(\n (e) => {\n log(\n `${chalk.bold.bgRed.white('⚠️ ERROR')} ${chalk.red(\n `Build ${i + 1}/${allBuildsCount} failed`,\n )}`,\n )\n log(chalk.gray(` Format: ${MODULE_TYPES[type]}`))\n log(chalk.gray(` File: ${output.file}`))\n log(e)\n throw e\n },\n )\n })\n })\n\n return p\n}\n\nconst runBuild = async () => {\n // --------------------------------------------------------\n // (1) delete build folder first\n // --------------------------------------------------------\n log(\n `${chalk.bold.bgBlue.black('[1/4]')} ${chalk.blue(\n '✂️ Cleaning up old build folder...',\n )}`,\n )\n\n rmSync(`${process.cwd()}/${CONFIG.outputDir}`, {\n recursive: true,\n force: true,\n })\n\n log(\n `${chalk.bold.bgBlue.black('[2/4]')} ${chalk.blue('☑️ Old build removed')}`,\n )\n\n // --------------------------------------------------------\n // (2) build\n // --------------------------------------------------------\n log(\n `${chalk.bold.bgBlue.black('[3/4]')} ${chalk.blue(\n `💪 Generating ${allBuildsCount} builds in total...`,\n )}`,\n )\n\n log('\\n')\n\n await Promise.resolve()\n .then(() => createBuilds())\n .then(() => {\n log(`${chalk.bold.bgBlue.black('[4/4]')} ${chalk.blue('🎉 Done!')}`)\n })\n}\n\nexport { runBuild }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/scripts/build.ts"],"names":[],"mappings":"AAmEA,QAAA,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../src/scripts/build.ts"],"names":[],"mappings":"AAmEA,QAAA,MAAM,QAAQ,qBAmCb,CAAA;AAED,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitus-labs/tools-rollup",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -42,26 +42,25 @@
|
|
|
42
42
|
"@rollup/plugin-replace": "^6.0.3",
|
|
43
43
|
"@rollup/plugin-terser": "^1.0.0",
|
|
44
44
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
45
|
-
"@types/node": "^25.
|
|
46
|
-
"@vitus-labs/tools-core": "^2.
|
|
45
|
+
"@types/node": "^25.8.0",
|
|
46
|
+
"@vitus-labs/tools-core": "^2.3.0",
|
|
47
47
|
"chalk": "^5.6.2",
|
|
48
48
|
"find-up": "^8.0.0",
|
|
49
49
|
"lodash-es": "^4.18.1",
|
|
50
|
-
"
|
|
51
|
-
"rollup": "^4.60.2",
|
|
50
|
+
"rollup": "^4.60.4",
|
|
52
51
|
"rollup-plugin-api-extractor": "^0.2.5",
|
|
53
52
|
"rollup-plugin-filesize": "^10.0.0",
|
|
54
53
|
"rollup-plugin-tsconfig-paths": "^1.5.2",
|
|
55
54
|
"rollup-plugin-typescript-paths": "^1.5.0",
|
|
56
55
|
"rollup-plugin-typescript2": "^0.37.0",
|
|
57
56
|
"rollup-plugin-visualizer": "^7.0.1",
|
|
58
|
-
"ts-patch": "^
|
|
57
|
+
"ts-patch": "^4.0.1",
|
|
59
58
|
"tslib": "^2.8.1",
|
|
60
59
|
"typescript-transform-paths": "^3.5.6"
|
|
61
60
|
},
|
|
62
61
|
"devDependencies": {
|
|
63
62
|
"@types/lodash-es": "^4.17.12",
|
|
64
|
-
"@vitus-labs/tools-typescript": "^2.
|
|
63
|
+
"@vitus-labs/tools-typescript": "^2.3.0",
|
|
65
64
|
"typescript": "^6.0.3"
|
|
66
65
|
}
|
|
67
66
|
}
|
package/src/scripts/build.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { rmSync } from 'node:fs'
|
|
1
2
|
import chalk from 'chalk'
|
|
2
|
-
import { rimraf } from 'rimraf'
|
|
3
3
|
import { rollup } from 'rollup'
|
|
4
4
|
import { CONFIG } from '../config/index.ts'
|
|
5
5
|
import { createBuildPipeline, config as rollupConfig } from '../rollup/index.ts'
|
|
@@ -75,7 +75,10 @@ const runBuild = async () => {
|
|
|
75
75
|
)}`,
|
|
76
76
|
)
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
rmSync(`${process.cwd()}/${CONFIG.outputDir}`, {
|
|
79
|
+
recursive: true,
|
|
80
|
+
force: true,
|
|
81
|
+
})
|
|
79
82
|
|
|
80
83
|
log(
|
|
81
84
|
`${chalk.bold.bgBlue.black('[2/4]')} ${chalk.blue('☑️ Old build removed')}`,
|
package/tsconfig.json
CHANGED