create-octane-xplat 0.1.0 → 0.4.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 (84) hide show
  1. package/README.md +25 -0
  2. package/index.mjs +20 -17
  3. package/package.json +2 -2
  4. package/template/.gitattributes +1 -0
  5. package/template/.oxlintrc.json +25 -0
  6. package/template/App_Resources/Android/app.gradle +25 -0
  7. package/template/App_Resources/Android/before-plugins.gradle +15 -0
  8. package/template/App_Resources/Android/src/main/AndroidManifest.xml +43 -0
  9. package/template/App_Resources/Android/src/main/res/drawable/ic_launcher_foreground.xml +15 -0
  10. package/template/App_Resources/Android/src/main/res/drawable-hdpi/background.png +0 -0
  11. package/template/App_Resources/Android/src/main/res/drawable-hdpi/logo.png +0 -0
  12. package/template/App_Resources/Android/src/main/res/drawable-ldpi/background.png +0 -0
  13. package/template/App_Resources/Android/src/main/res/drawable-ldpi/logo.png +0 -0
  14. package/template/App_Resources/Android/src/main/res/drawable-mdpi/background.png +0 -0
  15. package/template/App_Resources/Android/src/main/res/drawable-mdpi/logo.png +0 -0
  16. package/template/App_Resources/Android/src/main/res/drawable-nodpi/splash_screen.xml +8 -0
  17. package/template/App_Resources/Android/src/main/res/drawable-xhdpi/background.png +0 -0
  18. package/template/App_Resources/Android/src/main/res/drawable-xhdpi/logo.png +0 -0
  19. package/template/App_Resources/Android/src/main/res/drawable-xxhdpi/background.png +0 -0
  20. package/template/App_Resources/Android/src/main/res/drawable-xxhdpi/logo.png +0 -0
  21. package/template/App_Resources/Android/src/main/res/drawable-xxxhdpi/background.png +0 -0
  22. package/template/App_Resources/Android/src/main/res/drawable-xxxhdpi/logo.png +0 -0
  23. package/template/App_Resources/Android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
  24. package/template/App_Resources/Android/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  25. package/template/App_Resources/Android/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  26. package/template/App_Resources/Android/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  27. package/template/App_Resources/Android/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  28. package/template/App_Resources/Android/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  29. package/template/App_Resources/Android/src/main/res/values/colors.xml +14 -0
  30. package/template/App_Resources/Android/src/main/res/values/ic_launcher_background.xml +4 -0
  31. package/template/App_Resources/Android/src/main/res/values/styles.xml +42 -0
  32. package/template/App_Resources/Android/src/main/res/values-v21/colors.xml +5 -0
  33. package/template/App_Resources/Android/src/main/res/values-v21/styles.xml +34 -0
  34. package/template/App_Resources/Android/src/main/res/values-v29/styles.xml +18 -0
  35. package/template/App_Resources/Android/src/main/res/xml/network_security_config.xml +14 -0
  36. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/Contents.json +122 -0
  37. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-1024.png +0 -0
  38. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20.png +0 -0
  39. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@2x.png +0 -0
  40. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-20@3x.png +0 -0
  41. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29.png +0 -0
  42. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@2x.png +0 -0
  43. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-29@3x.png +0 -0
  44. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40.png +0 -0
  45. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@2x.png +0 -0
  46. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-40@3x.png +0 -0
  47. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@2x.png +0 -0
  48. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-60@3x.png +0 -0
  49. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76.png +0 -0
  50. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-76@2x.png +0 -0
  51. package/template/App_Resources/iOS/Assets.xcassets/AppIcon.appiconset/icon-83.5@2x.png +0 -0
  52. package/template/App_Resources/iOS/Assets.xcassets/Contents.json +6 -0
  53. package/template/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/Contents.json +23 -0
  54. package/template/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill.png +0 -0
  55. package/template/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@2x.png +0 -0
  56. package/template/App_Resources/iOS/Assets.xcassets/LaunchScreen.AspectFill.imageset/LaunchScreen-AspectFill@3x.png +0 -0
  57. package/template/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/Contents.json +23 -0
  58. package/template/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center.png +0 -0
  59. package/template/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@2x.png +0 -0
  60. package/template/App_Resources/iOS/Assets.xcassets/LaunchScreen.Center.imageset/LaunchScreen-Center@3x.png +0 -0
  61. package/template/App_Resources/iOS/Assets.xcassets/octane.imageset/Contents.json +8 -0
  62. package/template/App_Resources/iOS/Assets.xcassets/octane.imageset/octane.png +0 -0
  63. package/template/App_Resources/iOS/Assets.xcassets/octane.imageset/octane@2x.png +0 -0
  64. package/template/App_Resources/iOS/Assets.xcassets/octane.imageset/octane@3x.png +0 -0
  65. package/template/App_Resources/iOS/Info.plist +52 -0
  66. package/template/App_Resources/iOS/LaunchScreen.storyboard +53 -0
  67. package/template/App_Resources/iOS/build.xcconfig +7 -0
  68. package/template/App_Resources/iOS/src/OctaneShaders.metal +128 -0
  69. package/template/gitignore +2 -0
  70. package/template/index.html +9 -9
  71. package/template/nativescript.config.ts +13 -0
  72. package/template/package.json +40 -18
  73. package/template/patches/@nativescript-community__vite-octane@0.2.1.patch +41 -0
  74. package/template/patches/@nativescript__vite@8.0.11.patch +294 -0
  75. package/template/pnpm-workspace.yaml +25 -3
  76. package/template/references.d.ts +1 -0
  77. package/template/src/App.tsrx +5 -3
  78. package/template/src/index.native.ts +33 -0
  79. package/template/src/style.css +21 -0
  80. package/template/tsconfig.json +4 -2
  81. package/template/tsconfig.native.json +18 -0
  82. package/template/vite.config.native.mts +8 -0
  83. package/template/vite.config.ts +14 -7
  84. /package/template/src/{main.tsrx → main.web.tsrx} +0 -0
