@widget-js/cli 24.1.1-beta.71 → 24.1.1-beta.72

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.
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/utils.ts
4
- import path from "node:path";
5
- import process from "node:process";
6
- import fs from "node:fs";
4
+ import path from "path";
5
+ import process from "process";
6
+ import fs from "fs";
7
7
  import packageJson from "package-json";
8
8
  var widgetPackages = {
9
9
  "@widget-js/core": "",
@@ -13,8 +13,8 @@ var PrettierUtils = class {
13
13
  };
14
14
 
15
15
  // src/utils/EJSUtils.ts
16
- import path from "node:path";
17
- import fs from "node:fs";
16
+ import path from "path";
17
+ import fs from "fs";
18
18
  import ejs from "ejs";
19
19
  import { dirname } from "dirname-filename-esm";
20
20
  var EJSUtils = class {
@@ -28,8 +28,8 @@ var EJSUtils = class {
28
28
  };
29
29
 
30
30
  // src/utils/WidgetPackageUtils.ts
31
- import path2 from "node:path";
32
- import fs2 from "node:fs";
31
+ import path2 from "path";
32
+ import fs2 from "fs";
33
33
  var WidgetPackageUtils = class {
34
34
  static getRootDir(widgetPackage) {
35
35
  const widgetRootDir = path2.join(process.cwd(), widgetPackage.devOptions?.folder ?? "./src/widgets");
@@ -2,18 +2,18 @@
2
2
  import {
3
3
  EJSUtils,
4
4
  WidgetPackageUtils
5
- } from "./chunk-OHXTJCXT.js";
5
+ } from "./chunk-ZBS3VFVW.js";
6
6
  import {
7
7
  promptChecker_default
8
8
  } from "./chunk-QLSQIDVW.js";
9
9
  import {
10
10
  exit
11
- } from "./chunk-EXN6RZLX.js";
11
+ } from "./chunk-P4HGD3H3.js";
12
12
 
13
13
  // src/createWidget.ts
14
- import path from "node:path";
15
- import fs from "node:fs";
16
- import { fileURLToPath } from "node:url";
14
+ import path from "path";
15
+ import fs from "fs";
16
+ import { fileURLToPath } from "url";
17
17
  import consola from "consola";
18
18
  import { paramCase, snakeCase } from "change-case";
19
19
  import inquirer from "inquirer";
@@ -3,10 +3,10 @@ import {
3
3
  Utils,
4
4
  getPackagePath,
5
5
  widgetPackages
6
- } from "./chunk-EXN6RZLX.js";
6
+ } from "./chunk-P4HGD3H3.js";
7
7
 
8
8
  // src/dependencies/remoteDependencies.ts
9
- import fs from "node:fs";
9
+ import fs from "fs";
10
10
  import ora from "ora";
11
11
  var spinner = ora("Connecting");
12
12
  var RemoteDependencies = class {
@@ -16,8 +16,20 @@ var RemoteDependencies = class {
16
16
  const packageNames = Object.keys(widgetPackages);
17
17
  const dependencies = json.dependencies;
18
18
  const devDependencies = json.devDependencies;
19
+ const overrides = json.overrides;
20
+ const resolutions = json.resolutions;
21
+ const pnpmOverrides = json.pnpm?.overrides;
19
22
  await this.upgradePackage(dependencies, packageNames);
20
23
  await this.upgradePackage(devDependencies, packageNames);
24
+ if (overrides) {
25
+ await this.upgradePackage(overrides, packageNames);
26
+ }
27
+ if (resolutions) {
28
+ await this.upgradePackage(resolutions, packageNames);
29
+ }
30
+ if (pnpmOverrides) {
31
+ await this.upgradePackage(pnpmOverrides, packageNames);
32
+ }
21
33
  fs.writeFileSync(getPackagePath(), JSON.stringify(json, null, 2));
22
34
  spinner.succeed("Using remote versions!");
23
35
  }
@@ -39,7 +51,7 @@ var RemoteDependencies = class {
39
51
  };
40
52
 
41
53
  // src/dependencies/localDependencies.ts
42
- import fs2 from "node:fs";
54
+ import fs2 from "fs";
43
55
  import ora2 from "ora";
44
56
  var spinner2 = ora2("Connecting");
45
57
  var LocalDependencies;
@@ -50,8 +62,20 @@ var LocalDependencies;
50
62
  const packageNames = Object.keys(widgetPackages);
51
63
  const dependencies = json.dependencies;
52
64
  const devDependencies = json.devDependencies;
65
+ const overrides = json.overrides;
66
+ const resolutions = json.resolutions;
67
+ const pnpmOverrides = json.pnpm?.overrides;
53
68
  await setWorkspaceVersion(dependencies, packageNames);
54
69
  await setWorkspaceVersion(devDependencies, packageNames);
70
+ if (overrides) {
71
+ await setWorkspaceVersion(overrides, packageNames);
72
+ }
73
+ if (resolutions) {
74
+ await setWorkspaceVersion(resolutions, packageNames);
75
+ }
76
+ if (pnpmOverrides) {
77
+ await setWorkspaceVersion(pnpmOverrides, packageNames);
78
+ }
55
79
  fs2.writeFileSync(getPackagePath(), JSON.stringify(json, null, 2));
56
80
  spinner2.succeed("Using local versions(workspace:*)!");
57
81
  }
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/index.ts
4
- import fs from "node:fs";
5
- import path from "node:path";
6
- import * as process from "node:process";
4
+ import fs from "fs";
5
+ import path from "path";
6
+ import * as process from "process";
7
7
  import { Option, program } from "commander";
8
8
  import figlet from "figlet";
9
9
  import gradient from "gradient-string";
@@ -13,31 +13,31 @@ var cliPackage = JSON.parse(fs.readFileSync(packageJsonPath).toString());
13
13
  console.log(gradient.pastel.multiline(figlet.textSync("widget-cli", { horizontalLayout: "full" })));
14
14
  program.version(`@widget-js/cli ${cliPackage.version}`).usage("<command> [options]");
15
15
  program.command("create").description("Create new widget").action(async () => {
16
- const createWidget = await import("./createWidget-GO6A3JXP.js");
16
+ const createWidget = await import("./createWidget-K6V5LGFL.js");
17
17
  await createWidget.default();
18
18
  });
19
19
  var dependenciesOption = new Option("-t, --type <type>").choices(["remote", "local"]);
20
20
  program.command("dependencies").description("Deprecated!. Set @widget-js dependencies to local(workspace:*) or remote(^1.0.0 etc)").addOption(dependenciesOption).action(async (options) => {
21
- const dependencies = await import("./dependencies-RXDT7CJ6.js");
21
+ const dependencies = await import("./dependencies-M6SXBEWC.js");
22
22
  await dependencies.default(options);
23
23
  });
24
24
  program.command("deps").description("Set @widget-js dependencies to local(workspace:*) or remote(^1.0.0 etc)").addOption(dependenciesOption).action(async (options) => {
25
- const dependencies = await import("./dependencies-RXDT7CJ6.js");
25
+ const dependencies = await import("./dependencies-M6SXBEWC.js");
26
26
  await dependencies.default(options);
27
27
  });
28
28
  program.command("init").description("Initialize widget-js project").action(async () => {
29
- const init = await import("./init-5TSYOIYW.js");
29
+ const init = await import("./init-5SWBAB34.js");
30
30
  await init.init();
31
31
  });
32
32
  var keyOption = new Option("-k, --key <key>");
33
33
  program.command("publish").description("Publish widget package with developer key").addOption(keyOption).action(async (options) => {
34
- const publishImport = await import("./publish-YNV6U6KF.js");
34
+ const publishImport = await import("./publish-U7BSL3CC.js");
35
35
  await publishImport.publish(options);
36
36
  });
37
37
  var typeOption = new Option("-t, --type <type>").choices(["ftp", "oss"]);
38
38
  var fileOption = new Option("-f, --file <file>");
39
39
  program.command("release").description("\u901A\u8FC7FTP/OSS\u53D1\u5E03\u6587\u4EF6\uFF0C\u4EC5\u5185\u90E8\u4F7F\u7528").addOption(typeOption).addOption(fileOption).action(async (options) => {
40
- const release = await import("./release-2MP6V4VG.js");
40
+ const release = await import("./release-KM77KNDE.js");
41
41
  await release.default(options);
42
42
  });
43
43
  program.parse(process.argv);
@@ -3,19 +3,19 @@ import {
3
3
  EJSUtils,
4
4
  PrettierUtils,
5
5
  WidgetPackageUtils
6
- } from "./chunk-OHXTJCXT.js";
6
+ } from "./chunk-ZBS3VFVW.js";
7
7
  import {
8
8
  promptChecker_default
9
9
  } from "./chunk-QLSQIDVW.js";
