@astryxdesign/cli 0.6.3-canary.2c831e4 → 0.6.3-canary.3ee796c
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/api/build/build.type.d.mts +2 -2
- package/api/build/build.type.mjs +2 -2
- package/api/component/component.type.d.mts +6 -6
- package/api/component/component.type.mjs +19 -19
- package/api/discover/discover.type.d.mts +4 -4
- package/api/discover/discover.type.mjs +10 -10
- package/api/docs/docs.type.d.mts +4 -4
- package/api/docs/docs.type.mjs +10 -10
- package/api/hook/hook.type.d.mts +3 -3
- package/api/hook/hook.type.mjs +11 -11
- package/api/integration/add-contribution.mjs +3 -5
- package/api/integration/add-contribution.test.mjs +4 -4
- package/api/integration/pack-check.mjs +7 -49
- package/api/integration/pack-check.test.mjs +0 -249
- package/api/search/search.type.d.mts +1 -1
- package/api/search/search.type.mjs +1 -1
- package/api/swizzle/swizzle.type.d.mts +2 -2
- package/api/swizzle/swizzle.type.mjs +2 -2
- package/api/template/template.type.d.mts +5 -5
- package/api/template/template.type.mjs +12 -12
- package/api/theme/build/build.mjs +6 -20
- package/api/theme/build/build.test.mjs +0 -127
- package/api/theme/palette/generate/generate.mjs +1 -1
- package/api/theme/palette/generate/generator.d.mts +13 -10
- package/api/theme/palette/generate/generator.mjs +3 -7
- package/api/theme/theme.type.d.mts +11 -170
- package/api/theme/theme.type.mjs +27 -94
- package/api/upgrade/upgrade.type.d.mts +4 -4
- package/api/upgrade/upgrade.type.mjs +10 -10
- package/assets/codemods/integration-discovery.mjs +2 -40
- package/assets/codemods/integration-discovery.test.mjs +0 -58
- package/assets/docs/cli-integrations.doc.mjs +0 -9
- package/assets/docs/styling-libraries.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +1 -1
- package/clients/cli/commands/integration-authoring.test.mjs +9 -13
- package/package.json +11 -9
|
@@ -221,61 +221,3 @@ describe('integration codemod discovery', () => {
|
|
|
221
221
|
).rejects.toThrow(/across versions/i);
|
|
222
222
|
});
|
|
223
223
|
});
|
|
224
|
-
|
|
225
|
-
describe('test files beside a codemod', () => {
|
|
226
|
-
// The incident this closes: every .ts/.mjs/.js under a version folder was
|
|
227
|
-
// loaded AND VALIDATED as a codemod, so a test file colocated with its
|
|
228
|
-
// transform failed validation — and because a definition error is a hard
|
|
229
|
-
// error, it took every codemod in that version with it. `astryx upgrade`
|
|
230
|
-
// then applied nothing and reported success. Core is immune because its own
|
|
231
|
-
// codemods are enumerated in a registry rather than discovered by walking a
|
|
232
|
-
// directory, so its colocated tests are simply never visited. Only
|
|
233
|
-
// integrations carry the landmine.
|
|
234
|
-
const TRANSFORM = `
|
|
235
|
-
export default {
|
|
236
|
-
type: 'code',
|
|
237
|
-
title: 'Drop foo',
|
|
238
|
-
transform: (file) => file.source.replace(/foo/g, 'bar'),
|
|
239
|
-
};
|
|
240
|
-
`;
|
|
241
|
-
// Not a codemod: no default export of the right shape. Loading it throws.
|
|
242
|
-
const A_TEST = `
|
|
243
|
-
import {describe, it, expect} from 'vitest';
|
|
244
|
-
describe('drop-foo', () => {
|
|
245
|
-
it('drops foo', () => expect(1).toBe(1));
|
|
246
|
-
});
|
|
247
|
-
`;
|
|
248
|
-
|
|
249
|
-
it.each([
|
|
250
|
-
['a .test. sibling', '0.2.0/drop-foo.test.mjs'],
|
|
251
|
-
['a .spec. sibling', '0.2.0/drop-foo.spec.mjs'],
|
|
252
|
-
['a fixture sibling', '0.2.0/drop-foo.fixture.mjs'],
|
|
253
|
-
['a __tests__ directory', '0.2.0/__tests__/drop-foo.mjs'],
|
|
254
|
-
['a __fixtures__ directory', '0.2.0/__fixtures__/input.mjs'],
|
|
255
|
-
])('ignores %s and still discovers the codemod', async (_label, testPath) => {
|
|
256
|
-
scaffold({'0.2.0/drop-foo.mjs': TRANSFORM, [testPath]: A_TEST});
|
|
257
|
-
|
|
258
|
-
const project = await Project.load(tmpDir);
|
|
259
|
-
const byVersion = await discoverIntegrationCodemods(
|
|
260
|
-
project.loadedIntegrations,
|
|
261
|
-
);
|
|
262
|
-
|
|
263
|
-
expect([...byVersion.keys()]).toEqual(['0.2.0']);
|
|
264
|
-
expect(byVersion.get('0.2.0').map(entry => entry.id)).toEqual(['drop-foo']);
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
it('a nested helper directory is still walked', async () => {
|
|
268
|
-
// Only test and fixture names are skipped. A package that organises its
|
|
269
|
-
// transforms into subdirectories keeps working.
|
|
270
|
-
scaffold({'0.2.0/imports/drop-foo.mjs': TRANSFORM});
|
|
271
|
-
|
|
272
|
-
const project = await Project.load(tmpDir);
|
|
273
|
-
const byVersion = await discoverIntegrationCodemods(
|
|
274
|
-
project.loadedIntegrations,
|
|
275
|
-
);
|
|
276
|
-
|
|
277
|
-
expect(byVersion.get('0.2.0').map(entry => entry.id)).toEqual([
|
|
278
|
-
'imports/drop-foo',
|
|
279
|
-
]);
|
|
280
|
-
});
|
|
281
|
-
});
|
|
@@ -320,15 +320,6 @@ export const docs = {
|
|
|
320
320
|
type: 'prose',
|
|
321
321
|
text: 'Codemod ids (the extension-less relative path under the version folder, e.g. `rename-widget-prop`, `config/rename-integration`) must be unique within a package across all versions. A duplicate id across versions is a hard error.',
|
|
322
322
|
},
|
|
323
|
-
{
|
|
324
|
-
type: 'prose',
|
|
325
|
-
text: 'The loader automatically skips test and fixture files so you can colocate tests with transforms. Reserved names: files matching `*.test.*`, `*.spec.*`, or `*.fixture.*`, and any file under a `__tests__/` or `__fixtures__/` directory. These are never loaded as codemods regardless of their extension.',
|
|
326
|
-
},
|
|
327
|
-
{
|
|
328
|
-
type: 'code',
|
|
329
|
-
lang: 'text',
|
|
330
|
-
code: 'codemods/\n 0.2.0/\n rename-widget-prop.ts # loaded as a codemod\n rename-widget-prop.test.ts # skipped (reserved name)\n __tests__/\n rename-widget-prop.test.ts # skipped (reserved directory)',
|
|
331
|
-
},
|
|
332
323
|
{
|
|
333
324
|
type: 'code',
|
|
334
325
|
lang: 'typescript',
|
|
@@ -120,7 +120,7 @@ describe('integration authoring CLI', () => {
|
|
|
120
120
|
);
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
it('
|
|
123
|
+
it('packs the generated contribution and proves the consumer inventory', async () => {
|
|
124
124
|
const added = await runCli(
|
|
125
125
|
['integration', 'add', 'component', 'AcmeWidget', '--json'],
|
|
126
126
|
tmpDir,
|
|
@@ -131,23 +131,19 @@ describe('integration authoring CLI', () => {
|
|
|
131
131
|
['integration', 'pack', '--check', '--json'],
|
|
132
132
|
tmpDir,
|
|
133
133
|
);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
expect(checked.status).not.toBe(0);
|
|
137
|
-
const envelope = parseEnvelope(checked.stdout);
|
|
138
|
-
expect(envelope).toMatchObject({
|
|
134
|
+
expect(checked.status).toBe(0);
|
|
135
|
+
expect(parseEnvelope(checked.stdout)).toMatchObject({
|
|
139
136
|
type: 'integration.pack-check',
|
|
140
137
|
data: {
|
|
141
138
|
name: '@acme/widgets',
|
|
142
|
-
|
|
139
|
+
version: '1.0.0',
|
|
140
|
+
packable: true,
|
|
141
|
+
contributions: {
|
|
142
|
+
local: {components: ['AcmeWidget']},
|
|
143
|
+
packed: {components: ['AcmeWidget']},
|
|
144
|
+
},
|
|
143
145
|
},
|
|
144
146
|
});
|
|
145
|
-
expect(envelope.data.issues).toContainEqual(
|
|
146
|
-
expect.objectContaining({
|
|
147
|
-
severity: 'error',
|
|
148
|
-
message: expect.stringContaining('AcmeWidget'),
|
|
149
|
-
}),
|
|
150
|
-
);
|
|
151
147
|
});
|
|
152
148
|
|
|
153
149
|
it('requires the explicit --check gate on pack', async () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.6.3-canary.
|
|
3
|
+
"version": "0.6.3-canary.3ee796c",
|
|
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",
|
|
@@ -100,10 +100,11 @@
|
|
|
100
100
|
"zod": "^4.4.3"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
|
-
"@astryxdesign/charts": "0.6.3-canary.
|
|
104
|
-
"@astryxdesign/core": "0.6.3-canary.
|
|
105
|
-
"@astryxdesign/lab": "0.6.3-canary.
|
|
106
|
-
"@astryxdesign/theme-neutral": "0.6.3-canary.
|
|
103
|
+
"@astryxdesign/charts": "0.6.3-canary.3ee796c",
|
|
104
|
+
"@astryxdesign/core": "0.6.3-canary.3ee796c",
|
|
105
|
+
"@astryxdesign/lab": "0.6.3-canary.3ee796c",
|
|
106
|
+
"@astryxdesign/theme-neutral": "0.6.3-canary.3ee796c",
|
|
107
|
+
"gpt-tokenizer": "^3.4.0"
|
|
107
108
|
},
|
|
108
109
|
"peerDependenciesMeta": {
|
|
109
110
|
"@astryxdesign/charts": {
|
|
@@ -120,13 +121,14 @@
|
|
|
120
121
|
}
|
|
121
122
|
},
|
|
122
123
|
"devDependencies": {
|
|
123
|
-
"@astryxdesign/charts": "0.6.3-canary.
|
|
124
|
-
"@astryxdesign/core": "0.6.3-canary.
|
|
125
|
-
"@astryxdesign/lab": "0.6.3-canary.
|
|
126
|
-
"@astryxdesign/theme-neutral": "0.6.3-canary.
|
|
124
|
+
"@astryxdesign/charts": "0.6.3-canary.3ee796c",
|
|
125
|
+
"@astryxdesign/core": "0.6.3-canary.3ee796c",
|
|
126
|
+
"@astryxdesign/lab": "0.6.3-canary.3ee796c",
|
|
127
|
+
"@astryxdesign/theme-neutral": "0.6.3-canary.3ee796c",
|
|
127
128
|
"@heroicons/react": "^2.2.0",
|
|
128
129
|
"@stylexjs/stylex": "^0.19.0",
|
|
129
130
|
"@types/babel__core": "^7.20.5",
|
|
131
|
+
"gpt-tokenizer": "^3.4.0",
|
|
130
132
|
"lucide-react": "^1.18.0",
|
|
131
133
|
"recharts": "^3.9.2"
|
|
132
134
|
},
|