codingpixel-expo-app 0.1.3 → 0.1.5

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/dist/index.js CHANGED
@@ -22,6 +22,7 @@ import { buildLayoutReplacements } from "./fonts.js";
22
22
  import { ensureLockfile, installNativeDeps } from "./install.js";
23
23
  import { log } from "./util.js";
24
24
  import { readSDKNotes } from "./sdkNotes.js";
25
+ import { SDK_PROBE_RESULTS } from "./sdkProbeResults.js";
25
26
  const __filename = fileURLToPath(import.meta.url);
26
27
  const __dirname = path.dirname(__filename);
27
28
  /**
@@ -33,7 +34,9 @@ function resolveTemplatesRoot() {
33
34
  return path.resolve(__dirname, "..", "templates");
34
35
  }
35
36
  /**
36
- * Locate `docs/SDK_NOTES.md`. Same layout assumption as `resolveTemplatesRoot`.
37
+ * Locate `docs/SDK_NOTES.md` for OPTIONAL out-of-tree dev runs (when the CLI
38
+ * is invoked from its own source tree with fresh probe results). Production
39
+ * runs from a published tarball read from `SDK_PROBE_RESULTS` instead.
37
40
  */
38
41
  function resolveSdkNotesPath() {
39
42
  return path.resolve(__dirname, "..", "docs", "SDK_NOTES.md");
@@ -69,15 +72,21 @@ async function main() {
69
72
  log.step("Splicing constants + layout sentinels …");
70
73
  patchConstants(target.dir, templatesRoot, answers);
71
74
  patchLayout(target.dir, buildLayoutReplacements(answers));
72
- // ---- Read SDK_NOTES.md probe outcomes ----
75
+ // ---- Resolve probe outcomes ----
76
+ // Primary: baked-in `SDK_PROBE_RESULTS` (always available; ships in dist/).
77
+ // Override: `docs/SDK_NOTES.md` if present in the CLI source tree (out-of-tree
78
+ // development scenarios where probe was just re-run against a newer SDK).
73
79
  const sdk = readSDKNotes(resolveSdkNotesPath());
74
- const flagsOk = sdk.get("FLAGS_OK") === "1";
75
- const probePass = sdk.get("PROBE_PASS") === "1";
76
- const workletsAutoIncluded = sdk.get("BABEL_PRESET_AUTO_INCLUDES_WORKLETS") === "1";
77
- const workletsPkg = sdk.get("WORKLETS_PKG") === "react-native-worklets-core"
80
+ const get = (key, fallback) => sdk.get(key) ?? fallback;
81
+ const flagsOk = get("FLAGS_OK", SDK_PROBE_RESULTS.FLAGS_OK ? "1" : "0") === "1";
82
+ const probePass = get("PROBE_PASS", SDK_PROBE_RESULTS.PROBE_PASS ? "1" : "0") === "1";
83
+ const workletsAutoIncluded = get("BABEL_PRESET_AUTO_INCLUDES_WORKLETS", SDK_PROBE_RESULTS.BABEL_PRESET_AUTO_INCLUDES_WORKLETS ? "1" : "0") === "1";
84
+ const workletsPkg = get("WORKLETS_PKG", SDK_PROBE_RESULTS.WORKLETS_PKG) ===
85
+ "react-native-worklets-core"
78
86
  ? "react-native-worklets-core"
79
87
  : "react-native-worklets";
80
- const expoBaseUrlInherited = sdk.get("EXPO_TSCONFIG_BASEURL") !== "null";
88
+ const baseUrlNoteRaw = get("EXPO_TSCONFIG_BASEURL", SDK_PROBE_RESULTS.EXPO_TSCONFIG_BASEURL_INHERITED ? "." : "null");
89
+ const expoBaseUrlInherited = baseUrlNoteRaw !== "null";
81
90
  log.step("Patching package.json scripts + tsconfig + babel.config.js …");
82
91
  patchPackageJsonScripts(target.dir);
83
92
  patchTsconfig(target.dir, { expoBaseUrlInherited });
package/dist/install.js CHANGED
@@ -43,6 +43,16 @@ export function buildAlwaysInstalledList(workletsPkg) {
43
43
  // resolve 'expo-linking' from .../expo-router/build/views/Unmatched.js").
44
44
  "expo-linking",
45
45
  "expo-constants",
46
+ // Deviation #18 — react-native-mmkv 3.x+ peer deps + system-ui.
47
+ // mmkv was rewritten on Nitro Modules; without `react-native-nitro-modules`,
48
+ // gradle fails with "Project with path ':react-native-nitro-modules' could
49
+ // not be found in project ':react-native-mmkv'" and CocoaPods fails with
50
+ // "Unable to find a specification for `NitroModules` depended upon by `NitroMmkv`".
51
+ "react-native-nitro-modules",
52
+ // expo-system-ui is required by `expo prebuild` for `userInterfaceStyle`
53
+ // in app.json (default value "light"). Without it, prebuild warns:
54
+ // "Install expo-system-ui in your project to enable this feature."
55
+ "expo-system-ui",
46
56
  ];
47
57
  }
48
58
  export function buildConditionalDeps(answers) {
@@ -0,0 +1,28 @@
1
+ // Probe values captured during template authoring (run `scripts/run-probes.sh`
2
+ // to regenerate when bumping target SDK; then update this file by hand).
3
+ //
4
+ // These values are compiled into `dist/` so the CLI has them at runtime without
5
+ // depending on `docs/SDK_NOTES.md` being shipped in the npm tarball. Shipping
6
+ // the docs file was tried earlier and left two real bugs:
7
+ // 1. `BABEL_PRESET_AUTO_INCLUDES_WORKLETS` defaulted false → patchBabel
8
+ // added `react-native-worklets/plugin` even though babel-preset-expo
9
+ // already auto-includes it (double-load risk + duplicate-plugin warnings).
10
+ // 2. `EXPO_TSCONFIG_BASEURL` defaulted "inherited" → `baseUrl` never set
11
+ // → TS path resolution fragile.
12
+ //
13
+ // Constants here override `readSDKNotes` (which is now a fallback for
14
+ // out-of-tree development scenarios).
15
+ export const SDK_PROBE_RESULTS = {
16
+ /** Pinned by template-authoring date — bump alongside Expo SDK upgrades. */
17
+ EXPO_SDK_VERSION: "~54.0.33",
18
+ /** SDK 54+ `babel-preset-expo` auto-includes worklets/reanimated plugin. */
19
+ BABEL_PRESET_AUTO_INCLUDES_WORKLETS: true,
20
+ /** Canonical name per SDK 54 (vs the legacy `-core` variant). */
21
+ WORKLETS_PKG: "react-native-worklets",
22
+ /** SDK 54 `expo/tsconfig.base` does NOT provide `baseUrl` → patcher sets ".". */
23
+ EXPO_TSCONFIG_BASEURL_INHERITED: false,
24
+ /** SDK 54 `npx expo install --yarn`/`--npm` flags supported (Branch A). */
25
+ FLAGS_OK: true,
26
+ /** SDK 54 `expo install` materializes lockfile → no explicit PM install needed. */
27
+ PROBE_PASS: true,
28
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codingpixel-expo-app",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Opinionated Expo app scaffolder mirroring MyRoster conventions.",
5
5
  "type": "module",
6
6
  "bin": {