intlayer-editor 5.3.3 → 5.3.5
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/bin/intlayer-editor.mjs +22 -1
- package/client/dist/assets/index-CgKV7RM8.js +327 -0
- package/client/dist/index.html +1 -1
- package/package.json +19 -18
- package/server/dist/controllers/dictionary.controller.cjs +50 -3
- package/server/dist/controllers/dictionary.controller.cjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.mjs +51 -2
- package/server/dist/controllers/dictionary.controller.mjs.map +1 -1
- package/server/dist/index.cjs +29 -3
- package/server/dist/index.cjs.map +1 -1
- package/server/dist/index.mjs +31 -5
- package/server/dist/index.mjs.map +1 -1
- package/server/dist/utils/checkPortAvailability.cjs +56 -0
- package/server/dist/utils/checkPortAvailability.cjs.map +1 -0
- package/server/dist/utils/checkPortAvailability.mjs +22 -0
- package/server/dist/utils/checkPortAvailability.mjs.map +1 -0
- package/client/dist/assets/index-B5RwNNnv.js +0 -327
package/bin/intlayer-editor.mjs
CHANGED
|
@@ -15,9 +15,25 @@ const distPath = join(__dirname, '../server/dist/index.mjs');
|
|
|
15
15
|
// Get arguments passed to the command (ignoring "node" and the script name)
|
|
16
16
|
const args = process.argv.slice(2);
|
|
17
17
|
|
|
18
|
+
let env = 'production'; // Default environment
|
|
19
|
+
let envFile = ''; // Default to no env file
|
|
20
|
+
|
|
21
|
+
// Check for --env or -e flag
|
|
22
|
+
const envIndex = args.findIndex(
|
|
23
|
+
(arg) => arg === '---environment' || arg === '--env' || arg === '-e'
|
|
24
|
+
);
|
|
25
|
+
if (envIndex !== -1 && args[envIndex + 1]) {
|
|
26
|
+
env = args[envIndex + 1]; // Get the next argument as the environment
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Check for --env-file or -f flag
|
|
30
|
+
const envFileIndex = args.findIndex(
|
|
31
|
+
(arg) => arg === '---env-file' || arg === '--env-file' || arg === '-f'
|
|
32
|
+
);
|
|
33
|
+
|
|
18
34
|
if (args[0] === 'start') {
|
|
19
35
|
// Start the server pointing to the package's 'dist' directory
|
|
20
|
-
const command = `NODE_ENV
|
|
36
|
+
const command = `NODE_ENV=${env} ${envFileIndex !== -1 ? `ENV_FILE=${envFile}` : ''} node ${distPath}`;
|
|
21
37
|
const child = exec(command);
|
|
22
38
|
|
|
23
39
|
// Pipe child's stdout and stderr to the parent process
|
|
@@ -35,6 +51,11 @@ if (args[0] === 'start') {
|
|
|
35
51
|
});
|
|
36
52
|
|
|
37
53
|
child.on('close', (code) => {
|
|
54
|
+
if (
|
|
55
|
+
code === 255 // EADDRINUSE error when the port is already in use
|
|
56
|
+
)
|
|
57
|
+
return;
|
|
58
|
+
|
|
38
59
|
console.info(`Child process exited with code ${code}`);
|
|
39
60
|
});
|
|
40
61
|
} else {
|