@astryxdesign/cli 0.7.4 → 0.7.5-canary.51c62ca

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.
@@ -144,6 +144,10 @@
144
144
  "kind": "component",
145
145
  "name": "LogStream"
146
146
  },
147
+ {
148
+ "kind": "component",
149
+ "name": "MobilePowerSearch"
150
+ },
147
151
  {
148
152
  "kind": "component",
149
153
  "name": "MobileTokenizer"
@@ -26,19 +26,20 @@ export default function TokenizerClear() {
26
26
  const [value, setValue] = useState<SearchableItem[]>([users[0], users[1]]);
27
27
 
28
28
  return (
29
- <Stack direction="vertical" gap={2}>
30
- <Text type="supporting" color="secondary">
31
- Clear-all button appears when tokens are selected
32
- </Text>
33
- <Tokenizer
34
- label="Team Members"
35
- placeholder="Search people..."
36
- searchSource={userSource}
37
- value={value}
38
- onChange={items => setValue(items)}
39
- hasClear
40
- containerStyle={{width: 400}}
41
- />
42
- </Stack>
29
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 400px)'}}>
30
+ <Stack direction="vertical" gap={2}>
31
+ <Text type="supporting" color="secondary">
32
+ Clear-all button appears when tokens are selected
33
+ </Text>
34
+ <Tokenizer
35
+ label="Team Members"
36
+ placeholder="Search people..."
37
+ searchSource={userSource}
38
+ value={value}
39
+ onChange={items => setValue(items)}
40
+ hasClear
41
+ />
42
+ </Stack>
43
+ </div>
43
44
  );
44
45
  }
@@ -32,36 +32,36 @@ export default function TokenizerCreatable() {
32
32
  const [members, setMembers] = useState<SearchableItem[]>([]);
33
33
 
34
34
  return (
35
- <Stack direction="vertical" gap={4}>
36
- <Stack direction="vertical" gap={1}>
37
- <Text type="supporting" color="secondary">
38
- Free-text only
39
- </Text>
40
- <Tokenizer
41
- label="Tags"
42
- searchSource={emptySource}
43
- value={tags}
44
- onChange={items => setTags(items)}
45
- hasCreate
46
- placeholder="Type a tag and press Enter..."
47
- containerStyle={{width: 400}}
48
- />
35
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 400px)'}}>
36
+ <Stack direction="vertical" gap={4}>
37
+ <Stack direction="vertical" gap={1}>
38
+ <Text type="supporting" color="secondary">
39
+ Free-text only
40
+ </Text>
41
+ <Tokenizer
42
+ label="Tags"
43
+ searchSource={emptySource}
44
+ value={tags}
45
+ onChange={items => setTags(items)}
46
+ hasCreate
47
+ placeholder="Type a tag and press Enter..."
48
+ />
49
+ </Stack>
50
+ <Stack direction="vertical" gap={1}>
51
+ <Text type="supporting" color="secondary">
52
+ Create or search
53
+ </Text>
54
+ <Tokenizer
55
+ label="Team Members"
56
+ searchSource={userSource}
57
+ value={members}
58
+ onChange={items => setMembers(items)}
59
+ hasCreate
60
+ hasEntriesOnFocus
61
+ placeholder="Search or type a new name..."
62
+ />
63
+ </Stack>
49
64
  </Stack>
50
- <Stack direction="vertical" gap={1}>
51
- <Text type="supporting" color="secondary">
52
- Create or search
53
- </Text>
54
- <Tokenizer
55
- label="Team Members"
56
- searchSource={userSource}
57
- value={members}
58
- onChange={items => setMembers(items)}
59
- hasCreate
60
- hasEntriesOnFocus
61
- placeholder="Search or type a new name..."
62
- containerStyle={{width: 400}}
63
- />
64
- </Stack>
65
- </Stack>
65
+ </div>
66
66
  );
67
67
  }
