@astryxdesign/cli 0.7.15-canary.g79b95eb → 0.7.15-canary.gbe99721

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.
Files changed (135) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/README.md +63 -63
  3. package/api/build/_adapter.d.mts +4 -0
  4. package/api/build/_adapter.mjs +28 -2
  5. package/api/build/blocks/blocks.d.mts +10 -1
  6. package/api/build/blocks/blocks.mjs +84 -7
  7. package/api/build/build.mjs +6 -1
  8. package/api/build/tree.d.mts +4 -0
  9. package/api/build/tree.mjs +9 -2
  10. package/api/doctor/_adapter.d.mts +2 -1
  11. package/api/doctor/_adapter.mjs +6 -1
  12. package/api/doctor/doctor.mjs +2 -2
  13. package/api/doctor/theme-checks.mjs +56 -21
  14. package/api/integration/add-helpers.mjs +5 -0
  15. package/api/integration/add-theme.mjs +15 -110
  16. package/api/integration/validate-integration.mjs +17 -3
  17. package/api/integration/validateIntegration.doc.mjs +1 -1
  18. package/api/theme/_adapter.d.mts +37 -5
  19. package/api/theme/_adapter.mjs +363 -50
  20. package/api/theme/_fork.d.mts +90 -0
  21. package/api/theme/_fork.mjs +246 -0
  22. package/api/theme/build/build.d.mts +25 -1
  23. package/api/theme/build/build.mjs +352 -41
  24. package/api/theme/eject/eject.mjs +36 -15
  25. package/api/theme/list/list.mjs +3 -6
  26. package/api/theme/palette/generate/generator.d.mts +13 -0
  27. package/api/theme/palette/generate/generator.mjs +32 -2
  28. package/api/theme/targets/targets.mjs +10 -3
  29. package/api/theme/template/template.mjs +48 -2
  30. package/api/theme/theme.type.d.mts +8 -0
  31. package/api/theme/theme.type.mjs +5 -1
  32. package/api/theme/themeBuild.doc.mjs +2 -2
  33. package/api/theme/themeRemove.doc.mjs +5 -2
  34. package/api/theme/themeTemplate.doc.mjs +2 -2
  35. package/api/theme/themeUse.doc.mjs +8 -2
  36. package/api/theme-edit/_adapter.mjs +157 -36
  37. package/api/theme-edit/_catalog.d.mts +1 -6
  38. package/api/theme-edit/_catalog.mjs +5 -268
  39. package/api/theme-edit/_check.d.mts +3 -1
  40. package/api/theme-edit/_check.mjs +733 -308
  41. package/api/theme-edit/_color.d.mts +19 -0
  42. package/api/theme-edit/_color.mjs +277 -33
  43. package/api/theme-edit/_compiler.d.mts +1 -0
  44. package/api/theme-edit/_compiler.mjs +25 -0
  45. package/api/theme-edit/_context.d.mts +2 -0
  46. package/api/theme-edit/_context.mjs +83 -9
  47. package/api/theme-edit/_css.d.mts +84 -0
  48. package/api/theme-edit/_css.mjs +700 -0
  49. package/api/theme-edit/_edit.mjs +370 -85
  50. package/api/theme-edit/_how-commands.d.mts +5 -0
  51. package/api/theme-edit/_how-commands.mjs +20 -13
  52. package/api/theme-edit/_how-question.d.mts +29 -0
  53. package/api/theme-edit/_how-question.mjs +1573 -182
  54. package/api/theme-edit/_how.mjs +306 -22
  55. package/api/theme-edit/_overview.mjs +2 -7
  56. package/api/theme-edit/_palette.d.mts +27 -5
  57. package/api/theme-edit/_palette.mjs +231 -97
  58. package/api/theme-edit/_parts.d.mts +42 -10
  59. package/api/theme-edit/_parts.mjs +224 -69
  60. package/api/theme-edit/_preview-app.d.mts +8 -0
  61. package/api/theme-edit/_preview-app.mjs +549 -96
  62. package/api/theme-edit/_preview.d.mts +7 -16
  63. package/api/theme-edit/_preview.mjs +77 -84
  64. package/api/theme-edit/_project.d.mts +20 -1
  65. package/api/theme-edit/_project.mjs +43 -13
  66. package/api/theme-edit/_settings.d.mts +96 -20
  67. package/api/theme-edit/_settings.mjs +646 -141
  68. package/api/theme-edit/_tables.d.mts +18 -12
  69. package/api/theme-edit/_tables.mjs +144 -147
  70. package/api/theme-edit/theme-edit.type.d.mts +10 -1
  71. package/api/theme-edit/theme-edit.type.mjs +3 -1
  72. package/api/theme-edit/themeEditNew.doc.mjs +1 -1
  73. package/api/theme-edit/themeEditPreviewAdd.doc.mjs +1 -1
  74. package/api/theme-edit/themeEditPreviewApp.doc.mjs +1 -1
  75. package/api/theme-edit/themeEditPreviewList.doc.mjs +2 -2
  76. package/api/theme-edit/themeEditSet.doc.mjs +1 -1
  77. package/api/theme-edit/themeEditUndo.doc.mjs +1 -1
  78. package/assets/docs/tree/checks.doc.mjs +22 -1
  79. package/assets/docs/tree/publishing.doc.mjs +1 -0
  80. package/assets/docs.generated.json +2 -2
  81. package/assets/self-audit.generated.json +1 -1
  82. package/authoring/integration/integration.doc.mjs +8 -0
  83. package/authoring/integration/schema.d.mts +8 -0
  84. package/authoring/integration/schema.mjs +1 -0
  85. package/authoring/integration/type.ts +9 -0
  86. package/clients/cli/build-id.generated.json +1 -1
  87. package/clients/cli/commands/experimental/index.mjs +10 -10
  88. package/clients/cli/commands/experimental/theme.mjs +22 -3
  89. package/clients/cli/commands/experimental-theme-compile.doc.mjs +2 -2
  90. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +3 -3
  91. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -1
  92. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
  93. package/clients/cli/commands/integration.mjs +8 -0
  94. package/clients/cli/commands/theme-build.doc.mjs +2 -2
  95. package/clients/cli/commands/theme-list.doc.mjs +1 -1
  96. package/clients/cli/commands/theme-template.doc.mjs +1 -1
  97. package/clients/cli/commands/theme.mjs +325 -48
  98. package/clients/cli/index.mjs +18 -3
  99. package/clients/cli/lib/cli-error.mjs +118 -3
  100. package/clients/cli/manifest.generated.json +1 -1
  101. package/foundation/config/project.mjs +34 -8
  102. package/foundation/config/theme-state.d.mts +16 -0
  103. package/foundation/config/theme-state.mjs +84 -13
  104. package/foundation/discovery/template-needs.d.mts +13 -0
  105. package/foundation/discovery/template-needs.mjs +30 -15
  106. package/foundation/discovery/theme-discovery.mjs +14 -2
  107. package/foundation/discovery/theme-imports.d.mts +16 -0
  108. package/foundation/discovery/theme-imports.mjs +30 -2
  109. package/foundation/doc-compiler/import.mjs +10 -4
  110. package/foundation/fs/gather-cache.mjs +93 -26
  111. package/foundation/fs/jiti-cache.d.mts +21 -0
  112. package/foundation/fs/jiti-cache.mjs +66 -0
  113. package/foundation/fs/module-loader.mjs +7 -2
  114. package/foundation/fs/read-record.mjs +8 -2
  115. package/foundation/integrations/autolink.d.mts +1 -24
  116. package/foundation/integrations/autolink.mjs +7 -60
  117. package/foundation/integrations/declared-dependencies.d.mts +27 -0
  118. package/foundation/integrations/declared-dependencies.mjs +73 -0
  119. package/foundation/integrations/integrations.d.mts +8 -0
  120. package/foundation/integrations/integrations.mjs +4 -0
  121. package/foundation/integrations/may-have-integrations.d.mts +8 -0
  122. package/foundation/integrations/may-have-integrations.mjs +47 -0
  123. package/foundation/integrations/validate-contributions.d.mts +62 -1
  124. package/foundation/integrations/validate-contributions.mjs +452 -29
  125. package/foundation/release/cache.d.mts +21 -2
  126. package/foundation/release/cache.mjs +48 -8
  127. package/foundation/release/folder-lock.d.mts +7 -0
  128. package/foundation/release/folder-lock.mjs +60 -26
  129. package/foundation/release/lock-lease.d.mts +2 -1
  130. package/foundation/release/lock-lease.mjs +7 -2
  131. package/foundation/response/error-codes.doc.mjs +1 -1
  132. package/foundation/response/response-types.doc.mjs +5 -5
  133. package/package.json +6 -6
  134. package/api/theme-edit/_css-properties.d.mts +0 -10
  135. package/api/theme-edit/_css-properties.mjs +0 -556
