@octane-xplat/build 0.0.0-stage → 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.
- package/LICENSE +21 -0
- package/README.md +4 -2
- package/dist/add-worker.js +66 -0
- package/dist/build-worker.js +276 -0
- package/dist/compatibility-check.js +153 -0
- package/dist/compatibility-data/compatibility.js +106 -0
- package/dist/compatibility-data/compatibility.json +305 -0
- package/dist/compatibility.js +229 -0
- package/dist/css-layers.js +63 -0
- package/dist/css-platform.js +230 -0
- package/dist/css-platform.types.d.ts +11 -0
- package/dist/dev-inspector.web.js +125 -0
- package/dist/dev-log-client.web.js +79 -0
- package/dist/dev-log-server.js +13 -0
- package/dist/doctor-checks.js +317 -0
- package/dist/doctor-tool.js +27 -0
- package/dist/env.js +3 -0
- package/dist/fmt-plan.js +149 -0
- package/dist/fonts-worker.js +31 -0
- package/dist/fonts.js +614 -0
- package/dist/inline-stylesheets.js +37 -0
- package/dist/linux/config.js +43 -0
- package/dist/linux/host/bridge-selftest.linux.js +255 -0
- package/dist/linux/host/gjs-host.js +1412 -0
- package/dist/linux/package.js +176 -0
- package/dist/linux-gtk/vite.d.ts +23 -0
- package/dist/linux-gtk/vite.js +194 -0
- package/dist/macos/config.js +141 -0
- package/dist/macos/doctor-checks.js +58 -0
- package/dist/macos/executables.js +39 -0
- package/dist/macos/jsc-host/runtime.js +134 -0
- package/dist/macos/native.js +287 -0
- package/dist/macos/runtime-package.js +30 -0
- package/dist/macos/tab-item.js +62 -0
- package/dist/macos/vite.d.ts +21 -0
- package/dist/macos/vite.js +111 -0
- package/dist/markdown.js +11 -0
- package/dist/mason-engine.js +20 -0
- package/dist/mcp/contracts/actions.js +133 -0
- package/dist/mcp/dev-bridge.js +363 -0
- package/dist/mcp/dev-socket.js +161 -0
- package/dist/mcp/dev-stack.js +134 -0
- package/dist/mcp/inspection/dom.web.js +46 -0
- package/dist/native-regex.js +123 -0
- package/dist/package-manager.js +106 -0
- package/dist/package-root.js +48 -0
- package/dist/patches.js +356 -0
- package/dist/route-config.js +53 -0
- package/dist/route-data.js +42 -0
- package/dist/route-generator.js +514 -0
- package/dist/route-path.js +29 -0
- package/dist/route-source.js +67 -0
- package/dist/targets.js +38 -0
- package/dist/tsconfig-envs.js +287 -0
- package/dist/tsrx-leaf.js +57 -0
- package/dist/typecheck-globals/macos.d.ts +21 -0
- package/dist/typecheck-globals/native.d.ts +26 -0
- package/dist/ui/src/markdown/markdown-ast.js +33 -0
- package/dist/ui/src/markdown/markdown-character-references.js +79 -0
- package/dist/ui/src/markdown/markdown-parse.js +1930 -0
- package/dist/ui/src/markdown/markdown-plugins.js +564 -0
- package/dist/ui/src/markdown/markdown-url.js +17 -0
- package/dist/updates-worker.js +34 -0
- package/dist/upgrade-worker.js +63 -0
- package/dist/vite.d.ts +85 -0
- package/dist/vite.js +628 -0
- package/dist/workshop-worker.js +181 -0
- package/package.json +72 -5
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "Release compatibility set, shared by create-octane-xplat and xplat doctor/upgrade. Edit external pins here, then run bun run sync:compatibility. Framework package names are generated from the lockstep release set. Optional packages are managed only when declared; library consumer peer ranges remain app-owned.",
|
|
3
|
+
"schemaVersion": 1,
|
|
4
|
+
"frameworkVersion": "0.20.0",
|
|
5
|
+
"tools": {
|
|
6
|
+
"nodeMinimum": "22.22.2",
|
|
7
|
+
"bun": "1.4.4",
|
|
8
|
+
"pnpm": "11.24.0"
|
|
9
|
+
},
|
|
10
|
+
"frameworkPackages": [
|
|
11
|
+
"@octane-xplat/ads",
|
|
12
|
+
"@octane-xplat/app-menu",
|
|
13
|
+
"@octane-xplat/audio",
|
|
14
|
+
"@octane-xplat/auth",
|
|
15
|
+
"@octane-xplat/background-tasks",
|
|
16
|
+
"@octane-xplat/bamboo",
|
|
17
|
+
"@octane-xplat/barcode-scanner",
|
|
18
|
+
"@octane-xplat/billing",
|
|
19
|
+
"@octane-xplat/biometrics",
|
|
20
|
+
"@octane-xplat/build",
|
|
21
|
+
"@octane-xplat/calendar",
|
|
22
|
+
"@octane-xplat/camera",
|
|
23
|
+
"@octane-xplat/canvas",
|
|
24
|
+
"@octane-xplat/charts",
|
|
25
|
+
"@octane-xplat/cli",
|
|
26
|
+
"@octane-xplat/contacts",
|
|
27
|
+
"@octane-xplat/context-menu",
|
|
28
|
+
"@octane-xplat/crypto",
|
|
29
|
+
"@octane-xplat/css-engine",
|
|
30
|
+
"@octane-xplat/date-picker",
|
|
31
|
+
"@octane-xplat/desktop-webview",
|
|
32
|
+
"@octane-xplat/dnd-kit",
|
|
33
|
+
"@octane-xplat/docs-search",
|
|
34
|
+
"@octane-xplat/drawer",
|
|
35
|
+
"@octane-xplat/effects",
|
|
36
|
+
"@octane-xplat/files",
|
|
37
|
+
"@octane-xplat/fingerprint",
|
|
38
|
+
"@octane-xplat/firebase-analytics",
|
|
39
|
+
"@octane-xplat/firebase-crashlytics",
|
|
40
|
+
"@octane-xplat/form",
|
|
41
|
+
"@octane-xplat/geofencing",
|
|
42
|
+
"@octane-xplat/geolocation",
|
|
43
|
+
"@octane-xplat/gif",
|
|
44
|
+
"@octane-xplat/global-shortcuts",
|
|
45
|
+
"@octane-xplat/haptics",
|
|
46
|
+
"@octane-xplat/icons",
|
|
47
|
+
"@octane-xplat/image",
|
|
48
|
+
"@octane-xplat/image-crop",
|
|
49
|
+
"@octane-xplat/image-manipulator",
|
|
50
|
+
"@octane-xplat/intersection-observer",
|
|
51
|
+
"@octane-xplat/jsx",
|
|
52
|
+
"@octane-xplat/keyboard",
|
|
53
|
+
"@octane-xplat/lexical",
|
|
54
|
+
"@octane-xplat/lib",
|
|
55
|
+
"@octane-xplat/lingui",
|
|
56
|
+
"@octane-xplat/lint",
|
|
57
|
+
"@octane-xplat/linux-gtk",
|
|
58
|
+
"@octane-xplat/lottie",
|
|
59
|
+
"@octane-xplat/macos-appkit",
|
|
60
|
+
"@octane-xplat/macos-build",
|
|
61
|
+
"@octane-xplat/maps",
|
|
62
|
+
"@octane-xplat/mcp",
|
|
63
|
+
"@octane-xplat/media",
|
|
64
|
+
"@octane-xplat/media-converter",
|
|
65
|
+
"@octane-xplat/media-library",
|
|
66
|
+
"@octane-xplat/motion",
|
|
67
|
+
"@octane-xplat/nano-icons",
|
|
68
|
+
"@octane-xplat/network",
|
|
69
|
+
"@octane-xplat/notifications",
|
|
70
|
+
"@octane-xplat/pager",
|
|
71
|
+
"@octane-xplat/patches",
|
|
72
|
+
"@octane-xplat/picker",
|
|
73
|
+
"@octane-xplat/platform",
|
|
74
|
+
"@octane-xplat/posthog",
|
|
75
|
+
"@octane-xplat/print",
|
|
76
|
+
"@octane-xplat/push",
|
|
77
|
+
"@octane-xplat/recorder",
|
|
78
|
+
"@octane-xplat/richtext",
|
|
79
|
+
"@octane-xplat/rolling-text",
|
|
80
|
+
"@octane-xplat/screen-orientation",
|
|
81
|
+
"@octane-xplat/secure-storage",
|
|
82
|
+
"@octane-xplat/sentry",
|
|
83
|
+
"@octane-xplat/shaders",
|
|
84
|
+
"@octane-xplat/share",
|
|
85
|
+
"@octane-xplat/sheet",
|
|
86
|
+
"@octane-xplat/shortcuts",
|
|
87
|
+
"@octane-xplat/smooth-corners",
|
|
88
|
+
"@octane-xplat/sounds",
|
|
89
|
+
"@octane-xplat/speech-recognition",
|
|
90
|
+
"@octane-xplat/splash-screen",
|
|
91
|
+
"@octane-xplat/sqlite",
|
|
92
|
+
"@octane-xplat/store-review",
|
|
93
|
+
"@octane-xplat/stripe",
|
|
94
|
+
"@octane-xplat/table",
|
|
95
|
+
"@octane-xplat/tiptap",
|
|
96
|
+
"@octane-xplat/tracking-transparency",
|
|
97
|
+
"@octane-xplat/tray",
|
|
98
|
+
"@octane-xplat/ui",
|
|
99
|
+
"@octane-xplat/updates",
|
|
100
|
+
"@octane-xplat/video",
|
|
101
|
+
"@octane-xplat/view-shot",
|
|
102
|
+
"@octane-xplat/web-browser",
|
|
103
|
+
"@octane-xplat/web-host",
|
|
104
|
+
"@octane-xplat/workshop",
|
|
105
|
+
"create-octane-xplat",
|
|
106
|
+
"octane-xplat"
|
|
107
|
+
],
|
|
108
|
+
"packages": {
|
|
109
|
+
"octane": {
|
|
110
|
+
"version": "0.16.3",
|
|
111
|
+
"group": "runtime",
|
|
112
|
+
"singleton": true
|
|
113
|
+
},
|
|
114
|
+
"@nativescript-community/octane": {
|
|
115
|
+
"version": "0.2.5",
|
|
116
|
+
"group": "runtime",
|
|
117
|
+
"singleton": true
|
|
118
|
+
},
|
|
119
|
+
"@nativescript/core": {
|
|
120
|
+
"version": "9.1.3",
|
|
121
|
+
"group": "runtime",
|
|
122
|
+
"singleton": true
|
|
123
|
+
},
|
|
124
|
+
"typescript": {
|
|
125
|
+
"version": "7.1.0-beta",
|
|
126
|
+
"group": "compiler"
|
|
127
|
+
},
|
|
128
|
+
"@tsrx/oxc": {
|
|
129
|
+
"version": "0.20.0",
|
|
130
|
+
"group": "compiler"
|
|
131
|
+
},
|
|
132
|
+
"tsrx-typegen": {
|
|
133
|
+
"version": "0.6.0",
|
|
134
|
+
"group": "compiler"
|
|
135
|
+
},
|
|
136
|
+
"vite": {
|
|
137
|
+
"version": "8.3.6",
|
|
138
|
+
"group": "bundler"
|
|
139
|
+
},
|
|
140
|
+
"@octanejs/vite-plugin": {
|
|
141
|
+
"version": "0.5.0",
|
|
142
|
+
"group": "bundler"
|
|
143
|
+
},
|
|
144
|
+
"@nativescript-community/vite-octane": {
|
|
145
|
+
"version": "0.2.1",
|
|
146
|
+
"group": "bundler"
|
|
147
|
+
},
|
|
148
|
+
"@nativescript/vite": {
|
|
149
|
+
"version": "8.0.20",
|
|
150
|
+
"group": "bundler"
|
|
151
|
+
},
|
|
152
|
+
"nativescript": {
|
|
153
|
+
"version": "9.1.1",
|
|
154
|
+
"group": "native-toolchain"
|
|
155
|
+
},
|
|
156
|
+
"@nativescript/ios": {
|
|
157
|
+
"version": "9.1.0",
|
|
158
|
+
"group": "native-toolchain"
|
|
159
|
+
},
|
|
160
|
+
"@nativescript/android": {
|
|
161
|
+
"version": "9.1.1",
|
|
162
|
+
"group": "native-toolchain"
|
|
163
|
+
},
|
|
164
|
+
"@nativescript/types": {
|
|
165
|
+
"version": "9.1.4",
|
|
166
|
+
"group": "native-toolchain"
|
|
167
|
+
},
|
|
168
|
+
"@nativescript/types-ios": {
|
|
169
|
+
"version": "9.1.3",
|
|
170
|
+
"group": "native-toolchain"
|
|
171
|
+
},
|
|
172
|
+
"@nativescript/types-android": {
|
|
173
|
+
"version": "9.1.1",
|
|
174
|
+
"group": "native-toolchain"
|
|
175
|
+
},
|
|
176
|
+
"@nativescript/macos-node-api": {
|
|
177
|
+
"version": "0.5.0-beta.0",
|
|
178
|
+
"group": "native-toolchain"
|
|
179
|
+
},
|
|
180
|
+
"@nativescript/windows": {
|
|
181
|
+
"version": "0.1.0-alpha.146",
|
|
182
|
+
"group": "native-toolchain"
|
|
183
|
+
},
|
|
184
|
+
"vitest": {
|
|
185
|
+
"version": "4.1.11",
|
|
186
|
+
"group": "testing"
|
|
187
|
+
},
|
|
188
|
+
"@nativescript/unit-test-runner": {
|
|
189
|
+
"version": "5.0.0",
|
|
190
|
+
"group": "testing"
|
|
191
|
+
},
|
|
192
|
+
"@nativescript-community/gesturehandler": {
|
|
193
|
+
"version": "2.1.0",
|
|
194
|
+
"group": "plugin"
|
|
195
|
+
},
|
|
196
|
+
"@nativescript-community/ui-drawer": {
|
|
197
|
+
"version": "0.1.32",
|
|
198
|
+
"group": "plugin"
|
|
199
|
+
},
|
|
200
|
+
"@nativescript-community/ui-image": {
|
|
201
|
+
"version": "5.0.18",
|
|
202
|
+
"group": "plugin"
|
|
203
|
+
},
|
|
204
|
+
"@valor/nativescript-websockets": {
|
|
205
|
+
"version": "2.0.3",
|
|
206
|
+
"group": "plugin"
|
|
207
|
+
},
|
|
208
|
+
"@octane-xplat/nativescript-mason-core": {
|
|
209
|
+
"version": "1.0.0-beta.7",
|
|
210
|
+
"group": "runtime"
|
|
211
|
+
},
|
|
212
|
+
"@octane-xplat/nativescript-masonkit": {
|
|
213
|
+
"version": "1.0.0-beta.126",
|
|
214
|
+
"group": "runtime"
|
|
215
|
+
},
|
|
216
|
+
"jsdom": {
|
|
217
|
+
"version": "30.1.1",
|
|
218
|
+
"group": "testing"
|
|
219
|
+
},
|
|
220
|
+
"@nativescript/font-manager": {
|
|
221
|
+
"version": "1.0.20",
|
|
222
|
+
"group": "plugin"
|
|
223
|
+
},
|
|
224
|
+
"typescript-classic": {
|
|
225
|
+
"version": "5.9.3",
|
|
226
|
+
"specifier": "npm:typescript@5.9.3",
|
|
227
|
+
"group": "compiler"
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"profiles": {
|
|
231
|
+
"windows": {
|
|
232
|
+
"@nativescript/core": {
|
|
233
|
+
"version": "9.1.4-next.0",
|
|
234
|
+
"specifier": "https://pkg.pr.new/@nativescript/core@abae298"
|
|
235
|
+
},
|
|
236
|
+
"@nativescript/vite": {
|
|
237
|
+
"version": "8.0.21",
|
|
238
|
+
"specifier": "https://pkg.pr.new/@nativescript/vite@abae298"
|
|
239
|
+
},
|
|
240
|
+
"nativescript": {
|
|
241
|
+
"version": "9.1.2-dev.2026-09-24-36031892256"
|
|
242
|
+
},
|
|
243
|
+
"@nativescript/font-manager": {
|
|
244
|
+
"version": "1.0.18"
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
"overrides": {
|
|
249
|
+
"@nativescript/vite>esbuild": "0.27.7",
|
|
250
|
+
"@nativescript-community/vite-octane>esbuild": "0.27.7",
|
|
251
|
+
"vite>esbuild": "0.27.7",
|
|
252
|
+
"regenerate": "1.5.0",
|
|
253
|
+
"oxlint-tsgolint": "7.0.2005",
|
|
254
|
+
"@lexical/a11y": "0.53.0",
|
|
255
|
+
"@lexical/code": "0.53.0",
|
|
256
|
+
"@lexical/devtools-core": "0.53.0",
|
|
257
|
+
"@lexical/dragon": "0.53.0",
|
|
258
|
+
"@lexical/extension": "0.53.0",
|
|
259
|
+
"@lexical/hashtag": "0.53.0",
|
|
260
|
+
"@lexical/history": "0.53.0",
|
|
261
|
+
"@lexical/html": "0.53.0",
|
|
262
|
+
"@lexical/internal": "0.53.0",
|
|
263
|
+
"@lexical/link": "0.53.0",
|
|
264
|
+
"@lexical/list": "0.53.0",
|
|
265
|
+
"@lexical/mark": "0.53.0",
|
|
266
|
+
"@lexical/markdown": "0.53.0",
|
|
267
|
+
"@lexical/overflow": "0.53.0",
|
|
268
|
+
"@lexical/plain-text": "0.53.0",
|
|
269
|
+
"@lexical/rich-text": "0.53.0",
|
|
270
|
+
"@lexical/selection": "0.53.0",
|
|
271
|
+
"@lexical/table": "0.53.0",
|
|
272
|
+
"@lexical/text": "0.53.0",
|
|
273
|
+
"@lexical/utils": "0.53.0",
|
|
274
|
+
"@lexical/yjs": "0.53.0",
|
|
275
|
+
"lexical": "0.53.0",
|
|
276
|
+
"@tiptap/core": "3.32.2",
|
|
277
|
+
"@tiptap/pm": "3.32.2",
|
|
278
|
+
"@tiptap/starter-kit": "3.32.2",
|
|
279
|
+
"@tiptap/static-renderer": "3.32.2",
|
|
280
|
+
"@tiptap/extensions": "3.32.2",
|
|
281
|
+
"@tiptap/extension-blockquote": "3.32.2",
|
|
282
|
+
"@tiptap/extension-bold": "3.32.2",
|
|
283
|
+
"@tiptap/extension-bubble-menu": "3.32.2",
|
|
284
|
+
"@tiptap/extension-bullet-list": "3.32.2",
|
|
285
|
+
"@tiptap/extension-code": "3.32.2",
|
|
286
|
+
"@tiptap/extension-code-block": "3.32.2",
|
|
287
|
+
"@tiptap/extension-document": "3.32.2",
|
|
288
|
+
"@tiptap/extension-dropcursor": "3.32.2",
|
|
289
|
+
"@tiptap/extension-floating-menu": "3.32.2",
|
|
290
|
+
"@tiptap/extension-gapcursor": "3.32.2",
|
|
291
|
+
"@tiptap/extension-hard-break": "3.32.2",
|
|
292
|
+
"@tiptap/extension-heading": "3.32.2",
|
|
293
|
+
"@tiptap/extension-horizontal-rule": "3.32.2",
|
|
294
|
+
"@tiptap/extension-italic": "3.32.2",
|
|
295
|
+
"@tiptap/extension-link": "3.32.2",
|
|
296
|
+
"@tiptap/extension-list": "3.32.2",
|
|
297
|
+
"@tiptap/extension-list-item": "3.32.2",
|
|
298
|
+
"@tiptap/extension-list-keymap": "3.32.2",
|
|
299
|
+
"@tiptap/extension-ordered-list": "3.32.2",
|
|
300
|
+
"@tiptap/extension-paragraph": "3.32.2",
|
|
301
|
+
"@tiptap/extension-strike": "3.32.2",
|
|
302
|
+
"@tiptap/extension-text": "3.32.2",
|
|
303
|
+
"@tiptap/extension-underline": "3.32.2"
|
|
304
|
+
}
|
|
305
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { packageManagerFor, packageManagerRoot, readProjectWorkspace } from "./package-manager.js";
|
|
2
|
+
import { compatibility, dependencySections, managedCatalog, managedPackage, managedSpecifier, projectProfile } from "./compatibility-data/compatibility.js";
|
|
3
|
+
import { canonicalPatchesDir, loadPatchManifest, specifierPackage } from "./patches.js";
|
|
4
|
+
import { masonCorePackage, masonFullPackage, masonLegacyPackage } from "./mason-engine.js";
|
|
5
|
+
import { existsSync, globSync, mkdirSync, readFileSync, realpathSync, unlinkSync, writeFileSync } from "node:fs";
|
|
6
|
+
import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
7
|
+
import { parseDocument } from "yaml";
|
|
8
|
+
// ../cli/src/compatibility.ts
|
|
9
|
+
var readPackage = (path) => JSON.parse(readFileSync(path, "utf8"));
|
|
10
|
+
var localSpecifier = (spec) => /^(workspace:|link:|file:|portal:)/.test(spec);
|
|
11
|
+
var patchPrefix = "node_modules/.pnpm-config/@octane-xplat/patches/patches/";
|
|
12
|
+
var workspaceRoot = packageManagerRoot;
|
|
13
|
+
function readWorkspace(root) {
|
|
14
|
+
if (packageManagerFor(root) === "bun") return parseDocument(JSON.stringify(readProjectWorkspace(root, "bun")));
|
|
15
|
+
const path = join(root, "pnpm-workspace.yaml");
|
|
16
|
+
const doc = parseDocument(existsSync(path) ? readFileSync(path, "utf8") : "{}\n");
|
|
17
|
+
if (doc.errors.length) throw new Error(`${path}: ${doc.errors[0].message}`);
|
|
18
|
+
return doc;
|
|
19
|
+
}
|
|
20
|
+
function resolveCatalog(spec, name, config) {
|
|
21
|
+
if (!spec.startsWith("catalog:")) return spec;
|
|
22
|
+
const catalog = spec.slice(8);
|
|
23
|
+
return (catalog && catalog !== "default" ? config.catalogs?.[catalog]?.[name] : config.catalog?.[name]) ?? spec;
|
|
24
|
+
}
|
|
25
|
+
/** Match workspace package globs, including nested directories and exclusions. */
|
|
26
|
+
function workspacePackages(root, patterns = []) {
|
|
27
|
+
const included = patterns.filter((pattern) => !pattern.startsWith("!"));
|
|
28
|
+
const excluded = patterns.filter((pattern) => pattern.startsWith("!")).map((pattern) => pattern.slice(1));
|
|
29
|
+
const paths = /* @__PURE__ */ new Set([root]);
|
|
30
|
+
for (const match of included.length ? globSync(included, {
|
|
31
|
+
cwd: root,
|
|
32
|
+
exclude: ["**/node_modules/**", ...excluded]
|
|
33
|
+
}) : []) {
|
|
34
|
+
const path = resolve(root, match);
|
|
35
|
+
const rel = relative(realpathSync(root), realpathSync(path));
|
|
36
|
+
if (isAbsolute(rel) || rel === ".." || rel.startsWith(`..${sep}`)) throw new Error(`Workspace package ${match} points outside ${root}; align it in its own workspace`);
|
|
37
|
+
paths.add(path);
|
|
38
|
+
}
|
|
39
|
+
return [...paths].sort().filter((path) => existsSync(join(path, "package.json")));
|
|
40
|
+
}
|
|
41
|
+
var formatPackage = (pkg, raw) => JSON.stringify(pkg, null, raw.match(/^([\t ]+)"/m)?.[1] ?? " ") + "\n";
|
|
42
|
+
/** Pure preflight: no writes, installs, or package code execution. */
|
|
43
|
+
function planUpgrade(dir) {
|
|
44
|
+
const root = workspaceRoot(dir);
|
|
45
|
+
const manager = packageManagerFor(root);
|
|
46
|
+
const ws = readWorkspace(root);
|
|
47
|
+
const config = ws.toJS() ?? {};
|
|
48
|
+
const paths = workspacePackages(root, config.packages);
|
|
49
|
+
if (!paths.length || !existsSync(join(resolve(dir), "package.json"))) throw new Error("Run xplat upgrade inside a package with a package.json");
|
|
50
|
+
const plan = {
|
|
51
|
+
root,
|
|
52
|
+
version: compatibility.frameworkVersion,
|
|
53
|
+
packages: paths,
|
|
54
|
+
files: [],
|
|
55
|
+
updates: [],
|
|
56
|
+
skipped: [],
|
|
57
|
+
projects: []
|
|
58
|
+
};
|
|
59
|
+
const expected = /* @__PURE__ */ new Map();
|
|
60
|
+
const expectedSpecs = /* @__PURE__ */ new Map();
|
|
61
|
+
const applicable = /* @__PURE__ */ new Set();
|
|
62
|
+
const packages = paths.map((path) => {
|
|
63
|
+
const file = join(path, "package.json");
|
|
64
|
+
const raw = readFileSync(file, "utf8");
|
|
65
|
+
return {
|
|
66
|
+
path,
|
|
67
|
+
file,
|
|
68
|
+
raw,
|
|
69
|
+
pkg: JSON.parse(raw)
|
|
70
|
+
};
|
|
71
|
+
});
|
|
72
|
+
const change = (path, after) => {
|
|
73
|
+
const before = existsSync(path) ? readFileSync(path, "utf8") : null;
|
|
74
|
+
if (after !== before) plan.files.push({
|
|
75
|
+
path,
|
|
76
|
+
before,
|
|
77
|
+
after
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
for (const { path, pkg } of packages) {
|
|
81
|
+
const profile = projectProfile(pkg);
|
|
82
|
+
const label = relative(root, path) || ".";
|
|
83
|
+
const deps = Object.assign({}, ...dependencySections.map((section) => pkg[section]));
|
|
84
|
+
if (deps.octane && !deps["@tsrx/oxc"] && !localSpecifier(deps.octane)) {
|
|
85
|
+
pkg.devDependencies ??= {};
|
|
86
|
+
pkg.devDependencies["@tsrx/oxc"] = managedSpecifier("@tsrx/oxc", profile);
|
|
87
|
+
plan.updates.push(`${label}: add @tsrx/oxc compiler peer`);
|
|
88
|
+
}
|
|
89
|
+
const engine = profile === "windows" ? masonFullPackage : masonCorePackage;
|
|
90
|
+
const replacedEngines = [
|
|
91
|
+
masonCorePackage,
|
|
92
|
+
masonFullPackage,
|
|
93
|
+
masonLegacyPackage
|
|
94
|
+
].filter((name) => name !== engine);
|
|
95
|
+
if (deps["@nativescript-community/octane"] && !deps[engine] && !replacedEngines.some((name) => deps[name]) && !localSpecifier(deps["@nativescript-community/octane"])) {
|
|
96
|
+
pkg.dependencies ??= {};
|
|
97
|
+
pkg.dependencies[engine] = managedSpecifier(engine, profile);
|
|
98
|
+
plan.updates.push(`${label}: add ${engine} mason engine`);
|
|
99
|
+
}
|
|
100
|
+
for (const name of replacedEngines) {
|
|
101
|
+
if (!deps[name]) continue;
|
|
102
|
+
for (const section of dependencySections) delete pkg[section]?.[name];
|
|
103
|
+
pkg.dependencies ??= {};
|
|
104
|
+
pkg.dependencies[engine] ??= managedSpecifier(engine, profile);
|
|
105
|
+
plan.updates.push(`${label}: replace ${name} with ${engine}`);
|
|
106
|
+
}
|
|
107
|
+
for (const section of dependencySections) for (const [name, declared] of Object.entries(pkg[section] ?? {})) {
|
|
108
|
+
const managed = managedPackage(name, profile);
|
|
109
|
+
if (!managed) continue;
|
|
110
|
+
const spec = resolveCatalog(declared, name, config);
|
|
111
|
+
if (localSpecifier(spec)) {
|
|
112
|
+
plan.skipped.push(`${label}: keep ${name} ${declared}`);
|
|
113
|
+
continue;
|
|
114
|
+
}
|
|
115
|
+
const desired = managedSpecifier(name, profile);
|
|
116
|
+
if ((/^[\w+.-]+:/.test(spec) || spec.includes("/")) && spec !== desired) throw new Error(`${label}: ${name} uses a custom source; replace it with a registry pin or a local dependency before upgrading`);
|
|
117
|
+
const catalog = managedCatalog(profile);
|
|
118
|
+
pkg[section][name] = `catalog:${catalog}`;
|
|
119
|
+
ws.setIn([
|
|
120
|
+
"catalogs",
|
|
121
|
+
catalog,
|
|
122
|
+
name
|
|
123
|
+
], desired);
|
|
124
|
+
if (declared !== `catalog:${catalog}` || spec !== desired) plan.updates.push(`${label}: ${name} ${spec} → ${desired}`);
|
|
125
|
+
applicable.add(name);
|
|
126
|
+
if (!plan.projects.includes(path)) plan.projects.push(path);
|
|
127
|
+
const versions = expected.get(name) ?? /* @__PURE__ */ new Set();
|
|
128
|
+
versions.add(managed.version);
|
|
129
|
+
expected.set(name, versions);
|
|
130
|
+
const specs = expectedSpecs.get(name) ?? /* @__PURE__ */ new Set();
|
|
131
|
+
specs.add(desired);
|
|
132
|
+
expectedSpecs.set(name, specs);
|
|
133
|
+
}
|
|
134
|
+
if (path === root || dependencySections.some((section) => Object.keys(pkg[section] ?? {}).some((name) => applicable.has(name)))) {
|
|
135
|
+
pkg.packageManager = `${manager}@${compatibility.tools[manager]}`;
|
|
136
|
+
pkg.engines ??= {};
|
|
137
|
+
pkg.engines.node ??= `>=${compatibility.tools.nodeMinimum}`;
|
|
138
|
+
if (manager === "bun") pkg.engines.bun ??= `>=${compatibility.tools.bun}`;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const rootPackage = packages.find((pkg) => pkg.path === root);
|
|
142
|
+
const usesCli = packages.some(({ pkg }) => dependencySections.some((section) => ["@octane-xplat/cli", "octane-xplat"].some((name) => pkg[section]?.[name])));
|
|
143
|
+
if (manager === "bun" && rootPackage && usesCli && !(rootPackage.pkg.trustedDependencies ?? []).includes("@octane-xplat/cli")) {
|
|
144
|
+
rootPackage.pkg.trustedDependencies = [...rootPackage.pkg.trustedDependencies ?? [], "@octane-xplat/cli"];
|
|
145
|
+
plan.updates.push(".: trust the @octane-xplat/cli install script");
|
|
146
|
+
}
|
|
147
|
+
for (const overrides of [config.overrides ?? {}, rootPackage?.pkg.pnpm?.overrides ?? {}]) for (const [selector, value] of Object.entries(overrides)) {
|
|
148
|
+
const name = specifierPackage(selector.split(">").at(-1));
|
|
149
|
+
if (!applicable.has(name)) continue;
|
|
150
|
+
const versions = expected.get(name);
|
|
151
|
+
if (versions.size !== 1) throw new Error(`Override ${selector} spans incompatible profiles; scope it to the appropriate workspace package`);
|
|
152
|
+
const desired = [...versions][0];
|
|
153
|
+
const source = resolveCatalog(String(value), name, config);
|
|
154
|
+
if (!expectedSpecs.get(name).has(source)) throw new Error(`Override ${selector} conflicts with ${desired}; remove this override before upgrading`);
|
|
155
|
+
}
|
|
156
|
+
for (const [selector, version] of Object.entries(compatibility.overrides)) {
|
|
157
|
+
const existing = config.overrides?.[selector];
|
|
158
|
+
if (existing && existing !== version) throw new Error(`Override ${selector} conflicts with framework pin ${version}`);
|
|
159
|
+
ws.setIn(["overrides", selector], version);
|
|
160
|
+
}
|
|
161
|
+
const oldPatches = {
|
|
162
|
+
...rootPackage?.pkg.pnpm?.patchedDependencies,
|
|
163
|
+
...rootPackage?.pkg.patchedDependencies,
|
|
164
|
+
...config.patchedDependencies
|
|
165
|
+
};
|
|
166
|
+
const wanted = loadPatchManifest().filter((patch) => {
|
|
167
|
+
const name = specifierPackage(patch.specifier);
|
|
168
|
+
const version = patch.specifier.slice(name.length + 1);
|
|
169
|
+
const versions = expected.get(name);
|
|
170
|
+
if (versions) return versions.has(version);
|
|
171
|
+
return patch.template !== false && !managedPackage(name);
|
|
172
|
+
});
|
|
173
|
+
for (const patch of wanted) {
|
|
174
|
+
const existing = oldPatches[patch.specifier];
|
|
175
|
+
if (existing && !String(existing).startsWith(patchPrefix)) {
|
|
176
|
+
const file = resolve(root, existing);
|
|
177
|
+
const canonical = readFileSync(join(canonicalPatchesDir, patch.file));
|
|
178
|
+
if (!existsSync(file) || !canonical.equals(readFileSync(file))) throw new Error(`Custom patch for ${patch.specifier} at ${existing} differs from the framework patch; reconcile it before upgrading`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
const wantedSpecs = new Set(wanted.map((patch) => patch.specifier));
|
|
182
|
+
for (const [specifier, path] of Object.entries(oldPatches)) if (String(path).startsWith(patchPrefix) && !wantedSpecs.has(specifier)) delete oldPatches[specifier];
|
|
183
|
+
const configMode = manager === "pnpm" && config.configDependencies?.["@octane-xplat/patches"] !== void 0;
|
|
184
|
+
for (const patch of wanted) {
|
|
185
|
+
oldPatches[patch.specifier] ??= configMode ? `${patchPrefix}${patch.file}` : `patches/${patch.file}`;
|
|
186
|
+
if (!configMode) change(join(root, oldPatches[patch.specifier]), readFileSync(join(canonicalPatchesDir, patch.file), "utf8"));
|
|
187
|
+
}
|
|
188
|
+
if (Object.keys(oldPatches).length) {
|
|
189
|
+
ws.set("patchedDependencies", oldPatches);
|
|
190
|
+
ws.set("allowUnusedPatches", true);
|
|
191
|
+
}
|
|
192
|
+
if (wanted.some((patch) => oldPatches[patch.specifier].startsWith(patchPrefix))) ws.setIn(["configDependencies", "@octane-xplat/patches"], compatibility.frameworkVersion);
|
|
193
|
+
if (rootPackage?.pkg.pnpm?.patchedDependencies) delete rootPackage.pkg.pnpm.patchedDependencies;
|
|
194
|
+
if (manager === "bun" && rootPackage) {
|
|
195
|
+
const result = ws.toJS();
|
|
196
|
+
const owner = rootPackage.pkg;
|
|
197
|
+
if (Array.isArray(owner.workspaces)) owner.workspaces = { packages: owner.workspaces };
|
|
198
|
+
owner.workspaces ??= { packages: [] };
|
|
199
|
+
for (const key of ["catalog", "catalogs"]) if (result[key]) {
|
|
200
|
+
if (Object.hasOwn(owner, key)) owner[key] = result[key];
|
|
201
|
+
else owner.workspaces[key] = result[key];
|
|
202
|
+
}
|
|
203
|
+
for (const key of ["overrides", "patchedDependencies"]) if (result[key]) owner[key] = result[key];
|
|
204
|
+
}
|
|
205
|
+
for (const { file, raw, pkg } of packages) {
|
|
206
|
+
const after = formatPackage(pkg, raw);
|
|
207
|
+
if (JSON.stringify(JSON.parse(raw)) !== JSON.stringify(pkg)) change(file, after);
|
|
208
|
+
}
|
|
209
|
+
if (manager === "pnpm") change(join(root, "pnpm-workspace.yaml"), String(ws));
|
|
210
|
+
return plan;
|
|
211
|
+
}
|
|
212
|
+
/** Refuse stale previews and roll back authored files if a write fails. */
|
|
213
|
+
function applyUpgrade(plan) {
|
|
214
|
+
for (const file of plan.files) if ((existsSync(file.path) ? readFileSync(file.path, "utf8") : null) !== file.before) throw new Error(`${file.path} changed during upgrade; rerun xplat upgrade`);
|
|
215
|
+
const written = [];
|
|
216
|
+
try {
|
|
217
|
+
for (const file of plan.files) {
|
|
218
|
+
written.push(file);
|
|
219
|
+
mkdirSync(dirname(file.path), { recursive: true });
|
|
220
|
+
writeFileSync(file.path, file.after);
|
|
221
|
+
}
|
|
222
|
+
} catch (error) {
|
|
223
|
+
for (const file of written.reverse()) if (file.before === null) {
|
|
224
|
+
if (existsSync(file.path)) unlinkSync(file.path);
|
|
225
|
+
} else writeFileSync(file.path, file.before);
|
|
226
|
+
throw error;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
export { applyUpgrade, compatibility, localSpecifier, managedPackage, managedSpecifier, planUpgrade, readPackage, readWorkspace, resolveCatalog, workspaceRoot };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// ../cli/src/css-layers.ts
|
|
2
|
+
function skipComment(css, index) {
|
|
3
|
+
const end = css.indexOf("*/", index + 2);
|
|
4
|
+
return end < 0 ? css.length : end + 2;
|
|
5
|
+
}
|
|
6
|
+
function skipString(css, index) {
|
|
7
|
+
const quote = css[index];
|
|
8
|
+
for (let i = index + 1; i < css.length; i++) if (css[i] === "\\") i++;
|
|
9
|
+
else if (css[i] === quote) return i + 1;
|
|
10
|
+
return css.length;
|
|
11
|
+
}
|
|
12
|
+
function atRuleDelimiter(css, index) {
|
|
13
|
+
let parentheses = 0;
|
|
14
|
+
for (let i = index; i < css.length; i++) if (css.startsWith("/*", i)) i = skipComment(css, i) - 1;
|
|
15
|
+
else if (css[i] === "\"" || css[i] === "'") i = skipString(css, i) - 1;
|
|
16
|
+
else if (css[i] === "(") parentheses++;
|
|
17
|
+
else if (css[i] === ")") parentheses = Math.max(0, parentheses - 1);
|
|
18
|
+
else if (parentheses === 0 && (css[i] === ";" || css[i] === "{")) return {
|
|
19
|
+
index: i,
|
|
20
|
+
token: css[i]
|
|
21
|
+
};
|
|
22
|
+
else if (parentheses === 0 && css[i] === "}") return null;
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
function matchingBrace(css, open) {
|
|
26
|
+
let depth = 1;
|
|
27
|
+
for (let i = open + 1; i < css.length; i++) if (css.startsWith("/*", i)) i = skipComment(css, i) - 1;
|
|
28
|
+
else if (css[i] === "\"" || css[i] === "'") i = skipString(css, i) - 1;
|
|
29
|
+
else if (css[i] === "{") depth++;
|
|
30
|
+
else if (css[i] === "}" && --depth === 0) return i;
|
|
31
|
+
return -1;
|
|
32
|
+
}
|
|
33
|
+
/** NativeScript has no cascade-layer model; retain the rules and drop only their wrappers. */
|
|
34
|
+
function unwrapCssLayers(css) {
|
|
35
|
+
let output = "";
|
|
36
|
+
let copiedThrough = 0;
|
|
37
|
+
for (let i = 0; i < css.length; i++) {
|
|
38
|
+
if (css.startsWith("/*", i)) {
|
|
39
|
+
i = skipComment(css, i) - 1;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
if (css[i] === "\"" || css[i] === "'") {
|
|
43
|
+
i = skipString(css, i) - 1;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (!css.startsWith("@layer", i) || /[\w-]/.test(css[i + 6] ?? "")) continue;
|
|
47
|
+
const delimiter = atRuleDelimiter(css, i + 6);
|
|
48
|
+
if (!delimiter) continue;
|
|
49
|
+
output += css.slice(copiedThrough, i);
|
|
50
|
+
if (delimiter.token === ";") {
|
|
51
|
+
i = delimiter.index;
|
|
52
|
+
copiedThrough = i + 1;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const close = matchingBrace(css, delimiter.index);
|
|
56
|
+
if (close < 0) throw new Error("Unclosed @layer block in NativeScript stylesheet");
|
|
57
|
+
output += unwrapCssLayers(css.slice(delimiter.index + 1, close));
|
|
58
|
+
i = close;
|
|
59
|
+
copiedThrough = close + 1;
|
|
60
|
+
}
|
|
61
|
+
return output + css.slice(copiedThrough);
|
|
62
|
+
}
|
|
63
|
+
export { unwrapCssLayers };
|