@astryxdesign/cli 0.6.5-canary.efac39f → 0.6.5-canary.f27f749
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/theme/build/build.mjs +69 -146
- package/api/theme/build/build.test.mjs +1 -190
- package/api/theme/themeBuild.doc.d.mts +1 -4
- package/api/theme/themeBuild.doc.mjs +3 -14
- package/foundation/doc-compiler/doc-loads.test.mjs +1 -1
- package/package.json +9 -9
- package/api/theme/build/build.icon-lineage.test.mjs +0 -117
- package/api/theme/build/build.icon-preservation.test.mjs +0 -639
- package/api/theme/build/icon-imports.d.mts +0 -47
- package/api/theme/build/icon-imports.mjs +0 -691
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.doc.mjs +0 -15
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +0 -38
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.doc.mjs +0 -20
- package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.tsx +0 -48
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryxdesign/cli",
|
|
3
|
-
"version": "0.6.5-canary.
|
|
3
|
+
"version": "0.6.5-canary.f27f749",
|
|
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",
|
|
@@ -101,10 +101,10 @@
|
|
|
101
101
|
"zod": "^4.4.3"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
|
-
"@astryxdesign/charts": "0.6.5-canary.
|
|
105
|
-
"@astryxdesign/core": "0.6.5-canary.
|
|
106
|
-
"@astryxdesign/lab": "0.6.5-canary.
|
|
107
|
-
"@astryxdesign/theme-neutral": "0.6.5-canary.
|
|
104
|
+
"@astryxdesign/charts": "0.6.5-canary.f27f749",
|
|
105
|
+
"@astryxdesign/core": "0.6.5-canary.f27f749",
|
|
106
|
+
"@astryxdesign/lab": "0.6.5-canary.f27f749",
|
|
107
|
+
"@astryxdesign/theme-neutral": "0.6.5-canary.f27f749"
|
|
108
108
|
},
|
|
109
109
|
"peerDependenciesMeta": {
|
|
110
110
|
"@astryxdesign/charts": {
|
|
@@ -121,10 +121,10 @@
|
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@astryxdesign/charts": "0.6.5-canary.
|
|
125
|
-
"@astryxdesign/core": "0.6.5-canary.
|
|
126
|
-
"@astryxdesign/lab": "0.6.5-canary.
|
|
127
|
-
"@astryxdesign/theme-neutral": "0.6.5-canary.
|
|
124
|
+
"@astryxdesign/charts": "0.6.5-canary.f27f749",
|
|
125
|
+
"@astryxdesign/core": "0.6.5-canary.f27f749",
|
|
126
|
+
"@astryxdesign/lab": "0.6.5-canary.f27f749",
|
|
127
|
+
"@astryxdesign/theme-neutral": "0.6.5-canary.f27f749",
|
|
128
128
|
"@heroicons/react": "^2.2.0",
|
|
129
129
|
"@stylexjs/stylex": "^0.19.0",
|
|
130
130
|
"@types/babel__core": "^7.20.5",
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @file Icon preservation through multiple generations of built themes.
|
|
5
|
-
* @input Real themeBuild calls and registries imported under the same local
|
|
6
|
-
* binding name from separate base and child theme directories.
|
|
7
|
-
* @output A native ESM load verifies inherited and overridden React icons
|
|
8
|
-
* survive when a grandchild extends the child's generated artifact.
|
|
9
|
-
* @position Direct API regression for persisted icon inheritance in #5058.
|
|
10
|
-
* The node project's global setup supplies the compiled core package.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import {expect, it} from 'vitest';
|
|
14
|
-
import {execFileSync} from 'node:child_process';
|
|
15
|
-
import * as fs from 'node:fs';
|
|
16
|
-
import * as path from 'node:path';
|
|
17
|
-
import {themeBuild} from './build.mjs';
|
|
18
|
-
|
|
19
|
-
it('preserves merged icon lineage through a built child with colliding import names', async () => {
|
|
20
|
-
const tmpDir = fs.mkdtempSync(
|
|
21
|
-
path.resolve(import.meta.dirname, '../../..', '.tmp-icon-lineage-'),
|
|
22
|
-
);
|
|
23
|
-
try {
|
|
24
|
-
for (const directory of ['base', 'child']) {
|
|
25
|
-
fs.mkdirSync(path.join(tmpDir, directory));
|
|
26
|
-
}
|
|
27
|
-
const write = (file, source) =>
|
|
28
|
-
fs.writeFileSync(path.join(tmpDir, file), source);
|
|
29
|
-
const writeRegistry = (file, labels) => {
|
|
30
|
-
write(
|
|
31
|
-
file,
|
|
32
|
-
`import {createElement} from 'react';
|
|
33
|
-
export const icons = {
|
|
34
|
-
${Object.entries(labels)
|
|
35
|
-
.map(
|
|
36
|
-
([key, label]) =>
|
|
37
|
-
` ${JSON.stringify(key)}: createElement('svg', {'data-icon': ${JSON.stringify(label)}}),`,
|
|
38
|
-
)
|
|
39
|
-
.join('\n')}
|
|
40
|
-
};
|
|
41
|
-
`,
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
writeRegistry('base/icons.mjs', {
|
|
46
|
-
check: 'base-check',
|
|
47
|
-
close: 'base-close',
|
|
48
|
-
});
|
|
49
|
-
writeRegistry('child/icons.mjs', {
|
|
50
|
-
add: 'child-add',
|
|
51
|
-
close: 'child-close',
|
|
52
|
-
});
|
|
53
|
-
write(
|
|
54
|
-
'base/source.mjs',
|
|
55
|
-
`import {defineTheme} from '@astryxdesign/core/theme';
|
|
56
|
-
import {icons} from './icons.mjs';
|
|
57
|
-
export const baseTheme = defineTheme({
|
|
58
|
-
name: 'base', tokens: {'--color-bg': '#fff'}, icons,
|
|
59
|
-
});
|
|
60
|
-
`,
|
|
61
|
-
);
|
|
62
|
-
write(
|
|
63
|
-
'child/source.mjs',
|
|
64
|
-
`import {defineTheme} from '@astryxdesign/core/theme';
|
|
65
|
-
import {baseTheme} from '../base/source.mjs';
|
|
66
|
-
import {icons} from './icons.mjs';
|
|
67
|
-
export default defineTheme({
|
|
68
|
-
name: 'child', extends: baseTheme, tokens: {}, icons,
|
|
69
|
-
});
|
|
70
|
-
`,
|
|
71
|
-
);
|
|
72
|
-
const child = await themeBuild('child/source.mjs', {}, {cwd: tmpDir});
|
|
73
|
-
expect(child?.type).toBe('theme.build');
|
|
74
|
-
|
|
75
|
-
write(
|
|
76
|
-
'grandchild.mjs',
|
|
77
|
-
`import {defineTheme} from '@astryxdesign/core/theme';
|
|
78
|
-
import {childTheme} from './child/child.js';
|
|
79
|
-
export default defineTheme({name: 'grandchild', extends: childTheme, tokens: {}});
|
|
80
|
-
`,
|
|
81
|
-
);
|
|
82
|
-
const grandchild = await themeBuild('grandchild.mjs', {}, {cwd: tmpDir});
|
|
83
|
-
expect(grandchild?.type).toBe('theme.build');
|
|
84
|
-
const checked = await themeBuild(
|
|
85
|
-
'grandchild.mjs',
|
|
86
|
-
{check: true},
|
|
87
|
-
{cwd: tmpDir},
|
|
88
|
-
);
|
|
89
|
-
expect(checked?.data.upToDate).toBe(true);
|
|
90
|
-
|
|
91
|
-
// Native imports catch invalid aliases and incorrect relative specifiers
|
|
92
|
-
// that the source loader could otherwise resolve or transform away.
|
|
93
|
-
execFileSync(
|
|
94
|
-
process.execPath,
|
|
95
|
-
[
|
|
96
|
-
'--input-type=module',
|
|
97
|
-
'--eval',
|
|
98
|
-
`import assert from 'node:assert/strict';
|
|
99
|
-
import {isValidElement} from 'react';
|
|
100
|
-
import {childTheme} from './child/child.js';
|
|
101
|
-
import {grandchildTheme} from './grandchild.js';
|
|
102
|
-
const expected = {check: 'base-check', close: 'child-close', add: 'child-add'};
|
|
103
|
-
assert.deepEqual(Object.keys(grandchildTheme.icons).sort(), Object.keys(expected).sort());
|
|
104
|
-
for (const [key, label] of Object.entries(expected)) {
|
|
105
|
-
const icon = grandchildTheme.icons[key];
|
|
106
|
-
assert.ok(isValidElement(icon), key + ' must remain a React element');
|
|
107
|
-
assert.equal(icon.type, 'svg');
|
|
108
|
-
assert.equal(icon.props['data-icon'], label);
|
|
109
|
-
assert.equal(icon, childTheme.icons[key], key + ' must retain its imported identity');
|
|
110
|
-
}`,
|
|
111
|
-
],
|
|
112
|
-
{cwd: tmpDir, stdio: 'pipe', timeout: 10000},
|
|
113
|
-
);
|
|
114
|
-
} finally {
|
|
115
|
-
fs.rmSync(tmpDir, {recursive: true, force: true});
|
|
116
|
-
}
|
|
117
|
-
});
|