@lucent-lang/lucent 0.1.1 → 0.1.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.
@@ -1,4 +1,4 @@
1
- import { E as identityScript, N as projectFiles, O as coreJsPath, f as runtimeDir, j as moduleNameOf, n as compile } from "./src-ChnmWLwn.js";
1
+ import { E as identityScript, N as projectFiles, O as coreJsPath, f as runtimeDir, j as moduleNameOf, n as compile } from "./src-Bzpv4-ox.js";
2
2
  import { i as table } from "./format-D9fnIMEx.js";
3
3
  import { t as renderDiagnostic } from "./diagnostic-BvwLZQS1.js";
4
4
  import fs from "node:fs";
@@ -1,4 +1,4 @@
1
- import { t as buildOrCheck } from "./build-check-BA1ZEp9s.js";
1
+ import { t as buildOrCheck } from "./build-check-DYWM9LHo.js";
2
2
  //#region src/cli/commands/build.ts
3
3
  function run(invocation) {
4
4
  return buildOrCheck("build", invocation);
@@ -1,7 +1,7 @@
1
1
  import { n as version } from "./version-bqpIO5sP.js";
2
2
  import { i as table, n as duration } from "./format-D9fnIMEx.js";
3
3
  import { t as renderDiagnostic } from "./diagnostic-BvwLZQS1.js";
4
- import { a as filesText, i as ACTION_TEXT, n as nextText, r as plural, t as buildProject } from "./pipeline-BM_VM2X_.js";
4
+ import { a as filesText, i as ACTION_TEXT, n as nextText, r as plural, t as buildProject } from "./pipeline-rDlFUUa1.js";
5
5
  import { t as plainSteps } from "./steps--_h-FFS7.js";
6
6
  import fs from "node:fs";
7
7
  import path from "node:path";
@@ -1,4 +1,4 @@
1
- import { t as buildOrCheck } from "./build-check-BA1ZEp9s.js";
1
+ import { t as buildOrCheck } from "./build-check-DYWM9LHo.js";
2
2
  //#region src/cli/commands/check.ts
3
3
  function run(invocation) {
4
4
  return buildOrCheck("check", invocation);
package/dist/cli.js CHANGED
@@ -115,7 +115,7 @@ const commands = [
115
115
  description: "Fail unless the SDKs and SDK symbols are the ones lucent-sdk.lock.json records, with every target it lists (CI, releases)"
116
116
  }
117
117
  ],
118
- load: () => import("./build-CpUjeHFz.js")
118
+ load: () => import("./build-B2E9SkG_.js")
119
119
  },
120
120
  {
121
121
  name: "check",
@@ -124,7 +124,7 @@ const commands = [
124
124
  name: "frozen",
125
125
  description: "Fail unless the SDKs and SDK symbols are the ones lucent-sdk.lock.json records, with every target it lists (CI, releases)"
126
126
  }],
127
- load: () => import("./check-BZx3FgI6.js")
127
+ load: () => import("./check-DzsBZmBa.js")
128
128
  },
129
129
  {
130
130
  name: "dev",
@@ -133,7 +133,7 @@ const commands = [
133
133
  name: "compact",
134
134
  description: "One line per build instead of the dashboard (Metro runs it so)"
135
135
  }],
136
- load: () => import("./dev-DI5yL8zx.js")
136
+ load: () => import("./dev-ClJalHD4.js")
137
137
  },