@@ -0,0 +1,23 @@
1
+ {
2
+ "images": [
3
+ {
4
+ "idiom": "universal",
5
+ "filename": "LaunchScreen-Center.png",
6
+ "scale": "1x"
7
+ },
8
+ {
9
+ "idiom": "universal",
10
+ "filename": "LaunchScreen-Center@2x.png",
11
+ "scale": "2x"
12
+ },
13
+ {
14
+ "idiom": "universal",
15
+ "filename": "LaunchScreen-Center@3x.png",
16
+ "scale": "3x"
17
+ }
18
+ ],
19
+ "info": {
20
+ "version": 1,
21
+ "author": "xcode"
22
+ }
23
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "images": [
3
+ { "filename": "octane.png", "idiom": "universal", "scale": "1x" },
4
+ { "filename": "octane@2x.png", "idiom": "universal", "scale": "2x" },
5
+ { "filename": "octane@3x.png", "idiom": "universal", "scale": "3x" }
6
+ ],
7
+ "info": { "author": "xcode", "version": 1 }
8
+ }
@@ -0,0 +1,52 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3
+ <plist version="1.0">
4
+ <dict>
5
+ <key>CFBundleDevelopmentRegion</key>
6
+ <string>en</string>
7
+ <key>CFBundleDisplayName</key>
8
+ <string>${PRODUCT_NAME}</string>
9
+ <key>CFBundleExecutable</key>
10
+ <string>${EXECUTABLE_NAME}</string>
11
+ <key>CFBundleInfoDictionaryVersion</key>
12
+ <string>6.0</string>
13
+ <key>CFBundleName</key>
14
+ <string>${PRODUCT_NAME}</string>
15
+ <key>CFBundlePackageType</key>
16
+ <string>APPL</string>
17
+ <key>CFBundleShortVersionString</key>
18
+ <string>1.0</string>
19
+ <key>CFBundleSignature</key>
20
+ <string>????</string>
21
+ <key>CFBundleVersion</key>
22
+ <string>1.0</string>
23
+ <key>LSRequiresIPhoneOS</key>
24
+ <true/>
25
+ <key>UILaunchStoryboardName</key>
26
+ <string>LaunchScreen</string>
27
+ <key>UIRequiresFullScreen</key>
28
+ <false/>
29
+ <key>UIApplicationSceneManifest</key>
30
+ <dict>
31
+ <key>UIApplicationSupportsMultipleScenes</key>
32
+ <true/>
33
+ </dict>
34
+ <key>UIRequiredDeviceCapabilities</key>
35
+ <array>
36
+ <string>armv7</string>
37
+ </array>
38
+ <key>UISupportedInterfaceOrientations</key>
39
+ <array>
40
+ <string>UIInterfaceOrientationPortrait</string>
41
+ <string>UIInterfaceOrientationLandscapeLeft</string>
42
+ <string>UIInterfaceOrientationLandscapeRight</string>
43
+ </array>
44
+ <key>UISupportedInterfaceOrientations~ipad</key>
45
+ <array>
46
+ <string>UIInterfaceOrientationPortrait</string>
47
+ <string>UIInterfaceOrientationPortraitUpsideDown</string>
48
+ <string>UIInterfaceOrientationLandscapeLeft</string>
49
+ <string>UIInterfaceOrientationLandscapeRight</string>
50
+ </array>
51
+ </dict>
52
+ </plist>
@@ -0,0 +1,53 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
3
+ <device id="retina5_9" orientation="portrait">
4
+ <adaptation id="fullscreen"/>
5
+ </device>
6
+ <dependencies>
7
+ <deployment identifier="iOS"/>
8
+ <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
9
+ <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10
+ </dependencies>
11
+ <scenes>
12
+ <!--View Controller-->
13
+ <scene sceneID="EHf-IW-A2E">
14
+ <objects>
15
+ <viewController id="01J-lp-oVM" sceneMemberID="viewController">
16
+ <layoutGuides>
17
+ <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
18
+ <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
19
+ </layoutGuides>
20
+ <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
21
+ <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
22
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
23
+ <subviews>
24
+ <imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchScreen.AspectFill" translatesAutoresizingMaskIntoConstraints="NO" id="wtH-rr-YfP">
25
+ <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
26
+ </imageView>
27
+ <imageView userInteractionEnabled="NO" contentMode="center" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="LaunchScreen.Center" translatesAutoresizingMaskIntoConstraints="NO" id="s1z-aa-wYv">
28
+ <rect key="frame" x="0.0" y="150" width="375" height="512"/>
29
+ </imageView>
30
+ </subviews>
31
+ <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
32
+ <constraints>
33
+ <constraint firstAttribute="trailing" secondItem="s1z-aa-wYv" secondAttribute="trailing" id="4Rf-kf-vql"/>
34
+ <constraint firstAttribute="bottom" secondItem="wtH-rr-YfP" secondAttribute="bottom" id="5CS-At-4ka"/>
35
+ <constraint firstItem="wtH-rr-YfP" firstAttribute="top" secondItem="Ze5-6b-2t3" secondAttribute="top" id="Awn-b8-xf1"/>
36
+ <constraint firstItem="s1z-aa-wYv" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="BpJ-vb-eKA"/>
37
+ <constraint firstItem="s1z-aa-wYv" firstAttribute="trailing" secondItem="wtH-rr-YfP" secondAttribute="trailing" id="QIM-7J-OZz"/>
38
+ <constraint firstAttribute="trailing" secondItem="wtH-rr-YfP" secondAttribute="trailing" id="RXg-rW-UK8"/>
39
+ <constraint firstItem="s1z-aa-wYv" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="Rcp-LG-48z"/>
40
+ <constraint firstItem="wtH-rr-YfP" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" id="cch-8E-tYu"/>
41
+ </constraints>
42
+ </view>
43
+ </viewController>
44
+ <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
45
+ </objects>
46
+ <point key="canvasLocation" x="509.60000000000002" y="237.93103448275863"/>
47
+ </scene>
48
+ </scenes>
49
+ <resources>
50
+ <image name="LaunchScreen.AspectFill" width="768" height="1024"/>
51
+ <image name="LaunchScreen.Center" width="384" height="512"/>
52
+ </resources>
53
+ </document>
@@ -0,0 +1,7 @@
1
+ // You can add custom settings here
2
+ // for example you can uncomment the following line to force distribution code signing
3
+ // CODE_SIGN_IDENTITY = iPhone Distribution
4
+ // To build for device with XCode you need to specify your development team.
5
+ // DEVELOPMENT_TEAM = YOUR_TEAM_ID;
6
+ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
7
+ IPHONEOS_DEPLOYMENT_TARGET = 17.0;
@@ -0,0 +1,128 @@
1
+ #include <metal_stdlib>
2
+ #include <SwiftUI/SwiftUI_Metal.h>
3
+ using namespace metal;
4
+
5
+ // Stitchable shaders for SwiftUI's `.distortionEffect` / `.colorEffect` (iOS 17+).
6
+ // SwiftUI supplies the leading parameters — `position` for a distortion, plus
7
+ // `color` for a colour effect — and appends the arguments passed at the call
8
+ // site in `OctaneLogo.swift`.
9
+
10
+ /// Rising heat haze.
11
+ ///
12
+ /// A distortion shader maps a destination pixel back to the source pixel it
13
+ /// should sample, so the returned offset reads as the image bending. Amplitude
14
+ /// is weighted by `base^2` (1 at the bottom, 0 at the top) so the mark shimmers
15
+ /// like air over hot metal instead of wobbling as a rigid block, and the two
16
+ /// waves use incommensurate frequencies so the pattern never visibly repeats.
17
+ [[ stitchable ]] float2 octaneHeatHaze(float2 position, float time, float2 size, float intensity) {
18
+ float2 uv = position / size;
19
+ float base = 1.0 - uv.y;
20
+ float wave = sin(uv.y * 26.0 - time * 3.1) * 0.6
21
+ + sin(uv.y * 11.0 - time * 1.9 + uv.x * 4.0) * 0.4;
22
+ float amp = 2.4 * base * base * intensity;
23
+ return position + float2(wave * amp, 0.0);
24
+ }
25
+
26
+ /// Ember sheen sweeping diagonally across the ink.
27
+ ///
28
+ /// SwiftUI hands colour effects premultiplied alpha, so the colour has to be
29
+ /// un-premultiplied before mixing and re-premultiplied on the way out —
30
+ /// blending straight into premultiplied RGB would bleed the highlight into the
31
+ /// transparent surround and halo the glyph edges.
32
+ [[ stitchable ]] half4 octaneSheen(float2 position, half4 color, float time, float2 size, float intensity) {
33
+ if (color.a < 0.004h) {
34
+ return color;
35
+ }
36
+ half3 rgb = color.rgb / color.a;
37
+
38
+ float2 uv = position / size;
39
+ float sweep = fract(time * 0.22);
40
+ float d = (uv.x * 0.85 + (1.0 - uv.y) * 0.35) - (sweep * 1.8 - 0.4);
41
+ float band = exp(-(d * d) * 42.0);
42
+
43
+ half3 ember = half3(1.0h, 0.255h, 0.353h); // the logo's #FF415A accent
44
+ half3 gold = half3(1.0h, 0.72h, 0.36h);
45
+ half3 hot = mix(ember, gold, half(band));
46
+
47
+ half glow = half(band) * half(intensity);
48
+ rgb = mix(rgb, hot, glow * 0.9h);
49
+ rgb += half3(glow * 0.25h);
50
+
51
+ return half4(saturate(rgb) * color.a, color.a);
52
+ }
53
+
54
+ /// Per-shard pseudo-random pair. Deterministic in the cell index, so a shard
55
+ /// keeps the same trajectory for the whole burst instead of jittering per frame.
56
+ static inline float2 shardNoise(float2 cell) {
57
+ float3 a = fract(float3(cell.xyx) * float3(0.1031, 0.1030, 0.0973));
58
+ a += dot(a, a.yzx + 33.33);
59
+ return fract(float2((a.x + a.y) * a.z, (a.x + a.z) * a.y));
60
+ }
61
+
62
+ /// Ignition burst: the mark shatters outward and reassembles.
63
+ ///
64
+ /// A layer effect (rather than a distortion) because each shard has to read
65
+ /// from somewhere else in the image: sampling `position - offset` with an
66
+ /// offset that is constant across a grid cell translates that whole cell as a
67
+ /// rigid chip, which is what reads as breaking apart. A distortion shader can
68
+ /// only nudge its own pixel, so it smears instead of shattering.
69
+ ///
70
+ /// `progress` runs 0 -> 1 once per burst and the displacement rides
71
+ /// `sin(p * pi)`, so the shards fly out and land back exactly where they
72
+ /// started — no separate reassembly pass, and the mark cannot get stranded
73
+ /// mid-explosion if a frame is dropped.
74
+ [[ stitchable ]] half4 octaneShatter(float2 position, SwiftUI::Layer layer, float2 size, float progress) {
75
+ if (progress <= 0.0001) {
76
+ return layer.sample(position);
77
+ }
78
+
79
+ float p = clamp(progress, 0.0, 1.0);
80
+ float fly = sin(p * M_PI_F);
81
+ float ease = fly * fly;
82
+
83
+ float2 cells = float2(22.0, 5.0);
84
+ float2 cellSize = size / cells;
85
+ float2 rnd = shardNoise(floor(position / cellSize));
86
+
87
+ float2 centre = size * 0.5;
88
+ float2 radial = (position - centre) / max(size.x * 0.5, 1.0);
89
+ float2 dir = radial + (rnd - 0.5) * 0.9;
90
+ float len = max(length(dir), 0.0001);
91
+ dir /= len;
92
+
93
+ // Capped so the outermost shards stay inside the host view; anything
94
+ // travelling further is clipped by its bounds rather than fading out.
95
+ float2 offset = dir * mix(22.0, 70.0, rnd.x) * ease;
96
+ offset.y += (rnd.y - 0.5) * 42.0 * ease;
97
+ float2 src = position - offset;
98
+
99
+ // Chromatic split along the flight path — the shards read as moving fast
100
+ // rather than merely being displaced.
101
+ float split = ease * 3.5;
102
+ half4 cr = layer.sample(src + dir * split);
103
+ half4 cg = layer.sample(src);
104
+ half4 cb = layer.sample(src - dir * split);
105
+ half alpha = max(max(cr.a, cg.a), cb.a);
106
+ if (alpha < 0.004h) {
107
+ return half4(0.0h);
108
+ }
109
+ half3 rgb = half3(cr.r, cg.g, cb.b) / alpha;
110
+
111
+ // Expanding shockwave ring, brightest just after the tap.
112
+ float ring = exp(-pow((length(radial) - p * 1.5) * 5.0, 2.0)) * (1.0 - p);
113
+
114
+ half3 ember = half3(1.0h, 0.255h, 0.353h);
115
+ half3 gold = half3(1.0h, 0.78h, 0.35h);
116
+ half heat = half(ease);
117
+ // Ember-leaning, and only a partial mix: pushing all the way to `hot` turns
118
+ // every shard the same flat gold and the mark stops being recognisable
119
+ // mid-flight. Holding some ink back keeps them reading as burning pieces
120
+ // of the logo.
121
+ half3 hot = mix(ember, gold, heat * 0.75h);
122
+
123
+ rgb = mix(rgb, hot, heat * 0.6h);
124
+ rgb += half3(heat * 0.18h * half(rnd.x) + half(ring) * 0.45h);
125
+
126
+ alpha *= 1.0h - heat * 0.2h;
127
+ return half4(saturate(rgb) * alpha, alpha);
128
+ }
@@ -1,2 +1,4 @@
1
1
  node_modules
