@astryxdesign/cli 0.7.8 → 0.7.9-canary.07992bb

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 (80) hide show
  1. package/api/discover/_adapter.d.mts +1 -1
  2. package/api/docs/_adapter.d.mts +8 -2
  3. package/api/docs/_adapter.mjs +10 -4
  4. package/api/docs/detail/section/section.d.mts +5 -2
  5. package/api/docs/detail/section/section.mjs +6 -2
  6. package/api/docs/docs.mjs +7 -1
  7. package/api/search/_adapter.d.mts +3 -1
  8. package/api/search/_adapter.mjs +12 -2
  9. package/api/search/_main-searcher.mjs +1 -1
  10. package/api/search/_result.d.mts +5 -5
  11. package/api/search/search.d.mts +4 -2
  12. package/api/search/search.mjs +9 -8
  13. package/api/theme/build/build.d.mts +26 -1
  14. package/api/theme/build/build.mjs +50 -19
  15. package/api/theme/build/core-interception.d.mts +2 -1
  16. package/api/theme/build/core-interception.mjs +23 -5
  17. package/assets/docs/tree/calendar-systems.doc.mjs +146 -0
  18. package/assets/docs/tree/calendars.doc.mjs +46 -0
  19. package/assets/docs/tree/i18n-calendars.doc.mjs +51 -0
  20. package/assets/docs/tree/internationalization.doc.mjs +3 -3
  21. package/assets/docs/tree/tokens-color.doc.mjs +1 -1
  22. package/assets/templates/blocks/components/Hooks/useClickableContainerHookUsage.doc.mjs +14 -0
  23. package/assets/templates/blocks/components/Hooks/useClickableContainerHookUsage.tsx +67 -0
  24. package/assets/templates/blocks/components/Hooks/useImageModeHookUsage.doc.mjs +14 -0
  25. package/assets/templates/blocks/components/Hooks/useImageModeHookUsage.tsx +55 -0
  26. package/assets/templates/blocks/components/InfoTip/InfoTipMetricDefinitions.doc.mjs +14 -0
  27. package/assets/templates/blocks/components/InfoTip/InfoTipMetricDefinitions.tsx +46 -0
  28. package/assets/templates/blocks/components/InfoTip/InfoTipPermissionNotes.doc.mjs +14 -0
  29. package/assets/templates/blocks/components/InfoTip/InfoTipPermissionNotes.tsx +41 -0
  30. package/assets/templates/blocks/components/InfoTip/InfoTipShowcase.doc.mjs +13 -0
  31. package/assets/templates/blocks/components/InfoTip/InfoTipShowcase.tsx +24 -0
  32. package/assets/templates/blocks/components/PowerSearch/PowerSearchContentSearch.tsx +8 -7
  33. package/assets/templates/blocks/components/PowerSearch/PowerSearchFullFeatured.tsx +8 -7
  34. package/assets/templates/blocks/components/PowerSearch/PowerSearchPresetFilters.tsx +8 -7
  35. package/assets/templates/blocks/components/PowerSearch/PowerSearchSearchWithTable.tsx +12 -10
  36. package/assets/templates/blocks/components/PowerSearch/PowerSearchShowcase.tsx +8 -7
  37. package/assets/templates/blocks/components/Tokenizer/TokenizerClear.doc.mjs +2 -1
  38. package/assets/templates/blocks/components/Tokenizer/TokenizerClear.tsx +2 -2
  39. package/assets/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +0 -1
  40. package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +0 -1
  41. package/assets/templates/blocks/components/Tokenizer/TokenizerOverflow.doc.mjs +2 -1
  42. package/assets/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +0 -2
  43. package/assets/templates/pages/table-inbox/page.tsx +11 -8
  44. package/assets/templates/pages/work-item-detail/page.tsx +6 -2
  45. package/assets/theme.template.ts +1 -1
  46. package/authoring/debug/parse.d.mts +2 -2
  47. package/clients/cli/index.mjs +11 -6
  48. package/foundation/agent-docs/agent-docs-target.d.mts +49 -0
  49. package/foundation/agent-docs/agent-docs-target.mjs +201 -0
  50. package/foundation/agent-docs/agent-docs.d.mts +1 -38
  51. package/foundation/agent-docs/agent-docs.mjs +16 -181
  52. package/foundation/config/config-path.d.mts +13 -0
  53. package/foundation/config/config-path.mjs +42 -0
  54. package/foundation/config/project.d.mts +1 -10
  55. package/foundation/config/project.mjs +4 -26
  56. package/foundation/discovery/component-discovery.mjs +39 -4
  57. package/foundation/discovery/component-loader.d.mts +1 -1
  58. package/foundation/discovery/icon-set-paths.d.mts +18 -0
  59. package/foundation/discovery/icon-set-paths.mjs +23 -0
  60. package/foundation/discovery/icon-set-writer.d.mts +2 -7
  61. package/foundation/discovery/icon-set-writer.mjs +3 -12
  62. package/foundation/fs/module-loader.d.mts +2 -8
  63. package/foundation/fs/module-loader.mjs +3 -12
  64. package/foundation/fs/present-files.d.mts +11 -0
  65. package/foundation/fs/present-files.mjs +25 -0
  66. package/foundation/integrations/autolink.d.mts +2 -21
  67. package/foundation/integrations/autolink.mjs +6 -42
  68. package/foundation/integrations/contribution-fixes.mjs +26 -3
  69. package/foundation/integrations/contribution-inventory.mjs +1 -1
  70. package/foundation/integrations/installed-package.d.mts +36 -0
  71. package/foundation/integrations/installed-package.mjs +57 -0
  72. package/foundation/integrations/integrations.d.mts +3 -75
  73. package/foundation/integrations/integrations.mjs +3 -16
  74. package/foundation/integrations/manifest-paths.d.mts +13 -0
  75. package/foundation/integrations/manifest-paths.mjs +31 -0
  76. package/foundation/release/cache.d.mts +11 -4
  77. package/foundation/release/cache.mjs +15 -7
  78. package/foundation/runtime/locked-versions.mjs +1 -1
  79. package/foundation/runtime/package-set.mjs +1 -1
  80. package/package.json +9 -9
