@williamthorsen/nmr 0.15.0 → 0.17.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.
Files changed (41) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +43 -54
  3. package/dist/esm/.cache +1 -1
  4. package/dist/esm/cli-build.js +5 -4
  5. package/dist/esm/cli-ensure-prepublish-hooks.js +37 -56
  6. package/dist/esm/cli-report-overrides.js +7 -5
  7. package/dist/esm/cli-sync-agent-files.js +19 -28
  8. package/dist/esm/cli-sync-pnpm-version.js +7 -5
  9. package/dist/esm/cli.js +13 -13
  10. package/dist/esm/commands/build.d.ts +2 -8
  11. package/dist/esm/commands/build.js +270 -118
  12. package/dist/esm/commands/ensure-prepublish-hooks.js +66 -69
  13. package/dist/esm/commands/report-overrides.js +10 -13
  14. package/dist/esm/commands/sync-agent-files.js +46 -52
  15. package/dist/esm/commands/sync-pnpm-version.js +35 -42
  16. package/dist/esm/config.js +59 -57
  17. package/dist/esm/context.d.ts +1 -1
  18. package/dist/esm/context.js +70 -72
  19. package/dist/esm/default-scripts.js +63 -67
  20. package/dist/esm/help.d.ts +1 -1
  21. package/dist/esm/help.js +65 -68
  22. package/dist/esm/helpers/code-quality-pnpm-action.js +20 -24
  23. package/dist/esm/helpers/hook-name.js +2 -5
  24. package/dist/esm/helpers/package-json.js +46 -41
  25. package/dist/esm/helpers/type-guards.js +2 -5
  26. package/dist/esm/index.d.ts +3 -3
  27. package/dist/esm/index.js +1 -4
  28. package/dist/esm/resolve-scripts.d.ts +2 -2
  29. package/dist/esm/resolve-scripts.js +7 -11
  30. package/dist/esm/resolver.d.ts +3 -2
  31. package/dist/esm/resolver.js +85 -83
  32. package/dist/esm/runCli.js +135 -145
  33. package/dist/esm/runner.js +35 -34
  34. package/dist/esm/scripts.d.ts +2 -2
  35. package/dist/esm/scripts.js +1 -5
  36. package/dist/esm/tests/consistency.d.ts +1 -1
  37. package/dist/esm/tests/consistency.js +45 -54
  38. package/dist/esm/tests/helpers/get-runtime-version-from-asdf.js +11 -14
  39. package/dist/esm/tests/helpers/get-string-from-yaml-file.js +10 -13
  40. package/dist/esm/tests/helpers/get-value-at-path.js +30 -30
  41. package/package.json +5 -3
