@smoothbricks/cli 0.2.0 → 0.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/README.md +29 -24
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +19 -3
- package/dist/generate/index.d.ts +20 -0
- package/dist/generate/index.d.ts.map +1 -0
- package/dist/generate/index.js +47 -0
- package/dist/lib/run.d.ts +1 -0
- package/dist/lib/run.d.ts.map +1 -1
- package/dist/lib/run.js +19 -0
- package/dist/lib/workspace.d.ts +10 -0
- package/dist/lib/workspace.d.ts.map +1 -1
- package/dist/lib/workspace.js +55 -16
- package/dist/monorepo/lockfile.d.ts.map +1 -1
- package/dist/monorepo/lockfile.js +9 -0
- package/dist/monorepo/package-policy.d.ts +6 -17
- package/dist/monorepo/package-policy.d.ts.map +1 -1
- package/dist/monorepo/package-policy.js +63 -1127
- package/dist/monorepo/publish-workflow.js +2 -3
- package/dist/nx/index.d.ts +1 -0
- package/dist/nx/index.d.ts.map +1 -1
- package/dist/nx/index.js +23 -5
- package/dist/release/candidates.d.ts +1 -0
- package/dist/release/candidates.d.ts.map +1 -1
- package/dist/release/candidates.js +12 -0
- package/dist/release/core.d.ts +3 -1
- package/dist/release/core.d.ts.map +1 -1
- package/dist/release/core.js +76 -9
- package/dist/release/github-release.d.ts +1 -0
- package/dist/release/github-release.d.ts.map +1 -1
- package/dist/release/github-release.js +1 -1
- package/dist/release/index.d.ts +9 -3
- package/dist/release/index.d.ts.map +1 -1
- package/dist/release/index.js +287 -39
- package/dist/release/orchestration.d.ts +10 -2
- package/dist/release/orchestration.d.ts.map +1 -1
- package/dist/release/orchestration.js +33 -3
- package/managed/raw/tooling/git-hooks/commit-msg.sh +7 -1
- package/managed/raw/tooling/git-hooks/pre-commit.sh +7 -1
- package/managed/templates/github/workflows/ci.yml +3 -2
- package/package.json +7 -12
- package/src/cli.ts +21 -4
- package/src/generate/index.ts +92 -0
- package/src/lib/run.ts +25 -0
- package/src/lib/workspace.ts +72 -16
- package/src/monorepo/lockfile.ts +9 -0
- package/src/monorepo/package-policy.test.ts +254 -26
- package/src/monorepo/package-policy.ts +88 -1351
- package/src/monorepo/publish-workflow.ts +2 -3
- package/src/nx/index.test.ts +9 -0
- package/src/nx/index.ts +25 -5
- package/src/release/__tests__/candidates.test.ts +109 -8
- package/src/release/__tests__/core-properties.test.ts +2 -2
- package/src/release/__tests__/core-scenarios.test.ts +12 -15
- package/src/release/__tests__/core.test.ts +50 -3
- package/src/release/__tests__/fixture-repo.test.ts +68 -18
- package/src/release/__tests__/github-release.test.ts +9 -16
- package/src/release/__tests__/orchestration.test.ts +91 -5
- package/src/release/__tests__/retag-unpublished.test.ts +9 -9
- package/src/release/__tests__/trust-publisher.test.ts +65 -33
- package/src/release/candidates.ts +13 -0
- package/src/release/core.ts +95 -10
- package/src/release/github-release.ts +1 -1
- package/src/release/index.ts +366 -49
- package/src/release/orchestration.ts +50 -5
- package/dist/nx-version-actions.cjs +0 -25
- package/dist/nx-version-actions.d.cts +0 -6
- package/dist/nx-version-actions.d.cts.map +0 -1
- package/src/nx-version-actions.cts +0 -36
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ smoo release version --bump <auto|patch|minor|major|prerelease> [--dry-run] [--g
|
|
|
44
44
|
smoo release publish --bump <auto|patch|minor|major|prerelease> [--dry-run]
|
|
45
45
|
smoo release retag-unpublished <tag...> [--to <ref>] [--push] [--dispatch] [--remote <remote>] [--branch <branch>] [--dry-run]
|
|
46
46
|
smoo release bootstrap-npm-packages [--dry-run] [--skip-login] [--package <name...>]
|
|
47
|
-
smoo release trust-publisher [--bootstrap] [--dry-run] [--
|
|
47
|
+
smoo release trust-publisher [--bootstrap] [--dry-run] [--skip-login] [--package <name...>]
|
|
48
48
|
|
|
49
49
|
smoo github-ci cleanup-cache
|
|
50
50
|
smoo github-ci nx-smart --target <target> --name <check-name> --step <number>
|
|
@@ -80,7 +80,8 @@ Packages with internal workspace dependencies also need Nx-aware scripts so depe
|
|
|
80
80
|
For safe build, test, typecheck, benchmark, dev, and preview commands, `smoo monorepo validate --fix` moves the real
|
|
81
81
|
command into `package.json` `nx.targets.<target>.options.command`, sets `cwd` to `{projectRoot}`, and replaces the
|
|
82
82
|
script with an `nx run <project>:<target>` alias. Continuous commands such as `astro dev`, `vite dev`, and previews get
|
|
83
|
-
|
|
83
|
+
an explicit output style on the alias and `continuous: true` on the Nx target. Astro/Vite dev servers use
|
|
84
|
+
`--outputStyle=dynamic-legacy`; other continuous targets use `--outputStyle=stream`. Simple leading environment
|
|
84
85
|
assignments are moved into `nx.targets.<target>.options.env` so commands such as
|
|
85
86
|
`NODE_OPTIONS='--import=extensionless/register' astro dev` remain shell-independent.
|
|
86
87
|
|
|
@@ -202,8 +203,8 @@ repository directory, export ordering, and source-file publish entries when thos
|
|
|
202
203
|
`smoo monorepo list-release-packages` prints the comma-separated Nx project names for packages that are both
|
|
203
204
|
`npm:public` and owned by the current repository. Release commands, trusted-publisher setup, and the managed publish
|
|
204
205
|
workflow use this owned release package list instead of every public package in the workspace. smoo keeps both names in
|
|
205
|
-
release metadata: Nx commands
|
|
206
|
-
package `name`.
|
|
206
|
+
release metadata: Nx commands, GitHub Release tags, and git release tags use `projectName`, while npm publish checks and
|
|
207
|
+
tarball validation use the real package `name`.
|
|
207
208
|
|
|
208
209
|
For [GitHub Actions], `smoo monorepo list-release-packages --fail-empty --github-output "$GITHUB_OUTPUT"` appends the
|
|
209
210
|
`projects=<nx-project-list>` output expected by the managed publish workflow and fails with a clear error when no owned
|
|
@@ -233,7 +234,7 @@ builds, so a package `tsconfig.lib.json` produces the concrete target `tsc-js`.
|
|
|
233
234
|
`@smoothbricks/nx-plugin` only fills SmoothBricks convention gaps that official plugins do not provide. Today that means
|
|
234
235
|
Bun test typechecking, non-TypeScript build-tool steps, and aggregate targets.
|
|
235
236
|
|
|
236
|
-
Concrete targets describe the tool that runs and the artifact or purpose it produces:
|
|
237
|
+
Concrete targets use `{tool}-{output}` names and describe the tool that runs and the artifact or purpose it produces:
|
|
237
238
|
|
|
238
239
|
- `tsc-js` comes from the official TypeScript plugin and runs `tsc` for package JavaScript/declaration output.
|
|
239
240
|
- Packages that run `bun test` must have `tsconfig.test.json`. Bun executes tests without typechecking, so smoo creates
|
|
@@ -244,17 +245,18 @@ Concrete targets describe the tool that runs and the artifact or purpose it prod
|
|
|
244
245
|
`typecheck-tests` target runs `tsc --noEmit -p tsconfig.test.json` after `build` instead.
|
|
245
246
|
- Non-TypeScript build steps come from explicit tool configuration. For example, a package `build.zig` must expose named
|
|
246
247
|
`b.step("name", ...)` entries; each non-reserved step becomes a `zig-name` target such as `zig-wasm`.
|
|
247
|
-
- `build` is an aggregate. It exists only when there is at least one concrete build target such as `tsc-js
|
|
248
|
-
tool-output target, and it depends on
|
|
248
|
+
- `build` is an aggregate. It exists only when there is at least one concrete build target such as `tsc-js`,
|
|
249
|
+
`tsdown-js`, or another tool-output target, and it depends on output-family wildcards such as `*-js`, `*-web`,
|
|
250
|
+
`*-html`, `*-css`, `*-ios`, `*-android`, `*-native`, `*-napi`, `*-bun`, and `*-wasm` instead of duplicating commands.
|
|
249
251
|
- `lint` is an aggregate validation target. It is not a formatting target.
|
|
250
252
|
|
|
251
253
|
Explicit Nx target names must not contain `:`. Nx already uses colon syntax at the CLI boundary:
|
|
252
254
|
`project:target:configuration`. Allowing target names like `build:wasm` makes command parsing and package-script aliases
|
|
253
255
|
look like configurations, and it prevents a clean split between concrete tool-output targets and aggregate targets.
|
|
254
256
|
|
|
255
|
-
Use tool-output names for concrete targets, such as `tsc-js` and `zig-wasm`. Use `build` and `lint` only
|
|
256
|
-
targets. Package scripts may still use developer-friendly colon names, for example `build:wasm`, but those
|
|
257
|
-
should delegate to unambiguous Nx targets such as `nx run pkg:zig-wasm`.
|
|
257
|
+
Use tool-output names for concrete targets, such as `tsc-js`, `tsdown-js`, and `zig-wasm`. Use `build` and `lint` only
|
|
258
|
+
as aggregate targets. Package scripts may still use developer-friendly colon names, for example `build:wasm`, but those
|
|
259
|
+
scripts should delegate to unambiguous Nx targets such as `nx run pkg:zig-wasm`.
|
|
258
260
|
|
|
259
261
|
## Managed Files
|
|
260
262
|
|
|
@@ -356,9 +358,10 @@ Versioning:
|
|
|
356
358
|
|
|
357
359
|
- `--bump auto` first filters owned release packages to package-local candidates, then lets [Nx Release][nx-release]
|
|
358
360
|
derive the semver bump from [Conventional Commits]. A tagged package is an auto candidate only when files under its
|
|
359
|
-
package root changed since its current `
|
|
360
|
-
its package root has git history. Root-only changes, workflow edits,
|
|
361
|
-
|
|
361
|
+
package root changed since its current `projectName@version` release tag. An untagged package is an auto candidate
|
|
362
|
+
only when its package root has git history and its current version is stable. Root-only changes, workflow edits,
|
|
363
|
+
lockfile-only churn, untagged next-prerelease preparation commits, and other workspace-global changes may still affect
|
|
364
|
+
Nx tasks, but they do not make unrelated package artifacts releasable.
|
|
362
365
|
- `--bump patch|minor|major|prerelease` forces the release specifier for the full owned release package set. Forced
|
|
363
366
|
bumps intentionally bypass the package-local auto filter.
|
|
364
367
|
- Release packages are discovered from `npm:public` packages whose `repository.url` exactly matches the root package.
|
|
@@ -371,8 +374,8 @@ Versioning:
|
|
|
371
374
|
`"nx": { "name": "money" }`. This lets Nx Release understand commit scopes like `fix(money): ...` without requiring
|
|
372
375
|
the npm org in every commit subject.
|
|
373
376
|
- Nx project names and npm package names are different release identities. Nx project filters, workflow `projects=`
|
|
374
|
-
outputs, build/lint/test validation,
|
|
375
|
-
|
|
377
|
+
outputs, build/lint/test validation, project changelog lookup, GitHub Release tags, and durable git release tags use
|
|
378
|
+
`projectName`. npm publish checks and tarball validation use package `name`.
|
|
376
379
|
- [Nx Release][nx-release] `preVersionCommand` is intentionally not used. smoo builds exactly the packages that still
|
|
377
380
|
need npm publish immediately before packing them, while the managed workflow separately builds, lints, tests, and
|
|
378
381
|
validates newly created release commits.
|
|
@@ -398,9 +401,8 @@ Versioning:
|
|
|
398
401
|
[oven-sh/bun#18906](https://github.com/oven-sh/bun/issues/18906),
|
|
399
402
|
[oven-sh/bun#20477](https://github.com/oven-sh/bun/issues/20477), and
|
|
400
403
|
[oven-sh/bun#20829](https://github.com/oven-sh/bun/issues/20829).
|
|
401
|
-
- Package release tags must use the
|
|
402
|
-
|
|
403
|
-
before repairing remote state. Nx project names are only CLI/project-graph identifiers.
|
|
404
|
+
- Package release tags must use the Nx project name and version, for example `nx-plugin@0.0.2`. smoo derives release
|
|
405
|
+
package/version pairs from that tag shape and maps project names back to npm package names before checking npm state.
|
|
404
406
|
- `smoo release retag-unpublished <tag...>` is a break-glass recovery command for the case where Nx already committed a
|
|
405
407
|
version bump but npm publish failed before the package version became durable. It moves exact owned release tags to
|
|
406
408
|
`HEAD` by default without bumping package manifests again. It refuses to move a tag when `package@version` already
|
|
@@ -416,7 +418,7 @@ the durable record that a package version was selected for release. It only chec
|
|
|
416
418
|
decide which tags still need work; it does not walk normal commits looking for release-shaped changes.
|
|
417
419
|
|
|
418
420
|
1. Collect owned release tags from the fetched remote tag set, sorted newest-first by annotated tag `creatordate`. Only
|
|
419
|
-
tags matching owned
|
|
421
|
+
tags matching owned Nx project release names are considered, and each tag is peeled to the commit it releases.
|
|
420
422
|
2. Classify each owned release tag before grouping by commit. A tag needs npm repair when `package@version` is missing
|
|
421
423
|
from npm, and it needs GitHub repair when the GitHub Release for that tag is missing. Tags needing neither are
|
|
422
424
|
filtered out immediately.
|
|
@@ -441,6 +443,9 @@ Publishing:
|
|
|
441
443
|
- `smoo release publish` pushes missing branch/tag refs, publishes missing npm versions, creates or updates GitHub
|
|
442
444
|
Releases, and writes a GitHub Step Summary. Already published npm versions are skipped, so reruns after auth or
|
|
443
445
|
network failures retry only the package versions npm does not have yet.
|
|
446
|
+
- After a successful non-dry-run stable release at the branch tip, `smoo release publish` runs an untagged
|
|
447
|
+
`prerelease --preid next` version bump for the released stable packages and pushes that branch commit. This prepares
|
|
448
|
+
the codebase for the next development prerelease without creating prerelease release tags or publishing npm packages.
|
|
444
449
|
- npm registry state gates publish idempotency only. It decides which already-versioned package tarballs still need to
|
|
445
450
|
be published during a real release retry, not whether versioning should run or whether the workflow has a release to
|
|
446
451
|
publish.
|
|
@@ -463,11 +468,11 @@ Publishing:
|
|
|
463
468
|
- `smoo release trust-publisher` configures [npm trusted publishing][npm-trusted-publishing] for every owned release
|
|
464
469
|
package. It uses the root `package.json` `repository.url` as the GitHub `owner/repo`, uses `publish.yml` as the
|
|
465
470
|
trusted workflow, and runs `npm trust` through `nix shell nixpkgs#nodejs_latest` because the Lambda-pinned Node 24/npm
|
|
466
|
-
toolchain may lag the npm CLI feature.
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
+
toolchain may lag the npm CLI feature. It does not run a separate `npm login` before trust setup; `npm trust list` and
|
|
472
|
+
`npm trust github` own authentication so npm can offer the 5-minute trust/publish challenge bypass. Pass
|
|
473
|
+
`--package <name...>` to target specific owned packages. Pass `--bootstrap` to create missing npm package names first,
|
|
474
|
+
then configure trusted publishing in the same command. With `--bootstrap`, `--skip-login` only skips the placeholder
|
|
475
|
+
publish login. Existing matching trusted publishers are skipped via `npm trust list <package> --json`.
|
|
471
476
|
|
|
472
477
|
GitHub Releases:
|
|
473
478
|
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAKA,wBAAsB,MAAM,CAAC,IAAI,WAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAexE"}
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command, CommanderError } from 'commander';
|
|
2
|
+
import { variants } from './generate/index.js';
|
|
2
3
|
import { cliPackageVersion } from './lib/cli-package.js';
|
|
3
4
|
import { findRepoRoot } from './lib/run.js';
|
|
4
5
|
export async function runCli(argv = process.argv.slice(2)) {
|
|
@@ -95,6 +96,21 @@ function buildProgram() {
|
|
|
95
96
|
const { setupTestTracing } = await import('./monorepo/index.js');
|
|
96
97
|
await setupTestTracing(await findRepoRoot(), options);
|
|
97
98
|
});
|
|
99
|
+
// `smoo g` / `smoo generate` — subcommands are driven by the variant
|
|
100
|
+
// registry in src/generate/index.ts. To add a new variant, add an entry
|
|
101
|
+
// there; the CLI wiring below picks it up automatically.
|
|
102
|
+
const g = program.command('g').alias('generate').description('Scaffold workspace packages and components');
|
|
103
|
+
for (const [variantName, variant] of Object.entries(variants)) {
|
|
104
|
+
const sub = g.command(`${variantName} <name>`).description(variant.description);
|
|
105
|
+
for (const opt of variant.options ?? []) {
|
|
106
|
+
sub.option(opt.flag, opt.description);
|
|
107
|
+
}
|
|
108
|
+
sub.option('--dry-run', 'preview changes without writing');
|
|
109
|
+
sub.action(async (name, options) => {
|
|
110
|
+
const { generate } = await import('./generate/index.js');
|
|
111
|
+
await generate(await findRepoRoot(), variantName, name, options);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
98
114
|
const release = program.command('release').description('Version, publish, and create GitHub Releases');
|
|
99
115
|
release.command('npm-status').action(async () => {
|
|
100
116
|
const { printReleaseState } = await import('./release/index.js');
|
|
@@ -173,17 +189,17 @@ function buildProgram() {
|
|
|
173
189
|
.description('Configure npm trusted publishing for owned release packages')
|
|
174
190
|
.option('--dry-run [dryRun]', 'show npm trust changes without saving them')
|
|
175
191
|
.option('--bootstrap', 'publish missing npm placeholder packages before configuring trust')
|
|
176
|
-
.option('--otp <otp>', 'npm one-time password for trust operations')
|
|
177
192
|
.option('--bootstrap-otp <otp>', 'npm one-time password for placeholder publishes during --bootstrap')
|
|
178
|
-
.option('--skip-login', 'skip npm browser login before
|
|
193
|
+
.option('--skip-login', 'skip npm browser login before publishing placeholders during --bootstrap')
|
|
194
|
+
.option('--package <name...>', 'only configure the selected owned release package names')
|
|
179
195
|
.action(async (options) => {
|
|
180
196
|
const { releaseTrustPublisher } = await import('./release/index.js');
|
|
181
197
|
await releaseTrustPublisher(await findRepoRoot(), {
|
|
182
198
|
dryRun: booleanOption(options.dryRun),
|
|
183
199
|
bootstrap: options.bootstrap === true,
|
|
184
|
-
otp: options.otp,
|
|
185
200
|
bootstrapOtp: options.bootstrapOtp,
|
|
186
201
|
skipLogin: options.skipLogin === true,
|
|
202
|
+
packages: options.package ?? [],
|
|
187
203
|
});
|
|
188
204
|
});
|
|
189
205
|
const devenv = program.command('devenv').description('Manage the repository devenv shell');
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface GenerateVariant {
|
|
2
|
+
/** Nx generator name inside @smoothbricks/nx-plugin (e.g. 'create-package'). */
|
|
3
|
+
generator: string;
|
|
4
|
+
/** One-line description shown in `smoo g --help`. */
|
|
5
|
+
description: string;
|
|
6
|
+
/** Build the generator-specific args from the positional <name>. */
|
|
7
|
+
args: (name: string) => string[];
|
|
8
|
+
/** Extra CLI flags beyond the universal --dry-run. */
|
|
9
|
+
options?: readonly VariantOption[];
|
|
10
|
+
}
|
|
11
|
+
interface VariantOption {
|
|
12
|
+
/** Commander flag syntax (e.g. '--public'). */
|
|
13
|
+
flag: string;
|
|
14
|
+
/** Help text for this flag. */
|
|
15
|
+
description: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const variants: Record<string, GenerateVariant>;
|
|
18
|
+
export declare function generate(root: string, variantName: string, name: string, options: Record<string, unknown>): Promise<void>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/generate/index.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IACjC,sDAAsD;IACtD,OAAO,CAAC,EAAE,SAAS,aAAa,EAAE,CAAC;CACpC;AAED,UAAU,aAAa;IACrB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAkBpD,CAAC;AAMF,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,IAAI,CAAC,CAyBf"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { run } from '../lib/run.js';
|
|
2
|
+
const plugin = '@smoothbricks/nx-plugin';
|
|
3
|
+
export const variants = {
|
|
4
|
+
'ts-lib': {
|
|
5
|
+
generator: 'create-package',
|
|
6
|
+
description: 'Create a TypeScript library package',
|
|
7
|
+
args: (name) => ['--name', name, '--variant', 'ts-lib'],
|
|
8
|
+
options: [{ flag: '--public', description: 'configure for npm publication' }],
|
|
9
|
+
},
|
|
10
|
+
'ts-zig': {
|
|
11
|
+
generator: 'create-package',
|
|
12
|
+
description: 'Create a TypeScript + Zig/WASM hybrid package',
|
|
13
|
+
args: (name) => ['--name', name, '--variant', 'ts-zig'],
|
|
14
|
+
options: [{ flag: '--public', description: 'configure for npm publication' }],
|
|
15
|
+
},
|
|
16
|
+
'make-public': {
|
|
17
|
+
generator: 'make-public',
|
|
18
|
+
description: 'Promote a private package to npm publication',
|
|
19
|
+
args: (name) => ['--project', name],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
// Dispatch
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
export async function generate(root, variantName, name, options) {
|
|
26
|
+
const variant = variants[variantName];
|
|
27
|
+
if (!variant) {
|
|
28
|
+
const known = Object.keys(variants).join(', ');
|
|
29
|
+
throw new Error(`Unknown generator variant "${variantName}". Available: ${known}`);
|
|
30
|
+
}
|
|
31
|
+
const args = ['g', `${plugin}:${variant.generator}`, ...variant.args(name)];
|
|
32
|
+
for (const opt of variant.options ?? []) {
|
|
33
|
+
const key = opt.flag.replace(/^--/, '');
|
|
34
|
+
if (options[key]) {
|
|
35
|
+
args.push(opt.flag);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (options.dryRun) {
|
|
39
|
+
args.push('--dry-run');
|
|
40
|
+
}
|
|
41
|
+
await run('nx', args, root);
|
|
42
|
+
// Sync TypeScript project references so the new package is immediately
|
|
43
|
+
// visible in the build graph without a manual `nx sync` step.
|
|
44
|
+
if (!options.dryRun) {
|
|
45
|
+
await run('nx', ['sync'], root);
|
|
46
|
+
}
|
|
47
|
+
}
|
package/dist/lib/run.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare function run(command: string, args: string[], cwd: string, env?: Record<string, string>): Promise<void>;
|
|
2
2
|
export declare function runStatus(command: string, args: string[], cwd: string, quiet?: boolean, env?: Record<string, string>): Promise<number>;
|
|
3
|
+
export declare function runInteractiveStatus(command: string, args: string[], cwd: string, env?: Record<string, string>): Promise<number>;
|
|
3
4
|
export declare function runResult(command: string, args: string[], cwd: string, env?: Record<string, string>): Promise<{
|
|
4
5
|
exitCode: number;
|
|
5
6
|
stdout: string;
|
package/dist/lib/run.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/lib/run.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/lib/run.ts"],"names":[],"mappings":"AAMA,wBAAsB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAKnH;AAED,wBAAsB,SAAS,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,EACX,KAAK,UAAQ,EACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,EACX,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAED,wBAAsB,SAAS,CAC7B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,EACX,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3B,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAY/D;AAuCD,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAMpD;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEhD"}
|
package/dist/lib/run.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spawn } from 'node:child_process';
|
|
1
2
|
import { existsSync } from 'node:fs';
|
|
2
3
|
import { dirname, join } from 'node:path';
|
|
3
4
|
import { fileURLToPath } from 'node:url';
|
|
@@ -17,6 +18,24 @@ export async function runStatus(command, args, cwd, quiet = false, env) {
|
|
|
17
18
|
const result = quiet ? await shell.quiet() : await shell;
|
|
18
19
|
return result.exitCode;
|
|
19
20
|
}
|
|
21
|
+
export async function runInteractiveStatus(command, args, cwd, env) {
|
|
22
|
+
const invocation = resolveCommandInvocation(cwd, command, args);
|
|
23
|
+
return new Promise((resolve, reject) => {
|
|
24
|
+
const child = spawn(invocation.command, invocation.args, {
|
|
25
|
+
cwd,
|
|
26
|
+
env: env ? mergeEnv(env) : process.env,
|
|
27
|
+
stdio: 'inherit',
|
|
28
|
+
});
|
|
29
|
+
child.on('error', reject);
|
|
30
|
+
child.on('close', (code, signal) => {
|
|
31
|
+
if (signal) {
|
|
32
|
+
reject(new Error(`${command} ${args.join(' ')} terminated by signal ${signal}`));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
resolve(code ?? 1);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
}
|
|
20
39
|
export async function runResult(command, args, cwd, env) {
|
|
21
40
|
const invocation = resolveCommandInvocation(cwd, command, args);
|
|
22
41
|
let shell = $ `${invocation.command} ${invocation.args}`.cwd(cwd).nothrow().quiet();
|
package/dist/lib/workspace.d.ts
CHANGED
|
@@ -8,6 +8,14 @@ export interface PackageInfo {
|
|
|
8
8
|
packageJsonPath: string;
|
|
9
9
|
json: Record<string, unknown>;
|
|
10
10
|
}
|
|
11
|
+
export interface WorkspacePackageManifest {
|
|
12
|
+
name: string;
|
|
13
|
+
projectName: string;
|
|
14
|
+
private: boolean;
|
|
15
|
+
path: string;
|
|
16
|
+
packageJsonPath: string;
|
|
17
|
+
json: Record<string, unknown>;
|
|
18
|
+
}
|
|
11
19
|
export interface PackageJson extends Record<string, unknown> {
|
|
12
20
|
name?: string;
|
|
13
21
|
version?: string;
|
|
@@ -31,9 +39,11 @@ export declare function isSmoothBricksCodebase(root: string): boolean;
|
|
|
31
39
|
export declare function packageRepositoryInfo(pkg: PackageInfo): RepositoryInfo | null;
|
|
32
40
|
export declare function isOwnedPackage(rootRepository: RepositoryInfo, pkg: PackageInfo): boolean;
|
|
33
41
|
export declare function getWorkspacePackages(root: string): PackageInfo[];
|
|
42
|
+
export declare function getWorkspacePackageManifests(root: string): WorkspacePackageManifest[];
|
|
34
43
|
export declare function listPackageJsonRecords(root: string): PackageInfo[];
|
|
35
44
|
export declare function getWorkspacePatterns(root: string): string[];
|
|
36
45
|
export declare function readPackageJson(path: string): PackageInfo | null;
|
|
46
|
+
export declare function readWorkspacePackageManifest(path: string): WorkspacePackageManifest | null;
|
|
37
47
|
export declare function readPackageJsonObject(path: string): PackageJson | null;
|
|
38
48
|
export declare function getNxTags(pkg: Record<string, unknown>): string[];
|
|
39
49
|
export declare function repositoryInfo(pkg: Record<string, unknown>): RepositoryInfo | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../../src/lib/workspace.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,WAAY,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,C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rF;AAwDD,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CASlE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAG3D;AAgBD,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAiBhE;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,wBAAwB,GAAG,IAAI,CAc1F;AAOD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAGtE;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,EAAE,CAKhE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc,GAAG,IAAI,CAalF;AAED,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAErF;AA4BD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
package/dist/lib/workspace.js
CHANGED
|
@@ -46,10 +46,48 @@ export function getWorkspacePackages(root) {
|
|
|
46
46
|
}
|
|
47
47
|
return getWorkspacePackagesForPatterns(root, getWorkspacePatternsFromPackageJson(rootPackage.json));
|
|
48
48
|
}
|
|
49
|
+
export function getWorkspacePackageManifests(root) {
|
|
50
|
+
const rootPackage = readPackageJsonObject(join(root, 'package.json'));
|
|
51
|
+
if (!rootPackage) {
|
|
52
|
+
throw new Error('package.json not found or invalid');
|
|
53
|
+
}
|
|
54
|
+
return getWorkspacePackageManifestsForPatterns(root, getWorkspacePatternsFromPackageJson(rootPackage));
|
|
55
|
+
}
|
|
49
56
|
function getWorkspacePackagesForPatterns(root, workspacePatterns) {
|
|
50
57
|
const packages = [];
|
|
58
|
+
for (const pkgPath of listWorkspacePackageJsonPaths(root, workspacePatterns)) {
|
|
59
|
+
const pkg = readPackageJson(pkgPath);
|
|
60
|
+
if (!pkg?.name || !pkg.version) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
packages.push({
|
|
64
|
+
name: pkg.name,
|
|
65
|
+
projectName: pkg.projectName,
|
|
66
|
+
version: pkg.version,
|
|
67
|
+
private: pkg.private,
|
|
68
|
+
tags: pkg.tags,
|
|
69
|
+
path: relative(root, dirname(pkgPath)),
|
|
70
|
+
packageJsonPath: pkg.packageJsonPath,
|
|
71
|
+
json: pkg.json,
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return packages.sort((a, b) => a.name.localeCompare(b.name));
|
|
75
|
+
}
|
|
76
|
+
function getWorkspacePackageManifestsForPatterns(root, workspacePatterns) {
|
|
77
|
+
const manifests = [];
|
|
78
|
+
for (const pkgPath of listWorkspacePackageJsonPaths(root, workspacePatterns)) {
|
|
79
|
+
const pkg = readWorkspacePackageManifest(pkgPath);
|
|
80
|
+
if (pkg) {
|
|
81
|
+
manifests.push(pkg);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return manifests.sort((a, b) => a.name.localeCompare(b.name));
|
|
85
|
+
}
|
|
86
|
+
function listWorkspacePackageJsonPaths(root, workspacePatterns) {
|
|
87
|
+
const paths = [];
|
|
51
88
|
for (const pattern of workspacePatterns) {
|
|
52
89
|
if (!pattern.endsWith('/*')) {
|
|
90
|
+
paths.push(join(root, pattern, 'package.json'));
|
|
53
91
|
continue;
|
|
54
92
|
}
|
|
55
93
|
const parent = join(root, pattern.slice(0, -2));
|
|
@@ -57,24 +95,10 @@ function getWorkspacePackagesForPatterns(root, workspacePatterns) {
|
|
|
57
95
|
continue;
|
|
58
96
|
}
|
|
59
97
|
for (const entry of readdirSync(parent)) {
|
|
60
|
-
|
|
61
|
-
const pkg = readPackageJson(pkgPath);
|
|
62
|
-
if (!pkg?.name || !pkg.version) {
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
packages.push({
|
|
66
|
-
name: pkg.name,
|
|
67
|
-
projectName: pkg.projectName,
|
|
68
|
-
version: pkg.version,
|
|
69
|
-
private: pkg.private,
|
|
70
|
-
tags: pkg.tags,
|
|
71
|
-
path: relative(root, dirname(pkgPath)),
|
|
72
|
-
packageJsonPath: pkg.packageJsonPath,
|
|
73
|
-
json: pkg.json,
|
|
74
|
-
});
|
|
98
|
+
paths.push(join(parent, entry, 'package.json'));
|
|
75
99
|
}
|
|
76
100
|
}
|
|
77
|
-
return
|
|
101
|
+
return paths;
|
|
78
102
|
}
|
|
79
103
|
export function listPackageJsonRecords(root) {
|
|
80
104
|
const rootPackage = readPackageJson(join(root, 'package.json'));
|
|
@@ -121,6 +145,21 @@ export function readPackageJson(path) {
|
|
|
121
145
|
json: parsed,
|
|
122
146
|
};
|
|
123
147
|
}
|
|
148
|
+
export function readWorkspacePackageManifest(path) {
|
|
149
|
+
const parsed = readPackageJsonObject(path);
|
|
150
|
+
if (!isRecord(parsed) || !hasOwnString(parsed, 'name')) {
|
|
151
|
+
return null;
|
|
152
|
+
}
|
|
153
|
+
const privateValue = hasOwn(parsed, 'private') && typeof parsed.private === 'boolean' ? parsed.private : false;
|
|
154
|
+
return {
|
|
155
|
+
name: parsed.name,
|
|
156
|
+
projectName: packageNxProjectName(parsed),
|
|
157
|
+
private: privateValue,
|
|
158
|
+
path: dirname(path),
|
|
159
|
+
packageJsonPath: path,
|
|
160
|
+
json: parsed,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
124
163
|
function packageNxProjectName(pkg) {
|
|
125
164
|
const nx = isRecord(pkg.nx) ? pkg.nx : null;
|
|
126
165
|
return (nx ? stringProperty(nx, 'name') : null) ?? stringProperty(pkg, 'name') ?? '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lockfile.d.ts","sourceRoot":"","sources":["../../src/monorepo/lockfile.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,8BAA8B;IAC7C,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;
|
|
1
|
+
{"version":3,"file":"lockfile.d.ts","sourceRoot":"","sources":["../../src/monorepo/lockfile.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,8BAA8B;IAC7C,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAWD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,8BAAmC,GAAG,MAAM,CA0C1G;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA6BhE"}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { escapeRegex, getWorkspacePackages } from '../lib/workspace.js';
|
|
4
|
+
// Temporary Bun workaround. Delete this sync function, validateBunLockfileVersions,
|
|
5
|
+
// the `smoo monorepo sync-bun-lockfile-versions` command, and the matching Nx
|
|
6
|
+
// versionActions hook once supported Bun versions stop leaving workspace package
|
|
7
|
+
// versions stale in bun.lock after manifest bumps. Until then, `bun pm pack`
|
|
8
|
+
// rewrites `workspace:*` dependencies using those stale lockfile versions instead
|
|
9
|
+
// of the current package.json versions. Track removal against:
|
|
10
|
+
// - https://github.com/oven-sh/bun/issues/18906
|
|
11
|
+
// - https://github.com/oven-sh/bun/issues/20477
|
|
12
|
+
// - https://github.com/oven-sh/bun/issues/20829
|
|
4
13
|
export function syncBunLockfileVersions(root, options = {}) {
|
|
5
14
|
const log = options.log ?? true;
|
|
6
15
|
const lockfilePath = join(root, 'bun.lock');
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
export
|
|
5
|
-
targets: ReadonlySet<string>;
|
|
6
|
-
buildDependsOn?: readonly string[];
|
|
7
|
-
}
|
|
8
|
-
export declare const SMOO_NX_VERSION_ACTIONS = "@smoothbricks/cli/nx-version-actions";
|
|
9
|
-
export declare const SMOO_NX_RELEASE_TAG_PATTERN = "{projectName}@{version}";
|
|
1
|
+
import { type PackageTargetPolicyOptions, type ResolvedProjectTargets } from '@smoothbricks/nx-plugin/package-target-policy';
|
|
2
|
+
import { SMOO_NX_RELEASE_TAG_PATTERN, SMOO_NX_VERSION_ACTIONS } from '@smoothbricks/nx-plugin/release-config-policy';
|
|
3
|
+
export type { PackageTargetPolicyOptions as WorkspaceDependencyDefaultOptions, ResolvedProjectTargets };
|
|
4
|
+
export { SMOO_NX_RELEASE_TAG_PATTERN, SMOO_NX_VERSION_ACTIONS };
|
|
10
5
|
export declare function applyFixableMonorepoDefaults(root: string): void;
|
|
11
6
|
export declare function applyRootScriptDefaults(root: string): void;
|
|
12
7
|
export declare function applyNxPluginDefaults(root: string): void;
|
|
13
8
|
export declare function applyPublicPackageDefaults(root: string): void;
|
|
14
|
-
export declare function applyWorkspaceDependencyDefaults(root: string, options?:
|
|
9
|
+
export declare function applyWorkspaceDependencyDefaults(root: string, options?: PackageTargetPolicyOptions): void;
|
|
15
10
|
export declare function applyNxReleaseDefaults(root: string): void;
|
|
16
11
|
export declare function applyNxProjectNameDefaults(root: string): void;
|
|
17
12
|
export declare function listValidCommitScopes(root: string): ReadonlySet<string>;
|
|
@@ -21,11 +16,5 @@ export declare function validateNxReleaseConfig(root: string): number;
|
|
|
21
16
|
export declare function validateNxProjectNames(root: string): number;
|
|
22
17
|
export declare function validatePublicTags(root: string): number;
|
|
23
18
|
export declare function validatePublicPackageMetadata(root: string): number;
|
|
24
|
-
export declare function validateWorkspaceDependencies(root: string, options?:
|
|
25
|
-
export declare function applyPackageScriptPolicy(pkg: Record<string, unknown>, _packagePath: string, workspaceNames: ReadonlySet<string>, options?: {
|
|
26
|
-
resolvedTargets?: ReadonlySet<string>;
|
|
27
|
-
}): boolean;
|
|
28
|
-
export declare function validatePackageScriptPolicy(pkg: Record<string, unknown>, packagePath: string, workspaceNames: ReadonlySet<string>, options?: {
|
|
29
|
-
resolvedTargets?: ReadonlySet<string>;
|
|
30
|
-
}): number;
|
|
19
|
+
export declare function validateWorkspaceDependencies(root: string, options?: PackageTargetPolicyOptions): number;
|
|
31
20
|
//# sourceMappingURL=package-policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-policy.d.ts","sourceRoot":"","sources":["../../src/monorepo/package-policy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"package-policy.d.ts","sourceRoot":"","sources":["../../src/monorepo/package-policy.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC5B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAGL,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,+CAA+C,CAAC;AA6BvD,YAAY,EAAE,0BAA0B,IAAI,iCAAiC,EAAE,sBAAsB,EAAE,CAAC;AACxG,OAAO,EAAE,2BAA2B,EAAE,uBAAuB,EAAE,CAAC;AAUhE,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAI/D;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAuB1D;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAMxD;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAuC7D;AAED,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,0BAA+B,GAAG,IAAI,CAwB7G;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAMzD;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAoB7D;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAEvE;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAA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