@@ -39,9 +39,14 @@
39
39
 
40
40
  import * as fs from 'node:fs';
41
41
  import * as path from 'node:path';
42
- import {findNodeModulesPackage} from '../fs/paths.mjs';
43
42
  import {findManifestPaths, loadIntegrations} from './integrations.mjs';
44
43
  import {resolveProviders} from './provider-resolution.mjs';
44
+ import {
45
+ isBarePackageName,
46
+ resolveInstalledPackageDir,
47
+ } from './installed-package.mjs';
48
+
49
+ export {resolveInstalledPackageDir};
45
50
 
46
51
  /**
47
52
  * package.json fields whose keys name a dependency this project installs.
@@ -58,26 +63,6 @@ export const DEPENDENCY_FIELDS = Object.freeze([
58
63
  'optionalDependencies',
59
64
  ]);
60
65
 
61
- /**
62
- * Whether a dependency key is a bare package name safe to resolve.
63
- *
64
- * Mirrors the guard in {@link import('./integrations.mjs').resolvePackageDir}:
65
- * a name is a directory under node_modules, so a path segment (`.`, `..`) or an
66
- * absolute spec must never reach the resolver, which goes on to dynamically
67
- * import what it finds.
68
- *
69
- * @param {string} name
70
- * @returns {boolean}
71
- */
72
- function isBarePackageName(name) {
73
- return (
74
- typeof name === 'string' &&
75
- name.length > 0 &&
76
- !path.isAbsolute(name) &&
77
- !name.startsWith('@/') &&
78
- !name.split('/').some(segment => segment === '.' || segment === '..')
79
- );
80
- }
81
66
 
