rigjs 2.0.0-alpha → 2.0.0-alpha.0

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.
@@ -35,7 +35,6 @@ export default async (cmd: any) => {
35
35
  const cicd = CICD.createByDefault(cmd);
36
36
  //construct cmd object
37
37
  const cicdCmd = new CICDCmd(cmd, cicd);
38
-
39
38
  }catch (e) {
40
39
  throw e;
41
40
  }
@@ -1,17 +1,9 @@
1
1
  {
2
- tree_schema: '',//tree_schema help to indicate every level of directory's meaning
2
+ tree_schema: '{app}/{env}/{oem}',
3
3
  source: {
4
- path: 'dist',
4
+ root_path: 'dist',
5
5
  },
6
- target: {
7
- type: '',
8
- bucket: '',
9
- access_token: '',
10
- root_path: '/',
11
- },
12
- predefines: {},//relpace special string in your bundle,so you can use the same bundle in different enviroments without building multiple times.
13
- endpoints: [],
14
- alias: []
6
+ target: {},
7
+ endpoints: {},
8
+ groups: [],
15
9
  }
16
-
17
-
package/lib/init/index.js CHANGED
@@ -45,16 +45,39 @@ const load = async () => {
45
45
  console.log(chalk.green('rig_helper.js already exists~'));
46
46
  } else {
47
47
  console.log(chalk.green('create rig_helper.js'));
48
- let rigHelper = fs.readFileSync(`${__dirname}/rig_helper.js`);
49
- fs.writeFileSync(`${process.cwd()}/rig_helper.js`, rigHelper);
48
+ let template = `const json5 = require('json5');
49
+ const fs = require('fs');
50
+ const getPkgs = () => {
51
+ \tlet pkgArr = json5.parse(fs.readFileSync('./package.rig.json5'));
52
+ \tlet flatPkgArr = pkgArr.map((item, index) => {
53
+ \t\treturn item.name;
54
+ \t});
55
+ \tconsole.log(flatPkgArr);
56
+ \treturn flatPkgArr;
57
+ }
58
+
59
+ module.exports = {
60
+ \tgetPkgs
61
+ }
62
+ `
63
+ fs.writeFileSync(`${process.cwd()}/rig_helper.js`, template);
50
64
  }
51
65
  if (fs.existsSync(`${process.cwd()}/cicd.rig.json5`)) {
52
66
  console.log(chalk.green('cicd.rig.json5 already exists~'));
53
67
  } else {
54
68
  console.log(chalk.green('create cicd.rig.json5'));
55
- let cicdConfig = json5.parse(fs.readFileSync(`${__dirname}/cicd.rig.json5`));
56
- cicdConfig.tree_prefix_schema = `${pkg.name}`
57
- fs.writeFileSync(`${process.cwd()}/cicd.rig.json5`, json5.stringify(cicdConfig,null,2));
69
+ let template = `{
70
+ tree_schema: '{app}/{env}/{oem}',
71
+ source: {
72
+ root_path: 'dist',
73
+ },
74
+ target: {},
75
+ endpoints: {},
76
+ groups: [],
77
+ }
78
+ `;
79
+ fs.writeFileSync(`${process.cwd()}/cicd.rig.json5`, template);
80
+
58
81
  }
59
82
  //检查rigs是否存在
60
83
  if (fs.existsSync('./rigs') && fs.lstatSync('./rigs').isDirectory()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rigjs",
3
- "version": "2.0.0-alpha",
3
+ "version": "2.0.0-alpha.0",
4
4
  "description": "A multi-repos dev tool based on yarn and git.Rig is inspired by cocoapods. Not like those monorepo solutions,rig is a tool for organizing multi-repos.",
5
5
  "keywords": [
6
6
  "modular",
package/demo/test.js DELETED
@@ -1,18 +0,0 @@
1
- // const fs = require('fs');
2
- // let pkgStr = fs.readFileSync('package.json').toString();
3
- // let pkg = JSON.parse(pkgStr);
4
- // console.log(pkg);
5
- // pkg.info = 'test';
6
- // // fs.('package.json');
7
- // fs.writeFileSync('package.json', JSON.stringify(pkg,null,2));
8
- // pkgStr = fs.readFileSync('package.json').toString();
9
- // pkg = JSON.parse(pkgStr);
10
- // console.log(pkg);
11
- //
12
- console.log(/^([a-z]+-){1,3}([0-9]+)(\.([0-9]+)){3}$/.test('a-a-1.2.1.1'));
13
- //cmd
14
- // console.log(/^(\.([0-9]+)){3}$/.test('a-a-1.2.1.1'));
15
- console.log('a-a-1.2.1.1'.split(/(?<=[a-z])-(?=[0-9])/));
16
-
17
- //抓取版本
18
-