@astryxdesign/cli 0.6.5-canary.d6da8e4 → 0.6.5-canary.e5d11eb

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.
Files changed (67) hide show
  1. package/README.md +2 -2
  2. package/api/build/_adapter.d.mts +0 -14
  3. package/api/build/_adapter.mjs +1 -58
  4. package/api/build/build.test.mjs +1 -74
  5. package/api/build/kit/kit.mjs +7 -39
  6. package/api/build/kit/rank.d.mts +0 -8
  7. package/api/build/kit/rank.mjs +0 -14
  8. package/api/docs/docs.d.mts +0 -6
  9. package/api/docs/docs.doc.mjs +2 -31
  10. package/api/docs/docs.mjs +1 -44
  11. package/api/docs/docs.type.d.mts +1 -38
  12. package/api/docs/docs.type.mjs +1 -18
  13. package/api/docs/node/node.d.mts +3 -28
  14. package/api/docs/node/node.mjs +23 -146
  15. package/api/gap-report/gap-report.d.mts +1 -3
  16. package/api/gap-report/gap-report.mjs +2 -12
  17. package/api/gap-report/gap-report.test.mjs +0 -106
  18. package/api/hook/list/list.d.mts +1 -1
  19. package/api/integration/add-theme.mjs +3 -93
  20. package/api/integration/add-theme.test.mjs +0 -100
  21. package/api/integration/integrationAddTheme.doc.mjs +1 -1
  22. package/api/search/search.d.mts +5 -12
  23. package/api/search/search.doc.mjs +4 -4
  24. package/api/search/search.mjs +53 -123
  25. package/api/search/search.test.mjs +8 -123
  26. package/api/search/search.type.d.mts +5 -5
  27. package/api/search/search.type.mjs +5 -5
  28. package/api/theme/build/build.mjs +69 -146
  29. package/api/theme/build/build.test.mjs +1 -190
  30. package/api/theme/themeBuild.doc.d.mts +1 -4
  31. package/api/theme/themeBuild.doc.mjs +3 -14
  32. package/assets/docs/theme.doc.mjs +1 -2
  33. package/assets/docs/tokens.doc.mjs +3 -3
  34. package/assets/docs/tree/add-a-theme.doc.mjs +0 -4
  35. package/assets/docs/tree/debug-and-gap-reports.doc.mjs +1 -1
  36. package/clients/cli/commands/build-theme.mjs +2 -8
  37. package/clients/cli/commands/discover.mjs +1 -29
  38. package/clients/cli/commands/docs.doc.mjs +2 -15
  39. package/clients/cli/commands/docs.mjs +5 -222
  40. package/clients/cli/commands/gap-report.mjs +0 -12
  41. package/clients/cli/commands/gap-report.test.mjs +0 -63
  42. package/clients/cli/commands/integration-add.doc.mjs +1 -1
  43. package/clients/cli/commands/search.doc.mjs +4 -5
  44. package/clients/cli/commands/search.mjs +6 -30
  45. package/clients/cli/commands/search.test.mjs +16 -60
  46. package/foundation/agent-docs/agent-docs.mjs +1 -2
  47. package/foundation/agent-docs/agent-docs.test.mjs +0 -8
  48. package/foundation/discovery/theme-discovery.d.mts +0 -6
  49. package/foundation/discovery/theme-discovery.mjs +0 -9
  50. package/foundation/doc-compiler/doc-loads.test.mjs +1 -1
  51. package/package.json +9 -9
  52. package/api/build/kit/weights.d.mts +0 -82
  53. package/api/build/kit/weights.json +0 -1
  54. package/api/build/kit/weights.mjs +0 -305
  55. package/api/build/kit/weights.test.mjs +0 -190
  56. package/api/docs/docs.depth.test.mjs +0 -132
  57. package/api/theme/build/build.icon-lineage.test.mjs +0 -117
  58. package/api/theme/build/build.icon-preservation.test.mjs +0 -639
  59. package/api/theme/build/icon-imports.d.mts +0 -47
  60. package/api/theme/build/icon-imports.mjs +0 -691
  61. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.doc.mjs +0 -15
  62. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupShowcase.tsx +0 -38
  63. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.doc.mjs +0 -20
  64. package/assets/templates/blocks/components/DropdownMenuGroup/DropdownMenuGroupWithSelectable.tsx +0 -48
  65. package/clients/cli/commands/discover.no-source.test.mjs +0 -75
  66. package/clients/cli/commands/docs.depth.test.mjs +0 -219
  67. package/clients/cli/commands/theme-list.behavior.test.mjs +0 -41
@@ -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
- });