@elurjs/universal 0.1.11 → 0.1.13

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
  {
@@ -102,9 +102,11 @@ Prerequisitos por plataforma:
102
102
  device online el bundle queda generado sin push.
103
103
  - linux — \`libgtk-4-dev\`, \`libsoup-3.0\` dev, \`fontconfig\`,
104
104
  \`cmake\`, \`pkg-config\`, compilador C++20, X11/Wayland. El host se
105
- compila aparte: \`cmake -B targets/linux/build && cmake --build
106
- targets/linux/build\` (el scaffold no copia \`targets/linux\` — el
107
- source está en \`node_modules/@elurjs/universal/targets/linux\`).
105
+ compila aparte dentro del paquete: \`cmake -B node_modules/@elurjs/
106
+ universal/targets/linux/build -S node_modules/@elurjs/universal/
107
+ targets/linux && cmake --build node_modules/@elurjs/universal/
108
+ targets/linux/build -j4\` → \`…/targets/linux/build/elur-linux\`
109
+ (o simplemente \`bun run build:linux\`, que lo hace solo).
108
110
  - windows — nativo: VS Build Tools 2022 (VCTools + MSBuild + Windows
109
111
  11 SDK) + clone de \`quickjs-ng\` (el host enlaza \`qjs.lib\`);
110
112
  \`msbuild node_modules/@elurjs/universal/targets/windows/
@@ -138,11 +140,14 @@ Qué hace cada script:
138
140
  index.html; \`--ssr\`/\`--ssg\` emiten aparte); \`build:android\` →
139
141
  assets JS + .hbc/.qjsc + APK debug (\`--aab\`/\`--release\`/
140
142
  \`--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
143
+ \`build:linux\` → \`generated/\` + registrar de módulos + en Linux
144
+ compila \`elur-linux\` por cmake (configure+build del host GTK4);
145
+ packaging linux: \`bun node_modules/@elurjs/universal/cli/package-linux.mjs
143
146
  --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).
147
+ \`build:windows\` → \`generated/elurApp.{js,es5.qjsc}\` + en
148
+ Windows compila \`elur-windows.exe\` por msbuild (paridad con
149
+ el APK de android; fuera de Windows solo emite el JS — el exe
150
+ lo produce la máquina Windows, ADR-0220).
146
151
  - \`elur dev --target <p>\` watch-reconstruye \`src/\`, \`packages/\` y
147
152
  el entry (debounce 400 ms); flags: \`--dev-fast\`, \`--no-serve\`,
148
153
  \`--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);
@@ -144,9 +144,11 @@ Scripts del scaffold (`create-app.mjs`):
144
144
  `--splits` (APK por ABI + universal), `--minify` (R8 +
145
145
  shrinkResources). Sin credenciales release firma debug.
146
146
  - **linux** → `generated/elurApp.js` + `elurApp.es5.qjsc` +
147
- `targets/linux/generated/` (registrar/sources de módulos). El host se
148
- compila con `cmake -B targets/linux/build && cmake --build
149
- targets/linux/build` → `targets/linux/build/elur-linux`.
147
+ `targets/linux/generated/` (registrar/sources de módulos) **+ el
148
+ binario del host**: en Linux `build:linux` corre `cmake -B
149
+ node_modules/@elurjs/universal/targets/linux/build -S …/targets/linux`
150
+ + `cmake --build … -j4` → `node_modules/@elurjs/universal/targets/
151
+ linux/build/elur-linux`.
150
152
  Distribución (ADR-0186): `bun cli/package-linux.mjs --format
151
153
  appimage|deb|rpm|flatpak|all --app <bundle.js> --name n --title T
152
154
  --version X.Y.Z` → AppDir autocontenido (pila GTK4 por `ldd`, loaders
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elurjs/universal",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
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
  )