@codeyam/codeyam-cli 0.1.26 → 0.1.28

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 (30) hide show
  1. package/analyzer-template/.build-info.json +6 -6
  2. package/analyzer-template/log.txt +3 -3
  3. package/codeyam-cli/src/commands/__tests__/editor.statePersistence.test.js +55 -0
  4. package/codeyam-cli/src/commands/__tests__/editor.statePersistence.test.js.map +1 -0
  5. package/codeyam-cli/src/commands/editor.js +49 -0
  6. package/codeyam-cli/src/commands/editor.js.map +1 -1
  7. package/codeyam-cli/src/data/techStacks.js +1 -1
  8. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js +120 -0
  9. package/codeyam-cli/src/utils/__tests__/editorScenarioSwitch.test.js.map +1 -1
  10. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js +84 -0
  11. package/codeyam-cli/src/utils/__tests__/editorSeedAdapter.test.js.map +1 -1
  12. package/codeyam-cli/src/utils/editorScenarioSwitch.js +27 -12
  13. package/codeyam-cli/src/utils/editorScenarioSwitch.js.map +1 -1
  14. package/codeyam-cli/src/utils/editorSeedAdapter.js +27 -14
  15. package/codeyam-cli/src/utils/editorSeedAdapter.js.map +1 -1
  16. package/codeyam-cli/src/webserver/build/server/assets/{analysisRunner-B6HnVI5u.js → analysisRunner-OLsM110H.js} +1 -1
  17. package/codeyam-cli/src/webserver/build/server/assets/{index-rV_xLS1u.js → index-WHdB6WTN.js} +1 -1
  18. package/codeyam-cli/src/webserver/build/server/assets/{init-BdWDvetv.js → init-DbSiZoE6.js} +1 -1
  19. package/codeyam-cli/src/webserver/build/server/assets/{server-build-B_jdq5dT.js → server-build-DZbLY6O_.js} +97 -96
  20. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  21. package/codeyam-cli/src/webserver/build-info.json +5 -5
  22. package/codeyam-cli/templates/expo-react-native/MOBILE_SETUP.md +85 -0
  23. package/codeyam-cli/templates/expo-react-native/app/_layout.tsx +4 -2
  24. package/codeyam-cli/templates/expo-react-native/app.json +11 -0
  25. package/codeyam-cli/templates/expo-react-native/babel.config.js +1 -0
  26. package/codeyam-cli/templates/expo-react-native/gitignore +2 -0
  27. package/codeyam-cli/templates/expo-react-native/package.json +24 -18
  28. package/codeyam-cli/templates/expo-react-native/patches/expo-modules-autolinking+3.0.24.patch +29 -0
  29. package/codeyam-cli/templates/seed-adapters/supabase.ts +91 -8
  30. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  {
2
- "buildTimestamp": "2026-03-27T20:00:52.922Z",
3
- "buildTime": 1774641652922,
4
- "gitCommit": "2a3a412834b1cc8d46883263d3695bd29b8157dc",
2
+ "buildTimestamp": "2026-03-29T19:24:12.319Z",
3
+ "buildTime": 1774812252319,
4
+ "gitCommit": "6a7242fb2a5daa247023edfc8a3a5841b2de974c",
5
5
  "nodeVersion": "v20.20.1",
6
6
  "contentHash": "c92230c027acb71cab56d2a696876a6a52206bfadd59fbc31a512b00a7ee8826",
7
- "buildNumber": 1262,
8
- "semanticVersion": "0.1.1262",
9
- "version": "0.1.1262 (2026-03-27T20:00+c92230c)"
7
+ "buildNumber": 1276,
8
+ "semanticVersion": "0.1.1276",
9
+ "version": "0.1.1276 (2026-03-29T19:24+c92230c)"
10
10
  }
@@ -1,7 +1,7 @@
1
1
 
2
- [3/27/2026, 8:00:52 PM] > codeyam-combo@1.0.0 mergeDependencies
3
- [3/27/2026, 8:00:52 PM] > node ./scripts/mergePackageJsonFiles.cjs
2
+ [3/29/2026, 7:24:12 PM] > codeyam-combo@1.0.0 mergeDependencies
3
+ [3/29/2026, 7:24:12 PM] > node ./scripts/mergePackageJsonFiles.cjs
4
4
 
