@intlayer/cli 8.4.6 → 8.4.7
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/cjs/watch.cjs +4 -3
- package/dist/cjs/watch.cjs.map +1 -1
- package/dist/esm/watch.mjs +4 -3
- package/dist/esm/watch.mjs.map +1 -1
- package/package.json +12 -12
package/dist/cjs/watch.cjs
CHANGED
|
@@ -26,13 +26,14 @@ const watchContentDeclaration = async (options) => {
|
|
|
26
26
|
persistent: true,
|
|
27
27
|
skipPrepare: options?.skipPrepare ?? false
|
|
28
28
|
});
|
|
29
|
+
let isShuttingDown = false;
|
|
29
30
|
const handleShutdown = async () => {
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
if (isShuttingDown) return;
|
|
32
|
+
isShuttingDown = true;
|
|
32
33
|
appLogger("Stopping Intlayer watcher...");
|
|
33
34
|
try {
|
|
35
|
+
if (parallelProcess) parallelProcess.kill();
|
|
34
36
|
await watcher.close();
|
|
35
|
-
if (parallelProcess && "child" in parallelProcess) parallelProcess.child?.kill("SIGTERM");
|
|
36
37
|
} catch (error) {
|
|
37
38
|
console.error("Error during shutdown:", error);
|
|
38
39
|
} finally {
|
package/dist/cjs/watch.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.cjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { logConfigDetails } from '@intlayer/chokidar/cli';\nimport { runParallel } from '@intlayer/chokidar/utils';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n logConfigDetails(options?.configOptions);\n\n const appLogger = getAppLogger(config);\n\n // Store references to the child process\n let parallelProcess: ReturnType<typeof runParallel> | undefined;\n\n if (options?.with) {\n parallelProcess = runParallel(options.with);\n // Handle the promise to avoid unhandled rejection\n parallelProcess.result.catch(() => {\n // Parallel process failed or was terminated\n process.exit(1);\n });\n }\n\n // Capture the watcher instance\n const watcher = watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n\n // Define a Graceful Shutdown function\n const handleShutdown = async () => {\n // Prevent multiple calls\n
|
|
1
|
+
{"version":3,"file":"watch.cjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { logConfigDetails } from '@intlayer/chokidar/cli';\nimport { runParallel } from '@intlayer/chokidar/utils';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n logConfigDetails(options?.configOptions);\n\n const appLogger = getAppLogger(config);\n\n // Store references to the child process\n let parallelProcess: ReturnType<typeof runParallel> | undefined;\n\n if (options?.with) {\n parallelProcess = runParallel(options.with);\n // Handle the promise to avoid unhandled rejection\n parallelProcess.result.catch(() => {\n // Parallel process failed or was terminated\n process.exit(1);\n });\n }\n\n // Capture the watcher instance\n const watcher = watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n\n // Define a Graceful Shutdown function\n let isShuttingDown = false;\n const handleShutdown = async () => {\n // Prevent multiple calls\n if (isShuttingDown) return;\n isShuttingDown = true;\n\n appLogger('Stopping Intlayer watcher...');\n\n try {\n // Kill the parallel process (e.g., Next.js) before closing the watcher\n if (parallelProcess) {\n parallelProcess.kill();\n }\n\n // Close the file watcher to stop \"esbuild service not running\" errors\n await watcher.close();\n } catch (error) {\n console.error('Error during shutdown:', error);\n } finally {\n process.exit(0);\n }\n };\n\n // Attach Signal Listeners\n process.on('SIGINT', handleShutdown);\n process.on('SIGTERM', handleShutdown);\n};\n"],"mappings":";;;;;;;;;;;;;AAmBA,MAAa,0BAA0B,OAAO,YAA2B;CACvE,MAAM,qDAA0B,SAAS,cAAc;AACvD,8CAAiB,SAAS,cAAc;CAExC,MAAM,sDAAyB,OAAO;CAGtC,IAAI;AAEJ,KAAI,SAAS,MAAM;AACjB,8DAA8B,QAAQ,KAAK;AAE3C,kBAAgB,OAAO,YAAY;AAEjC,WAAQ,KAAK,EAAE;IACf;;CAIJ,MAAM,gDAAgB;EACpB,YAAY;EACZ,aAAa,SAAS,eAAe;EACtC,CAAC;CAGF,IAAI,iBAAiB;CACrB,MAAM,iBAAiB,YAAY;AAEjC,MAAI,eAAgB;AACpB,mBAAiB;AAEjB,YAAU,+BAA+B;AAEzC,MAAI;AAEF,OAAI,gBACF,iBAAgB,MAAM;AAIxB,SAAM,QAAQ,OAAO;WACd,OAAO;AACd,WAAQ,MAAM,0BAA0B,MAAM;YACtC;AACR,WAAQ,KAAK,EAAE;;;AAKnB,SAAQ,GAAG,UAAU,eAAe;AACpC,SAAQ,GAAG,WAAW,eAAe"}
|
package/dist/esm/watch.mjs
CHANGED
|
@@ -24,13 +24,14 @@ const watchContentDeclaration = async (options) => {
|
|
|
24
24
|
persistent: true,
|
|
25
25
|
skipPrepare: options?.skipPrepare ?? false
|
|
26
26
|
});
|
|
27
|
+
let isShuttingDown = false;
|
|
27
28
|
const handleShutdown = async () => {
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
if (isShuttingDown) return;
|
|
30
|
+
isShuttingDown = true;
|
|
30
31
|
appLogger("Stopping Intlayer watcher...");
|
|
31
32
|
try {
|
|
33
|
+
if (parallelProcess) parallelProcess.kill();
|
|
32
34
|
await watcher.close();
|
|
33
|
-
if (parallelProcess && "child" in parallelProcess) parallelProcess.child?.kill("SIGTERM");
|
|
34
35
|
} catch (error) {
|
|
35
36
|
console.error("Error during shutdown:", error);
|
|
36
37
|
} finally {
|
package/dist/esm/watch.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watch.mjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { logConfigDetails } from '@intlayer/chokidar/cli';\nimport { runParallel } from '@intlayer/chokidar/utils';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n logConfigDetails(options?.configOptions);\n\n const appLogger = getAppLogger(config);\n\n // Store references to the child process\n let parallelProcess: ReturnType<typeof runParallel> | undefined;\n\n if (options?.with) {\n parallelProcess = runParallel(options.with);\n // Handle the promise to avoid unhandled rejection\n parallelProcess.result.catch(() => {\n // Parallel process failed or was terminated\n process.exit(1);\n });\n }\n\n // Capture the watcher instance\n const watcher = watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n\n // Define a Graceful Shutdown function\n const handleShutdown = async () => {\n // Prevent multiple calls\n
|
|
1
|
+
{"version":3,"file":"watch.mjs","names":[],"sources":["../../src/watch.ts"],"sourcesContent":["import { logConfigDetails } from '@intlayer/chokidar/cli';\nimport { runParallel } from '@intlayer/chokidar/utils';\nimport { watch } from '@intlayer/chokidar/watcher';\nimport { getAppLogger } from '@intlayer/config/logger';\nimport {\n type GetConfigurationOptions,\n getConfiguration,\n} from '@intlayer/config/node';\n\ntype WatchOptions = {\n skipPrepare?: boolean;\n with?: string | string[];\n configOptions?: GetConfigurationOptions;\n};\n\n/**\n * Get locales dictionaries .content.{json|ts|tsx|js|jsx|mjs|cjs} and build the JSON dictionaries in the .intlayer directory.\n * Watch mode available to get the change in the .content.{json|ts|tsx|js|jsx|mjs|cjs}\n */\nexport const watchContentDeclaration = async (options?: WatchOptions) => {\n const config = getConfiguration(options?.configOptions);\n logConfigDetails(options?.configOptions);\n\n const appLogger = getAppLogger(config);\n\n // Store references to the child process\n let parallelProcess: ReturnType<typeof runParallel> | undefined;\n\n if (options?.with) {\n parallelProcess = runParallel(options.with);\n // Handle the promise to avoid unhandled rejection\n parallelProcess.result.catch(() => {\n // Parallel process failed or was terminated\n process.exit(1);\n });\n }\n\n // Capture the watcher instance\n const watcher = watch({\n persistent: true,\n skipPrepare: options?.skipPrepare ?? false,\n });\n\n // Define a Graceful Shutdown function\n let isShuttingDown = false;\n const handleShutdown = async () => {\n // Prevent multiple calls\n if (isShuttingDown) return;\n isShuttingDown = true;\n\n appLogger('Stopping Intlayer watcher...');\n\n try {\n // Kill the parallel process (e.g., Next.js) before closing the watcher\n if (parallelProcess) {\n parallelProcess.kill();\n }\n\n // Close the file watcher to stop \"esbuild service not running\" errors\n await watcher.close();\n } catch (error) {\n console.error('Error during shutdown:', error);\n } finally {\n process.exit(0);\n }\n };\n\n // Attach Signal Listeners\n process.on('SIGINT', handleShutdown);\n process.on('SIGTERM', handleShutdown);\n};\n"],"mappings":";;;;;;;;;;;AAmBA,MAAa,0BAA0B,OAAO,YAA2B;CACvE,MAAM,SAAS,iBAAiB,SAAS,cAAc;AACvD,kBAAiB,SAAS,cAAc;CAExC,MAAM,YAAY,aAAa,OAAO;CAGtC,IAAI;AAEJ,KAAI,SAAS,MAAM;AACjB,oBAAkB,YAAY,QAAQ,KAAK;AAE3C,kBAAgB,OAAO,YAAY;AAEjC,WAAQ,KAAK,EAAE;IACf;;CAIJ,MAAM,UAAU,MAAM;EACpB,YAAY;EACZ,aAAa,SAAS,eAAe;EACtC,CAAC;CAGF,IAAI,iBAAiB;CACrB,MAAM,iBAAiB,YAAY;AAEjC,MAAI,eAAgB;AACpB,mBAAiB;AAEjB,YAAU,+BAA+B;AAEzC,MAAI;AAEF,OAAI,gBACF,iBAAgB,MAAM;AAIxB,SAAM,QAAQ,OAAO;WACd,OAAO;AACd,WAAQ,MAAM,0BAA0B,MAAM;YACtC;AACR,WAAQ,KAAK,EAAE;;;AAKnB,SAAQ,GAAG,UAAU,eAAe;AACpC,SAAQ,GAAG,WAAW,eAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intlayer/cli",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Provides uniform command-line interface scripts for Intlayer, used in packages like intlayer-cli and intlayer.",
|
|
6
6
|
"keywords": [
|
|
@@ -67,16 +67,16 @@
|
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@clack/prompts": "0.11.0",
|
|
70
|
-
"@intlayer/ai": "8.4.
|
|
71
|
-
"@intlayer/api": "8.4.
|
|
72
|
-
"@intlayer/babel": "8.4.
|
|
73
|
-
"@intlayer/chokidar": "8.4.
|
|
74
|
-
"@intlayer/config": "8.4.
|
|
75
|
-
"@intlayer/core": "8.4.
|
|
76
|
-
"@intlayer/dictionaries-entry": "8.4.
|
|
77
|
-
"@intlayer/remote-dictionaries-entry": "8.4.
|
|
78
|
-
"@intlayer/types": "8.4.
|
|
79
|
-
"@intlayer/unmerged-dictionaries-entry": "8.4.
|
|
70
|
+
"@intlayer/ai": "8.4.7",
|
|
71
|
+
"@intlayer/api": "8.4.7",
|
|
72
|
+
"@intlayer/babel": "8.4.7",
|
|
73
|
+
"@intlayer/chokidar": "8.4.7",
|
|
74
|
+
"@intlayer/config": "8.4.7",
|
|
75
|
+
"@intlayer/core": "8.4.7",
|
|
76
|
+
"@intlayer/dictionaries-entry": "8.4.7",
|
|
77
|
+
"@intlayer/remote-dictionaries-entry": "8.4.7",
|
|
78
|
+
"@intlayer/types": "8.4.7",
|
|
79
|
+
"@intlayer/unmerged-dictionaries-entry": "8.4.7",
|
|
80
80
|
"commander": "14.0.3",
|
|
81
81
|
"enquirer": "^2.4.1",
|
|
82
82
|
"eventsource": "4.1.0",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"vitest": "4.1.0"
|
|
94
94
|
},
|
|
95
95
|
"peerDependencies": {
|
|
96
|
-
"@intlayer/ai": "8.4.
|
|
96
|
+
"@intlayer/ai": "8.4.7"
|
|
97
97
|
},
|
|
98
98
|
"peerDependenciesMeta": {
|
|
99
99
|
"@intlayer/ai": {
|