@astryxdesign/cli 0.7.0-canary.db75a96 → 0.7.0-canary.de3959f
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 +30 -33
- package/api/build/build.mjs +9 -0
- package/api/component/_adapter.d.mts +2 -0
- package/api/component/_adapter.mjs +3 -1
- package/api/component/component.doc.mjs +5 -1
- package/api/docs/compiled-topics.test.mjs +16 -0
- package/api/doctor/doctor.doc.mjs +1 -1
- package/api/doctor/doctor.test.mjs +28 -0
- package/api/doctor/theme-checks.mjs +10 -10
- package/api/doctor/theme-checks.test.mjs +5 -4
- package/api/gap-report/gap-report.doc.mjs +1 -1
- package/api/gap-report/gap-report.mjs +15 -0
- package/api/gap-report/gap-report.test.mjs +1 -1
- package/api/index.d.mts +0 -2
- package/api/index.mjs +0 -2
- package/api/init/init.doc.mjs +5 -1
- package/api/init/init.mjs +22 -0
- package/api/init/init.type.d.mts +4 -1
- package/api/init/init.type.mjs +1 -1
- package/api/init/remove/remove.mjs +8 -3
- package/api/init/remove/remove.test.mjs +12 -0
- package/api/init/run/run.d.mts +1 -1
- package/api/init/run/run.mjs +3 -3
- package/api/integration/validate-integration.d.mts +4 -0
- package/api/integration/validate-integration.mjs +5 -2
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/json/index.ts +0 -1
- package/api/search/search.doc.mjs +1 -1
- package/api/search/search.mjs +1 -1
- package/api/search/search.test.mjs +1 -1
- package/api/search/search.type.d.mts +1 -1
- package/api/search/search.type.mjs +1 -1
- package/api/template/list/list.mjs +23 -2
- package/api/template/list/list.test.mjs +52 -0
- package/api/template/template-integration.test.mjs +37 -100
- package/api/template/template.doc.mjs +7 -2
- package/api/template/template.mjs +45 -0
- package/api/theme/_adapter.mjs +3 -3
- package/api/theme/add/add.d.mts +11 -5
- package/api/theme/add/add.mjs +19 -192
- package/api/theme/add/add.test.mjs +68 -258
- package/api/theme/add/add.types.test.mjs +0 -1
- package/api/theme/build/build.d.mts +3 -3
- package/api/theme/build/build.mjs +22 -36
- package/api/theme/build/build.test.mjs +11 -24
- package/api/theme/eject/eject.copy-compat.test.mjs +168 -0
- package/api/theme/integration-themes.test.mjs +3 -3
- package/api/theme/remove/remove.test.mjs +1 -1
- package/api/theme/targets/targets.test.mjs +0 -4
- package/api/theme/template/template.mjs +1 -1
- package/api/theme/theme.type.d.mts +1 -30
- package/api/theme/theme.type.mjs +3 -13
- package/api/theme/themeAdd.doc.mjs +19 -27
- package/api/theme/themeTargets.doc.mjs +3 -4
- package/api/theme/themeTemplate.doc.mjs +1 -1
- package/api/theme/use/use.test.mjs +1 -1
- package/api/upgrade/upgrade.doc.mjs +1 -1
- package/api/upgrade/upgrade.mjs +19 -0
- package/assets/codemods/transforms/next/README.md +15 -17
- package/assets/codemods/transforms/next/__tests__/migrate-deprecated-theme-surface.test.mjs +322 -0
- package/assets/codemods/transforms/next/index.mjs +11 -1
- package/assets/codemods/transforms/next/migrate-deprecated-theme-surface-v0.6-data.mjs +229 -0
- package/assets/codemods/transforms/next/migrate-deprecated-theme-surface.mjs +624 -0
- package/assets/codemods/transforms/v0.6.0/migrate-astryx-theme-selectors-to-data-attrs.mjs +38 -18
- package/assets/docs/author-a-theme.doc.mjs +4 -4
- package/assets/docs/getting-started.doc.mjs +2 -2
- package/assets/docs/theme.doc.dense.mjs +1 -1
- package/assets/docs/theme.doc.mjs +2 -2
- package/assets/docs/tree/add-a-theme.doc.mjs +1 -1
- package/assets/docs/tree/document-the-theme.doc.mjs +2 -2
- package/assets/docs/tree/fonts-and-assets.doc.mjs +3 -3
- package/assets/docs/tree/styling-advanced.doc.mjs +21 -14
- package/assets/docs/tree/themes.doc.mjs +1 -1
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +2 -2
- package/assets/docs/tree/versioning.doc.mjs +1 -4
- package/assets/docs/use-a-theme.doc.mjs +16 -16
- package/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts +10 -9
- package/authoring/debug/type.ts +2 -2
- package/authoring/doctypes/base/type.ts +0 -9
- package/authoring/integration/integration.doc.mjs +1 -1
- package/clients/cli/command-result-coverage.test.mjs +1 -1
- package/clients/cli/commands/build-theme.adaptations.test.mjs +4 -0
- package/clients/cli/commands/build-theme.ascii-output.test.mjs +35 -8
- package/clients/cli/commands/build-theme.mjs +31 -67
- package/clients/cli/commands/build-theme.registry.test.mjs +0 -10
- package/clients/cli/commands/build.doc.mjs +1 -1
- package/clients/cli/commands/build.mjs +1 -1
- package/clients/cli/commands/component-ownership.test.mjs +2 -2
- package/clients/cli/commands/debug-result-summary.test.mjs +0 -16
- package/clients/cli/commands/discover.mjs +2 -1
- package/clients/cli/commands/doctor.mjs +5 -2
- package/clients/cli/commands/empty-argument.test.mjs +16 -0
- package/clients/cli/commands/gap-report.doc.mjs +1 -1
- package/clients/cli/commands/gap-report.test.mjs +2 -2
- package/clients/cli/commands/init.doc.mjs +4 -4
- package/clients/cli/commands/init.flag-help.test.mjs +7 -10
- package/clients/cli/commands/init.next-steps.test.mjs +1 -1
- package/clients/cli/commands/integration.mjs +2 -1
- package/clients/cli/commands/option-pair-refusals.test.mjs +37 -0
- package/clients/cli/commands/search.test.mjs +1 -1
- package/clients/cli/commands/silent-success-refusals.test.mjs +15 -0
- package/clients/cli/commands/swizzle.mjs +4 -1
- package/clients/cli/commands/template.doc.mjs +4 -4
- package/clients/cli/commands/template.flag-help.test.mjs +18 -11
- package/clients/cli/commands/template.mjs +7 -1
- package/clients/cli/commands/text-json-parity.test.mjs +0 -17
- package/clients/cli/commands/theme-add-lifecycle.test.mjs +142 -49
- package/clients/cli/commands/theme-add.doc.mjs +10 -17
- package/clients/cli/commands/theme-list.behavior.test.mjs +2 -1
- package/clients/cli/commands/theme-targets.behavior.test.mjs +8 -6
- package/clients/cli/commands/theme-template.doc.mjs +1 -1
- package/clients/cli/commands/theme.doc.mjs +2 -2
- package/clients/cli/commands/upgrade.doc.mjs +1 -1
- package/clients/cli/commands/upgrade.flag-help.test.mjs +7 -11
- package/clients/cli/commands/validate-nothing-exits-nonzero.test.mjs +67 -0
- package/clients/cli/index.mjs +0 -4
- package/clients/cli/lib/cli-error.mjs +19 -0
- package/clients/cli/lib/component-format.mjs +111 -57
- package/clients/cli/lib/component-format.test.mjs +28 -39
- package/clients/cli/lib/doc-text-ascii.test.mjs +5 -2
- package/clients/cli/lib/exit-codes.test.mjs +0 -7
- package/clients/cli/lib/json-shim.test.mjs +0 -24
- package/foundation/agent-docs/agent-docs.d.mts +2 -1
- package/foundation/agent-docs/agent-docs.mjs +6 -1
- package/foundation/agent-docs/app-theme-workflow.test.mjs +3 -0
- package/foundation/config/theme-state.mjs +3 -3
- package/foundation/debug/debug-fields.test.mjs +13 -35
- package/foundation/debug/event.mjs +13 -78
- package/foundation/debug/privacy-contract.test.mjs +20 -12
- package/foundation/debug/redact.d.mts +2 -2
- package/foundation/debug/redact.mjs +2 -2
- package/foundation/discovery/theme-imports.mjs +1 -1
- package/foundation/discovery/theming-targets.d.mts +1 -20
- package/foundation/discovery/theming-targets.mjs +1 -38
- package/foundation/discovery/theming-targets.test.mjs +9 -175
- package/foundation/doc-compiler/doc-loads.test.mjs +0 -12
- package/foundation/response/error-codes.doc.mjs +1 -1
- package/foundation/response/response-types.doc.mjs +11 -30
- package/foundation/response/response-types.doc.test.mjs +36 -14
- package/foundation/response/response.doc.mjs +1 -1
- package/foundation/xle/browser.d.mts +2 -2
- package/foundation/xle/browser.mjs +2 -2
- package/foundation/xle/expand.mjs +1 -1
- package/foundation/xle/print.mjs +1 -1
- package/package.json +9 -9
- package/api/layout/_adapter.d.mts +0 -34
- package/api/layout/_adapter.mjs +0 -148
- package/api/layout/check/check.d.mts +0 -17
- package/api/layout/check/check.mjs +0 -41
- package/api/layout/expand/expand.d.mts +0 -23
- package/api/layout/expand/expand.mjs +0 -161
- package/api/layout/expand/expand.path-safety.test.mjs +0 -53
- package/api/layout/expand/expand.receipt.test.mjs +0 -74
- package/api/layout/grammar/grammar.d.mts +0 -14
- package/api/layout/grammar/grammar.mjs +0 -88
- package/api/layout/layout.d.mts +0 -6
- package/api/layout/layout.mjs +0 -17
- package/api/layout/layout.test.mjs +0 -297
- package/api/layout/layout.type.d.mts +0 -90
- package/api/layout/layout.type.mjs +0 -104
- package/api/layout/layoutCheck.doc.d.mts +0 -11
- package/api/layout/layoutCheck.doc.mjs +0 -85
- package/api/layout/layoutExpand.doc.d.mts +0 -11
- package/api/layout/layoutExpand.doc.mjs +0 -107
- package/api/layout/layoutGrammar.doc.d.mts +0 -11
- package/api/layout/layoutGrammar.doc.mjs +0 -57
- package/api/theme/add/add.binary.test.mjs +0 -157
- package/api/theme/add/add.rollback.test.mjs +0 -158
- package/api/theme/add/add.staging.test.mjs +0 -83
- package/clients/cli/commands/layout-check.doc.mjs +0 -67
- package/clients/cli/commands/layout-expand.doc.mjs +0 -87
- package/clients/cli/commands/layout-grammar.doc.mjs +0 -32
- package/clients/cli/commands/layout.deprecation-lifecycle.test.mjs +0 -140
- package/clients/cli/commands/layout.doc.mjs +0 -36
- package/clients/cli/commands/layout.error-codes.test.mjs +0 -66
- package/clients/cli/commands/layout.exit-parity.test.mjs +0 -41
- package/clients/cli/commands/layout.expand-receipt.test.mjs +0 -94
- package/clients/cli/commands/layout.mjs +0 -327
- package/clients/cli/commands/layout.path-help.test.mjs +0 -33
- package/clients/cli/commands/layout.stdin-cap.test.mjs +0 -47
- package/clients/cli/commands/layout.text-fields.test.mjs +0 -39
|
@@ -30,10 +30,16 @@ export const meta = {
|
|
|
30
30
|
/** @typedef {[string, string]} AttributeCandidate */
|
|
31
31
|
/** @typedef {AttributeCandidate | AttributeCandidate[]} CandidateEntry */
|
|
32
32
|
|
|
33
|
+
/** @typedef {Record<string, Array<{axis: string, token: 'class-value' | 'prefixed', prefix?: string}>>} DynamicAxes */
|
|
34
|
+
/** @typedef {{targets: Record<string, Record<string, CandidateEntry>>, dynamicAxes: DynamicAxes}} SelectorData */
|
|
35
|
+
|
|
36
|
+
// The selector tables in effect for the current synchronous migration. They
|
|
37
|
+
// default to the 0.5.4 snapshot this codemod shipped with; a later release can
|
|
38
|
+
// pass a newer frozen snapshot to migrateAstryxThemeSelectors().
|
|
33
39
|
/** @type {Record<string, Record<string, CandidateEntry>>} */
|
|
34
|
-
|
|
35
|
-
/** @type {
|
|
36
|
-
|
|
40
|
+
let TARGETS = V054_THEME_SELECTOR_TARGETS;
|
|
41
|
+
/** @type {DynamicAxes} */
|
|
42
|
+
let DYNAMIC_AXES = V054_THEME_SELECTOR_DYNAMIC_AXES;
|
|
37
43
|
const SAME_ELEMENT_FUNCTIONAL_PSEUDOS = new Set([':is', ':where', ':not']);
|
|
38
44
|
|
|
39
45
|
/** @param {string} axis */
|
|
@@ -108,7 +114,10 @@ function candidatesFor(target, token) {
|
|
|
108
114
|
function dedupeCandidates(candidates) {
|
|
109
115
|
return [
|
|
110
116
|
...new Map(
|
|
111
|
-
candidates.map(candidate => [
|
|
117
|
+
candidates.map(candidate => [
|
|
118
|
+
`${candidate[0]}\0${candidate[1]}`,
|
|
119
|
+
candidate,
|
|
120
|
+
]),
|
|
112
121
|
).values(),
|
|
113
122
|
];
|
|
114
123
|
}
|
|
@@ -410,10 +419,7 @@ function migrateCompound(
|
|
|
410
419
|
const selectorArms = node.nodes.filter(
|
|
411
420
|
(/** @type {any} */ selector) => selector.type === 'selector',
|
|
412
421
|
);
|
|
413
|
-
if (
|
|
414
|
-
completedArms.size > 0 &&
|
|
415
|
-
completedArms.size === selectorArms.length
|
|
416
|
-
) {
|
|
422
|
+
if (completedArms.size > 0 && completedArms.size === selectorArms.length) {
|
|
417
423
|
continue;
|
|
418
424
|
}
|
|
419
425
|
if (node.value === ':nth-child' || node.value === ':nth-last-child') {
|
|
@@ -427,11 +433,7 @@ function migrateCompound(
|
|
|
427
433
|
: [];
|
|
428
434
|
for (const selector of selectorArms) {
|
|
429
435
|
if (completedArms.has(selector)) continue;
|
|
430
|
-
migrateSelectorNode(
|
|
431
|
-
selector,
|
|
432
|
-
nestedTargets,
|
|
433
|
-
nestedConditionalTargets,
|
|
434
|
-
);
|
|
436
|
+
migrateSelectorNode(selector, nestedTargets, nestedConditionalTargets);
|
|
435
437
|
}
|
|
436
438
|
}
|
|
437
439
|
|
|
@@ -490,9 +492,7 @@ function combineSelectorListContexts(contexts) {
|
|
|
490
492
|
);
|
|
491
493
|
return {
|
|
492
494
|
guaranteed,
|
|
493
|
-
possible: [
|
|
494
|
-
...new Set(contexts.flatMap(context => context.possible)),
|
|
495
|
-
],
|
|
495
|
+
possible: [...new Set(contexts.flatMap(context => context.possible))],
|
|
496
496
|
};
|
|
497
497
|
}
|
|
498
498
|
|
|
@@ -655,8 +655,28 @@ function migrateScopeParams(params) {
|
|
|
655
655
|
return result + params.slice(last);
|
|
656
656
|
}
|
|
657
657
|
|
|
658
|
+
/**
|
|
659
|
+
* @param {string} source
|
|
660
|
+
* @param {string} [from]
|
|
661
|
+
* @param {SelectorData} [data] frozen selector tables; defaults to 0.5.4
|
|
662
|
+
* @returns {string}
|
|
663
|
+
*/
|
|
664
|
+
export function migrateAstryxThemeSelectors(source, from = 'styles.css', data) {
|
|
665
|
+
if (data == null) return migrateWithActiveTables(source, from);
|
|
666
|
+
const previousTargets = TARGETS;
|
|
667
|
+
const previousAxes = DYNAMIC_AXES;
|
|
668
|
+
TARGETS = data.targets;
|
|
669
|
+
DYNAMIC_AXES = data.dynamicAxes;
|
|
670
|
+
try {
|
|
671
|
+
return migrateWithActiveTables(source, from);
|
|
672
|
+
} finally {
|
|
673
|
+
TARGETS = previousTargets;
|
|
674
|
+
DYNAMIC_AXES = previousAxes;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
658
678
|
/** @param {string} source @param {string} from @returns {string} */
|
|
659
|
-
|
|
679
|
+
function migrateWithActiveTables(source, from) {
|
|
660
680
|
const root = postcss.parse(source, {from});
|
|
661
681
|
const existingComments = new Set();
|
|
662
682
|
root.walkComments(comment => {
|
|
@@ -683,7 +703,7 @@ export function migrateAstryxThemeSelectors(source, from = 'styles.css') {
|
|
|
683
703
|
}
|
|
684
704
|
const parentContext =
|
|
685
705
|
parent?.type === 'rule'
|
|
686
|
-
? ruleContexts.get(parent) ?? {guaranteed: [], possible: []}
|
|
706
|
+
? (ruleContexts.get(parent) ?? {guaranteed: [], possible: []})
|
|
687
707
|
: {guaranteed: [], possible: []};
|
|
688
708
|
try {
|
|
689
709
|
const migrated = migrateSelectorTextWithContext(
|
|
@@ -15,7 +15,7 @@ export const docs = {
|
|
|
15
15
|
title: 'Custom themes',
|
|
16
16
|
content: [
|
|
17
17
|
{type: 'prose', text: "Use an installed built theme as the base for ordinary customization. Import it into your source and pass it as `extends` to `defineTheme({extends: importedTheme, ...})`. Build the result, then add the local slug. Only eject when you need to own and maintain a full source fork."},
|
|
18
|
-
{type: 'code', lang: 'bash', label: 'Add to use, eject to fork', code: 'astryx theme list\nastryx theme add stone
|
|
18
|
+
{type: 'code', lang: 'bash', label: 'Add to use, eject to fork', code: 'astryx theme list\nastryx theme add stone\nastryx theme eject stone\nastryx theme build src/themes/stone/stoneTheme.ts\nastryx theme add stone'},
|
|
19
19
|
{type: 'prose', text: "For an annotated map of the whole surface (every defineTheme field, the token families, and the component override syntax, each with the CLI command that prints its reference), run `astryx theme template`. It writes `theme.template.ts` into your project to read and copy from (`astryx init --features theme` writes it as part of project setup)."},
|
|
20
20
|
{type: 'prose', text: 'To apply a theme you created, see {@link generic:use-a-theme}. To generate colors from seed values, see the Palette section below. Use `theme eject` only when you want an independent source fork that no longer receives the package owner\u2019s updates.'},
|
|
21
21
|
],
|
|
@@ -34,10 +34,10 @@ export const docs = {
|
|
|
34
34
|
{
|
|
35
35
|
title: 'defineTheme',
|
|
36
36
|
content: [
|
|
37
|
-
{type: 'prose', text:
|
|
38
|
-
{type: 'code', lang: 'tsx', label: 'defineTheme with scale configs', code: "import {defineTheme} from '@astryxdesign/core/theme';\n\nconst myTheme = defineTheme({\n name: 'my-theme',\n
|
|
37
|
+
{type: 'prose', text: 'defineTheme creates a theme from explicit token overrides and optional scale configs. Existing themes may use `color` to expand an accent seed into neutral, surface, text, border, and related values; it is not an accent-only edit. Keep that configuration when preserving existing output. For new complete palettes, generate and review a committed palette module, then import its `palette` export and reference stable stops from semantic tokens. This keeps mapped roles coherent when the accepted palette is regenerated; generation itself does not rewrite the theme. Other scale configs generate typography, radius, and motion values from parameters. Explicit token overrides always take precedence over scale-generated values, token by token. When an existing `color` config is in use, overriding `--color-accent` in `tokens` re-points `--color-accent-muted`, `--color-text-accent`, and `--color-icon-accent`, but `--color-on-accent` stays baked from the `color.accent` seed. Prefer a `[light, dark]` tuple for `color.accent` over overriding `--color-accent` alone. localTokens accepts any valid CSS custom-property name; prefixes do not establish ownership.'},
|
|
38
|
+
{type: 'code', lang: 'tsx', label: 'defineTheme with generated palette references and non-color scale configs', code: "import {defineTheme} from '@astryxdesign/core/theme';\nimport {palette} from './palette.generated';\n\nconst myTheme = defineTheme({\n name: 'my-theme',\n typography: {\n scale: { base: 14, ratio: 1.2 },\n body: { family: 'Inter', fallbacks: '-apple-system, sans-serif' },\n },\n radius: { base: 4, multiplier: 1 },\n motion: { fast: 175, medium: 410, ratio: 0.75 },\n tokens: {\n '--color-background-surface': [\n palette.neutral.light[100],\n palette.neutral.dark[15],\n ],\n },\n});"},
|
|
39
39
|
{type: 'table', headers: ['Config', 'Generates', 'Parameters'], rows: [
|
|
40
|
-
['color', '--color-accent, --color-background-*, --color-text-*, --color-border, etc.', 'accent? (hex or [light, dark] tuple
|
|
40
|
+
['color (existing themes)', '--color-accent, --color-background-*, --color-text-*, --color-border, etc.', 'Supported broad scale: accent? (hex or [light, dark] tuple), neutralStyle? (warm|cool|neutral), contrast? (standard|high). Use theme palette generate for new complete palettes.'],
|
|
41
41
|
['typography.scale', '--text-heading-*-size/weight/leading, --text-body-size/weight/leading', 'base (px), ratio'],
|
|
42
42
|
['typography.body/heading/code', '--font-family-body, --font-family-heading, --font-family-code', 'family, fallbacks?, url?, weight?'],
|
|
43
43
|
['radius', '--radius-inner, --radius-element, --radius-container, --radius-page, --radius-chat', 'base (px), multiplier (0–2)'],
|
|
@@ -31,7 +31,7 @@ export const docs = {
|
|
|
31
31
|
type: 'code',
|
|
32
32
|
lang: 'text',
|
|
33
33
|
label: 'Give it a look',
|
|
34
|
-
code: 'Ask me what look and feel this app should have. Run `npx @astryxdesign/cli theme list`, install the closest theme package, and run `theme add <slug
|
|
34
|
+
code: 'Ask me what look and feel this app should have. Run `npx @astryxdesign/cli theme list`, install the closest theme package, and run `theme add <slug>`; use `--package` when owners share a slug. Import `themes` and `defaultThemeSlug` from the generated module once and pass `themes[defaultThemeSlug]` to `<Theme>`. Customize with `defineTheme({extends: importedTheme, ...})`. Use `theme eject` only when I ask for an independent source fork. Default to neutral if I have no preference, and show me the result before moving on.',
|
|
35
35
|
},
|
|
36
36
|
],
|
|
37
37
|
},
|
|
@@ -69,7 +69,7 @@ export const docs = {
|
|
|
69
69
|
content: [
|
|
70
70
|
{
|
|
71
71
|
type: 'prose',
|
|
72
|
-
text: 'Import the reset and base styles in your global CSS. Then run `astryx theme add neutral
|
|
72
|
+
text: 'Import the reset and base styles in your global CSS. Then run `astryx theme add neutral`; the generated app module imports the theme’s production CSS and font CSS.',
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
type: 'code',
|
|
@@ -32,7 +32,7 @@ export const docsDense = {
|
|
|
32
32
|
section: 'Integration themes',
|
|
33
33
|
title: 'Integration themes',
|
|
34
34
|
content: [
|
|
35
|
-
{type: 'prose', text: 'Install integration
|
|
35
|
+
{type: 'prose', text: 'Install integration. `astryx theme add` imports, and `theme eject` forks source. {@link generic:use-a-theme} for full guide.'},
|
|
36
36
|
],
|
|
37
37
|
},
|
|
38
38
|
],
|
|
@@ -39,7 +39,7 @@ export const docs = {
|
|
|
39
39
|
type: 'code',
|
|
40
40
|
lang: 'bash',
|
|
41
41
|
label: 'Quick start',
|
|
42
|
-
code: 'astryx theme add stone
|
|
42
|
+
code: 'astryx theme add stone # use an existing theme\nastryx theme eject stone # fork its source to customize\nastryx theme build src/themes/stone/stoneTheme.ts',
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
type: 'prose',
|
|
@@ -74,7 +74,7 @@ export const docs = {
|
|
|
74
74
|
content: [
|
|
75
75
|
{
|
|
76
76
|
type: 'prose',
|
|
77
|
-
text: 'Install an integration and Astryx discovers its themes automatically. Import one with `astryx theme add <name> --
|
|
77
|
+
text: 'Install an integration and Astryx discovers its themes automatically. Import one with `astryx theme add <name> --package <integration>`. Use `theme eject` only for an independent source fork. For the full walkthrough, see {@link generic:use-a-theme}.',
|
|
78
78
|
},
|
|
79
79
|
],
|
|
80
80
|
},
|
|
@@ -48,7 +48,7 @@ Declare theme root ./themes in astryx.integration.mjs.
|
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
type: 'prose',
|
|
51
|
-
text: 'The source and built outputs ship in your package. Build the source with `theme build`, then run `integration verify` before publishing. An app runs `theme add
|
|
51
|
+
text: 'The source and built outputs ship in your package. Build the source with `theme build`, then run `integration verify` before publishing. An app runs `theme add` to record and import the built module and stylesheets; `theme eject` creates an independent source fork. See {@link generic:use-a-theme-in-an-app}.',
|
|
52
52
|
},
|
|
53
53
|
],
|
|
54
54
|
},
|
|
@@ -41,7 +41,7 @@ export default {
|
|
|
41
41
|
content: [
|
|
42
42
|
{
|
|
43
43
|
type: 'prose',
|
|
44
|
-
text: 'Install @acme/astryx-widgets, then run astryx theme add ocean --
|
|
44
|
+
text: 'Install @acme/astryx-widgets, then run astryx theme add ocean --package @acme/astryx-widgets and apply it from the generated app theme module.',
|
|
45
45
|
},
|
|
46
46
|
],
|
|
47
47
|
},
|
|
@@ -50,7 +50,7 @@ export default {
|
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
type: 'prose',
|
|
53
|
-
text: 'Keep the section short: how to install the package, run `theme add
|
|
53
|
+
text: 'Keep the section short: how to install the package, run `theme add`, apply the generated module ({@link generic:use-a-theme-in-an-app}), and customize with `extends`. When the theme uses a custom font, name the families and the optional exported font stylesheet that `theme add` imports ({@link generic:fonts-and-assets}). Extend `theme` rather than a topic another package replaces, or an app that lists that package first drops your section.',
|
|
54
54
|
},
|
|
55
55
|
],
|
|
56
56
|
},
|
|
@@ -13,7 +13,7 @@ export const docs = {
|
|
|
13
13
|
title: 'Fonts and assets',
|
|
14
14
|
category: 'guide',
|
|
15
15
|
description:
|
|
16
|
-
'Name the fonts in the theme, then export an optional font stylesheet that `theme add
|
|
16
|
+
'Name the fonts in the theme, then export an optional font stylesheet that `theme add` imports with the built theme.',
|
|
17
17
|
sections: [
|
|
18
18
|
{
|
|
19
19
|
id: 'name-the-font',
|
|
@@ -48,7 +48,7 @@ export const oceanTheme = defineTheme({
|
|
|
48
48
|
content: [
|
|
49
49
|
{
|
|
50
50
|
type: 'prose',
|
|
51
|
-
text: 'Naming a family does not load it. When the theme uses non-system fonts, add `<slug>.fonts.css` beside the built module and production CSS, then export it as `./themes/<slug>.fonts.css`. `theme add
|
|
51
|
+
text: 'Naming a family does not load it. When the theme uses non-system fonts, add `<slug>.fonts.css` beside the built module and production CSS, then export it as `./themes/<slug>.fonts.css`. `theme add` imports that stylesheet with the built theme.',
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
type: 'code',
|
|
@@ -94,7 +94,7 @@ export const oceanTheme = defineTheme({
|
|
|
94
94
|
content: [
|
|
95
95
|
{
|
|
96
96
|
type: 'prose',
|
|
97
|
-
text: 'Before publishing, run `integration verify`. Then install the package in a clean app, run `theme add
|
|
97
|
+
text: 'Before publishing, run `integration verify`. Then install the package in a clean app, run `theme add`, apply the generated theme, and open it in a browser. The source, packed exports, and applied result form one chain; check the last step too.',
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
type: 'list',
|
|
@@ -14,11 +14,11 @@ export const docs = {
|
|
|
14
14
|
placement: {parent: 'namespace:styling', slot: 'guides', order: 20},
|
|
15
15
|
category: 'guide',
|
|
16
16
|
description:
|
|
17
|
-
'Compound component styling, data-attribute selectors,
|
|
17
|
+
'Compound component styling, data-attribute selectors, migrating removed theme compatibility selectors, and common anti-patterns.',
|
|
18
18
|
keywords: [
|
|
19
19
|
'compound',
|
|
20
20
|
'data attributes',
|
|
21
|
-
'
|
|
21
|
+
'removed classes',
|
|
22
22
|
'selector',
|
|
23
23
|
'astryx-button',
|
|
24
24
|
'data-variant',
|
|
@@ -114,28 +114,35 @@ const overrides = stylex.create({
|
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
id: 'deprecated-classes',
|
|
117
|
-
title: '
|
|
117
|
+
title: 'Migrating Removed Theme Compatibility Selectors',
|
|
118
118
|
content: [
|
|
119
119
|
{
|
|
120
120
|
type: 'prose',
|
|
121
|
-
text: 'Astryx
|
|
121
|
+
text: 'Astryx 0.7 emits canonical `astryx-*` target classes and reflected `data-*` attributes only. Run `astryx upgrade --from <your 0.6 version> --apply --path .` to rename removed target keys inside theme `components` maps and to migrate CSS selectors. The CSS migration renames removed target classes and replaces target-qualified bare prop/value/state classes such as `.primary`, `.sm`, `.level-2`, and `.checked` with their reflected `data-*` selectors.',
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
type: 'code',
|
|
125
125
|
lang: 'css',
|
|
126
|
-
code: `/*
|
|
127
|
-
.
|
|
128
|
-
|
|
129
|
-
}
|
|
126
|
+
code: `/* Before */
|
|
127
|
+
.astryx-progressbar.success > .astryx-progressbar-mark.fill {}
|
|
128
|
+
.astryx-selector-clear-icon { color: red; }
|
|
130
129
|
|
|
131
|
-
/*
|
|
132
|
-
.
|
|
133
|
-
|
|
134
|
-
}`,
|
|
130
|
+
/* After */
|
|
131
|
+
.astryx-progress-bar:is([data-variant="success"]) >
|
|
132
|
+
.astryx-progress-bar-mark:is([data-placement="fill"]) {}
|
|
133
|
+
.astryx-input-clear-icon:where(.astryx-selector *) { color: red; }`,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
type: 'prose',
|
|
137
|
+
text: 'Removed target mappings: `base-table` → `table`; `checkbox` → `checkbox-indicator`; `codeblock` → `code-block`; `codeblock-copy-button` → `code-block-copy-button`; `codeblock-header` → `code-block-header`; `codeblock-title` → `code-block-title`; `date-input-clear-icon`, `date-range-input-clear-icon`, `multi-selector-clear-icon`, and `selector-clear-icon` → `input-clear-icon`; `hovercard` → `hover-card`; `navicon` → `nav-icon`; `popover-surface` → `popover`; `progressbar`, `progressbar-fill`, `progressbar-mark`, and `progressbar-track` → their hyphenated `progress-bar*` forms; `radio` → `radio-indicator`; `radio-dot` → `radio-indicator-dot`; `statusdot` → `status-dot`; `textarea` → `text-area`.',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
type: 'prose',
|
|
141
|
+
text: '`input-clear-icon` styles the clear icon of every input. In CSS the upgrade keeps each old clear-icon rule on its component with `:where(.astryx-<component> *)`. A theme key cannot carry that scope, so the upgrade renames the key and adds a `TODO(astryx upgrade)` that names the CSS selector to use instead.',
|
|
135
142
|
},
|
|
136
143
|
{
|
|
137
144
|
type: 'prose',
|
|
138
|
-
text: 'The upgrade
|
|
145
|
+
text: 'The upgrade treats a `components` map as a theme when it belongs to a `defineTheme()` call imported from Astryx, an object typed as an Astryx theme, or a theme object with a static `name` whose component entries are style objects. It leaves computed theme keys, unqualified classes, unknown consumer classes, declarations, comments, and CSS inside JavaScript or TypeScript strings unchanged. It adds `TODO(astryx upgrade)` when a map has both an old and a canonical key, and when a bare class Astryx once emitted has no known meaning on the target it qualifies. Review each TODO by hand.',
|
|
139
146
|
},
|
|
140
147
|
],
|
|
141
148
|
},
|
|
@@ -150,7 +157,7 @@ const overrides = stylex.create({
|
|
|
150
157
|
'Hardcoded colors (#fff, rgb(...)). Use var(--color-*) tokens or Tailwind semantic classes (text-primary, bg-surface).',
|
|
151
158
|
'Hardcoded spacing (16px, 1rem). Use var(--spacing-*) tokens or Tailwind spacing utilities (p-4, gap-3).',
|
|
152
159
|
'Wrapping a component in a <div> just to add margin. Use xstyle with stylex.create on the component.',
|
|
153
|
-
|
|
160
|
+
"Using !important. If styles aren't applying, check specificity; xstyle is merged last.",
|
|
154
161
|
],
|
|
155
162
|
},
|
|
156
163
|
],
|
|
@@ -23,7 +23,7 @@ export const docs = {
|
|
|
23
23
|
blocks: [
|
|
24
24
|
{
|
|
25
25
|
type: 'prose',
|
|
26
|
-
text: 'A theme contribution has editable `defineTheme` source plus a built module and production CSS. `integration add theme` scaffolds the source and declares the package exports; `theme build` writes the built outputs. An app installs the package, runs `theme add
|
|
26
|
+
text: 'A theme contribution has editable `defineTheme` source plus a built module and production CSS. `integration add theme` scaffolds the source and declares the package exports; `theme build` writes the built outputs. An app installs the package, runs `theme add`, applies the theme from its generated app module, and customizes it with `extends` instead of copying source.',
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
type: 'prose',
|
|
@@ -21,12 +21,12 @@ export const docs = {
|
|
|
21
21
|
content: [
|
|
22
22
|
{
|
|
23
23
|
type: 'prose',
|
|
24
|
-
text: 'Install the integration, then run `theme add
|
|
24
|
+
text: 'Install the integration, then run `theme add` with its slug and package. The command records the package owner and regenerates one app theme module that imports the built theme, production CSS, and optional font CSS. Use `theme eject` only to copy source into an independent local fork.',
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
type: 'code',
|
|
28
28
|
lang: 'bash',
|
|
29
|
-
code: 'npm install @acme/astryx-widgets\nnpx astryx theme add ocean --
|
|
29
|
+
code: 'npm install @acme/astryx-widgets\nnpx astryx theme add ocean --package @acme/astryx-widgets',
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
type: 'code',
|
|
@@ -60,10 +60,7 @@ export const docs = {
|
|
|
60
60
|
'A template id, such as `acme-dashboard`',
|
|
61
61
|
'`npx astryx template acme-dashboard`',
|
|
62
62
|
],
|
|
63
|
-
[
|
|
64
|
-
'A theme slug, such as `ocean`',
|
|
65
|
-
'`npx astryx theme add ocean --import`',
|
|
66
|
-
],
|
|
63
|
+
['A theme slug, such as `ocean`', '`npx astryx theme add ocean`'],
|
|
67
64
|
[
|
|
68
65
|
'A topic name or route, such as `acme/deploying`',
|
|
69
66
|
'Reads of the old name, and links to it from other docs',
|
|
@@ -19,7 +19,7 @@ export const docs = {
|
|
|
19
19
|
type: 'code',
|
|
20
20
|
lang: 'bash',
|
|
21
21
|
label: 'Install and add a theme',
|
|
22
|
-
code: 'npm install @astryxdesign/theme-neutral\nastryx theme add neutral
|
|
22
|
+
code: 'npm install @astryxdesign/theme-neutral\nastryx theme add neutral',
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
type: 'code',
|
|
@@ -35,7 +35,7 @@ export const docs = {
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
type: 'prose',
|
|
38
|
-
text: '`theme add
|
|
38
|
+
text: '`theme add` records an installed package theme and regenerates `src/astryx-themes.ts` or `.js` with its built module, production CSS, and optional font CSS. In a project without `src`, the module is at the project root. The first imported theme becomes the default. `theme use <slug>` changes that default, and `theme remove <slug>` removes a non-default theme.',
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
type: 'prose',
|
|
@@ -58,11 +58,11 @@ export const docs = {
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
type: 'prose',
|
|
61
|
-
text: 'Before the upgrade runs, theme commands skip a descriptor-less copy in `src/themes`. `theme list` and doctor name it as unmigrated and show the upgrade command. A script that meant to copy source now runs `theme eject` with the same arguments. A script that meant to make the app use a theme runs `theme add
|
|
61
|
+
text: 'Before the upgrade runs, theme commands skip a descriptor-less copy in `src/themes`. `theme list` and doctor name it as unmigrated and show the upgrade command. A script that meant to copy source now runs `theme eject` with the same arguments. A script that meant to make the app use a theme runs `theme add`.',
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
type: 'prose',
|
|
65
|
-
text: '`ASTRYX_THEME` is no longer read. Run `theme add <slug
|
|
65
|
+
text: '`ASTRYX_THEME` is no longer read. Run `theme add <slug>` and `theme use <slug>` to choose the default in a generated app theme module. When that module exists, component metadata reads its recorded default theme. Without the module, the released `package.json#astryx.theme` lookup keeps its meaning.',
|
|
66
66
|
},
|
|
67
67
|
],
|
|
68
68
|
},
|
|
@@ -71,24 +71,24 @@ export const docs = {
|
|
|
71
71
|
content: [
|
|
72
72
|
{
|
|
73
73
|
type: 'prose',
|
|
74
|
-
text: 'Install the theme package you want with `npm install @astryxdesign/theme-{name}`, then import its slug with `theme add <slug
|
|
74
|
+
text: 'Install the theme package you want with `npm install @astryxdesign/theme-{name}`, then import its slug with `theme add <slug>`. The CLI imports the package\'s built outputs for you.',
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
type: 'table',
|
|
78
78
|
headers: ['Theme', 'Add command', 'Description'],
|
|
79
79
|
rows: [
|
|
80
|
-
['Neutral', 'astryx theme add neutral
|
|
81
|
-
['Butter', 'astryx theme add butter
|
|
82
|
-
['Chocolate', 'astryx theme add chocolate
|
|
83
|
-
['Gothic', 'astryx theme add gothic
|
|
84
|
-
['Matcha', 'astryx theme add matcha
|
|
85
|
-
['Stone', 'astryx theme add stone
|
|
86
|
-
['Y2K', 'astryx theme add y2k
|
|
80
|
+
['Neutral', 'astryx theme add neutral', 'Muted, minimal aesthetic with Figtree typography. A good starting point.'],
|
|
81
|
+
['Butter', 'astryx theme add butter', 'Golden, buttery surfaces with blue accents; Sarina + Outfit type.'],
|
|
82
|
+
['Chocolate', 'astryx theme add chocolate', 'Warm brown tones and cozy beige; Fraunces + Albert Sans type.'],
|
|
83
|
+
['Gothic', 'astryx theme add gothic', 'Dark-only atmospheric theme; deep blue-gray surfaces, distressed display type.'],
|
|
84
|
+
['Matcha', 'astryx theme add matcha', 'Earthy greens; DM Sans + Playwrite US Trad type.'],
|
|
85
|
+
['Stone', 'astryx theme add stone', 'Warm stone and slate tones; Montserrat + Figtree type.'],
|
|
86
|
+
['Y2K', 'astryx theme add y2k', 'Playful Y2K pop; periwinkle body, holographic accents, Poppins + Crimson Text.'],
|
|
87
87
|
],
|
|
88
88
|
},
|
|
89
89
|
{
|
|
90
90
|
type: 'prose',
|
|
91
|
-
text: 'Every first-party package exports its built theme at `@astryxdesign/theme-{name}/built`, production CSS at `/theme.css`, and font loading CSS at `/fonts.css`. `theme add
|
|
91
|
+
text: 'Every first-party package exports its built theme at `@astryxdesign/theme-{name}/built`, production CSS at `/theme.css`, and font loading CSS at `/fonts.css`. `theme add` writes those imports into the generated app module.',
|
|
92
92
|
},
|
|
93
93
|
],
|
|
94
94
|
},
|
|
@@ -113,11 +113,11 @@ export const docs = {
|
|
|
113
113
|
type: 'code',
|
|
114
114
|
lang: 'bash',
|
|
115
115
|
label: 'Install, inspect, and add',
|
|
116
|
-
code: 'npm install @astryxdesign/core @acme/brand-integration\nastryx theme list --package @acme/brand-integration\nastryx docs brand-theme\nastryx theme add ocean --
|
|
116
|
+
code: 'npm install @astryxdesign/core @acme/brand-integration\nastryx theme list --package @acme/brand-integration\nastryx docs brand-theme\nastryx theme add ocean --package @acme/brand-integration',
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
type: 'prose',
|
|
120
|
-
text: '`theme add
|
|
120
|
+
text: '`theme add` keeps the owner package in the app record and imports its built module, stylesheet, and optional font stylesheet. Package updates continue to reach the app. Run `theme eject ocean --package @acme/brand-integration` only to copy the source and descriptor into `src/themes/ocean` as an independent local fork.',
|
|
121
121
|
},
|
|
122
122
|
],
|
|
123
123
|
},
|
|
@@ -186,7 +186,7 @@ export const docs = {
|
|
|
186
186
|
type: 'list',
|
|
187
187
|
style: 'do',
|
|
188
188
|
items: [
|
|
189
|
-
'Use `theme add
|
|
189
|
+
'Use `theme add` for production apps; it wires the built module and CSS.',
|
|
190
190
|
'Import `themes` and `defaultThemeSlug` from the generated module once, and keep that wiring in development too.',
|
|
191
191
|
'While you edit a local theme, run `astryx theme build --watch` so its built files stay current.',
|
|
192
192
|
'Run `astryx theme build` for custom themes to get the built artifacts.',
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
-
// Generated from
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// Generated from the committed full palette for the stops used by Neutral's
|
|
4
|
+
// theme source. Regenerate with `pnpm generate:neutral-palette-refs`.
|
|
5
|
+
// Keep the complete palette available for authoring and audits without
|
|
6
|
+
// making consumers pay for unused palette stops.
|
|
6
7
|
// prettier-ignore
|
|
7
8
|
export const neutralPaletteRefs = {
|
|
8
9
|
purple: {
|
|
@@ -10,11 +11,11 @@ export const neutralPaletteRefs = {
|
|
|
10
11
|
dark: {25: '#4a2f51', 80: '#eaacf8'},
|
|
11
12
|
},
|
|
12
13
|
green: {
|
|
13
|
-
light: {25: '#00490b', 30: '#0b5615',
|
|
14
|
+
light: {25: '#00490b', 30: '#0b5615', 45: '#2f7d33', 65: '#6ab26b', 75: '#90ca90', 80: '#a4d6a3'},
|
|
14
15
|
dark: {25: '#2b422b', 80: '#aad4a9', 85: '#bce0bb'},
|
|
15
16
|
},
|
|
16
17
|
neutral: {
|
|
17
|
-
light: {0: '#000000', 5: '#111111', 10: '#1b1b1b',
|
|
18
|
+
light: {0: '#000000', 5: '#111111', 10: '#1b1b1b', 30: '#474747', 45: '#6a6a6a', 60: '#919191', 85: '#d4d4d4', 90: '#e2e2e2', 95: '#f1f1f1', 100: '#ffffff'},
|
|
18
19
|
dark: {0: '#000000', 5: '#111111', 10: '#1b1b1b', 15: '#262626', 20: '#303030', 35: '#525252', 65: '#9e9e9e', 85: '#d4d4d4', 90: '#e2e2e2', 95: '#f1f1f1', 100: '#ffffff'},
|
|
19
20
|
},
|
|
20
21
|
orange: {
|
|
@@ -26,11 +27,11 @@ export const neutralPaletteRefs = {
|
|
|
26
27
|
dark: {25: '#253c5a', 65: '#5aa0f8', 75: '#88bcff', 80: '#a1caff'},
|
|
27
28
|
},
|
|
28
29
|
red: {
|
|
29
|
-
light: {25: '#76000c', 30: '#8a0011',
|
|
30
|
+
light: {25: '#76000c', 30: '#8a0011', 55: '#de4745', 65: '#fa6762', 70: '#ff7f77', 80: '#ffaea7', 85: '#ffc4be'},
|
|
30
31
|
dark: {25: '#5b2b28', 65: '#ee736c', 75: '#ff9890', 80: '#ffaea7', 85: '#ffc4be'},
|
|
31
32
|
},
|
|
32
33
|
yellow: {
|
|
33
|
-
light: {25: '#4b3900', 30: '#584400',
|
|
34
|
+
light: {25: '#4b3900', 30: '#584400', 65: '#c29900', 75: '#e2b623', 80: '#eec448', 85: '#f8d36a'},
|
|
34
35
|
dark: {25: '#453a1c', 80: '#e3c36c', 90: '#fae19e'},
|
|
35
36
|
},
|
|
36
37
|
teal: {
|
|
@@ -39,10 +40,10 @@ export const neutralPaletteRefs = {
|
|
|
39
40
|
},
|
|
40
41
|
cyan: {
|
|
41
42
|
dark: {25: '#274046', 65: '#49adc4', 75: '#71c7dd', 80: '#85d5e9', 85: '#9ae2f4'},
|
|
42
|
-
light: {25: '#004351'
|
|
43
|
+
light: {25: '#004351'},
|
|
43
44
|
},
|
|
44
45
|
pink: {
|
|
45
|
-
light: {25: '#70003f',
|
|
46
|
+
light: {25: '#70003f', 70: '#fc78b1', 85: '#ffc0d7'},
|
|
46
47
|
dark: {25: '#572b3d', 75: '#fd92bd', 80: '#ffa9ca'},
|
|
47
48
|
},
|
|
48
49
|
} as const;
|
package/authoring/debug/type.ts
CHANGED
|
@@ -176,8 +176,8 @@ export interface DebugEventEnv {
|
|
|
176
176
|
/** Legacy broad detector, retained for compatibility with existing consumers. */
|
|
177
177
|
agent: string | null;
|
|
178
178
|
/**
|
|
179
|
-
* Coding-agent identity from `
|
|
180
|
-
*
|
|
179
|
+
* Coding-agent identity from `AGENT` or a known public agent signal.
|
|
180
|
+
* Scrubbed.
|
|
181
181
|
*/
|
|
182
182
|
agentIdentity: string | null;
|
|
183
183
|
/**
|
|
@@ -500,15 +500,6 @@ export interface ComponentThemingTarget {
|
|
|
500
500
|
* selectors such as `[data-checked="checked"]`. Omit if the element has no
|
|
501
501
|
* state-driven selectors. */
|
|
502
502
|
states?: string[];
|
|
503
|
-
/** Set when this target has been renamed and this entry is the old name.
|
|
504
|
-
* The component continues emitting the class through `themeProps`'s
|
|
505
|
-
* `legacyNames`, so existing themes keep working while discovery and build
|
|
506
|
-
* guidance prefer the replacement. The value is the canonical target key
|
|
507
|
-
* without the `astryx-` prefix — e.g. `"checkbox-indicator"`.
|
|
508
|
-
*
|
|
509
|
-
* A theme target is public API; deprecation alone does not authorize
|
|
510
|
-
* removing either this metadata or runtime support. */
|
|
511
|
-
deprecatedFor?: string;
|
|
512
503
|
}
|
|
513
504
|
|
|
514
505
|
/**
|
|
@@ -58,7 +58,7 @@ export const doc = {
|
|
|
58
58
|
name: 'themes',
|
|
59
59
|
type: 'string',
|
|
60
60
|
description:
|
|
61
|
-
'The folder that holds your themes, relative to package.json, with one folder per theme. Each theme folder has the theme source and a matching .doc.mjs file with the same name. Installed themes show up in `astryx theme list`; `theme add
|
|
61
|
+
'The folder that holds your themes, relative to package.json, with one folder per theme. Each theme folder has the theme source and a matching .doc.mjs file with the same name. Installed themes show up in `astryx theme list`; `theme add` imports their built package exports, and `theme eject` creates an editable local fork.',
|
|
62
62
|
example: "'./themes'",
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -39,7 +39,7 @@ import {reportsResult, reportsResultVia} from './lib/define-command.mjs';
|
|
|
39
39
|
* other. Its bare form prints help and never returns from that action, which
|
|
40
40
|
* the recorder covers where help is recorded, not here.)
|
|
41
41
|
*/
|
|
42
|
-
const NO_ACTION_OF_THEIR_OWN = [
|
|
42
|
+
const NO_ACTION_OF_THEIR_OWN = [];
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Commands that record for themselves instead of returning a descriptor.
|
|
@@ -519,7 +519,11 @@ describe('theme build adaptations', () => {
|
|
|
519
519
|
);
|
|
520
520
|
|
|
521
521
|
const result = await build(project, themeFile);
|
|
522
|
+
expect(result.code).toBe(1);
|
|
522
523
|
expect(`${result.stdout}${result.stderr}`).toContain('private var');
|
|
524
|
+
expect(fs.existsSync(path.join(themesDir, 'rule-private.css'))).toBe(true);
|
|
525
|
+
expect(fs.existsSync(path.join(themesDir, 'rule-private.js'))).toBe(true);
|
|
526
|
+
expect(fs.existsSync(path.join(themesDir, 'rule-private.d.ts'))).toBe(true);
|
|
523
527
|
});
|
|
524
528
|
|
|
525
529
|
it('rejects cycles across co-matching rules before writing output', async () => {
|