@astryxdesign/cli 0.7.2-canary.081ccea → 0.7.2-canary.0d5d64e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -84
- package/api/build/_adapter.d.mts +8 -0
- package/api/build/_adapter.mjs +12 -1
- package/api/build/build.doc.mjs +4 -0
- package/api/build/kit/kit.mjs +3 -11
- package/api/component/_adapter.mjs +3 -11
- package/api/component/component.doc.mjs +6 -1
- package/api/discover/_adapter.d.mts +13 -0
- package/api/discover/_adapter.mjs +39 -17
- package/api/discover/discover.doc.mjs +3 -2
- package/api/discover/discover.mjs +22 -8
- package/api/discover/discover.type.d.mts +5 -3
- package/api/discover/discover.type.mjs +5 -3
- package/api/docs/_adapter.mjs +3 -2
- package/api/docs/docs.doc.mjs +2 -1
- package/api/docs/docs.mjs +2 -1
- package/api/docs/docs.test.mjs +5 -2
- package/api/docs/reference-blocks.test.mjs +1 -3
- package/api/doctor/_adapter.d.mts +108 -0
- package/api/doctor/_adapter.mjs +223 -4
- package/api/doctor/doctor.d.mts +199 -0
- package/api/doctor/doctor.doc.mjs +3 -2
- package/api/doctor/doctor.mjs +503 -31
- package/api/doctor/doctor.test.mjs +137 -14
- package/api/doctor/release-checks.test.mjs +156 -0
- package/api/doctor/theme-checks.mjs +16 -3
- package/api/doctor/theme-checks.test.mjs +87 -7
- package/api/error.d.mts +10 -0
- package/api/error.mjs +25 -0
- package/api/hook/_adapter.mjs +3 -11
- package/api/hook/hook.doc.mjs +4 -0
- package/api/hook/list/list.d.mts +1 -1
- package/api/init/_adapter.d.mts +22 -0
- package/api/init/_adapter.mjs +59 -0
- package/api/init/init.d.mts +7 -5
- package/api/init/init.doc.mjs +28 -7
- package/api/init/init.mjs +28 -4
- package/api/init/init.type.d.mts +48 -3
- package/api/init/init.type.mjs +37 -3
- package/api/init/run/run.d.mts +1 -1
- package/api/init/run/run.mjs +15 -4
- package/api/init/user/user.d.mts +14 -0
- package/api/init/user/user.mjs +87 -0
- package/api/init/user/user.test.mjs +232 -0
- package/api/integration/authoring-checks.mjs +2 -2
- package/api/integration/integrationCheck.doc.mjs +1 -1
- package/api/integration/pack-check.mjs +10 -9
- package/api/integration/pack-check.test.mjs +9 -15
- package/api/integration/validate-integration.d.mts +8 -0
- package/api/integration/validate-integration.mjs +27 -6
- package/api/integration/validate-integration.type.d.mts +8 -0
- package/api/integration/validate-integration.type.mjs +3 -1
- package/api/integration/validate-unread-theme-folders.test.mjs +3 -2
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/search/_adapter.d.mts +11 -0
- package/api/search/_adapter.mjs +25 -0
- package/api/search/search.d.mts +1 -1
- package/api/search/search.doc.mjs +8 -3
- package/api/search/search.mjs +38 -14
- package/api/search/search.test.mjs +4 -1
- package/api/search/search.type.d.mts +14 -1
- package/api/search/search.type.mjs +6 -1
- package/api/swizzle/_adapter.mjs +2 -2
- package/api/swizzle/copy/copy.mjs +1 -1
- package/api/template/template-integration.test.mjs +1 -1
- package/api/theme/_adapter.d.mts +16 -0
- package/api/theme/_adapter.mjs +32 -5
- package/api/theme/build/build.d.mts +2 -1
- package/api/theme/build/build.mjs +70 -14
- package/api/theme/build/build.packed-old-core.test.mjs +20 -3
- package/api/theme/build/font-warning.mjs +5 -3
- package/api/theme/build/font-warning.test.mjs +2 -1
- package/api/theme/remove/remove.test.mjs +2 -2
- package/api/theme/targets/targets.mjs +3 -10
- package/api/theme/themeTargets.doc.mjs +4 -0
- package/api/theme/use/use.test.mjs +1 -1
- package/api/upgrade/_adapter.mjs +1 -1
- package/api/upgrade/run/run.mjs +5 -1
- package/api/upgrade/upgrade.doc.mjs +2 -1
- package/api/upgrade/upgrade.mjs +5 -1
- package/assets/docs/getting-started.doc.mjs +23 -3
- package/assets/docs/tree/add-a-component.doc.mjs +11 -1
- package/assets/docs/tree/add-a-theme.doc.mjs +12 -2
- package/assets/docs/tree/add-a-topic.doc.mjs +43 -1
- package/assets/docs/tree/agent-guidance.doc.mjs +18 -4
- package/assets/docs/tree/building-blocks.doc.mjs +4 -0
- package/assets/docs/tree/check-the-props.doc.mjs +1 -1
- package/assets/docs/tree/check-your-docs.doc.mjs +5 -5
- package/assets/docs/tree/checks.doc.mjs +9 -9
- package/assets/docs/tree/ci-and-containers.doc.mjs +88 -0
- package/assets/docs/tree/cli-command.doc.mjs +142 -0
- package/assets/docs/tree/cli.doc.mjs +6 -0
- package/assets/docs/tree/codemods.doc.mjs +13 -3
- package/assets/docs/tree/commands.doc.mjs +7 -1
- package/assets/docs/tree/component-imports.doc.mjs +11 -1
- package/assets/docs/tree/components.doc.mjs +6 -0
- package/assets/docs/tree/computer-agent-guide.doc.mjs +160 -0
- package/assets/docs/tree/computer-integrations.doc.mjs +93 -0
- package/assets/docs/tree/configuration.doc.mjs +7 -3
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +11 -1
- package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
- package/assets/docs/tree/docs.doc.mjs +6 -0
- package/assets/docs/tree/extend-or-replace.doc.mjs +13 -3
- package/assets/docs/tree/generate-a-palette.doc.mjs +2 -2
- package/assets/docs/tree/global-integrations.doc.mjs +124 -0
- package/assets/docs/tree/global.doc.mjs +131 -0
- package/assets/docs/tree/grade-template-with-agent.doc.mjs +4 -4
- package/assets/docs/tree/install-once.doc.mjs +105 -0
- package/assets/docs/tree/integrations.doc.mjs +5 -1
- package/assets/docs/tree/layout.doc.mjs +1 -1
- package/assets/docs/tree/links.doc.mjs +1 -1
- package/assets/docs/tree/monorepos.doc.mjs +84 -0
- package/assets/docs/tree/problems.doc.mjs +205 -0
- package/assets/docs/tree/project-global-or-both.doc.mjs +131 -0
- package/assets/docs/tree/publishing.doc.mjs +2 -2
- package/assets/docs/tree/quick-start.doc.mjs +15 -5
- package/assets/docs/tree/reference.doc.mjs +192 -0
- package/assets/docs/tree/replace-a-core-component.doc.mjs +11 -1
- package/assets/docs/tree/replace-a-core-template.doc.mjs +4 -4
- package/assets/docs/tree/scaffold.doc.mjs +1 -1
- package/assets/docs/tree/sections-and-placement.doc.mjs +3 -3
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +13 -3
- package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
- package/assets/docs/tree/single-component.doc.mjs +3 -3
- package/assets/docs/tree/start-a-template.doc.mjs +15 -5
- package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
- package/assets/docs/tree/templates.doc.mjs +6 -0
- package/assets/docs/tree/test-in-an-app.doc.mjs +4 -4
- package/assets/docs/tree/test-template-in-app.doc.mjs +4 -4
- package/assets/docs/tree/themes.doc.mjs +4 -0
- package/assets/docs/tree/troubleshooting.doc.mjs +15 -7
- package/assets/docs/tree/uninstall.doc.mjs +109 -0
- package/assets/docs/tree/updates.doc.mjs +92 -0
- package/assets/docs/tree/upgrading.doc.mjs +2 -2
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +11 -1
- package/assets/docs/tree/verify-packed-template.doc.mjs +2 -2
- package/assets/docs/tree/versioning.doc.mjs +3 -3
- package/assets/docs/tree/who-answers.doc.mjs +119 -0
- package/assets/docs/tree/write-the-template-file.doc.mjs +3 -3
- package/assets/docs/working-with-ai.doc.mjs +23 -9
- package/authoring/debug/parse.d.mts +5 -5
- package/authoring/discover/discover.doc.mjs +6 -0
- package/authoring/doctypes/_schema.d.mts +8 -3
- package/authoring/doctypes/_schema.mjs +1 -0
- package/authoring/doctypes/command/command.doc.mjs +6 -0
- package/authoring/doctypes/command/type.ts +14 -0
- package/authoring/doctypes/reference/reference.doc.mjs +1 -1
- package/authoring/index.d.ts +1 -0
- package/authoring/integration/integration.doc.mjs +18 -2
- package/authoring/integration/parse.test.mjs +11 -0
- package/authoring/integration/schema.d.mts +14 -3
- package/authoring/integration/schema.mjs +33 -2
- package/authoring/integration/type.ts +8 -0
- package/clients/cli/bin/astryx.mjs +20 -3
- package/clients/cli/cli-command.test.mjs +166 -0
- package/clients/cli/commands/blog.doc.mjs +1 -0
- package/clients/cli/commands/build-theme.batch-report.test.mjs +14 -2
- package/clients/cli/commands/build-theme.font-warning.test.mjs +3 -3
- package/clients/cli/commands/build-theme.mjs +25 -12
- package/clients/cli/commands/build.doc.mjs +1 -0
- package/clients/cli/commands/build.exit-codes-doc.test.mjs +4 -0
- package/clients/cli/commands/component.doc.mjs +1 -0
- package/clients/cli/commands/discover.broken-integration.test.mjs +7 -6
- package/clients/cli/commands/discover.doc.mjs +8 -0
- package/clients/cli/commands/discover.no-source.test.mjs +1 -0
- package/clients/cli/commands/docs.doc.mjs +1 -0
- package/clients/cli/commands/docs.mjs +49 -19
- package/clients/cli/commands/docs.test.mjs +2 -2
- package/clients/cli/commands/doctor-integration-components.doc.mjs +1 -0
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +1 -0
- package/clients/cli/commands/doctor-integration-templates.doc.mjs +1 -0
- package/clients/cli/commands/doctor-integration-validate.doc.mjs +10 -1
- package/clients/cli/commands/doctor-integration.test.mjs +4 -3
- package/clients/cli/commands/doctor.doc.mjs +12 -2
- package/clients/cli/commands/doctor.mjs +12 -3
- package/clients/cli/commands/doctor.test.mjs +10 -4
- package/clients/cli/commands/gap-report.doc.mjs +1 -0
- package/clients/cli/commands/hook.doc.mjs +1 -0
- package/clients/cli/commands/init.behavior.test.mjs +5 -0
- package/clients/cli/commands/init.doc.mjs +29 -3
- package/clients/cli/commands/integration-add.doc.mjs +7 -0
- package/clients/cli/commands/integration-authoring.test.mjs +3 -3
- package/clients/cli/commands/integration-check.doc.mjs +10 -2
- package/clients/cli/commands/integration-check.test.mjs +31 -1
- package/clients/cli/commands/integration-pack.doc.mjs +8 -1
- package/clients/cli/commands/integration-verify.doc.mjs +8 -1
- package/clients/cli/commands/integration.mjs +3 -2
- package/clients/cli/commands/json-contract.test.mjs +6 -1
- package/clients/cli/commands/manifest.doc.mjs +1 -0
- package/clients/cli/commands/outside-project.test.mjs +774 -0
- package/clients/cli/commands/search.doc.mjs +1 -0
- package/clients/cli/commands/search.mjs +16 -11
- package/clients/cli/commands/search.test.mjs +429 -296
- package/clients/cli/commands/setup-nudge.test.mjs +26 -4
- package/clients/cli/commands/swizzle.doc.mjs +7 -0
- package/clients/cli/commands/swizzle.routing.test.mjs +1 -1
- package/clients/cli/commands/template.doc.mjs +1 -0
- package/clients/cli/commands/theme-add-lifecycle.test.mjs +3 -3
- package/clients/cli/commands/theme-add.doc.mjs +8 -1
- package/clients/cli/commands/theme-build.doc.mjs +1 -0
- package/clients/cli/commands/theme-eject.doc.mjs +1 -0
- package/clients/cli/commands/theme-list.behavior.test.mjs +6 -0
- package/clients/cli/commands/theme-list.doc.mjs +1 -0
- package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -0
- package/clients/cli/commands/theme-remove.doc.mjs +7 -0
- package/clients/cli/commands/theme-targets.doc.mjs +1 -0
- package/clients/cli/commands/theme-template.doc.mjs +1 -0
- package/clients/cli/commands/theme-use.doc.mjs +7 -0
- package/clients/cli/commands/upgrade.config-ordering.test.mjs +2 -1
- package/clients/cli/commands/upgrade.doc.mjs +8 -1
- package/clients/cli/commands/upgrade.file-protection.test.mjs +3 -2
- package/clients/cli/commands/upgrade.hook-output.test.mjs +2 -1
- package/clients/cli/index.mjs +84 -13
- package/clients/cli/lib/cli-error.mjs +4 -1
- package/clients/cli/lib/component-format.test.mjs +1 -1
- package/clients/cli/lib/define-command.mjs +2 -2
- package/clients/cli/lib/json-shim.mjs +3 -1
- package/clients/cli/lib/manifest.d.ts +9 -0
- package/clients/cli/lib/manifest.mjs +17 -1
- package/clients/cli/lib/manifest.test.mjs +25 -0
- package/foundation/agent-docs/agent-doc-state.d.mts +21 -6
- package/foundation/agent-docs/agent-doc-state.mjs +29 -7
- package/foundation/agent-docs/agent-docs.d.mts +2 -2
- package/foundation/agent-docs/agent-docs.mjs +3 -3
- package/foundation/agent-docs/computer-agent-text.d.mts +133 -0
- package/foundation/agent-docs/computer-agent-text.mjs +623 -0
- package/foundation/agent-docs/computer-agent-text.test.mjs +602 -0
- package/foundation/config/project.d.mts +35 -3
- package/foundation/config/project.mjs +145 -8
- package/foundation/config/project.test.mjs +66 -0
- package/foundation/config/theme-state.mjs +5 -4
- package/foundation/discovery/cli-self-docs.mjs +20 -3
- package/foundation/discovery/cli-self-docs.test.mjs +3 -2
- package/foundation/discovery/component-replacement.mjs +2 -1
- package/foundation/discovery/runner-allowlist.d.mts +40 -0
- package/foundation/discovery/runner-allowlist.mjs +53 -0
- package/foundation/discovery/template-needs.mjs +5 -2
- package/foundation/discovery/theme-imports.mjs +8 -4
- package/foundation/discovery/theme-imports.test.mjs +1 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +20 -0
- package/foundation/doc-compiler/inputs.mjs +4 -1
- package/foundation/doc-compiler/read.d.mts +1 -1
- package/foundation/doc-compiler/tree.test.mjs +1 -1
- package/foundation/env/cli-command.d.mts +83 -0
- package/foundation/env/cli-command.mjs +152 -0
- package/foundation/env/cli-command.test.mjs +129 -0
- package/foundation/env/node-version.test.mjs +15 -3
- package/foundation/env/package-manager.d.mts +61 -9
- package/foundation/env/package-manager.global.test.mjs +66 -0
- package/foundation/env/package-manager.mjs +137 -13
- package/foundation/env/package-manager.test.mjs +148 -9
- package/foundation/env/project-scope.d.mts +9 -0
- package/foundation/env/project-scope.mjs +33 -0
- package/foundation/env/search-path.d.mts +42 -0
- package/foundation/env/search-path.mjs +205 -0
- package/foundation/env/search-path.test.mjs +122 -0
- package/foundation/env/user-dirs.d.mts +39 -0
- package/foundation/env/user-dirs.mjs +93 -0
- package/foundation/env/user-dirs.test.mjs +72 -0
- package/foundation/env/user-settings.d.mts +46 -0
- package/foundation/env/user-settings.mjs +106 -0
- package/foundation/env/user-settings.test.mjs +64 -0
- package/foundation/fs/file-protection.mjs +15 -1
- package/foundation/fs/module-loader.stdout.test.mjs +3 -2
- package/foundation/fs/path-compare.d.mts +33 -0
- package/foundation/fs/path-compare.mjs +73 -0
- package/foundation/fs/paths.d.mts +57 -1
- package/foundation/fs/paths.mjs +131 -3
- package/foundation/fs/paths.test.mjs +10 -1
- package/foundation/integrations/computer-integrations.d.mts +78 -0
- package/foundation/integrations/computer-integrations.mjs +316 -0
- package/foundation/integrations/computer-integrations.test.mjs +292 -0
- package/foundation/integrations/integration-warnings.mjs +3 -2
- package/foundation/integrations/integration-warnings.test.mjs +8 -9
- package/foundation/integrations/integrations.d.mts +25 -1
- package/foundation/integrations/integrations.mjs +46 -3
- package/foundation/integrations/validate-contributions.d.mts +2 -0
- package/foundation/integrations/validate-contributions.mjs +11 -0
- package/foundation/release/agent-text-worker.d.mts +4 -0
- package/foundation/release/agent-text-worker.mjs +52 -0
- package/foundation/release/cache.d.mts +310 -0
- package/foundation/release/cache.mjs +1216 -0
- package/foundation/release/cache.test.mjs +920 -0
- package/foundation/release/choose.d.mts +207 -0
- package/foundation/release/choose.mjs +677 -0
- package/foundation/release/choose.test.mjs +427 -0
- package/foundation/release/core-worker.d.mts +4 -0
- package/foundation/release/core-worker.mjs +38 -0
- package/foundation/release/global-state.d.mts +259 -0
- package/foundation/release/global-state.mjs +472 -0
- package/foundation/release/global-state.test.mjs +381 -0
- package/foundation/release/handoff.d.mts +60 -0
- package/foundation/release/handoff.e2e.test.mjs +278 -0
- package/foundation/release/handoff.mjs +357 -0
- package/foundation/release/lock-lease.d.mts +23 -0
- package/foundation/release/lock-lease.mjs +80 -0
- package/foundation/release/notices.d.mts +253 -0
- package/foundation/release/notices.mjs +596 -0
- package/foundation/release/notices.test.mjs +565 -0
- package/foundation/release/npm-guard.d.mts +4 -0
- package/foundation/release/npm-guard.mjs +126 -0
- package/foundation/release/project.d.mts +141 -0
- package/foundation/release/project.mjs +466 -0
- package/foundation/release/project.test.mjs +288 -0
- package/foundation/release/refresh-worker.d.mts +4 -0
- package/foundation/release/refresh-worker.mjs +27 -0
- package/foundation/release/run-context.d.mts +47 -0
- package/foundation/release/run-context.mjs +149 -0
- package/foundation/release/update-notice-env.d.mts +28 -0
- package/foundation/release/update-notice-env.mjs +39 -0
- package/foundation/response/base.d.ts +26 -3
- package/foundation/response/error-codes.d.mts +3 -1
- package/foundation/response/error-codes.doc.mjs +12 -0
- package/foundation/response/error-codes.mjs +17 -0
- package/foundation/response/error-codes.test.mjs +2 -0
- package/foundation/response/json-contract.test.mjs +7 -2
- package/foundation/response/json.mjs +4 -1
- package/foundation/response/response-types.doc.mjs +8 -3
- package/foundation/response/response-types.doc.test.mjs +46 -0
- package/foundation/response/response.doc.mjs +3 -3
- package/foundation/xle/browser-imports.test.mjs +74 -0
- package/package.json +9 -9
- package/scripts/postinstall.mjs +21 -2
|
@@ -19,7 +19,7 @@ import {Command} from 'commander';
|
|
|
19
19
|
import {discoverCoreTemplates} from '../../../foundation/discovery/template-adapter.mjs';
|
|
20
20
|
import {discoverOwnedComponents} from '../../../foundation/discovery/component-discovery.mjs';
|
|
21
21
|
import {discoverBuiltinTopics} from '../../../foundation/discovery/docs-discovery.mjs';
|
|
22
|
-
import {findCoreDir} from '../../../foundation/fs/paths.mjs';
|
|
22
|
+
import {findCoreDir, findProjectCoreDir} from '../../../foundation/fs/paths.mjs';
|
|
23
23
|
import {registerDoctor} from './doctor.mjs';
|
|
24
24
|
import {expectRecordsCarry} from '../../../test-utils/text-projection.mjs';
|
|
25
25
|
|
|
@@ -185,7 +185,7 @@ describe('doctor integration — command', () => {
|
|
|
185
185
|
]);
|
|
186
186
|
|
|
187
187
|
expect(logCalls.join('\n')).toContain(
|
|
188
|
-
'
|
|
188
|
+
' doctor integration templates <package>',
|
|
189
189
|
);
|
|
190
190
|
expect(process.exitCode).toBeUndefined();
|
|
191
191
|
});
|
|
@@ -817,7 +817,8 @@ describe('doctor integration — command', () => {
|
|
|
817
817
|
tmpDir = outside;
|
|
818
818
|
try {
|
|
819
819
|
writeComponentIntegration('AcmeCarousel');
|
|
820
|
-
|
|
820
|
+
// Doctor judges the project's own Core, never the one a copy carries.
|
|
821
|
+
expect(findProjectCoreDir(outside)).toBeNull();
|
|
821
822
|
process.chdir(outside);
|
|
822
823
|
|
|
823
824
|
await createProgram().parseAsync([
|
|
@@ -18,8 +18,11 @@ export const doc = {
|
|
|
18
18
|
'Runs read-only project health diagnostics by default: Node version, @astryxdesign/core ' +
|
|
19
19
|
'install and version alignment, theme packages, generated app themes when present, earlier copied-theme migration, config, integrations (every one astryx.config names must load, linked without a config entry, ' +
|
|
20
20
|
'provider identity, contribution issues), agent docs, core peer dependencies, package manager, ' +
|
|
21
|
-
"and the
|
|
22
|
-
'The `integration` subcommands provide authoring checks for one integration package.'
|
|
21
|
+
"the docs the CLI reads, the newest release the computer knows of, with the install and upgrade commands when the project's release is older, and every `astryx` command on the search path, warning when the first one is not the Astryx CLI or predates the hand-off. It writes nothing, but loading astryx.config runs that file's code. " +
|
|
22
|
+
'The `integration` subcommands provide authoring checks for one integration package. ' +
|
|
23
|
+
'Outside a project it checks the computer instead: the Node version, the release that answered, ' +
|
|
24
|
+
'the newest release this computer knows of, with the command that upgrades the CLI installed for the computer when it is older, the astryx commands on the search path, the integrations installed for the computer (warning about one it skips), and whether the computer-level agent text (`astryx init --user`) is present, matches this release, was edited, or is turned off (info only). ' +
|
|
25
|
+
'It never fails a check because the folder has no project.',
|
|
23
26
|
fn: 'doctor',
|
|
24
27
|
subcommands: ['integration'],
|
|
25
28
|
examples: [
|
|
@@ -42,9 +45,16 @@ export const doc = {
|
|
|
42
45
|
cli: 'astryx doctor integration docs @acme/widgets',
|
|
43
46
|
},
|
|
44
47
|
],
|
|
48
|
+
outsideProject: 'own',
|
|
45
49
|
exitCodes: [
|
|
46
50
|
{code: 0, when: 'no checks failed (warnings are allowed)'},
|
|
47
51
|
{code: 1, when: 'one or more checks failed'},
|
|
48
52
|
],
|
|
49
53
|
related: ['init', 'upgrade'],
|
|
54
|
+
notes: [
|
|
55
|
+
{
|
|
56
|
+
type: 'prose',
|
|
57
|
+
text: "In global mode: outside a project, doctor checks your computer instead of a folder: `node-version`, `answering-release` (the version that answered), `newest-release`, `cli-on-path` (every astryx command on your PATH), `computer-integrations` (integrations installed globally), and `computer-agent-text` (the agent guide). It never fails a check because the folder has no project. In a project, the project's version of Astryx runs it, whichever astryx command you start. See {@link namespace:global} and {@link generic:who-answers}.",
|
|
58
|
+
},
|
|
59
|
+
],
|
|
50
60
|
};
|
|
@@ -38,6 +38,8 @@ import {doc as integrationDocConflictsFn} from '../../../api/integration/integra
|
|
|
38
38
|
import {NO_RESULT_SET} from '../../../foundation/debug/index.mjs';
|
|
39
39
|
import {cliError} from '../lib/cli-error.mjs';
|
|
40
40
|
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
41
|
+
import {formatCliCommand} from '../../../foundation/env/package-manager.mjs';
|
|
42
|
+
import {isOutsideProject} from '../../../foundation/env/project-scope.mjs';
|
|
41
43
|
|
|
42
44
|
const STATUS = {
|
|
43
45
|
pass: '[ok]',
|
|
@@ -194,6 +196,9 @@ function printIntegrationValidation(data) {
|
|
|
194
196
|
}),
|
|
195
197
|
]
|
|
196
198
|
: [text('[ok] No integration issues found.')]),
|
|
199
|
+
...(data.notes ?? []).map(note =>
|
|
200
|
+
text(`note (${note.code}): ${note.message}`),
|
|
201
|
+
),
|
|
197
202
|
text(
|
|
198
203
|
`Summary: ${errors} error${errors === 1 ? '' : 's'}, ` +
|
|
199
204
|
`${warnings} warning${warnings === 1 ? '' : 's'}`,
|
|
@@ -541,7 +546,7 @@ async function runIntegrationValidation(program, pkg) {
|
|
|
541
546
|
noPackage
|
|
542
547
|
? 'Nothing was validated: no package.json found. Run this command inside a package directory.'
|
|
543
548
|
: 'Nothing was validated: no astryx.integration.* found next to package.json. ' +
|
|
544
|
-
|
|
549
|
+
`To validate an installed integration: ${formatCliCommand('doctor integration validate <package>')}`,
|
|
545
550
|
),
|
|
546
551
|
);
|
|
547
552
|
} else printIntegrationValidation(result.data);
|
|
@@ -564,10 +569,14 @@ async function runAuthoringCheck(program, pkg, kind) {
|
|
|
564
569
|
|
|
565
570
|
if (program.opts().json) jsonOut(result);
|
|
566
571
|
else if (!result.data.validated) {
|
|
572
|
+
// Outside a project no integration is installed to check by name
|
|
573
|
+
// (spec AST-081 FR3).
|
|
567
574
|
emit(
|
|
568
575
|
text(
|
|
569
|
-
|
|
570
|
-
|
|
576
|
+
isOutsideProject()
|
|
577
|
+
? 'Nothing was checked: no astryx.integration.* found next to package.json, and this folder is outside a project.'
|
|
578
|
+
: 'Nothing was checked: no astryx.integration.* found next to package.json. ' +
|
|
579
|
+
`To check an installed integration: ${formatCliCommand(`doctor integration ${kind} <package>`)}`,
|
|
571
580
|
),
|
|
572
581
|
);
|
|
573
582
|
} else if (kind === 'templates') {
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
checkPackageManager,
|
|
21
21
|
} from '../../../api/doctor/doctor.mjs';
|
|
22
22
|
import {MIN_NODE_VERSION} from '../../../foundation/env/node-version.mjs';
|
|
23
|
+
import {CLI_VERSION, linkThisCliAsProjectCli} from '../../../test-utils/release-fixtures.mjs';
|
|
23
24
|
|
|
24
25
|
let tmpDir;
|
|
25
26
|
let logCalls;
|
|
@@ -101,7 +102,7 @@ describe('doctor — individual checks', () => {
|
|
|
101
102
|
});
|
|
102
103
|
|
|
103
104
|
it('app themes: reports unmanaged state as one INFO check', async () => {
|
|
104
|
-
fs.writeFileSync(path.join(tmpDir, 'package.json'), '{"name":"app"}\n');
|
|
105
|
+
fs.writeFileSync(path.join(tmpDir, 'package.json'), '{"name":"app","dependencies":{"@astryxdesign/core":"*"}}\n');
|
|
105
106
|
const result = await runChecks({cwd: tmpDir});
|
|
106
107
|
const themeChecks = result.checks.filter(check =>
|
|
107
108
|
check.id.startsWith('theme-'),
|
|
@@ -176,13 +177,16 @@ describe('doctor — individual checks', () => {
|
|
|
176
177
|
it('agent-docs: the fix names the scoped package when the project has no local CLI', () => {
|
|
177
178
|
fs.writeFileSync(path.join(tmpDir, 'package-lock.json'), '{}');
|
|
178
179
|
const res = checkAgentDocs({cwd: tmpDir});
|
|
179
|
-
expect(res.fix).toContain(
|
|
180
|
+
expect(res.fix).toContain(
|
|
181
|
+
`\`npx @astryxdesign/cli@${CLI_VERSION} init --features agents\``,
|
|
182
|
+
);
|
|
180
183
|
});
|
|
181
184
|
|
|
182
185
|
it('agent-docs: the fix keeps `npx astryx` when the project has a local CLI', () => {
|
|
183
186
|
fs.writeFileSync(path.join(tmpDir, 'package-lock.json'), '{}');
|
|
184
187
|
fs.mkdirSync(path.join(tmpDir, 'node_modules', '.bin'), {recursive: true});
|
|
185
188
|
fs.writeFileSync(path.join(tmpDir, 'node_modules', '.bin', 'astryx'), '');
|
|
189
|
+
linkThisCliAsProjectCli(tmpDir);
|
|
186
190
|
const res = checkAgentDocs({cwd: tmpDir});
|
|
187
191
|
expect(res.fix).toContain('`npx astryx init --features agents`');
|
|
188
192
|
});
|
|
@@ -301,7 +305,8 @@ describe('doctor — runChecks / report', () => {
|
|
|
301
305
|
expect(total).toBe(report.checks.length);
|
|
302
306
|
});
|
|
303
307
|
|
|
304
|
-
it('reports a FAIL for core
|
|
308
|
+
it('reports a FAIL for core in a project that declares Core but installs none', async () => {
|
|
309
|
+
fs.writeFileSync(path.join(tmpDir, 'package.json'), '{"name":"app","dependencies":{"@astryxdesign/core":"*"}}\n');
|
|
305
310
|
const report = await runChecks({cwd: tmpDir});
|
|
306
311
|
expect(find(report.checks, 'core-installed').status).toBe('fail');
|
|
307
312
|
expect(report.summary.fail).toBeGreaterThan(0);
|
|
@@ -346,7 +351,8 @@ describe('doctor — command', () => {
|
|
|
346
351
|
process.exitCode = prevExit;
|
|
347
352
|
});
|
|
348
353
|
|
|
349
|
-
it('sets exit code 1 when a check FAILs (
|
|
354
|
+
it('sets exit code 1 when a check FAILs (Core declared, not installed)', async () => {
|
|
355
|
+
fs.writeFileSync(path.join(tmpDir, 'package.json'), '{"name":"app","dependencies":{"@astryxdesign/core":"*"}}\n');
|
|
350
356
|
const prevCwd = process.cwd();
|
|
351
357
|
const prevExit = process.exitCode;
|
|
352
358
|
process.exitCode = undefined;
|
|
@@ -39,6 +39,11 @@ const exists = rel => fs.existsSync(path.join(tmpDir, rel));
|
|
|
39
39
|
|
|
40
40
|
describe('astryx init — default (no flags)', () => {
|
|
41
41
|
it('installs the tool-agnostic AGENTS.md cheat sheet and prints next steps', async () => {
|
|
42
|
+
// Inside a project; outside one the steps are left out (outside-project.test.mjs).
|
|
43
|
+
fs.writeFileSync(
|
|
44
|
+
path.join(tmpDir, 'package.json'),
|
|
45
|
+
'{"name":"app","dependencies":{"@astryxdesign/core":"*"}}',
|
|
46
|
+
);
|
|
42
47
|
const {status, stdout} = await runCli(['init'], {cwd: tmpDir});
|
|
43
48
|
expect(status).toBe(0);
|
|
44
49
|
expect(exists('AGENTS.md')).toBe(true);
|
|
@@ -19,7 +19,12 @@ export const doc = {
|
|
|
19
19
|
'agents, and CI). By default it installs the AGENTS.md/CLAUDE.md agent-docs, ' +
|
|
20
20
|
'including guidance from configured integrations, and prints getting-started ' +
|
|
21
21
|
"steps. --features and --all print only the chosen features' guidance (no " +
|
|
22
|
-
'getting-started steps); the theme feature also writes an annotated theme template.'
|
|
22
|
+
'getting-started steps); the theme feature also writes an annotated theme template. ' +
|
|
23
|
+
'Outside a project it writes the same files but prints no step that sets up a project: ' +
|
|
24
|
+
'no getting-started steps, and no step that adds a theme to an app. ' +
|
|
25
|
+
'--user writes the computer-level agent text instead (see the flag), in any folder, and touches nothing in the folder. ' +
|
|
26
|
+
'The CLI installed for the computer also keeps that text current in the background, unless --user --remove-agents turned it off; ' +
|
|
27
|
+
'package install scripts, project setup, and upgrade never write it.',
|
|
23
28
|
fn: 'init',
|
|
24
29
|
options: [
|
|
25
30
|
{
|
|
@@ -43,6 +48,18 @@ export const doc = {
|
|
|
43
48
|
"(deleting AGENTS.md or .claude/CLAUDE.md when only init's heading is left) and do nothing else. " +
|
|
44
49
|
'--features, --all, --agent and --agent-docs-path are refused; a file written with --agent-docs-path keeps its block',
|
|
45
50
|
},
|
|
51
|
+
{
|
|
52
|
+
flag: '--user',
|
|
53
|
+
param: 'options.user',
|
|
54
|
+
description:
|
|
55
|
+
'Write or refresh the computer-level agent text instead of setting up the folder: one skill file, ~/.agents/skills/astryx/SKILL.md, which most coding agents read, ' +
|
|
56
|
+
'linked into the skill folders of agents that read only their own (~/.claude/skills always; Kiro, Windsurf, Letta, Xcode\'s coding assistant, and ~/.config/agents/skills when that folder exists): a folder symlink with a relative target, a junction on Windows, or a copy where neither can be made. Continue, whose scanner skips links, gets a managed copy, refreshed with the file. ' +
|
|
57
|
+
"It tells agents anywhere on the computer that Astryx is there, when it is relevant, and to start with `astryx search`. " +
|
|
58
|
+
'Records the links it made in astryx/settings.json in the per-user configuration folder, so removal removes exactly those; the CLI installed for the computer refreshes the file in the background after each upgrade. ' +
|
|
59
|
+
'Works in any folder. A file without the Astryx markers, one edited since Astryx wrote it, or a symlink, is kept as it is, and so is anything at a link target that Astryx did not create. ' +
|
|
60
|
+
'Warns, and still writes, when no `astryx` command on the computer runs the Astryx CLI. ' +
|
|
61
|
+
'With --remove-agents it removes the file, the links, and the copy instead and records that the text is turned off. --features, --all, --agent and --agent-docs-path are refused',
|
|
62
|
+
},
|
|
46
63
|
{
|
|
47
64
|
flag: '--agent <tool>',
|
|
48
65
|
param: 'options.agent',
|
|
@@ -51,7 +68,7 @@ export const doc = {
|
|
|
51
68
|
'Target AI tool for agent docs: claude (CLAUDE.md or .claude/CLAUDE.md, else creates .claude/CLAUDE.md), cursor (.cursorrules if present, else AGENTS.md), ' +
|
|
52
69
|
'codex and muse (AGENTS.md), hermes (.hermes.md or HERMES.md if present, else AGENTS.md), all (every existing agent doc, else AGENTS.md and .claude/CLAUDE.md). ' +
|
|
53
70
|
'An unknown tool exits 1 with ERR_UNKNOWN_AGENT. ' +
|
|
54
|
-
|
|
71
|
+
'Used only when agent docs are installed (the default, --all, or --features agents); --agent-docs-path takes precedence.',
|
|
55
72
|
},
|
|
56
73
|
{
|
|
57
74
|
flag: '--agent-docs-path <path...>',
|
|
@@ -66,7 +83,10 @@ export const doc = {
|
|
|
66
83
|
{label: 'Default setup', cli: 'astryx init'},
|
|
67
84
|
{label: 'All features, no prompts', cli: 'astryx init --all'},
|
|
68
85
|
{label: 'Machine-readable receipt', cli: 'astryx init --json'},
|
|
86
|
+
{label: 'Agent text for the whole computer', cli: 'astryx init --user'},
|
|
87
|
+
{label: 'Remove the computer-level agent text and turn it off', cli: 'astryx init --user --remove-agents'},
|
|
69
88
|
],
|
|
89
|
+
outsideProject: 'own',
|
|
70
90
|
exitCodes: [
|
|
71
91
|
{
|
|
72
92
|
code: 0,
|
|
@@ -74,8 +94,14 @@ export const doc = {
|
|
|
74
94
|
},
|
|
75
95
|
{
|
|
76
96
|
code: 1,
|
|
77
|
-
|
|
97
|
+
when: 'an unknown --agent (ERR_UNKNOWN_AGENT) or feature, an --agent-docs-path outside the project, --remove-agents combined with install options, --user combined with --features, --all, --agent or --agent-docs-path, or --all with --features (ERR_INVALID_ARGUMENT)',
|
|
78
98
|
},
|
|
79
99
|
],
|
|
80
100
|
related: ['doctor', 'upgrade', 'build', 'theme'],
|
|
101
|
+
notes: [
|
|
102
|
+
{
|
|
103
|
+
type: 'prose',
|
|
104
|
+
text: "In global mode: outside a project, init writes the agent docs (AGENTS.md) into the folder and prints no getting-started steps. `init --user` writes the agent guide for your computer, in any folder, and is never handed to a project's own CLI. In a project, the project's version of Astryx runs it, whichever astryx command you start. See {@link namespace:global} and {@link generic:computer-agent-guide}.",
|
|
105
|
+
},
|
|
106
|
+
],
|
|
81
107
|
};
|
|
@@ -113,6 +113,7 @@ export const doc = {
|
|
|
113
113
|
cli: 'astryx integration add theme ocean --from neutral',
|
|
114
114
|
},
|
|
115
115
|
],
|
|
116
|
+
outsideProject: 'refuse',
|
|
116
117
|
exitCodes: [
|
|
117
118
|
{code: 0, when: 'the contribution is written or the dry run succeeds'},
|
|
118
119
|
{
|
|
@@ -121,4 +122,10 @@ export const doc = {
|
|
|
121
122
|
},
|
|
122
123
|
],
|
|
123
124
|
related: ['integration verify', 'doctor integration validate', 'theme add'],
|
|
125
|
+
notes: [
|
|
126
|
+
{
|
|
127
|
+
type: 'prose',
|
|
128
|
+
text: "In global mode: outside a package, integration add writes nothing and stops with `ERR_FILE_NOT_FOUND`: \"No package.json found. Run this command inside an integration package.\" In a project, the project's version of Astryx runs it, whichever astryx command you start. See {@link namespace:global} and {@link generic:global-integrations}.",
|
|
129
|
+
},
|
|
130
|
+
],
|
|
124
131
|
};
|
|
@@ -219,7 +219,7 @@ describe('integration authoring CLI', () => {
|
|
|
219
219
|
expect(text.status).toBe(verifyText.status);
|
|
220
220
|
expect(text.stdout).toBe(verifyText.stdout);
|
|
221
221
|
expect(text.stderr).toContain('`integration pack --check` is deprecated');
|
|
222
|
-
expect(text.stderr).toContain('
|
|
222
|
+
expect(text.stderr).toContain(' integration verify`');
|
|
223
223
|
// Without --check it fails, as it did, and points only at the new name:
|
|
224
224
|
// suggesting `--check` would send people to the deprecated spelling.
|
|
225
225
|
const bare = await runCli(['integration', 'pack'], tmpDir);
|
|
@@ -227,13 +227,13 @@ describe('integration authoring CLI', () => {
|
|
|
227
227
|
expect(bare.stderr).toContain(
|
|
228
228
|
'`integration pack` is now `integration verify`',
|
|
229
229
|
);
|
|
230
|
-
expect(bare.stderr).toContain('
|
|
230
|
+
expect(bare.stderr).toContain(' integration verify`');
|
|
231
231
|
expect(bare.stderr).toContain('npm pack');
|
|
232
232
|
expect(bare.stderr).not.toContain('--check');
|
|
233
233
|
const bareJson = await runCli(['--json', 'integration', 'pack'], tmpDir);
|
|
234
234
|
expect(parseEnvelope(bareJson.stdout)).toMatchObject({
|
|
235
235
|
code: 'ERR_INVALID_ARGUMENT',
|
|
236
|
-
error: expect.stringContaining('
|
|
236
|
+
error: expect.stringContaining(' integration verify`'),
|
|
237
237
|
});
|
|
238
238
|
// Help lists it, marked deprecated: nothing is hidden.
|
|
239
239
|
const help = await runCli(['integration', '--help'], tmpDir);
|
|
@@ -35,14 +35,15 @@ export const doc = {
|
|
|
35
35
|
'`integration check` on every build; run ' +
|
|
36
36
|
'`integration verify` before you publish, to check that the packed package ' +
|
|
37
37
|
'works in an app. To check an installed integration by name, run the ' +
|
|
38
|
-
'`doctor integration` subcommands with its package name.'
|
|
38
|
+
'`doctor integration` subcommands with its package name. Outside a package, ' +
|
|
39
|
+
'it writes nothing, `validate` reports one `no_package` issue, and it exits 1.',
|
|
39
40
|
fn: 'integrationCheck',
|
|
40
41
|
options: [
|
|
41
42
|
{
|
|
42
43
|
flag: '--strict',
|
|
43
44
|
param: 'options.strict',
|
|
44
45
|
description:
|
|
45
|
-
'Also exit 1 on any warning and on any check that did not run. A new check or failure code joins only in a minor release, named in the release notes.',
|
|
46
|
+
'Also exit 1 on any warning and on any check that did not run. A new check or failure code joins only in a minor release, named in the release notes; until then, a malformed `cliCommand` is reported as a note (`invalid_cli_command`) that fails nothing.',
|
|
46
47
|
},
|
|
47
48
|
],
|
|
48
49
|
examples: [
|
|
@@ -65,6 +66,7 @@ export const doc = {
|
|
|
65
66
|
cli: 'integration verify',
|
|
66
67
|
},
|
|
67
68
|
],
|
|
69
|
+
outsideProject: 'own',
|
|
68
70
|
exitCodes: [
|
|
69
71
|
{
|
|
70
72
|
code: 0,
|
|
@@ -82,4 +84,10 @@ export const doc = {
|
|
|
82
84
|
'doctor integration templates',
|
|
83
85
|
'doctor integration docs',
|
|
84
86
|
],
|
|
87
|
+
notes: [
|
|
88
|
+
{
|
|
89
|
+
type: 'prose',
|
|
90
|
+
text: "In global mode: outside a package, it writes nothing, its `validate` check reports one `no_package` issue, and it exits 1. In a project, the project's version of Astryx runs it, whichever astryx command you start. See {@link namespace:global} and {@link generic:global-integrations}.",
|
|
91
|
+
},
|
|
92
|
+
],
|
|
85
93
|
};
|
|
@@ -265,13 +265,43 @@ describe('astryx integration check', () => {
|
|
|
265
265
|
'"typecheck": "tsc --noEmit && astryx integration check --strict"',
|
|
266
266
|
);
|
|
267
267
|
expect(run.stdout).toContain(
|
|
268
|
-
'A new check or failure code joins only in a minor release, named in the release notes.',
|
|
268
|
+
'A new check or failure code joins only in a minor release, named in the release notes; until then, a malformed `cliCommand` is reported as a note (`invalid_cli_command`) that fails nothing.',
|
|
269
269
|
);
|
|
270
270
|
expect(run.stdout).toContain('integration verify');
|
|
271
271
|
expect(run.stdout).toContain('against the package in the current folder');
|
|
272
272
|
expect(run.stdout).not.toContain('[package]');
|
|
273
273
|
});
|
|
274
274
|
|
|
275
|
+
it('reports a malformed cliCommand as a note beside the issues, which --strict does not fail', async () => {
|
|
276
|
+
// A unique template id, so nothing else warns.
|
|
277
|
+
writePackage({
|
|
278
|
+
id: 'acme-notes-only-fixture',
|
|
279
|
+
extraManifest: ", cliCommand: ' acme astryx\\n'",
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
const json = await runCli(
|
|
283
|
+
['--json', 'integration', 'check', '--strict'],
|
|
284
|
+
tmpDir,
|
|
285
|
+
);
|
|
286
|
+
const envelope = JSON.parse(json.stdout);
|
|
287
|
+
const validate = envelope.data.checks[0].response.data;
|
|
288
|
+
expect(validate.issues.map((/** @type {any} */ i) => i.code)).not.toContain(
|
|
289
|
+
'invalid_cli_command',
|
|
290
|
+
);
|
|
291
|
+
expect(validate.notes).toEqual([
|
|
292
|
+
{code: 'invalid_cli_command', message: expect.any(String)},
|
|
293
|
+
]);
|
|
294
|
+
expect(envelope.data.failed).toBe(false);
|
|
295
|
+
expect(json.status).toBe(0);
|
|
296
|
+
|
|
297
|
+
const text = await runCli(['integration', 'check'], tmpDir);
|
|
298
|
+
expect(
|
|
299
|
+
text.stdout
|
|
300
|
+
.split('\n')
|
|
301
|
+
.filter(line => line.startsWith('note (invalid_cli_command): ')),
|
|
302
|
+
).toHaveLength(1);
|
|
303
|
+
});
|
|
304
|
+
|
|
275
305
|
it('takes no package name: one passed is an error, not a check of the current folder', async () => {
|
|
276
306
|
writePackage({id: 'acme-page'});
|
|
277
307
|
|
|
@@ -8,7 +8,7 @@ export const doc = {
|
|
|
8
8
|
namespace: 'cli/commands',
|
|
9
9
|
summary: 'Deprecated: the old name of `integration verify`',
|
|
10
10
|
description:
|
|
11
|
-
'`astryx integration pack --check` is the name this check had before {@link command:integration verify}. It still runs the same check, with the same output, JSON, and exit codes, and prints a note that names `integration verify`. It will be removed in a later release.',
|
|
11
|
+
'`astryx integration pack --check` is the name this check had before {@link command:integration verify}. It still runs the same check, with the same output, JSON, and exit codes, and prints a note that names `integration verify`. It will be removed in a later release. Outside a package it writes nothing and reports one failed check, no_package, naming the integration package it needs (exit 1).',
|
|
12
12
|
fn: 'integrationPackCheck',
|
|
13
13
|
options: [
|
|
14
14
|
{
|
|
@@ -19,6 +19,7 @@ export const doc = {
|
|
|
19
19
|
examples: [
|
|
20
20
|
{label: 'The old spelling', cli: 'astryx integration pack --check'},
|
|
21
21
|
],
|
|
22
|
+
outsideProject: 'own',
|
|
22
23
|
exitCodes: [
|
|
23
24
|
{code: 0, when: 'the packed package exposes the same valid contributions'},
|
|
24
25
|
{
|
|
@@ -27,4 +28,10 @@ export const doc = {
|
|
|
27
28
|
},
|
|
28
29
|
],
|
|
29
30
|
related: ['integration verify'],
|
|
31
|
+
notes: [
|
|
32
|
+
{
|
|
33
|
+
type: 'prose',
|
|
34
|
+
text: "In global mode: outside a package, `integration pack --check` writes nothing, reports one failed check, `no_package`, and exits 1. In a project, the project's version of Astryx runs it, whichever astryx command you start. See {@link namespace:global} and {@link generic:global-integrations}.",
|
|
35
|
+
},
|
|
36
|
+
],
|
|
30
37
|
};
|
|
@@ -8,15 +8,22 @@ export const doc = {
|
|
|
8
8
|
namespace: 'cli/commands',
|
|
9
9
|
summary: 'Check the package the way npm will publish it, before you publish',
|
|
10
10
|
description:
|
|
11
|
-
'Packs the package with npm, unpacks the tarball into a temporary app without installing its dependencies, and checks that the app sees the same components, templates, themes, docs, and codemods as the package, that every public import resolves, and that the package declares a CLI new enough to read it. It publishes nothing and leaves no tarball behind. It runs the package\'s own pack lifecycle scripts, as `npm pack` does.',
|
|
11
|
+
'Packs the package with npm, unpacks the tarball into a temporary app without installing its dependencies, and checks that the app sees the same components, templates, themes, docs, and codemods as the package, that every public import resolves, and that the package declares a CLI new enough to read it. It publishes nothing and leaves no tarball behind. It runs the package\'s own pack lifecycle scripts, as `npm pack` does. Outside a package it writes nothing and reports one failed check, no_package, naming the integration package it needs (exit 1).',
|
|
12
12
|
fn: 'integrationPackCheck',
|
|
13
13
|
examples: [
|
|
14
14
|
{label: 'Check before publishing', cli: 'astryx integration verify'},
|
|
15
15
|
{label: 'Machine-readable result', cli: 'astryx integration verify --json'},
|
|
16
16
|
],
|
|
17
|
+
outsideProject: 'own',
|
|
17
18
|
exitCodes: [
|
|
18
19
|
{code: 0, when: 'the packed package exposes the same valid contributions'},
|
|
19
20
|
{code: 1, when: 'the tarball is incomplete or invalid'},
|
|
20
21
|
],
|
|
21
22
|
related: ['integration add', 'doctor integration validate'],
|
|
23
|
+
notes: [
|
|
24
|
+
{
|
|
25
|
+
type: 'prose',
|
|
26
|
+
text: "In global mode: outside a package, it writes nothing, reports one failed check, `no_package`, and exits 1. In a project, the project's version of Astryx runs it, whichever astryx command you start. See {@link namespace:global} and {@link generic:global-integrations}.",
|
|
27
|
+
},
|
|
28
|
+
],
|
|
22
29
|
};
|
|
@@ -20,6 +20,7 @@ import {doc as integrationAddFn} from '../../../api/integration/integrationAdd.d
|
|
|
20
20
|
import {doc as integrationCheckFn} from '../../../api/integration/integrationCheck.doc.mjs';
|
|
21
21
|
import {printIntegrationCheckResponse} from './doctor.mjs';
|
|
22
22
|
import {doc as integrationPackCheckFn} from '../../../api/integration/integrationPackCheck.doc.mjs';
|
|
23
|
+
import {formatCliCommand} from '../../../foundation/env/package-manager.mjs';
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* @param {import('commander').Command} command
|
|
@@ -283,14 +284,14 @@ export function registerIntegration(program) {
|
|
|
283
284
|
if (!options.check) {
|
|
284
285
|
// One way forward: the new name. `npm pack` is what builds a tarball.
|
|
285
286
|
return cliError(
|
|
286
|
-
|
|
287
|
+
`\`integration pack\` is now \`integration verify\`: run \`${formatCliCommand('integration verify')}\` to check the package the way npm will publish it. To build the tarball, run \`npm pack\`.`,
|
|
287
288
|
{code: ERROR_CODES.ERR_INVALID_ARGUMENT},
|
|
288
289
|
);
|
|
289
290
|
}
|
|
290
291
|
// stderr, and only in text: JSON callers get the same envelope as verify.
|
|
291
292
|
if (!program.opts().json) {
|
|
292
293
|
console.error(
|
|
293
|
-
|
|
294
|
+
`Note: \`integration pack --check\` is deprecated. Run \`${formatCliCommand('integration verify')}\`: it runs the same check.`,
|
|
294
295
|
);
|
|
295
296
|
}
|
|
296
297
|
return verifyPackage(program);
|
|
@@ -148,6 +148,7 @@ describe('--json contract: supported commands emit valid envelopes', () => {
|
|
|
148
148
|
expect(parsed.meta.sources).toEqual([
|
|
149
149
|
expect.objectContaining({name: 'Astryx', status: 'fresh'}),
|
|
150
150
|
]);
|
|
151
|
+
expect(parsed.meta.answeredBy).toEqual(expect.any(Object));
|
|
151
152
|
});
|
|
152
153
|
|
|
153
154
|
it('astryx template --json emits a typed envelope', async () => {
|
|
@@ -166,7 +167,11 @@ describe('--json contract: supported commands emit valid envelopes', () => {
|
|
|
166
167
|
});
|
|
167
168
|
|
|
168
169
|
it('astryx doctor --json emits a doctor envelope with checks + summary', async () => {
|
|
169
|
-
//
|
|
170
|
+
// A project that declares @astryxdesign/core but installs none → a FAIL → exit 1.
|
|
171
|
+
fs.writeFileSync(
|
|
172
|
+
path.join(tmpDir, 'package.json'),
|
|
173
|
+
'{"name":"app","dependencies":{"@astryxdesign/core":"*"}}',
|
|
174
|
+
);
|
|
170
175
|
const {status, stdout} = await runCli(['doctor', '--json'], {cwd: tmpDir});
|
|
171
176
|
expect(status).toBe(1);
|
|
172
177
|
const parsed = parseJson(stdout);
|
|
@@ -22,6 +22,7 @@ export const doc = {
|
|
|
22
22
|
{label: 'Full manifest', cli: 'astryx manifest --json'},
|
|
23
23
|
{label: 'The same manifest, under data.manifest (type "help")', cli: 'astryx --json'},
|
|
24
24
|
],
|
|
25
|
+
outsideProject: 'same',
|
|
25
26
|
exitCodes: [
|
|
26
27
|
{code: 0, when: 'success'},
|
|
27
28
|
{code: 1, when: 'the manifest cannot be generated'},
|