138
138
  {
139
139
  name: "doctor",
@@ -179,7 +179,7 @@ const commands = [
179
179
  name: "bench",
180
180
  summary: "Time the cases of your *.bench.ts files natively and as JavaScript, and show the speedup (needs a desktop Hermes)",
181
181
  flags: [],
182
- load: () => import("./bench-eEez4jhQ.js")
182
+ load: () => import("./bench-Ec_oPBhN.js")
183
183
  },
184
184
  {
185
185
  name: "trace",
@@ -208,13 +208,13 @@ const commands = [
208
208
  name: "sdk search",
209
209
  summary: "Find SDK classes and members by name, with the import to copy (your imports and the SDK cache)",
210
210
  flags: [],
211
- load: () => import("./sdk-search-CPGJm_Ne.js")
211
+ load: () => import("./sdk-search-BDercg36.js")
212
212
  },
213
213
  {
214
214
  name: "sdk show",
215
215
  summary: "Print the declaration Lucent code sees for an SDK type or member: android.os.Vibrator, UIKit.UIDevice.current",
216
216
  flags: [],
217
- load: () => import("./sdk-show-BUkLqRnA.js")
217
+ load: () => import("./sdk-show-DEdKobD7.js")
218
218
  },
219
219
  {
220
220
  name: "sdk prefetch",
@@ -237,7 +237,7 @@ const commands = [
237
237
  description: "Every module of every installed SDK"
238
238
  }
239
239
  ],
240
- load: () => import("./sdk-prefetch-Bv2pNega.js")
240
+ load: () => import("./sdk-prefetch-D-MAqtZs.js")
241
241
  },
242
242
  {
243
243
  name: "sdk lock",
@@ -247,7 +247,7 @@ const commands = [
247
247
  value: "list",
248
248
  description: "Targets to record: ios, android (default: every platform the project has code for, each needing its SDK)"
249
249
  }],
250
- load: () => import("./sdk-lock-BQn7IyRs.js")
250
+ load: () => import("./sdk-lock-BWHZdSu-.js")
251
251
  },
252
252
  {
253
253
  name: "sdk diff",
@@ -256,7 +256,7 @@ const commands = [
256
256
  name: "all",
257
257
  description: "Also the other members of the modules the project uses (the locked schemas must be in this machine's SDK cache)"
258
258
  }],
259
- load: () => import("./sdk-diff-ByJ1Gw-F.js")
259
+ load: () => import("./sdk-diff-DbPQmOSD.js")
260
260
  },
261
261
  {
262
262
  name: "sdk coverage",
@@ -287,7 +287,7 @@ const commands = [
287
287
  description: "List every member with its stage, key and reason"
288
288
  }
289
289
  ],
290
- load: () => import("./sdk-coverage-iiv3JqMp.js")
290
+ load: () => import("./sdk-coverage-DL81IAi9.js")
291
291
  }
292
292
  ];
293
293
  //#endregion
package/dist/compiler.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { n as Explanations, r as docsUrl, t as Codes } from "./codes-D-6LxUqD.js";
2
- import { A as findLucentFiles, C as bindExtensions, D as LUCENT_EXTENSION, E as identityScript, F as moduleNamespace, G as cachedModules, I as extensionDts, J as forgetLoadedSdks, L as sdkDts, M as platformOf, N as projectFiles, O as coreJsPath, P as usesPlatforms, Q as sdkNames, R as coverage, S as inNativePackage, T as RUNTIME_ABI, W as podsSearchPaths, X as sdkAvailable, Y as prefetch, _ as VIEW_CONTRACT_VERSION, a as report, b as PACKAGE_FIELDS, c as sdkModules, d as isUpToDate, f as runtimeDir, g as libraryBuildGradle, h as toolkitsFrom, i as projectExtensions, j as moduleNameOf, k as coreTypesPath, l as deferredLibraryGradle, m as jsxToolkits, n as compile, o as sdkDeclarations, p as writeNativePackage, q as extractionCount, r as compileDirectory, s as sdkModule, t as checkSources, tt as formatDiagnostic, u as inputsKey, v as resolveNative, w as forgetExtensionHeaders, x as fileHashes, y as EXTENSION_FIELDS } from "./src-ChnmWLwn.js";
2
+ import { A as findLucentFiles, C as bindExtensions, D as LUCENT_EXTENSION, E as identityScript, F as moduleNamespace, G as cachedModules, I as extensionDts, J as forgetLoadedSdks, L as sdkDts, M as platformOf, N as projectFiles, O as coreJsPath, P as usesPlatforms, Q as sdkNames, R as coverage, S as inNativePackage, T as RUNTIME_ABI, W as podsSearchPaths, X as sdkAvailable, Y as prefetch, _ as VIEW_CONTRACT_VERSION, a as report, b as PACKAGE_FIELDS, c as sdkModules, d as isUpToDate, f as runtimeDir, g as libraryBuildGradle, h as toolkitsFrom, i as projectExtensions, j as moduleNameOf, k as coreTypesPath, l as deferredLibraryGradle, m as jsxToolkits, n as compile, o as sdkDeclarations, p as writeNativePackage, q as extractionCount, r as compileDirectory, s as sdkModule, t as checkSources, tt as formatDiagnostic, u as inputsKey, v as resolveNative, w as forgetExtensionHeaders, x as fileHashes, y as EXTENSION_FIELDS } from "./src-Bzpv4-ox.js";
3
3
  import { i as satisfies, n as lucentPackages, r as lucentVersion } from "./packages-CSmKeaAh.js";