2
2
  dist
3
+ platforms/
4
+ hooks/
@@ -1,12 +1,12 @@
1
1
  <!doctype html>
2
2
  <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>octane-xplat app</title>
7
- </head>
8
- <body>
9
- <div id="root"></div>
10
- <script type="module" src="/src/main.tsrx"></script>
11
- </body>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <title>octane-xplat app</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <script type="module" src="/src/main.web.tsrx"></script>
11
+ </body>
12
12
  </html>
@@ -0,0 +1,13 @@
1
+ import { NativeScriptConfig } from '@nativescript/core'
2
+
3
+ export default {
4
+ id: 'org.nativescript.octanexplat',
5
+ appPath: 'src',
6
+ appResourcesPath: 'App_Resources',
7
+ android: {
8
+ v8Flags: '--expose_gc',
9
+ markingMode: 'none',
10
+ },
11
+ bundler: 'vite',
12
+ bundlerConfigPath: 'vite.config.native.mts',
13
+ } as NativeScriptConfig
@@ -1,20 +1,42 @@
1
1
  {
2
- "name": "octane-xplat-app",
3
- "private": true,
4
- "type": "module",
5
- "scripts": {
6
- "dev": "vite",
7
- "build": "vite build",
8
- "typecheck": "tsrx-tsc --noEmit"
9
- },
10
- "dependencies": {
11
- "@octane-xplat/ui": "^0.2.0",
12
- "octane": "0.4.0"
13
- },
14
- "devDependencies": {
15
- "@octanejs/vite-plugin": "0.1.58",
16
- "@tsrx/typescript-plugin": "0.4.7",
17
- "typescript": "5.9.3",
18
- "vite": "8.3.0"
19
- }
2
+ "name": "octane-xplat-app",
3
+ "private": true,
4
+ "type": "module",
5
+ "main": "src/index.native.ts",
6
+ "scripts": {
7
+ "xplat": "xplat",
8
+ "dev": "vite",
9
+ "dev:ios": "ns run ios",
10
+ "dev:android": "ns run android",
11
+ "build": "vite build",
12
+ "build:ios": "ns build ios",
13
+ "build:android": "ns build android",
14
+ "lint": "xplat-lint",
15
+ "lint:fix": "xplat-lint --fix",
16
+ "typecheck": "tsrx-tsc --noEmit && tsrx-tsc --noEmit -p tsconfig.native.json"
17
+ },
18
+ "dependencies": {
19
+ "@nativescript-community/octane": "0.2.1",
20
+ "@nativescript-community/ui-canvas": "4.6.52",
21
+ "@nativescript-community/ui-svg": "0.2.24",
22
+ "@nativescript/core": "9.1.2",
23
+ "@octane-xplat/ui": "^0.4.0",
24
+ "@valor/nativescript-websockets": "2.0.3",
25
+ "octane": "0.4.0"
26
+ },
27
+ "devDependencies": {
28
+ "@nativescript-community/vite-octane": "0.2.1",
29
+ "@nativescript/android": "9.1.1",
30
+ "@nativescript/ios": "9.1.0",
31
+ "@nativescript/types": "9.0.0",
32
+ "@nativescript/vite": "8.0.11",
33
+ "@octane-xplat/cli": "^0.4.0",
34
+ "@octane-xplat/lint": "^0.1.0",
35
+ "@octanejs/vite-plugin": "0.1.58",
36
+ "@tsrx/typescript-plugin": "0.4.7",
37
+ "oxlint": "^1.74.0",
38
+ "nativescript": "9.1.1",
39
+ "typescript": "5.9.3",
40
+ "vite": "8.3.0"
41
+ }
20
42
  }