5
5
 
6
- [3/27/2026, 8:00:52 PM] Merged dependencies into root package.json
6
+ [3/29/2026, 7:24:12 PM] Merged dependencies into root package.json
7
7
 
@@ -0,0 +1,55 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ /**
4
+ * Structural test: every writeState() call in editor.ts must preserve
5
+ * `techStackId` and `appFormats` from the previous state.
6
+ *
7
+ * Bug: Steps 4-18 dropped techStackId from writeState calls, causing
8
+ * getTechStackContext() to fall back to Next.js defaults. This broke
9
+ * `codeyam editor isolate` for Expo projects — it created Next.js-style
10
+ * subdirectories instead of Expo flat files.
11
+ */
12
+ describe('editor state persistence', () => {
13
+ const editorSource = fs.readFileSync(path.join(__dirname, '..', 'editor.ts'), 'utf8');
14
+ // Find all writeState blocks in the source.
15
+ // Each writeState call spans multiple lines like:
16
+ // writeState(root, {
17
+ // feature,
18
+ // step: N,
19
+ // ...
20
+ // });
21
+ const writeStateBlocks = [];
22
+ const lines = editorSource.split('\n');
23
+ for (let i = 0; i < lines.length; i++) {
24
+ if (lines[i].includes('writeState(root,')) {
25
+ // Collect lines until we find the closing `});`
26
+ let block = '';
27
+ for (let j = i; j < lines.length; j++) {
28
+ block += lines[j] + '\n';
29
+ if (lines[j].match(/^\s*\}\);/))
30
+ break;
31
+ }
32
+ writeStateBlocks.push({ lineNumber: i + 1, block });
33
+ }
34
+ }
35
+ it('should find writeState calls in editor.ts', () => {
36
+ expect(writeStateBlocks.length).toBeGreaterThan(10);
37
+ });
38
+ // Filter to only writeState blocks that set a step number (printStep functions).
39
+ // Exclude the handleTemplate/migration-survey writeState that sets step: 0.
40
+ const stepWriteStates = writeStateBlocks.filter(({ block }) => block.match(/step:\s*\d+/) && !block.match(/step:\s*0/));
41
+ it('should find step writeState calls', () => {
42
+ expect(stepWriteStates.length).toBeGreaterThanOrEqual(18);
43
+ });
44
+ for (const { lineNumber, block } of stepWriteStates) {
45
+ const stepMatch = block.match(/step:\s*(\d+)/);
46
+ const stepNum = stepMatch ? stepMatch[1] : '?';
47
+ it(`step ${stepNum} writeState (line ${lineNumber}) should preserve techStackId`, () => {
48
+ expect(block).toContain('techStackId');
49
+ });
50
+ it(`step ${stepNum} writeState (line ${lineNumber}) should preserve appFormats`, () => {
51
+ expect(block).toContain('appFormats');
52
+ });
53
+ }
54
+ });
55
+ //# sourceMappingURL=editor.statePersistence.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.statePersistence.test.js","sourceRoot":"","sources":["../../../../../src/commands/__tests__/editor.statePersistence.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;;;;;GAQG;AACH,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,MAAM,YAAY,GAAG,EAAE,CAAC,YAAY,CAClC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,CAAC,EACvC,MAAM,CACP,CAAC;IAEF,4CAA4C;IAC5C,kDAAkD;IAClD,uBAAuB;IACvB,eAAe;IACf,eAAe;IACf,UAAU;IACV,QAAQ;IACR,MAAM,gBAAgB,GAA4C,EAAE,CAAC;IACrE,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAAC;YAC1C,gDAAgD;YAChD,IAAI,KAAK,GAAG,EAAE,CAAC;YACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACtC,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;gBACzB,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC;oBAAE,MAAM;YACzC,CAAC;YACD,gBAAgB,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;IAED,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;IAEH,iFAAiF;IACjF,4EAA4E;IAC5E,MAAM,eAAe,GAAG,gBAAgB,CAAC,MAAM,CAC7C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CACvE,CAAC;IAEF,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;QAC3C,MAAM,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,sBAAsB,CAAC,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,KAAK,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,eAAe,EAAE,CAAC;QACpD,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAE/C,EAAE,CAAC,QAAQ,OAAO,qBAAqB,UAAU,+BAA+B,EAAE,GAAG,EAAE;YACrF,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,QAAQ,OAAO,qBAAqB,UAAU,8BAA8B,EAAE,GAAG,EAAE;YACpF,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1085,6 +1085,21 @@ function printStep2(root, feature) {
1085
1085
  console.log();
