@bake-native/core 0.1.0-rc.0 → 0.1.0-rc.2
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/THIRD_PARTY_NOTICES.txt +1 -1
- package/close-watcher.js +137 -0
- package/compat.json +3 -3
- package/dist/bake.mjs +9 -9
- package/dist/{build-CMsvCcZ0.mjs → build-CTvDcJg_.mjs} +1 -1
- package/dist/{build-CkLSZw06.mjs → build-CoK3bspu.mjs} +5 -3
- package/dist/compiler.mjs +1 -1
- package/dist/{dev-Cskd8Hl4.mjs → dev-CyIzIurx.mjs} +9 -5
- package/dist/{native-views-BuzB9x5H.mjs → native-views-COg9tj_5.mjs} +271 -60
- package/dist/octane/package.json +1 -1
- package/dist/{package-KkUSMoji.mjs → package-CYWHh6C1.mjs} +42 -38
- package/dist/react/package.json +1 -1
- package/dist/{run-D2aPm54a.mjs → run-C44lJhc4.mjs} +1 -1
- package/dist/screens/package.json +1 -1
- package/host-runtime.js +14 -1
- package/native-globals.d.ts +10 -0
- package/native-support.json +26 -9
- package/package.json +6 -5
- package/runtime-provides.json +2 -1
- package/swift-ui/modifiers.js +14 -2
package/THIRD_PARTY_NOTICES.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
THIRD-PARTY NOTICES: @bake-native/core 0.1.0-rc.
|
|
1
|
+
THIRD-PARTY NOTICES: @bake-native/core 0.1.0-rc.2
|
|
2
2
|
Generated by tools/release/third-party.mjs (https://github.com/gronxb/bake-native). Do not edit.
|
|
3
3
|
|
|
4
4
|
@bake-native/core is licensed under the MIT License (LICENSE). It also contains the third-party
|
package/close-watcher.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// The HTML Standard's CloseWatcher on native targets ("close requests and close watchers", as
|
|
2
|
+
// Chromium implements it: Android's back is a close request). The core keeps the root's
|
|
3
|
+
// close-request stack (bake_core::close_watch): auto popovers, aria-modal dialogs of the page and
|
|
4
|
+
// these watchers, newest on top. `new CloseWatcher()` posts `closeWatcher {id, op: "add"}`; a
|
|
5
|
+
// close request for it comes back as `__bakeDispatch(-1, {type: "closerequest", id})`.
|
|
6
|
+
//
|
|
7
|
+
// Not as in Chromium: an app is not an untrusted page, so watchers created without a user
|
|
8
|
+
// activation are not grouped together, and `cancel` is always cancelable (an app may keep the
|
|
9
|
+
// screen on back, as React Native's BackHandler can).
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Installs `CloseWatcher` on `global`. `post(channel, json)` reaches the core (null: no core,
|
|
13
|
+
* as while baking: watchers then do nothing). Returns the close request handler for watcher id.
|
|
14
|
+
*/
|
|
15
|
+
export function installCloseWatcher(global, post) {
|
|
16
|
+
const watchers = new Map();
|
|
17
|
+
let nextId = 1;
|
|
18
|
+
const S = Symbol('closeWatcher');
|
|
19
|
+
|
|
20
|
+
function fire(watcher, type, cancelable) {
|
|
21
|
+
const s = watcher[S];
|
|
22
|
+
let prevented = false;
|
|
23
|
+
const event = {
|
|
24
|
+
type,
|
|
25
|
+
bubbles: false,
|
|
26
|
+
cancelable,
|
|
27
|
+
target: watcher,
|
|
28
|
+
currentTarget: watcher,
|
|
29
|
+
eventPhase: 2,
|
|
30
|
+
isTrusted: true,
|
|
31
|
+
get defaultPrevented() {
|
|
32
|
+
return prevented;
|
|
33
|
+
},
|
|
34
|
+
preventDefault() {
|
|
35
|
+
if (cancelable) prevented = true;
|
|
36
|
+
},
|
|
37
|
+
stopPropagation() {},
|
|
38
|
+
stopImmediatePropagation() {
|
|
39
|
+
event.__immediate = true;
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
const handler = s.handlers[type];
|
|
43
|
+
const listeners = [...s.listeners].filter((l) => l.type === type);
|
|
44
|
+
if (typeof handler === 'function') handler.call(watcher, event);
|
|
45
|
+
for (const l of listeners) {
|
|
46
|
+
if (event.__immediate) break;
|
|
47
|
+
if (!s.listeners.has(l)) continue;
|
|
48
|
+
if (l.once) s.listeners.delete(l);
|
|
49
|
+
l.fn.call(watcher, event);
|
|
50
|
+
}
|
|
51
|
+
return !prevented;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
class CloseWatcher {
|
|
55
|
+
constructor(options) {
|
|
56
|
+
const signal = options?.signal;
|
|
57
|
+
this[S] = { id: 0, active: false, cancelling: false, handlers: { cancel: null, close: null }, listeners: new Set() };
|
|
58
|
+
if (signal?.aborted) return;
|
|
59
|
+
const s = this[S];
|
|
60
|
+
s.id = nextId++;
|
|
61
|
+
s.active = true;
|
|
62
|
+
watchers.set(s.id, this);
|
|
63
|
+
post?.('closeWatcher', JSON.stringify({ id: s.id, op: 'add' }));
|
|
64
|
+
if (signal) {
|
|
65
|
+
const abort = () => this.destroy();
|
|
66
|
+
if (typeof signal.addEventListener === 'function') signal.addEventListener('abort', abort, { once: true });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
get oncancel() {
|
|
71
|
+
return this[S].handlers.cancel;
|
|
72
|
+
}
|
|
73
|
+
set oncancel(fn) {
|
|
74
|
+
this[S].handlers.cancel = typeof fn === 'function' ? fn : null;
|
|
75
|
+
}
|
|
76
|
+
get onclose() {
|
|
77
|
+
return this[S].handlers.close;
|
|
78
|
+
}
|
|
79
|
+
set onclose(fn) {
|
|
80
|
+
this[S].handlers.close = typeof fn === 'function' ? fn : null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** As a close request (Android's back) would: `cancel` (cancelable), then `close`. */
|
|
84
|
+
requestClose() {
|
|
85
|
+
const s = this[S];
|
|
86
|
+
if (!s.active || s.cancelling) return;
|
|
87
|
+
s.cancelling = true;
|
|
88
|
+
let go;
|
|
89
|
+
try {
|
|
90
|
+
go = fire(this, 'cancel', true);
|
|
91
|
+
} finally {
|
|
92
|
+
s.cancelling = false;
|
|
93
|
+
}
|
|
94
|
+
if (go) this.close();
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/** Closes without `cancel`: destroys the watcher, then fires `close`. */
|
|
98
|
+
close() {
|
|
99
|
+
if (!this[S].active) return;
|
|
100
|
+
this.destroy();
|
|
101
|
+
fire(this, 'close', false);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Takes the watcher off the stack without events. */
|
|
105
|
+
destroy() {
|
|
106
|
+
const s = this[S];
|
|
107
|
+
if (!s.active) return;
|
|
108
|
+
s.active = false;
|
|
109
|
+
watchers.delete(s.id);
|
|
110
|
+
post?.('closeWatcher', JSON.stringify({ id: s.id, op: 'remove' }));
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
addEventListener(type, fn, options) {
|
|
114
|
+
if (typeof fn !== 'function' || (type !== 'cancel' && type !== 'close')) return;
|
|
115
|
+
const once = typeof options === 'object' && options !== null && !!options.once;
|
|
116
|
+
for (const l of this[S].listeners) if (l.type === type && l.fn === fn) return;
|
|
117
|
+
const l = { type, fn, once };
|
|
118
|
+
this[S].listeners.add(l);
|
|
119
|
+
const signal = typeof options === 'object' && options !== null ? options.signal : null;
|
|
120
|
+
if (signal?.aborted) this[S].listeners.delete(l);
|
|
121
|
+
else if (signal && typeof signal.addEventListener === 'function') signal.addEventListener('abort', () => this[S].listeners.delete(l), { once: true });
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
removeEventListener(type, fn) {
|
|
125
|
+
for (const l of this[S].listeners) if (l.type === type && l.fn === fn) this[S].listeners.delete(l);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
Object.defineProperty(global, 'CloseWatcher', { value: CloseWatcher, writable: true, configurable: true, enumerable: false });
|
|
130
|
+
|
|
131
|
+
return (id) => {
|
|
132
|
+
const watcher = watchers.get(id);
|
|
133
|
+
// Destroyed in JS while the request was on its way: the core forgets it.
|
|
134
|
+
if (!watcher) post?.('closeWatcher', JSON.stringify({ id, op: 'remove' }));
|
|
135
|
+
else watcher.requestClose();
|
|
136
|
+
};
|
|
137
|
+
}
|
package/compat.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$comment": "The version table: which runtime, host protocol, Hermes bytecode, schemas and Octane this @bake-native/core release builds for, and the toolchain package each host installs (its bin/ tools, apps and libraries, and apple/: the prebuilt Apple runtime iOS and macOS apps link). bake build refuses any other combination (src/compat.ts); tools/check-versions.mjs keeps it equal to the Rust core, the Swift host, the Hermes pin and the toolchain packages. Change versions with tools/release/version.mjs.",
|
|
3
|
-
"@bake-native/core": "0.1.0-rc.
|
|
3
|
+
"@bake-native/core": "0.1.0-rc.2",
|
|
4
4
|
"runtime": {
|
|
5
|
-
"version": "0.1.0-rc.
|
|
5
|
+
"version": "0.1.0-rc.2",
|
|
6
6
|
"series": "0.1"
|
|
7
7
|
},
|
|
8
8
|
"hostProtocol": 4,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"commit": "f7b0b8632a926720a777564d1264c027a95bb49f",
|
|
12
12
|
"bytecode": 100
|
|
13
13
|
},
|
|
14
|
-
"schemaDigest": "
|
|
14
|
+
"schemaDigest": "0x377ed5b41f9a99cc",
|
|
15
15
|
"batchDigest": "0xd4c77b3d54621b67",
|
|
16
16
|
"octane": "0.27.1",
|
|
17
17
|
"toolchain": {
|
package/dist/bake.mjs
CHANGED
|
@@ -3,12 +3,12 @@ import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
|
|
|
3
3
|
import { closeSync, copyFileSync, cpSync, existsSync, fstatSync, mkdirSync, mkdtempSync, openSync, readFileSync, readSync, readdirSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { basename, dirname, extname, join, relative, resolve, sep } from "node:path";
|
|
5
5
|
import { C as flag, D as integer, E as float, F as optional, I as withDefault, M as or, N as map, O as string, P as multiple, S as constant, T as choice, _ as inspectRequest, b as argument, g as inspectParser, j as object, l as inspectParsed, w as option, wt as message, x as command } from "./client-Cm7o6dQd.mjs";
|
|
6
|
-
import { c as TARGETS, d as targetList$1, f as writeMobileApp, l as loadBakeConfig, n as aarPackageManifest, r as checkAar, s as DEFAULT_CONFIG_TARGETS, t as run, u as resolveTargets } from "./run-
|
|
7
|
-
import { A as writeRegistration, C as bundleAppModules, D as registrationFiles, E as checkoutRelative, G as toolchainFor, I as repo, J as execToolBuffer, L as toolProcessEnv, N as defaultHermesc, P as nativeTool, R as COMPAT, S as appViewUnit, T as bundleViews, W as toolchainDir, Z as NOTICES_JSON, a as androidIdentity, b as FAMILY, d as thirdPartyDeclarations, et as mergeComponents, k as targetNativeDeps, n as packageConfig, nt as readNoticesJson, q as execTool, rt as writeOutputNotices, s as integrateThirdParty, tt as placedAt, w as bundleModules, x as appModuleSources } from "./package-
|
|
6
|
+
import { c as TARGETS, d as targetList$1, f as writeMobileApp, l as loadBakeConfig, n as aarPackageManifest, r as checkAar, s as DEFAULT_CONFIG_TARGETS, t as run, u as resolveTargets } from "./run-C44lJhc4.mjs";
|
|
7
|
+
import { A as writeRegistration, C as bundleAppModules, D as registrationFiles, E as checkoutRelative, G as toolchainFor, I as repo, J as execToolBuffer, L as toolProcessEnv, N as defaultHermesc, P as nativeTool, R as COMPAT, S as appViewUnit, T as bundleViews, W as toolchainDir, Z as NOTICES_JSON, a as androidIdentity, b as FAMILY, d as thirdPartyDeclarations, et as mergeComponents, k as targetNativeDeps, n as packageConfig, nt as readNoticesJson, q as execTool, rt as writeOutputNotices, s as integrateThirdParty, tt as placedAt, w as bundleModules, x as appModuleSources } from "./package-CYWHh6C1.mjs";
|
|
8
8
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
9
9
|
import { execFileSync } from "node:child_process";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
|
-
import { A as moduleDir, C as MODULES_DIR, D as compareVersions, E as buildRegistry, F as registryLocation, I as satisfies, J as unpinnedPackages, L as sha256$1, M as openRegistry, N as parseRequest, O as filesFor, P as readLock, S as LOCK_FILE, T as appModules,
|
|
11
|
+
import { A as moduleDir, C as MODULES_DIR, D as compareVersions, E as buildRegistry, F as registryLocation, I as satisfies, J as unpinnedPackages, L as sha256$1, M as openRegistry, N as parseRequest, O as filesFor, P as readLock, S as LOCK_FILE, T as appModules, Wt as packageRoot$1, X as merge3, Y as diffStat, Z as unifiedDiff, _ as specsSchema, f as generateSpecs, j as normalize$1, k as lockEntry, o as viewFiles, ot as releaseCheck, r as viewCatalog, s as viewIssues, t as readViewSpec, u as appModuleSpecs, x as ALL_TARGETS, z as writeLock } from "./native-views-COg9tj_5.mjs";
|
|
12
12
|
import { n as loadReactCompiler, r as selectRenderer } from "./build-tools-Dxyl6XAf.mjs";
|
|
13
13
|
// src/apple-runtime.ts
|
|
14
14
|
/** The runtime's files in the toolchain package's apple/ directory. */
|
|
@@ -2128,17 +2128,17 @@ async function main() {
|
|
|
2128
2128
|
}
|
|
2129
2129
|
});
|
|
2130
2130
|
switch (input.command) {
|
|
2131
|
-
case "build": return (await import("./build-
|
|
2131
|
+
case "build": return (await import("./build-CTvDcJg_.mjs")).buildCommand(await resolveBuildOptions(input));
|
|
2132
2132
|
case "package": {
|
|
2133
2133
|
const opts = await resolveBuildOptions(input);
|
|
2134
|
-
const { buildCommand, packageCommand } = await import("./build-
|
|
2134
|
+
const { buildCommand, packageCommand } = await import("./build-CTvDcJg_.mjs");
|
|
2135
2135
|
return input.standalone ? buildCommand(opts) : packageCommand(opts);
|
|
2136
2136
|
}
|
|
2137
2137
|
case "check": {
|
|
2138
2138
|
const root = resolve(input.root);
|
|
2139
2139
|
const config = await loadBakeConfig(root);
|
|
2140
2140
|
const targets = resolveTargets(input.targets, config, [...platforms]);
|
|
2141
|
-
return (await import("./build-
|
|
2141
|
+
return (await import("./build-CTvDcJg_.mjs")).checkCommand({
|
|
2142
2142
|
root,
|
|
2143
2143
|
targets,
|
|
2144
2144
|
json: input.json,
|
|
@@ -2156,7 +2156,7 @@ async function main() {
|
|
|
2156
2156
|
case "aot": {
|
|
2157
2157
|
const root = resolve(input.root);
|
|
2158
2158
|
const config = await loadBakeConfig(root);
|
|
2159
|
-
return (await import("./build-
|
|
2159
|
+
return (await import("./build-CTvDcJg_.mjs")).aotCommand({
|
|
2160
2160
|
root,
|
|
2161
2161
|
renderer: config?.config.renderer,
|
|
2162
2162
|
json: input.json,
|
|
@@ -2165,7 +2165,7 @@ async function main() {
|
|
|
2165
2165
|
});
|
|
2166
2166
|
}
|
|
2167
2167
|
case "create": return createCommand(input);
|
|
2168
|
-
case "dev": return (await import("./dev-
|
|
2168
|
+
case "dev": return (await import("./dev-CyIzIurx.mjs")).devCommand(await resolveDevOptions(input));
|
|
2169
2169
|
case "add":
|
|
2170
2170
|
case "diff":
|
|
2171
2171
|
case "upgrade":
|
|
@@ -2191,7 +2191,7 @@ async function main() {
|
|
|
2191
2191
|
const args = [bundle];
|
|
2192
2192
|
for (const [key, value] of Object.entries(options)) if (value !== void 0) args.push("--" + key, String(value));
|
|
2193
2193
|
const hermesc = defaultHermesc();
|
|
2194
|
-
const prelude = hermesc ? { BAKE_FRAME_PRELUDE: (await import("./build-
|
|
2194
|
+
const prelude = hermesc ? { BAKE_FRAME_PRELUDE: (await import("./build-CTvDcJg_.mjs")).bakePrelude(hermesc) } : {};
|
|
2195
2195
|
process.stdout.write(execToolBuffer(nativeTool("bake-snap"), args, {
|
|
2196
2196
|
env: {
|
|
2197
2197
|
...toolProcessEnv(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as aotCommand, i as bakePrelude, a as buildCommand, o as buildTargets, c as checkCommand, l as packageCommand } from "./build-
|
|
1
|
+
export { n as aotCommand, i as bakePrelude, a as buildCommand, o as buildTargets, c as checkCommand, l as packageCommand } from "./build-CoK3bspu.mjs";
|
|
@@ -8,10 +8,10 @@ import { tmpdir } from "node:os";
|
|
|
8
8
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
9
9
|
import { createContext, runInContext } from "node:vm";
|
|
10
10
|
import { performance } from "node:perf_hooks";
|
|
11
|
-
import { $ as bundleComponents, A as writeRegistration, D as registrationFiles, E as checkoutRelative, F as nativeTools, G as toolchainFor, H as hermescPackage, I as repo, L as toolProcessEnv, M as NATIVE_RENDERER, O as targetFiles, P as nativeTool, R as COMPAT, S as appViewUnit, V as hermescBytecode, X as NOTICES, Y as toolTimeout, Z as NOTICES_JSON, _ as run, b as FAMILY, et as mergeComponents, f as TARGET_SLICES, g as productName, h as packageSwift, j as implementationIssues, k as targetNativeDeps, m as buildPackageXCFramework, n as packageConfig, nt as readNoticesJson, p as buildAppXCFramework, q as execTool, r as packageManifest, rt as writeOutputNotices, t as RUNTIME_VERSION, tt as placedAt, u as rangeAccepts, v as runtimeNoticeFiles, x as appModuleSources, y as zipForSwiftPM, z as assertCompatible } from "./package-
|
|
11
|
+
import { $ as bundleComponents, A as writeRegistration, D as registrationFiles, E as checkoutRelative, F as nativeTools, G as toolchainFor, H as hermescPackage, I as repo, L as toolProcessEnv, M as NATIVE_RENDERER, O as targetFiles, P as nativeTool, R as COMPAT, S as appViewUnit, V as hermescBytecode, X as NOTICES, Y as toolTimeout, Z as NOTICES_JSON, _ as run, b as FAMILY, et as mergeComponents, f as TARGET_SLICES, g as productName, h as packageSwift, j as implementationIssues, k as targetNativeDeps, m as buildPackageXCFramework, n as packageConfig, nt as readNoticesJson, p as buildAppXCFramework, q as execTool, r as packageManifest, rt as writeOutputNotices, t as RUNTIME_VERSION, tt as placedAt, u as rangeAccepts, v as runtimeNoticeFiles, x as appModuleSources, y as zipForSwiftPM, z as assertCompatible } from "./package-CYWHh6C1.mjs";
|
|
12
12
|
import { createRequire } from "node:module";
|
|
13
13
|
import { r as selectRenderer, t as loadBuildTools } from "./build-tools-Dxyl6XAf.mjs";
|
|
14
|
-
import { B as DEPS_RULE, Bt as
|
|
14
|
+
import { At as rootPropParams, B as DEPS_RULE, Bt as usesViewRef, Ct as importLine, Dt as originalPosition, Et as markupIssues, Ft as usesCustomProperties, G as packageDepIssues, Ht as usesWebCrypto, It as usesDialogs, J as unpinnedPackages, Lt as usesElementApi, Mt as swiftUiIssues, Nt as swiftUiTargetMessage, P as readLock, Pt as uiIssues, Q as FIRST_PARTY_MODULES, R as verifyModules, Rt as usesPageElements, S as LOCK_FILE, St as hostEmitIssues, T as appModules, Tt as liveReferences, U as nativeDepComponents, Ut as usesWebFetch, V as NativeDepsError, Vt as usesVisibility, Wt as packageRoot, _t as decodeMappings, b as webSpec, bt as globalIssues, c as viewRequires, d as calledSpecs, dt as allowed, et as bundleRequires, gt as deadBranches, kt as refineLine, m as parseModuleSpec, mt as componentDeclarations, n as usedViews, nt as cssProperties, r as viewCatalog, s as viewIssues, tt as checkUses, u as appModuleSpecs, vt as dialogWarnings, wt as lineStartsOf, xt as headerIconIssues, yt as freeReferences, zt as usesPopover } from "./native-views-COg9tj_5.mjs";
|
|
15
15
|
import { r as scope_exports } from "./scope-8W2aIuQ9.mjs";
|
|
16
16
|
import { i as intlUses, n as HERMES_TARGETS, r as intlMessage } from "./intl-ROnAp2qO.mjs";
|
|
17
17
|
// lower-views.mjs
|
|
@@ -3827,6 +3827,7 @@ function styleTagLines(text) {
|
|
|
3827
3827
|
* dependencies). */
|
|
3828
3828
|
function intlLint(root, target) {
|
|
3829
3829
|
const errors = [];
|
|
3830
|
+
const realRoot = realpathOr(root);
|
|
3830
3831
|
return {
|
|
3831
3832
|
errors,
|
|
3832
3833
|
plugin: {
|
|
@@ -3846,6 +3847,7 @@ function intlLint(root, target) {
|
|
|
3846
3847
|
try {
|
|
3847
3848
|
text = readFileSync(file, "utf8");
|
|
3848
3849
|
} catch {}
|
|
3850
|
+
const source = relative(realRoot, realpathOr(file)).replaceAll("\\", "/");
|
|
3849
3851
|
const seen = {};
|
|
3850
3852
|
for (const u of uses) {
|
|
3851
3853
|
const needle = new RegExp(`\\bIntl\\s*(?:\\.\\s*|\\[\\s*['"\`])${u.name}\\b|\\b${u.name}\\b(?=[^=]*\\}\\s*=\\s*Intl\\b)`, "g");
|
|
@@ -3854,7 +3856,7 @@ function intlLint(root, target) {
|
|
|
3854
3856
|
const at = hits.length ? hits[Math.min(k, hits.length - 1)] : -1;
|
|
3855
3857
|
const before = at >= 0 ? text.slice(0, at) : "";
|
|
3856
3858
|
errors.push({
|
|
3857
|
-
file:
|
|
3859
|
+
file: source,
|
|
3858
3860
|
line: at >= 0 ? before.split("\n").length : 1,
|
|
3859
3861
|
column: at >= 0 ? at - before.lastIndexOf("\n") : 1,
|
|
3860
3862
|
id: "intl-unsupported",
|
package/dist/compiler.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { parseSync } from "@tsrx/oxc/parser";
|
|
2
|
-
import {
|
|
2
|
+
import { Kt as checkElement, Ot as patternNames, _t as decodeMappings, a as viewDeclarations, ct as SUPPORT, ft as checkImageSourceSyntax, ht as constNumber, i as viewClientParts, jt as styleCss, pt as checkSafeAreaEdgesSyntax, ut as VIEW_ELEMENTS, wt as lineStartsOf } from "./native-views-COg9tj_5.mjs";
|
|
3
3
|
import { n as UI_SWIFT_STYLE_KEYS, t as UI_COMPONENTS } from "./scope-8W2aIuQ9.mjs";
|
|
4
4
|
export { SUPPORT, UI_COMPONENTS, UI_SWIFT_STYLE_KEYS, VIEW_ELEMENTS, checkElement, checkImageSourceSyntax, checkSafeAreaEdgesSyntax, constNumber, decodeMappings, lineStartsOf, parseSync, patternNames, styleCss, viewClientParts, viewDeclarations };
|
|
@@ -4,8 +4,8 @@ import { createServer } from "node:http";
|
|
|
4
4
|
import { basename, extname, join, resolve, sep } from "node:path";
|
|
5
5
|
import { performance } from "node:perf_hooks";
|
|
6
6
|
import { promisify } from "node:util";
|
|
7
|
-
import { o as buildTargets } from "./build-
|
|
8
|
-
import { I as repo, U as packagedTool } from "./package-
|
|
7
|
+
import { o as buildTargets } from "./build-CoK3bspu.mjs";
|
|
8
|
+
import { I as repo, U as packagedTool } from "./package-CYWHh6C1.mjs";
|
|
9
9
|
// src/devices.mjs
|
|
10
10
|
/** The booted simulator bake dev uses: `udid` when given (it must be booted), else the only booted one. */
|
|
11
11
|
function pickSimulator(devices, udid) {
|
|
@@ -235,13 +235,17 @@ async function devCommand(opts) {
|
|
|
235
235
|
for (const f of files) if (!pending.files.includes(f)) pending.files.push(f);
|
|
236
236
|
schedule();
|
|
237
237
|
}
|
|
238
|
-
const
|
|
238
|
+
const watchStartedAt = process.platform === "darwin" ? performance.timeOrigin + performance.now() : 0;
|
|
239
|
+
const watcher = opts.once ? null : watch(opts.root, { recursive: true }, (type, filename) => {
|
|
239
240
|
const rel = filename ? String(filename) : "";
|
|
240
241
|
if (!watchedChange(rel)) return;
|
|
241
242
|
const file = rel.replaceAll("\\", "/");
|
|
242
243
|
try {
|
|
243
|
-
|
|
244
|
-
|
|
244
|
+
const stat = statSync(join(opts.root, rel));
|
|
245
|
+
if (stat.isDirectory() || watchStartedAt && stat.ctimeMs < watchStartedAt) return;
|
|
246
|
+
} catch (error) {
|
|
247
|
+
if (watchStartedAt && error.code === "ENOENT" && type === "change" && rel === basename(opts.root)) return;
|
|
248
|
+
}
|
|
245
249
|
if (NATIVE_SOURCES.has(extname(file).toLowerCase())) {
|
|
246
250
|
emit({
|
|
247
251
|
event: "notice",
|