@hile/cli 1.1.3 → 1.1.4
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/start.d.ts +1 -0
- package/dist/start.js +5 -2
- package/package.json +2 -2
package/dist/start.d.ts
CHANGED
package/dist/start.js
CHANGED
|
@@ -77,7 +77,7 @@ export async function start(options) {
|
|
|
77
77
|
const offEvent = !options.silent && process.env.NODE_ENV === 'development'
|
|
78
78
|
? container.on(logContainerEvent)
|
|
79
79
|
: () => { };
|
|
80
|
-
const cwd = process.cwd();
|
|
80
|
+
const cwd = options.cwd ?? process.cwd();
|
|
81
81
|
const files = [];
|
|
82
82
|
// 加载 package.json 文件
|
|
83
83
|
// 如果 package.json 中存在 hile.auto_load_packages 属性,则加载该属性值中的所有服务
|
|
@@ -89,7 +89,7 @@ export async function start(options) {
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
// 加载所有后缀为 boot.ts 或 boot.js 的服务
|
|
92
|
-
const directory = resolve(cwd,
|
|
92
|
+
const directory = resolve(cwd, options.dev ? 'src' : 'dist');
|
|
93
93
|
const _files = await glob(`**/*.boot.{ts,js}`, { cwd: directory });
|
|
94
94
|
files.push(..._files.map(file => resolve(directory, file)));
|
|
95
95
|
// 加载所有自启动服务
|
|
@@ -103,6 +103,9 @@ export async function start(options) {
|
|
|
103
103
|
if (!fn || !isService(fn))
|
|
104
104
|
throw new Error(`invalid service file: ${file}`);
|
|
105
105
|
await loadService(fn);
|
|
106
|
+
if (!options.silent) {
|
|
107
|
+
console.info(`+ [bootstrap] ${file}`);
|
|
108
|
+
}
|
|
106
109
|
}));
|
|
107
110
|
// 如果没有服务要加载,则提示
|
|
108
111
|
if (!files.length) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hile/cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,5 +31,5 @@
|
|
|
31
31
|
"glob": "^13.0.6",
|
|
32
32
|
"tsx": "^4.21.0"
|
|
33
33
|
},
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "64f79a1b10cbc557b5b4e72caf369fa328aa180b"
|
|
35
35
|
}
|