@@ -41,7 +41,7 @@ import {fileURLToPath} from 'node:url';
41
41
  import {satisfiesRange} from '../env/semver.mjs';
42
42
  import {readJson} from './project.mjs';
43
43
  import {userCacheDir as userCacheDirFor} from '../env/user-dirs.mjs';
44
- import {foreignLockIsSilent} from './lock-lease.mjs';
44
+ import {foreignLockIsSilent, LEASE_RENEW_MS} from './lock-lease.mjs';
45
45
  import {relativeWithin} from '../fs/path-compare.mjs';
46
46
 
47
47
  /**
@@ -649,6 +649,19 @@ const FOREIGN_LOCK_MS = 20 * 60_000;
649
649
  /** How long a lock with no owner record may stand: its holder died taking it. */
650
650
  const UNOWNED_LOCK_MS = 10_000;
651
651
 
652
+ /**
653
+ * This process's process-id space (Linux: the pid namespace), or null where
654
+ * process ids are one space for the whole computer.
655
+ * @returns {string | null}
656
+ */
657
+ export function pidSpace() {
658
+ try {
659
+ return fs.readlinkSync('/proc/self/ns/pid');
660
+ } catch {
661
+ return null;
662
+ }
663
+ }
664
+
652
665
  /**
653
666
  * Is process `pid` on this computer still running?
654
667
  * @param {number} pid
@@ -674,7 +687,7 @@ export function isAlive(pid) {
674
687
  * @param {number} now
675
688
  * @returns {boolean}
676
689
  */
