@astryxdesign/cli 0.7.15 → 0.7.16-canary.g8514aae
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 +5 -3
- package/api/component/_adapter.d.mts +1 -1
- package/api/component/_adapter.mjs +28 -1
- package/api/doctor/_adapter.d.mts +17 -0
- package/api/doctor/_adapter.mjs +35 -0
- package/api/doctor/doctor.mjs +18 -4
- package/api/integration/validate-integration.mjs +1 -1
- package/api/theme/_adapter.d.mts +5 -2
- package/api/theme/_adapter.mjs +43 -12
- package/api/theme/build/build.d.mts +1 -21
- package/api/theme/build/build.mjs +149 -37
- package/api/theme/eject/eject.mjs +22 -1
- package/api/theme/template/template.d.mts +19 -0
- package/api/theme/template/template.mjs +91 -19
- package/api/theme/theme.type.d.mts +5 -1
- package/api/theme/theme.type.mjs +2 -1
- package/api/theme/themeBuild.doc.mjs +3 -3
- package/api/theme/themeEject.doc.mjs +1 -1
- package/api/theme/themeTemplate.doc.mjs +9 -3
- package/api/theme-edit/_adapter.d.mts +21 -0
- package/api/theme-edit/_adapter.mjs +176 -22
- package/api/theme-edit/_check.d.mts +7 -0
- package/api/theme-edit/_check.mjs +1050 -173
- package/api/theme-edit/_color.d.mts +2 -8
- package/api/theme-edit/_color.mjs +292 -219
- package/api/theme-edit/_compiler.d.mts +1 -0
- package/api/theme-edit/_compiler.mjs +20 -1
- package/api/theme-edit/_context.d.mts +21 -0
- package/api/theme-edit/_context.mjs +235 -12
- package/api/theme-edit/_css.d.mts +50 -1
- package/api/theme-edit/_css.mjs +310 -28
- package/api/theme-edit/_edit.d.mts +9 -0
- package/api/theme-edit/_edit.mjs +907 -123
- package/api/theme-edit/_how-commands.d.mts +11 -26
- package/api/theme-edit/_how-commands.mjs +30 -2
- package/api/theme-edit/_how-question.d.mts +7 -0
- package/api/theme-edit/_how-question.mjs +1304 -176
- package/api/theme-edit/_how.mjs +144 -30
- package/api/theme-edit/_palette.d.mts +6 -0
- package/api/theme-edit/_palette.mjs +164 -62
- package/api/theme-edit/_parts.d.mts +16 -0
- package/api/theme-edit/_parts.mjs +49 -1
- package/api/theme-edit/_png.mjs +19 -14
- package/api/theme-edit/_preview-app.mjs +514 -27
- package/api/theme-edit/_preview.d.mts +11 -0
- package/api/theme-edit/_preview.mjs +245 -24
- package/api/theme-edit/_project.d.mts +11 -0
- package/api/theme-edit/_project.mjs +35 -9
- package/api/theme-edit/_settings.d.mts +122 -5
- package/api/theme-edit/_settings.mjs +1363 -71
- package/api/theme-edit/_tables.d.mts +19 -0
- package/api/theme-edit/_tables.mjs +205 -149
- package/api/theme-edit/_vet.d.mts +42 -0
- package/api/theme-edit/_vet.mjs +144 -0
- package/api/theme-edit/theme-edit.type.d.mts +2 -1
- package/api/theme-edit/theme-edit.type.mjs +1 -1
- package/api/theme-edit/themeEditNew.doc.mjs +1 -1
- package/api/theme-edit/themeEditShow.doc.mjs +11 -3
- package/assets/docs/tree/single-component.doc.mjs +11 -2
- package/assets/docs/tree/tokens-and-setup.doc.mjs +39 -3
- package/assets/docs.generated.json +2 -2
- package/assets/preview-app/next.config.mjs +7 -1
- package/assets/preview-app/src/app/globals.css +1 -0
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Table/ColumnsVirtualizationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/ColumnsVirtualizationHookUsage.tsx +53 -0
- package/assets/templates/blocks/components/Table/InfiniteScrollHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/Table/InfiniteScrollHookUsage.tsx +33 -0
- package/assets/templates/components.generated.json +1 -1
- package/authoring/doctypes/_schema.d.mts +52 -5
- package/authoring/doctypes/_schema.mjs +62 -7
- package/authoring/doctypes/base/type.ts +10 -0
- package/authoring/doctypes/component/component.doc.mjs +1 -1
- package/authoring/doctypes/function/function.doc.mjs +6 -0
- package/authoring/doctypes/function/type.ts +3 -0
- package/authoring/doctypes/legacy.mjs +5 -1
- package/authoring/index.d.ts +1 -0
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/doctor.doc.mjs +2 -2
- package/clients/cli/commands/experimental/theme.mjs +188 -37
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-editor-new.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-eject.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-template.doc.mjs +2 -2
- package/clients/cli/commands/theme-build.doc.mjs +2 -2
- package/clients/cli/commands/theme-eject.doc.mjs +1 -1
- package/clients/cli/commands/theme-template.doc.mjs +3 -1
- package/clients/cli/commands/theme.mjs +89 -6
- package/clients/cli/formatters/index.mjs +7 -4
- package/clients/cli/lib/cli-error.mjs +9 -3
- package/clients/cli/lib/component-format.mjs +27 -9
- package/clients/cli/lib/json-shim.mjs +40 -2
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/config/project.mjs +50 -14
- package/foundation/discovery/theme-discovery.d.mts +5 -1
- package/foundation/discovery/theme-discovery.mjs +24 -3
- package/foundation/fs/gather-cache.d.mts +9 -2
- package/foundation/fs/gather-cache.mjs +36 -10
- package/foundation/fs/paths.d.mts +16 -0
- package/foundation/fs/paths.mjs +25 -0
- package/foundation/render/host-exit.d.mts +8 -0
- package/foundation/render/host-exit.mjs +11 -0
- package/foundation/render/page-host.mjs +56 -10
- package/foundation/render/page-worker.mjs +14 -0
- package/foundation/render/render-page.mjs +37 -2
- package/foundation/response/error-codes.d.mts +2 -1
- package/foundation/response/error-codes.d.ts +1 -0
- package/foundation/response/error-codes.doc.mjs +5 -0
- package/foundation/response/error-codes.mjs +3 -0
- package/foundation/response/json.d.mts +15 -0
- package/foundation/response/json.mjs +52 -1
- package/foundation/response/response-types.doc.mjs +1 -1
- package/package.json +7 -6
|
@@ -84,4 +84,19 @@ export function toErrorEnvelope(err: unknown, suggestions?: import("./base").Sug
|
|
|
84
84
|
* done before it failed (see toErrorEnvelope).
|
|
85
85
|
*/
|
|
86
86
|
export function jsonError(message: string, suggestions?: import("./base").Suggestion[], code?: string, receipt?: Record<string, unknown>): void;
|
|
87
|
+
/**
|
|
88
|
+
* Whether the output on `fd` is captured in process: the console method or
|
|
89
|
+
* the stream's write replaced since this module loaded (a test).
|
|
90
|
+
* @param {number} fd
|
|
91
|
+
*/
|
|
92
|
+
export function outputCaptured(fd: number): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Write `text` to a file descriptor whole, synchronously, waiting while a
|
|
95
|
+
* full pipe drains (a non-blocking pipe answers EAGAIN until its reader
|
|
96
|
+
* reads). Used for a command's last output before it exits, so nothing is
|
|
97
|
+
* lost however slowly the output is read.
|
|
98
|
+
* @param {number} fd 1 (stdout) or 2 (stderr)
|
|
99
|
+
* @param {string} text
|
|
100
|
+
*/
|
|
101
|
+
export function writeAllSync(fd: number, text: string): void;
|
|
87
102
|
export const API_VERSION: 1;
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
import {ERROR_CODES, isErrorCode} from './error-codes.mjs';
|
|
32
32
|
import {recordEnvelope, setOutcome} from '../debug/index.mjs';
|
|
33
33
|
import {answeredBy} from '../release/run-context.mjs';
|
|
34
|
+
import * as fs from 'node:fs';
|
|
34
35
|
|
|
35
36
|
export const API_VERSION = 1;
|
|
36
37
|
|
|
@@ -171,6 +172,56 @@ export function jsonError(message, suggestions, code, receipt) {
|
|
|
171
172
|
const err = toErrorEnvelope(message, suggestions, code, receipt);
|
|
172
173
|
// No-op when cliError already classified this failure — first outcome wins.
|
|
173
174
|
setOutcome('error', {exitCode: 1, error: new Error(message), code: err.code});
|
|
174
|
-
|
|
175
|
+
// Written whole before the exit: a process that exits with output still
|
|
176
|
+
// queued for a pipe (a slow reader, bash `$(…)`) loses all but the first
|
|
177
|
+
// 64 KiB, and a --json caller gets invalid JSON.
|
|
178
|
+
writeAllSync(1, `${JSON.stringify(err, null, 2)}\n`);
|
|
175
179
|
process.exit(1);
|
|
176
180
|
}
|
|
181
|
+
|
|
182
|
+
const CONSOLE_LOG = console.log;
|
|
183
|
+
const CONSOLE_ERROR = console.error;
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Whether the output on `fd` is captured in process: the console method or
|
|
187
|
+
* the stream's write replaced since this module loaded (a test).
|
|
188
|
+
* @param {number} fd
|
|
189
|
+
*/
|
|
190
|
+
export function outputCaptured(fd) {
|
|
191
|
+
const stream = fd === 2 ? process.stderr : process.stdout;
|
|
192
|
+
return (
|
|
193
|
+
Object.hasOwn(stream, 'write') ||
|
|
194
|
+
(fd === 2 ? console.error !== CONSOLE_ERROR : console.log !== CONSOLE_LOG)
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Write `text` to a file descriptor whole, synchronously, waiting while a
|
|
200
|
+
* full pipe drains (a non-blocking pipe answers EAGAIN until its reader
|
|
201
|
+
* reads). Used for a command's last output before it exits, so nothing is
|
|
202
|
+
* lost however slowly the output is read.
|
|
203
|
+
* @param {number} fd 1 (stdout) or 2 (stderr)
|
|
204
|
+
* @param {string} text
|
|
205
|
+
*/
|
|
206
|
+
export function writeAllSync(fd, text) {
|
|
207
|
+
// Output captured in process (a test replaced the console or the
|
|
208
|
+
// stream's write) keeps going through what captures it.
|
|
209
|
+
if (outputCaptured(fd)) {
|
|
210
|
+
(fd === 2 ? console.error : console.log)(text.replace(/\n$/, ''));
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const buf = Buffer.from(text, 'utf8');
|
|
214
|
+
const pause = new Int32Array(new SharedArrayBuffer(4));
|
|
215
|
+
let off = 0;
|
|
216
|
+
while (off < buf.length) {
|
|
217
|
+
try {
|
|
218
|
+
off += fs.writeSync(fd, buf, off, buf.length - off);
|
|
219
|
+
} catch (e) {
|
|
220
|
+
const code = /** @type {any} */ (e)?.code;
|
|
221
|
+
// A full pipe: wait a moment for its reader, then write the rest.
|
|
222
|
+
if (code === 'EAGAIN') Atomics.wait(pause, 0, 0, 5);
|
|
223
|
+
// The reader is gone (EPIPE) or the fd is closed: nothing to keep.
|
|
224
|
+
else return;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -386,7 +386,7 @@ export const doc = {
|
|
|
386
386
|
{
|
|
387
387
|
value: 'theme.build.check',
|
|
388
388
|
description:
|
|
389
|
-
'The --check receipt: theme name, an upToDate flag, the stale outputs (each {path, reason: missing | outdated}),
|
|
389
|
+
'The --check receipt: theme name, an upToDate flag, the stale outputs (each {path, reason: missing | outdated}), the full list of checked paths, and, when any is stale or missing, code ERR_THEME_STALE. Writes nothing.',
|
|
390
390
|
},
|
|
391
391
|
{
|
|
392
392
|
value: 'theme.build.batch',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.16-canary.g8514aae",
|
|
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",
|
|
@@ -111,6 +111,7 @@
|
|
|
111
111
|
"@babel/parser": "7.29.8",
|
|
112
112
|
"@babel/plugin-transform-typescript": "7.29.7",
|
|
113
113
|
"@babel/types": "7.29.8",
|
|
114
|
+
"@csstools/css-syntax-patches-for-csstree": "1.1.6",
|
|
114
115
|
"@stylexjs/babel-plugin": "^0.19.1",
|
|
115
116
|
"ast-types": "0.16.3",
|
|
116
117
|
"commander": "^12.1.0",
|
|
@@ -126,7 +127,7 @@
|
|
|
126
127
|
"zod": "^4.6.7"
|
|
127
128
|
},
|
|
128
129
|
"peerDependencies": {
|
|
129
|
-
"@astryxdesign/core": "
|
|
130
|
+
"@astryxdesign/core": "0.7.16-canary.g8514aae"
|
|
130
131
|
},
|
|
131
132
|
"peerDependenciesMeta": {
|
|
132
133
|
"@astryxdesign/core": {
|
|
@@ -134,10 +135,10 @@
|
|
|
134
135
|
}
|
|
135
136
|
},
|
|
136
137
|
"devDependencies": {
|
|
137
|
-
"@astryxdesign/charts": "
|
|
138
|
-
"@astryxdesign/core": "
|
|
139
|
-
"@astryxdesign/lab": "
|
|
140
|
-
"@astryxdesign/theme-neutral": "
|
|
138
|
+
"@astryxdesign/charts": "0.7.16-canary.g8514aae",
|
|
139
|
+
"@astryxdesign/core": "0.7.16-canary.g8514aae",
|
|
140
|
+
"@astryxdesign/lab": "0.7.16-canary.g8514aae",
|
|
141
|
+
"@astryxdesign/theme-neutral": "0.7.16-canary.g8514aae",
|
|
141
142
|
"@heroicons/react": "^2.2.0",
|
|
142
143
|
"@stylexjs/stylex": "^0.19.1",
|
|
143
144
|
"@types/babel__core": "^7.20.5",
|