4
4
  export { Codes, EXTENSION_FIELDS, Explanations, LUCENT_EXTENSION, PACKAGE_FIELDS, RUNTIME_ABI, VIEW_CONTRACT_VERSION, bindExtensions, cachedModules, checkSources, compile, compileDirectory, coreJsPath, coreTypesPath, deferredLibraryGradle, docsUrl, extensionDts, extractionCount, fileHashes, findLucentFiles, forgetExtensionHeaders, forgetLoadedSdks, formatDiagnostic, identityScript, inNativePackage, inputsKey, isUpToDate, jsxToolkits, libraryBuildGradle, lucentPackages, lucentVersion, moduleNameOf, moduleNamespace, platformOf, podsSearchPaths, prefetch as prefetchSdk, projectExtensions, projectFiles, report, resolveNative, runtimeDir, satisfies, sdkAvailable, coverage as sdkCoverage, sdkDeclarations, sdkDts, sdkModule, sdkModules, sdkNames, toolkitsFrom, usesPlatforms, writeNativePackage };
@@ -1,5 +1,5 @@
1
1
  import { i as table, n as duration, t as codeFrame } from "./format-D9fnIMEx.js";
2
- import { i as ACTION_TEXT, n as nextText } from "./pipeline-BM_VM2X_.js";
2
+ import { i as ACTION_TEXT, n as nextText } from "./pipeline-rDlFUUa1.js";
3
3
  import { Box, Text, render, useApp, useInput } from "ink";
4
4
  import { useState, useSyncExternalStore } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -1,8 +1,8 @@
1
1
  import { t as createTheme } from "./theme-uv5bc0aK.js";
2
2
  import { n as version } from "./version-bqpIO5sP.js";
3
- import { D as LUCENT_EXTENSION, M as platformOf, j as moduleNameOf } from "./src-ChnmWLwn.js";
3
+ import { D as LUCENT_EXTENSION, M as platformOf, j as moduleNameOf } from "./src-Bzpv4-ox.js";
4
4
  import { n as lucentPackages } from "./packages-CSmKeaAh.js";
5
- import { i as ACTION_TEXT, n as nextText, r as plural, t as buildProject } from "./pipeline-BM_VM2X_.js";
5
+ import { i as ACTION_TEXT, n as nextText, r as plural, t as buildProject } from "./pipeline-rDlFUUa1.js";
6
6
  import { t as plainSteps } from "./steps--_h-FFS7.js";
7
7
  import { n as systemProbe, t as diagnose } from "./doctor-CTAX3euc.js";
8
8
  import fs from "node:fs";
@@ -226,7 +226,7 @@ async function run({ root, flags, out }) {
226
226
  session.stop();
227
227
  return 0;
228
228
  }
