rigjs 2.0.0-alpha.9 → 2.0.1
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/built/index.js +98 -98
- package/demo/cicd.rig.json5 +4 -3
- package/demo/package.json +3 -1
- package/demo/package.rig.json5 +10 -5
- package/lib/build/index.ts +25 -14
- package/lib/classes/cicd/CICD.ts +1 -0
- package/lib/classes/cicd/Deploy/AliDeploy.ts +72 -44
- package/lib/classes/cicd/Deploy/CDN.ts +14 -6
- package/lib/classes/cicd/Endpoint.ts +9 -0
- package/lib/deploy/index.ts +3 -1
- package/lib/preinstall/index.js +159 -107
- package/lib/publish/index.ts +16 -13
- package/lib/rig/index.ts +2 -2
- package/lib/{env → vue-env}/index.d.ts +0 -0
- package/lib/{env → vue-env}/index.js +0 -0
- package/package.json +1 -1
package/lib/publish/index.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import fsHelper from '../utils/fsHelper';
|
|
2
1
|
import CICD from '@/classes/cicd/CICD';
|
|
3
2
|
import CICDCmd from '@/classes/cicd/CICDCmd';
|
|
4
|
-
import shell from 'shelljs';
|
|
5
|
-
import path from 'path';
|
|
6
3
|
import CDN from '@/classes/cicd/Deploy/CDN';
|
|
7
4
|
|
|
8
5
|
const setRWriteUri = async (
|
|
@@ -15,11 +12,10 @@ const setRWriteUri = async (
|
|
|
15
12
|
domain,
|
|
16
13
|
[original],
|
|
17
14
|
[deployDir],
|
|
18
|
-
[
|
|
15
|
+
[null]
|
|
19
16
|
);
|
|
20
17
|
|
|
21
18
|
const configId = rwriteResult?.DomainConfigList.DomainConfigModel[0].ConfigId;
|
|
22
|
-
console.log('Please Wait For Set RWrite URI...');
|
|
23
19
|
while (true) {
|
|
24
20
|
const configInfo = await cdn.describeCdnDomainConfigs(domain, configId);
|
|
25
21
|
if (configInfo.DomainConfigs.DomainConfig[0].Status === 'success') {
|
|
@@ -29,7 +25,6 @@ const setRWriteUri = async (
|
|
|
29
25
|
throw new Error('cdn rewrite fail');
|
|
30
26
|
}
|
|
31
27
|
}
|
|
32
|
-
console.log('Set RWrite URI Done');
|
|
33
28
|
};
|
|
34
29
|
|
|
35
30
|
const refreshCache = async (urls: string[], cdn: CDN) => {
|
|
@@ -67,18 +62,26 @@ export default async (cmd: any) => {
|
|
|
67
62
|
|
|
68
63
|
const cdn = new CDN(target);
|
|
69
64
|
const urls: string[] = [];
|
|
65
|
+
const setRWriteUriPromises: Promise<any>[] = [];
|
|
70
66
|
for (const endpoint of cicdCmd.endpoints) {
|
|
71
67
|
// 目前只支持set一个original
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
setRWriteUriPromises.push(
|
|
69
|
+
setRWriteUri(
|
|
70
|
+
endpoint.domain,
|
|
71
|
+
`${target.uri_rewrite.original_regexp ? target.uri_rewrite.original_regexp : target.uri_rewrite.original}`,
|
|
72
|
+
`/${endpoint.deployDir.replace(/\\/g, '/')}/index.html`,
|
|
73
|
+
cdn
|
|
74
|
+
)
|
|
77
75
|
);
|
|
78
|
-
urls.push(`https://${endpoint.domain}
|
|
76
|
+
urls.push(`https://${endpoint.domain}${target.uri_rewrite.original}`);
|
|
79
77
|
}
|
|
80
78
|
|
|
79
|
+
// 回源URI改写
|
|
80
|
+
console.log('Please Wait For Set RWrite URI...');
|
|
81
|
+
await Promise.all(setRWriteUriPromises);
|
|
82
|
+
console.log('Set RWrite URI Done');
|
|
83
|
+
|
|
81
84
|
//刷新cdn
|
|
82
85
|
await refreshCache(urls, cdn);
|
|
83
|
-
console.log('
|
|
86
|
+
console.log('Publish Done-----');
|
|
84
87
|
};
|
package/lib/rig/index.ts
CHANGED
|
@@ -50,8 +50,8 @@ program.command('publish')
|
|
|
50
50
|
.option('-p , --params <params>', 'replace words in cicd.rig.json5, only words in ${} are replacable')
|
|
51
51
|
.action(publish);
|
|
52
52
|
|
|
53
|
-
import env from '../env';
|
|
53
|
+
import env from '../vue-env';
|
|
54
54
|
|
|
55
|
-
program.option('
|
|
55
|
+
program.option('--vueenv <vueenv>', 'specify vue env').action(env.load);
|
|
56
56
|
program.version(require('../../package.json').version, '-v,--version');
|
|
57
57
|
program.parse(process.argv);
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rigjs",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
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",
|