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,65 @@
1
+ diff --git a/common.js b/common.js
2
+ --- a/common.js
3
+ +++ b/common.js
4
+ @@ -1020,6 +1020,39 @@
5
+ get _masonPlacedNatively() {
6
+ return __APPLE__ && !!this[isMasonView_] && !!this.parent?.[isMasonView_];
7
+ }
8
+ + // Refresh nested roots before the outer Rust compute takes the shared lock.
9
+ + // Otherwise core can reuse the foreign host's previous exact frame as its
10
+ + // intrinsic minimum, preventing a grid/flex ancestor from shrinking.
11
+ + _masonWarmForeignRoots() {
12
+ + if (!__APPLE__) return;
13
+ + for (let ancestor = this.parent; ancestor; ancestor = ancestor.parent) {
14
+ + if (ancestor[isMasonView_]) return;
15
+ + }
16
+ + const native = this.nativeViewProtected;
17
+ + const mason = native?.mason ?? native?.node?.mason;
18
+ + if (typeof mason?.invalidateForeignView !== 'function') return;
19
+ + const containsMason = (view) => {
20
+ + let found = false;
21
+ + view.eachChildView?.((child) => {
22
+ + found = !!child[isMasonView_] || containsMason(child);
23
+ + return !found;
24
+ + });
25
+ + return found;
26
+ + };
27
+ + const visit = (parent) => parent.eachChildView?.((child) => {
28
+ + if (child[isMasonView_]) {
29
+ + visit(child);
30
+ + } else if (child.nativeViewProtected && containsMason(child)) {
31
+ + // Settle the deepest independent roots first. Both axes must
32
+ + // be unconstrained: a previous width can also preserve height.
33
+ + visit(child);
34
+ + child.measure(0, 0);
35
+ + mason.invalidateForeignView(child.nativeViewProtected);
36
+ + }
37
+ + return true;
38
+ + });
39
+ + visit(this);
40
+ + }
41
+ /** Size a non-Mason child with core's measure: its native view rarely implements sizeThatFits. */
42
+ _masonMeasureForeign(child) {
43
+ if (!__APPLE__ || child[isMasonView_] || !child.nativeViewProtected)
44
+ diff --git a/scroll/index.ios.js b/scroll/index.ios.js
45
+ --- a/scroll/index.ios.js
46
+ +++ b/scroll/index.ios.js
47
+ @@ -50,6 +50,7 @@
48
+ onMeasure(widthMeasureSpec, heightMeasureSpec) {
49
+ const nativeView = this._view;
50
+ if (nativeView) {
51
+ + if (this.parent && !this.parent[isMasonView_]) this._masonWarmForeignRoots();
52
+ // As a root, the box is the viewport: clamped to the specs so the content overflows it and scrolls.
53
+ // @ts-ignore
54
+ setMeasuredFromNative(this, nativeView.mason_measure(widthMeasureSpec, heightMeasureSpec, !!this.parent && !this.parent[isMasonView_], true));
55
+ diff --git a/view/index.ios.js b/view/index.ios.js
56
+ --- a/view/index.ios.js
57
+ +++ b/view/index.ios.js
58
+ @@ -56,6 +56,7 @@
59
+ const root = !this.parent?.[isMasonView_];
60
+ if (root && pendingAddHosts > 0)
61
+ flushNativeAddsDeep(this);
62
+ + if (root) this._masonWarmForeignRoots();
63
+ // One native call computes a root for the host's specs, or reads a child's placed box.
64
+ // @ts-ignore
65
+ setMeasuredFromNative(this, nativeView.mason_measure(widthMeasureSpec, heightMeasureSpec, root, false));
@@ -0,0 +1,12 @@
1
+ diff --git a/src/useEditor.ts b/src/useEditor.ts
2
+ index c30a55e..f550fce 100644
3
+ --- a/src/useEditor.ts
4
+ +++ b/src/useEditor.ts
5
+ @@ -7,6 +7,7 @@ import { useEditorState, type UseEditorStateOptions } from './useEditorState';
6
+ type DependencyList = readonly unknown[];
7
+ type MutableRefObject<T> = { current: T };
8
+
9
+ +declare const process: { env: { NODE_ENV?: string } };
10
+ const isDev = process.env.NODE_ENV !== 'production';
11
+ const isSSR = typeof window === 'undefined';
12
+ const isNext = isSSR || Boolean(typeof window !== 'undefined' && (window as any).next);
@@ -0,0 +1,16 @@
1
+ diff --git a/index.js b/index.js
2
+ index b1ec4ee..2f3a9c1 100644
3
+ --- a/index.js
4
+ +++ b/index.js
5
+ @@ -2563,10 +2563,10 @@
6
+ // Note: In TypeScript implementation we must provide `yieldContext` and `awaitContext`,
7
+ // but here it's always false, because this is only used for types.
8
+ tsFillSignature(returnToken, signature) {
9
+ const returnTokenRequired = returnToken === tt.arrow;
10
+ const paramsKey = "parameters";
11
+ const returnTypeKey = "typeAnnotation";
12
+ - signature.typeParameters = this.tsTryParseTypeParameters();
13
+ + signature.typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
14
+ this.expect(tt.parenL);
15
+ signature[paramsKey] = this.tsParseBindingListForSignature();
16
+ if (returnTokenRequired) {
@@ -0,0 +1,52 @@
1
+ diff --git a/lib/parse/index.js b/lib/parse/index.js
2
+ index 053f059..ec14409 100644
3
+ --- a/lib/parse/index.js
4
+ +++ b/lib/parse/index.js
5
+ @@ -390,6 +390,39 @@ module.exports = function(css, options){
6
+ }
7
+
8
+
9
+ + /**
10
+ + * Parse layer — block form `@layer name { rules }` (anonymous when the name
11
+ + * is empty) and statement form `@layer a, b;` (declares order only).
12
+ + */
13
+ +
14
+ + function atlayer() {
15
+ + var pos = position();
16
+ + var m = match(/^@layer\s*([^{;]*)/);
17
+ +
18
+ + if (!m) return;
19
+ +
20
+ + var name = trim(m[1]);
21
+ +
22
+ + if (match(/^;/)) {
23
+ + return pos({
24
+ + type: 'layer',
25
+ + layer: name
26
+ + });
27
+ + }
28
+ +
29
+ + if (!open()) return error("@layer missing '{'");
30
+ +
31
+ + var style = comments().concat(rules());
32
+ +
33
+ + if (!close()) return error("@layer missing '}'");
34
+ +
35
+ + return pos({
36
+ + type: 'layer',
37
+ + layer: name,
38
+ + rules: style
39
+ + });
40
+ + }
41
+ +
42
+ /**
43
+ * Parse custom-media.
44
+ */
45
+ @@ -533,6 +566,7 @@ module.exports = function(css, options){
46
+
47
+ return atkeyframes()
48
+ || atmedia()
49
+ + || atlayer()
50
+ || atcustommedia()
51
+ || atsupports()
52
+ || atimport()