@@ -28,19 +28,20 @@ export default function TokenizerEndContent() {
28
28
  const [value, setValue] = useState<SearchableItem[]>([users[0], users[2]]);
29
29
 
30
30
  return (
31
- <Stack direction="vertical" gap={2}>
32
- <Text type="supporting" color="secondary">
33
- Action button in the end slot
34
- </Text>
35
- <Tokenizer
36
- label="Team Members"
37
- placeholder="Search people..."
38
- searchSource={userSource}
39
- value={value}
40
- onChange={items => setValue(items)}
41
- endContent={<Button label="Apply" variant="primary" size="sm" />}
42
- containerStyle={{width: 400}}
43
- />
44
- </Stack>
31
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 400px)'}}>
32
+ <Stack direction="vertical" gap={2}>
33
+ <Text type="supporting" color="secondary">
34
+ Action button in the end slot
35
+ </Text>
36
+ <Tokenizer
37
+ label="Team Members"
38
+ placeholder="Search people..."
39
+ searchSource={userSource}
40
+ value={value}
41
+ onChange={items => setValue(items)}
42
+ endContent={<Button label="Apply" variant="primary" size="sm" />}
43
+ />
44
+ </Stack>
45
+ </div>
45
46
  );
46
47
  }
@@ -27,19 +27,20 @@ export default function TokenizerIcon() {
27
27
  const [value, setValue] = useState<SearchableItem[]>([users[0], users[2]]);
28
28
 
29
29
  return (
30
- <Stack direction="vertical" gap={2}>
31
- <Text type="supporting" color="secondary">
32
- Leading icon reinforces the search affordance
33
- </Text>
34
- <Tokenizer
35
- label="Team Members"
36
- placeholder="Search people..."
37
- searchSource={userSource}
38
- value={value}
39
- onChange={items => setValue(items)}
40
- startIcon={MagnifyingGlassIcon}
41
- containerStyle={{width: 400}}
42
- />
43
- </Stack>
30
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 400px)'}}>
31
+ <Stack direction="vertical" gap={2}>
32
+ <Text type="supporting" color="secondary">
33
+ Leading icon reinforces the search affordance
34
+ </Text>
35
+ <Tokenizer
36
+ label="Team Members"
37
+ placeholder="Search people..."
38
+ searchSource={userSource}
39
+ value={value}
40
+ onChange={items => setValue(items)}
41
+ startIcon={MagnifyingGlassIcon}
42
+ />
43
+ </Stack>
44
+ </div>
44
45
  );
45
46
  }
@@ -31,21 +31,22 @@ export default function TokenizerMaxEntries() {
31
31
  const [value, setValue] = useState<SearchableItem[]>([skills[0], skills[1]]);
32
32
 
33
33
  return (
34
- <Stack direction="vertical" gap={2}>
35
- <Text type="supporting" color="secondary">
36
- Limited to {MAX_SKILLS} selections — {MAX_SKILLS - value.length}{' '}
37
- remaining
38
- </Text>
39
- <Tokenizer
40
- label="Top Skills"
41
- placeholder="Search skills..."
42
- description={`Choose up to ${MAX_SKILLS} skills`}
43
- searchSource={skillSource}
44
- value={value}
45
- onChange={items => setValue(items)}
46
- maxEntries={MAX_SKILLS}
47
- containerStyle={{width: 400}}
48
- />
49
- </Stack>
34
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 400px)'}}>
35
+ <Stack direction="vertical" gap={2}>
36
+ <Text type="supporting" color="secondary">
37
+ Limited to {MAX_SKILLS} selections — {MAX_SKILLS - value.length}{' '}
38
+ remaining
39
+ </Text>
40
+ <Tokenizer
41
+ label="Top Skills"
42
+ placeholder="Search skills..."
43
+ description={`Choose up to ${MAX_SKILLS} skills`}
44
+ searchSource={skillSource}
45
+ value={value}
46
+ onChange={items => setValue(items)}
47
+ maxEntries={MAX_SKILLS}
48
+ />
49
+ </Stack>
50
+ </div>
50
51
  );
