create-octane-xplat 0.18.0 → 0.20.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.
Files changed (77) hide show
  1. package/README.md +2 -144
  2. package/compatibility.json +97 -19
  3. package/compatibility.ts +141 -72
  4. package/dist/compatibility.js +66 -26
  5. package/dist/index.js +127 -64
  6. package/dist/package-manager.js +62 -0
  7. package/dist/scaffold.js +377 -127
  8. package/index.ts +256 -154
  9. package/library-template/AGENTS.md +6 -4
  10. package/library-template/README.md +22 -18
  11. package/library-template/bunfig +4 -0
  12. package/library-template/package.json +115 -18
  13. package/library-template/patches/@nativescript-community__octane@0.2.5.patch +1018 -0
  14. package/library-template/patches/@nativescript-community__sqlite-bridge@4.1.1.patch +30 -0
  15. package/library-template/patches/@nativescript-community__vite-octane@0.2.1.patch +72 -0
  16. package/library-template/patches/@nativescript__core@9.1.3.patch +1280 -0
  17. package/library-template/patches/@nativescript__doctor@2.0.18.patch +13 -0
  18. package/library-template/patches/@nativescript__vite@8.0.20.patch +2019 -0
  19. package/library-template/patches/@octane-xplat__nativescript-mason-core@1.0.0-beta.7.patch +65 -0
  20. package/library-template/patches/@octanejs__tiptap@0.0.62.patch +12 -0
  21. package/library-template/patches/@sveltejs__acorn-typescript@1.0.13.patch +16 -0
  22. package/library-template/patches/css@3.0.0.patch +52 -0
  23. package/library-template/patches/octane@0.16.3.patch +1479 -0
  24. package/library-template/src/Badge.tsx +7 -6
  25. package/library-template/src/Badge.web.tsx +7 -6
  26. package/library-template/src/Welcome.stories.tsx +12 -0
  27. package/library-template/src/normalizeBadgeLabel.ts +1 -1
  28. package/library-template/src/props.ts +11 -11
  29. package/library-template/tests/normalizeBadgeLabel.test.ts +1 -1
  30. package/library-template/tests/packed-consumer.mjs +140 -123
  31. package/library-template/tsconfig.envs.json +1 -0
  32. package/library-template/tsconfig.json +1 -0
  33. package/library-template/tsconfig.types.json +15 -1
  34. package/library-template/tsrx-typegen.json +1 -1
  35. package/library-template/workshop.config.ts +3 -0
  36. package/package-manager.ts +93 -0
  37. package/package.json +70 -58
  38. package/scaffold.ts +1056 -526
  39. package/template/.agents/skills/xplat/SKILL.md +6 -6
  40. package/template/.agents/skills/xplat/references/components.md +1 -1
  41. package/template/.agents/skills/xplat/references/navigation.md +1 -1
  42. package/template/.agents/skills/xplat/references/styling.md +14 -14
  43. package/template/AGENTS.md +10 -10
  44. package/template/bunfig +4 -0
  45. package/template/gitignore +1 -0
  46. package/template/nativescript.config.ts +13 -16
  47. package/template/package.json +119 -10
  48. package/template/patches/@nativescript-community__octane@0.2.5.patch +1018 -0
  49. package/template/patches/@nativescript-community__sqlite-bridge@4.1.1.patch +30 -0
  50. package/template/patches/@nativescript-community__vite-octane@0.2.1.patch +72 -0
  51. package/template/patches/@nativescript__core@9.1.3.patch +1280 -0
  52. package/template/patches/@nativescript__doctor@2.0.18.patch +13 -0
  53. package/template/patches/@nativescript__vite@8.0.20.patch +2019 -0
  54. package/template/patches/@octane-xplat__nativescript-mason-core@1.0.0-beta.7.patch +65 -0
  55. package/template/patches/@octanejs__tiptap@0.0.62.patch +12 -0
  56. package/template/patches/@sveltejs__acorn-typescript@1.0.13.patch +16 -0
  57. package/template/patches/css@3.0.0.patch +52 -0
  58. package/template/patches/octane@0.16.3.patch +1479 -0
  59. package/template/src/App.tsrx +77 -42
  60. package/template/src/Welcome.stories.tsx +22 -0
  61. package/template/src/app.spec.tsrx +169 -163
  62. package/template/src/app.web.test.tsx +18 -13
  63. package/template/src/failure-reporting.spec.ts +3 -3
  64. package/template/src/main.ts +14 -13
  65. package/template/src/main.tsrx +2 -0
  66. package/template/src/main.web.tsrx +5 -5
  67. package/template/src/native-runtime.spec.ts +13 -11
  68. package/template/src/test-setup.web.ts +9 -8
  69. package/template/src/test.ts +6 -6
  70. package/template/tsconfig.json +17 -1
  71. package/template/vite.config.native.mts +1 -2
  72. package/template/vite.config.ts +29 -23
  73. package/template/vitest.config.mts +18 -18
  74. package/template/vitest.web.config.mts +7 -7
  75. package/template/workshop.config.ts +3 -0
  76. package/library-template/pnpm-workspace.yaml +0 -171
  77. package/template/pnpm-workspace.yaml +0 -192
