@animus-ui/cli 0.1.38 → 0.1.41
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 +8 -0
- package/dist/build.d.ts.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.cjs +17 -1
- package/dist/index.mjs +19 -3
- package/dist/writer.d.ts +8 -0
- package/dist/writer.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -119,6 +119,14 @@ lock that fails loud. The full contract, including the consistency-check
|
|
|
119
119
|
recipe for non-JS orchestrators, is in the
|
|
120
120
|
[standalone extraction contract](https://github.com/codecaaron/animus/blob/main/docs/standalone-extraction.md).
|
|
121
121
|
|
|
122
|
+
With `stylesheets: 'split'` in the config, the build also publishes
|
|
123
|
+
`styles.css` as consecutive slices, `styles.<slice>.<hash>.css` for the
|
|
124
|
+
foundation, components and utilities, and `stylesheets.json`, their names in
|
|
125
|
+
the order a document links them. Their bytes in order are `styles.css`'s, so
|
|
126
|
+
linking them in that order changes nothing in the cascade, and a slice an
|
|
127
|
+
edit leaves alone keeps its name and its cached copy. `commit.json` lists
|
|
128
|
+
them with the rest.
|
|
129
|
+
|
|
122
130
|
## License
|
|
123
131
|
|
|
124
132
|
MIT
|
package/dist/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAQA,OAAO,EAIL,iBAAiB,EAMlB,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;CACf;AAgBD,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,iBAAiB,EACzB,KAAK,GAAE,UAAe,GACrB,OAAO,CAAC,WAAW,CAAC,CAwDtB"}
|
package/dist/config.d.ts
CHANGED
|
@@ -44,6 +44,7 @@ export declare function projectResolvedConfig(config: ResolvedCliConfig): {
|
|
|
44
44
|
diagnostics: Readonly<Record<string, DiagnosticLevel>> | null;
|
|
45
45
|
verbose: "trace" | boolean;
|
|
46
46
|
targets: string | string[] | null;
|
|
47
|
+
keepDirSelector: boolean;
|
|
47
48
|
minify: boolean | null;
|
|
48
49
|
prefix: string | null;
|
|
49
50
|
prefixContextualVars: boolean;
|
|
@@ -53,6 +54,7 @@ export declare function projectResolvedConfig(config: ResolvedCliConfig): {
|
|
|
53
54
|
runtimeImport: string | null;
|
|
54
55
|
closedDynamicImports: import("@animus-ui/extract/pipeline").ClosedDynamicImport[] | null;
|
|
55
56
|
fontPreloads: import("@animus-ui/extract/pipeline").FontPreloadEntry[] | null;
|
|
57
|
+
stylesheets: import("@animus-ui/extract/pipeline").StylesheetDelivery;
|
|
56
58
|
exclude: readonly string[];
|
|
57
59
|
provenance: Record<string, OptionProvenance>;
|
|
58
60
|
};
|
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,OAAO,GAAG,OAAO,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,GAAG,YAAY,GAAG,KAAK,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,KAAK,CAAC;IACd,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,aAAa,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC9C;
|
|
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,OAAO,GAAG,OAAO,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,aAAa,GAAG,YAAY,GAAG,KAAK,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,KAAK,CAAC;IACd,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,aAAa,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,IAAI,EAAE,UAAU,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;CAC9C;AA8PD,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,QAAQ,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,iBAAiB,CAAC,CAyI5B;AAED;kEACkE;AAClE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,iBAAiB,EACzB,GAAG,EAAE,MAAM,GACV,MAAM,GAAG,IAAI,CAOf;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,iBAAiB;IAE3D,MAAM;IACN,IAAI;IACJ,UAAU;IACV,MAAM;IACN,IAAI;IACJ,MAAM;IACN,MAAM;IACN,WAAW;IACX,OAAO;IACP,OAAO;IACP,eAAe;IACf,MAAM;IACN,MAAM;IACN,oBAAoB;IACpB,MAAM;IACN,UAAU;IACV,SAAS;IACT,aAAa;IACb,oBAAoB;IACpB,YAAY;IACZ,WAAW;IACX,OAAO;IACP,UAAU;EAEb"}
|
package/dist/index.cjs
CHANGED
|
@@ -63,6 +63,7 @@ const COMMIT_FILE = _animus_ui_extract_session.CLI_COMMIT_ARTIFACT;
|
|
|
63
63
|
const LOCK_FILE = _animus_ui_extract_session.CLI_LOCK_ARTIFACT;
|
|
64
64
|
const ASSETS_DIR = _animus_ui_extract_session.SESSION_ASSETS_DIR;
|
|
65
65
|
const FONT_PRELOADS_FILE = _animus_ui_extract_session.CLI_FONT_PRELOADS_ARTIFACT;
|
|
66
|
+
const STYLESHEETS_FILE = _animus_ui_extract_session.CLI_STYLESHEETS_ARTIFACT;
|
|
66
67
|
function isFileExistsError(error) {
|
|
67
68
|
return error instanceof Object && "code" in error && error.code === "EEXIST";
|
|
68
69
|
}
|
|
@@ -105,7 +106,11 @@ const NAMED_PAYLOAD_FIELDS = [
|
|
|
105
106
|
[MANIFEST_FILE, "manifestJson"],
|
|
106
107
|
[FONT_PRELOADS_FILE, "fontPreloadsJson"]
|
|
107
108
|
];
|
|
108
|
-
const PUBLISHED_NAMES = [
|
|
109
|
+
const PUBLISHED_NAMES = [
|
|
110
|
+
...NAMED_PAYLOAD_FIELDS.map(([name]) => name),
|
|
111
|
+
STYLESHEETS_FILE,
|
|
112
|
+
COMMIT_FILE
|
|
113
|
+
];
|
|
109
114
|
/** Called only while the claim is held — deciding a tree is debris and
|
|
110
115
|
* deleting it is a write. A live pid's tree is its own working set. */
|
|
111
116
|
function reapAbandonedStaging(outDir) {
|
|
@@ -194,6 +199,10 @@ function publishArtifacts(outDir, payloads) {
|
|
|
194
199
|
const text = payloads[field];
|
|
195
200
|
if (text !== void 0) namedPayloads.push([name, text]);
|
|
196
201
|
}
|
|
202
|
+
if (payloads.stylesheets !== void 0) {
|
|
203
|
+
for (const { name, css } of payloads.stylesheets) namedPayloads.push([name, css]);
|
|
204
|
+
namedPayloads.push([STYLESHEETS_FILE, JSON.stringify(payloads.stylesheets.map(({ name }) => name))]);
|
|
205
|
+
}
|
|
197
206
|
const record = {
|
|
198
207
|
schema: 1,
|
|
199
208
|
payloads: {}
|
|
@@ -317,6 +326,7 @@ function publishSharedPayloads(config, session) {
|
|
|
317
326
|
assets: (0, _animus_ui_extract_session.collectSessionAssets)(session.sessionDir)
|
|
318
327
|
};
|
|
319
328
|
if (fontPreloads.length > 0) payloads.fontPreloadsJson = JSON.stringify(fontPreloads);
|
|
329
|
+
if (options.stylesheets === "split") payloads.stylesheets = (0, _animus_ui_extract_pipeline.stylesheetSliceFiles)(stylesCss, "styles");
|
|
320
330
|
try {
|
|
321
331
|
publishArtifacts(outDir, payloads);
|
|
322
332
|
} catch (error) {
|
|
@@ -476,12 +486,14 @@ function parseLoadedCliConfig(raw) {
|
|
|
476
486
|
prefix: isConfigString(raw.prefix) ? raw.prefix : void 0,
|
|
477
487
|
prefixContextualVars: isConfigBoolean(raw.prefixContextualVars) ? raw.prefixContextualVars : void 0,
|
|
478
488
|
targets: isConfigString(raw.targets) || isConfigStringArray(raw.targets) ? raw.targets : void 0,
|
|
489
|
+
keepDirSelector: isConfigBoolean(raw.keepDirSelector) ? raw.keepDirSelector : void 0,
|
|
479
490
|
minify: isConfigBoolean(raw.minify) ? raw.minify : void 0,
|
|
480
491
|
staticCss: configStaticCss(raw.staticCss),
|
|
481
492
|
layers: isConfigStringArray(raw.layers) ? raw.layers : void 0,
|
|
482
493
|
runtimeImport: isConfigString(raw.runtimeImport) ? raw.runtimeImport : void 0,
|
|
483
494
|
closedDynamicImports: Array.isArray(raw.closedDynamicImports) ? raw.closedDynamicImports : void 0,
|
|
484
495
|
fontPreloads: Array.isArray(raw.fontPreloads) ? raw.fontPreloads : void 0,
|
|
496
|
+
stylesheets: raw.stylesheets === "single" || raw.stylesheets === "split" ? raw.stylesheets : void 0,
|
|
485
497
|
mode: raw.mode === "development" || raw.mode === "production" ? raw.mode : void 0
|
|
486
498
|
},
|
|
487
499
|
cli: { outDir: cli.outDir }
|
|
@@ -571,12 +583,14 @@ async function resolveCliConfig(flags, cwd) {
|
|
|
571
583
|
prefix: pick("prefix", void 0),
|
|
572
584
|
prefixContextualVars: pick("prefixContextualVars", void 0),
|
|
573
585
|
targets: pick("targets", flags.targets),
|
|
586
|
+
keepDirSelector: pick("keepDirSelector", void 0),
|
|
574
587
|
minify: pick("minify", void 0),
|
|
575
588
|
staticCss: pick("staticCss", void 0),
|
|
576
589
|
layers: pick("layers", void 0),
|
|
577
590
|
runtimeImport: pick("runtimeImport", void 0),
|
|
578
591
|
closedDynamicImports: pick("closedDynamicImports", void 0),
|
|
579
592
|
fontPreloads: pick("fontPreloads", void 0),
|
|
593
|
+
stylesheets: pick("stylesheets", void 0),
|
|
580
594
|
mode: resolvedMode.mode
|
|
581
595
|
};
|
|
582
596
|
const excludePatterns = (0, _animus_ui_extract_pipeline.createExcludeMatcher)(options.exclude).patterns;
|
|
@@ -610,6 +624,7 @@ function projectResolvedConfig(config) {
|
|
|
610
624
|
diagnostics: config.options.diagnostics ?? null,
|
|
611
625
|
verbose: config.options.verbose ?? false,
|
|
612
626
|
targets: config.options.targets ?? null,
|
|
627
|
+
keepDirSelector: config.options.keepDirSelector ?? false,
|
|
613
628
|
minify: config.options.minify ?? null,
|
|
614
629
|
prefix: config.options.prefix ?? null,
|
|
615
630
|
prefixContextualVars: config.options.prefixContextualVars ?? false,
|
|
@@ -619,6 +634,7 @@ function projectResolvedConfig(config) {
|
|
|
619
634
|
runtimeImport: config.options.runtimeImport ?? null,
|
|
620
635
|
closedDynamicImports: config.options.closedDynamicImports ?? null,
|
|
621
636
|
fontPreloads: config.options.fontPreloads ?? null,
|
|
637
|
+
stylesheets: config.options.stylesheets ?? "single",
|
|
622
638
|
exclude: config.excludePatterns,
|
|
623
639
|
provenance: config.provenance
|
|
624
640
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AnimusConfigError, DIAGNOSTIC_LEVELS, KIT_DESCRIPTOR_FILE, REPLACEABLE_DEFAULT_EXCLUDE, STRUCTURAL_EXCLUDE, assertKnownOptionKeys, assertSupportedEngine, buildKitDescriptor, contentHash, createExcludeMatcher, kitPublicationFailures, outputExclusion, renderFontPreloads, resolveMode, runStructuralSelfCheck } from "@animus-ui/extract/pipeline";
|
|
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, 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, 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";
|
|
@@ -62,6 +62,7 @@ const COMMIT_FILE = CLI_COMMIT_ARTIFACT;
|
|
|
62
62
|
const LOCK_FILE = CLI_LOCK_ARTIFACT;
|
|
63
63
|
const ASSETS_DIR = SESSION_ASSETS_DIR;
|
|
64
64
|
const FONT_PRELOADS_FILE = CLI_FONT_PRELOADS_ARTIFACT;
|
|
65
|
+
const STYLESHEETS_FILE = CLI_STYLESHEETS_ARTIFACT;
|
|
65
66
|
function isFileExistsError(error) {
|
|
66
67
|
return error instanceof Object && "code" in error && error.code === "EEXIST";
|
|
67
68
|
}
|
|
@@ -104,7 +105,11 @@ const NAMED_PAYLOAD_FIELDS = [
|
|
|
104
105
|
[MANIFEST_FILE, "manifestJson"],
|
|
105
106
|
[FONT_PRELOADS_FILE, "fontPreloadsJson"]
|
|
106
107
|
];
|
|
107
|
-
const PUBLISHED_NAMES = [
|
|
108
|
+
const PUBLISHED_NAMES = [
|
|
109
|
+
...NAMED_PAYLOAD_FIELDS.map(([name]) => name),
|
|
110
|
+
STYLESHEETS_FILE,
|
|
111
|
+
COMMIT_FILE
|
|
112
|
+
];
|
|
108
113
|
/** Called only while the claim is held — deciding a tree is debris and
|
|
109
114
|
* deleting it is a write. A live pid's tree is its own working set. */
|
|
110
115
|
function reapAbandonedStaging(outDir) {
|
|
@@ -193,6 +198,10 @@ function publishArtifacts(outDir, payloads) {
|
|
|
193
198
|
const text = payloads[field];
|
|
194
199
|
if (text !== void 0) namedPayloads.push([name, text]);
|
|
195
200
|
}
|
|
201
|
+
if (payloads.stylesheets !== void 0) {
|
|
202
|
+
for (const { name, css } of payloads.stylesheets) namedPayloads.push([name, css]);
|
|
203
|
+
namedPayloads.push([STYLESHEETS_FILE, JSON.stringify(payloads.stylesheets.map(({ name }) => name))]);
|
|
204
|
+
}
|
|
196
205
|
const record = {
|
|
197
206
|
schema: 1,
|
|
198
207
|
payloads: {}
|
|
@@ -316,6 +325,7 @@ function publishSharedPayloads(config, session) {
|
|
|
316
325
|
assets: collectSessionAssets(session.sessionDir)
|
|
317
326
|
};
|
|
318
327
|
if (fontPreloads.length > 0) payloads.fontPreloadsJson = JSON.stringify(fontPreloads);
|
|
328
|
+
if (options.stylesheets === "split") payloads.stylesheets = stylesheetSliceFiles(stylesCss, "styles");
|
|
319
329
|
try {
|
|
320
330
|
publishArtifacts(outDir, payloads);
|
|
321
331
|
} catch (error) {
|
|
@@ -475,12 +485,14 @@ function parseLoadedCliConfig(raw) {
|
|
|
475
485
|
prefix: isConfigString(raw.prefix) ? raw.prefix : void 0,
|
|
476
486
|
prefixContextualVars: isConfigBoolean(raw.prefixContextualVars) ? raw.prefixContextualVars : void 0,
|
|
477
487
|
targets: isConfigString(raw.targets) || isConfigStringArray(raw.targets) ? raw.targets : void 0,
|
|
488
|
+
keepDirSelector: isConfigBoolean(raw.keepDirSelector) ? raw.keepDirSelector : void 0,
|
|
478
489
|
minify: isConfigBoolean(raw.minify) ? raw.minify : void 0,
|
|
479
490
|
staticCss: configStaticCss(raw.staticCss),
|
|
480
491
|
layers: isConfigStringArray(raw.layers) ? raw.layers : void 0,
|
|
481
492
|
runtimeImport: isConfigString(raw.runtimeImport) ? raw.runtimeImport : void 0,
|
|
482
493
|
closedDynamicImports: Array.isArray(raw.closedDynamicImports) ? raw.closedDynamicImports : void 0,
|
|
483
494
|
fontPreloads: Array.isArray(raw.fontPreloads) ? raw.fontPreloads : void 0,
|
|
495
|
+
stylesheets: raw.stylesheets === "single" || raw.stylesheets === "split" ? raw.stylesheets : void 0,
|
|
484
496
|
mode: raw.mode === "development" || raw.mode === "production" ? raw.mode : void 0
|
|
485
497
|
},
|
|
486
498
|
cli: { outDir: cli.outDir }
|
|
@@ -570,12 +582,14 @@ async function resolveCliConfig(flags, cwd) {
|
|
|
570
582
|
prefix: pick("prefix", void 0),
|
|
571
583
|
prefixContextualVars: pick("prefixContextualVars", void 0),
|
|
572
584
|
targets: pick("targets", flags.targets),
|
|
585
|
+
keepDirSelector: pick("keepDirSelector", void 0),
|
|
573
586
|
minify: pick("minify", void 0),
|
|
574
587
|
staticCss: pick("staticCss", void 0),
|
|
575
588
|
layers: pick("layers", void 0),
|
|
576
589
|
runtimeImport: pick("runtimeImport", void 0),
|
|
577
590
|
closedDynamicImports: pick("closedDynamicImports", void 0),
|
|
578
591
|
fontPreloads: pick("fontPreloads", void 0),
|
|
592
|
+
stylesheets: pick("stylesheets", void 0),
|
|
579
593
|
mode: resolvedMode.mode
|
|
580
594
|
};
|
|
581
595
|
const excludePatterns = createExcludeMatcher(options.exclude).patterns;
|
|
@@ -609,6 +623,7 @@ function projectResolvedConfig(config) {
|
|
|
609
623
|
diagnostics: config.options.diagnostics ?? null,
|
|
610
624
|
verbose: config.options.verbose ?? false,
|
|
611
625
|
targets: config.options.targets ?? null,
|
|
626
|
+
keepDirSelector: config.options.keepDirSelector ?? false,
|
|
612
627
|
minify: config.options.minify ?? null,
|
|
613
628
|
prefix: config.options.prefix ?? null,
|
|
614
629
|
prefixContextualVars: config.options.prefixContextualVars ?? false,
|
|
@@ -618,6 +633,7 @@ function projectResolvedConfig(config) {
|
|
|
618
633
|
runtimeImport: config.options.runtimeImport ?? null,
|
|
619
634
|
closedDynamicImports: config.options.closedDynamicImports ?? null,
|
|
620
635
|
fontPreloads: config.options.fontPreloads ?? null,
|
|
636
|
+
stylesheets: config.options.stylesheets ?? "single",
|
|
621
637
|
exclude: config.excludePatterns,
|
|
622
638
|
provenance: config.provenance
|
|
623
639
|
};
|
package/dist/writer.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const COMMIT_FILE = "commit.json";
|
|
|
7
7
|
export declare const LOCK_FILE = "lock.json";
|
|
8
8
|
export declare const ASSETS_DIR = "assets";
|
|
9
9
|
export declare const FONT_PRELOADS_FILE = "font-preloads.json";
|
|
10
|
+
export declare const STYLESHEETS_FILE = "stylesheets.json";
|
|
10
11
|
export interface ArtifactPayloads {
|
|
11
12
|
stylesCss: string;
|
|
12
13
|
systemPropsJs: string;
|
|
@@ -14,6 +15,13 @@ export interface ArtifactPayloads {
|
|
|
14
15
|
/** The faces' preloads, hrefs relative to styles.css, for
|
|
15
16
|
* `renderFontPreloads`; absent when no face preloads. */
|
|
16
17
|
fontPreloadsJson?: string;
|
|
18
|
+
/** A split build's stylesheet files in link order, published beside
|
|
19
|
+
* styles.css, whose bytes in order are styles.css's, with
|
|
20
|
+
* stylesheets.json naming them; absent for one sheet. */
|
|
21
|
+
stylesheets?: ReadonlyArray<{
|
|
22
|
+
name: string;
|
|
23
|
+
css: string;
|
|
24
|
+
}>;
|
|
17
25
|
/** Published under `assets/<name>` beside styles.css — the stylesheet's
|
|
18
26
|
* relative urls dangle without them. */
|
|
19
27
|
assets?: readonly SessionAsset[];
|
package/dist/writer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../src/writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAe,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../src/writer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAe,MAAM,6BAA6B,CAAC;AA8B7E,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAI7E,eAAO,MAAM,WAAW,eAAkB,CAAC;AAC3C,eAAO,MAAM,iBAAiB,oBAAwB,CAAC;AACvD,eAAO,MAAM,aAAa,kBAAoB,CAAC;AAC/C,eAAO,MAAM,WAAW,gBAAsB,CAAC;AAC/C,eAAO,MAAM,SAAS,cAAoB,CAAC;AAC3C,eAAO,MAAM,UAAU,WAAqB,CAAC;AAC7C,eAAO,MAAM,kBAAkB,uBAA6B,CAAC;AAC7D,eAAO,MAAM,gBAAgB,qBAA2B,CAAC;AAEzD,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB;8DAC0D;IAC1D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B;;8DAE0D;IAC1D,WAAW,CAAC,EAAE,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3D;6CACyC;IACzC,MAAM,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CAClC;AAYD;8DAC8D;AAC9D,qBAAa,yBAA0B,SAAQ,KAAK;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE;IAAvC,YAAqB,QAAQ,EAAE,MAAM,EAAE,EAKtC;CACF;AAED,qBAAa,0BAA0B,CAAC,MAAM,CAAE,SAAQ,KAAK;IAEzD,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,wDAAwD;IACxD,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM;IAJ1B,YACW,MAAM,EAAE,MAAM;IACvB,wDAAwD;IAC/C,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,OAAO,EAAE,MAAM,EASzB;CACF;AAED;yEACyE;AACzE,qBAAa,uBAAwB,SAAQ,iBAAiB;IAC5D,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAqDD,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,CAoDtD;AAeD;4EAC4E;AAC5E,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,gBAAgB,GACzB,YAAY,CA8Fd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@animus-ui/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.41",
|
|
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.41"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": ">=22.12.0"
|