@hile/cli 2.0.10 → 2.0.12
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/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/start.js +8 -4
- package/package.json +3 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export
|
|
2
|
+
export { start, registerExitHook, useExit } from '@hile/bootstrap';
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import pkg from '../package.json' with { type: 'json' };
|
|
3
3
|
import { program } from 'commander';
|
|
4
|
-
import { start } from '
|
|
4
|
+
import { start } from '@hile/bootstrap';
|
|
5
5
|
import { execSync } from 'node:child_process';
|
|
6
6
|
import { existsSync, readFileSync } from 'node:fs';
|
|
7
7
|
import { dirname, join, resolve } from 'node:path';
|
|
8
8
|
import { createRequire } from 'node:module';
|
|
9
9
|
import { Registry } from '@hile/micro';
|
|
10
|
-
import { useExit } from '
|
|
10
|
+
import { useExit } from '@hile/bootstrap';
|
|
11
11
|
import { listConfigs, getConfig, setConfig, delConfig } from './configs.js';
|
|
12
12
|
import { createLogger } from '@hile/logger';
|
|
13
13
|
const requireCli = createRequire(import.meta.url);
|
|
@@ -160,4 +160,4 @@ configs.command('del <namespace> [key]')
|
|
|
160
160
|
await delConfig(namespace, key, options.yes);
|
|
161
161
|
});
|
|
162
162
|
program.parseAsync(process.argv);
|
|
163
|
-
export
|
|
163
|
+
export { start, registerExitHook, useExit } from '@hile/bootstrap';
|
package/dist/start.js
CHANGED
|
@@ -4,6 +4,7 @@ import { resolve } from 'node:path';
|
|
|
4
4
|
import { container, formatServiceKey, isService, loadService } from '@hile/core';
|
|
5
5
|
import { createRequire } from 'node:module';
|
|
6
6
|
import { pathToFileURL } from 'node:url';
|
|
7
|
+
import { existsSync } from 'node:fs';
|
|
7
8
|
const require = createRequire(import.meta.url);
|
|
8
9
|
/** 加载 env 文件到 process.env(Node 20.12+ 原生 process.loadEnvFile) */
|
|
9
10
|
function loadEnvFile(filePath) {
|
|
@@ -88,10 +89,13 @@ export async function start(options) {
|
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
91
|
else {
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
const pkg_path = resolve(cwd, 'package.json');
|
|
93
|
+
if (existsSync(pkg_path)) {
|
|
94
|
+
const packageJson = require(pkg_path);
|
|
95
|
+
if (packageJson.hile?.auto_load_packages && Array.isArray(packageJson.hile.auto_load_packages)) {
|
|
96
|
+
for (let i = 0; i < packageJson.hile.auto_load_packages.length; i++) {
|
|
97
|
+
files.push(AUTO_TAG + packageJson.hile.auto_load_packages[i]);
|
|
98
|
+
}
|
|
95
99
|
}
|
|
96
100
|
}
|
|
97
101
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hile/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -23,20 +23,16 @@
|
|
|
23
23
|
"node": ">=20.12.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@types/async-exit-hook": "^2.0.2",
|
|
27
26
|
"fix-esm-import-path": "^1.10.3",
|
|
28
27
|
"vitest": "^4.0.18"
|
|
29
28
|
},
|
|
30
29
|
"dependencies": {
|
|
31
|
-
"@hile/
|
|
30
|
+
"@hile/bootstrap": "^1.0.1",
|
|
32
31
|
"@hile/logger": "^2.0.3",
|
|
33
32
|
"@hile/micro": "^2.0.7",
|
|
34
|
-
"async-exit-hook": "^2.0.1",
|
|
35
33
|
"commander": "^14.0.3",
|
|
36
|
-
"glob": "^13.0.6",
|
|
37
34
|
"pino-pretty": "^13.1.3",
|
|
38
|
-
"tsx": "^4.21.0",
|
|
39
35
|
"yaml": "^2.9.0"
|
|
40
36
|
},
|
|
41
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "a1b2b073ea45f0504bc24ce7eb4899cb4d517192"
|
|
42
38
|
}
|