1086
1086
  console.log(chalk.dim(' Read MOBILE_SETUP.md for data storage, navigation, and testing patterns.'));
1087
1087
  console.log();
1088
+ checkbox('Ask the user what to name the app (use AskUserQuestion), then update app.json');
1089
+ console.log(chalk.dim(' Update name, slug, scheme, ios.bundleIdentifier (com.codeyam.<slug>), and android.package'));
1090
+ console.log(chalk.dim(' Also set the projectTitle via: curl -s -X POST http://localhost:' +
1091
+ port +
1092
+ '/api/editor-project-info -H "Content-Type: application/json" -d \'{"projectTitle":"<name>"}\''));
1093
+ console.log();
1094
+ checkbox('Generate an app icon using `sharp`');
1095
+ console.log(chalk.dim(' Create `scripts/generate-icon.mjs` and `mkdir -p assets`'));
1096
+ console.log(chalk.yellow(' ICON DESIGN GOAL: The icon must look distinctive on a home screen full of other app icons.'));
1097
+ console.log(chalk.yellow(' Use multiple bold colors from the design system and complex, overlapping shapes.'));
1098
+ console.log(chalk.yellow(' NO simple/minimal icons — no single glyph on a flat background, no plain text, no basic circles.'));
1099
+ console.log(chalk.yellow(' Make it colorful, layered, and dense. Use gradients, multiple contrasting fills, and depth.'));
1100
+ console.log(chalk.dim(' Use sharp to render SVG to 1024x1024 PNG. iOS: flatten onto background (no alpha channel).'));
1101
+ console.log(chalk.dim(' Generate: icon.png, adaptive-icon.png, favicon.png (48x48). Run `node scripts/generate-icon.mjs`'));
1102
+ console.log();
1088
1103
  }
1089
1104
  else if (ctx.isChromeExt) {
1090
1105
  // Chrome Extension: use chrome.storage
@@ -1219,6 +1234,10 @@ function printStep3(root, feature) {
1219
1234
  console.log(chalk.dim(' Bad: color: "#333", fontSize: 14, padding: 12'));
1220
1235
  console.log(chalk.dim(' Good: color: theme.colors.textPrimary, fontSize: theme.fontSize.sm, padding: theme.spacing.md'));
1221
1236
  console.log(chalk.dim(' Do NOT use CSS custom properties (var(--token)) — they do not work in React Native.'));
1237
+ checkbox('Buttons: put backgroundColor, borderRadius, borderStyle on a wrapping <View>, NOT on <Pressable>');
1238
+ console.log(chalk.dim(' Pressable renders these styles on web but FAILS SILENTLY on native devices.'));
1239
+ console.log(chalk.dim(' Use a <View> with overflow:"hidden" for the visual shell, <Pressable> inside for touch only.'));
1240
+ console.log(chalk.dim(' For press feedback: use onPressIn/onPressOut + useState to toggle opacity, not function-style style.'));
1222
1241
  }
1223
1242
  else {
1224
1243
  checkbox('Define ALL design tokens as CSS custom properties in globals.css — not just colors');
@@ -1259,6 +1278,8 @@ function printStep4(root, feature) {
1259
1278
  label: STEP_LABELS[4],
1260
1279
  startedAt: isResuming ? prevState.startedAt : now,
1261
1280
  featureStartedAt: prevState?.featureStartedAt || now,
1281
+ appFormats: prevState?.appFormats,
1282
+ techStackId: prevState?.techStackId,
1262
1283
  });
1263
1284
  logEvent(root, 'step', { step: 4, label: 'Verify Prototype', feature });
1264
1285
  stepHeader(4, 'Verify Prototype', feature);
@@ -1315,6 +1336,8 @@ function printStep5(root, feature) {
1315
1336
  label: STEP_LABELS[5],
1316
1337
  startedAt: isResuming ? prevState.startedAt : now,
1317
1338
  featureStartedAt: prevState?.featureStartedAt || now,
1339
+ appFormats: prevState?.appFormats,
1340
+ techStackId: prevState?.techStackId,
1318
1341
  });
