@astryxdesign/cli 0.7.9-canary.d0cf29a → 0.7.9-canary.d8387c5

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.
@@ -8,7 +8,7 @@
8
8
  * domain the query wants. Its weights are static numbers in
9
9
  * _main-searcher.weights.json.
10
10
  * @input {query, options} and the gathered catalog with its static data
11
- * @output the search response, the lexical response's shape and size
11
+ * @output the search response, the lexical response's shape and count
12
12
  * @position api/search; a child of the root dispatcher in tree.mjs
13
13
  */
14
14
 
@@ -0,0 +1,146 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file `astryx docs calendars/calendar-systems`: choosing a calendar, the
5
+ * supported calendars, loading Temporal on the server and in the browser, the
6
+ * lunisolar calendars, and week numbers.
7
+ */
8
+
9
+ /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
10
+
11
+ export const docs = {
12
+ type: 'generic',
13
+ name: 'calendar-systems',
14
+ title: 'Calendar systems',
15
+ placement: {
16
+ parent: 'namespace:calendars',
17
+ slot: 'guides',
18
+ order: 10,
19
+ },
20
+ category: 'guide',
21
+ description:
22
+ 'Choosing a calendar, which calendars need Temporal, server rendering, the lunisolar calendars, and week numbers.',
23
+
24
+ sections: [
25
+ {
26
+ title: 'Choose a calendar',
27
+ content: [
28
+ {
29
+ type: 'prose',
30
+ text: '`Calendar` shows the Gregorian calendar unless you choose another one. Pass `calendar` to `<InternationalizationProvider>` to set it for a subtree. A locale on its own never changes the calendar: `fa-IR` shows Gregorian dates in Persian until you pass `calendar="persian"`. A locale with a `-u-ca-` keyword, such as `th-TH-u-ca-buddhist`, keeps Gregorian dates too; set `calendar` to choose one.',
31
+ },
32
+ {
33
+ type: 'code',
34
+ lang: 'tsx',
35
+ label: 'Persian dates in a Persian interface',
36
+ code: `import {InternationalizationProvider} from '@astryxdesign/core/i18n';
37
+ import {Calendar} from '@astryxdesign/core/Calendar';
38
+
39
+ <InternationalizationProvider locale="fa-IR" calendar="persian">
40
+ {/* shows Aban 1405; value and onChange stay '2026-10-30' */}
41
+ <Calendar value={date} onChange={setDate} />
42
+ </InternationalizationProvider>;`,
43
+ },
44
+ {
45
+ type: 'prose',
46
+ text: 'Calendar and language are independent: `locale="en" calendar="hebrew"` shows Hebrew dates in English. `Calendar` also takes its own `calendar`, which wins over the provider. Use it when one screen shows two calendars side by side.',
47
+ },
48
+ {
49
+ type: 'prose',
50
+ text: 'Values never change with the calendar. `value`, `defaultValue`, `onChange`, `min`, and `max` stay Gregorian ISO dates (`YYYY-MM-DD`) in every calendar, so your data, server code, and existing handlers keep working.',
51
+ },
52
+ ],
53
+ },
54
+ {
55
+ title: 'Supported calendars',
56
+ content: [
57
+ {
58
+ type: 'table',
59
+ headers: ['Calendar', 'Identifiers', 'Needs Temporal'],
60
+ rows: [
61
+ ['Gregorian', '`gregory`, `iso8601`', 'No'],
62
+ ['Buddhist (Thai)', '`buddhist`', 'No'],
63
+ ['Minguo', '`roc`', 'No'],
64
+ ['Japanese (eras)', '`japanese`', 'No'],
65
+ ['Persian (Solar Hijri)', '`persian`', 'Yes'],
66
+ ['Indian national (Saka)', '`indian`', 'Yes'],
67
+ ['Hebrew', '`hebrew`', 'Yes'],
68
+ [
69
+ 'Islamic (Hijri)',
70
+ '`islamic-umalqura`, `islamic-civil`, `islamic-tbla`',
71
+ 'Yes',
72
+ ],
73
+ ['Lunisolar', '`chinese`, `dangi`', 'Yes'],
74
+ ['Coptic', '`coptic`', 'Yes'],
75
+ ['Ethiopian', '`ethiopic`, `ethioaa`', 'Yes'],
76
+ ],
77
+ },
78
+ {
79
+ type: 'prose',
80
+ text: 'Any other identifier, such as `islamic`, shows Gregorian dates and warns once in development.',
81
+ },
82
+ ],
83
+ },
84
+ {
85
+ title: 'Load Temporal where the runtime lacks it',
86
+ content: [
87
+ {
88
+ type: 'prose',
89
+ text: "Calendars whose months are not Gregorian use the runtime's `Temporal` for their month lengths, leap months, and years. Chrome and Edge 144 and later, Firefox 139 and later, and Node.js 26 and later ship it. Safari and older runtimes do not. Astryx bundles no polyfill, so Gregorian applications pay nothing.",
90
+ },
91
+ {
92
+ type: 'prose',
93
+ text: 'Where `Temporal` is missing, load the full build of `temporal-polyfill` before your app renders. The default build has no non-ISO calendars. Load it only where `Temporal` is missing: a native implementation is more accurate for the lunisolar calendars.',
94
+ },
95
+ {
96
+ type: 'code',
97
+ lang: 'ts',
98
+ label: 'Load the polyfill only where Temporal is missing',
99
+ code: `// temporal-setup.ts: import before your app renders, on the server and in the browser
100
+ if (!('Temporal' in globalThis)) {
101
+ await import('temporal-polyfill/full/global');
102
+ }`,
103
+ },
104
+ {
105
+ type: 'prose',
106
+ text: 'If you render on the server, load it there too. `Calendar` resolves its calendar during render, so a server without `Temporal` renders Gregorian dates, and a browser with it renders Persian ones: hydration then fails. When both have `Temporal`, or both lack it, they render the same markup.',
107
+ },
108
+ {
109
+ type: 'prose',
110
+ text: 'Without a `Temporal` that supports it, a calendar that needs one shows Gregorian dates and warns once in development, on the server and in the browser. The Gregorian-aligned calendars (`buddhist`, `roc`, `japanese`) work everywhere without it.',
111
+ },
112
+ ],
113
+ },
114
+ {
115
+ title: 'Lunisolar calendars',
116
+ content: [
117
+ {
118
+ type: 'prose',
119
+ text: "In the lunisolar calendars, months start on new moons computed from astronomy, and runtimes do not all agree on a few of them. Astryx follows the runtime's `Temporal` and does not correct it.",
120
+ },
121
+ {
122
+ type: 'list',
123
+ style: 'unordered',
124
+ items: [
125
+ 'Native `Temporal` in Chrome, Edge, Firefox, and Node.js 26 agrees with official observatory data from 1900 through 2100.',
126
+ "A polyfill reads the platform's `Intl` data instead. Under a polyfill, Node.js 24 starts nine `chinese` and four `dangi` months in that range one day apart from the native result: the first month of the 2027 `chinese` year starts on February 6 with native `Temporal` and on February 7 under the polyfill. Safari uses the same kind of `Intl` data, so expect the same differences there.",
127
+ 'Within one browser, the day numbers a person sees, the dates a screen reader announces, and the value they pick agree. Only two different runtimes can disagree.',
128
+ ],
129
+ },
130
+ {
131
+ type: 'prose',
132
+ text: 'If you render on the server, a server and a browser that use different implementations can disagree on one of these month starts. The browser then renders that month differently from the server markup, and React renders that part again on the client during hydration. The `temporal-polyfill/full/global` import keeps a native `Temporal` where one exists, so on its own it leaves Chrome, Edge, and Firefox on native `Temporal` and a Node.js 24 server on the polyfill. When identical server and browser markup for these calendars matters more than matching official data, call `installImplementation()` from `temporal-polyfill/full/shim` on the server and in the browser before rendering: it installs the polyfill even over a native `Temporal`. A server runtime with native `Temporal`, such as Node.js 26, also matches native browsers. Otherwise, do not replace a native `Temporal`: that makes native environments less accurate.',
133
+ },
134
+ ],
135
+ },
136
+ {
137
+ title: 'Week numbers',
138
+ content: [
139
+ {
140
+ type: 'prose',
141
+ text: "`Calendar`'s `hasWeekNumbers` shows ISO 8601 week numbers in every calendar. Temporal defines week numbering only for the ISO calendar.",
142
+ },
143
+ ],
144
+ },
145
+ ],
146
+ };
@@ -0,0 +1,46 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file `astryx docs calendars`: calendar systems in detail. Which calendars
5
+ * date components show, how to load Temporal, server rendering, and the
6
+ * lunisolar calendars. The `internationalization/i18n-calendars` guide has the
7
+ * short version.
8
+ */
9
+
10
+ /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
11
+ export const docs = {
12
+ type: 'namespace',
13
+ name: 'calendars',
14
+ // The docsite lists guide pages by title, so this one sorts directly below
15
+ // Internationalization, the page that links here.
16
+ title: 'Internationalization: calendars',
17
+ summary:
18
+ 'Show dates in the Persian, Hebrew, Islamic, Buddhist, Japanese, lunisolar, and other calendars while values stay Gregorian ISO dates.',
19
+ keywords: [
20
+ 'calendar',
21
+ 'calendar system',
22
+ 'Persian',
23
+ 'Jalali',
24
+ 'Hebrew',
25
+ 'Hijri',
26
+ 'Islamic',
27
+ 'Buddhist',
28
+ 'Japanese era',
29
+ 'lunisolar',
30
+ 'chinese',
31
+ 'dangi',
32
+ 'Ethiopian',
33
+ 'Temporal',
34
+ 'polyfill',
35
+ 'u-ca',
36
+ ],
37
+ slots: {
38
+ guides: {title: 'Guides', accepts: {kinds: ['generic']}},
39
+ },
40
+ blocks: [
41
+ {
42
+ type: 'prose',
43
+ text: '`Calendar` shows the Gregorian calendar unless the application chooses another one; DateInput, DateRangeInput, and DateTimeInput stay Gregorian. Values never change with the calendar: they stay Gregorian ISO dates. {@link generic:i18n-calendars} has the short version.',
44
+ },
45
+ ],
46
+ };
@@ -0,0 +1,51 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file `astryx docs internationalization/i18n-calendars`: the short version of
5
+ * showing dates in another calendar. The `calendars` namespace holds the
6
+ * detail.
7
+ */
8
+
9
+ /** @type {import('@astryxdesign/cli/authoring').ReferenceDoc} */
10
+
11
+ export const docs = {
12
+ type: 'generic',
13
+ name: 'i18n-calendars',
14
+ title: 'Other calendars',
15
+ placement: {
16
+ parent: 'namespace:internationalization',
17
+ slot: 'guides',
18
+ order: 25,
19
+ },
20
+ category: 'guide',
21
+ description:
22
+ 'Show dates in the Persian, Hebrew, Islamic, Buddhist, Japanese, and other calendars while values stay Gregorian ISO dates.',
23
+
24
+ sections: [
25
+ {
26
+ title: 'Show dates in another calendar',
27
+ content: [
28
+ {
29
+ type: 'prose',
30
+ text: 'Set `calendar` on `<InternationalizationProvider>` for a subtree, or on `Calendar` itself; without it, `Calendar` is Gregorian. Values stay Gregorian ISO dates (`YYYY-MM-DD`) in every calendar.',
31
+ },
32
+ {
33
+ type: 'code',
34
+ lang: 'tsx',
35
+ label: 'Persian dates in a Persian interface',
36
+ code: `import {InternationalizationProvider} from '@astryxdesign/core/i18n';
37
+ import {Calendar} from '@astryxdesign/core/Calendar';
38
+
39
+ <InternationalizationProvider locale="fa-IR" calendar="persian">
40
+ {/* shows Aban 1405; value and onChange stay '2026-10-30' */}
41
+ <Calendar value={date} onChange={setDate} />
42
+ </InternationalizationProvider>;`,
43
+ },
44
+ {
45
+ type: 'prose',
46
+ text: "Most calendars need the runtime's `Temporal`. Safari and older runtimes lack it: load `temporal-polyfill/full/global` there, on the server and in the browser. Without it, those calendars show Gregorian dates. See {@link namespace:calendars} for the supported calendars, server rendering, and the lunisolar calendars.",
47
+ },
48
+ ],
49
+ },
50
+ ],
51
+ };
@@ -2,8 +2,8 @@
2
2
 
