@knapsack/package-bundler 4.101.0--canary.8110.15bba7c.0
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/.lintstagedrc.mjs +11 -0
- package/INSTRUCTIONS-FOR-CUSTOMERS.md +130 -0
- package/dist/bundle.d.ts +41 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +348 -0
- package/dist/bundle.js.map +1 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +165 -0
- package/dist/cli.js.map +1 -0
- package/dist/errors.d.ts +63 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +155 -0
- package/dist/errors.js.map +1 -0
- package/dist/help-text.d.ts +16 -0
- package/dist/help-text.d.ts.map +1 -0
- package/dist/help-text.js +180 -0
- package/dist/help-text.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/log.d.ts +42 -0
- package/dist/log.d.ts.map +1 -0
- package/dist/log.js +114 -0
- package/dist/log.js.map +1 -0
- package/dist/metadata.d.ts +112 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +204 -0
- package/dist/metadata.js.map +1 -0
- package/dist/prompts.d.ts +54 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +125 -0
- package/dist/prompts.js.map +1 -0
- package/dist/resolve-entries.d.ts +56 -0
- package/dist/resolve-entries.d.ts.map +1 -0
- package/dist/resolve-entries.js +333 -0
- package/dist/resolve-entries.js.map +1 -0
- package/dist/resolve-source.d.ts +53 -0
- package/dist/resolve-source.d.ts.map +1 -0
- package/dist/resolve-source.js +174 -0
- package/dist/resolve-source.js.map +1 -0
- package/dist/run.d.ts +52 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +276 -0
- package/dist/run.js.map +1 -0
- package/dist/types.d.ts +67 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +62 -0
- package/dist/types.js.map +1 -0
- package/dist/vendor.d.ts +59 -0
- package/dist/vendor.d.ts.map +1 -0
- package/dist/vendor.js +134 -0
- package/dist/vendor.js.map +1 -0
- package/dist/verify-bundle.d.ts +59 -0
- package/dist/verify-bundle.d.ts.map +1 -0
- package/dist/verify-bundle.js +238 -0
- package/dist/verify-bundle.js.map +1 -0
- package/dist/write-output.d.ts +82 -0
- package/dist/write-output.d.ts.map +1 -0
- package/dist/write-output.js +214 -0
- package/dist/write-output.js.map +1 -0
- package/package.json +53 -0
- package/readme.md +127 -0
- package/tsconfig.json +9 -0
- package/tsconfig.test.json +13 -0
- package/vitest.config.ts +9 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { dirname } from 'node:path';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
|
|
4
|
+
import defaultConfig, { buildEslintCommand } from '../../.lintstagedrc.mjs';
|
|
5
|
+
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
'*.{ts,tsx,js,jsx,cjs,mjs,mts,cts}': buildEslintCommand(__dirname),
|
|
10
|
+
...defaultConfig,
|
|
11
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Sending us your design system
|
|
2
|
+
|
|
3
|
+
We'd like to run an evaluation against your design system. To do that we need it as
|
|
4
|
+
running code — but we don't want to ask you for registry credentials, and we don't want
|
|
5
|
+
to spend a week working out how your dependencies resolve.
|
|
6
|
+
|
|
7
|
+
So instead: you run one command, it produces a folder, you send us the folder. The
|
|
8
|
+
command bundles your already-built package together with everything it depends on, so
|
|
9
|
+
the result works on our machines without any access to your systems.
|
|
10
|
+
|
|
11
|
+
It takes a couple of minutes. Nothing gets installed permanently.
|
|
12
|
+
|
|
13
|
+
## Before you start
|
|
14
|
+
|
|
15
|
+
You'll need:
|
|
16
|
+
|
|
17
|
+
- **Node.js 20 or newer.** Check with `node --version`.
|
|
18
|
+
- **Your package, already built.** Run your normal build first (usually
|
|
19
|
+
`npm run build`). This tool bundles compiled output — it deliberately does not
|
|
20
|
+
compile your source, so whatever you'd publish to npm is what we want.
|
|
21
|
+
|
|
22
|
+
That's it. No account, no login, no configuration.
|
|
23
|
+
|
|
24
|
+
## Run it
|
|
25
|
+
|
|
26
|
+
From inside your package directory — the folder with `package.json` in it:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npx @knapsack/package-bundler
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
It will ask you where to save the output and confirm what it's about to bundle. The
|
|
33
|
+
defaults are fine; press Enter through them.
|
|
34
|
+
|
|
35
|
+
If your design system lives in a monorepo, point at the specific package:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx @knapsack/package-bundler ./packages/design-system
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Or, if it's already published somewhere we can't reach, you can bundle straight from
|
|
42
|
+
your registry (make sure you're logged in first):
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx @knapsack/package-bundler @your-scope/design-system@1.2.3
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## What you'll get
|
|
49
|
+
|
|
50
|
+
A folder — by default in your `Downloads` — named something like
|
|
51
|
+
`ks-bundle--your-design-system--1.2.3--2026-09-09T14-22-31-004Z`. Inside:
|
|
52
|
+
|
|
53
|
+
| File | What it is |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `bundle/` | Your package, with its dependencies folded in |
|
|
56
|
+
| `README.md` | A plain-language summary of what was bundled and what wasn't |
|
|
57
|
+
| `bundle-metadata.json` | The same information in machine-readable form |
|
|
58
|
+
| `package.original.json` | Your `package.json`, copied verbatim |
|
|
59
|
+
| `build-log.txt` | Everything the tool printed, including any warnings |
|
|
60
|
+
|
|
61
|
+
**Please read the `README.md` in that folder before sending it.** The most important
|
|
62
|
+
line says whether the bundle is self-contained. The tool checks this itself, in a
|
|
63
|
+
scratch directory with no dependencies available, so it either confirms the bundle is
|
|
64
|
+
complete or tells you exactly what's missing.
|
|
65
|
+
|
|
66
|
+
Then zip the folder and send it back the same way you received these instructions.
|
|
67
|
+
|
|
68
|
+
## A note on peer dependencies
|
|
69
|
+
|
|
70
|
+
If your design system lists React or Vue as a peer dependency, the bundle will
|
|
71
|
+
deliberately **not** include it. That's correct — we supply the framework on our side,
|
|
72
|
+
and shipping a second copy inside the bundle would break things. The `README.md` lists
|
|
73
|
+
exactly which packages we need to provide and at which versions.
|
|
74
|
+
|
|
75
|
+
## What the tool sends us
|
|
76
|
+
|
|
77
|
+
While it runs, the tool reports whether it succeeded and, if it failed, which error it
|
|
78
|
+
hit — plus the tool version, your Node version, and your operating system. This is so we
|
|
79
|
+
can fix problems you run into.
|
|
80
|
+
|
|
81
|
+
It does **not** send your source code, your file contents, your package name, your
|
|
82
|
+
dependency list, or anything from inside the bundle. Nothing leaves your machine except
|
|
83
|
+
the folder you choose to send us.
|
|
84
|
+
|
|
85
|
+
To turn reporting off entirely:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npx @knapsack/package-bundler --no-telemetry
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Setting `KS_TELEMETRY=no` or `DO_NOT_TRACK=1` in your environment does the same thing.
|
|
92
|
+
|
|
93
|
+
## If something goes wrong
|
|
94
|
+
|
|
95
|
+
Every failure prints a code and what to do about it. Here are the ones you're most
|
|
96
|
+
likely to see. For the complete list, run `npx @knapsack/package-bundler --help`.
|
|
97
|
+
|
|
98
|
+
**`ERR_NOT_BUILT`** — your package declares entry points but the files aren't there.
|
|
99
|
+
Run your build (`npm run build`) and try again. This is the most common one, and it
|
|
100
|
+
usually just means the build hasn't run in this checkout yet.
|
|
101
|
+
|
|
102
|
+
**`ERR_NOT_SELF_CONTAINED`** — the bundle would still depend on packages that won't
|
|
103
|
+
exist on our machines. The error names them. Nearly always this means those packages
|
|
104
|
+
aren't installed locally, so run `npm install` (or `pnpm install` / `yarn`) and try
|
|
105
|
+
again. If a named package genuinely can't be bundled — native binaries are the usual
|
|
106
|
+
culprit — add `--external <package-name>` and the tool will copy its real files into the
|
|
107
|
+
bundle instead.
|
|
108
|
+
|
|
109
|
+
**`ERR_NO_PACKAGE`** — the tool didn't find a `package.json`. Check you're in the right
|
|
110
|
+
directory, or pass the path: `npx @knapsack/package-bundler ./path/to/package`.
|
|
111
|
+
|
|
112
|
+
**`ERR_NPM_RESOLVE`** — the package couldn't be fetched from your registry. Check the
|
|
113
|
+
name and version, and that you're authenticated (`npm whoami`).
|
|
114
|
+
|
|
115
|
+
**Anything else** — re-run with `--verbose` and send us the output along with
|
|
116
|
+
`build-log.txt`. That's usually enough for us to tell you what to do next.
|
|
117
|
+
|
|
118
|
+
## Getting more detail
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
npx @knapsack/package-bundler --help
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
The help text covers every option, has worked examples, and lists every error code with
|
|
125
|
+
its recovery steps.
|
|
126
|
+
|
|
127
|
+
## Questions
|
|
128
|
+
|
|
129
|
+
Reply to whoever sent you this. If the tool failed, including the `build-log.txt` from
|
|
130
|
+
the output folder will get you a much faster answer.
|
package/dist/bundle.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Vite build.
|
|
3
|
+
*
|
|
4
|
+
* Nearly every option here overrides a Vite default that would otherwise produce a
|
|
5
|
+
* wrong bundle *without failing*. The comments say which, because a future reader
|
|
6
|
+
* deleting one of these will get a green build and a broken artifact.
|
|
7
|
+
*/
|
|
8
|
+
import type { BundleWarning, EntryPoint } from './types.js';
|
|
9
|
+
/** An import Rollup actually emitted into a chunk. */
|
|
10
|
+
export interface EmittedImport {
|
|
11
|
+
readonly specifier: string;
|
|
12
|
+
/** Chunk file name, relative to the output directory. */
|
|
13
|
+
readonly chunk: string;
|
|
14
|
+
readonly dynamic: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface BundleResult {
|
|
17
|
+
readonly warnings: readonly BundleWarning[];
|
|
18
|
+
/** True when any input module carried a `"use client"` directive. */
|
|
19
|
+
readonly hadUseClientDirective: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Every import left in the output, as reported by Rollup.
|
|
22
|
+
*
|
|
23
|
+
* Taken from `generateBundle` rather than by scanning the emitted text. Text scanning
|
|
24
|
+
* cannot tell an import from a comment that looks like one, and real dependencies are
|
|
25
|
+
* full of `@import {Node} from 'unist'` JSDoc and `@example` blocks — which produced
|
|
26
|
+
* false "leaked dependency" failures on bundles that were in fact correct.
|
|
27
|
+
*/
|
|
28
|
+
readonly emittedImports: readonly EmittedImport[];
|
|
29
|
+
}
|
|
30
|
+
/** Pull the owning package name out of a resolved module path. */
|
|
31
|
+
export declare function packageNameFromModuleId(id: string): string | undefined;
|
|
32
|
+
export declare function bundlePackage({ pkgDir, entries, outDir, externals, treeshake, verbose, }: {
|
|
33
|
+
pkgDir: string;
|
|
34
|
+
entries: readonly EntryPoint[];
|
|
35
|
+
outDir: string;
|
|
36
|
+
/** Package names to leave out of the bundle. */
|
|
37
|
+
externals: readonly string[];
|
|
38
|
+
treeshake: 'safe' | 'none';
|
|
39
|
+
verbose: boolean;
|
|
40
|
+
}): Promise<BundleResult>;
|
|
41
|
+
//# sourceMappingURL=bundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAmC5D,sDAAsD;AACtD,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,SAAS,aAAa,EAAE,CAAC;IAC5C,qEAAqE;IACrE,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;IACxC;;;;;;;OAOG;IACH,QAAQ,CAAC,cAAc,EAAE,SAAS,aAAa,EAAE,CAAC;CACnD;AAwCD,kEAAkE;AAClE,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAQtE;AAuJD,wBAAsB,aAAa,CAAC,EAClC,MAAM,EACN,OAAO,EACP,MAAM,EACN,SAAS,EACT,SAAS,EACT,OAAO,GACR,EAAE;IACD,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IAC7B,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;CAClB,GAAG,OAAO,CAAC,YAAY,CAAC,CAyIxB"}
|
package/dist/bundle.js
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Vite build.
|
|
3
|
+
*
|
|
4
|
+
* Nearly every option here overrides a Vite default that would otherwise produce a
|
|
5
|
+
* wrong bundle *without failing*. The comments say which, because a future reader
|
|
6
|
+
* deleting one of these will get a green build and a broken artifact.
|
|
7
|
+
*/
|
|
8
|
+
import { mkdtempSync } from 'node:fs';
|
|
9
|
+
import { createRequire, isBuiltin } from 'node:module';
|
|
10
|
+
import { tmpdir } from 'node:os';
|
|
11
|
+
import { join } from 'node:path';
|
|
12
|
+
import { build } from 'vite';
|
|
13
|
+
import { BundlerError, ERROR_CODES } from './errors.js';
|
|
14
|
+
/**
|
|
15
|
+
* Supplies the CJS globals that bundled CommonJS dependencies expect to find but which
|
|
16
|
+
* do not exist in an ESM module. Same shim as `apps/api/lambdas-for-tf/tsup.config.cjs`.
|
|
17
|
+
*
|
|
18
|
+
* The `require` binding here is also what a surviving dynamic `require()` binds to (see
|
|
19
|
+
* `ignoreDynamicRequires`), which is why it resolves relative to the output file.
|
|
20
|
+
*/
|
|
21
|
+
const CJS_SHIM = [
|
|
22
|
+
"import { createRequire as __ksCreateRequire } from 'node:module';",
|
|
23
|
+
"import { fileURLToPath as __ksFileURLToPath } from 'node:url';",
|
|
24
|
+
"import { dirname as __ksDirname } from 'node:path';",
|
|
25
|
+
'const require = __ksCreateRequire(import.meta.url);',
|
|
26
|
+
'const __filename = __ksFileURLToPath(import.meta.url);',
|
|
27
|
+
'const __dirname = __ksDirname(__filename);',
|
|
28
|
+
].join('\n');
|
|
29
|
+
/**
|
|
30
|
+
* Keeps everything observable while still dropping statically unreachable code.
|
|
31
|
+
*
|
|
32
|
+
* Turning treeshaking off entirely is worse for fidelity, not better: Rollup then calls
|
|
33
|
+
* `includeAllInBundle()` on every loaded module, which drags in dead branches like
|
|
34
|
+
* `if (process.platform === 'win32') require('./win-binding')`. Those then have to
|
|
35
|
+
* resolve at build time or execute at runtime on a platform they were never meant for.
|
|
36
|
+
*/
|
|
37
|
+
const CONSERVATIVE_TREESHAKE = {
|
|
38
|
+
moduleSideEffects: true,
|
|
39
|
+
annotations: false,
|
|
40
|
+
propertyReadSideEffects: true,
|
|
41
|
+
tryCatchDeoptimization: true,
|
|
42
|
+
unknownGlobalSideEffects: true,
|
|
43
|
+
correctVarValueBeforeDeclaration: true,
|
|
44
|
+
};
|
|
45
|
+
/** Signals in dependency source that mean "this will not survive being inlined". */
|
|
46
|
+
const HAZARD_PATTERNS = [
|
|
47
|
+
{
|
|
48
|
+
code: 'DYNAMIC_REQUIRE',
|
|
49
|
+
// require(<anything that isn't a literal string>)
|
|
50
|
+
pattern: /\brequire\s*\(\s*(?!['"`])/,
|
|
51
|
+
message: 'uses a dynamic require() whose target cannot be determined at build time',
|
|
52
|
+
hint: 'If this module misbehaves at runtime, exclude its package with --external <package> to ship it as real files instead.',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
code: 'REQUIRE_RESOLVE',
|
|
56
|
+
pattern: /\brequire\.resolve\s*\(/,
|
|
57
|
+
message: 'calls require.resolve(), which will resolve relative to the bundle rather than to its own package',
|
|
58
|
+
hint: 'If it resolves a file inside its own package, exclude it with --external <package>.',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
code: 'DIRNAME_FILE_READ',
|
|
62
|
+
pattern: /(readFileSync|readFile|createReadStream)\s*\([^)]*__dirname/,
|
|
63
|
+
message: 'reads a file relative to its own directory, which the bundle will not contain',
|
|
64
|
+
hint: 'Exclude its package with --external <package> so its files are copied alongside the bundle.',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
code: 'WORKER_THREAD',
|
|
68
|
+
pattern: /new\s+Worker\s*\(/,
|
|
69
|
+
message: 'starts a worker thread from a separate entry file, which is a module graph the bundler cannot follow',
|
|
70
|
+
hint: 'Exclude its package with --external <package>.',
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
/** Pull the owning package name out of a resolved module path. */
|
|
74
|
+
export function packageNameFromModuleId(id) {
|
|
75
|
+
const marker = '/node_modules/';
|
|
76
|
+
const index = id.lastIndexOf(marker);
|
|
77
|
+
if (index === -1)
|
|
78
|
+
return undefined;
|
|
79
|
+
const rest = id.slice(index + marker.length);
|
|
80
|
+
const segments = rest.split('/');
|
|
81
|
+
if (segments[0]?.startsWith('@'))
|
|
82
|
+
return `${segments[0]}/${segments[1]}`;
|
|
83
|
+
return segments[0];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Watches modules as they enter the graph and flags the ones that historically do not
|
|
87
|
+
* survive inlining. Runs during the build rather than as a scan of `node_modules`, so we
|
|
88
|
+
* only report packages actually reachable from the entry points.
|
|
89
|
+
*/
|
|
90
|
+
function createHazardPlugin({ onWarning, onUseClient, }) {
|
|
91
|
+
const reported = new Set();
|
|
92
|
+
return {
|
|
93
|
+
name: 'ks-detect-hazards',
|
|
94
|
+
enforce: 'pre',
|
|
95
|
+
transform(code, id) {
|
|
96
|
+
if (id.includes('\0'))
|
|
97
|
+
return null;
|
|
98
|
+
if (/^\s*['"]use client['"]/.test(code))
|
|
99
|
+
onUseClient();
|
|
100
|
+
for (const hazard of HAZARD_PATTERNS) {
|
|
101
|
+
if (!hazard.pattern.test(code))
|
|
102
|
+
continue;
|
|
103
|
+
const pkgName = packageNameFromModuleId(id);
|
|
104
|
+
// One report per package per hazard; a big dep would otherwise emit hundreds.
|
|
105
|
+
const key = `${hazard.code}:${pkgName ?? id}`;
|
|
106
|
+
if (reported.has(key))
|
|
107
|
+
continue;
|
|
108
|
+
reported.add(key);
|
|
109
|
+
onWarning({
|
|
110
|
+
code: hazard.code,
|
|
111
|
+
message: `${pkgName ?? 'The package'} ${hazard.message}.`,
|
|
112
|
+
module: id,
|
|
113
|
+
hint: hazard.hint,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Resolve bare imports that Vite gives up on, using Node's own algorithm.
|
|
122
|
+
*
|
|
123
|
+
* This closes the gap that makes the whole approach risky. Vite's SSR resolution is
|
|
124
|
+
* stricter than Node's: it misses legacy layouts like directory imports
|
|
125
|
+
* (`date-fns/locale/eo` -> `.../eo/index.js`) and packages without an `exports` map. When
|
|
126
|
+
* it misses one it does not error — it marks the import external, on the assumption
|
|
127
|
+
* Node will resolve it at runtime. For a bundle meant to run with no `node_modules`
|
|
128
|
+
* that assumption is exactly wrong, and the build still reports success.
|
|
129
|
+
*
|
|
130
|
+
* So: let Vite resolve first, and only step in when it either failed or externalized
|
|
131
|
+
* something we never asked to be external. Because `this.resolve` runs the rest of the
|
|
132
|
+
* pipeline, Vite keeps ownership of every case it handles correctly, and there is
|
|
133
|
+
* exactly one resolution per specifier — no risk of pulling a package in twice through
|
|
134
|
+
* two different conditions.
|
|
135
|
+
*/
|
|
136
|
+
function createFallbackResolverPlugin({ isIntentionallyExternal, onWarning, }) {
|
|
137
|
+
const rescued = new Set();
|
|
138
|
+
return {
|
|
139
|
+
name: 'ks-fallback-resolver',
|
|
140
|
+
// Must be 'pre' to be asked before Vite's own resolver, which would otherwise
|
|
141
|
+
// return `{ external: true }` first and win — Rollup takes the first non-null
|
|
142
|
+
// result. Delegating via `this.resolve` below still gives Vite the first real
|
|
143
|
+
// attempt, so ordering here costs nothing.
|
|
144
|
+
enforce: 'pre',
|
|
145
|
+
async resolveId(source, importer, options) {
|
|
146
|
+
if (!importer)
|
|
147
|
+
return null;
|
|
148
|
+
if (source.startsWith('.') ||
|
|
149
|
+
source.startsWith('/') ||
|
|
150
|
+
source.includes('\0')) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
if (isBuiltin(source))
|
|
154
|
+
return null;
|
|
155
|
+
if (isIntentionallyExternal(source))
|
|
156
|
+
return null;
|
|
157
|
+
const resolved = await this.resolve(source, importer, {
|
|
158
|
+
...options,
|
|
159
|
+
skipSelf: true,
|
|
160
|
+
});
|
|
161
|
+
if (resolved && !resolved.external)
|
|
162
|
+
return resolved;
|
|
163
|
+
try {
|
|
164
|
+
const resolvedPath = createRequire(importer).resolve(source);
|
|
165
|
+
if (!rescued.has(source)) {
|
|
166
|
+
rescued.add(source);
|
|
167
|
+
onWarning({
|
|
168
|
+
code: 'RESOLVED_BY_FALLBACK',
|
|
169
|
+
message: `Vite could not resolve "${source}"; used Node's resolver instead so it stays inlined.`,
|
|
170
|
+
module: importer,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
return resolvedPath;
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
// Genuinely unresolvable. Leave it — the verification step reports it with
|
|
177
|
+
// the full list rather than failing here on the first one.
|
|
178
|
+
return resolved;
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Record what each emitted chunk imports, straight from Rollup's own bundle model.
|
|
185
|
+
*
|
|
186
|
+
* `chunk.imports` is the resolved truth about a chunk's external dependencies — the
|
|
187
|
+
* specifiers Rollup wrote into the file because it could not or would not inline them.
|
|
188
|
+
*/
|
|
189
|
+
function createImportCollectorPlugin({ onCollect, }) {
|
|
190
|
+
return {
|
|
191
|
+
name: 'ks-collect-emitted-imports',
|
|
192
|
+
generateBundle(_options, bundle) {
|
|
193
|
+
// `chunk.imports` mixes two kinds of entry: names of other files in this bundle
|
|
194
|
+
// (internal, and fine) and specifiers Rollup left for the runtime to resolve
|
|
195
|
+
// (external, and what we care about). Only the emitted file names appear as keys
|
|
196
|
+
// of `bundle`, which is an exact way to tell them apart — much better than
|
|
197
|
+
// guessing from the shape of the string.
|
|
198
|
+
const emittedFileNames = new Set(Object.keys(bundle));
|
|
199
|
+
const collected = [];
|
|
200
|
+
for (const [fileName, output] of Object.entries(bundle)) {
|
|
201
|
+
if (output.type !== 'chunk')
|
|
202
|
+
continue;
|
|
203
|
+
for (const specifier of output.imports) {
|
|
204
|
+
if (emittedFileNames.has(specifier))
|
|
205
|
+
continue;
|
|
206
|
+
collected.push({ specifier, chunk: fileName, dynamic: false });
|
|
207
|
+
}
|
|
208
|
+
for (const specifier of output.dynamicImports) {
|
|
209
|
+
if (emittedFileNames.has(specifier))
|
|
210
|
+
continue;
|
|
211
|
+
collected.push({ specifier, chunk: fileName, dynamic: true });
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
onCollect(collected);
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
export async function bundlePackage({ pkgDir, entries, outDir, externals, treeshake, verbose, }) {
|
|
219
|
+
const warnings = [];
|
|
220
|
+
let hadUseClientDirective = false;
|
|
221
|
+
let emittedImports = [];
|
|
222
|
+
const entryMap = Object.fromEntries(entries.map((entry) => [entry.name, entry.sourceFile]));
|
|
223
|
+
// Subpath imports of an external package (`lodash/merge`) must be externalised too,
|
|
224
|
+
// but Vite's `ssr.external` is an exact-string match. Regexes only work in
|
|
225
|
+
// `rollupOptions.external`, so the prefix matching lives there.
|
|
226
|
+
const externalPattern = externals.length > 0
|
|
227
|
+
? new RegExp(`^(${externals.map((name) => name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|')})(/|$)`)
|
|
228
|
+
: undefined;
|
|
229
|
+
try {
|
|
230
|
+
await build({
|
|
231
|
+
root: pkgDir,
|
|
232
|
+
// These go in Vite's own `plugins`, not `build.rollupOptions.plugins`: `enforce`
|
|
233
|
+
// is a Vite concept and is ignored on raw Rollup plugins. Both of these depend on
|
|
234
|
+
// running before Vite's core plugins — the resolver to be asked before Vite's
|
|
235
|
+
// resolve returns `external`, the hazard scanner to see original source before
|
|
236
|
+
// the CommonJS transform rewrites it.
|
|
237
|
+
plugins: [
|
|
238
|
+
createFallbackResolverPlugin({
|
|
239
|
+
isIntentionallyExternal: (source) => externalPattern ? externalPattern.test(source) : false,
|
|
240
|
+
onWarning: (warning) => warnings.push(warning),
|
|
241
|
+
}),
|
|
242
|
+
createHazardPlugin({
|
|
243
|
+
onWarning: (warning) => warnings.push(warning),
|
|
244
|
+
onUseClient: () => {
|
|
245
|
+
hadUseClientDirective = true;
|
|
246
|
+
},
|
|
247
|
+
}),
|
|
248
|
+
createImportCollectorPlugin({
|
|
249
|
+
onCollect: (imports) => {
|
|
250
|
+
emittedImports = imports;
|
|
251
|
+
},
|
|
252
|
+
}),
|
|
253
|
+
],
|
|
254
|
+
// Without this Vite loads the *target* package's vite.config and builds something
|
|
255
|
+
// other than what we asked for.
|
|
256
|
+
configFile: false,
|
|
257
|
+
// Without this it reads the target's .env into import.meta.env.
|
|
258
|
+
envFile: false,
|
|
259
|
+
logLevel: verbose ? 'info' : 'warn',
|
|
260
|
+
// Default is `<pkgDir>/node_modules/.vite` — we are a read-only consumer of the
|
|
261
|
+
// input and must not write into someone else's package.
|
|
262
|
+
cacheDir: mkdtempSync(join(tmpdir(), 'ks-package-bundler-cache-')),
|
|
263
|
+
build: {
|
|
264
|
+
outDir,
|
|
265
|
+
emptyOutDir: true,
|
|
266
|
+
minify: false,
|
|
267
|
+
sourcemap: true,
|
|
268
|
+
// 'esnext' skips a pointless esbuild re-parse of already-built input.
|
|
269
|
+
target: 'esnext',
|
|
270
|
+
ssr: true,
|
|
271
|
+
// DEFAULT false. Without it every CSS file and asset is deleted from the bundle
|
|
272
|
+
// — silently, which for a design system means shipping unstyled components.
|
|
273
|
+
ssrEmitAssets: true,
|
|
274
|
+
// DEFAULT true; would sweep the target's public/ folder into our output.
|
|
275
|
+
copyPublicDir: false,
|
|
276
|
+
lib: { entry: entryMap, formats: ['es'] },
|
|
277
|
+
commonjsOptions: {
|
|
278
|
+
// DEFAULT [/node_modules/]. pnpm resolves workspace packages to real paths
|
|
279
|
+
// outside node_modules, so the default silently skips transforming their CJS
|
|
280
|
+
// and Rollup then treats `module.exports` as an undeclared global.
|
|
281
|
+
include: [/.*/],
|
|
282
|
+
extensions: ['.js', '.cjs'],
|
|
283
|
+
transformMixedEsModules: true,
|
|
284
|
+
// DEFAULT false, and the default is dangerous: every `require(<expr>)` in
|
|
285
|
+
// every bundled dependency gets rewritten into a stub whose body throws.
|
|
286
|
+
// Nothing fails at build time; it crashes later, on whichever code path
|
|
287
|
+
// reaches it. With this on, the call survives and binds to the shim's
|
|
288
|
+
// `require` above.
|
|
289
|
+
ignoreDynamicRequires: true,
|
|
290
|
+
},
|
|
291
|
+
rollupOptions: {
|
|
292
|
+
treeshake: treeshake === 'none' ? false : CONSERVATIVE_TREESHAKE,
|
|
293
|
+
...(externalPattern ? { external: externalPattern } : {}),
|
|
294
|
+
output: {
|
|
295
|
+
banner: CJS_SHIM,
|
|
296
|
+
// SSR mode ignores `lib.fileName`, so pin the names here or the extensions
|
|
297
|
+
// desync from the `type` we write into the output package.json.
|
|
298
|
+
entryFileNames: '[name].mjs',
|
|
299
|
+
chunkFileNames: 'chunks/[name]-[hash].mjs',
|
|
300
|
+
assetFileNames: 'assets/[name][extname]',
|
|
301
|
+
},
|
|
302
|
+
onLog(level, log, defaultHandler) {
|
|
303
|
+
// "use client" cannot survive collapsing many modules into one chunk. We
|
|
304
|
+
// hoist a single directive onto the output instead, so the per-module
|
|
305
|
+
// warnings are noise.
|
|
306
|
+
if (log.code === 'MODULE_LEVEL_DIRECTIVE')
|
|
307
|
+
return;
|
|
308
|
+
// Circular imports are normal in real dependency graphs and Rollup handles
|
|
309
|
+
// them; reporting each one buries the warnings that matter.
|
|
310
|
+
if (log.code === 'CIRCULAR_DEPENDENCY')
|
|
311
|
+
return;
|
|
312
|
+
if (level === 'warn') {
|
|
313
|
+
warnings.push({
|
|
314
|
+
code: log.code ?? 'ROLLUP_WARNING',
|
|
315
|
+
message: log.message,
|
|
316
|
+
module: log.id,
|
|
317
|
+
});
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
defaultHandler(level, log);
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
ssr: {
|
|
325
|
+
target: 'node',
|
|
326
|
+
// The whole point: nothing is externalized unless it is in `ssr.external`.
|
|
327
|
+
noExternal: true,
|
|
328
|
+
external: [...externals],
|
|
329
|
+
// These belong under `ssr.resolve` — a top-level `resolve.conditions` is
|
|
330
|
+
// explicitly stripped for non-client environments and would do nothing.
|
|
331
|
+
// Note `require` is deliberately absent: Vite appends import/require per
|
|
332
|
+
// importer already, and forcing both can pull one package into the graph twice
|
|
333
|
+
// with two copies of its module state.
|
|
334
|
+
resolve: { conditions: ['module', 'node', 'development|production'] },
|
|
335
|
+
},
|
|
336
|
+
});
|
|
337
|
+
}
|
|
338
|
+
catch (error) {
|
|
339
|
+
throw new BundlerError({
|
|
340
|
+
code: ERROR_CODES.ERR_BUILD_FAILED,
|
|
341
|
+
message: 'Vite could not bundle this package.',
|
|
342
|
+
details: [error instanceof Error ? error.message : String(error)],
|
|
343
|
+
cause: error,
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
return { warnings, hadUseClientDirective, emittedImports };
|
|
347
|
+
}
|
|
348
|
+
//# sourceMappingURL=bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.js","sourceRoot":"","sources":["../src/bundle.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,KAAK,EAA4B,MAAM,MAAM,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGxD;;;;;;GAMG;AACH,MAAM,QAAQ,GAAG;IACf,mEAAmE;IACnE,gEAAgE;IAChE,qDAAqD;IACrD,qDAAqD;IACrD,wDAAwD;IACxD,4CAA4C;CAC7C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEb;;;;;;;GAOG;AACH,MAAM,sBAAsB,GAAG;IAC7B,iBAAiB,EAAE,IAAI;IACvB,WAAW,EAAE,KAAK;IAClB,uBAAuB,EAAE,IAAI;IAC7B,sBAAsB,EAAE,IAAI;IAC5B,wBAAwB,EAAE,IAAI;IAC9B,gCAAgC,EAAE,IAAI;CACM,CAAC;AAyB/C,oFAAoF;AACpF,MAAM,eAAe,GAKf;IACJ;QACE,IAAI,EAAE,iBAAiB;QACvB,kDAAkD;QAClD,OAAO,EAAE,4BAA4B;QACrC,OAAO,EACL,0EAA0E;QAC5E,IAAI,EAAE,uHAAuH;KAC9H;IACD;QACE,IAAI,EAAE,iBAAiB;QACvB,OAAO,EAAE,yBAAyB;QAClC,OAAO,EACL,mGAAmG;QACrG,IAAI,EAAE,qFAAqF;KAC5F;IACD;QACE,I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