@eggjs/scripts 5.0.2-beta.1 → 5.0.2-beta.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/baseCommand.d.ts +0 -1
- package/dist/commands/start.d.ts +15 -15
- package/dist/commands/stop.d.ts +4 -4
- package/dist/helper.js +1 -1
- package/package.json +5 -5
- package/scripts/start-cluster.cjs +15 -0
- package/scripts/start-cluster.mjs +15 -0
package/dist/baseCommand.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ declare abstract class BaseCommand<T extends typeof Command> extends Command {
|
|
|
11
11
|
protected args: Args$1<T>;
|
|
12
12
|
protected env: {
|
|
13
13
|
[key: string]: string | undefined;
|
|
14
|
-
TZ?: string | undefined;
|
|
15
14
|
};
|
|
16
15
|
protected pkg: Record<string, any>;
|
|
17
16
|
protected isESM: boolean;
|
package/dist/commands/start.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseCommand } from "../baseCommand.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as _oclif_core_interfaces0 from "@oclif/core/interfaces";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/start.d.ts
|
|
5
5
|
interface FrameworkOptions {
|
|
@@ -11,22 +11,22 @@ declare class Start<T extends typeof Start> extends BaseCommand<T> {
|
|
|
11
11
|
static description: string;
|
|
12
12
|
static examples: string[];
|
|
13
13
|
static args: {
|
|
14
|
-
baseDir:
|
|
14
|
+
baseDir: _oclif_core_interfaces0.Arg<string | undefined, Record<string, unknown>>;
|
|
15
15
|
};
|
|
16
16
|
static flags: {
|
|
17
|
-
title:
|
|
18
|
-
framework:
|
|
19
|
-
port:
|
|
20
|
-
workers:
|
|
21
|
-
env:
|
|
22
|
-
daemon:
|
|
23
|
-
stdout:
|
|
24
|
-
stderr:
|
|
25
|
-
timeout:
|
|
26
|
-
'ignore-stderr':
|
|
27
|
-
node:
|
|
28
|
-
require:
|
|
29
|
-
sourcemap:
|
|
17
|
+
title: _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
|
|
18
|
+
framework: _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
|
|
19
|
+
port: _oclif_core_interfaces0.OptionFlag<number | undefined, _oclif_core_interfaces0.CustomOptions>;
|
|
20
|
+
workers: _oclif_core_interfaces0.OptionFlag<number | undefined, _oclif_core_interfaces0.CustomOptions>;
|
|
21
|
+
env: _oclif_core_interfaces0.OptionFlag<string, _oclif_core_interfaces0.CustomOptions>;
|
|
22
|
+
daemon: _oclif_core_interfaces0.BooleanFlag<boolean>;
|
|
23
|
+
stdout: _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
|
|
24
|
+
stderr: _oclif_core_interfaces0.OptionFlag<string | undefined, _oclif_core_interfaces0.CustomOptions>;
|
|
25
|
+
timeout: _oclif_core_interfaces0.OptionFlag<number, _oclif_core_interfaces0.CustomOptions>;
|
|
26
|
+
'ignore-stderr': _oclif_core_interfaces0.BooleanFlag<boolean>;
|
|
27
|
+
node: _oclif_core_interfaces0.OptionFlag<string, _oclif_core_interfaces0.CustomOptions>;
|
|
28
|
+
require: _oclif_core_interfaces0.OptionFlag<string[] | undefined, _oclif_core_interfaces0.CustomOptions>;
|
|
29
|
+
sourcemap: _oclif_core_interfaces0.BooleanFlag<boolean>;
|
|
30
30
|
};
|
|
31
31
|
isReady: boolean;
|
|
32
32
|
protected getFrameworkPath(options: FrameworkOptions): Promise<string>;
|
package/dist/commands/stop.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { BaseCommand } from "../baseCommand.js";
|
|
2
2
|
import { NodeProcess } from "../helper.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as _oclif_core_interfaces23 from "@oclif/core/interfaces";
|
|
4
4
|
|
|
5
5
|
//#region src/commands/stop.d.ts
|
|
6
6
|
declare class Stop<T extends typeof Stop> extends BaseCommand<T> {
|
|
7
7
|
static description: string;
|
|
8
8
|
static examples: string[];
|
|
9
9
|
static args: {
|
|
10
|
-
baseDir:
|
|
10
|
+
baseDir: _oclif_core_interfaces23.Arg<string | undefined, Record<string, unknown>>;
|
|
11
11
|
};
|
|
12
12
|
static flags: {
|
|
13
|
-
title:
|
|
14
|
-
timeout:
|
|
13
|
+
title: _oclif_core_interfaces23.OptionFlag<string | undefined, _oclif_core_interfaces23.CustomOptions>;
|
|
14
|
+
timeout: _oclif_core_interfaces23.OptionFlag<number, _oclif_core_interfaces23.CustomOptions>;
|
|
15
15
|
};
|
|
16
16
|
run(): Promise<void>;
|
|
17
17
|
protected findNodeProcesses(filter: (item: NodeProcess) => boolean): Promise<NodeProcess[]>;
|
package/dist/helper.js
CHANGED
|
@@ -4,7 +4,7 @@ import { runScript } from "runscript";
|
|
|
4
4
|
const isWindows = process.platform === "win32";
|
|
5
5
|
const REGEX = isWindows ? /^(.*)\s+(\d+)\s*$/ : /^\s*(\d+)\s+(.*)/;
|
|
6
6
|
async function findNodeProcess(filterFn) {
|
|
7
|
-
return (await runScript(isWindows ? "wmic Path win32_process Where \"Name = 'node.exe'\" Get CommandLine,ProcessId" : "ps -wweo \"pid,args\"", { stdio: "pipe" })).stdout.toString().split("\n").reduce((arr, line) => {
|
|
7
|
+
return (await runScript(isWindows ? "wmic Path win32_process Where \"Name = 'node.exe'\" Get CommandLine,ProcessId" : "ps --help 2>&1 | grep -q BusyBox && ps -o \"pid,args\" || ps -wweo \"pid,args\"", { stdio: "pipe" })).stdout.toString().split("\n").reduce((arr, line) => {
|
|
8
8
|
if (!!line && !line.includes("/bin/sh") && line.includes("node")) {
|
|
9
9
|
const m = line.match(REGEX);
|
|
10
10
|
if (m) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eggjs/scripts",
|
|
3
|
-
"version": "5.0.2-beta.
|
|
3
|
+
"version": "5.0.2-beta.11",
|
|
4
4
|
"description": "deploy tool for egg project",
|
|
5
5
|
"homepage": "https://github.com/eggjs/egg/tree/next/tools/scripts",
|
|
6
6
|
"bugs": {
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"runscript": "^2.0.1",
|
|
45
45
|
"source-map-support": "^0.5.21",
|
|
46
46
|
"utility": "^2.5.0",
|
|
47
|
-
"@eggjs/utils": "5.0.2-beta.
|
|
47
|
+
"@eggjs/utils": "5.0.2-beta.11"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/node": "^24.10.2",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"typescript": "^5.9.3",
|
|
56
56
|
"urllib": "^4.8.2",
|
|
57
57
|
"vitest": "^4.0.15",
|
|
58
|
-
"egg": "4.1.2-beta.
|
|
58
|
+
"egg": "4.1.2-beta.11"
|
|
59
59
|
},
|
|
60
60
|
"oclif": {
|
|
61
61
|
"additionalHelpFlags": [
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"scripts": {
|
|
73
73
|
"typecheck": "tsgo --noEmit",
|
|
74
74
|
"test": "vitest run --bail 1 --no-file-parallelism",
|
|
75
|
-
"cov": "
|
|
76
|
-
"ci": "
|
|
75
|
+
"cov": "ut run test -- --coverage",
|
|
76
|
+
"ci": "ut run cov"
|
|
77
77
|
}
|
|
78
78
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
const nodeModule = require('node:module');
|
|
2
|
+
const path = require('node:path');
|
|
1
3
|
const { debuglog } = require('node:util');
|
|
2
4
|
|
|
3
5
|
const { importModule } = require('@eggjs/utils');
|
|
@@ -8,6 +10,19 @@ async function main() {
|
|
|
8
10
|
debug('argv: %o', process.argv);
|
|
9
11
|
const options = JSON.parse(process.argv[2]);
|
|
10
12
|
debug('start cluster options: %o', options);
|
|
13
|
+
|
|
14
|
+
// Duplicated from ManifestStore.enableCompileCache (@eggjs/core is not a dependency)
|
|
15
|
+
if (!process.env.NODE_COMPILE_CACHE && !process.env.NODE_DISABLE_COMPILE_CACHE) {
|
|
16
|
+
const cacheDir = path.join(options.baseDir ?? process.cwd(), '.egg', 'compile-cache');
|
|
17
|
+
process.env.NODE_COMPILE_CACHE = cacheDir;
|
|
18
|
+
process.env.NODE_COMPILE_CACHE_PORTABLE = '1';
|
|
19
|
+
try {
|
|
20
|
+
nodeModule.enableCompileCache?.(cacheDir);
|
|
21
|
+
} catch {
|
|
22
|
+
/* non-fatal */
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
11
26
|
const exports = await importModule(options.framework);
|
|
12
27
|
let startCluster = exports.startCluster;
|
|
13
28
|
if (typeof startCluster !== 'function') {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import module from 'node:module';
|
|
2
|
+
import path from 'node:path';
|
|
1
3
|
import { debuglog } from 'node:util';
|
|
2
4
|
|
|
3
5
|
import { importModule } from '@eggjs/utils';
|
|
@@ -8,6 +10,19 @@ async function main() {
|
|
|
8
10
|
debug('argv: %o', process.argv);
|
|
9
11
|
const options = JSON.parse(process.argv[2]);
|
|
10
12
|
debug('start cluster options: %o', options);
|
|
13
|
+
|
|
14
|
+
// Duplicated from ManifestStore.enableCompileCache (@eggjs/core is not a dependency)
|
|
15
|
+
if (!process.env.NODE_COMPILE_CACHE && !process.env.NODE_DISABLE_COMPILE_CACHE) {
|
|
16
|
+
const cacheDir = path.join(options.baseDir ?? process.cwd(), '.egg', 'compile-cache');
|
|
17
|
+
process.env.NODE_COMPILE_CACHE = cacheDir;
|
|
18
|
+
process.env.NODE_COMPILE_CACHE_PORTABLE = '1';
|
|
19
|
+
try {
|
|
20
|
+
module.enableCompileCache?.(cacheDir);
|
|
21
|
+
} catch {
|
|
22
|
+
/* non-fatal */
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
11
26
|
const { startCluster } = await importModule(options.framework);
|
|
12
27
|
await startCluster(options);
|
|
13
28
|
}
|