82
67
  /**
83
68
  * The dependency names this project declares, in field then declaration order,
@@ -118,27 +103,6 @@ export function readDeclaredDependencies(projectDir) {
118
103
  return declared;
119
104
  }
120
105
 
121
- /**
122
- * Resolve an installed package's directory the way Node's resolver finds it:
123
- * the nearest `node_modules/<name>` walking up from `fromDir`.
124
- *
125
- * Walking up matters because hoisting is normal — yarn and npm workspaces lift
126
- * a workspace member's dependency to the repo root, so the app's own
127
- * node_modules can be empty of a package it genuinely declares. Integrations
128
- * named in astryx.config resolve through the same walk.
129
- *
130
- * Presence is decided by the package's own package.json, not the directory, so
131
- * a stale empty directory is not mistaken for an install.
132
- *
133
- * @param {string} name bare package name
134
- * @param {string} fromDir directory to start walking up from
135
- * @returns {{packageDir: string, hostDir: string}|null} the resolved package
136
- * directory and the directory whose node_modules holds it
137
- */
138
- export function resolveInstalledPackageDir(name, fromDir) {
139
- if (!isBarePackageName(name)) return null;
140
- return findNodeModulesPackage(fromDir, name);
141
- }
142
106
 
143
107
  /**
144
108
  * Resolve a path through symlinks for identity comparison. pnpm links every
@@ -20,7 +20,7 @@
20
20
 
21
21
  import * as fs from 'node:fs';
22
22
  import * as path from 'node:path';
23
- import jscodeshift from 'jscodeshift';
23
+ import {createRequire} from 'node:module';
24
24
  import {isValidSemver} from '../env/semver.mjs';
25
25
  import {
26
26
  isThemeFolder as readsAsTheme,
@@ -88,7 +88,29 @@ const ROOT_HOLDS = /** @type {Record<MetadataRoot, string>} */ ({
88
88
  themes: 'themes',
89
89
  });
90
90
 
91
- const j = jscodeshift.withParser('tsx');
91
+ const require = createRequire(import.meta.url);
92
+ /** @type {typeof import('jscodeshift').default | undefined} */
93
+ let jscodeshiftModule;
94
+ /** @type {ReturnType<typeof import('jscodeshift').default['withParser']> | undefined} */
95
+ let tsxParser;
96
+
97
+ /**
98
+ * jscodeshift, loaded at its first use: it is a large module, and a run that
99
+ * checks no contribution file never needs it.
100
+ * @returns {typeof import('jscodeshift').default}
101
+ */
102
+ function jscodeshift() {
103
+ jscodeshiftModule ??= require('jscodeshift');
104
+ return /** @type {typeof import('jscodeshift').default} */ (
105
+ jscodeshiftModule
106
+ );
107
+ }
108
+
109
+ /** jscodeshift with the TypeScript parser, made once. */
110
+ function tsx() {
111
+ tsxParser ??= jscodeshift().withParser('tsx');
112
+ return tsxParser;
113
+ }
92
114
 
93
115
  /** @param {any} node @returns {any} */