@@ -0,0 +1,41 @@
1
+ diff --git a/dist/server/strategy.js b/dist/server/strategy.js
2
+ index 7d84b37e2ed3a026da5b31c8a11027e0580877b2..f6594a913ba64837135e994cb183add13c6a0530 100644
3
+ --- a/dist/server/strategy.js
4
+ +++ b/dist/server/strategy.js
5
+ @@ -14,7 +14,9 @@ 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
+ @@ -24,7 +26,7 @@ export const octaneServerStrategy = {
17
+ if (!state)
18
+ return;
19
+ const { root, metrics, emitSummary } = state;
20
+ - const { moduleGraph, verbose, sharedTransformRequest } = deps;
21
+ + const { moduleGraph, verbose, sharedTransformRequest, wss, isSocketClientOpen } = deps;
22
+ const { file, server } = ctx;
23
+ if (!SCRIPT_FILE_RE.test(file)) {
24
+ emitSummary();
25
+ @@ -71,6 +73,16 @@ export const octaneServerStrategy = {
26
+ const gm = moduleGraph.get(normalizedId);
27
+ if (gm)
28
+ moduleGraph.emitDelta([gm], []);
29
+ + // The ns:hmr-delta broadcast IS the update delivery for this flavor —
30
+ + // count open sockets so the always-on summary reflects reality
31
+ + // instead of reporting recipients=0 for a delivered update.
32
+ + try {
33
+ + wss?.clients?.forEach((client) => {
34
+ + if (isSocketClientOpen?.(client))
35
+ + metrics.recipients += 1;
36
+ + });
37
+ + }
38
+ + catch { }
39
+ }
40
+ catch (e) {
41
+ if (verbose)