51
52
  }
@@ -28,35 +28,35 @@ export default function TokenizerOverflow() {
28
28
  const [layerValue, setLayerValue] = useState<SearchableItem[]>(users);
29
29
 
30
30
  return (
31
- <Stack direction="vertical" gap={4}>
32
- <Stack direction="vertical" gap={1}>
33
- <Text type="supporting" color="secondary">
34
- Inline overflow — content shifts down on expand
35
- </Text>
36
- <Tokenizer
37
- label="Inline Overflow"
38
- placeholder="Add more..."
39
- searchSource={userSource}
40
- value={inlineValue}
41
- onChange={items => setInlineValue(items)}
42
- tokenOverflowBehavior="unfocusedInline"
43
- containerStyle={{width: 400, maxWidth: 400}}
44
- />
31
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 400px)'}}>
32
+ <Stack direction="vertical" gap={4}>
33
+ <Stack direction="vertical" gap={1}>
34
+ <Text type="supporting" color="secondary">
35
+ Inline overflow — content shifts down on expand
36
+ </Text>
37
+ <Tokenizer
38
+ label="Inline Overflow"
39
+ placeholder="Add more..."
40
+ searchSource={userSource}
41
+ value={inlineValue}
42
+ onChange={items => setInlineValue(items)}
43
+ tokenOverflowBehavior="unfocusedInline"
44
+ />
45
+ </Stack>
46
+ <Stack direction="vertical" gap={1}>
47
+ <Text type="supporting" color="secondary">
48
+ Layer overflow — expands as overlay, no layout shift
49
+ </Text>
50
+ <Tokenizer
51
+ label="Layer Overflow"
52
+ placeholder="Add more..."
53
+ searchSource={userSource}
54
+ value={layerValue}
55
+ onChange={items => setLayerValue(items)}
56
+ tokenOverflowBehavior="unfocusedLayer"
57
+ />
58
+ </Stack>
45
59
  </Stack>
46
- <Stack direction="vertical" gap={1}>
47
- <Text type="supporting" color="secondary">
48
- Layer overflow — expands as overlay, no layout shift
49
- </Text>
50
- <Tokenizer
51
- label="Layer Overflow"
52
- placeholder="Add more..."
53
- searchSource={userSource}
54
- value={layerValue}
55
- onChange={items => setLayerValue(items)}
56
- tokenOverflowBehavior="unfocusedLayer"
57
- containerStyle={{width: 400, maxWidth: 400}}
58
- />
59
- </Stack>
60
- </Stack>
60
+ </div>
61
61
  );
62
62
  }
@@ -17,13 +17,14 @@ export default function TokenizerShowcase() {
17
17
  {id: '2', label: 'Engineering'},
18
18
  ]);
19
19
  return (
20
- <Tokenizer
21
- label="Tags"
22
- placeholder="Search..."
23
- searchSource={source}
24
- value={value}
25
- onChange={setValue}
26
- containerStyle={{width: 400}}
27
- />
20
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 400px)'}}>
21
+ <Tokenizer
22
+ label="Tags"
23
+ placeholder="Search..."
24
+ searchSource={source}
25
+ value={value}
26
+ onChange={setValue}
27
+ />
28
+ </div>
28
29
  );
29
30
  }
@@ -32,46 +32,44 @@ export default function TokenizerStates() {
32
32
  ]);
33
33
 
