publish-microfrontend 0.15.6-beta.5100
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/LICENSE +21 -0
- package/README.md +9 -0
- package/lib/index.js +5892 -0
- package/package.json +73 -0
- package/src/index.ts +48 -0
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "publish-microfrontend",
|
|
3
|
+
"version": "0.15.6-beta.5100",
|
|
4
|
+
"description": "A CLI for publishing micro frontends to a feed service.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"modules",
|
|
7
|
+
"microfrontend",
|
|
8
|
+
"publish",
|
|
9
|
+
"utility",
|
|
10
|
+
"cli"
|
|
11
|
+
],
|
|
12
|
+
"author": "smapiot",
|
|
13
|
+
"homepage": "https://piral.io",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"main": "lib/index.js",
|
|
16
|
+
"typings": "lib/index.d.ts",
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=12.0"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"lib",
|
|
22
|
+
"src"
|
|
23
|
+
],
|
|
24
|
+
"funding": {
|
|
25
|
+
"type": "github",
|
|
26
|
+
"url": "https://github.com/sponsors/smapiot"
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/smapiot/piral.git"
|
|
31
|
+
},
|
|
32
|
+
"bugs": {
|
|
33
|
+
"url": "https://github.com/smapiot/piral/issues"
|
|
34
|
+
},
|
|
35
|
+
"bin": {
|
|
36
|
+
"publish-microfrontend": "./lib/index.js"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"cleanup": "rimraf lib",
|
|
40
|
+
"build": "esbuild src/index.ts --bundle --outfile=lib/index.js --format=cjs --platform=node",
|
|
41
|
+
"test": "echo \"Error: run tests from root\" && exit 1"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/express": "^4.16.1",
|
|
45
|
+
"@types/glob": "^7.1.1",
|
|
46
|
+
"@types/inquirer": "^6.0.0",
|
|
47
|
+
"@types/jju": "^1.4.2",
|
|
48
|
+
"@types/mime": "^2.0.0",
|
|
49
|
+
"@types/node": "^12.7.2",
|
|
50
|
+
"@types/rc": "^1.1.0",
|
|
51
|
+
"@types/rimraf": "^2.0.2",
|
|
52
|
+
"@types/tar": "^4.0.0",
|
|
53
|
+
"@types/yargs": "^15.0.4",
|
|
54
|
+
"axios": "^0.21.1",
|
|
55
|
+
"chalk": "^4.0.0",
|
|
56
|
+
"enhanced-resolve": "^5.10.0",
|
|
57
|
+
"form-data": "^3.0.0",
|
|
58
|
+
"get-port": "^5.0.0",
|
|
59
|
+
"glob": "^7.1.3",
|
|
60
|
+
"inquirer": "^6.2.2",
|
|
61
|
+
"is-interactive": "^2.0.0",
|
|
62
|
+
"jju": "^1.4.0",
|
|
63
|
+
"mime": "^2.5.2",
|
|
64
|
+
"open": "^7.1.0",
|
|
65
|
+
"ora": "^6.1.2",
|
|
66
|
+
"rc": "^1.2.8",
|
|
67
|
+
"rimraf": "^3.0.0",
|
|
68
|
+
"tar": "^4.4.8",
|
|
69
|
+
"typescript": "^4.0.0",
|
|
70
|
+
"yargs": "^15.0.0"
|
|
71
|
+
},
|
|
72
|
+
"gitHead": "e3037bccd6f8bf036f49a057a9b92ca79e4b5442"
|
|
73
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { fromKeys, publishModeKeys } from 'piral-cli/src/helpers';
|
|
4
|
+
import * as yargs from 'yargs';
|
|
5
|
+
|
|
6
|
+
const defaultArgs = {
|
|
7
|
+
url: undefined,
|
|
8
|
+
apiKey: undefined,
|
|
9
|
+
cert: undefined,
|
|
10
|
+
mode: 'basic',
|
|
11
|
+
from: 'local',
|
|
12
|
+
fields: {},
|
|
13
|
+
headers: {},
|
|
14
|
+
interactive: false,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const args = yargs
|
|
18
|
+
.positional('source', {
|
|
19
|
+
type: 'string',
|
|
20
|
+
describe: 'Sets the source of either the previously packed *.tgz bundle or the directory to publish.',
|
|
21
|
+
})
|
|
22
|
+
.string('url')
|
|
23
|
+
.describe('url', 'Sets the explicit URL where to publish the micro frontend to.')
|
|
24
|
+
.default('url', defaultArgs.url)
|
|
25
|
+
.string('api-key')
|
|
26
|
+
.describe('api-key', 'Sets the potential API key to send to the service.')
|
|
27
|
+
.default('api-key', defaultArgs.apiKey)
|
|
28
|
+
.string('ca-cert')
|
|
29
|
+
.describe('ca-cert', 'Sets a custom certificate authority to use, if any.')
|
|
30
|
+
.default('ca-cert', defaultArgs.cert)
|
|
31
|
+
.choices('mode', publishModeKeys)
|
|
32
|
+
.describe('mode', 'Sets the authorization mode to use.')
|
|
33
|
+
.default('mode', defaultArgs.mode)
|
|
34
|
+
.alias('mode', 'auth-mode')
|
|
35
|
+
.choices('from', fromKeys)
|
|
36
|
+
.describe('from', 'Sets the type of the source to use for publishing.')
|
|
37
|
+
.default('from', defaultArgs.from)
|
|
38
|
+
.option('fields', undefined)
|
|
39
|
+
.describe('fields', 'Sets additional fields to be included in the feed service request.')
|
|
40
|
+
.default('fields', defaultArgs.fields)
|
|
41
|
+
.option('headers', undefined)
|
|
42
|
+
.describe('headers', 'Sets additional headers to be included in the feed service request.')
|
|
43
|
+
.default('headers', defaultArgs.headers)
|
|
44
|
+
.boolean('interactive')
|
|
45
|
+
.describe('interactive', 'Defines if authorization tokens can be retrieved interactively.')
|
|
46
|
+
.default('interactive', defaultArgs.interactive).argv;
|
|
47
|
+
|
|
48
|
+
console.log('First release.', args.source);
|