@widget-js/cli 1.1.7 → 1.1.8
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/lib/index.js +5 -4
- package/package.json +2 -2
- package/release-xyy.json +7 -0
- package/release.json +1 -1
- package/src/index.ts +2 -0
- package/src/release/ftp.ts +2 -2
- package/src/release/release.ts +1 -1
package/lib/index.js
CHANGED
|
@@ -155569,8 +155569,8 @@ async function runSSH(sshConfig, releaseConfig) {
|
|
|
155569
155569
|
await ftpClient.end();
|
|
155570
155570
|
}
|
|
155571
155571
|
}
|
|
155572
|
-
async function ftpUpload() {
|
|
155573
|
-
const releaseJsonFilePath = import_path3.default.join(process3.cwd(),
|
|
155572
|
+
async function ftpUpload(releaseFile = "release.json") {
|
|
155573
|
+
const releaseJsonFilePath = import_path3.default.join(process3.cwd(), releaseFile);
|
|
155574
155574
|
const packageVersion = getPackageVersion();
|
|
155575
155575
|
import_consola3.default.info("Package Version:", packageVersion);
|
|
155576
155576
|
let releaseJson = import_fs7.default.readFileSync(releaseJsonFilePath).toString().replaceAll("${version}", packageVersion);
|
|
@@ -155622,7 +155622,7 @@ var init_release = __esm({
|
|
|
155622
155622
|
init_ftp();
|
|
155623
155623
|
release = async (options) => {
|
|
155624
155624
|
if (options.type == "ftp") {
|
|
155625
|
-
await ftpUpload();
|
|
155625
|
+
await ftpUpload(options.file);
|
|
155626
155626
|
return;
|
|
155627
155627
|
}
|
|
155628
155628
|
const packageJSON = JSON.parse(import_fs8.default.readFileSync("package.json", "utf-8"));
|
|
@@ -155693,7 +155693,8 @@ import_commander.program.command("build").description("\u6267\u884C\u7F16\u8BD1\
|
|
|
155693
155693
|
await build2.build();
|
|
155694
155694
|
});
|
|
155695
155695
|
var typeOption = new import_commander.Option("-t, --type <type>").choices(["ftp", "oss"]);
|
|
155696
|
-
import_commander.
|
|
155696
|
+
var fileOption = new import_commander.Option("-f, --file <file>");
|
|
155697
|
+
import_commander.program.command("release").description("\u901A\u8FC7FTP/OSS\u53D1\u5E03\u6587\u4EF6\uFF0C\u4EC5\u5185\u90E8\u4F7F\u7528").addOption(typeOption).addOption(fileOption).action(async (options, command) => {
|
|
155697
155698
|
let release2 = await Promise.resolve().then(() => (init_release(), release_exports));
|
|
155698
155699
|
await release2.default(options);
|
|
155699
155700
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@widget-js/cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"author": "Neo Fu",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"shelljs": "^0.8.5",
|
|
36
36
|
"ssh2-sftp-client": "^9.0.4",
|
|
37
37
|
"ws": "^8.11.0",
|
|
38
|
-
"@widget-js/utils": "0.7.
|
|
38
|
+
"@widget-js/utils": "0.7.15"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/ali-oss": "^6.16.7",
|
package/release-xyy.json
ADDED
package/release.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -40,10 +40,12 @@ program
|
|
|
40
40
|
});
|
|
41
41
|
|
|
42
42
|
let typeOption = new Option("-t, --type <type>").choices(["ftp", "oss"]);
|
|
43
|
+
let fileOption = new Option("-f, --file <file>");
|
|
43
44
|
program
|
|
44
45
|
.command("release")
|
|
45
46
|
.description("通过FTP/OSS发布文件,仅内部使用")
|
|
46
47
|
.addOption(typeOption)
|
|
48
|
+
.addOption(fileOption)
|
|
47
49
|
.action(async (options, command) => {
|
|
48
50
|
// @ts-ignore
|
|
49
51
|
let release = await import("./release/release");
|
package/src/release/ftp.ts
CHANGED
|
@@ -85,9 +85,9 @@ async function runSSH(sshConfig: Record<string, string | string[]>, releaseConfi
|
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
export async function ftpUpload() {
|
|
88
|
+
export async function ftpUpload(releaseFile: string = 'release.json') {
|
|
89
89
|
// 读取
|
|
90
|
-
const releaseJsonFilePath = path.join(process.cwd(),
|
|
90
|
+
const releaseJsonFilePath = path.join(process.cwd(), releaseFile)
|
|
91
91
|
const packageVersion = getPackageVersion()
|
|
92
92
|
consola.info('Package Version:', packageVersion)
|
|
93
93
|
|
package/src/release/release.ts
CHANGED
|
@@ -16,7 +16,7 @@ async function delay(time: number) {
|
|
|
16
16
|
|
|
17
17
|
const release = async (options: any) => {
|
|
18
18
|
if (options.type == 'ftp') {
|
|
19
|
-
await ftpUpload()
|
|
19
|
+
await ftpUpload(options.file)
|
|
20
20
|
return
|
|
21
21
|
}
|
|
22
22
|
const packageJSON = JSON.parse(fs.readFileSync('package.json', 'utf-8'))
|