@@ -0,0 +1,30 @@
1
+ diff --git a/platforms/ios/NSSqliteBridge.xcframework/ios-arm64/Headers/module.modulemap b/platforms/ios/NSSqliteBridge.xcframework/ios-arm64/Headers/module.modulemap
2
+ deleted file mode 100644
3
+ index 5c114bd2d94ff8e574cb6c09f5df6a85345ce2b5..0000000000000000000000000000000000000000
4
+ --- a/platforms/ios/NSSqliteBridge.xcframework/ios-arm64/Headers/module.modulemap
5
+ +++ /dev/null
6
+ @@ -1,4 +0,0 @@
7
+ -module NSSqlite {
8
+ - header "NSSqliteBridge.h"
9
+ - export *
10
+ -}
11
+ diff --git a/platforms/ios/NSSqliteBridge.xcframework/ios-arm64_x86_64-maccatalyst/Headers/module.modulemap b/platforms/ios/NSSqliteBridge.xcframework/ios-arm64_x86_64-maccatalyst/Headers/module.modulemap
12
+ deleted file mode 100644
13
+ index 5c114bd2d94ff8e574cb6c09f5df6a85345ce2b5..0000000000000000000000000000000000000000
14
+ --- a/platforms/ios/NSSqliteBridge.xcframework/ios-arm64_x86_64-maccatalyst/Headers/module.modulemap
15
+ +++ /dev/null
16
+ @@ -1,4 +0,0 @@
17
+ -module NSSqlite {
18
+ - header "NSSqliteBridge.h"
19
+ - export *
20
+ -}
21
+ diff --git a/platforms/ios/NSSqliteBridge.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap b/platforms/ios/NSSqliteBridge.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap
22
+ deleted file mode 100644
23
+ index 5c114bd2d94ff8e574cb6c09f5df6a85345ce2b5..0000000000000000000000000000000000000000
24
+ --- a/platforms/ios/NSSqliteBridge.xcframework/ios-arm64_x86_64-simulator/Headers/module.modulemap
25
+ +++ /dev/null
26
+ @@ -1,4 +0,0 @@
27
+ -module NSSqlite {
28
+ - header "NSSqliteBridge.h"
29
+ - export *
30
+ -}
@@ -0,0 +1,72 @@
1
+ diff --git a/dist/server/strategy.js b/dist/server/strategy.js
2
+ index 7d84b37e2ed3a026da5b31c8a11027e0580877b2..1943f7c05e47d95950212789f84d5b7725da9ac9 100644
3
+ --- a/dist/server/strategy.js
4
+ +++ b/dist/server/strategy.js
5
+ @@ -14,17 +14,26 @@ import { purgeTransformCachesForHotUpdate, runHotUpdatePrologue, typescriptServe
6
+ * otherwise the re-fetch can be served from the previous save's transform and
7
+ * the screen ends up one save behind.
8
+ */
9
+ -const SCRIPT_FILE_RE = /\.(?:[mc]?[jt]sx?)$/i;
10
+ +// `.tsrx` is Octane's component extension — without it the deferred delta is
11
+ +// never emitted and component edits silently never reach the device.
12
+ +const SCRIPT_FILE_RE = /\.(?:[mc]?[jt]sx?|tsrx)$/i;
13
+ export const octaneServerStrategy = {
14
+ ...typescriptServerStrategy,
15
+ flavor: 'octane',
16
+ + matchesFile(id) {
17
+ + // Shared sources have workspace/@fs identities rather than /src IDs.
18
+ + // Source-root gating remains in runHotUpdatePrologue; dependency and
19
+ + // type/test files must not enter executable transaction batches.
20
+ + const clean = id.replace(/[?#].*$/, '');
21
+ + return SCRIPT_FILE_RE.test(clean) && !/(?:^|\/)(?:node_modules|__tests__|__mocks__)(?:\/|$)|\.(?:spec|test)\.[^/]+$|\.d\.(?:ts|mts|cts)$/i.test(clean);
22
+ + },
23
+ deferDeltaBroadcast: true,
24
+ async handleHotUpdate(ctx, deps) {
25
+ const state = await runHotUpdatePrologue(ctx, deps);
26
+ if (!state)
27
+ return;
28
+ const { root, metrics, emitSummary } = state;
29
+ - const { moduleGraph, verbose, sharedTransformRequest } = deps;
30
+ + const { moduleGraph, verbose, sharedTransformRequest, wss, isSocketClientOpen } = deps;
31
+ const { file, server } = ctx;
32
+ if (!SCRIPT_FILE_RE.test(file)) {
33
+ emitSummary();
34
+ @@ -37,9 +46,9 @@ export const octaneServerStrategy = {
35
+ .normalize(path.relative(root, file))
36
+ .split(path.sep)
37
+ .join('/');
38
+ - const normalizedId = moduleGraph.normalizeGraphId(rel);
39
+ + const normalizedId = moduleGraph.normalizeGraphId(file);
40
+ if (!moduleGraph.get(normalizedId)) {
41
+ - moduleGraph.upsert(rel, `/* octane-hmr ${Date.now()} */`, [], {
42
+ + moduleGraph.upsert(normalizedId, `/* octane-hmr ${Date.now()} */`, [], {
43
+ emitDeltaOnInsert: true,
44
+ });
45
+ }
46
+ @@ -51,7 +60,8 @@ export const octaneServerStrategy = {
47
+ label: 'octane',
48
+ });
49
+ try {
50
+ - const fresh = await sharedTransformRequest(rel, 30000);
51
+ + const transformId = path.relative(root, file).startsWith('..' + path.sep) ? '/@fs/' + file.replace(/\\/g, '/') : rel;
52
+ + const fresh = await sharedTransformRequest(transformId, 30000);
53
+ if (fresh?.code) {
54
+ const viteModule = server.moduleGraph.getModuleById(file);
55
+ const deps = viteModule
56
+ @@ -71,6 +81,16 @@ export const octaneServerStrategy = {
57
+ const gm = moduleGraph.get(normalizedId);
58
+ if (gm)
59
+ moduleGraph.emitDelta([gm], []);
60
+ + // The ns:hmr-delta broadcast IS the update delivery for this flavor —
61
+ + // count open sockets so the always-on summary reflects reality
62
+ + // instead of reporting recipients=0 for a delivered update.
63
+ + try {
64
+ + wss?.clients?.forEach((client) => {
65
+ + if (isSocketClientOpen?.(client))
66
+ + metrics.recipients += 1;
67
+ + });
68
+ + }
69
+ + catch { }
70
+ }
71
+ catch (e) {
72
+ if (verbose)