94
116
  function unwrapStaticExpression(node) {
@@ -136,6 +158,7 @@ function staticPropertyNamed(property, name) {
136
158
  * @returns {ContributionStamp | null} null when it is not contribution metadata
137
159
  */
138
160
  export function readContributionStamp(file, templateOnly) {
161
+ const j = tsx();
139
162
  let ast;
140
163
  try {
141
164
  ast = j(fs.readFileSync(file, 'utf-8'));
@@ -526,7 +549,7 @@ function localImports(entry) {
526
549
  /** @type {string[]} */
527
550
  const specifiers = [];
528
551
  try {
529
- const js = jscodeshift.withParser(
552
+ const js = jscodeshift().withParser(
530
553
  /\.(?:ts|tsx|mts)$/u.test(file) ? 'tsx' : 'babel',
531
554
  );
532
555
  const ast = js(fs.readFileSync(file, 'utf-8'));
@@ -25,7 +25,7 @@ import {discoverIntegrationTemplatesForOne} from '../discovery/template-adapter.
25
25
  import {discoverIntegrationCodemods} from '../../assets/codemods/integration-discovery.mjs';
26
26
  import {discoverIntegrationDocs} from '../discovery/docs-discovery.mjs';
27
27
  import {discoverIconSetDirectory} from '../discovery/icon-set-discovery.mjs';
28
- import {generatedTypesPath} from '../discovery/icon-set-writer.mjs';
28
+ import {generatedTypesPath} from '../discovery/icon-set-paths.mjs';
29
29
 
30
30
  // ── File-walk helpers (no module imports, no execution) ──────────
31
31
 
@@ -0,0 +1,36 @@
1
+ // @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
2
+ // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
+
4
+ /**
5
+ * Whether a dependency key is a bare package name safe to resolve.
6
+ *
7
+ * Mirrors the guard in {@link import('./integrations.mjs').resolvePackageDir}:
8
+ * a name is a directory under node_modules, so a path segment (`.`, `..`) or an
9
+ * absolute spec must never reach the resolver, which goes on to dynamically
10
+ * import what it finds.
11
+ *
12
+ * @param {string} name
13
+ * @returns {boolean}
14
+ */
15
+ export function isBarePackageName(name: string): boolean;
16
+ /**
17
+ * Resolve an installed package's directory the way Node's resolver finds it:
18
+ * the nearest `node_modules/<name>` walking up from `fromDir`.
19
+ *
20
+ * Walking up matters because hoisting is normal — yarn and npm workspaces lift
21
+ * a workspace member's dependency to the repo root, so the app's own
22
+ * node_modules can be empty of a package it genuinely declares. Integrations
23
+ * named in astryx.config resolve through the same walk.
24
+ *
25
+ * Presence is decided by the package's own package.json, not the directory, so
26
+ * a stale empty directory is not mistaken for an install.
27
+ *
28
+ * @param {string} name bare package name
29
+ * @param {string} fromDir directory to start walking up from
30
+ * @returns {{packageDir: string, hostDir: string}|null} the resolved package
31
+ * directory and the directory whose node_modules holds it
32
+ */
33
+ export function resolveInstalledPackageDir(name: string, fromDir: string): {
34
+ packageDir: string;
35
+ hostDir: string;
36
+ } | null;
@@ -0,0 +1,57 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file installed-package.mjs
5
+ * @input A dependency name and the folder to resolve it from
6
+ * @output isBarePackageName and resolveInstalledPackageDir: where an installed
7
+ * package is, found the way Node's resolver walks up node_modules
8
+ * @position packages/cli/foundation/integrations: loads no integration, so the
9
+ * run's locked versions resolve packages without autolink.mjs and its
10
+ * manifest loader. autolink.mjs re-exports resolveInstalledPackageDir.
11
+ */
12
+
13
+ import * as path from 'node:path';
14
+ import {findNodeModulesPackage} from '../fs/paths.mjs';
15
+
16
+ /**
17
+ * Whether a dependency key is a bare package name safe to resolve.
18
+ *
19
+ * Mirrors the guard in {@link import('./integrations.mjs').resolvePackageDir}:
20
+ * a name is a directory under node_modules, so a path segment (`.`, `..`) or an
21
+ * absolute spec must never reach the resolver, which goes on to dynamically
22
+ * import what it finds.
23
+ *
24
+ * @param {string} name
25
+ * @returns {boolean}
26
+ */
27
+ export function isBarePackageName(name) {
28
+ return (
29
+ typeof name === 'string' &&
30
+ name.length > 0 &&
31
+ !path.isAbsolute(name) &&
32
+ !name.startsWith('@/') &&
33
+ !name.split('/').some(segment => segment === '.' || segment === '..')
34
+ );
35
+ }
36
+
37
+ /**
38
+ * Resolve an installed package's directory the way Node's resolver finds it:
39
+ * the nearest `node_modules/<name>` walking up from `fromDir`.
40
+ *
41
+ * Walking up matters because hoisting is normal — yarn and npm workspaces lift
42
+ * a workspace member's dependency to the repo root, so the app's own
43
+ * node_modules can be empty of a package it genuinely declares. Integrations
44
+ * named in astryx.config resolve through the same walk.
45
+ *
46
+ * Presence is decided by the package's own package.json, not the directory, so
47
+ * a stale empty directory is not mistaken for an install.
48
+ *
49
+ * @param {string} name bare package name
50
+ * @param {string} fromDir directory to start walking up from
51
+ * @returns {{packageDir: string, hostDir: string}|null} the resolved package
52
+ * directory and the directory whose node_modules holds it
53
+ */
54
+ export function resolveInstalledPackageDir(name, fromDir) {
55
+ if (!isBarePackageName(name)) return null;
56
+ return findNodeModulesPackage(fromDir, name);
57
+ }
@@ -21,14 +21,6 @@
21
21
  * @returns {LoadedIntegration[]}
22
22
  */
23
23
  export function markProviderConflicts(integrations: LoadedIntegration[]): LoadedIntegration[];
24
- /**
25
- * Return the conventional root manifest paths present in `dir`, in
26
- * load-precedence order. Unlike {@link resolveManifestPath} this never throws —
27
- * callers (for example Doctor integration validation) decide how to treat zero / multiple.
28
- * @param {string} dir
29
- * @returns {string[]} absolute manifest paths
30
- */
31
- export function findManifestPaths(dir: string): string[];
32
24
  /**
33
25
  * Load and validate a manifest module's default export, while isolating the
34
26
  * optional `agentDocs` contribution from the manifest's other fields.
@@ -120,73 +112,6 @@ export function loadIntegrations(specs?: string[], { cwd, fresh, resolveProvider
120
112
  fresh?: boolean;
121
113
  resolveProviders?: boolean;
122
114
  }): Promise<LoadedIntegration[]>;
123
- /**
124
- * A fully-resolved, loaded integration. Identity (`name`, `version`) comes from
125
- * the package's package.json; the `components`/`templates`/`codemods`/`docs`/
126
- * `themes` roots are absolute paths resolved from the manifest. The `__`-prefixed fields
127
- * are internal bookkeeping used by Doctor integration validation and Project.
128
- * @typedef {object} LoadedIntegration
129
- * @property {string} name
130
- * @property {import('../../authoring/identity/type').ProviderId} [providerId]
131
- * normalized stable provider identity; absent only for a legacy unnamed local
132
- * package. Unique among contributing integrations: a later claimant is kept
133
- * inert with `__providerConflict` (see {@link markProviderConflicts})
134
- * @property {string} [version]
135
- * @property {string} [components]
136
- * @property {string} [templates]
137
- * @property {string} [codemods]
138
- * @property {string} [docs]
139
- * @property {string} [themes]
140
- * @property {string} [iconSets] the manifest's `experimental.iconSets` root
141
- * @property {string} [issuesUrl]
142
- * @property {{append?: readonly string[]}} [agentDocs]
143
- * @property {string} [cliCommand] the command this package's users run the
144
- * CLI with; read by the picker in foundation/env (see cli-command.mjs)
145
- * @property {string} [__cliCommandError] why a declared `cliCommand` was
146
- * ignored; the rest of the manifest still contributes
147
- * @property {string} [__agentDocsError] contribution-specific validation
148
- * failure; other manifest contributions remain available
149
- * @property {string} __spec
150
- * @property {string} [__declaredProviderId] the manifest's `providerId` as
151
- * written, kept by validation so it can tell whether the package has one
152
- * @property {string} __packageDir
153
- * @property {Record<string, unknown>|null} [__packageExports] the owning
154
- * package's `exports` map, kept from the package.json this loader already
155
- * parsed so import resolution does not read it a second time
156
- * @property {string} __manifestFile
157
- * @property {string} [__loadError] set when the manifest failed to load/validate;
158
- * such an integration contributes nothing and is surfaced via Project.issues()
159
- * @property {{providerId: import('../../authoring/identity/type').ProviderId, claimedBy: string, message: string}} [__providerConflict]
160
- * set on a package whose provider ID an earlier-loaded package already
161
- * claims; it contributes nothing and is reported as a `duplicate_provider`
162
- * warning
163
- * @property {string[]} [__declaredKeys] the keys the manifest object itself
164
- * declares, before any is filled in (providerId from the package name)
165
- * @property {string[]} [__unknownKeys] manifest keys this CLI does not know —
166
- * surfaced as a warning; the rest of the manifest still contributes
167
- * @property {boolean} [__autolinked] loaded because the project declares the
168
- * package as a dependency and it ships a manifest, with no astryx.config
169
- * entry naming it — see foundation/integrations/autolink.mjs
170
- * @property {boolean} [__computer] loaded because it is installed beside the
171
- * running CLI and the folder is outside a project (spec AST-081 FR12) — see
172
- * foundation/integrations/computer-integrations.mjs
173
- * @property {boolean} [__local] loaded from the package containing the current
174
- * working directory, so an author sees the exact bytes they are editing
175
- * @property {string} [__dependencyField] for an autolinked integration, the
176
- * package.json field that declared it (`dependencies`, `devDependencies`,
177
- * `optionalDependencies`)
178
- * @property {import('../../authoring/debug/type').DebugEventHandler} [__debug]
179
- * the manifest module's `debug` NAMED export, when it exported a function.
180
- * @property {import('../../authoring/gap-report/type').GapReportHandler} [__gapReport]
181
- * validated package-owned handler from the `gapReport` NAMED export.
182
- * @property {string} [__gapReportError] isolated named-handler validation error.
183
- * Named exports are not manifest keys — see {@link loadManifest}.
184
- * @property {import('../../authoring/discover/type').DiscoverSource} [__discover]
185
- * validated catalog source from the `discover` NAMED export.
186
- * @property {string} [__discoverError] isolated discover-source validation error.
187
- */
188
- /** Conventional manifest basenames, in load-precedence order. */
189
- export const MANIFEST_BASENAMES: string[];
190
115
  /**
191
116
  * A fully-resolved, loaded integration. Identity (`name`, `version`) comes from
192
117
  * the package's package.json; the `components`/`templates`/`codemods`/`docs`/
@@ -314,3 +239,6 @@ export type LoadedIntegration = {
314
239
  */
315
240
  __discoverError?: string | undefined;
316
241
  };
242
+ import { findManifestPaths } from './manifest-paths.mjs';
243
+ import { MANIFEST_BASENAMES } from './manifest-paths.mjs';
244
+ export { findManifestPaths, MANIFEST_BASENAMES };
@@ -32,6 +32,9 @@ import {
32
32
  unknownIntegrationKeys,
33
33
  } from '../../authoring/integration/schema.mjs';
34
34
  import {importUserModule, findPresentFiles} from '../fs/module-loader.mjs';
35
+ import {findManifestPaths, MANIFEST_BASENAMES} from './manifest-paths.mjs';
36
+
37
+ export {findManifestPaths, MANIFEST_BASENAMES};
35
38
  import {parseGapReportHandler} from '../../authoring/gap-report/parse.mjs';
36
39
  import {parseDiscoverSource} from '../../authoring/discover/parse.mjs';
37
40
  import {resolveProviders} from './provider-resolution.mjs';
@@ -102,12 +105,6 @@ import {resolveProviders} from './provider-resolution.mjs';
102
105
  * @property {string} [__discoverError] isolated discover-source validation error.
103
106
  */
104
107
 
105
- /** Conventional manifest basenames, in load-precedence order. */
106
- export const MANIFEST_BASENAMES = [
107
- 'astryx.integration.ts',
108
- 'astryx.integration.mjs',
109
- 'astryx.integration.js',
110
- ];
111
108
 
112
109
  /**
113
110
  * Normalize a package-owned provider ID without rejecting legacy unnamed local
@@ -153,16 +150,6 @@ export function markProviderConflicts(integrations) {
153
150
  ).integrations;
154
151
  }
155
152
 
156
- /**
157
- * Return the conventional root manifest paths present in `dir`, in
158
- * load-precedence order. Unlike {@link resolveManifestPath} this never throws —
159
- * callers (for example Doctor integration validation) decide how to treat zero / multiple.
160
- * @param {string} dir
161
- * @returns {string[]} absolute manifest paths
162
- */
163
- export function findManifestPaths(dir) {
164
- return findPresentFiles(dir, MANIFEST_BASENAMES);
165
- }
166
153
 
167
154
  /**
168
155
  * Parse the optional named gap-report handler without making it part of the
@@ -0,0 +1,13 @@
1
+ // @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
2
+ // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
+
4
+ /**
5
+ * Return the conventional root manifest paths present in `dir`, in
6
+ * load-precedence order. Unlike {@link resolveManifestPath} this never throws —
7
+ * callers (for example Doctor integration validation) decide how to treat zero / multiple.
8
+ * @param {string} dir
9
+ * @returns {string[]} absolute manifest paths
10
+ */
11
+ export function findManifestPaths(dir: string): string[];
12
+ /** Conventional manifest basenames, in load-precedence order. */
13
+ export const MANIFEST_BASENAMES: string[];
@@ -0,0 +1,31 @@
1
+ // Copyright (c) Meta Platforms, Inc. and affiliates.
2
+
3
+ /**
4
+ * @file manifest-paths.mjs
5
+ * @input A package folder
6
+ * @output MANIFEST_BASENAMES and findManifestPaths: the integration manifests
7
+ * a package has, in load-precedence order
8
+ * @position packages/cli/foundation/integrations: reads no manifest, so the
9
+ * run's package set finds them without integrations.mjs, its schemas and
10
+ * its module loader. integrations.mjs re-exports both.
11
+ */
12
+
13
+ import {findPresentFiles} from '../fs/present-files.mjs';
14
+
15
+ /** Conventional manifest basenames, in load-precedence order. */
16
+ export const MANIFEST_BASENAMES = [
17
+ 'astryx.integration.ts',
18
+ 'astryx.integration.mjs',
19
+ 'astryx.integration.js',
20
+ ];
21
+
22
+ /**
23
+ * Return the conventional root manifest paths present in `dir`, in
24
+ * load-precedence order. Unlike {@link resolveManifestPath} this never throws —
25
+ * callers (for example Doctor integration validation) decide how to treat zero / multiple.
26
+ * @param {string} dir
27
+ * @returns {string[]} absolute manifest paths
28
+ */
29
+ export function findManifestPaths(dir) {
30
+ return findPresentFiles(dir, MANIFEST_BASENAMES);
31
+ }
@@ -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') &&
@@ -14,7 +14,7 @@
14
14
 
15
15
  import * as path from 'node:path';
16
16
  import {findLockfile, lockedVersion, readJson} from '../release/project.mjs';
17
- import {resolveInstalledPackageDir} from '../integrations/autolink.mjs';
17
+ import {resolveInstalledPackageDir} from '../integrations/installed-package.mjs';
18
18
 
19
19
  const SCOPE = '@astryxdesign/';
20
20
  const FIELDS = ['dependencies', 'devDependencies', 'optionalDependencies'];
@@ -22,7 +22,7 @@
22
22
 
23
23
  import * as fs from 'node:fs';
24
24
  import * as path from 'node:path';
25
- import {findManifestPaths} from '../integrations/integrations.mjs';
25
+ import {findManifestPaths} from '../integrations/manifest-paths.mjs';
26
26
  import {readJson} from '../release/project.mjs';
27
27
  import {cliBinOf, isVersionRange} from '../release/cache.mjs';
28
28
  import {isValidSemver, satisfiesRange} from '../env/semver.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.8",
3
+ "version": "0.7.9-canary.07992bb",
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": "*",
128
- "@astryxdesign/core": "*",
129
- "@astryxdesign/lab": "*",
130
- "@astryxdesign/theme-neutral": "*"
127
+ "@astryxdesign/charts": "0.7.9-canary.07992bb",
128
+ "@astryxdesign/core": "0.7.9-canary.07992bb",
129
+ "@astryxdesign/lab": "0.7.9-canary.07992bb",
130
+ "@astryxdesign/theme-neutral": "0.7.9-canary.07992bb"
131
131
  },
132
132
  "peerDependenciesMeta": {
133
133
  "@astryxdesign/charts": {
@@ -144,10 +144,10 @@
144
144
  }
145
145
  },
146
146
  "devDependencies": {
147
- "@astryxdesign/charts": "*",
148
- "@astryxdesign/core": "*",
149
- "@astryxdesign/lab": "*",
150
- "@astryxdesign/theme-neutral": "*",
147
+ "@astryxdesign/charts": "0.7.9-canary.07992bb",
148
+ "@astryxdesign/core": "0.7.9-canary.07992bb",
149
+ "@astryxdesign/lab": "0.7.9-canary.07992bb",
150
+ "@astryxdesign/theme-neutral": "0.7.9-canary.07992bb",
151
151
  "@heroicons/react": "^2.2.0",
152
152
  "@stylexjs/stylex": "^0.19.0",
153
153
  "@types/babel__core": "^7.20.5",