@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.
- package/AGENTS.md +1 -1
- package/README.md +43 -54
- package/dist/esm/.cache +1 -1
- package/dist/esm/cli-build.js +5 -4
- package/dist/esm/cli-ensure-prepublish-hooks.js +37 -56
- package/dist/esm/cli-report-overrides.js +7 -5
- package/dist/esm/cli-sync-agent-files.js +19 -28
- package/dist/esm/cli-sync-pnpm-version.js +7 -5
- package/dist/esm/cli.js +13 -13
- package/dist/esm/commands/build.d.ts +2 -8
- package/dist/esm/commands/build.js +270 -118
- package/dist/esm/commands/ensure-prepublish-hooks.js +66 -69
- package/dist/esm/commands/report-overrides.js +10 -13
- package/dist/esm/commands/sync-agent-files.js +46 -52
- package/dist/esm/commands/sync-pnpm-version.js +35 -42
- package/dist/esm/config.js +59 -57
- package/dist/esm/context.d.ts +1 -1
- package/dist/esm/context.js +70 -72
- package/dist/esm/default-scripts.js +63 -67
- package/dist/esm/help.d.ts +1 -1
- package/dist/esm/help.js +65 -68
- package/dist/esm/helpers/code-quality-pnpm-action.js +20 -24
- package/dist/esm/helpers/hook-name.js +2 -5
- package/dist/esm/helpers/package-json.js +46 -41
- package/dist/esm/helpers/type-guards.js +2 -5
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +1 -4
- package/dist/esm/resolve-scripts.d.ts +2 -2
- package/dist/esm/resolve-scripts.js +7 -11
- package/dist/esm/resolver.d.ts +3 -2
- package/dist/esm/resolver.js +85 -83
- package/dist/esm/runCli.js +135 -145
- package/dist/esm/runner.js +35 -34
- package/dist/esm/scripts.d.ts +2 -2
- package/dist/esm/scripts.js +1 -5
- package/dist/esm/tests/consistency.d.ts +1 -1
- package/dist/esm/tests/consistency.js +45 -54
- package/dist/esm/tests/helpers/get-runtime-version-from-asdf.js +11 -14
- package/dist/esm/tests/helpers/get-string-from-yaml-file.js +10 -13
- package/dist/esm/tests/helpers/get-value-at-path.js +30 -30
- 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
|
|
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.
|
|
6
|
+
## Release notes — v0.17.0 (2026-07-01)
|
|
7
7
|
|
|
8
8
|
### 🎉 Features
|
|
9
9
|
|
|
10
|
-
-
|
|
10
|
+
- 🚨 **Breaking:** Rebuild nmr-compile on a unified tsc emit (#455)
|
|
11
11
|
|
|
12
|
-
|
|
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
|
|
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
|
|
87
|
-
| ---- | ----------------------- |
|
|
88
|
-
| 1 | Built-in default | `['compile'
|
|
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
|
-
// "
|
|
102
|
-
// expands to: nmr
|
|
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
|
|
157
|
-
|
|
|
158
|
-
| `
|
|
159
|
-
| `
|
|
160
|
-
| `check
|
|
161
|
-
| `
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
164
|
-
| `fix
|
|
165
|
-
| `
|
|
166
|
-
| `fmt
|
|
167
|
-
| `
|
|
168
|
-
| `lint`
|
|
169
|
-
| `lint:check`
|
|
170
|
-
| `lint:strict`
|
|
171
|
-
| `test`
|
|
172
|
-
| `test:coverage`
|
|
173
|
-
| `test:watch`
|
|
174
|
-
| `typecheck`
|
|
175
|
-
| `view-coverage`
|
|
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
|
-
|
|
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
|
-
| `
|
|
203
|
-
| `check
|
|
204
|
-
| `check:
|
|
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
|
|
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
|
|
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
|
-
|
|
1
|
+
49f79592247d14646b1445473aa445a8bcbeafb478c6dc9949eb31cee8e2a627
|
package/dist/esm/cli-build.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { buildPackage } from "./commands/build.js";
|
|
2
2
|
try {
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
10
|
-
} catch (error) {
|
|
11
|
-
console.error(error instanceof Error ? error.message : String(error));
|
|
12
|
-
process.exit(1);
|
|
9
|
+
runCommand(flags.check);
|
|
13
10
|
}
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
process.
|
|
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
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
|
|
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
|
|
1
|
+
import process from 'node:process';
|
|
2
2
|
import { runCli } from "./runCli.js";
|
|
3
3
|
try {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
`);
|
|
15
|
-
|
|
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[],
|
|
14
|
-
export declare function
|
|
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[];
|