@astryxdesign/cli 0.7.16-canary.ge95b87c → 0.7.16
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/CHANGELOG.md +369 -0
- package/README.md +1 -1
- package/api/build/_adapter.d.mts +9 -0
- package/api/build/_adapter.mjs +24 -0
- package/api/build/kit/shell.weights.json +1 -0
- package/api/build/kit/shellcall.d.mts +26 -0
- package/api/build/kit/shellcall.mjs +87 -0
- package/api/build/kit/start.mjs +67 -4
- package/api/build/kit/weights.d.mts +15 -0
- package/api/build/kit/weights.mjs +27 -0
- package/api/component/__fixtures__/resolutions/modules.txt +1 -1
- package/api/doctor/_adapter.d.mts +3 -2
- package/api/doctor/_adapter.mjs +7 -1
- package/api/doctor/doctor.d.mts +8 -0
- package/api/doctor/doctor.mjs +53 -8
- package/api/doctor/theme-checks.mjs +157 -8
- package/api/icon/_adapter.d.mts +7 -3
- package/api/icon/_adapter.mjs +12 -3
- package/api/icon/icon.type.d.mts +15 -0
- package/api/icon/icon.type.mjs +10 -3
- package/api/icon/iconUse.doc.mjs +19 -5
- package/api/icon/list/list.mjs +7 -1
- package/api/icon/use/use.d.mts +8 -5
- package/api/icon/use/use.mjs +95 -13
- package/api/init/run/run.mjs +1 -0
- package/api/template/template.type.d.mts +6 -2
- package/api/template/template.type.mjs +2 -1
- package/api/theme/_adapter.mjs +16 -2
- package/api/theme/build/build.d.mts +10 -6
- package/api/theme/build/build.mjs +42 -29
- package/api/theme/generateTonalPalette.doc.mjs +2 -2
- package/api/theme/palette/generate/generator.mjs +141 -2
- package/api/theme/theme.type.d.mts +39 -0
- package/api/theme/theme.type.mjs +21 -0
- package/api/theme/themeBuild.doc.mjs +1 -1
- package/api/theme/themePaletteGenerate.doc.mjs +1 -1
- package/api/theme-edit/_adapter.d.mts +1 -0
- package/api/theme-edit/_adapter.mjs +79 -21
- package/api/theme-edit/_check.d.mts +25 -2
- package/api/theme-edit/_check.mjs +251 -61
- package/api/theme-edit/_context.d.mts +2 -1
- package/api/theme-edit/_context.mjs +19 -1
- package/api/theme-edit/_edit.d.mts +16 -0
- package/api/theme-edit/_edit.mjs +360 -59
- package/api/theme-edit/_how-question.d.mts +8 -0
- package/api/theme-edit/_how-question.mjs +169 -22
- package/api/theme-edit/_marks.d.mts +13 -0
- package/api/theme-edit/_marks.mjs +15 -0
- package/api/theme-edit/_palette.d.mts +27 -0
- package/api/theme-edit/_palette.mjs +112 -8
- package/api/theme-edit/_preview-app.d.mts +46 -1
- package/api/theme-edit/_preview-app.mjs +367 -36
- package/api/theme-edit/_preview.d.mts +55 -0
- package/api/theme-edit/_preview.mjs +231 -6
- package/api/theme-edit/_project.d.mts +4 -0
- package/api/theme-edit/_project.mjs +27 -6
- package/api/theme-edit/_settings.d.mts +61 -2
- package/api/theme-edit/_settings.mjs +317 -115
- package/api/theme-edit/_tables.mjs +1 -1
- package/api/theme-edit/theme-edit.type.d.mts +30 -2
- package/api/theme-edit/theme-edit.type.mjs +10 -2
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +1 -1
- package/assets/docs/author-a-theme.doc.mjs +1 -1
- package/assets/docs/theme.doc.dense.mjs +1 -1
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/docs/theme.doc.zh.mjs +4 -3
- package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/icon-sets.doc.mjs +63 -8
- package/assets/docs.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Outline/useOutlineFromDOMHookUsage.doc.mjs +21 -0
- package/assets/templates/blocks/components/Outline/useOutlineFromDOMHookUsage.tsx +62 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +20 -2
- package/assets/templates/themes/neutral/neutralPalettes.generated.receipt.json +2 -0
- package/authoring/config/config.doc.mjs +8 -0
- package/authoring/config/parse.d.mts +1 -0
- package/authoring/config/parse.mjs +12 -0
- package/authoring/config/type.ts +8 -0
- package/authoring/doctypes/icon-set/icon-set-data.doc.mjs +3 -3
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/experimental/icon.mjs +61 -6
- package/clients/cli/commands/experimental/theme.mjs +9 -2
- package/clients/cli/commands/experimental-icon-use.doc.mjs +12 -5
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
- package/clients/cli/commands/theme.doc.mjs +7 -2
- package/clients/cli/commands/theme.mjs +41 -18
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/index.mjs +25 -5
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/config/config-writer.d.mts +23 -0
- package/foundation/config/config-writer.mjs +150 -56
- package/foundation/config/project.mjs +43 -2
- package/foundation/discovery/component-discovery.mjs +6 -5
- package/foundation/discovery/icon-set-checks.mjs +164 -48
- package/foundation/discovery/icon-set-discovery.d.mts +38 -5
- package/foundation/discovery/icon-set-discovery.mjs +50 -6
- package/foundation/discovery/icon-set-theme-maps.d.mts +59 -0
- package/foundation/discovery/icon-set-theme-maps.mjs +95 -0
- package/foundation/discovery/icon-set-writer.d.mts +2 -3
- package/foundation/discovery/icon-set-writer.mjs +57 -16
- package/foundation/discovery/template-icons.d.mts +27 -10
- package/foundation/discovery/template-icons.mjs +142 -26
- package/foundation/discovery/theme-discovery.d.mts +25 -0
- package/foundation/discovery/theme-discovery.mjs +48 -7
- package/foundation/fs/gather-cache.mjs +6 -2
- package/foundation/integrations/autolink.d.mts +4 -2
- package/foundation/integrations/autolink.mjs +4 -2
- package/foundation/integrations/cli-requirement.d.mts +16 -5
- package/foundation/integrations/cli-requirement.mjs +27 -6
- package/foundation/integrations/may-have-integrations.mjs +5 -2
- package/foundation/integrations/missing-dependency.d.mts +9 -0
- package/foundation/integrations/missing-dependency.mjs +100 -0
- package/package.json +6 -6
package/clients/cli/index.mjs
CHANGED
|
@@ -17,8 +17,9 @@ import {fileURLToPath} from 'node:url';
|
|
|
17
17
|
import * as fs from 'node:fs';
|
|
18
18
|
import * as path from 'node:path';
|
|
19
19
|
import {formatCliCommand, getCliInvocation, quoteCommandArgument} from '../../foundation/env/package-manager.mjs';
|
|
20
|
-
import {hasRecordedProject} from '../../foundation/env/cli-command.mjs';
|
|
20
|
+
import {hasRecordedProject, recordDeclaredCliCommands} from '../../foundation/env/cli-command.mjs';
|
|
21
21
|
import {isOutsideProject} from '../../foundation/env/project-scope.mjs';
|
|
22
|
+
import {mayHaveIntegrations} from '../../foundation/integrations/may-have-integrations.mjs';
|
|
22
23
|
import {findConfigPath} from '../../foundation/config/config-path.mjs';
|
|
23
24
|
import {API_VERSION, setJsonMode} from '../../foundation/response/json.mjs';
|
|
24
25
|
import {answeredBy, runChoice} from '../../foundation/release/run-context.mjs';
|
|
@@ -235,7 +236,10 @@ export async function loadProjectDebugHandler() {
|
|
|
235
236
|
* Commander parses, before any hook, so the preAction load cannot reach it.
|
|
236
237
|
* `Project.load` reads astryx.config and each integration's manifest; it does
|
|
237
238
|
* no discovery. Skipped when the debug preload already loaded the project, and
|
|
238
|
-
*
|
|
239
|
+
* where no integration can load (no config, no manifest of its own, no
|
|
240
|
+
* installed dependency that ships one): nothing there declares a command, so
|
|
241
|
+
* help prints the same without loading the project module. Called from the
|
|
242
|
+
* bin before Commander parses.
|
|
239
243
|
*
|
|
240
244
|
* @param {string[]} [argv] arguments after the binary.
|
|
241
245
|
* @returns {Promise<void>}
|
|
@@ -247,6 +251,11 @@ export async function loadProjectForHelp(argv = process.argv.slice(2)) {
|
|
|
247
251
|
try {
|
|
248
252
|
const cwd = process.cwd();
|
|
249
253
|
if (hasRecordedProject(cwd)) return;
|
|
254
|
+
if (!mayHaveIntegrations(cwd)) {
|
|
255
|
+
// What loading this project would record: no declared command.
|
|
256
|
+
recordDeclaredCliCommands(cwd, []);
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
250
259
|
const {Project} = await import('../../foundation/config/project.mjs');
|
|
251
260
|
await Project.load(cwd);
|
|
252
261
|
} catch {
|
|
@@ -586,7 +595,7 @@ export async function createProgram({argv} = {}) {
|
|
|
586
595
|
|
|
587
596
|
program
|
|
588
597
|
.name('astryx')
|
|
589
|
-
.description('Design system CLI — components, themes, and tooling')
|
|
598
|
+
.description('Design system CLI — components, themes, and tooling\n\nMaking or changing a theme? Use the experimental theme editor: astryx experimental theme editor new <name> --like neutral, then editor set / editor how "<what you want>"; after each change look at it with astryx experimental theme editor show <name> --png (writes PNGs, changes nothing in the app): a theme change is not done until you have looked. No app yet: astryx experimental theme preview app <dir>.')
|
|
590
599
|
.version(pkg.version)
|
|
591
600
|
// These four change only the reads named in their text; every other
|
|
592
601
|
// command ignores them.
|
|
@@ -792,13 +801,20 @@ export async function createProgram({argv} = {}) {
|
|
|
792
801
|
* Load the project's integrations before any command runs, so every command
|
|
793
802
|
* it prints starts with the `cliCommand` they declare (the picker reads them
|
|
794
803
|
* synchronously; see foundation/env/cli-command.mjs). Skipped when this
|
|
795
|
-
* process already loaded the project, such as the bin's debug preload
|
|
796
|
-
*
|
|
804
|
+
* process already loaded the project, such as the bin's debug preload, and
|
|
805
|
+
* where no integration can load, so nothing declares a command (a command
|
|
806
|
+
* that needs the project still loads it). A project that cannot load is the
|
|
807
|
+
* command's to report, never this hook's.
|
|
797
808
|
*/
|
|
798
809
|
program.hook('preAction', async () => {
|
|
799
810
|
try {
|
|
800
811
|
const cwd = process.cwd();
|
|
801
812
|
if (hasRecordedProject(cwd)) return;
|
|
813
|
+
if (!mayHaveIntegrations(cwd)) {
|
|
814
|
+
// What loading this project would record: no declared command.
|
|
815
|
+
recordDeclaredCliCommands(cwd, []);
|
|
816
|
+
return;
|
|
817
|
+
}
|
|
802
818
|
const {Project} = await import('../../foundation/config/project.mjs');
|
|
803
819
|
await Project.load(cwd);
|
|
804
820
|
} catch {
|
|
@@ -933,6 +949,10 @@ export async function createProgram({argv} = {}) {
|
|
|
933
949
|
const stub = program
|
|
934
950
|
.command(cmd.name)
|
|
935
951
|
.description(`(failed to load: ${reason})`)
|
|
952
|
+
// Whatever options and words the run passed, it gets the load
|
|
953
|
+
// error, not a complaint about an option this stand-in never knew.
|
|
954
|
+
.allowUnknownOption()
|
|
955
|
+
.allowExcessArguments()
|
|
936
956
|
.action(() => {
|
|
937
957
|
// Nothing loaded, so nothing was answered — say that rather than
|
|
938
958
|
// leaving the run's result unreported.
|