1319
1342
  logEvent(root, 'step', { step: 5, label: 'Confirm', feature });
1320
1343
  stepHeader(5, 'Confirm', feature);
@@ -1374,6 +1397,8 @@ function printStep6(root, feature) {
1374
1397
  label: STEP_LABELS[6],
1375
1398
  startedAt: isResuming ? prevState.startedAt : now,
1376
1399
  featureStartedAt: prevState?.featureStartedAt || now,
1400
+ appFormats: prevState?.appFormats,
1401
+ techStackId: prevState?.techStackId,
1377
1402
  });
1378
1403
  logEvent(root, 'step', { step: 6, label: 'Deconstruct', feature });
1379
1404
  stepHeader(6, 'Deconstruct', feature);
@@ -1399,6 +1424,8 @@ function printStep7(root, feature) {
1399
1424
  label: STEP_LABELS[7],
1400
1425
  startedAt: isResuming ? prevState.startedAt : now,
1401
1426
  featureStartedAt: prevState?.featureStartedAt || now,
1427
+ appFormats: prevState?.appFormats,
1428
+ techStackId: prevState?.techStackId,
1402
1429
  });
1403
1430
  logEvent(root, 'step', { step: 7, label: 'Extract', feature });
1404
1431
  stepHeader(7, 'Extract', feature);
@@ -1457,6 +1484,8 @@ function printStep8(root, feature) {
1457
1484
  label: STEP_LABELS[8],
1458
1485
  startedAt: isResuming ? prevState.startedAt : now,
1459
1486
  featureStartedAt: prevState?.featureStartedAt || now,
1487
+ appFormats: prevState?.appFormats,
1488
+ techStackId: prevState?.techStackId,
1460
1489
  });
1461
1490
  logEvent(root, 'step', { step: 8, label: 'Glossary', feature });
1462
1491
  stepHeader(8, 'Glossary', feature);
@@ -1483,6 +1512,8 @@ function printStep9(root, feature) {
1483
1512
  label: STEP_LABELS[9],
1484
1513
  startedAt: isResuming ? prevState.startedAt : now,
1485
1514
  featureStartedAt: prevState?.featureStartedAt || now,
1515
+ appFormats: prevState?.appFormats,
1516
+ techStackId: prevState?.techStackId,
1486
1517
  });
1487
1518
  logEvent(root, 'step', { step: 9, label: 'Analyze', feature });
1488
1519
  stepHeader(9, 'Analyze and Verify', feature);
@@ -1533,6 +1564,8 @@ function printStep10(root, feature) {
1533
1564
  label: STEP_LABELS[10],
1534
1565
  startedAt: isResuming ? prevState.startedAt : now,
1535
1566
  featureStartedAt: prevState?.featureStartedAt || now,
1567
+ appFormats: prevState?.appFormats,
1568
+ techStackId: prevState?.techStackId,
1536
1569
  });
1537
1570
  logEvent(root, 'step', { step: 10, label: 'App Scenarios', feature });
1538
1571
  stepHeader(10, 'App Scenarios', feature);
@@ -1597,6 +1630,8 @@ function printStep11(root, feature) {
1597
1630
  label: STEP_LABELS[11],
1598
1631
  startedAt: isResuming ? prevState.startedAt : now,
1599
1632
  featureStartedAt: prevState?.featureStartedAt || now,
1633
+ appFormats: prevState?.appFormats,
1634
+ techStackId: prevState?.techStackId,
1600
1635
  });