3
3
  /**
4
4
  * @file `astryx docs internationalization`: the internationalization namespace.
5
- * Groups guides for quick-start locale setup, library integration, and
6
- * RTL + testing.
5
+ * Groups guides for quick-start locale setup, library integration, calendars,
6
+ * and RTL + testing.
7
7
  */
8
8
 
9
9
  /** @type {import('@astryxdesign/cli/authoring').NamespaceDoc} */
@@ -12,7 +12,7 @@ export const docs = {
12
12
  name: 'internationalization',
13
13
  title: 'Internationalization',
14
14
  summary:
15
- 'Set the active locale, load catalogs, coexist with your own i18n library, handle RTL, and test translations.',
15
+ 'Set the active locale, load catalogs, coexist with your own i18n library, show other calendars, handle RTL, and test translations.',
16
16
  keywords: [
17
17
  'i18n',
18
18
  'internationalization',
@@ -6,7 +6,8 @@ export const doc = {
6
6
  exampleFor: 'Tokenizer',
7
7
  name: 'Tokenizer \u2014 Clear',
8
8
  displayName: 'Tokenizer \u2014 Clear',
9
- description: 'Tokenizer with a built-in clear-all button for bulk removal of all selected tokens.',
9
+ description:
10
+ "Tokenizer with a built-in clear-all button for bulk removal of all selected tokens. On touch screens, clear through the sheet's Clear all.",
10
11
  isReady: true,
11
12
  aspectRatio: 16 / 9,
12
13
  componentsUsed: ['Tokenizer', 'Layout', 'Text'],
@@ -29,7 +29,8 @@ export default function TokenizerClear() {
29
29
  <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 400px)'}}>
30
30
  <Stack direction="vertical" gap={2}>
31
31
  <Text type="supporting" color="secondary">
32
- Clear-all button appears when tokens are selected
32
+ Clear-all button appears when tokens are selected; on touch screens,
33
+ clear through the sheet's Clear all
33
34
  </Text>
34
35
  <Tokenizer
35
36
  label="Team Members"
@@ -38,7 +39,6 @@ export default function TokenizerClear() {
38
39
  value={value}
39
40
  onChange={items => setValue(items)}
40
41
  hasClear
41
- presentation="popover"
42
42
  />
43
43
  </Stack>
44
44
  </div>
@@ -59,7 +59,6 @@ export default function TokenizerCreatable() {
59
59
  hasCreate
60
60
  hasEntriesOnFocus
61
61
  placeholder="Search or type a new name..."
62
- presentation="popover"
63
62
  />
64
63
  </Stack>
65
64
  </Stack>
@@ -40,7 +40,6 @@ export default function TokenizerEndContent() {
40
40
  value={value}
41
41
  onChange={items => setValue(items)}
42
42
  endContent={<Button label="Apply" variant="primary" size="sm" />}
43
- presentation="popover"
44
43
  />
45
44
  </Stack>
46
45
  </div>
@@ -6,7 +6,8 @@ export const doc = {
6
6
  exampleFor: 'Tokenizer',
7
7
  name: 'Tokenizer \u2014 Overflow',
8
8
  displayName: 'Tokenizer \u2014 Overflow',
9
- description: 'Tokenizer with overflow truncation when unfocused. Inline mode pushes content down on expand; layer mode overlays without shifting layout.',
9
+ description:
10
+ 'Tokenizer with overflow truncation when unfocused. Inline mode pushes content down on expand; layer mode overlays without shifting layout. Overflow modes apply to the inline field.',
10
11
  isReady: true,
11
12
  aspectRatio: 16 / 9,
12
13
  componentsUsed: ['Tokenizer', 'Layout', 'Text'],
@@ -41,7 +41,6 @@ export default function TokenizerOverflow() {
41
41
  value={inlineValue}
42
42
  onChange={items => setInlineValue(items)}
43
43
  tokenOverflowBehavior="unfocusedInline"
44
- presentation="popover"
45
44
  />
46
45
  </Stack>
47
46
  <Stack direction="vertical" gap={1}>
@@ -55,7 +54,6 @@ export default function TokenizerOverflow() {
55
54
  value={layerValue}
56
55
  onChange={items => setLayerValue(items)}
57
56
  tokenOverflowBehavior="unfocusedLayer"
58
- presentation="popover"
59
57
  />
60
58
  </Stack>
61
59
  </Stack>
@@ -82,6 +82,7 @@ import {
82
82
  StackItem,
83
83
  VStack,
84
84
  } from '@astryxdesign/core/Layout';
85
+ import {rtlStyles} from '@astryxdesign/core/utils';
85
86
  import {
86
87
  durationVars,
87
88
  easeVars,
@@ -1391,7 +1392,13 @@ function ConversationPane({
1391
1392
  <Button
1392
1393
  label="Inbox"
1393
1394
  variant="ghost"
1394
- icon={<Icon icon={ArrowLeftIcon} size="sm" />}
1395
+ icon={
1396
+ <Icon
1397
+ icon={ArrowLeftIcon}
1398
+ size="sm"
1399
+ xstyle={rtlStyles.mirror}
1400
+ />
1401
+ }
1395
1402
  onClick={onClose}
1396
1403
  />
1397
1404
  }
@@ -1840,7 +1847,9 @@ function ComposeWindow({
1840
1847
  // than being rejected for not matching anything.
1841
1848
  hasCreate
1842
1849
  // Stamps data-autofocus, which is what the sheet looks for
1843
- // once the window is actually visible.
1850
+ // once the window is actually visible. It applies to the
1851
+ // inline field: on a compact touch screen the field opens
1852
+ // its own sheet and ignores it.
1844
1853
  //
1845
1854
  // Deliberately without `hasEntriesOnFocus`: the two together
1846
1855
  // mean the window can never open without the full directory
@@ -1874,10 +1883,6 @@ function ComposeWindow({
1874
1883
  )}
1875
1884
  </>
1876
1885
  }
1877
- // The recipient rows read as one header, so all three stay
1878
- // inline fields on every device; the sheet has no end lane
1879
- // for the Cc and Bcc buttons.
1880
- presentation="popover"
1881
1886
  />
1882
1887
  {hasCc ? (
1883
1888
  <Tokenizer
@@ -1888,7 +1893,6 @@ function ComposeWindow({
1888
1893
  value={cc}
1889
1894
  onChange={items => setCc(items)}
1890
1895
  hasCreate
1891
- presentation="popover"
1892
1896
  />
1893
1897
  ) : null}
1894
1898
  {hasBcc ? (
@@ -1900,7 +1904,6 @@ function ComposeWindow({
1900
1904
  value={bcc}
1901
1905
  onChange={items => setBcc(items)}
1902
1906
  hasCreate
1903
- presentation="popover"
1904
1907
  />
1905
1908
  ) : null}
1906
1909
  <TextInput
@@ -29,6 +29,7 @@ import {MoreMenu} from '@astryxdesign/core/MoreMenu';
29
29
  import type {DropdownMenuOption} from '@astryxdesign/core/DropdownMenu';
30
30
  import {Link} from '@astryxdesign/core/Link';
31
31
  import {Icon} from '@astryxdesign/core/Icon';
32
+ import {rtlStyles} from '@astryxdesign/core/utils';
32
33
  import {AspectRatio} from '@astryxdesign/core/AspectRatio';
33
34
  import {Divider} from '@astryxdesign/core/Divider';
34
35
  import {StatusDot} from '@astryxdesign/core/StatusDot';
@@ -381,7 +382,11 @@ function PageHeader({
381
382
  <HStack gap={4} vAlign="center" wrap="wrap">
382
383
  <Link href="#" type="supporting" color="secondary">
383
384
  <HStack as="span" gap={1} vAlign="center">
384
- <Icon icon={ArrowLeftIcon} size="sm" />
385
+ <Icon
386
+ icon={ArrowLeftIcon}
387
+ size="sm"
388
+ xstyle={rtlStyles.mirror}
389
+ />
385
390
  All Tasks
386
391
  </HStack>
387
392
  </Link>
@@ -463,7 +468,6 @@ function PageHeader({
463
468
  onRemove={onRemove}
464
469
  />
465
470
  )}
466
- presentation="popover"
467
471
  />
468
472
  </HStack>
469
473
  </VStack>
@@ -11,6 +11,7 @@ import {DOC_EXPORTS} from '../doc-compiler/read.mjs';
11
11
  import {
12
12
  listDir,
13
13
  listDirEntries,
14
+ listingCacheActive,
14
15
  oncePerListing,
15
16
  pathExists,
16
17
  withListingCache,
@@ -511,6 +512,42 @@ export function discoverComponents(coreDir) {
511
512
  return ordered;
512
513
  }
513
514
 
515
+ /**
516
+ * The folders of `srcDir`, in listing order, whose own listing holds one of
517
+ * `names`: the only folders a probe for `<folder>/<name>` can find. Inside an
518
+ * operation each listing is read once, for every name. Outside one, every
519
+ * folder is returned, so each probe reads the disk.
520
+ * @param {string} srcDir
521
+ * @param {fs.Dirent[]} entries `srcDir`'s listing
522
+ * @param {string[]} names
523
+ * @returns {fs.Dirent[]}
524
+ */
525
+ function foldersHolding(srcDir, entries, names) {
526
+ const folders = entries.filter(entry => entry.isDirectory());
527
+ if (!listingCacheActive()) return folders;
528
+ const byName = oncePerListing(`folder-names\0${srcDir}`, () => {
529
+ /** @type {Map<string, Set<string>>} */
530
+ const index = new Map();
531
+ for (const folder of folders) {
532
+ let listed;
533
+ try {
534
+ listed = listDir(path.join(srcDir, folder.name));
535
+ } catch {
536
+ continue;
537
+ }
538
+ for (const name of listed) {
539
+ let holders = index.get(name);
540
+ if (!holders) index.set(name, (holders = new Set()));
541
+ holders.add(folder.name);
542
+ }
543
+ }
544
+ return index;
545
+ });
546
+ return folders.filter(folder =>
547
+ names.some(name => byName.get(name)?.has(folder.name)),
548
+ );
549
+ }
550
+
514
551
  /**
515
552
  * Find the .doc.mjs file for a component.
516
553
  * For sub-components (e.g. StackItem), returns the parent's .doc.mjs
@@ -532,8 +569,7 @@ export function findComponentReadme(coreDir, name) {
532
569
 
533
570
  // Nested match: src/*/{name}/{Name}.doc.mjs or src/*/{name}/Astryx{Name}.doc.mjs
534
571
  const entries = listDirEntries(srcDir);
535
- for (const entry of entries) {
536
- if (!entry.isDirectory()) continue;
572
+ for (const entry of foldersHolding(srcDir, entries, [name])) {
537
573
  const nested = path.join(srcDir, entry.name, name, exactDoc);
538
574
  if (existsCaseExact(nested, srcDir)) return nested;
539
575
  const nestedXds = path.join(srcDir, entry.name, name, xdsDoc);
@@ -541,8 +577,7 @@ export function findComponentReadme(coreDir, name) {
541
577
  }
542
578
 
543
579
  // Per-component doc in a parent directory: src/*/{Name}.doc.mjs or src/*/Astryx{Name}.doc.mjs
544
- for (const entry of entries) {
545
- if (!entry.isDirectory()) continue;
580
+ for (const entry of foldersHolding(srcDir, entries, [exactDoc, xdsDoc])) {
546
581
  const perComp = path.join(srcDir, entry.name, exactDoc);
547
582
  if (existsCaseExact(perComp, srcDir)) return perComp;
548
583
  const perCompXds = path.join(srcDir, entry.name, xdsDoc);
@@ -199,15 +199,22 @@ export function tryLock(lockDir: string, { now }?: {
199
199
  }): boolean;
200
200
  /**
201
201
  * Whether a process's arguments are this CLI's install of `version`, as
202
- * runNpm starts it: the program (`argv[0]`) is npm, or node running npm's
202
+ * runNpm starts it: the program (`argv[0]`) is npm, or a Node running npm's
203
203
  * entry file `npm-cli.js` (`argv[1]`), each exactly by name, and the arguments
204
- * include `install` and `@astryxdesign/cli@<version>`. A program that only has
205
- * `npm` somewhere in its name or arguments is not.
204
+ * include `install` and `@astryxdesign/cli@<version>`. A Node is one named
205
+ * `node` (with a version, such as `node22`), or one with the same file name
206
+ * as the Node runNpm starts npm with (`node`, by default this one), however
207
+ * it is named, such as `nodejs` or `node-linux-x64`. A program that only
208
+ * has `npm` somewhere in its name or arguments is not.
206
209
  * @param {string[]} argv
207
210
  * @param {string} version
211
+ * @param {{node?: string}} [options] `node`: the Node runNpm starts npm with
212
+ * (npmCommand's `execPath`; default: this one)
208
213
  * @returns {boolean}
209
214
  */
210
- export function isReleaseInstall(argv: string[], version: string): boolean;
215
+ export function isReleaseInstall(argv: string[], version: string, { node }?: {
216
+ node?: string;
217
+ }): boolean;
211
218
  /**
212
219
  * End the npm process group a stale lock records, only when that process is
213
220
  * surely the install the lock was taken for: its command line is this CLI's
@@ -823,15 +823,24 @@ function processFactsOf(pid, procRoot) {
823
823
 
824
824
  /**
825
825
  * Whether a process's arguments are this CLI's install of `version`, as
826
- * runNpm starts it: the program (`argv[0]`) is npm, or node running npm's
826
+ * runNpm starts it: the program (`argv[0]`) is npm, or a Node running npm's
827
827
  * entry file `npm-cli.js` (`argv[1]`), each exactly by name, and the arguments
828
- * include `install` and `@astryxdesign/cli@<version>`. A program that only has
829
- * `npm` somewhere in its name or arguments is not.
828
+ * include `install` and `@astryxdesign/cli@<version>`. A Node is one named
829
+ * `node` (with a version, such as `node22`), or one with the same file name
830
+ * as the Node runNpm starts npm with (`node`, by default this one), however
831
+ * it is named, such as `nodejs` or `node-linux-x64`. A program that only
832
+ * has `npm` somewhere in its name or arguments is not.
830
833
  * @param {string[]} argv
831
834
  * @param {string} version
835
+ * @param {{node?: string}} [options] `node`: the Node runNpm starts npm with
836
+ * (npmCommand's `execPath`; default: this one)
832
837
  * @returns {boolean}
833
838
  */
834
- export function isReleaseInstall(argv, version) {
839
+ export function isReleaseInstall(
840
+ argv,
841
+ version,
842
+ {node = process.execPath} = {},
843
+ ) {
835
844
  const name = (/** @type {string | undefined} */ arg) =>
836
845
  (arg ?? '')
837
846
  .split(/[\\/]/u)
@@ -839,9 +848,8 @@ export function isReleaseInstall(argv, version) {
839
848
  ?.replace(/\.(?:exe|cmd)$/iu, '')
840
849
  .toLowerCase() ?? '';
841
850
  const program = name(argv[0]);
842
- const npm =
843
- program === 'npm' ||
844
- (/^node(?:[-.\d]*)$/u.test(program) && name(argv[1]) === 'npm-cli.js');
851
+ const isNode = /^node(?:[-.\d]*)$/u.test(program) || program === name(node);
852
+ const npm = program === 'npm' || (isNode && name(argv[1]) === 'npm-cli.js');
845
853
  return (
846
854
  npm &&
847
855
  argv.includes('install') &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.9-canary.d0cf29a",
3
+ "version": "0.7.9-canary.d8387c5",
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",
@@ -124,10 +124,10 @@
124
124
  "zod": "^4.4.3"
125
125
  },
126
126
  "peerDependencies": {
127
- "@astryxdesign/charts": "0.7.9-canary.d0cf29a",
128
- "@astryxdesign/core": "0.7.9-canary.d0cf29a",
129
- "@astryxdesign/lab": "0.7.9-canary.d0cf29a",
130
- "@astryxdesign/theme-neutral": "0.7.9-canary.d0cf29a"
127
+ "@astryxdesign/charts": "0.7.9-canary.d8387c5",
128
+ "@astryxdesign/core": "0.7.9-canary.d8387c5",
129
+ "@astryxdesign/lab": "0.7.9-canary.d8387c5",
130
+ "@astryxdesign/theme-neutral": "0.7.9-canary.d8387c5"
131
131
  },
132
132
  "peerDependenciesMeta": {
133
133
  "@astryxdesign/charts": {
@@ -144,10 +144,10 @@
144
144
  }
145
145
  },
146
146
  "devDependencies": {
147
- "@astryxdesign/charts": "0.7.9-canary.d0cf29a",
148
- "@astryxdesign/core": "0.7.9-canary.d0cf29a",
149
- "@astryxdesign/lab": "0.7.9-canary.d0cf29a",
150
- "@astryxdesign/theme-neutral": "0.7.9-canary.d0cf29a",
147
+ "@astryxdesign/charts": "0.7.9-canary.d8387c5",
148
+ "@astryxdesign/core": "0.7.9-canary.d8387c5",
149
+ "@astryxdesign/lab": "0.7.9-canary.d8387c5",
150
+ "@astryxdesign/theme-neutral": "0.7.9-canary.d8387c5",
151
151
  "@heroicons/react": "^2.2.0",
152
152
  "@stylexjs/stylex": "^0.19.0",
153
153
  "@types/babel__core": "^7.20.5",