10
10
  import {
11
11
  Utils
12
- } from "./chunk-EXN6RZLX.js";
12
+ } from "./chunk-P4HGD3H3.js";
13
13
 
14
14
  // src/init/init.ts
15
- import path from "node:path";
16
- import process from "node:process";
17
- import fs from "node:fs";
18
- import { fileURLToPath } from "node:url";
15
+ import path from "path";
16
+ import process from "process";
17
+ import fs from "fs";
18
+ import { fileURLToPath } from "url";
19
19
  import consola from "consola";
20
20
  import chalk from "chalk";
21
21
  import ora from "ora";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/publish/index.ts
4
- import fs from "node:fs";
4
+ import fs from "fs";
5
5
  import fastGlob from "fast-glob";
6
6
  import axios from "axios";
7
7
  import consola from "consola";
@@ -4,17 +4,17 @@ import {
4
4
  } from "./chunk-QLSQIDVW.js";
5
5
  import {
6
6
  Utils
7
- } from "./chunk-EXN6RZLX.js";
7
+ } from "./chunk-P4HGD3H3.js";
8
8
 
9
9
  // src/release/release.ts
10
- import fs4 from "node:fs";
11
- import path2 from "node:path";
12
- import { Buffer as Buffer2 } from "node:buffer";
10
+ import fs4 from "fs";
11
+ import path2 from "path";
12
+ import { Buffer as Buffer2 } from "buffer";
13
13
  import chalk2 from "chalk";
