@auto-engineer/generate-react-client 1.103.0 → 1.104.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,58 @@
1
1
  # @auto-engineer/generate-react-client
2
2
 
3
+ ## 1.104.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`78976f5`](https://github.com/BeOnAuto/auto-engineer/commit/78976f5df70cec2320f548f08d4b950bda1c5063) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: extractDefaults extracts destructuring defaults
8
+
9
+ - [`ad74fec`](https://github.com/BeOnAuto/auto-engineer/commit/ad74fecdba40dff69a57c1fb5c0b36e7de40df35) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: buildHtmlPropSet resolves HTML div prop names
10
+
11
+ - [`4ca9d54`](https://github.com/BeOnAuto/auto-engineer/commit/4ca9d5434af53f9bbffa6d8af61082534693cbd2) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: add Card.tsx tests verifying pure HTML wrappers have empty props
12
+
13
+ - [`4ca9d54`](https://github.com/BeOnAuto/auto-engineer/commit/4ca9d5434af53f9bbffa6d8af61082534693cbd2) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: add Card.tsx tests verifying pure HTML wrappers have empty props
14
+
15
+ - [`8d4a3d1`](https://github.com/BeOnAuto/auto-engineer/commit/8d4a3d1c992ce35e390260007e1575052df4bc39) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: resolveCustomProps filters HTML props from component type
16
+
17
+ - [`4ca9d54`](https://github.com/BeOnAuto/auto-engineer/commit/4ca9d5434af53f9bbffa6d8af61082534693cbd2) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: add Card.tsx tests verifying pure HTML wrappers have empty props
18
+
19
+ - [`fb635c1`](https://github.com/BeOnAuto/auto-engineer/commit/fb635c1b23a1ad472e76604ad9ee502c8ebe453e) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: add Carousel.tsx tests for separate type def and custom prop survival
20
+
21
+ - [`21f0490`](https://github.com/BeOnAuto/auto-engineer/commit/21f04909e0378673fe94180d3ff081e222120580) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: parseManifestComponents deduplicates and parses component paths
22
+
23
+ - [`98d70d8`](https://github.com/BeOnAuto/auto-engineer/commit/98d70d8116ec8e87bee34aa1e506ef77fa8ffd37) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: parseComponentFile extracts Button props
24
+
25
+ - [`27df054`](https://github.com/BeOnAuto/auto-engineer/commit/27df054af29a314fdacef7dec2ffb15748d61036) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: createProject returns ts-morph Project from tsconfig
26
+
27
+ - [`4e58f58`](https://github.com/BeOnAuto/auto-engineer/commit/4e58f5859d4df96ff9944ec7411606769aaa38ff) Thanks [@github-actions[bot]](https://github.com/github-actions%5Bbot%5D)! - - **component-implementor-react**: add toHaveStyle and ReferenceError fix guidance to test fixer
28
+ - **component-implementor-react**: strengthen mock spy expect.anything() requirement in test rule 16
29
+ - **component-implementor-react**: add mock spy argument count fix to test fixer
30
+ - **component-implementor-react**: add semantic HTML role mapping test rule
31
+ - **component-implementor-react**: add array key rule and strengthen noArrayIndexKey lint fixer
32
+
33
+ - [`8fc425d`](https://github.com/BeOnAuto/auto-engineer/commit/8fc425d6c53ed4bac3739f703edbd788eb1e3397) Thanks [@osamanar](https://github.com/osamanar)! - - Added component-parser package that extracts and deduplicates component props, filtering out standard HTML attributes to surface only custom props
34
+ - Replaced client-side component merging with server-side approach using the new component-parser, simplifying the React client build pipeline
35
+ - Fixed components database not being properly built in generate-react-client
36
+ - Fixed out-of-date package lock
37
+
38
+ - [`48a7155`](https://github.com/BeOnAuto/auto-engineer/commit/48a7155ccdfca8ad58028564d821902e2d1c7b0d) Thanks [@osamanar](https://github.com/osamanar)! - - **generate-react-client**: replace merge with component-parser
39
+
40
+ - [`4ca9d54`](https://github.com/BeOnAuto/auto-engineer/commit/4ca9d5434af53f9bbffa6d8af61082534693cbd2) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: add Accordion.tsx tests for Radix prop survival
41
+
42
+ ### Patch Changes
43
+
44
+ - [`f5be819`](https://github.com/BeOnAuto/auto-engineer/commit/f5be8199bbcc358dd2f5d9940e404a55b32ef853) Thanks [@osamanar](https://github.com/osamanar)! - - Fixed an issue where the components database was not being properly built during React client generation
45
+
46
+ - [`6f72c42`](https://github.com/BeOnAuto/auto-engineer/commit/6f72c4259c96da831e72348de005ff6e70140b61) Thanks [@osamanar](https://github.com/osamanar)! - - Fixed failing tests across the project
47
+
48
+ - [`a5615d9`](https://github.com/BeOnAuto/auto-engineer/commit/a5615d944a1836d80722452c50f10c955a664a90) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: mark all bursts complete in ketchup plan
49
+
50
+ - [`47a13ab`](https://github.com/BeOnAuto/auto-engineer/commit/47a13abe754ef572cedb578ef61bb3b1c07961e8) Thanks [@osamanar](https://github.com/osamanar)! - - **component-parser**: scaffold @auto-engineer/component-parser package
51
+
52
+ - Updated dependencies [[`78976f5`](https://github.com/BeOnAuto/auto-engineer/commit/78976f5df70cec2320f548f08d4b950bda1c5063), [`ad74fec`](https://github.com/BeOnAuto/auto-engineer/commit/ad74fecdba40dff69a57c1fb5c0b36e7de40df35), [`4ca9d54`](https://github.com/BeOnAuto/auto-engineer/commit/4ca9d5434af53f9bbffa6d8af61082534693cbd2), [`4ca9d54`](https://github.com/BeOnAuto/auto-engineer/commit/4ca9d5434af53f9bbffa6d8af61082534693cbd2), [`8d4a3d1`](https://github.com/BeOnAuto/auto-engineer/commit/8d4a3d1c992ce35e390260007e1575052df4bc39), [`4ca9d54`](https://github.com/BeOnAuto/auto-engineer/commit/4ca9d5434af53f9bbffa6d8af61082534693cbd2), [`fb635c1`](https://github.com/BeOnAuto/auto-engineer/commit/fb635c1b23a1ad472e76604ad9ee502c8ebe453e), [`21f0490`](https://github.com/BeOnAuto/auto-engineer/commit/21f04909e0378673fe94180d3ff081e222120580), [`f5be819`](https://github.com/BeOnAuto/auto-engineer/commit/f5be8199bbcc358dd2f5d9940e404a55b32ef853), [`6f72c42`](https://github.com/BeOnAuto/auto-engineer/commit/6f72c4259c96da831e72348de005ff6e70140b61), [`98d70d8`](https://github.com/BeOnAuto/auto-engineer/commit/98d70d8116ec8e87bee34aa1e506ef77fa8ffd37), [`27df054`](https://github.com/BeOnAuto/auto-engineer/commit/27df054af29a314fdacef7dec2ffb15748d61036), [`4e58f58`](https://github.com/BeOnAuto/auto-engineer/commit/4e58f5859d4df96ff9944ec7411606769aaa38ff), [`a5615d9`](https://github.com/BeOnAuto/auto-engineer/commit/a5615d944a1836d80722452c50f10c955a664a90), [`8fc425d`](https://github.com/BeOnAuto/auto-engineer/commit/8fc425d6c53ed4bac3739f703edbd788eb1e3397), [`48a7155`](https://github.com/BeOnAuto/auto-engineer/commit/48a7155ccdfca8ad58028564d821902e2d1c7b0d), [`47a13ab`](https://github.com/BeOnAuto/auto-engineer/commit/47a13abe754ef572cedb578ef61bb3b1c07961e8), [`4ca9d54`](https://github.com/BeOnAuto/auto-engineer/commit/4ca9d5434af53f9bbffa6d8af61082534693cbd2)]:
53
+ - @auto-engineer/file-upload@1.104.0
54
+ - @auto-engineer/message-bus@1.104.0
55
+
3
56
  ## 1.103.0
4
57
 
5
58
  ### Minor Changes
@@ -14,6 +14,9 @@ importers:
14
14
  '@hookform/resolvers':
15
15
  specifier: ^5.2.2
16
16
  version: 5.2.2(react-hook-form@7.71.1(react@19.2.4))
17
+ '@react-spring/web':
18
+ specifier: ^10.0.3
19
+ version: 10.0.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)
17
20
  '@tanstack/react-query':
18
21
  specifier: ^5.90.19
19
22
  version: 5.90.21(react@19.2.4)
@@ -1858,6 +1861,33 @@ packages:
1858
1861
  '@radix-ui/rect@1.1.1':
1859
1862
  resolution: {integrity: sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==}
1860
1863
 
1864
+ '@react-spring/animated@10.0.3':
1865
+ resolution: {integrity: sha512-7MrxADV3vaUADn2V9iYhaIL6iOWRx9nCJjYrsk2AHD2kwPr6fg7Pt0v+deX5RnCDmCKNnD6W5fasiyM8D+wzJQ==}
1866
+ peerDependencies:
1867
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
1868
+
1869
+ '@react-spring/core@10.0.3':
1870
+ resolution: {integrity: sha512-D4DwNO68oohDf/0HG2G0Uragzb9IA1oXblxrd6MZAcBcUQG2EHUWXewjdECMPLNmQvlYVyyBRH6gPxXM5DX7DQ==}
1871
+ peerDependencies:
1872
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
1873
+
1874
+ '@react-spring/rafz@10.0.3':
1875
+ resolution: {integrity: sha512-Ri2/xqt8OnQ2iFKkxKMSF4Nqv0LSWnxXT4jXFzBDsHgeeH/cHxTLupAWUwmV9hAGgmEhBmh5aONtj3J6R/18wg==}
1876
+
1877
+ '@react-spring/shared@10.0.3':
1878
+ resolution: {integrity: sha512-geCal66nrkaQzUVhPkGomylo+Jpd5VPK8tPMEDevQEfNSWAQP15swHm+MCRG4wVQrQlTi9lOzKzpRoTL3CA84Q==}
1879
+ peerDependencies:
1880
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
1881
+
1882
+ '@react-spring/types@10.0.3':
1883
+ resolution: {integrity: sha512-H5Ixkd2OuSIgHtxuHLTt7aJYfhMXKXT/rK32HPD/kSrOB6q6ooeiWAXkBy7L8F3ZxdkBb9ini9zP9UwnEFzWgQ==}
1884
+
1885
+ '@react-spring/web@10.0.3':
1886
+ resolution: {integrity: sha512-ndU+kWY81rHsT7gTFtCJ6mrVhaJ6grFmgTnENipzmKqot4HGf5smPNK+cZZJqoGeDsj9ZsiWPW4geT/NyD484A==}
1887
+ peerDependencies:
1888
+ react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
1889
+ react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
1890
+
1861
1891
  '@repeaterjs/repeater@3.0.6':
1862
1892
  resolution: {integrity: sha512-Javneu5lsuhwNCryN+pXH93VPQ8g0dBX7wItHFgYiwQmzE1sVdg5tWHiOgHywzL2W21XQopa7IwIEnNbmeUJYA==}
1863
1893
 
@@ -6322,6 +6352,38 @@ snapshots:
6322
6352
 
6323
6353
  '@radix-ui/rect@1.1.1': {}
6324
6354
 
6355
+ '@react-spring/animated@10.0.3(react@19.2.4)':
6356
+ dependencies:
6357
+ '@react-spring/shared': 10.0.3(react@19.2.4)
6358
+ '@react-spring/types': 10.0.3
6359
+ react: 19.2.4
6360
+
6361
+ '@react-spring/core@10.0.3(react@19.2.4)':
6362
+ dependencies:
6363
+ '@react-spring/animated': 10.0.3(react@19.2.4)
6364
+ '@react-spring/shared': 10.0.3(react@19.2.4)
6365
+ '@react-spring/types': 10.0.3
6366
+ react: 19.2.4
6367
+
6368
+ '@react-spring/rafz@10.0.3': {}
6369
+
6370
+ '@react-spring/shared@10.0.3(react@19.2.4)':
6371
+ dependencies:
6372
+ '@react-spring/rafz': 10.0.3
6373
+ '@react-spring/types': 10.0.3
6374
+ react: 19.2.4
6375
+
6376
+ '@react-spring/types@10.0.3': {}
6377
+
6378
+ '@react-spring/web@10.0.3(react-dom@19.2.4(react@19.2.4))(react@19.2.4)':
6379
+ dependencies:
6380
+ '@react-spring/animated': 10.0.3(react@19.2.4)
6381
+ '@react-spring/core': 10.0.3(react@19.2.4)
6382
+ '@react-spring/shared': 10.0.3(react@19.2.4)
6383
+ '@react-spring/types': 10.0.3
6384
+ react: 19.2.4
6385
+ react-dom: 19.2.4(react@19.2.4)
6386
+
6325
6387
  '@repeaterjs/repeater@3.0.6': {}
6326
6388
 
6327
6389
  '@rolldown/pluginutils@1.0.0-rc.2': {}
@@ -2,11 +2,14 @@ import { mkdirSync, writeFileSync } from 'node:fs';
2
2
  import { dirname, resolve } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { parseArgs } from 'node:util';
5
+ import { createProject, parseManifestComponents } from '@auto-engineer/component-parser';
5
6
  import { uploadToArtifactPath } from './upload-artifact';
6
7
 
7
8
  const __dirname = dirname(fileURLToPath(import.meta.url));
9
+ const PROJECT_ROOT = resolve(__dirname, '..');
8
10
  const OUTPUT_DIR = resolve(__dirname, '../../.context');
9
11
  const OUTPUT_FILE = resolve(OUTPUT_DIR, 'components-db.json');
12
+ const TSCONFIG_PATH = resolve(PROJECT_ROOT, 'tsconfig.app.json');
10
13
 
11
14
  const { values } = parseArgs({
12
15
  options: { port: { type: 'string', default: '6006' } },
@@ -87,59 +90,6 @@ async function fetchWithRetry<T>(url: string, maxAttempts = 3): Promise<T> {
87
90
  throw new Error('unreachable');
88
91
  }
89
92
 
90
- function merge(componentsJson: ComponentsManifest, indexJson: IndexJson) {
91
- const entries = indexJson.entries ?? {};
92
-
93
- const storysByComponent = new Map<string, IndexEntry[]>();
94
- const docsByComponent = new Map<string, IndexEntry>();
95
-
96
- for (const entry of Object.values(entries)) {
97
- const componentId = entry.id.replace(/--.*$/, '');
98
-
99
- if (entry.type === 'docs') {
100
- docsByComponent.set(componentId, entry);
101
- } else {
102
- if (!storysByComponent.has(componentId)) storysByComponent.set(componentId, []);
103
- storysByComponent.get(componentId)!.push(entry);
104
- }
105
- }
106
-
107
- const components = Object.values(componentsJson.components);
108
- return components.map((component) => {
109
- const indexStories = storysByComponent.get(component.id) ?? [];
110
- const docsEntry = docsByComponent.get(component.id);
111
-
112
- const firstStory = indexStories[0];
113
- const merged: Record<string, unknown> = { ...component };
114
-
115
- if (firstStory) {
116
- merged.componentPath = firstStory.componentPath;
117
- merged.title = firstStory.title;
118
- merged.tags = firstStory.tags;
119
- }
120
-
121
- if (component.stories) {
122
- merged.stories = component.stories.map((story) => {
123
- const match = indexStories.find((s) => s.name === story.name);
124
- if (!match) return story;
125
- return {
126
- ...story,
127
- id: match.id,
128
- exportName: match.exportName,
129
- type: match.type,
130
- subtype: match.subtype,
131
- };
132
- });
133
- }
134
-
135
- if (docsEntry) {
136
- merged.docs = docsEntry;
137
- }
138
-
139
- return merged;
140
- });
141
- }
142
-
143
93
  await checkStorybookRunning(PORT);
144
94
 
145
95
  const [componentsJson, indexJson] = await Promise.all([
@@ -147,14 +97,24 @@ const [componentsJson, indexJson] = await Promise.all([
147
97
  fetchWithRetry<IndexJson>(`http://localhost:${PORT}/index.json`),
148
98
  ]);
149
99
 
150
- const merged = merge(componentsJson, indexJson);
100
+ const project = createProject(TSCONFIG_PATH);
101
+ const componentPaths = Object.values(componentsJson.components).map((c) =>
102
+ c.path.replace(/\.stories\.(tsx?|jsx?)$/, '.$1'),
103
+ );
104
+ const parsedProps = parseManifestComponents(project, componentPaths, PROJECT_ROOT);
105
+
106
+ const payload = {
107
+ index: indexJson,
108
+ manifest: componentsJson,
109
+ props: parsedProps,
110
+ };
151
111
 
152
- const json = `${JSON.stringify(merged, null, 2)}\n`;
112
+ const json = `${JSON.stringify(payload, null, 2)}\n`;
153
113
 
154
114
  mkdirSync(OUTPUT_DIR, { recursive: true });
155
115
  writeFileSync(OUTPUT_FILE, json);
156
116
 
157
- console.log(`Wrote ${merged.length} components to ${OUTPUT_FILE}`);
117
+ console.log(`Wrote ${Object.keys(componentsJson.components).length} components (${parsedProps.length} parsed) to ${OUTPUT_FILE}`);
158
118
 
159
119
  const artifactUrl = await uploadToArtifactPath(json, process.env, { fetch });
160
120
  if (artifactUrl) {
package/package.json CHANGED
@@ -19,13 +19,13 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "debug": "^4.4.1",
22
- "@auto-engineer/file-upload": "1.103.0",
23
- "@auto-engineer/message-bus": "1.103.0"
22
+ "@auto-engineer/file-upload": "1.104.0",
23
+ "@auto-engineer/message-bus": "1.104.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/debug": "^4.1.12"
27
27
  },
28
- "version": "1.103.0",
28
+ "version": "1.104.0",
29
29
  "scripts": {
30
30
  "build": "tsc && tsx ../../scripts/fix-esm-imports.ts && cp -r starter dist/",
31
31
  "test-cli": "tsx test-cli.ts",