rigjs 1.0.34 → 2.0.0-alpha
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/bin/rig.js +1 -1
- package/built/index.js +47 -0
- package/demo/cicd.rig.json5 +50 -0
- package/demo/package.json +4 -3
- package/demo/package.rig.json5 +1 -6
- package/demo/rig_helper.js +7 -7
- package/demo/yarn.lock +32 -0
- package/lib/build/index.ts +17 -0
- package/lib/check/index.d.ts +6 -0
- package/lib/check/index.js +0 -1
- package/lib/classes/cicd/CICD.ts +110 -0
- package/lib/classes/cicd/CICDCmd.ts +65 -0
- package/lib/classes/cicd/Deploy/AliDeploy.ts +0 -0
- package/lib/classes/cicd/Deploy/HuaweiDeploy.ts +0 -0
- package/lib/classes/cicd/Deploy/index.ts +0 -0
- package/lib/classes/cicd/DirLevel.ts +49 -0
- package/lib/classes/cicd/Endpoint.ts +87 -0
- package/lib/define/index.ts +47 -0
- package/lib/deploy/index.ts +42 -0
- package/lib/deps/index.d.ts +6 -0
- package/lib/env/index.d.ts +4 -0
- package/lib/info/index.d.ts +6 -0
- package/lib/init/cicd.rig.json5 +17 -0
- package/lib/init/index.d.ts +6 -0
- package/lib/init/index.js +32 -40
- package/lib/init/rig_helper.js +14 -0
- package/lib/install/index.d.ts +5 -0
- package/lib/install/index.js +1 -2
- package/lib/postinstall/index.d.ts +6 -0
- package/lib/preinstall/index.d.ts +6 -0
- package/lib/rig/index.ts +48 -0
- package/lib/tag/index.d.ts +6 -0
- package/lib/tag/index.js +0 -3
- package/lib/utils/fsHelper.ts +10 -0
- package/lib/utils/index.js +4 -1
- package/lib/utils/{regex.js → regex.ts} +9 -3
- package/package.json +10 -2
- package/tsconfig.json +50 -0
- package/.github/workflows/npm-publish.yml +0 -44
- package/demo/package.rig2.json5 +0 -8
- package/lib/rig/index.js +0 -17
package/lib/rig/index.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {Command} from 'commander';
|
|
2
|
+
|
|
3
|
+
const program = new Command();
|
|
4
|
+
console.log('Hello rigjs');
|
|
5
|
+
import check from '../check';
|
|
6
|
+
|
|
7
|
+
program.command('check').action(check.load);
|
|
8
|
+
import init from '../init';
|
|
9
|
+
|
|
10
|
+
program.command('init').action(init.load);
|
|
11
|
+
import install from '../install';
|
|
12
|
+
|
|
13
|
+
program.command('install').action(install.load);
|
|
14
|
+
program.command('i').action(install.load);
|
|
15
|
+
import preinstall from '../preinstall';
|
|
16
|
+
import postinstall from '../postinstall';
|
|
17
|
+
|
|
18
|
+
program.command('preinstall').action(preinstall.load);
|
|
19
|
+
program.command('postinstall').action(postinstall.load);
|
|
20
|
+
import tag from '../tag';
|
|
21
|
+
|
|
22
|
+
program.command('tag').action(tag.load);
|
|
23
|
+
import info from '../info';
|
|
24
|
+
|
|
25
|
+
program.command('info').action(info.load);
|
|
26
|
+
import build from '../build';
|
|
27
|
+
|
|
28
|
+
program.command('build')
|
|
29
|
+
.option('-s, --schema <schema>', 'specify params in tree_schema')
|
|
30
|
+
.option('-p , --params <params>', 'replace words in cicd.rig.json5, only words in ${} are replacable')
|
|
31
|
+
.action(build);
|
|
32
|
+
// import define from '../define';
|
|
33
|
+
//
|
|
34
|
+
// program.command('define')
|
|
35
|
+
// .option('-s, --schema <schema>', 'specify params in tree_schema')
|
|
36
|
+
// .option('-p , --params <params>', 'replace words in cicd.rig.json5, only words in ${} are replacable')
|
|
37
|
+
// .action(define);
|
|
38
|
+
import deploy from '../deploy';
|
|
39
|
+
|
|
40
|
+
program.command('deploy')
|
|
41
|
+
.option('-s, --schema <schema>', 'specify params in tree_schema')
|
|
42
|
+
.option('-p , --params <params>', 'replace words in cicd.rig.json5, only words in ${} are replacable')
|
|
43
|
+
.action(deploy);
|
|
44
|
+
import env from '../env';
|
|
45
|
+
|
|
46
|
+
program.option('-e, --env <env>', 'specify env').action(env.load);
|
|
47
|
+
program.version(require('../../package.json').version, '-v,--version');
|
|
48
|
+
program.parse(process.argv);
|
package/lib/tag/index.js
CHANGED
|
@@ -5,13 +5,10 @@
|
|
|
5
5
|
* @date 2020/10/15 3:28 PM
|
|
6
6
|
*/
|
|
7
7
|
const fs = require('fs');
|
|
8
|
-
const JSON5 = require('json5');
|
|
9
8
|
const shell = require('shelljs');
|
|
10
9
|
const chalk = require('chalk');
|
|
11
10
|
const print = require('../print');
|
|
12
11
|
let red = chalk.red;
|
|
13
|
-
let greenBright = chalk.greenBright;
|
|
14
|
-
let redBright = chalk.redBright;
|
|
15
12
|
|
|
16
13
|
|
|
17
14
|
const load = async ()=>{
|
package/lib/utils/index.js
CHANGED
|
@@ -6,7 +6,13 @@
|
|
|
6
6
|
*/
|
|
7
7
|
const gitURL = /(?:git|ssh|https?|git@[-\w.]+):(\/\/)?(.*?)(\.git)(\/?|\#[-\d\w._]+?)$/;
|
|
8
8
|
const path = /^(\/\w+){0,2}\/?$/;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/**
|
|
10
|
+
* 文字下划线中划线
|
|
11
|
+
* @type {RegExp}
|
|
12
|
+
*/
|
|
13
|
+
const dynamicDir = /(^\[[\w\-]+\]$)|(^\{[\w\-]+\}$)/
|
|
14
|
+
export default {
|
|
15
|
+
gitURL,
|
|
16
|
+
path,
|
|
17
|
+
dynamicDir
|
|
12
18
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rigjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha",
|
|
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",
|
|
@@ -28,14 +28,22 @@
|
|
|
28
28
|
"c": "d demo && node ../lib/rig/index.js check",
|
|
29
29
|
"envmake": "cd demo && node ../lib/rig/index.js --env prod_view_zhs",
|
|
30
30
|
"t": "node lib/rig/index.js tag",
|
|
31
|
-
"deliver": "npm publish --registry=https://registry.npmjs.org"
|
|
31
|
+
"deliver": "npm publish --registry=https://registry.npmjs.org",
|
|
32
|
+
"build": "esbuild lib/rig/index.ts --platform=node --bundle --minify --outfile=built/index.js --external:shelljs"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
35
|
+
"@types/ali-oss": "^6.16.3",
|
|
36
|
+
"@types/json5": "^2.2.0",
|
|
37
|
+
"@types/shelljs": "^0.8.11",
|
|
38
|
+
"ali-oss": "^6.17.1",
|
|
34
39
|
"chalk": "^4.1.0",
|
|
35
40
|
"commander": "6.1.0",
|
|
36
41
|
"inquirer": "7.3.3",
|
|
37
42
|
"json5": "2.1.3",
|
|
38
43
|
"ora": "^5.1.0",
|
|
39
44
|
"shelljs": "^0.8.4"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/node": "^17.0.21"
|
|
40
48
|
}
|
|
41
49
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2015",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"strict": true,
|
|
6
|
+
"importHelpers": true,
|
|
7
|
+
"moduleResolution": "node",
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"experimentalDecorators": true,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"sourceMap": true,
|
|
12
|
+
"baseUrl": ".",
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"outDir": "./built",
|
|
15
|
+
"allowJs": true,
|
|
16
|
+
"types": [
|
|
17
|
+
"node"
|
|
18
|
+
],
|
|
19
|
+
"paths": {
|
|
20
|
+
"@/*": [
|
|
21
|
+
"./lib/*"
|
|
22
|
+
],
|
|
23
|
+
"@root/*": [
|
|
24
|
+
"./*"
|
|
25
|
+
],
|
|
26
|
+
"@static/*": [
|
|
27
|
+
"static/*"
|
|
28
|
+
],
|
|
29
|
+
"tslib": [
|
|
30
|
+
"node_modules/tslib/tslib.d.ts"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"lib": [
|
|
34
|
+
"es2015"
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"include": [
|
|
38
|
+
"index.ts",
|
|
39
|
+
"rigs/**/*.ts",
|
|
40
|
+
"src/**/*.ts",
|
|
41
|
+
"lib/**/*.ts",
|
|
42
|
+
"lib/**/*.d.ts",
|
|
43
|
+
"lib/**/*.js",
|
|
44
|
+
"test/**/*.ts",
|
|
45
|
+
"typings/**/*.ts",
|
|
46
|
+
],
|
|
47
|
+
"exclude": [
|
|
48
|
+
"node_modules"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
-
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
3
|
-
|
|
4
|
-
name: Node.js Package
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
push:
|
|
8
|
-
branches:
|
|
9
|
-
- main
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
build:
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
steps:
|
|
15
|
-
- uses: actions/checkout@v2
|
|
16
|
-
- uses: actions/setup-node@v1
|
|
17
|
-
with:
|
|
18
|
-
node-version: 12
|
|
19
|
-
|
|
20
|
-
publish-npm:
|
|
21
|
-
needs: build
|
|
22
|
-
runs-on: ubuntu-latest
|
|
23
|
-
steps:
|
|
24
|
-
- uses: actions/checkout@v2
|
|
25
|
-
- uses: actions/setup-node@v1
|
|
26
|
-
with:
|
|
27
|
-
node-version: 12
|
|
28
|
-
registry-url: https://registry.npmjs.org/
|
|
29
|
-
- run: npm publish
|
|
30
|
-
env:
|
|
31
|
-
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
|
32
|
-
|
|
33
|
-
publish-gpr:
|
|
34
|
-
needs: build
|
|
35
|
-
runs-on: ubuntu-latest
|
|
36
|
-
steps:
|
|
37
|
-
- uses: actions/checkout@v2
|
|
38
|
-
- uses: actions/setup-node@v1
|
|
39
|
-
with:
|
|
40
|
-
node-version: 12
|
|
41
|
-
registry-url: https://npm.pkg.github.com/
|
|
42
|
-
- run: npm publish
|
|
43
|
-
env:
|
|
44
|
-
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
package/demo/package.rig2.json5
DELETED
package/lib/rig/index.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const { Command } = require('commander');
|
|
2
|
-
const program = new Command();
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
program.command('check').action(require('../check').load);
|
|
5
|
-
program.command('init').action(require('../init').load);
|
|
6
|
-
program.command('install').action(require('../install').load);
|
|
7
|
-
program.command('i').action(require('../install').load);
|
|
8
|
-
program.command('publish').action(require('../publish').load);
|
|
9
|
-
program.command('p').action(require('../publish').load);
|
|
10
|
-
program.command('preinstall').action(require('../preinstall').load);
|
|
11
|
-
program.command('postinstall').action(require('../postinstall').load);
|
|
12
|
-
program.command('tag').action(require('../tag').load);
|
|
13
|
-
program.command('info').action(require('../info').load);
|
|
14
|
-
program.option('-e, --env <env>', 'specify env').action(require('../env').load);
|
|
15
|
-
|
|
16
|
-
program.version(require('../../package.json').version,'-v,--version');
|
|
17
|
-
program.parse(process.argv);
|