34
34
  return (
35
- <Stack direction="vertical" gap={4}>
36
- <Tokenizer
37
- label="Disabled field"
38
- searchSource={userSource}
39
- value={[users[0], users[2]]}
40
- onChange={() => {}}
41
- isDisabled
42
- containerStyle={{width: 400}}
43
- />
44
- <Tokenizer
45
- label="Error message"
46
- placeholder="Search people..."
47
- searchSource={userSource}
48
- value={errorValue}
49
- onChange={items => setErrorValue(items)}
50
- isRequired
51
- status={{type: 'error', message: 'At least one reviewer is required'}}
52
- containerStyle={{width: 400}}
53
- />
54
- <Tokenizer
55
- label="Warning message"
56
- placeholder="Search people..."
57
- searchSource={userSource}
58
- value={warningValue}
59
- onChange={items => setWarningValue(items)}
60
- status={{
61
- type: 'warning',
62
- message: 'Consider adding at least 2 approvers',
63
- }}
64
- containerStyle={{width: 400}}
65
- />
66
- <Tokenizer
67
- label="Success message"
68
- placeholder="Search people..."
69
- searchSource={userSource}
70
- value={successValue}
71
- onChange={items => setSuccessValue(items)}
72
- status={{type: 'success', message: 'All required reviewers added'}}
73
- containerStyle={{width: 400}}
74
- />
75
- </Stack>
35
+ <div style={{display: 'grid', gridTemplateColumns: 'minmax(0, 400px)'}}>
36
+ <Stack direction="vertical" gap={4}>
37
+ <Tokenizer
38
+ label="Disabled field"
39
+ searchSource={userSource}
40
+ value={[users[0], users[2]]}
41
+ onChange={() => {}}
42
+ isDisabled
43
+ />
44
+ <Tokenizer
45
+ label="Error message"
46
+ placeholder="Search people..."
47
+ searchSource={userSource}
48
+ value={errorValue}
49
+ onChange={items => setErrorValue(items)}
50
+ isRequired
51
+ status={{type: 'error', message: 'At least one reviewer is required'}}
52
+ />
53
+ <Tokenizer
54
+ label="Warning message"
55
+ placeholder="Search people..."
56
+ searchSource={userSource}
57
+ value={warningValue}
58
+ onChange={items => setWarningValue(items)}
59
+ status={{
60
+ type: 'warning',
61
+ message: 'Consider adding at least 2 approvers',
62
+ }}
63
+ />
64
+ <Tokenizer
65
+ label="Success message"
66
+ placeholder="Search people..."
67
+ searchSource={userSource}
68
+ value={successValue}
69
+ onChange={items => setSuccessValue(items)}
70
+ status={{type: 'success', message: 'All required reviewers added'}}
71
+ />
72
+ </Stack>
73
+ </div>
76
74
  );
77
75
  }
