@wjwjq/release-helper 0.0.3 → 0.0.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/dist/prepare.js +1 -1
- package/dist/start_prepare.js +19 -0
- package/package.json +2 -2
- package/src/prepare.ts +2 -1
- package/src/start_prepare.ts +13 -0
package/dist/prepare.js
CHANGED
|
@@ -7,7 +7,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
7
7
|
import { logger } from './logger.js';
|
|
8
8
|
import 'picocolors';
|
|
9
9
|
|
|
10
|
-
const __work_dir = process.cwd();
|
|
10
|
+
const __work_dir = process.env.INIT_CWD || process.cwd();
|
|
11
11
|
const __releaseDir = path.resolve(__work_dir, ".release");
|
|
12
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
13
|
const __dirname = dirname(__filename);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { logger } from './logger.js';
|
|
2
|
+
import { prepare } from './prepare.js';
|
|
3
|
+
import 'picocolors';
|
|
4
|
+
import 'path';
|
|
5
|
+
import 'fs';
|
|
6
|
+
import 'yaml';
|
|
7
|
+
import '@inquirer/prompts';
|
|
8
|
+
import 'execa';
|
|
9
|
+
import 'node:url';
|
|
10
|
+
|
|
11
|
+
(async function startPrepare() {
|
|
12
|
+
try {
|
|
13
|
+
logger.info("start to generate .release configuration ");
|
|
14
|
+
await prepare();
|
|
15
|
+
logger.info("done");
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.error(`release-helper error: `, error);
|
|
18
|
+
}
|
|
19
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wjwjq/release-helper",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "generate deployment package for frontend, include nginx...",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"localpack": "pnpm link --global",
|
|
67
|
-
"postinstall": "
|
|
67
|
+
"postinstall": "node dist/start_prepare.js",
|
|
68
68
|
"build": "rollup -c",
|
|
69
69
|
"prepublish": "pnpm build"
|
|
70
70
|
}
|
package/src/prepare.ts
CHANGED
|
@@ -19,7 +19,8 @@ export type ReleaseConf = {
|
|
|
19
19
|
assetsDir?: string
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
// 获取项目根目录
|
|
23
|
+
export const __work_dir = process.env.INIT_CWD || process.cwd();
|
|
23
24
|
export const __releaseDir = path.resolve(__work_dir, '.release')
|
|
24
25
|
|
|
25
26
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { logger } from "./logger";
|
|
2
|
+
import { prepare } from "./prepare";
|
|
3
|
+
|
|
4
|
+
(async function startPrepare(){
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
logger.info('start to generate .release configuration ')
|
|
8
|
+
await prepare();
|
|
9
|
+
logger.info('done')
|
|
10
|
+
} catch (error) {
|
|
11
|
+
console.error(`release-helper error: `, error)
|
|
12
|
+
}
|
|
13
|
+
})()
|