@apia/cli 4.0.43 → 4.0.44

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.
Files changed (2) hide show
  1. package/cli/cli.cjs +19 -9
  2. package/package.json +11 -7
package/cli/cli.cjs CHANGED
@@ -57,7 +57,7 @@ compile.command('component')
57
57
 
58
58
  let envFile = findFileInAncestors('.env');
59
59
  if (envFile !== undefined) {
60
- const outDir = envFile.content.match(/^(?<!#) *APIA_4004 *= *([^\n]+)/m);
60
+ const outDir = envFile.content.match(/^(?<!#) *APIA_4005 *= *([^\n]+)/m);
61
61
  if (outDir?.[1]) {
62
62
  const actualOutput = path.resolve(outDir[1], 'react', 'customComponents', parsedName)
63
63
 
@@ -69,20 +69,30 @@ compile.command('component')
69
69
  - Output: ${actualOutput}
70
70
  - Webpack config: ${webpackConfig}`);
71
71
 
72
- const npx = process.platform === 'win32' ? 'npx.cmd' : 'npx';
73
- spawn(
74
- npx,
72
+ const child = spawn(
73
+ 'npx',
75
74
  [
76
75
  'webpack',
77
- '--config', webpackConfig,
78
- '--entry', targetComponentIndex,
79
- '--output-path', actualOutput,
76
+ '--config', `"${webpackConfig}"`,
77
+ '--entry', `"${targetComponentIndex}"`,
78
+ '--output-path', `"${actualOutput}"`,
80
79
  '--output-filename', 'index.js',
81
80
  ...(watch ? ['--mode', 'development', '--watch'] : [])
82
81
  ],
83
- { stdio: 'inherit' })
82
+ { shell: true, })
83
+
84
+ child.stdout.setEncoding('utf8');
85
+ child.stdout.on('data', data => {
86
+ process.stdout.write(data); // muestra al instante
87
+ });
88
+ child.stderr.on('data', data => {
89
+ process.stderr.write(data); // idem para errores
90
+ });
91
+ child.on('exit', code => {
92
+ console.log(`⚙️ webpack terminó con código ${code}`);
93
+ });
84
94
  } else {
85
- throw new Error("Cannot find APIA_4004 in " + envFile.fileName);
95
+ throw new Error("Cannot find APIA_4005 in " + envFile.fileName);
86
96
  }
87
97
  } else {
88
98
  throw new Error("Cannot find .env file");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apia/cli",
3
- "version": "4.0.43",
3
+ "version": "4.0.44",
4
4
  "sideEffects": true,
5
5
  "author": "Alexis Leite <alexisleite@live.com>",
6
6
  "bin": {
@@ -8,15 +8,19 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "chalk": "^4.1.2",
11
- "commander": "^12.0.0"
11
+ "commander": "^12.0.0",
12
+ "fork-ts-checker-webpack-plugin": "^9.0.2",
13
+ "html-webpack-plugin": "^5.6.0",
14
+ "terser-webpack-plugin": "^5.2.5",
15
+ "ts-loader": "^9.5.2",
16
+ "webpack": "^5.91.0",
17
+ "webpack-bundle-analyzer": "^4.10.1",
18
+ "webpack-cli": "^5.1.4",
19
+ "wrapper-webpack-plugin": "^2.2.2"
12
20
  },
13
21
  "publishConfig": {
14
22
  "access": "public",
15
23
  "registry": "https://registry.npmjs.org/"
16
24
  },
17
- "gitHead": "f4c40b69ba514626379ac45021c254ad661826f1",
18
- "devDependencies": {
19
- "ts-loader": "^9.5.2",
20
- "wrapper-webpack-plugin": "^2.2.2"
21
- }
25
+ "gitHead": "0822e3a7f4a7fa49b47087e8097caab678d36ef6"
22
26
  }