@@ -127,7 +127,8 @@ export function docStem(docPath: string): string;
127
127
  /**
128
128
  * The local module a doc's import names: the doc's own `import`, else the
129
129
  * subpath its directory publishes, read through the package's `exports` (its
130
- * `main` when it has none). Undefined when the package directory is unknown;
130
+ * `main` when it has none). A subpath's `source` condition wins when its file
131
+ * is in the package, so the answer does not depend on a build. Undefined when the package directory is unknown;
131
132
  * null when the import names another package or resolves to no file.
132
133
  *
133
134
  * @param {{name?: string, __packageDir?: string, __packageExports?: Record<string, unknown>|null}} integration
@@ -705,6 +705,47 @@ describe('integration components a family doc lists in components', () => {
705
705
  expect(namesIn(loaded)).toEqual(['AcmeList']);
706
706
  });
707
707
 
708
+ it('reads members through the source condition, the same with or without built output', () => {
709
+ // The family's member is exported only from the root entry, as Lab's
710
+ // TourStep is.
711
+ const loaded = writePackage(
712
+ {
713
+ exports: {
714
+ '.': {
715
+ source: './src/index.ts',
716
+ types: './dist/index.d.ts',
717
+ default: './dist/index.js',
718
+ },
719
+ },
720
+ },
721
+ {
722
+ 'src/index.ts':
723
+ "export {AcmeList} from './list/AcmeList';\nexport {AcmeListRow} from './list/row';\n",
724
+ 'src/list/AcmeList.doc.mjs': family(
725
+ 'AcmeList',
726
+ "{name: 'AcmeList', description: 'x'}, {name: 'AcmeListRow', description: 'x'}",
727
+ ),
728
+ 'src/list/AcmeList.tsx':
729
+ 'export function AcmeList() { return null; }\n',
730
+ 'src/list/row.tsx': 'export function AcmeListRow() { return null; }\n',
731
+ },
732
+ );
733
+ expect(namesIn(loaded)).toEqual(['AcmeList', 'AcmeListRow']);
734
+ expect(findIntegrationComponentSource(loaded, 'AcmeListRow')).toBe(
735
+ path.join(root, 'src', 'list', 'row.tsx'),
736
+ );
737
+ // Built output, even a stale one without the member, changes nothing.
738
+ fs.mkdirSync(path.join(root, 'dist'), {recursive: true});
739
+ fs.writeFileSync(
740
+ path.join(root, 'dist', 'index.js'),
741
+ 'export function AcmeList() { return null; }\n',
742
+ );
743
+ expect(namesIn(loaded)).toEqual(['AcmeList', 'AcmeListRow']);
744
+ // A package that does not ship its source reads the built output.
745
+ fs.rmSync(path.join(root, 'src', 'index.ts'));
746
+ expect(namesIn(loaded)).toEqual(['AcmeList']);
747
+ });
748
+
708
749
  it('lists a member another folder declares, with no source', async () => {
709
750
  const loaded = writePackage(
710
751
  {exports: {'./menu': './src/menu/index.ts'}},
@@ -18,7 +18,10 @@ import {
18
18
  moduleExportsName,
19
19
  staticExportObject,
20
20
  } from './module-exports.mjs';
21
- import {inspectPackageExport} from './package-exports.mjs';
21
+ import {
22
+ inspectPackageExport,
23
+ sourceExportTarget,
24
+ } from './package-exports.mjs';
22
25
 
23
26
  const require = createRequire(import.meta.url);
24
27
 
@@ -996,7 +999,8 @@ function packageMain(packageDir) {
996
999
  /**
997
1000
  * The local module a doc's import names: the doc's own `import`, else the
998
1001
  * subpath its directory publishes, read through the package's `exports` (its
999
- * `main` when it has none). Undefined when the package directory is unknown;
1002
+ * `main` when it has none). A subpath's `source` condition wins when its file
1003
+ * is in the package, so the answer does not depend on a build. Undefined when the package directory is unknown;
1000
1004
  * null when the import names another package or resolves to no file.
1001
1005
  *
1002
1006
  * @param {{name?: string, __packageDir?: string, __packageExports?: Record<string, unknown>|null}} integration
@@ -1027,11 +1031,13 @@ export function importedModule(integration, docPath, doc) {
1027
1031
  specifier === packageName
1028
1032
  ? '.'
1029
1033
  : `./${specifier.slice(packageName.length + 1)}`;
1030
- return inspectPackageExport(
1031
- {name: packageName, exports: exportsMap ?? undefined},
1032
- packageDir,
1033
- subpath,
1034
- ).target;
1034
+ const pkg = {name: packageName, exports: exportsMap ?? undefined};
1035
+ // The `source` condition first, when its file is there, so a family lists
1036
+ // the same members whether or not the package has been built.
1037
+ return (
1038
+ sourceExportTarget(pkg, packageDir, subpath) ??
1039
+ inspectPackageExport(pkg, packageDir, subpath).target
1040
+ );
1035
1041
  }
1036
1042
 
1037
1043
  /**
@@ -1,6 +1,19 @@
1
1
  // @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
+ /**
5
+ * The file a subpath's `source` condition names, when that file is in the
6
+ * package. A package that ships its source (or a workspace package before it
7
+ * is built) declares it beside the built target, so reading it answers the
8
+ * same with or without a build. Null when there is no such condition or file.
9
+ * @param {{exports?: unknown}} pkg
10
+ * @param {string} packageDir
11
+ * @param {string} subpath `.` or a `./`-prefixed subpath
12
+ * @returns {string|null}
13
+ */
14
+ export function sourceExportTarget(pkg: {
15
+ exports?: unknown;
16
+ }, packageDir: string, subpath: string): string | null;
4
17
  /**
5
18
  * @typedef {object} PackageExportResult
6
19
  * @property {string} subpath
@@ -8,7 +8,8 @@
8
8
  * their legacy public deep paths and are resolved from files on disk.
9
9
  *
10
10
  * @input Parsed package.json, package directory, and a public subpath
11
- * @output The public specifier and confined target file, when exported
11
+ * @output The public specifier and confined target file, when exported, and
12
+ * the file a subpath's `source` condition names, when the package has it
12
13
  * @position packages/cli/foundation/discovery — shared package import metadata
13
14
  */