229
- const { dashboard } = await import("./dashboard-CC-HXhcd.js");
229
+ const { dashboard } = await import("./dashboard--hlNXMUi.js");
230
230
  await dashboard({
231
231
  session,
232
232
  theme: out.theme,
@@ -1,7 +1,7 @@
1
- import { C as bindExtensions, F as moduleNamespace, M as platformOf, N as projectFiles, P as usesPlatforms, S as inNativePackage, Z as sdkModuleArtifacts, d as isUpToDate, j as moduleNameOf, l as deferredLibraryGradle, n as compile, p as writeNativePackage, q as extractionCount, s as sdkModule, u as inputsKey, v as resolveNative } from "./src-ChnmWLwn.js";
1
+ import { C as bindExtensions, F as moduleNamespace, M as platformOf, N as projectFiles, P as usesPlatforms, S as inNativePackage, Z as sdkModuleArtifacts, d as isUpToDate, j as moduleNameOf, l as deferredLibraryGradle, n as compile, p as writeNativePackage, q as extractionCount, s as sdkModule, u as inputsKey, v as resolveNative } from "./src-Bzpv4-ox.js";
2
2
  import { n as lucentPackages } from "./packages-CSmKeaAh.js";
3
- import { a as projectHashes, c as sdkImports, i as pendingAndroidModules, l as staleAutolinking, n as mapLucentPaths, o as projectSdk, r as missingAppEntries, s as resolveAndroidDependencies, t as backgroundPrefetch, u as writeLinkedPackage } from "./project-BKNoTEEp.js";
4
- import { a as lockProblems, c as sdkUsage, d as writeUsage, i as frozenFailure, l as usageReadable, n as USAGE_FILE, o as readUsage, s as sdkUnavailable, t as LOCK_FILE, u as usedModules } from "./sdk-usage-0ZFMAYg1.js";
3
+ import { a as projectHashes, c as sdkImports, i as pendingAndroidModules, l as staleAutolinking, n as mapLucentPaths, o as projectSdk, r as missingAppEntries, s as resolveAndroidDependencies, t as backgroundPrefetch, u as writeLinkedPackage } from "./project-MN6cwMwO.js";
4
+ import { a as lockProblems, c as sdkUsage, d as writeUsage, i as frozenFailure, l as usageReadable, n as USAGE_FILE, o as readUsage, s as sdkUnavailable, t as LOCK_FILE, u as usedModules } from "./sdk-usage-D_ly-uLw.js";
5
5
  import fs from "node:fs";
6
6
  import path from "node:path";
7
7
  import { createHash } from "node:crypto";
@@ -1,5 +1,5 @@
1
1
  import { t as packageFile } from "./version-bqpIO5sP.js";
2
- import { J as forgetLoadedSdks, W as podsSearchPaths, c as sdkModules, f as runtimeDir, g as libraryBuildGradle, v as resolveNative, x as fileHashes } from "./src-ChnmWLwn.js";
2
+ import { J as forgetLoadedSdks, W as podsSearchPaths, c as sdkModules, f as runtimeDir, g as libraryBuildGradle, v as resolveNative, x as fileHashes } from "./src-Bzpv4-ox.js";
3
3
  import { n as lucentPackages } from "./packages-CSmKeaAh.js";
4
4
  import { t as withLucentPaths } from "./tsconfig-S4uyLNzf.js";
5
5
  import fs from "node:fs";
@@ -1,7 +1,7 @@
1
- import { N as projectFiles, R as coverage, U as symbolKey, c as sdkModules, et as sdkSourceModule, h as toolkitsFrom, s as sdkModule } from "./src-ChnmWLwn.js";
2
- import { c as sdkImports, o as projectSdk } from "./project-BKNoTEEp.js";
1
+ import { N as projectFiles, R as coverage, U as symbolKey, c as sdkModules, et as sdkSourceModule, h as toolkitsFrom, s as sdkModule } from "./src-Bzpv4-ox.js";
2
+ import { c as sdkImports, o as projectSdk } from "./project-MN6cwMwO.js";
3
3
  import { i as table } from "./format-D9fnIMEx.js";
4
- import { n as USAGE_FILE, o as readUsage } from "./sdk-usage-0ZFMAYg1.js";
4
+ import { n as USAGE_FILE, o as readUsage } from "./sdk-usage-D_ly-uLw.js";
5
5
  import fs from "node:fs";
6
6
  import path from "node:path";
7
7
  //#region src/cli/commands/sdk-coverage.ts
@@ -1,7 +1,7 @@
1
- import { B as diffModule, H as displayName, K as cachedSchema, U as symbolKey, V as diffSymbols, s as sdkModule, z as compareArtifacts } from "./src-ChnmWLwn.js";
2
- import { o as projectSdk } from "./project-BKNoTEEp.js";
1
+ import { B as diffModule, H as displayName, K as cachedSchema, U as symbolKey, V as diffSymbols, s as sdkModule, z as compareArtifacts } from "./src-Bzpv4-ox.js";
2
+ import { o as projectSdk } from "./project-MN6cwMwO.js";
3
3
  import { i as table } from "./format-D9fnIMEx.js";
4
- import { o as readUsage, r as artifactText, s as sdkUnavailable, t as LOCK_FILE, u as usedModules } from "./sdk-usage-0ZFMAYg1.js";
4
+ import { o as readUsage, r as artifactText, s as sdkUnavailable, t as LOCK_FILE, u as usedModules } from "./sdk-usage-D_ly-uLw.js";
5
5
  import path from "node:path";
6
6
  //#region src/cli/commands/sdk-diff.ts
7
7
  const entry = (c) => {
@@ -1,5 +1,5 @@
1
- import { r as plural, t as buildProject } from "./pipeline-BM_VM2X_.js";
2
- import { d as writeUsage, t as LOCK_FILE } from "./sdk-usage-0ZFMAYg1.js";
1
+ import { r as plural, t as buildProject } from "./pipeline-rDlFUUa1.js";
2
+ import { d as writeUsage, t as LOCK_FILE } from "./sdk-usage-D_ly-uLw.js";
3
3
  import { t as plainSteps } from "./steps--_h-FFS7.js";
4
4
  import path from "node:path";
5
5
  //#region src/cli/commands/sdk-lock.ts
@@ -1,5 +1,5 @@
1
- import { N as projectFiles, c as sdkModules, q as extractionCount, s as sdkModule } from "./src-ChnmWLwn.js";
2
- import { c as sdkImports, o as projectSdk } from "./project-BKNoTEEp.js";
1
+ import { N as projectFiles, c as sdkModules, q as extractionCount, s as sdkModule } from "./src-Bzpv4-ox.js";
2
+ import { c as sdkImports, o as projectSdk } from "./project-MN6cwMwO.js";
3
3
  import { t as plainSteps } from "./steps--_h-FFS7.js";
4
4
  //#region src/cli/commands/sdk-prefetch.ts
5
5
  async function run({ root, flags, out }) {
@@ -1,5 +1,5 @@
1
- import { G as cachedModules, N as projectFiles, Q as sdkNames, X as sdkAvailable, s as sdkModule } from "./src-ChnmWLwn.js";
2
- import { c as sdkImports, o as projectSdk } from "./project-BKNoTEEp.js";
1
+ import { G as cachedModules, N as projectFiles, Q as sdkNames, X as sdkAvailable, s as sdkModule } from "./src-Bzpv4-ox.js";
2
+ import { c as sdkImports, o as projectSdk } from "./project-MN6cwMwO.js";
3
3
  import { i as table } from "./format-D9fnIMEx.js";
4
4
  //#region src/cli/commands/sdk-search.ts
5
5
  function run({ root, positionals, out }) {
@@ -1,5 +1,5 @@
1
- import { X as sdkAvailable, c as sdkModules, o as sdkDeclarations, s as sdkModule } from "./src-ChnmWLwn.js";
2
- import { o as projectSdk } from "./project-BKNoTEEp.js";
1
+ import { X as sdkAvailable, c as sdkModules, o as sdkDeclarations, s as sdkModule } from "./src-Bzpv4-ox.js";
2
+ import { o as projectSdk } from "./project-MN6cwMwO.js";
3
3
  //#region src/cli/commands/sdk-show.ts
4
4
  function run({ root, positionals, out }) {
5
5
  const t = out.theme;
@@ -1,4 +1,4 @@
1
- import { $ as sdkSchemaEntry, H as displayName, U as symbolKey, X as sdkAvailable, Z as sdkModuleArtifacts, s as sdkModule, z as compareArtifacts } from "./src-ChnmWLwn.js";
1
+ import { $ as sdkSchemaEntry, H as displayName, U as symbolKey, X as sdkAvailable, Z as sdkModuleArtifacts, s as sdkModule, z as compareArtifacts } from "./src-Bzpv4-ox.js";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  //#region src/cli/sdk-usage.ts
@@ -4010,7 +4010,7 @@ function jvmSymbol(internal, member) {
4010
4010
  let extractorHash;
4011
4011
  function extractorVersion() {
4012
4012
  if (extractorHash) return extractorHash;
4013
- return extractorHash = "beb4a07a";
4013
+ return extractorHash = "9bb0f2e9";
4014
4014
  }
4015
4015
  const contentHashes = /* @__PURE__ */ new Map();
4016
4016
  function contentHash(files) {
@@ -8414,12 +8414,15 @@ function extractionCount() {
8414
8414
  }
8415
8415
  const loaded$1 = /* @__PURE__ */ new Map();
8416
8416
  const located$3 = /* @__PURE__ */ new Map();
8417
+ const iosSdks = /* @__PURE__ */ new Map();
8417
8418
  const headerIndexes = /* @__PURE__ */ new Map();
8418
8419
  function forgetLoadedSdks() {
8419
8420
  loaded$1.clear();
8420
8421
  located$3.clear();
8422
+ iosSdks.clear();
8421
8423
  headerIndexes.clear();
8422
8424
  locatedByObject = /* @__PURE__ */ new WeakMap();
8425
+ namesRead = /* @__PURE__ */ new WeakMap();
8423
8426
  }
8424
8427
  const extractorKey = () => [extractorVersion(), `schema format 1`];
8425
8428
  const memoDir = (root) => path.join(root, "memo", extractorVersion());
@@ -8580,21 +8583,20 @@ function podOf(files, podsDir, pods) {
8580
8583
  }
8581
8584
  function locateIos(opts) {
8582
8585
  const xcrun = opts.ios?.xcrun ?? process.env.LUCENT_XCRUN ?? "xcrun";
8583
- const sdk = run(xcrun, [
8584
- "--sdk",
8585
- "iphonesimulator",
8586
- "--show-sdk-path"
8587
- ]);
8588
- const version = run(xcrun, [
8589
- "--sdk",
8590
- "iphonesimulator",
8591
- "--show-sdk-version"
8592
- ]);
8593
- const build = run(xcrun, [
8594
- "--sdk",
8595
- "iphonesimulator",
8596
- "--show-sdk-build-version"
8597
- ]);
8586
+ let answers = iosSdks.get(xcrun);
8587
+ if (!answers) {
8588
+ answers = [
8589
+ "--show-sdk-path",
8590
+ "--show-sdk-version",
8591
+ "--show-sdk-build-version"
8592
+ ].map((q) => run(xcrun, [
8593
+ "--sdk",
8594
+ "iphonesimulator",
8595
+ q
8596
+ ]));
8597
+ iosSdks.set(xcrun, answers);
8598
+ }
8599
+ const [sdk, version, build] = answers;
8598
8600
  if (!sdk || !version || !build) return { missing: `the iOS SDK was not found (${xcrun} --sdk iphonesimulator failed). Install Xcode and select it: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer` };
8599
8601
  const includePaths = opts.ios?.includePaths ?? [];
8600
8602
  const root = cacheRoot(opts.cacheDir);
@@ -8795,8 +8797,15 @@ function graphs(r, modules) {
8795
8797
  });
8796
8798
  return out;
8797
8799
  }
8800
+ let namesRead = /* @__PURE__ */ new WeakMap();
8798
8801
  function namesFor(r, modules) {
8799
- const read = (m) => findEntry(r, path.join(r.scope, m), "names")?.names;
8802
+ const known = namesRead.get(r) ?? /* @__PURE__ */ new Map();
8803
+ namesRead.set(r, known);
8804
+ const read = (m) => {
8805
+ const names = known.get(m) ?? findEntry(r, path.join(r.scope, m), "names")?.names;
8806
+ if (names) known.set(m, names);
8807
+ return names;
8808
+ };
8800
8809
  const missing = modules.filter((m) => !read(m));
8801
8810
  for (const [m, g] of graphs(r, missing)) publishEntry(path.join(r.scope, m), "names", {
8802
8811
  inputs: inputsOf(r, [m]),
@@ -8811,7 +8820,8 @@ function iosNotFound(r, module) {
8811
8820
  ios.moduleMaps?.length ? `${ios.moduleMaps.length} module map${ios.moduleMaps.length === 1 ? "" : "s"}` : "",
8812
8821
  ios.frameworkPaths?.length ? `${ios.frameworkPaths.length} framework path${ios.frameworkPaths.length === 1 ? "" : "s"}` : ""
8813
8822
  ].filter(Boolean);
8814
- return { missing: `lucent:ios/${module} was not found in the SDK or the app's dependencies (${`looked in ${r.ios.frameworks}${extra.length ? ` and the app's pods (${extra.join(", ")}); run pod install after adding a pod` : ""}`})` };
8823
+ const pods = extra.length ? ` and the app's pods (${extra.join(", ")}); run pod install after adding a pod` : "; no pods were read: when it comes from a pod, run pod install first";
8824
+ return { missing: `lucent:ios/${module} was not found in the SDK or the app's dependencies (${`looked in ${r.ios.frameworks}${pods}`})` };
8815
8825
  }
8816
8826
  function extractIosModule(r, module) {
8817
8827
  const { modules, sdk: sdkPath, ios } = r.ios;
@@ -20406,11 +20416,14 @@ var Lowerer = class Lowerer {
20406
20416
  }
20407
20417
  conditional(node, hint) {
20408
20418
  const guard = this.host.platformGuard?.(node.condition);
20409
- const live = guard && guard.runs !== "nowhere" && (guard.runs === "elsewhere" || !guard.rest.length) ? guard.runs === "here" ? node.whenTrue : node.whenFalse : void 0;
20419
+ if (guard?.runs === "nowhere") {
20420
+ const typed = [node.whenTrue, node.whenFalse].find((e) => !(this.host.checker.getTypeAtLocation(e).flags & ts.TypeFlags.Any));
20421
+ return this.platformOnly(node, this.typeAt(typed ?? node));
20422
+ }
20423
+ const live = guard && (guard.runs === "elsewhere" || !guard.rest.length) ? guard.runs === "here" ? node.whenTrue : node.whenFalse : void 0;
20410
20424
  const own = this.typeAt(live ?? node);
20411
20425
  const promised = own.k === "promise" || own.k === "union" && own.ms.some((m) => m.k === "promise");
20412
20426
  const type = hint && !isVoidish(hint) && !promised ? hint : own;
20413
- if (guard?.runs === "nowhere") return this.platformOnly(node, own);
20414
20427
  if (live) return this.coerce(this.expr(live, type), type, live);
20415
20428
  const cond = guard ? this.all(guard.rest) : this.condition(node.condition);
20416
20429
  const branch = (e) => () => this.b.yield(this.coerce(this.expr(e, type), type, e), spanOf(e));
@@ -21330,6 +21343,8 @@ var Emitter = class {
21330
21343
  }
21331
21344
  aliases = /* @__PURE__ */ new Set();
21332
21345
  inlined = /* @__PURE__ */ new Set();
21346
+ temporaries = /* @__PURE__ */ new Map();
21347
+ current;
21333
21348
  definitions = /* @__PURE__ */ new Map();
21334
21349
  spellings() {
21335
21350
  const plain = /* @__PURE__ */ new Set();
@@ -21415,14 +21430,16 @@ var Emitter = class {
21415
21430
  this.suspended = true;
21416
21431
  }
21417
21432
  region(id) {
21418
- const saved = this.out;
21433
+ const [saved, savedRegion] = [this.out, this.current];
21419
21434
  const ops = this.fn.regions[id].ops;
21420
21435
  this.out = [];
21436
+ this.current = id;
21421
21437
  try {
21422
21438
  ops.forEach((op, i) => EMIT[op.kind](op, this, i, ops));
21423
21439
  return this.out;
21424
21440
  } finally {
21425
21441
  this.out = saved;
21442
+ this.current = savedRegion;
21426
21443
  }
21427
21444
  }
21428
21445
  branch(id, result) {
@@ -21454,6 +21471,16 @@ var Emitter = class {
21454
21471
  value(v) {
21455
21472
  return this.exprs.get(v);
21456
21473
  }
21474
+ taken(v) {
21475
+ const value = this.value(v);
21476
+ if ([
21477
+ "number",
21478
+ "boolean",
21479
+ "undefined",
21480
+ "null"
21481
+ ].includes(this.typeOf(v).k) || this.uses.get(v) !== 1 || this.temporaries.get(v) !== this.current) return value;
21482
+ return call$5("std::move", [value]);
21483
+ }
21457
21484
  place(p) {
21458
21485
  return this.places.get(p);
21459
21486
  }
@@ -21567,12 +21594,14 @@ var Emitter = class {
21567
21594
  const name = `v${v}_`;
21568
21595
  this.emit(op, varDecl(this.backend.cppType(this.fn.values[v].type), name, c));
21569
21596
  this.exprs.set(v, id(name));
21597
+ this.temporaries.set(v, this.current);
21570
21598
  } else if (effect) this.emit(op, exprStmt$4(cast$3("c", voidType, c)));
21571
21599
  }
21572
- bind(v, c) {
21600
+ bind(v, c, home) {
21573
21601
  if (!this.used(v)) return [];
21574
21602
  const name = `v${v}_`;
21575
21603
  this.exprs.set(v, id(name));
21604
+ this.temporaries.set(v, home);
21576
21605
  return [varDecl(this.backend.cppType(this.typeOf(v)), name, c)];
21577
21606
  }
21578
21607
  declareEmpty(op, v) {
@@ -21734,7 +21763,7 @@ const EMIT = {
21734
21763
  if (prev?.kind === "local" && prev.place === op.place) {
21735
21764
  const type = int ? type$5(INT_CPP[int]) : boxOf(e.backend.cppType(prev.type), prev.boxed);
21736
21765
  const style = prev.boxed ? { style: "construct" } : {};
21737
- const value = int ? e.stored(op.value, int) : e.value(op.value);
21766
+ const value = int ? e.stored(op.value, int) : e.taken(op.value);
21738
21767
  e.emit(op, varDecl(type, cppIdent(prev.name), value, style));
21739
21768
  return;
21740
21769
  }
@@ -21747,7 +21776,7 @@ const EMIT = {
21747
21776
  e.emit(op, exprStmt$4(assign$4(e.place(op.place), e.value(appended), "+=")));
21748
21777
  return;
21749
21778
  }
21750
- e.emit(op, exprStmt$4(assign$4(e.place(op.place), e.value(op.value))));
21779
+ e.emit(op, exprStmt$4(assign$4(e.place(op.place), e.taken(op.value))));
21751
21780
  },
21752
21781
  call: (op, e) => {
21753
21782
  const args = op.args.map((a) => e.value(a));
@@ -21813,7 +21842,7 @@ const EMIT = {
21813
21842
  const body = e.region(op.body);
21814
21843
  if (!op.catch) return [block$2(body)];
21815
21844
  const ex = `ex${op.catch.error}_`;
21816
- const error = e.bind(op.catch.error, call$5("lucent::currentError", [id(ex)]));
21845
+ const error = e.bind(op.catch.error, call$5("lucent::currentError", [id(ex)]), op.catch.region);
21817
21846
  const handler = e.region(op.catch.region);
21818
21847
  return [
21819
21848
  varDecl(type$5("std::exception_ptr"), ex),
@@ -21881,7 +21910,7 @@ const EMIT = {
21881
21910
  next: false
21882
21911
  };
21883
21912
  const body = (element, head = []) => {
21884
- const bound = e.bind(op.element, element);
21913
+ const bound = e.bind(op.element, element, op.body);
21885
21914
  const inner = e.inside(jump, op.body);
21886
21915
  return [
21887
21916
  ...head,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucent-lang/lucent",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Write native React Native modules in TypeScript: the Lucent compiler, CLI, Metro integration, Expo config plugin and editor plugin",
5
5
  "homepage": "https://lucent-lang.dev",
6
6
  "bugs": "https://github.com/Fausto95/lucent/issues",
@@ -53,10 +53,10 @@
53
53
  "@types/react": "^19.2.0",
54
54
  "ajv": "^8",
55
55
  "ink-testing-library": "^4.0.0",
56
- "@lucent-lang/bindgen": "0.0.3",
57
56
  "@lucent-lang/codegen": "0.0.3",
58
- "@lucent-lang/runtime": "0.0.3",
59
- "@lucent-lang/compiler": "0.0.3"
57
+ "@lucent-lang/bindgen": "0.0.3",
58
+ "@lucent-lang/compiler": "0.0.3",
59
+ "@lucent-lang/runtime": "0.0.3"
60
60
  },
61
61
  "scripts": {}
62
62
  }