@animus-ui/cli 0.1.42 → 0.1.44
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 +6 -0
- package/dist/build.d.ts +4 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.cjs +38 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +36 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -31,8 +31,14 @@ on unsupported platforms.
|
|
|
31
31
|
animus build --root . --system ./src/ds.ts --strict
|
|
32
32
|
animus watch --root . --system ./src/ds.ts
|
|
33
33
|
animus print-config --root . --system ./src/ds.ts
|
|
34
|
+
animus prop-order --root . --system ./src/ds.ts
|
|
34
35
|
```
|
|
35
36
|
|
|
37
|
+
`animus prop-order` writes only `<root>/.animus/prop-order.json`. The
|
|
38
|
+
[`animus/prop-order` lint rule](../extract/README.md#prop-order-lint-rule)
|
|
39
|
+
reads it, and the command needs no dev server; `animus build` writes the
|
|
40
|
+
same file when the config sets `propOrderFile: true`.
|
|
41
|
+
|
|
36
42
|
Configuration lives in `animus.config.{json,mjs,js,ts}` (probed in that
|
|
37
43
|
order; `.ts` needs Node >= 23.6 native type stripping — older runtimes get
|
|
38
44
|
a guided error naming the `.mjs`/`.json` remedy). Flags override file
|
package/dist/build.d.ts
CHANGED
|
@@ -26,6 +26,10 @@ export declare function reportDiscoveryOutcomes(config: ResolvedCliConfig, sessi
|
|
|
26
26
|
export interface BuildFlags {
|
|
27
27
|
/** Also write the kit descriptor at the root. */
|
|
28
28
|
kit?: boolean;
|
|
29
|
+
/** Write only the prop-order file the `animus/prop-order` lint rule
|
|
30
|
+
* reads: no artifact directory is claimed or published, so a running
|
|
31
|
+
* build's output stays as it is. */
|
|
32
|
+
propOrderOnly?: boolean;
|
|
29
33
|
}
|
|
30
34
|
export declare function runBuild(config: ResolvedCliConfig, flags?: BuildFlags): Promise<BuildResult>;
|
|
31
35
|
//# sourceMappingURL=build.d.ts.map
|
package/dist/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAQA,OAAO,EAIL,iBAAiB,
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAQA,OAAO,EAIL,iBAAiB,EAOlB,MAAM,4BAA4B,CAAC;AAcpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAKlD,qBAAa,iBAAkB,SAAQ,KAAK;CAAG;AAC/C,qBAAa,YAAa,SAAQ,KAAK;CAAG;AAC1C,qBAAa,kBAAmB,SAAQ,KAAK;CAAG;AAEhD,eAAO,MAAM,GAAG,aAAc,OAAO,EAAE,KAAG,IACL,CAAC;AAEtC,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;qCACqC;AACrC,wBAAsB,YAAY,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB3E;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,iBAAiB,GAAG,iBAAiB,CAkC7E;AAED,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,iBAAiB,GACzB,cAAc,CAsEhB;AAqBD,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,iBAAiB,GAAG,IAAI,EAC1C,WAAW,EAAE,MAAM,IAAI,GACtB,MAAM,IAAI,CAOZ;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,iBAAiB,EACzB,OAAO,EAAE,iBAAiB,GACzB,IAAI,CAUN;AAED,MAAM,WAAW,UAAU;IACzB,iDAAiD;IACjD,GAAG,CAAC,EAAE,OAAO,CAAC;IACd;;yCAEqC;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAgBD,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,iBAAiB,EACzB,KAAK,GAAE,UAAe,GACrB,OAAO,CAAC,WAAW,CAAC,CA6EtB"}
|
package/dist/config.d.ts
CHANGED
|
@@ -45,6 +45,10 @@ export declare function projectResolvedConfig(config: ResolvedCliConfig): {
|
|
|
45
45
|
verbose: "trace" | boolean;
|
|
46
46
|
targets: string | string[] | null;
|
|
47
47
|
keepDirSelector: boolean;
|
|
48
|
+
shortClassNames: {
|
|
49
|
+
prefix: string;
|
|
50
|
+
} | null;
|
|
51
|
+
propOrderFile: boolean;
|
|
48
52
|
minify: boolean | null;
|
|
49
53
|
prefix: string | null;
|
|
50
54
|
prefixContextualVars: boolean;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,eAAe,EAEf,gBAAgB,EAEhB,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAErC,eAAO,MAAM,gBAAgB,YAC3B,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,CACV,CAAC;AAEX,MAAM,WAAW,mBAAmB;IAClC,0EAA0E;IAC1E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,O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|
|
367
367
|
* build published. */
|
|
368
368
|
function writeKitDescriptor(root, key) {
|
|
369
369
|
const manifest = JSON.parse((0, _animus_ui_extract_session.getManifestJson)(key) ?? "");
|
|
370
|
-
const path$
|
|
371
|
-
(0, fs.writeFileSync)(path$
|
|
372
|
-
return path$
|
|
370
|
+
const path$3 = (0, path.join)(root, _animus_ui_extract_pipeline.KIT_DESCRIPTOR_FILE);
|
|
371
|
+
(0, fs.writeFileSync)(path$3, `${JSON.stringify((0, _animus_ui_extract_pipeline.buildKitDescriptor)(manifest), null, 2)}\n`);
|
|
372
|
+
return path$3;
|
|
373
373
|
}
|
|
374
374
|
async function runBuild(config, flags = {}) {
|
|
375
375
|
const { outDir } = config;
|
|
376
376
|
await runPreflight(config);
|
|
377
|
-
const release = acquireLock(outDir);
|
|
377
|
+
const release = flags.propOrderOnly ? () => {} : acquireLock(outDir);
|
|
378
|
+
const run = flags.propOrderOnly ? {
|
|
379
|
+
...config,
|
|
380
|
+
options: {
|
|
381
|
+
...config.options,
|
|
382
|
+
propOrderFile: true
|
|
383
|
+
}
|
|
384
|
+
} : config;
|
|
378
385
|
let session = null;
|
|
379
386
|
const releaseClaims = createRunClaimRelease(() => session, release);
|
|
380
387
|
const removeShutdownSignals = installShutdownSignals({ release: ({ exitCode, signal }) => {
|
|
@@ -383,12 +390,23 @@ async function runBuild(config, flags = {}) {
|
|
|
383
390
|
process.exit(exitCode);
|
|
384
391
|
} });
|
|
385
392
|
try {
|
|
386
|
-
session = createCliSession(
|
|
393
|
+
session = createCliSession(run);
|
|
387
394
|
try {
|
|
388
395
|
await session.runFullPipeline();
|
|
389
396
|
} catch (error) {
|
|
390
397
|
throw new ExtractionFailure(String(error));
|
|
391
398
|
}
|
|
399
|
+
if (flags.propOrderOnly) {
|
|
400
|
+
const path$2 = (0, _animus_ui_extract_session.propOrderPath)(config.root);
|
|
401
|
+
if (session.propOrderWrittenTo !== path$2) throw new ExtractionFailure(`Analysis wrote no prop-order file at ${path$2}`);
|
|
402
|
+
reportDiscoveryOutcomes(config, session);
|
|
403
|
+
err(`prop order → ${path$2}`);
|
|
404
|
+
return {
|
|
405
|
+
outDir: (0, path.dirname)(path$2),
|
|
406
|
+
componentCount: session.lastComponentCount ?? 0,
|
|
407
|
+
fileCount: (0, _animus_ui_extract_session.getAnalyzedHashes)(session.key)?.size ?? 0
|
|
408
|
+
};
|
|
409
|
+
}
|
|
392
410
|
const { componentCount, fileCount } = publishSharedPayloads(config, session);
|
|
393
411
|
if (flags.kit) {
|
|
394
412
|
const failures = (0, _animus_ui_extract_pipeline.kitPublicationFailures)(config.root, (0, _animus_ui_extract_session.engineApi)(session.key), config.outDir);
|
|
@@ -487,6 +505,8 @@ function parseLoadedCliConfig(raw) {
|
|
|
487
505
|
prefixContextualVars: isConfigBoolean(raw.prefixContextualVars) ? raw.prefixContextualVars : void 0,
|
|
488
506
|
targets: isConfigString(raw.targets) || isConfigStringArray(raw.targets) ? raw.targets : void 0,
|
|
489
507
|
keepDirSelector: isConfigBoolean(raw.keepDirSelector) ? raw.keepDirSelector : void 0,
|
|
508
|
+
shortClassNames: isConfigRecord(raw.shortClassNames) && isConfigString(raw.shortClassNames.prefix) ? { prefix: raw.shortClassNames.prefix } : void 0,
|
|
509
|
+
propOrderFile: isConfigBoolean(raw.propOrderFile) ? raw.propOrderFile : void 0,
|
|
490
510
|
minify: isConfigBoolean(raw.minify) ? raw.minify : void 0,
|
|
491
511
|
staticCss: configStaticCss(raw.staticCss),
|
|
492
512
|
layers: isConfigStringArray(raw.layers) ? raw.layers : void 0,
|
|
@@ -584,6 +604,8 @@ async function resolveCliConfig(flags, cwd) {
|
|
|
584
604
|
prefixContextualVars: pick("prefixContextualVars", void 0),
|
|
585
605
|
targets: pick("targets", flags.targets),
|
|
586
606
|
keepDirSelector: pick("keepDirSelector", void 0),
|
|
607
|
+
shortClassNames: pick("shortClassNames", void 0),
|
|
608
|
+
propOrderFile: pick("propOrderFile", void 0),
|
|
587
609
|
minify: pick("minify", void 0),
|
|
588
610
|
staticCss: pick("staticCss", void 0),
|
|
589
611
|
layers: pick("layers", void 0),
|
|
@@ -625,6 +647,8 @@ function projectResolvedConfig(config) {
|
|
|
625
647
|
verbose: config.options.verbose ?? false,
|
|
626
648
|
targets: config.options.targets ?? null,
|
|
627
649
|
keepDirSelector: config.options.keepDirSelector ?? false,
|
|
650
|
+
shortClassNames: config.options.shortClassNames ?? null,
|
|
651
|
+
propOrderFile: config.options.propOrderFile ?? false,
|
|
628
652
|
minify: config.options.minify ?? null,
|
|
629
653
|
prefix: config.options.prefix ?? null,
|
|
630
654
|
prefixContextualVars: config.options.prefixContextualVars ?? false,
|
|
@@ -828,6 +852,9 @@ Usage:
|
|
|
828
852
|
animus watch [options] Long-lived watch: republish on change; ready,
|
|
829
853
|
per-cycle failures, and degradation on stderr
|
|
830
854
|
animus print-config [opts] Print the fully resolved configuration (JSON)
|
|
855
|
+
animus prop-order [opts] Write only .animus/prop-order.json, which the
|
|
856
|
+
animus/prop-order lint rule reads, without a
|
|
857
|
+
dev server
|
|
831
858
|
|
|
832
859
|
Options:
|
|
833
860
|
--system <path> SystemInstance module (required unless configured)
|
|
@@ -914,7 +941,7 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
914
941
|
reportUsageError(`Unexpected argument '${positionals[1]}' — one command per invocation`);
|
|
915
942
|
return;
|
|
916
943
|
}
|
|
917
|
-
if (command !== "build" && command !== "watch" && command !== "print-config") {
|
|
944
|
+
if (command !== "build" && command !== "watch" && command !== "print-config" && command !== "prop-order") {
|
|
918
945
|
reportUsageError(`Unknown command '${command}'`);
|
|
919
946
|
return;
|
|
920
947
|
}
|
|
@@ -944,6 +971,11 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
944
971
|
process.exitCode = 0;
|
|
945
972
|
return;
|
|
946
973
|
}
|
|
974
|
+
if (command === "prop-order") {
|
|
975
|
+
await runBuild(config, { propOrderOnly: true });
|
|
976
|
+
process.exitCode = 0;
|
|
977
|
+
return;
|
|
978
|
+
}
|
|
947
979
|
process.exitCode = await runWatch(config, { failOnDegraded: values["fail-on-degraded"] === true });
|
|
948
980
|
} catch (error) {
|
|
949
981
|
console.error(`[animus] ${String(readThrownMessage(error) ?? error)}`);
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;kDACkD;AAiBlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,YAAY,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,eAAO,MAAM,OAAO,IAAI,CAAC;AACzB,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC;qEACqE;AACrE,eAAO,MAAM,YAAY,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;kDACkD;AAiBlD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,YAAY,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,eAAO,MAAM,OAAO,IAAI,CAAC;AACzB,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,UAAU,IAAI,CAAC;AAC5B,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAClC;qEACqE;AACrE,eAAO,MAAM,YAAY,IAAI,CAAC;AA+D9B;sDACsD;AACtD,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAMzD;AAQD,wBAAsB,IAAI,CACxB,IAAI,GAAE,MAAM,EAA0B,GACrC,OAAO,CAAC,IAAI,CAAC,CAmGf"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnimusConfigError, DIAGNOSTIC_LEVELS, KIT_DESCRIPTOR_FILE, REPLACEABLE_DEFAULT_EXCLUDE, STRUCTURAL_EXCLUDE, assertKnownOptionKeys, assertSupportedEngine, buildKitDescriptor, contentHash, createExcludeMatcher, kitPublicationFailures, outputExclusion, renderFontPreloads, resolveMode, runStructuralSelfCheck, stylesheetSliceFiles } from "@animus-ui/extract/pipeline";
|
|
2
2
|
import { parseArgs } from "node:util";
|
|
3
|
-
import { ANIMUS_ARTIFACT_DIR, CLI_COMMIT_ARTIFACT, CLI_FONT_PRELOADS_ARTIFACT, CLI_LOCK_ARTIFACT, CLI_STYLESHEETS_ARTIFACT, ExtractionSession, MANIFEST_ARTIFACT, SESSION_ASSETS_DIR, STYLES_ARTIFACT, SYSTEM_PROPS_ARTIFACT, checkLockLiveness, collectSessionAssets, decodeCommitRecord, engineApi, getAnalyzedHashes, getManifestJson, getSharedCss, getSharedFontPreloads, getSharedSystemProps, holdDirectoryClaim, isLockHolderAlive, lockRecordBytes, readCliLockRecord, startTurbopackWatcher, verifyCommitRecord } from "@animus-ui/extract/session";
|
|
3
|
+
import { ANIMUS_ARTIFACT_DIR, CLI_COMMIT_ARTIFACT, CLI_FONT_PRELOADS_ARTIFACT, CLI_LOCK_ARTIFACT, CLI_STYLESHEETS_ARTIFACT, ExtractionSession, MANIFEST_ARTIFACT, SESSION_ASSETS_DIR, STYLES_ARTIFACT, SYSTEM_PROPS_ARTIFACT, checkLockLiveness, collectSessionAssets, decodeCommitRecord, engineApi, getAnalyzedHashes, getManifestJson, getSharedCss, getSharedFontPreloads, getSharedSystemProps, holdDirectoryClaim, isLockHolderAlive, lockRecordBytes, propOrderPath, readCliLockRecord, startTurbopackWatcher, verifyCommitRecord } from "@animus-ui/extract/session";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, unlinkSync, writeFileSync } from "fs";
|
|
5
5
|
import { dirname, isAbsolute, join, relative, resolve } from "path";
|
|
6
6
|
import { pathToFileURL } from "url";
|
|
@@ -373,7 +373,14 @@ function writeKitDescriptor(root, key) {
|
|
|
373
373
|
async function runBuild(config, flags = {}) {
|
|
374
374
|
const { outDir } = config;
|
|
375
375
|
await runPreflight(config);
|
|
376
|
-
const release = acquireLock(outDir);
|
|
376
|
+
const release = flags.propOrderOnly ? () => {} : acquireLock(outDir);
|
|
377
|
+
const run = flags.propOrderOnly ? {
|
|
378
|
+
...config,
|
|
379
|
+
options: {
|
|
380
|
+
...config.options,
|
|
381
|
+
propOrderFile: true
|
|
382
|
+
}
|
|
383
|
+
} : config;
|
|
377
384
|
let session = null;
|
|
378
385
|
const releaseClaims = createRunClaimRelease(() => session, release);
|
|
379
386
|
const removeShutdownSignals = installShutdownSignals({ release: ({ exitCode, signal }) => {
|
|
@@ -382,12 +389,23 @@ async function runBuild(config, flags = {}) {
|
|
|
382
389
|
process.exit(exitCode);
|
|
383
390
|
} });
|
|
384
391
|
try {
|
|
385
|
-
session = createCliSession(
|
|
392
|
+
session = createCliSession(run);
|
|
386
393
|
try {
|
|
387
394
|
await session.runFullPipeline();
|
|
388
395
|
} catch (error) {
|
|
389
396
|
throw new ExtractionFailure(String(error));
|
|
390
397
|
}
|
|
398
|
+
if (flags.propOrderOnly) {
|
|
399
|
+
const path = propOrderPath(config.root);
|
|
400
|
+
if (session.propOrderWrittenTo !== path) throw new ExtractionFailure(`Analysis wrote no prop-order file at ${path}`);
|
|
401
|
+
reportDiscoveryOutcomes(config, session);
|
|
402
|
+
err(`prop order → ${path}`);
|
|
403
|
+
return {
|
|
404
|
+
outDir: dirname(path),
|
|
405
|
+
componentCount: session.lastComponentCount ?? 0,
|
|
406
|
+
fileCount: getAnalyzedHashes(session.key)?.size ?? 0
|
|
407
|
+
};
|
|
408
|
+
}
|
|
391
409
|
const { componentCount, fileCount } = publishSharedPayloads(config, session);
|
|
392
410
|
if (flags.kit) {
|
|
393
411
|
const failures = kitPublicationFailures(config.root, engineApi(session.key), config.outDir);
|
|
@@ -486,6 +504,8 @@ function parseLoadedCliConfig(raw) {
|
|
|
486
504
|
prefixContextualVars: isConfigBoolean(raw.prefixContextualVars) ? raw.prefixContextualVars : void 0,
|
|
487
505
|
targets: isConfigString(raw.targets) || isConfigStringArray(raw.targets) ? raw.targets : void 0,
|
|
488
506
|
keepDirSelector: isConfigBoolean(raw.keepDirSelector) ? raw.keepDirSelector : void 0,
|
|
507
|
+
shortClassNames: isConfigRecord(raw.shortClassNames) && isConfigString(raw.shortClassNames.prefix) ? { prefix: raw.shortClassNames.prefix } : void 0,
|
|
508
|
+
propOrderFile: isConfigBoolean(raw.propOrderFile) ? raw.propOrderFile : void 0,
|
|
489
509
|
minify: isConfigBoolean(raw.minify) ? raw.minify : void 0,
|
|
490
510
|
staticCss: configStaticCss(raw.staticCss),
|
|
491
511
|
layers: isConfigStringArray(raw.layers) ? raw.layers : void 0,
|
|
@@ -583,6 +603,8 @@ async function resolveCliConfig(flags, cwd) {
|
|
|
583
603
|
prefixContextualVars: pick("prefixContextualVars", void 0),
|
|
584
604
|
targets: pick("targets", flags.targets),
|
|
585
605
|
keepDirSelector: pick("keepDirSelector", void 0),
|
|
606
|
+
shortClassNames: pick("shortClassNames", void 0),
|
|
607
|
+
propOrderFile: pick("propOrderFile", void 0),
|
|
586
608
|
minify: pick("minify", void 0),
|
|
587
609
|
staticCss: pick("staticCss", void 0),
|
|
588
610
|
layers: pick("layers", void 0),
|
|
@@ -624,6 +646,8 @@ function projectResolvedConfig(config) {
|
|
|
624
646
|
verbose: config.options.verbose ?? false,
|
|
625
647
|
targets: config.options.targets ?? null,
|
|
626
648
|
keepDirSelector: config.options.keepDirSelector ?? false,
|
|
649
|
+
shortClassNames: config.options.shortClassNames ?? null,
|
|
650
|
+
propOrderFile: config.options.propOrderFile ?? false,
|
|
627
651
|
minify: config.options.minify ?? null,
|
|
628
652
|
prefix: config.options.prefix ?? null,
|
|
629
653
|
prefixContextualVars: config.options.prefixContextualVars ?? false,
|
|
@@ -827,6 +851,9 @@ Usage:
|
|
|
827
851
|
animus watch [options] Long-lived watch: republish on change; ready,
|
|
828
852
|
per-cycle failures, and degradation on stderr
|
|
829
853
|
animus print-config [opts] Print the fully resolved configuration (JSON)
|
|
854
|
+
animus prop-order [opts] Write only .animus/prop-order.json, which the
|
|
855
|
+
animus/prop-order lint rule reads, without a
|
|
856
|
+
dev server
|
|
830
857
|
|
|
831
858
|
Options:
|
|
832
859
|
--system <path> SystemInstance module (required unless configured)
|
|
@@ -913,7 +940,7 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
913
940
|
reportUsageError(`Unexpected argument '${positionals[1]}' — one command per invocation`);
|
|
914
941
|
return;
|
|
915
942
|
}
|
|
916
|
-
if (command !== "build" && command !== "watch" && command !== "print-config") {
|
|
943
|
+
if (command !== "build" && command !== "watch" && command !== "print-config" && command !== "prop-order") {
|
|
917
944
|
reportUsageError(`Unknown command '${command}'`);
|
|
918
945
|
return;
|
|
919
946
|
}
|
|
@@ -943,6 +970,11 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
943
970
|
process.exitCode = 0;
|
|
944
971
|
return;
|
|
945
972
|
}
|
|
973
|
+
if (command === "prop-order") {
|
|
974
|
+
await runBuild(config, { propOrderOnly: true });
|
|
975
|
+
process.exitCode = 0;
|
|
976
|
+
return;
|
|
977
|
+
}
|
|
946
978
|
process.exitCode = await runWatch(config, { failOnDegraded: values["fail-on-degraded"] === true });
|
|
947
979
|
} catch (error) {
|
|
948
980
|
console.error(`[animus] ${String(readThrownMessage(error) ?? error)}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.44",
|
|
4
4
|
"description": "Standalone Animus extraction CLI — one-shot builds and artifact emission for any build system",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"animus",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"compile": "bun check"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@animus-ui/extract": "0.1.
|
|
44
|
+
"@animus-ui/extract": "0.1.44"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=22.12.0"
|