14
15
 
@@ -165,6 +166,44 @@ function resolveLegacy(packageDir, subpath) {
165
166
  return candidates.find(regularFile) ?? null;
166
167
  }
167
168
 
169
+ /**
170
+ * The raw export value one subpath maps to, with the wildcard it matched.
171
+ * @param {unknown} exportsField
172
+ * @param {string} subpath
173
+ * @returns {{value: unknown, wildcard: string} | null}
174
+ */
175
+ function rawExportValue(exportsField, subpath) {
176
+ if (exportsField == null) return null;
177
+ if (!isRecord(exportsField)) {
178
+ return subpath === '.' ? {value: exportsField, wildcard: ''} : null;
179
+ }
180
+ if (!Object.keys(exportsField).some(key => key.startsWith('.'))) {
181
+ return subpath === '.' ? {value: exportsField, wildcard: ''} : null;
182
+ }
183
+ const selected = subpathValue(exportsField, subpath);
184
+ return selected.found
185
+ ? {value: selected.value, wildcard: selected.wildcard}
186
+ : null;
187
+ }
188
+
189
+ /**
190
+ * The file a subpath's `source` condition names, when that file is in the
191
+ * package. A package that ships its source (or a workspace package before it
192
+ * is built) declares it beside the built target, so reading it answers the
193
+ * same with or without a build. Null when there is no such condition or file.
194
+ * @param {{exports?: unknown}} pkg
195
+ * @param {string} packageDir
196
+ * @param {string} subpath `.` or a `./`-prefixed subpath
197
+ * @returns {string|null}
198
+ */
199
+ export function sourceExportTarget(pkg, packageDir, subpath) {
200
+ const selected = rawExportValue(pkg.exports, subpath);
201
+ if (!selected || !isRecord(selected.value)) return null;
202
+ const source = selected.value.source;
203
+ if (typeof source !== 'string') return null;
204
+ return resolveTarget(packageDir, source.replaceAll('*', selected.wildcard));
205
+ }
206
+
168
207
  /**
169
208
  * @typedef {object} PackageExportResult
170
209
  * @property {string} subpath
@@ -209,6 +209,39 @@ export async function searchComponents(needle, coreDir, components) {
209
209
  }
210
210
  }
211
211
 
212
+ // --- Pass 3: a name made of other words around a component's name ---
213
+ // Only when nothing above matched: a contiguous run of the needle's words
214
+ // ("Primitive Button", "Meta Employee Typeahead") that is a component's
215
+ // whole name. Longer runs and runs nearer the end score higher.
216
+ if (scored.size === 0) {
217
+ const words = String(needle)
218
+ .replace(/([a-z0-9])([A-Z])/g, '$1 $2')
219
+ .replace(/([A-Z])([A-Z][a-z])/g, '$1 $2')
220
+ .toLowerCase()
221
+ .split(/[^a-z0-9]+/)
222
+ .filter(Boolean);
223
+ const byLower = new Map(allNames.map(n => [n.toLowerCase(), n]));
224
+ const longest = Math.max(0, ...allNames.map(n => n.length));
225
+ for (let i = 0; i < words.length; i++) {
226
+ let run = '';
227
+ for (let j = i + 1; j <= words.length; j++) {
228
+ // Grow the run one word at a time; stop once no name is that long.
229
+ run += words[j - 1];
230
+ if (run.length > longest) break;
231
+ if (run.length < 4 || run === term) continue;
232
+ const comp = byLower.get(run);
233
+ if (!comp) continue;
234
+ const span = j - i;
235
+ const atEnd = j === words.length ? 1 : 0;
236
+ addMatch(comp, 10 + Math.min(span, 4) + atEnd, 'name part "' + run + '"');
237
+ }
238
+ }
239
+ // Keep only the strongest name parts, so a weaker part never sits
240
+ // beside the best one.
241
+ const best = Math.max(0, ...[...scored.values()].map(r => r.score));
242
+ for (const [name, r] of scored) if (r.score < best) scored.delete(name);
243
+ }
244
+
212
245
  const results = Array.from(scored.values())
213
246
  .map(r =>
214
247
  keywordAt.has(r.name)
@@ -116,6 +116,23 @@ describe('searchComponents', () => {
116
116
  }
117
117
  });
118
118
 
119
+ it('suggests a component whose whole name is a run of the needle\'s words when nothing else matches', async () => {
120
+ const results = await searchComponents('FancyWidgetPanel', NO_CORE, {
121
+ g: ['Panel', 'Widget', 'Sheet'],
122
+ });
123
+ expect(results.map(r => r.name)).toEqual(['Panel']);
124
+ expect(results[0].reason).toBe('name part "panel"');
125
+ expect(results.every(r => r.score < 20)).toBe(true);
126
+ });
127
+
128
+ it('adds no name-part matches when another signal matched', async () => {
129
+ const results = await searchComponents('Panl', NO_CORE, {
130
+ g: ['Panel', 'Sheet'],
131
+ });
132
+ expect(results.map(r => r.name)).toEqual(['Panel']);
133
+ expect(results[0].score).toBe(80);
134
+ });
135
+
119
136
  it('breaks a score tie alphabetically', async () => {
120
137
  // Both names are edit-distance 2 from "bcd" -> both score 40 -> alpha order.
121
138
  const results = await searchComponents('bcd', NO_CORE, {g: ['Xbc', 'Abc']});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astryxdesign/cli",
3
- "version": "0.7.4",
3
+ "version": "0.7.5-canary.51c62ca",
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",
@@ -106,10 +106,10 @@
106
106
  "zod": "^4.4.3"
107
107
  },
108
108
  "peerDependencies": {
109
- "@astryxdesign/charts": "*",
110
- "@astryxdesign/core": "*",
111
- "@astryxdesign/lab": "*",
112
- "@astryxdesign/theme-neutral": "*"
109
+ "@astryxdesign/charts": "0.7.5-canary.51c62ca",
110
+ "@astryxdesign/core": "0.7.5-canary.51c62ca",
111
+ "@astryxdesign/lab": "0.7.5-canary.51c62ca",
112
+ "@astryxdesign/theme-neutral": "0.7.5-canary.51c62ca"
113
113
  },
114
114
  "peerDependenciesMeta": {
115
115
  "@astryxdesign/charts": {
@@ -126,10 +126,10 @@
126
126
  }
127
127
  },
128
128
  "devDependencies": {
129
- "@astryxdesign/charts": "*",
130
- "@astryxdesign/core": "*",
131
- "@astryxdesign/lab": "*",
132
- "@astryxdesign/theme-neutral": "*",
129
+ "@astryxdesign/charts": "0.7.5-canary.51c62ca",
130
+ "@astryxdesign/core": "0.7.5-canary.51c62ca",
131
+ "@astryxdesign/lab": "0.7.5-canary.51c62ca",
132
+ "@astryxdesign/theme-neutral": "0.7.5-canary.51c62ca",
133
133
  "@heroicons/react": "^2.2.0",
134
134
  "@stylexjs/stylex": "^0.19.0",
135
135
  "@types/babel__core": "^7.20.5",