@elurjs/universal 0.1.11 → 0.1.12

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/cli/commands.mjs CHANGED
@@ -13,7 +13,7 @@
13
13
  export const CLI_COMMANDS = [
14
14
  {
15
15
  cmd: "`elur build --target web|android|linux|windows [--apk --aab --release --engine hermes --splits --minify]`",
16
- fn: "Build completo: bundling, lowering, assets, integración de host, Gradle; windows emite `generated/elurApp.{js,es5.qjsc}` + host por `msbuild`",
16
+ fn: "Build completo: bundling, lowering, assets, integración de host, Gradle; windows emite `generated/elurApp.{js,es5.qjsc}` y compila el exe por `msbuild` cuando corre en Windows (`--skip-host` lo omite — lo usa `dev`)",
17
17
  estado: "Implementado", sub: ["build"],
18
18
  },
19
19
  {
@@ -138,11 +138,14 @@ Qué hace cada script:
138
138
  index.html; \`--ssr\`/\`--ssg\` emiten aparte); \`build:android\` →
139
139
  assets JS + .hbc/.qjsc + APK debug (\`--aab\`/\`--release\`/
140
140
  \`--splits\`/\`--minify\`; release exige \`--engine\`);
141
- \`build:linux\` → \`generated/\` + registrar de módulos; packaging
142
- linux: \`bun node_modules/@elurjs/universal/cli/package-linux.mjs
141
+ \`build:linux\` → \`generated/\` + registrar de módulos + en Linux
142
+ compila \`elur-linux\` por cmake (configure+build del host GTK4);
143
+ packaging linux: \`bun node_modules/@elurjs/universal/cli/package-linux.mjs
143
144
  --format appimage|deb|rpm|flatpak\` (ADR-0186);
144
- \`build:windows\` → \`generated/elurApp.{js,es5.qjsc}\` (el host
145
- WinUI 3 se compila aparte en la máquina Windows, ADR-0220).
145
+ \`build:windows\` → \`generated/elurApp.{js,es5.qjsc}\` + en
146
+ Windows compila \`elur-windows.exe\` por msbuild (paridad con
147
+ el APK de android; fuera de Windows solo emite el JS — el exe
148
+ lo produce la máquina Windows, ADR-0220).
146
149
  - \`elur dev --target <p>\` watch-reconstruye \`src/\`, \`packages/\` y
147
150
  el entry (debounce 400 ms); flags: \`--dev-fast\`, \`--no-serve\`,
148
151
  \`--full\`, \`--json\` (NDJSON).
package/cli/dev.mjs CHANGED
@@ -408,7 +408,7 @@ function rebuild() {
408
408
  if (target === "linux") {
409
409
  run("bun", join(__dirname, "elur.mjs"), "build", "--target", "linux",
410
410
  "--app", appEntry,
411
- ...(devFast ? ["--dev-fast"] : []));
411
+ ...(devFast ? ["--dev-fast"] : []), "--skip-host");
412
412
  if (full) {
413
413
  const linuxBuildDir = existsSync(join(process.cwd(), "targets/linux/build"))
414
414
  ? join(process.cwd(), "targets/linux/build")
@@ -430,7 +430,8 @@ function rebuild() {
430
430
  if (target === "windows") {
431
431
  run("bun", join(__dirname, "elur.mjs"), "build", "--target", "windows",
432
432
  "--app", appEntry,
433
- ...(devFast ? ["--dev-fast"] : []));
433
+ ...(devFast ? ["--dev-fast"] : []),
434
+ ...(full ? [] : ["--skip-host"]));
434
435
  const launched = restartWindowsHost();
435
436
  log("dev.build.end", {
436
437
  ok: true, ms: Date.now() - t0,
package/cli/elur.mjs CHANGED
@@ -402,6 +402,48 @@ if (target === "web" && args.includes("--ssr")) {
402
402
  }
403
403
  console.log(`[elur] ${target} → generated/elurApp.js${qjscOk ? " + elurApp.es5.qjsc" : " (source — sin qjsc)"}`);
404
404
  }
405
+ // Host nativo: el binario se compila una vez por máquina — build
406
+ // lo invoca (paridad con el APK de android); el loop dev pasa
407
+ // --skip-host porque el exe no cambia con cada save de JS.
408
+ if (target === "linux" && !args.includes("--skip-host")) {
409
+ const hostDir = [
410
+ join(project, "targets/linux"),
411
+ pkg("targets/linux"),
412
+ ].find((d) => existsSync(join(d, "CMakeLists.txt")));
413
+ if (process.platform === "linux") {
414
+ if (!hostDir) {
415
+ console.warn("[elur] targets/linux no encontrado — host sin compilar");
416
+ } else {
417
+ const buildDir = join(hostDir, "build");
418
+ if (!existsSync(join(buildDir, "CMakeCache.txt"))) {
419
+ run("cmake", "-B", buildDir, "-S", hostDir,
420
+ ...(process.env.ELUR_QJS_DIR ? [`-DELUR_QJS_DIR=${process.env.ELUR_QJS_DIR}`] : []));
421
+ }
422
+ run("cmake", "--build", buildDir, "-j4");
423
+ console.log(`[elur] host → ${buildDir}/elur-linux`);
424
+ }
425
+ } else if (hostDir) {
426
+ console.log("[elur] host linux sin compilar aquí — el binario lo produce cmake en la máquina Linux");
427
+ }
428
+ }
429
+ if (target === "windows" && !args.includes("--skip-host")) {
430
+ const vcxproj = [
431
+ join(project, "targets/windows/elur-windows.vcxproj"),
432
+ pkg("targets/windows/elur-windows.vcxproj"),
433
+ ].find(existsSync);
434
+ if (process.platform === "win32") {
435
+ if (!vcxproj) {
436
+ console.warn("[elur] elur-windows.vcxproj no encontrado — host sin compilar");
437
+ } else {
438
+ run("msbuild", vcxproj,
439
+ "/p:Configuration=Release", "/p:Platform=x64", "/restore",
440
+ ...(process.env.ELUR_QJS_DIR ? [`/p:ElurQjsDir=${process.env.ELUR_QJS_DIR}`] : []));
441
+ console.log("[elur] host → targets/windows/x64/Release/elur-windows.exe");
442
+ }
443
+ } else if (vcxproj) {
444
+ console.log("[elur] host windows sin compilar aquí — el .exe lo produce msbuild en la máquina Windows (o un host remoto)");
445
+ }
446
+ }
405
447
  } else {
406
448
  console.error(`[elur] target desconocido: ${target} (web|android|linux|ios|windows)`);
407
449
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elurjs/universal",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -1,14 +1,18 @@
1
1
  // Generated by cli/gen-host-integration.mjs — do not edit.
2
2
  #include "elur_modules.h"
3
3
 
4
-
4
+ void elurjs_i18n_register();
5
+ void elurjs_kv_register();
6
+ void elurjs_location_register();
5
7
 
6
8
  namespace elur::modules {
7
9
 
8
10
  /** Registrant de módulos de paquetes (ADR-0103 linux): una llamada por
9
11
  * bindings.linux.register de los elur.plugin.json del grafo. */
10
12
  void registerGeneratedModules() {
11
- // sin bindings linux en el grafo
13
+ elurjs_i18n_register();
14
+ elurjs_kv_register();
15
+ elurjs_location_register();
12
16
  }
13
17
 
14
18
  } // namespace elur::modules
@@ -1,5 +1,7 @@
1
1
  # Generated by cli/gen-host-integration.mjs — do not edit.
2
2
  # Fuentes de bindings.linux de los elur.plugin.json del grafo.
3
3
  set(ELUR_MODULE_SOURCES
4
-
4
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../packages/i18n/linux/elur_i18n_module.cpp
5
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../packages/kv/linux/elur_kv_module.cpp
6
+ ${CMAKE_CURRENT_SOURCE_DIR}/../../packages/location/linux/elur_location_module.cpp
5
7
  )