@open-mova/cli 0.1.10 → 0.1.11
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/dist/commands/build.js
CHANGED
|
@@ -2,6 +2,7 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
import { spawnSync } from 'node:child_process';
|
|
4
4
|
import { readApplicationConfiguration, requireApplicationRoot, } from '../application/configuration.js';
|
|
5
|
+
import { npmCommand } from '../utils/platform.js';
|
|
5
6
|
export function registerBuildCommand(program) {
|
|
6
7
|
program
|
|
7
8
|
.command('build')
|
|
@@ -24,7 +25,7 @@ export function registerBuildCommand(program) {
|
|
|
24
25
|
}
|
|
25
26
|
function runBuild(directory, label) {
|
|
26
27
|
console.log(`Compilando ${label}...`);
|
|
27
|
-
const result = spawnSync(
|
|
28
|
+
const result = spawnSync(npmCommand(), ['run', 'build'], {
|
|
28
29
|
cwd: directory,
|
|
29
30
|
stdio: 'inherit',
|
|
30
31
|
});
|
|
@@ -2,6 +2,7 @@ import { spawnSync } from 'node:child_process';
|
|
|
2
2
|
import { existsSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { readApplicationConfiguration, requireApplicationRoot, } from '../application/configuration.js';
|
|
5
|
+
import { localBinaryName, npmCommand } from '../utils/platform.js';
|
|
5
6
|
export function registerCapacitorCommands(program) {
|
|
6
7
|
const capacitor = program.command('cap').description('Prepara la shell para Android o iOS');
|
|
7
8
|
capacitor.command('add <platform>')
|
|
@@ -38,7 +39,7 @@ function buildMobileShell(root) {
|
|
|
38
39
|
}
|
|
39
40
|
const configuration = readApplicationConfiguration(root);
|
|
40
41
|
const manifest = createProductionManifest(configuration);
|
|
41
|
-
run(root,
|
|
42
|
+
run(root, npmCommand(), ['run', 'build']);
|
|
42
43
|
const webDirectory = join(root, 'dist', 'browser');
|
|
43
44
|
if (!existsSync(join(webDirectory, 'index.html'))) {
|
|
44
45
|
throw new Error(`No se encuentra la shell compilada en ${webDirectory}.`);
|
|
@@ -67,7 +68,7 @@ function runCapacitor(root, args) {
|
|
|
67
68
|
if (!existsSync(join(root, 'capacitor.config.ts'))) {
|
|
68
69
|
throw new Error('Esta versión de shell no incluye Capacitor. Usa una shell v0.1.2 o posterior.');
|
|
69
70
|
}
|
|
70
|
-
const binary = join(root, 'node_modules', '.bin', 'cap');
|
|
71
|
+
const binary = join(root, 'node_modules', '.bin', localBinaryName('cap'));
|
|
71
72
|
if (!existsSync(binary)) {
|
|
72
73
|
throw new Error('Instala las dependencias de la aplicación con npm install.');
|
|
73
74
|
}
|
package/dist/commands/start.js
CHANGED
|
@@ -2,6 +2,7 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
4
|
import { readApplicationConfiguration, requireApplicationRoot, } from '../application/configuration.js';
|
|
5
|
+
import { npmCommand } from '../utils/platform.js';
|
|
5
6
|
export function registerStartCommand(program) {
|
|
6
7
|
program
|
|
7
8
|
.command('start')
|
|
@@ -34,7 +35,7 @@ export function registerStartCommand(program) {
|
|
|
34
35
|
async function startProjects(projects) {
|
|
35
36
|
const children = projects.map(({ directory, label }) => {
|
|
36
37
|
console.log(`- ${label}: ${directory}`);
|
|
37
|
-
return spawn(
|
|
38
|
+
return spawn(npmCommand(), ['run', 'start'], {
|
|
38
39
|
cwd: directory,
|
|
39
40
|
stdio: 'inherit',
|
|
40
41
|
});
|