@vyr/cli 0.0.2 → 0.0.3

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.
Files changed (49) hide show
  1. package/.bin/default/index.js +0 -2
  2. package/.bin/index.js +1 -0
  3. package/.bin/install/index.js +51 -0
  4. package/.entry/app.js +362 -362
  5. package/README.md +27 -68
  6. package/README.zh-CN.md +2 -12
  7. package/build/css/{3864.d7e761ea.css → 3864.a80486d1.css} +1 -1
  8. package/build/index.html +1 -1
  9. package/build/js/{3864.d5d8003c.js → 3864.bec1192e.js} +2 -2
  10. package/build/js/{3964.66f0c619.js → 3964.96d036ca.js} +1 -1
  11. package/build/js/4530.1ef5ebfc.js +1 -0
  12. package/build/js/{6968.d6e90089.js → 4587.ca9eeb25.js} +1 -1
  13. package/build/js/{6234.efa90525.js → 6234.1227c7e7.js} +1 -1
  14. package/build/js/677.3e00dd5c.js +1 -0
  15. package/build/js/{4587.04343c23.js → 6968.0be80297.js} +1 -1
  16. package/build/js/931.df399aa1.js +1 -0
  17. package/build/js/{index.715638f0.js → index.77bb7122.js} +1 -1
  18. package/build/js/{login.1a6bff2e.js → login.740a9725.js} +1 -1
  19. package/build/js/{preview.6ee9a584.js → preview.083440fd.js} +1 -1
  20. package/build/login.html +1 -1
  21. package/build/preview.html +1 -1
  22. package/pack/auto-provider-plugin/package.json +1 -1
  23. package/pack/class-wrapper-plugin/package.json +1 -1
  24. package/pack/rollup-config-plugin/package.json +1 -1
  25. package/pack/var-rename-plugin/package.json +1 -1
  26. package/package.json +1 -2
  27. package/build/js/4530.f37bf7ff.js +0 -1
  28. package/build/js/677.c536501d.js +0 -1
  29. package/build/js/931.8edc5ac8.js +0 -1
  30. /package/build/js/{1018.841102d5.js → 1018.54b7c2da.js} +0 -0
  31. /package/build/js/{1349.8c628175.js → 1349.9b04698c.js} +0 -0
  32. /package/build/js/{1402.a2b31799.js → 1402.959080ba.js} +0 -0
  33. /package/build/js/{150.e0b6ce77.js → 150.7b02c788.js} +0 -0
  34. /package/build/js/{1583.ebe181e2.js → 1583.fe623811.js} +0 -0
  35. /package/build/js/{1877.1ae78e83.js → 1877.4e5568cd.js} +0 -0
  36. /package/build/js/{250.86810c99.js → 250.87c27d4b.js} +0 -0
  37. /package/build/js/{3085.5ce399d8.js → 3085.b4adae0b.js} +0 -0
  38. /package/build/js/{3745.cd0df446.js → 3745.7cfe411d.js} +0 -0
  39. /package/build/js/{4263.4fee7680.js → 4263.d7a13386.js} +0 -0
  40. /package/build/js/{4582.a70df995.js → 4582.334df958.js} +0 -0
  41. /package/build/js/{530.4b2961fe.js → 530.a25f4a44.js} +0 -0
  42. /package/build/js/{5639.f2d2e21b.js → 5639.21eb71b5.js} +0 -0
  43. /package/build/js/{6357.264f8155.js → 6357.d2b1aeab.js} +0 -0
  44. /package/build/js/{7195.e454ee38.js → 7195.915ff054.js} +0 -0
  45. /package/build/js/{7769.81492015.js → 7769.8bdec987.js} +0 -0
  46. /package/build/js/{8637.a22cc644.js → 8637.35feda19.js} +0 -0
  47. /package/build/js/{8657.8fef2180.js → 8657.c161c764.js} +0 -0
  48. /package/build/js/{9044.70484b04.js → 9044.8f4c6040.js} +0 -0
  49. /package/build/js/{9620.ee62a8bc.js → 9620.d8b97c72.js} +0 -0
@@ -33,7 +33,6 @@ module.exports = {
33
33
  scene: options.scene,
34
34
  static: options.static,
35
35
  entry: options.entry,
36
- extensionStatic: options.extensionStatic,
37
36
  capabilities: capabilities,
38
37
  };
39
38
 
@@ -66,7 +65,6 @@ module.exports = {
66
65
  .option('--static <string>', '静态资产目录', '/public/vyr/static')
67
66
  .option('--scene <string>', '场景资产目录', '/public/vyr/scene')
68
67
  .option('--entry <string>', '入口目录', '/src')
69
- .option('--extensionStatic <string>', '静态资产目录', '/public/vyr/extension')
70
68
  .option('--capabilities <string>', '功能支持', 'depHint')
71
69
  .option('--start <string>', '启动模式', 'prod')
72
70
  .action(this.run);
package/.bin/index.js CHANGED
@@ -5,6 +5,7 @@ const meta = require('../package.json')
5
5
 
6
6
  const commands = [
7
7
  require('./default/index'),
8
+ require('./install/index'),
8
9
  ]
9
10
 
10
11
  const commander = new Command()
@@ -0,0 +1,51 @@
1
+ const { join } = require("path");
2
+ const { execSync } = require("child_process");
3
+ const os = require('os')
4
+ const fs = require('fs-extra')
5
+
6
+ const getTempDirectory = () => {
7
+ const homeDir = os.homedir()
8
+
9
+ let directory
10
+ if (process.platform === 'win32') {
11
+ directory = join(homeDir, 'AppData', 'Roaming', 'vyr-temp');
12
+ } else {
13
+ directory = join(homeDir, '.vyr-temp');
14
+ }
15
+
16
+ fs.ensureDirSync(directory)
17
+
18
+ return directory
19
+ }
20
+
21
+ module.exports = {
22
+ name: "install",
23
+ options: { isDefault: false },
24
+ run(packagesFromArgs, options) {
25
+ if (packagesFromArgs.length === 0) return
26
+
27
+ const cwd = join(__dirname, '../../')
28
+ const extension = join(cwd, 'extension')
29
+ const temp = getTempDirectory()
30
+
31
+ execSync(['npm', 'install', ...packagesFromArgs].join(' '), { cwd: temp })
32
+
33
+ for (const name of packagesFromArgs) {
34
+ const dir = join(temp, 'node_modules', name)
35
+ if (fs.existsSync(dir) === false) {
36
+ console.log(name, '安装失败,请检查后重试!')
37
+ continue
38
+ }
39
+ const dest = join(extension, name.replaceAll('/', '-'))
40
+ if (fs.existsSync(dest)) fs.removeSync(dest)
41
+ fs.moveSync(dir, dest)
42
+ }
43
+ },
44
+ register(commander) {
45
+ commander
46
+ .command(this.name, this.options)
47
+ .arguments('[packages...]')
48
+ // .option('-b --build', ' 重新打包依赖')
49
+ .action(this.run);
50
+ },
51
+ };