677
- function lockIsStale(lockDir, now) {
690
+ function lockIsStale(lockDir, now, leased = false) {
678
691
  let age;
679
692
  try {
680
693
  age = now - fs.statSync(lockDir).mtimeMs;
@@ -688,7 +701,24 @@ function lockIsStale(lockDir, now) {
688
701
  return age > FOREIGN_LOCK_MS || foreignLockIsSilent(lockDir, now);
689
702
  }
690
703
  // A live holder on this computer is installing, however slowly.
691
- return !isAlive(owner.pid);
704
+ if (isAlive(owner.pid)) return false;
705
+ // A leased lock's holder renews its record while it runs. A process id
706
+ // that looks gone may only be out of sight (a container that shares this
707
+ // computer's name, in its own process space): the record must also have
708
+ // stood unrenewed for three renewals.
709
+ if (!leased) return true;
710
+ // Recorded from this process space (or by a version that records none):
711
+ // the process id is judged right.
712
+ const ns = pidSpace();
713
+ if (ns === null || !owner.ns || owner.ns === ns) return true;
714
+ try {
715
+ return (
716
+ now - fs.statSync(path.join(lockDir, 'owner.json')).mtimeMs >
717
+ 3 * LEASE_RENEW_MS
718
+ );
719
+ } catch {
720
+ return true;
721
+ }
692
722
  }
693
723
 
694
724
  /**
@@ -709,10 +739,14 @@ function ownerText(lockDir) {
709
739
  * over at once, and one from another computer once its holder has stopped
710
740
  * renewing it. Throws when the cache folder cannot be written.
711
741
  * @param {string} lockDir
712
- * @param {{now?: number}} [options] the clock, for tests
742
+ * @param {{now?: number, leased?: boolean}} [options] the clock, for tests;
743
+ * `leased` for a lock whose holder renews it (lock-lease.mjs): its record
744
+ * names its process space, and a holder on this computer that looks gone
745
+ * from another space (a container with the same computer name) is taken
746
+ * over only once its record has stood unrenewed for three renewals.
713
747
  * @returns {boolean}
714
748
  */
715
- export function tryLock(lockDir, {now = Date.now()} = {}) {
749
+ export function tryLock(lockDir, {now = Date.now(), leased = false} = {}) {
716
750
  fs.mkdirSync(path.dirname(lockDir), {recursive: true});
717
751
  try {
718
752
  fs.mkdirSync(lockDir);
@@ -725,7 +759,7 @@ export function tryLock(lockDir, {now = Date.now()} = {}) {
725
759
  // record, which a new lock lacks for a moment), or another run took the
726
760
  // lock in between.
727
761
  const judged = lockIdentity(lockDir);
728
- if (!judged || !lockIsStale(lockDir, now)) return false;
762
+ if (!judged || !lockIsStale(lockDir, now, leased)) return false;
729
763
  const aside = `${lockDir}.stale-${process.pid}-${Math.random().toString(36).slice(2, 8)}`;
730
764
  try {
731
765
  fs.renameSync(lockDir, aside);
@@ -761,7 +795,13 @@ export function tryLock(lockDir, {now = Date.now()} = {}) {
761
795
  try {
762
796
  fs.writeFileSync(
763
797
  path.join(lockDir, 'owner.json'),
764
- JSON.stringify({pid: process.pid, host: os.hostname(), at: Date.now()}),
798
+ JSON.stringify({
799
+ pid: process.pid,
800
+ host: os.hostname(),
801
+ at: Date.now(),
802
+ // A leased lock names the process space its id belongs to.
803
+ ...(leased && pidSpace() ? {ns: pidSpace()} : {}),
804
+ }),
765
805
  );
766
806
  } catch {
767
807
  // Without a record the lock still expires on its own.
@@ -776,7 +816,7 @@ export function tryLock(lockDir, {now = Date.now()} = {}) {
776
816
  * @param {string} lockDir
777
817
  * @returns {string | null}
778
818
  */
779
- function lockIdentity(lockDir) {
819
+ export function lockIdentity(lockDir) {
780
820
  try {
781
821
  const st = fs.statSync(lockDir, {bigint: true});
782
822
  return `${st.dev}:${st.ino}:${st.birthtimeNs}:${ownerText(lockDir)}`;
@@ -1,6 +1,13 @@
1
1
  // @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
+ /**
5
+ * Throw when the work running under withFolderLock no longer holds its lock
6
+ * (another run took it over while this one was stopped), so it writes
7
+ * nothing more. Outside withFolderLock it does nothing. Call it right
8
+ * before a write.
9
+ */
10
+ export function stillHolds(): void;
4
11
  /**
5
12
  * Run `fn` holding the lock folder `lockDir`. A run waits while another
6
13
  * holds it; the wait starts again each time the lock changes hands, and
@@ -14,21 +14,14 @@
14
14
 
15
15
  import * as fs from 'node:fs';
16
16
  import * as path from 'node:path';
17
- import {tryLock} from './cache.mjs';
18
- import {LEASE_RENEW_MS, renewLock} from './lock-lease.mjs';
17
+ import {AsyncLocalStorage} from 'node:async_hooks';
18
+ import * as os from 'node:os';
19
+ import {isAlive, lockIdentity, pidSpace, tryLock} from './cache.mjs';
20
+ import {foreignLockIsSilent, LEASE_RENEW_MS, renewLock} from './lock-lease.mjs';
19
21
 
20
22
  /** How long a held lock's record may stand unrenewed before it is taken over. */
21
23
  export const SILENT_MS = 3 * LEASE_RENEW_MS;
22
24
 
23
- /** @param {string} file @returns {string} */
24
- const recordText = file => {
25
- try {
26
- return fs.readFileSync(file, 'utf8');
27
- } catch {
28
- return '';
29
- }
30
- };
31
-
32
25
  /**
33
26
  * Move a silent lock aside and remove it; another run that moved it first
34
27
  * wins, and this one tries again.
@@ -42,19 +35,59 @@ function takeOver(lockDir, judged) {
42
35
  } catch {
43
36
  return;
44
37
  }
45
- // The lock moved aside must hold the record judged silent: a lock taken
46
- // or renewed in between is put back.
47
- if (recordText(path.join(aside, 'owner.json')) !== judged) {
38
+ // The lock moved aside must be the one judged silent (by its identity
39
+ // on disk and its record, as the release cache checks): a lock taken or
40
+ // renewed in between is put back. When its place is taken again, it
41
+ // stays aside for its run, and this run holds nothing.
42
+ if (lockIdentity(aside) !== judged) {
48
43
  try {
49
44
  fs.renameSync(aside, lockDir);
50
45
  } catch {
51
- // Its place is taken again.
46
+ // Left for its run.
52
47
  }
53
48
  return;
54
49
  }
55
50
  fs.rmSync(aside, {recursive: true, force: true});
56
51
  }
57
52
 
53
+ /**
54
+ * Whether a lock's holder runs on this computer, in this process space: a
55
+ * holder that is only stopped (Ctrl-Z, a sleeping laptop, a debugger) is
56
+ * alive, however long its record stands unrenewed.
57
+ * @param {any} owner
58
+ */
59
+ function aliveHere(owner) {
60
+ if (!owner || owner.host !== os.hostname() || !Number.isInteger(owner.pid))
61
+ return false;
62
+ const ns = pidSpace();
63
+ if (owner.ns && ns && owner.ns !== ns) return false;
64
+ return isAlive(owner.pid);
65
+ }
66
+
67
+ /** The lock the running work holds, for the check before each write. */
68
+ const holding = new AsyncLocalStorage();
69
+
70
+ /**
71
+ * Throw when the work running under withFolderLock no longer holds its lock
72
+ * (another run took it over while this one was stopped), so it writes
73
+ * nothing more. Outside withFolderLock it does nothing. Call it right
74
+ * before a write.
75
+ */
76
+ export function stillHolds() {
77
+ const h =
78
+ /** @type {{ownerFile: string, same: (o: any) => boolean} | undefined} */ (
79
+ holding.getStore()
80
+ );
81
+ if (!h || h.same(readOwner(h.ownerFile))) return;
82
+ const error = /** @type {Error & {code?: string}} */ (
83
+ new Error(
84
+ 'another command took over the lock while this one was stopped, so this one writes nothing more',
85
+ )
86
+ );
87
+ error.code = 'ERR_LOCK_LOST';
88
+ throw error;
89
+ }
90
+
58
91
  /** The lock folders this process holds now. */
59
92
  const HELD = new Set();
60
93
 
@@ -101,16 +134,17 @@ export async function withFolderLock(lockDir, fn, {waitMs = 30_000, onBusy}) {
101
134
  // not changed for three of those, as this run sees it, has stopped,
102
135
  // whatever computer or process id it names (pid 1 in a container, a
103
136
  // computer whose processes this run cannot check).
104
- let record = recordText(ownerFile);
105
- let since = Date.now();
106
- for (let waited = 0; !tryLock(lockDir); waited += 50) {
107
- const text = recordText(ownerFile);
108
- if (text !== record) {
109
- record = text;
110
- since = Date.now();
111
- } else if (Date.now() - since >= SILENT_MS) {
112
- takeOver(lockDir, record);
113
- since = Date.now();
137
+ for (let waited = 0; !tryLock(lockDir, {leased: true}); waited += 50) {
138
+ // The release cache's own judge of silence (what this process saw of
139
+ // the record), with the editor's shorter window. The lock is judged by
140
+ // its identity on disk, so the one moved aside is the one judged.
141
+ const judged = lockIdentity(lockDir);
142
+ if (
143
+ judged &&
144
+ foreignLockIsSilent(lockDir, Date.now(), SILENT_MS) &&
145
+ !aliveHere(readOwner(ownerFile))
146
+ ) {
147
+ takeOver(lockDir, judged);
114
148
  continue;
115
149
  }
116
150
  const now = holderOf();
@@ -153,7 +187,7 @@ export async function withFolderLock(lockDir, fn, {waitMs = 30_000, onBusy}) {
153
187
  process.once('SIGINT', onSignal);
154
188
  process.once('SIGTERM', onSignal);
155
189
  try {
156
- return await fn();
190
+ return await holding.run({ownerFile, same}, fn);
157
191
  } finally {
158
192
  clearInterval(lease);
159
193
  release();
@@ -12,9 +12,10 @@ export function renewLock(lockDir: string): void;
12
12
  * not changed for `LEASE_SILENCE_MS` of this process's own observation.
13
13
  * @param {string} lockDir
14
14
  * @param {number} [now]
15
+ * @param {number} [window] how long the record must stand unchanged (default `LEASE_SILENCE_MS`)
15
16
  * @returns {boolean}
16
17
  */
17
- export function foreignLockIsSilent(lockDir: string, now?: number): boolean;
18
+ export function foreignLockIsSilent(lockDir: string, now?: number, window?: number): boolean;
18
19
  /** Forget what this process observed (tests). */
19
20
  export function forgetObservedLocks(): void;
20
21
  /** How often the holder renews its record while the package manager works. */
@@ -57,9 +57,14 @@ const observed = new Map();
57
57
  * not changed for `LEASE_SILENCE_MS` of this process's own observation.
58
58
  * @param {string} lockDir
59
59
  * @param {number} [now]
60
+ * @param {number} [window] how long the record must stand unchanged (default `LEASE_SILENCE_MS`)
60
61
  * @returns {boolean}
61
62
  */
62
- export function foreignLockIsSilent(lockDir, now = Date.now()) {
63
+ export function foreignLockIsSilent(
64
+ lockDir,
65
+ now = Date.now(),
66
+ window = LEASE_SILENCE_MS,
67
+ ) {
63
68
  let text;
64
69
  try {
65
70
  text = fs.readFileSync(path.join(lockDir, 'owner.json'), 'utf-8');
@@ -71,7 +76,7 @@ export function foreignLockIsSilent(lockDir, now = Date.now()) {
71
76
  observed.set(lockDir, {text, since: now});
72
77
  return false;
73
78
  }
74
- return now - seen.since >= LEASE_SILENCE_MS;
79
+ return now - seen.since >= window;
75
80
  }
76
81
 
77
82
  /** Forget what this process observed (tests). */
@@ -332,7 +332,7 @@ export const doc = {
332
332
  value: 'ERR_RENDER_FAILED',
333
333
  stability: 'experimental',
334
334
  description:
335
- 'The page threw while rendering, or Node crashed while it rendered the page. Nothing was written. Raised only by the experimental render command.',
335
+ "The page threw while rendering, or Node crashed while it rendered the page. Raised by the experimental render command, which then writes nothing, and by the experimental theme editor when it cannot render a theme's pages (two copies of React, a component that throws, or a render past its time limit; the theme it built is kept, and the refusal says so). A React that is not installed is ERR_RENDER_MISSING_DEPENDENCY.",
336
336
  },
337
337
  {
338
338
  value: 'ERR_RENDER_NOT_ASTRYX',
@@ -117,13 +117,13 @@ export const doc = {
117
117
  value: 'themeEdit.new',
118
118
  stability: 'experimental',
119
119
  description:
120
- 'A theme made by `experimental theme editor new`: `theme`, `like` (the built-in theme it builds on, or null), the `files` written (settings, source, css, module), the dial `settings` it started with, font `notes`, contrast `problems`, the `preview` page, and any `pictures` (with `pictureProblem` when none could be taken). Experimental: may change or be removed in a patch release.',
120
+ 'A theme made by `experimental theme editor new`: `theme`, `like` (the built-in theme it builds on, or null), the `files` written (settings, source, css, module), the dial `settings` it started with, font `notes`, contrast `problems`, the `preview` page, and any `pictures` (with `pictureProblem` when none could be taken), and `sheetStale` when a sheet.html left in the folder shows an older look. Experimental: may change or be removed in a patch release.',
121
121
  },
122
122
  {
123
123
  value: 'themeEdit.set',
124
124
  stability: 'experimental',
125
125
  description:
126
- 'One checked change written: the `setting`, the one it `replaced`, `was` (for base and mode), the `parts` and `group` it styles, resolved `changedTokens`, part styles written (`styled`), part settings a dial `kept`, newly `lifted` variant keys, `notes`, contrast `problems`, build `warnings`, the `preview` page and any `pictures`. Experimental: may change or be removed in a patch release.',
126
+ 'One checked change written: the `setting`, the one it `replaced`, `was` (for base and mode), the `parts` and `group` it styles, resolved `changedTokens`, part styles written (`styled`), part settings a dial `kept`, newly `lifted` variant keys, `notes`, contrast `problems`, build `warnings`, the `preview` page and any `pictures`, and `sheetStale` when sheet.html (made by `show`) still shows the theme as it was before. Experimental: may change or be removed in a patch release.',
127
127
  },
128
128
  {
129
129
  value: 'themeEdit.show',
@@ -135,7 +135,7 @@ export const doc = {
135
135
  value: 'themeEdit.undo',
136
136
  stability: 'experimental',
137
137
  description:
138
- "An undo. One step back (`action` `step`): what was `undone`, the `settings` count now, the `stepsLeft`, the `preview` page and any `pictures`. One setting removed (`action` `undo`): the same fields as `themeEdit.set`, with `setting` and `removed` both naming the setting removed, and `now` saying what applies instead (a whole-theme setting of the same thing, or the base theme's value; `changedTokens` lists the values). Experimental: may change or be removed in a patch release.",
138
+ "An undo. One step back (`action` `step`): what was `undone`, the `settings` count now, the `stepsLeft`, the `preview` page, any `pictures`, and `sheetStale` when sheet.html still shows the theme as it was. One setting removed (`action` `undo`): the same fields as `themeEdit.set`, with `setting` and `removed` both naming the setting removed, and `now` saying what applies instead (a whole-theme setting of the same thing, or the base theme's value; `changedTokens` lists the values). Experimental: may change or be removed in a patch release.",
139
139
  },
140
140
  {
141
141
  value: 'themeEdit.previewAdd',
@@ -153,7 +153,7 @@ export const doc = {
153
153
  value: 'themeEdit.previewList',
154
154
  stability: 'experimental',
155
155
  description:
156
- 'The pages of the theme preview: the route `folder` (null with no preview), the `theme`, and the `pages` (`id`, `label`). Experimental: may change or be removed in a patch release.',
156
+ 'The pages of the theme preview: the route `folder` (null with no preview), the `theme`, `themeMissing` (true when that theme is gone), the `pages` (`id`, `label`) and `notes`. Experimental: may change or be removed in a patch release.',
157
157
  },
158
158
  {
159
159
  value: 'themeEdit.previewRemove',
@@ -487,7 +487,7 @@ export const doc = {
487
487
  {
488
488
  value: 'integration.validate',
489
489
  description:
490
- 'The validation result: validated (false when nothing was validated: with no package.json the issues list carries one no_package error so the command exits 1, and with a package.json but no integration manifest the issues list is empty and proves nothing), the package name and version (both null when validated is false) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning | error, message, fix?, file?, line?} (fix: the change that resolves it; file and line: where, relative to the package), and notes when there are any: {code, message, next?} information beside the issues (text output marks a next note [next minor]); a note fails nothing by default, and one with next: true counts as a warning under integration check --next, fails integration check --strict --next, and fails --strict from the next minor release. Notes include invalid_cli_command for a malformed cliCommand and cli_peer_version when the running CLI is outside the @astryxdesign/cli peer range of the package, and the package layout findings added after the last minor release, each with its fix in the message (duplicate_component_doc, symlinked_root, unreadable_file, invalid_package_json, no_provider_id, source_without_component_doc where a doc and its source still pair), and doc_name_mismatch and unknown_block_component, until they become warnings in the next minor release. For the commands a topic writes, runner_command (written with a package runner), plain_command (written bare), package_manager_command (written for one package manager) and doc_token (a token that does not parse) notes each give the file, line and the token to write. A doc_target_not_found note names a doc whose replaces or extends names no topic and no guide of the CLI docs or the docs of the package (such as a namespace), and a doc_section_unplaced note a section whose before or after names no section of what it extends (it is added at the end), and a duplicate_guide_replacement note two docs of the package that replace one guide; they become warnings in the next minor release. When the manifest loads, docTypes checks each doc against its published authoring type: status (checked | skipped), reason, typescript, docs, findings (all warnings, each naming the field and a fix), unchecked, and fixtures (test fixture docs not checked). When the manifest loads, docNames lists the component doc names it could not judge: status (checked), findings (always empty; a doc name the module its import names provably does not export is a doc_name_mismatch note, with its fix in the message) and unchecked ({file, name, reason}: a doc whose name differs from the name it is listed under and whose source exports cannot all be read, such as a re-export from another package). When the manifest loads, blockComponents lists the component names templates give in exampleFor or componentsUsed that could not be judged: status (checked), findings (always empty; a name neither the package nor Core has, and the template does not import, is an unknown_block_component note, with its fix in the message) and unchecked ({file, name, reason}: a name the template may reach through anything other than named imports and re-exports from Core, React, StyleX, local helpers or the entry of the package itself, such as an import from another package, a default or namespace import, an alias of or member read off an imported binding, require() or a dynamic import(), or a local module that cannot be read, or any name Core would have to resolve when Core is not installed). Since 0.7.3 each import apps cannot use is also a note (its fix in the message), listed only and failing --strict from the next minor. So are the examples a package ships: component_without_example (a published component no block shows with exampleFor and isShowcase: true, or names in alsoShowcaseFor), template_category (a category written as a path, such as components/X), showcase_not_standalone (a showcase importing server-only code or reading process.env past NODE_ENV) and template_asset_not_packed (a new URL(…, import.meta.url) asset missing, or left out by npm pack --dry-run). When npm cannot list the files, an asset no files entry can reach is still a note and any other is listed in exampleAssets ({status: checked, findings: [], unchecked}, only when it lists any) as {file, asset, reason}. publicImports ({status: checked, findings: [], unchecked}) lists each import the check could not judge as {file, specifier, reason}; never counted or failed on. For the package being authored, olderCliNotes ({file, kind: template | namespace, field, message}) lists each descriptor field a CLI before 0.7.4 refuses, such as stability on a template or namespace doc; it is present only when it has entries, and is never counted or fails a check.',
490
+ 'The validation result: validated (false when nothing was validated: with no package.json the issues list carries one no_package error so the command exits 1, and with a package.json but no integration manifest the issues list is empty and proves nothing), the package name and version (both null when validated is false) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning | error, message, fix?, file?, line?} (fix: the change that resolves it; file and line: where, relative to the package), and notes when there are any: {code, message, next?} information beside the issues (text output marks a next note [next minor]); a note fails nothing by default, and one with next: true counts as a warning under integration check --next, fails integration check --strict --next, and fails --strict from the next minor release. Notes include invalid_cli_command for a malformed cliCommand and cli_peer_version when the running CLI is outside the @astryxdesign/cli peer range of the package, and the package layout findings added after the last minor release, each with its fix in the message (duplicate_component_doc, symlinked_root, unreadable_file, invalid_package_json, no_provider_id, source_without_component_doc where a doc and its source still pair), and doc_name_mismatch and unknown_block_component, until they become warnings in the next minor release. For the commands a topic writes, runner_command (written with a package runner), plain_command (written bare), package_manager_command (written for one package manager) and doc_token (a token that does not parse) notes each give the file, line and the token to write. A doc_target_not_found note names a doc whose replaces or extends names no topic and no guide of the CLI docs or the docs of the package (such as a namespace), and a doc_section_unplaced note a section whose before or after names no section of what it extends (it is added at the end), and a duplicate_guide_replacement note two docs of the package that replace one guide; they become warnings in the next minor release. When the manifest loads, docTypes checks each doc against its published authoring type: status (checked | skipped), reason, typescript, docs, findings (all warnings, each naming the field and a fix), unchecked, and fixtures (test fixture docs not checked). When the manifest loads, docNames lists the component doc names it could not judge: status (checked), findings (always empty; a doc name the module its import names provably does not export is a doc_name_mismatch note, with its fix in the message) and unchecked ({file, name, reason}: a doc whose name differs from the name it is listed under and whose source exports cannot all be read, such as a re-export from another package). When the manifest loads, blockComponents lists the component names templates give in exampleFor or componentsUsed that could not be judged: status (checked), findings (always empty; a name neither the package nor Core has, and the template does not import, is an unknown_block_component note, with its fix in the message) and unchecked ({file, name, reason}: a name the template may reach through anything other than named imports and re-exports from Core, React, StyleX, local helpers or the entry of the package itself, such as an import from another package, a default or namespace import, an alias of or member read off an imported binding, require() or a dynamic import(), or a local module that cannot be read, or any name Core would have to resolve when Core is not installed). Since 0.7.3 each import apps cannot use is also a note (its fix in the message), listed only and failing --strict from the next minor. So are the examples a package ships: component_without_example (a published component no block shows with exampleFor and isShowcase: true, or names in alsoShowcaseFor), template_category (a category written as a path, such as components/X), showcase_not_standalone (a showcase importing server-only code or reading process.env past NODE_ENV) and template_asset_not_packed (a new URL(…, import.meta.url) asset missing, or left out by npm pack --dry-run). When npm cannot list the files, an asset no files entry can reach is still a note and any other is listed in exampleAssets ({status: checked, findings: [], unchecked}, only when it lists any) as {file, asset, reason}. Since 0.7.15, package_without_logo (logo.light in the integration file, or a logo.dark that is set, names no packed PNG, JPEG, WebP or shapes-only SVG of at most 512 KB in the package; package.json marketplace.logo is read when the integration file has no logo) and package_without_example (components, other than those component_without_example exempts, but no block with isShowcase: true and exampleFor, or alsoShowcaseFor; themes-, docs- or codemods-only packages need none) say what a catalog needs to list the package, as notes without next that fail no check under any flag; a logo npm cannot be asked about is listed in exampleAssets with the file that names it. publicImports ({status: checked, findings: [], unchecked}) lists each import the check could not judge as {file, specifier, reason}; never counted or failed on. For the package being authored, olderCliNotes ({file, kind: template | namespace, field, message}) lists each descriptor field a CLI before 0.7.4 refuses, such as stability on a template or namespace doc; it is present only when it has entries, and is never counted or fails a check.',
491
491
  },
492
492
  {
493
493
  value: 'integration.template-conflicts',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.15-canary.g79b95eb",
3
+ "version": "0.7.15-canary.gbe99721",
4
4
  "displayName": "CLI",
5
5
  "description": "Scaffold projects, browse templates, generate themes, and get agent-ready docs from the command line.",
6
6
  "author": "Meta Open Source",
@@ -126,7 +126,7 @@
126
126
  "zod": "^4.6.7"
127
127
  },
128
128
  "peerDependencies": {
129
- "@astryxdesign/core": "0.7.15-canary.g79b95eb"
129
+ "@astryxdesign/core": "0.7.15-canary.gbe99721"
130
130
  },
131
131
  "peerDependenciesMeta": {
132
132
  "@astryxdesign/core": {
@@ -134,10 +134,10 @@
134
134
  }
135
135
  },
136
136
  "devDependencies": {
137
- "@astryxdesign/charts": "0.7.15-canary.g79b95eb",
138
- "@astryxdesign/core": "0.7.15-canary.g79b95eb",
139
- "@astryxdesign/lab": "0.7.15-canary.g79b95eb",
140
- "@astryxdesign/theme-neutral": "0.7.15-canary.g79b95eb",
137
+ "@astryxdesign/charts": "0.7.15-canary.gbe99721",
138
+ "@astryxdesign/core": "0.7.15-canary.gbe99721",
139
+ "@astryxdesign/lab": "0.7.15-canary.gbe99721",
140
+ "@astryxdesign/theme-neutral": "0.7.15-canary.gbe99721",
141
141
  "@heroicons/react": "^2.2.0",
142
142
  "@stylexjs/stylex": "^0.19.1",
143
143
  "@types/babel__core": "^7.20.5",
@@ -1,10 +0,0 @@
1
- // @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
2
- // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
-
4
- /**
5
- * @file The standard CSS property names a theme may set on a part. A name
6
- * outside this list is not a CSS property, so the command refuses it.
7
- * @position api/theme-edit — data
8
- */
9
- /** @type {ReadonlySet<string>} */
10
- export const CSS_PROPERTIES: ReadonlySet<string>;