@widget-js/cli 1.2.9-rc.3 → 1.2.9-rc.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/lib/index.js CHANGED
@@ -20,7 +20,7 @@ program.command("dependencies").description("Set @widget-js dependencies to loca
20
20
  await dependencies.default(options);
21
21
  });
22
22
  program.command("init").description("Initialize widget-js project").action(async () => {
23
- const init = await import("./init-QWD6RW77.js");
23
+ const init = await import("./init-RLKWBXN2.js");
24
24
  await init.init();
25
25
  });
26
26
  var typeOption = new Option("-t, --type <type>").choices(["ftp", "oss"]);
@@ -18,6 +18,9 @@ import consola from "consola";
18
18
  import chalk from "chalk";
19
19
  import ora from "ora";
20
20
  import { scanWidgetPackage } from "@widget-js/utils";
21
+ import { fileURLToPath } from "url";
22
+ var __filename = fileURLToPath(import.meta.url);
23
+ var __dirname = path.dirname(__filename);
21
24
  var spinner = ora("Loading");
22
25
  async function init() {
23
26
  await addDependencies();
@@ -89,7 +92,7 @@ async function createRouter() {
89
92
  const widgetRouterPath = path.join(rootDir, "widget-router.ts");
90
93
  const routerContent = fs.readFileSync(path.join(__dirname, "../template/widget-router.ts"), "utf8");
91
94
  fs.writeFileSync(widgetRouterPath, routerContent);
92
- const vueRouterPath = path.join(process.cwd(), "./router/index.ts");
95
+ const vueRouterPath = path.join(process.cwd(), "./src/router/index.ts");
93
96
  spinner.info("\u4FEE\u6539VueRouter\u914D\u7F6E");
94
97
  if (fs.existsSync(vueRouterPath)) {
95
98
  let vueRouterContent = fs.readFileSync(vueRouterPath, "utf8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widget-js/cli",
3
- "version": "1.2.9-rc.3",
3
+ "version": "1.2.9-rc.5",
4
4
  "main": "lib/index.js",
5
5
  "author": "Neo Fu",
6
6
  "license": "MIT",
@@ -13,7 +13,6 @@ import {EJSUtils} from './utils/EJSUtils'
13
13
  import {WidgetPackageUtils} from "./utils/WidgetPackageUtils";
14
14
  // import vm from "vm";
15
15
  const __filename = fileURLToPath(import.meta.url)
16
-
17
16
  const __dirname = path.dirname(__filename)
18
17
 
19
18
  interface RenderOptions {
package/src/init/init.ts CHANGED
@@ -10,7 +10,9 @@ import ora from 'ora'
10
10
  import {PrettierUtils} from '../utils/PrettierUtils'
11
11
  import {scanWidgetPackage} from '@widget-js/utils'
12
12
  import {WidgetPackageUtils} from '../utils/WidgetPackageUtils'
13
-
13
+ import {fileURLToPath} from "url";
14
+ const __filename = fileURLToPath(import.meta.url)
15
+ const __dirname = path.dirname(__filename)
14
16
  const spinner = ora('Loading')
15
17
 
16
18
  export async function init() {
@@ -96,7 +98,7 @@ async function createRouter() {
96
98
  const routerContent = fs.readFileSync(path.join(__dirname, '../template/widget-router.ts'), 'utf8')
97
99
  fs.writeFileSync(widgetRouterPath, routerContent)
98
100
 
99
- const vueRouterPath = path.join(process.cwd(), './router/index.ts')
101
+ const vueRouterPath = path.join(process.cwd(), './src/router/index.ts')
100
102
  spinner.info('修改VueRouter配置')
101
103
  if (fs.existsSync(vueRouterPath)) {
102
104
  let vueRouterContent = fs.readFileSync(vueRouterPath, 'utf8')
@@ -7,6 +7,7 @@ export default new WidgetPackage({
7
7
  'zh-CN': '修改成你的组件描述',
8
8
  },
9
9
  entry: 'index.html',
10
+ hash: false,
10
11
  homepage: '',
11
12
  name: '<%= name %>',
12
13
  title: {