14
14
  import consola3 from "consola";
15
15
 
16
16
  // src/release/update-zip.ts
17
- import fs from "node:fs";
17
+ import fs from "fs";
18
18
  import archiver from "archiver";
19
19
  function zipDirectory(sourceDir, outPath, ignoreDir) {
20
20
  const archive = archiver("zip", { zlib: { level: 9 } });
@@ -32,7 +32,7 @@ function zipDirectory(sourceDir, outPath, ignoreDir) {
32
32
  var update_zip_default = zipDirectory;
33
33
 
34
34
  // src/release/oss.ts
35
- import fs2 from "node:fs";
35
+ import fs2 from "fs";
36
36
  import OSS from "ali-oss";
37
37
  import chalk from "chalk";
38
38
  import consola from "consola";
@@ -78,11 +78,11 @@ var OssClient = class {
78
78
  };
79
79
 
80
80
  // src/release/ftp.ts
81
- import path from "node:path";
82
- import fs3 from "node:fs";
83
- import os from "node:os";
84
- import Buffer from "node:buffer";
85
- import * as process from "node:process";
81
+ import path from "path";
82
+ import fs3 from "fs";
83
+ import os from "os";
84
+ import Buffer from "buffer";
85
+ import * as process from "process";
86
86
  import SSHConfig from "@widget-js/ssh-config";
87
87
  import Client from "ssh2-sftp-client";
88
88
  import consola2 from "consola";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@widget-js/cli",
3
3
  "type": "module",
4
- "version": "24.1.1-beta.71",
4
+ "version": "24.1.1-beta.72",
5
5
  "private": false,
6
6
  "author": "Neo Fu",
7
7
  "license": "MIT",
@@ -44,8 +44,8 @@
44
44
  "shelljs": "^0.8.5",
45
45
  "ssh2-sftp-client": "^9.1.0",
46
46
  "ws": "^8.11.0",
47
- "@widget-js/core": "24.1.1-beta.76",
48
- "@widget-js/utils": "24.1.1-beta.71",
47
+ "@widget-js/core": "24.1.1-beta.85",
48
+ "@widget-js/utils": "24.1.1-beta.72",
49
49
  "@widget-js/vue3": "24.1.1-beta.74"
50
50
  },
51
51
  "devDependencies": {
@@ -64,14 +64,14 @@
64
64
  "rimraf": "^4.4.1",
65
65
  "ts-loader": "^9.4.1",
66
66
  "ts-node": "^10.9.1",
67
- "tsup": "^6.5.0",
67
+ "tsup": "^8.3.5",
68
68
  "typescript": "^5.2.2",
69
- "vite": "^5.0.5",
69
+ "vite": "^7.1.11",
70
70
  "vitest": "^3.2.4",
71
71
  "vue-router": "^4.2.5",
72
- "@widget-js/vite-plugin-widget": "24.1.1-beta.71",
73
- "@widget-js/core": "24.1.1-beta.76",
74
- "@widget-js/vue3": "24.1.1-beta.74"
72
+ "@widget-js/vue3": "24.1.1-beta.74",
73
+ "@widget-js/core": "24.1.1-beta.85",
74
+ "@widget-js/vite-plugin-widget": "24.1.1-beta.72"
75
75
  },
76
76
  "scripts": {
77
77
  "build": "tsup-node src/index.ts",
@@ -83,7 +83,7 @@
83
83
  "widget:publish": "node ./dist/index.js publish -key 123",
84
84
  "widget:create": "npm run build && node ./dist/index.js create",
85
85
  "widget:local": "npm run build && node ./dist/index.js dependencies -t local",
86
- "widget:remote": "npm run build && node ./dist/index.js dependencies -t remote",
86
+ "widget:remote": "node ./dist/index.js dependencies -t remote",
87
87
  "build:publish": "npm run build && npm run pnpm:publish",
88
88
  "pnpm:publish": "pnpm publish --no-git-checks",
89
89
  "remote": "widget dependencies -t remote && pnpm install",