1601
1636
  logEvent(root, 'step', { step: 11, label: 'User Scenarios', feature });
1602
1637
  stepHeader(11, 'User Scenarios', feature);
@@ -1643,6 +1678,8 @@ function printStep12(root, feature) {
1643
1678
  label: STEP_LABELS[12],
1644
1679
  startedAt: isResuming ? prevState.startedAt : now,
1645
1680
  featureStartedAt: prevState?.featureStartedAt || now,
1681
+ appFormats: prevState?.appFormats,
1682
+ techStackId: prevState?.techStackId,
1646
1683
  });
1647
1684
  logEvent(root, 'step', { step: 12, label: 'Verify', feature });
1648
1685
  stepHeader(12, 'Verify', feature);
@@ -1689,6 +1726,8 @@ function printStep13(root, feature) {
1689
1726
  label: STEP_LABELS[13],
1690
1727
  startedAt: isResuming ? prevState.startedAt : now,
1691
1728
  featureStartedAt: prevState?.featureStartedAt || now,
1729
+ appFormats: prevState?.appFormats,
1730
+ techStackId: prevState?.techStackId,
1692
1731
  });
1693
1732
  logEvent(root, 'step', { step: 13, label: 'Journal', feature });
1694
1733
  stepHeader(13, 'Journal', feature);
@@ -1722,6 +1761,8 @@ function printStep14(root, feature) {
1722
1761
  label: STEP_LABELS[14],
1723
1762
  startedAt: isResuming ? prevState.startedAt : now,
1724
1763
  featureStartedAt: prevState?.featureStartedAt || now,
1764
+ appFormats: prevState?.appFormats,
1765
+ techStackId: prevState?.techStackId,
1725
1766
  });
1726
1767
  logEvent(root, 'step', { step: 14, label: 'Review', feature });
1727
1768
  stepHeader(14, 'Review', feature);
@@ -1755,6 +1796,8 @@ function printStep15(root, feature) {
1755
1796
  label: STEP_LABELS[15],
1756
1797
  startedAt: isResuming ? prevState.startedAt : now,
1757
1798
  featureStartedAt: prevState?.featureStartedAt || now,
1799
+ appFormats: prevState?.appFormats,
1800
+ techStackId: prevState?.techStackId,
1758
1801
  });
1759
1802
  logEvent(root, 'step', { step: 15, label: 'Present', feature });
1760
1803
  stepHeader(15, 'Present', feature);
@@ -2404,6 +2447,8 @@ function printStep16(root, feature) {
2404
2447
  label: STEP_LABELS[16],
2405
2448
  startedAt: isResuming ? prevState.startedAt : now,
2406
2449
  featureStartedAt: prevState?.featureStartedAt || now,
2450
+ appFormats: prevState?.appFormats,
2451
+ techStackId: prevState?.techStackId,
2407
2452
  });
2408
2453
  logEvent(root, 'step', { step: 16, label: 'Commit', feature });
2409
2454
  stepHeader(16, 'Commit', feature);
@@ -2430,6 +2475,8 @@ function printStep17(root, feature) {
2430
2475
  label: STEP_LABELS[17],
2431
2476
  startedAt: isResuming ? prevState.startedAt : now,
2432
2477
  featureStartedAt: prevState?.featureStartedAt || now,
2478
+ appFormats: prevState?.appFormats,
2479
+ techStackId: prevState?.techStackId,
2433
2480
  });
2434
2481
  logEvent(root, 'step', { step: 17, label: 'Finalize', feature });
2435
2482
  stepHeader(17, 'Finalize', feature);
@@ -2455,6 +2502,8 @@ function printStep18(root, feature) {
2455
2502
  label: STEP_LABELS[18],
2456
2503
  startedAt: isResuming ? prevState.startedAt : now,
2457
2504
  featureStartedAt: prevState?.featureStartedAt || now,
2505
+ appFormats: prevState?.appFormats,
2506
+ techStackId: prevState?.techStackId,
2458
2507
  });
2459
2508
  logEvent(root, 'step', { step: 18, label: 'Push', feature });
2460
2509
  stepHeader(18, 'Push', feature);