package/AGENTS.md CHANGED
@@ -38,7 +38,7 @@ Some root scripts (e.g. `lint`, `typecheck`, `test`) expand to `nmr root:X && pn
38
38
 
39
39
  ## Managed build
40
40
 
41
- The default `compile` script runs `nmr-compile`, a standalone bin that esbuild-compiles a package's `src` to `dist/esm`, rewriting `~/` (package-root) import aliases and `.ts`→`.js` specifiers, and skipping work when inputs are unchanged. There is no repo-local build script to maintain; `nmr build` runs `compile` then `generate-typings`. To find or debug the build, look to `nmr-compile`, not a `config/build.ts` in the consuming repo.
41
+ The default `compile` script runs `nmr-compile`, a standalone bin that uses the TypeScript compiler API to emit a package's `src` to `dist/esm` as `.js` and `.d.ts` in one pass, rewriting relative `.ts`→`.js` specifiers and tsconfig `paths` aliases in both outputs, and skipping work when inputs are unchanged. `typescript` is a peer dependency (`>=5.7.0`). There is no repo-local build script to maintain, and no separate typings step; `nmr build` runs `compile` alone. To find or debug the build, look to `nmr-compile`, not a `config/build.ts` in the consuming repo.
42
42
 
43
43
  ## Override behaviors
44
44
 
package/README.md CHANGED
@@ -3,27 +3,13 @@
3
3
  Context-aware script runner for PNPM monorepos. Ships an `nmr` (node-monorepo run) binary that provides centralized, consistent script execution across workspace packages and the monorepo root.
4
4
 
5
5
  <!-- section:release-notes -->
6
- ## Release notes — v0.15.0 (2026-06-27)
6
+ ## Release notes — v0.17.0 (2026-07-01)
7
7
 
8
8
  ### 🎉 Features
9
9
 
10
- - Centralize the per-package build as an nmr-compile bin (#419)
10
+ - 🚨 **Breaking:** Rebuild nmr-compile on a unified tsc emit (#455)
11
11
 
12
- Introduces `nmr-compile`, a single command shipped with `@williamthorsen/nmr` that compiles each workspace package and now backs the default build. Consuming repos can delete their own per-package build script and pick up future build fixes just by upgrading nmr. Repeated builds with unchanged source now reliably skip recompiling instead of occasionally rebuilding for no reason, and import aliases now resolve correctly in symlinked checkouts.
13
-
14
- ### 🐛 Bug fixes
15
-
16
- - Write the build cache only after a successful compile (#421)
17
-
18
- Fixes an issue where a package compile that failed partway — from a crash, disk error, or transient build failure — could leave stale or incomplete output that the next build skipped over as unchanged. The next build now retries the failed compile, so recovering no longer requires a manual `nmr clean` or a source-file edit.
19
-
20
- - Stop sync-agent-files --check failing on version-only bumps (#424)
21
-
22
- Fixes an issue where `nmr sync-agent-files --check` failed after an nmr upgrade even when the managed agent guidance was identical. The check now passes whenever the guidance content is current, even if the version has changed.
23
-
24
- - Remove inapplicable bootstrap fallback from agent guidance (#425)
25
-
26
- Fixes an issue where the agent guidance bundled with nmr told coding agents to run a recovery step that exists only in the nmr repo itself.
12
+ `nmr` now compiles a package's JavaScript and type declarations in one step, rewriting every import form — static, re-export, dynamic `import()`, bare side-effect, and tsconfig `paths` aliases — to runnable `.js` in both outputs. It now requires TypeScript 5.7 or newer as a peer dependency.
27
13
  <!-- /section:release-notes -->
28
14
 
29
15
  ## Installation
@@ -40,7 +26,7 @@ From a package directory:
40
26
 
41
27
  ```bash
42
28
  nmr test # Run tests for the current package
43
- nmr build # Compile + generate typings
29
+ nmr build # Compile to .js and .d.ts in one pass
44
30
  nmr check # Typecheck, format check, lint check, and tests
45
31
  ```
46
32
 
@@ -83,11 +69,11 @@ Scripts resolve through three tiers. Higher tiers override lower ones:
83
69
 
84
70
  Given the `build` command for a package that defines its own build script:
85
71
 
86
- | Tier | Source | Value | Wins? |
87
- | ---- | ----------------------- | --------------------------------- | ----- |
88
- | 1 | Built-in default | `['compile', 'generate-typings']` | — |
89
- | 2 | `.config/nmr.config.ts` | _(not set)_ | — |
90
- | 3 | `package.json` scripts | `"tsx custom-build.ts"` | ✓ |
72
+ | Tier | Source | Value | Wins? |
73
+ | ---- | ----------------------- | ----------------------- | ----- |
74
+ | 1 | Built-in default | `['compile']` | — |
75
+ | 2 | `.config/nmr.config.ts` | _(not set)_ | — |
76
+ | 3 | `package.json` scripts | `"tsx custom-build.ts"` | ✓ |
91
77
 
92
78
  If no per-package override exists, the highest-tier value that is set wins. Set a script to `""` in `package.json` to skip it for that package.
93
79
 
@@ -98,8 +84,8 @@ If no per-package override exists, the highest-tier value that is set wins. Set
98
84
  Script values can be `string` or `string[]`. Arrays expand to chained `nmr` sub-invocations:
99
85
 
100
86
  ```ts
101
- // "build": ["compile", "generate-typings"]
102
- // expands to: nmr compile && nmr generate-typings
87
+ // "fix": ["lint", "fmt"]
88
+ // expands to: nmr lint && nmr fmt
103
89
  ```
104
90
 
105
91
  ## Configuration
@@ -153,34 +139,35 @@ These scripts are available out of the box. Repo-wide config (tier 2) and per-pa
153
139
 
154
140
  ### Workspace scripts
155
141
 
156
- | Command | Runs |
157
- | ------------------ | -------------------------------------------------------- |
158
- | `build` | `compile`, `generate-typings` |
159
- | `check` | `typecheck`, `fmt:check`, `lint:check`, `test` |
160
- | `check:strict` | `typecheck`, `fmt:check`, `lint:strict`, `test:coverage` |
161
- | `clean` | `pnpm exec rimraf dist/*` |
162
- | `compile` | `nmr-compile` |
163
- | `fix` | `lint`, `fmt` |
164
- | `fix:check` | `fmt:check`, `lint:check` |
165
- | `fmt` | `prettier --list-different --write .` |
166
- | `fmt:check` | `prettier --check .` |
167
- | `generate-typings` | `tsc --project tsconfig.generate-typings.json` |
168
- | `lint` | `eslint --fix .` |
169
- | `lint:check` | `eslint .` |
170
- | `lint:strict` | `strict-lint` |
171
- | `test` | `pnpm exec vitest` |
172
- | `test:coverage` | `pnpm exec vitest --coverage` |
173
- | `test:watch` | `pnpm exec vitest --watch` |
174
- | `typecheck` | `tsgo --noEmit` |
175
- | `view-coverage` | `open coverage/index.html` |
142
+ | Command | Runs |
143
+ | --------------- | ---------------------------------------------------------------- |
144
+ | `attw` | `attw --pack --profile esm-only` |
145
+ | `build` | `compile` |
146
+ | `check` | `typecheck`, `fmt:check`, `lint:check`, `test` |
147
+ | `check:strict` | `typecheck`, `fmt:check`, `lint:strict`, `test:coverage`, `attw` |
148
+ | `clean` | `pnpm exec rimraf dist/*` |
149
+ | `compile` | `nmr-compile` |
150
+ | `fix` | `lint`, `fmt` |
151
+ | `fix:check` | `fmt:check`, `lint:check` |
152
+ | `fmt` | `prettier --list-different --write .` |
153
+ | `fmt:check` | `prettier --check .` |
154
+ | `lint` | `eslint --fix .` |
155
+ | `lint:check` | `eslint .` |
156
+ | `lint:strict` | `strict-lint` |
157
+ | `test` | `pnpm exec vitest` |
158
+ | `test:coverage` | `pnpm exec vitest --coverage` |
159
+ | `test:watch` | `pnpm exec vitest --watch` |
160
+ | `typecheck` | `tsgo --noEmit` |
161
+ | `view-coverage` | `open coverage/index.html` |
176
162
 
177
163
  #### Integration test variant
178
164
 
179
- Packages with a `vitest.integration.config.ts` file get different test commands. Use the `--int-test` flag to select this variant.
165
+ A package gets this variant automatically when it contains a `vitest.integration.config.ts` file: `test` and `test:coverage` run the standalone (non-integration) suite, and integration tests run only when invoked explicitly. Activation is detected per package, so it applies under the recursive `nmr ci` fan-out. Opting in requires **both** `vitest.integration.config.ts` and `vitest.standalone.config.ts`, since the standalone scripts reference the latter.
180
166
 
181
167
  | Command | Runs |
182
168
  | ------------------ | ------------------------------------------------------------------ |
183
169
  | `test` | `pnpm exec vitest --config=vitest.standalone.config.ts` |
170
+ | `test:all` | `pnpm exec vitest` |
184
171
  | `test:coverage` | `pnpm exec vitest --config=vitest.standalone.config.ts --coverage` |
185
172
  | `test:integration` | `pnpm exec vitest --config=vitest.integration.config.ts` |
186
173
  | `test:watch` | `pnpm exec vitest --config=vitest.standalone.config.ts --watch` |
@@ -197,11 +184,12 @@ Packages with a `vitest.integration.config.ts` file get different test commands.
197
184
 
198
185
  #### Check and quality
199
186
 
200
- | Command | Runs |
201
- | ------------------- | ----------------------------------------------------------------------------- |
202
- | `check` | `typecheck`, `fmt:check`, `lint:check`, `test` |
203
- | `check:agent-files` | `nmr-sync-agent-files --check` |
204
- | `check:strict` | `typecheck`, `fmt:check`, `lint:strict`, `test:coverage`, `check:agent-files` |
187
+ | Command | Runs |
188
+ | ------------------- | ------------------------------------------------------------------------------------- |
189
+ | `attw` | `pnpm --recursive exec nmr attw` |
190
+ | `check` | `typecheck`, `fmt:check`, `lint:check`, `test` |
191
+ | `check:agent-files` | `nmr-sync-agent-files --check` |
192
+ | `check:strict` | `typecheck`, `fmt:check`, `lint:strict`, `test:coverage`, `attw`, `check:agent-files` |
205
193
 
206
194
  #### Fix
207
195
 
@@ -294,14 +282,13 @@ nmr [flags] <command> [args...]
294
282
  | `-q, --quiet` | Suppress info messages; show full output on failure | — |
295
283
  | `-?, --help` | Show available commands | — |
296
284
  | `-V, --version` | Show version number | — |
297
- | `--int-test` | Use integration test scripts | — |
298
285
 
299
286
  ### Examples
300
287
 
301
288
  ```bash
302
289
  # From a package directory
303
290
  nmr test # Run workspace test script
304
- nmr build # Compile + generate typings
291
+ nmr build # Compile to .js and .d.ts in one pass
305
292
 
306
293
  # From the monorepo root
307
294
  nmr test # Root tests + recursive workspace tests
@@ -358,7 +345,9 @@ nmr sync-pnpm-version
358
345
 
359
346
  ### `nmr-compile`
360
347
 
361
- Compile a single package's `src` tree to `dist/esm` with esbuild. Rewrites `~/` (package-root) import aliases and `.ts`→`.js` specifiers to match the emitted output, and skips the build when no input has changed (a content-and-path hash is cached in `dist/esm/.cache`). This is the default `compile` script — run it from a package directory.
348
+ Compile a single package's `src` tree to `dist/esm` with the TypeScript compiler API, emitting `.js` and `.d.ts` in one pass. Because the compiler parses each source file, every relative import form — static, re-export, dynamic `import()`, and bare side-effect — is rewritten from `.ts` to `.js` in both outputs, and `.ts` occurrences inside strings and comments are left intact. tsconfig `paths` aliases are resolved to runnable relative `.js` specifiers in both outputs, sourced from the package's tsconfig. The build is skipped when no input has changed (a content-and-path hash is cached in `dist/esm/.cache`). This is the default `compile` script — run it from a package directory.
349
+
350
+ `typescript` is a peer dependency (`>=5.7.0`, required for `rewriteRelativeImportExtensions`); the consuming repo provides it. Relative imports in source must carry explicit `.ts` extensions for them to be rewritten.
362
351
 
363
352
  ```bash
364
353
  nmr-compile
package/dist/esm/.cache CHANGED
@@ -1 +1 @@
1
- d2f01850cfe4f42bf00cb8b8eaf3d3fab438916c419957842d927d22fb9d67cf
1
+ 49f79592247d14646b1445473aa445a8bcbeafb478c6dc9949eb31cee8e2a627
@@ -1,7 +1,8 @@
1
1
  import { buildPackage } from "./commands/build.js";
2
2
  try {
3
- await buildPackage(process.cwd());
4
- } catch (error) {
5
- console.error(error instanceof Error ? error.message : String(error));
6
- process.exit(1);
3
+ await buildPackage(process.cwd());
4
+ }
5
+ catch (error) {
6
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
7
+ process.exitCode = 1;
7
8
  }
@@ -1,62 +1,43 @@
1
+ import { parseArgsOrExit, reportError } from '@williamthorsen/nmr-core';
1
2
  import { DEFAULT_HOOK, ensurePrepublishHooks } from "./commands/ensure-prepublish-hooks.js";
2
3
  import { findMonorepoRoot } from "./context.js";
3
- let fix = false;
4
- let dryRun = false;
5
- let command;
6
- const args = process.argv.slice(2);
7
- for (let i = 0; i < args.length; i++) {
8
- const arg = args[i];
9
- switch (arg) {
10
- case "--fix":
11
- fix = true;
12
- break;
13
- case "--dry-run":
14
- dryRun = true;
15
- break;
16
- case "--command":
17
- i++;
18
- command = args[i];
19
- if (!command) {
20
- console.error("--command requires a value");
21
- process.exit(1);
22
- }
23
- break;
24
- default:
25
- console.error(`Unknown argument: ${arg}`);
26
- process.exit(1);
27
- }
28
- }
4
+ const flagSchema = {
5
+ fix: { long: '--fix', type: 'boolean' },
6
+ dryRun: { long: '--dry-run', type: 'boolean' },
7
+ command: { long: '--command', type: 'string' },
8
+ };
9
+ const { fix, dryRun, command } = parseArgsOrExit(process.argv.slice(2), flagSchema).flags;
29
10
  try {
30
- const monorepoRoot = findMonorepoRoot();
31
- const hookCommand = command ?? DEFAULT_HOOK;
32
- const options = command ? { fix, dryRun, command } : { fix, dryRun };
33
- const result = ensurePrepublishHooks(monorepoRoot, options);
34
- for (const pkg of result.packages) {
35
- if (pkg.isPrivate) {
36
- continue;
11
+ const monorepoRoot = findMonorepoRoot();
12
+ const hookCommand = command ?? DEFAULT_HOOK;
13
+ const options = command ? { fix, dryRun, command } : { fix, dryRun };
14
+ const result = ensurePrepublishHooks(monorepoRoot, options);
15
+ for (const pkg of result.packages) {
16
+ if (pkg.isPrivate) {
17
+ continue;
18
+ }
19
+ switch (pkg.action) {
20
+ case 'ok':
21
+ console.info(`✓ ${pkg.packageName}: prepublishOnly = "${pkg.prepublishOnly}"`);
22
+ break;
23
+ case 'missing':
24
+ console.warn(`✗ ${pkg.packageName}: missing prepublishOnly`);
25
+ break;
26
+ case 'fixed':
27
+ console.info(`✓ ${pkg.packageName}: added prepublishOnly = "${hookCommand}"`);
28
+ break;
29
+ case 'would-fix':
30
+ console.info(`~ ${pkg.packageName}: would add prepublishOnly = "${hookCommand}"`);
31
+ break;
32
+ }
37
33
  }
38
- switch (pkg.action) {
39
- case "ok":
40
- console.info(`\u2713 ${pkg.packageName}: prepublishOnly = "${pkg.prepublishOnly}"`);
41
- break;
42
- case "missing":
43
- console.warn(`\u2717 ${pkg.packageName}: missing prepublishOnly`);
44
- break;
45
- case "fixed":
46
- console.info(`\u2713 ${pkg.packageName}: added prepublishOnly = "${hookCommand}"`);
47
- break;
48
- case "would-fix":
49
- console.info(`~ ${pkg.packageName}: would add prepublishOnly = "${hookCommand}"`);
50
- break;
34
+ if (result.hasFailures) {
35
+ const missing = result.packages.filter((p) => p.action === 'missing').length;
36
+ process.stderr.write(`\n${missing} package(s) missing prepublishOnly. Use --fix to add it.\n`);
37
+ process.exitCode = 1;
51
38
  }
52
- }
53
- if (result.hasFailures) {
54
- const missing = result.packages.filter((p) => p.action === "missing").length;
55
- console.error(`
56
- ${missing} package(s) missing prepublishOnly. Use --fix to add it.`);
57
- process.exit(1);
58
- }
59
- } catch (error) {
60
- console.error(error instanceof Error ? error.message : String(error));
61
- process.exit(1);
39
+ }
40
+ catch (error) {
41
+ reportError(error instanceof Error ? error.message : String(error));
42
+ process.exitCode = 1;
62
43
  }
@@ -1,9 +1,11 @@
1
+ import { reportError } from '@williamthorsen/nmr-core';
1
2
  import { reportOverrides } from "./commands/report-overrides.js";
2
3
  import { findMonorepoRoot } from "./context.js";
3
4
  try {
4
- const monorepoRoot = findMonorepoRoot();
5
- reportOverrides(monorepoRoot);
6
- } catch (error) {
7
- console.error(error instanceof Error ? error.message : String(error));
8
- process.exit(1);
5
+ const monorepoRoot = findMonorepoRoot();
6
+ reportOverrides(monorepoRoot);
7
+ }
8
+ catch (error) {
9
+ reportError(error instanceof Error ? error.message : String(error));
10
+ process.exitCode = 1;
9
11
  }
@@ -1,38 +1,29 @@
1
- import { parseArgs, translateParseError } from "@williamthorsen/nmr-core";
1
+ import { parseArgsOrExit, reportError } from '@williamthorsen/nmr-core';
2
2
  import { check, sync } from "./commands/sync-agent-files.js";
3
3
  import { findMonorepoRoot } from "./context.js";
4
4
  const flagSchema = {
5
- check: { long: "--check", type: "boolean" }
5
+ check: { long: '--check', type: 'boolean' },
6
6
  };
7
- const { flags } = parseArgsOrExit(process.argv.slice(2));
7
+ const { flags } = parseArgsOrExit(process.argv.slice(2), flagSchema);
8
8
  try {
9
- runCommand(flags.check);
10
- } catch (error) {
11
- console.error(error instanceof Error ? error.message : String(error));
12
- process.exit(1);
9
+ runCommand(flags.check);
13
10
  }
14
- function parseArgsOrExit(argv) {
15
- try {
16
- return parseArgs(argv, flagSchema);
17
- } catch (error) {
18
- console.error(`Error: ${translateParseError(error)}`);
11
+ catch (error) {
12
+ reportError(error instanceof Error ? error.message : String(error));
19
13
  process.exit(1);
20
- }
21
14
  }
22
15
  function runCommand(checkOnly) {
23
- const monorepoRoot = findMonorepoRoot();
24
- if (!checkOnly) {
25
- const { path: destinationPath, packageSpecifier, changed } = sync(monorepoRoot);
26
- console.info(
27
- changed ? `\u2713 Wrote ${destinationPath} (${packageSpecifier})` : `\u2713 ${destinationPath} already up to date`
28
- );
29
- process.exit(0);
30
- }
31
- const result = check(monorepoRoot);
32
- if (result.ok) {
33
- console.info("\u2713 .agents/nmr/AGENTS.md is in sync");
34
- process.exit(0);
35
- }
36
- console.error(result.reason);
37
- process.exit(1);
16
+ const monorepoRoot = findMonorepoRoot();
17
+ if (!checkOnly) {
18
+ const { path: destinationPath, packageSpecifier, changed } = sync(monorepoRoot);
19
+ console.info(changed ? `✓ Wrote ${destinationPath} (${packageSpecifier})` : `✓ ${destinationPath} already up to date`);
20
+ process.exit(0);
21
+ }
22
+ const result = check(monorepoRoot);
23
+ if (result.ok) {
24
+ console.info('✓ .agents/nmr/AGENTS.md is in sync');
25
+ process.exit(0);
26
+ }
27
+ process.stderr.write(`${result.reason}\n`);
28
+ process.exit(1);
38
29
  }
@@ -1,9 +1,11 @@
1
+ import { reportError } from '@williamthorsen/nmr-core';
1
2
  import { syncPnpmVersion } from "./commands/sync-pnpm-version.js";
2
3
  import { findMonorepoRoot } from "./context.js";
3
4
  try {
4
- const monorepoRoot = findMonorepoRoot();
5
- syncPnpmVersion(monorepoRoot);
6
- } catch (error) {
7
- console.error(error instanceof Error ? error.message : String(error));
8
- process.exit(1);
5
+ const monorepoRoot = findMonorepoRoot();
6
+ syncPnpmVersion(monorepoRoot);
7
+ }
8
+ catch (error) {
9
+ reportError(error instanceof Error ? error.message : String(error));
10
+ process.exitCode = 1;
9
11
  }
package/dist/esm/cli.js CHANGED
@@ -1,16 +1,16 @@
1
- import process from "node:process";
1
+ import process from 'node:process';
2
2
  import { runCli } from "./runCli.js";
3
3
  try {
4
- const { exitCode } = await runCli({
5
- args: process.argv.slice(2),
6
- cwd: process.cwd(),
7
- env: process.env,
8
- stdout: process.stdout,
9
- stderr: process.stderr
10
- });
11
- process.exit(exitCode);
12
- } catch (error) {
13
- process.stderr.write(`${error instanceof Error ? error.stack ?? error.message : String(error)}
14
- `);
15
- process.exit(1);
4
+ const { exitCode } = await runCli({
5
+ args: process.argv.slice(2),
6
+ cwd: process.cwd(),
7
+ env: process.env,
8
+ stdout: process.stdout,
9
+ stderr: process.stderr,
10
+ });
11
+ process.exitCode = exitCode;
12
+ }
13
+ catch (error) {
14
+ process.stderr.write(`${error instanceof Error ? (error.stack ?? error.message) : String(error)}\n`);
15
+ process.exitCode = 1;
16
16
  }
@@ -1,15 +1,9 @@
1
- import { type Format, type Platform } from 'esbuild';
2
1
  export interface BuildOptions {
3
- aliases?: Record<string, string>;
4
2
  entryGlobs?: string[];
5
3
  ignore?: string[];
6
4
  outdir?: string;
7
5
  cacheFile?: string;
8
- format?: Format;
9
- platform?: Platform;
10
- target?: string;
11
6
  }
12
7
  export declare function buildPackage(packageDir: string, options?: BuildOptions): Promise<void>;
13
- export declare function computeBuildHash(packageDir: string, files: string[], outputConfig: object): Promise<string>;
14
- export declare function resolveAliasImports(code: string, fileDir: string, aliasMap: Record<string, string>, packageDir: string): string;
15
- export declare function rewriteTsImportExtensions(code: string): string;
8
+ export declare function computeBuildHash(packageDir: string, files: string[], emitConfig: object): Promise<string>;
9
+ export declare function resolveTsconfigChain(packageDir: string, configFileName?: string): string[];