@unisphere/cli 1.13.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/CHANGELOG.md +13 -0
- package/README.md +17 -0
- package/bundler/context/rollup.js +199 -0
- package/bundler/package/bundled-dependencies.js +15 -0
- package/bundler/package/fix-package-json-dependencies.js +104 -0
- package/bundler/package/rollup.js +116 -0
- package/package.json +49 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +12 -0
- package/src/index.js.map +1 -0
- package/src/lib/commands/context/activate/check-availability.d.ts +7 -0
- package/src/lib/commands/context/activate/check-availability.js +29 -0
- package/src/lib/commands/context/activate/check-availability.js.map +1 -0
- package/src/lib/commands/context/activate/command.d.ts +2 -0
- package/src/lib/commands/context/activate/command.js +16 -0
- package/src/lib/commands/context/activate/command.js.map +1 -0
- package/src/lib/commands/context/activate/element/command.d.ts +2 -0
- package/src/lib/commands/context/activate/element/command.js +73 -0
- package/src/lib/commands/context/activate/element/command.js.map +1 -0
- package/src/lib/commands/context/activate/loader/command.d.ts +2 -0
- package/src/lib/commands/context/activate/loader/command.js +55 -0
- package/src/lib/commands/context/activate/loader/command.js.map +1 -0
- package/src/lib/commands/context/activate/runtime-file-utils.d.ts +20 -0
- package/src/lib/commands/context/activate/runtime-file-utils.js +39 -0
- package/src/lib/commands/context/activate/runtime-file-utils.js.map +1 -0
- package/src/lib/commands/context/activate/update-runtime-version.d.ts +23 -0
- package/src/lib/commands/context/activate/update-runtime-version.js +78 -0
- package/src/lib/commands/context/activate/update-runtime-version.js.map +1 -0
- package/src/lib/commands/context/activate/verify-env-readiness.d.ts +8 -0
- package/src/lib/commands/context/activate/verify-env-readiness.js +54 -0
- package/src/lib/commands/context/activate/verify-env-readiness.js.map +1 -0
- package/src/lib/commands/context/activate/workspace/command.d.ts +2 -0
- package/src/lib/commands/context/activate/workspace/command.js +60 -0
- package/src/lib/commands/context/activate/workspace/command.js.map +1 -0
- package/src/lib/commands/context/build-command.d.ts +2 -0
- package/src/lib/commands/context/build-command.js +74 -0
- package/src/lib/commands/context/build-command.js.map +1 -0
- package/src/lib/commands/context/context-command.d.ts +2 -0
- package/src/lib/commands/context/context-command.js +19 -0
- package/src/lib/commands/context/context-command.js.map +1 -0
- package/src/lib/commands/context/publish/command.d.ts +2 -0
- package/src/lib/commands/context/publish/command.js +82 -0
- package/src/lib/commands/context/publish/command.js.map +1 -0
- package/src/lib/commands/context/publish/execute/execute.d.ts +2 -0
- package/src/lib/commands/context/publish/execute/execute.js +118 -0
- package/src/lib/commands/context/publish/execute/execute.js.map +1 -0
- package/src/lib/commands/context/publish/execute/sync-element.d.ts +8 -0
- package/src/lib/commands/context/publish/execute/sync-element.js +58 -0
- package/src/lib/commands/context/publish/execute/sync-element.js.map +1 -0
- package/src/lib/commands/context/publish/prepare/build-nx-runtimes.d.ts +11 -0
- package/src/lib/commands/context/publish/prepare/build-nx-runtimes.js +112 -0
- package/src/lib/commands/context/publish/prepare/build-nx-runtimes.js.map +1 -0
- package/src/lib/commands/context/publish/prepare/prepare.d.ts +2 -0
- package/src/lib/commands/context/publish/prepare/prepare.js +122 -0
- package/src/lib/commands/context/publish/prepare/prepare.js.map +1 -0
- package/src/lib/commands/context/publish/types.d.ts +15 -0
- package/src/lib/commands/context/publish/types.js +3 -0
- package/src/lib/commands/context/publish/types.js.map +1 -0
- package/src/lib/commands/context/serve-command.d.ts +2 -0
- package/src/lib/commands/context/serve-command.js +76 -0
- package/src/lib/commands/context/serve-command.js.map +1 -0
- package/src/lib/commands/info/command.d.ts +2 -0
- package/src/lib/commands/info/command.js +51 -0
- package/src/lib/commands/info/command.js.map +1 -0
- package/src/lib/commands/init/command.d.ts +2 -0
- package/src/lib/commands/init/command.js +46 -0
- package/src/lib/commands/init/command.js.map +1 -0
- package/src/lib/commands/package/build-command.d.ts +2 -0
- package/src/lib/commands/package/build-command.js +70 -0
- package/src/lib/commands/package/build-command.js.map +1 -0
- package/src/lib/commands/package/link/command.d.ts +2 -0
- package/src/lib/commands/package/link/command.js +110 -0
- package/src/lib/commands/package/link/command.js.map +1 -0
- package/src/lib/commands/package/package-command.d.ts +2 -0
- package/src/lib/commands/package/package-command.js +15 -0
- package/src/lib/commands/package/package-command.js.map +1 -0
- package/src/lib/commands/package/publish/command.d.ts +2 -0
- package/src/lib/commands/package/publish/command.js +37 -0
- package/src/lib/commands/package/publish/command.js.map +1 -0
- package/src/lib/commands/package/publish/deploy-to-github.d.ts +13 -0
- package/src/lib/commands/package/publish/deploy-to-github.js +151 -0
- package/src/lib/commands/package/publish/deploy-to-github.js.map +1 -0
- package/src/lib/commands/package/publish/deploy-to-npm.d.ts +13 -0
- package/src/lib/commands/package/publish/deploy-to-npm.js +151 -0
- package/src/lib/commands/package/publish/deploy-to-npm.js.map +1 -0
- package/src/lib/commands/package/publish/publish.d.ts +2 -0
- package/src/lib/commands/package/publish/publish.js +133 -0
- package/src/lib/commands/package/publish/publish.js.map +1 -0
- package/src/lib/commands/package/publish/types.d.ts +7 -0
- package/src/lib/commands/package/publish/types.js +3 -0
- package/src/lib/commands/package/publish/types.js.map +1 -0
- package/src/lib/unisphere.d.ts +2 -0
- package/src/lib/unisphere.js +19 -0
- package/src/lib/unisphere.js.map +1 -0
- package/src/lib/utils/artifacts.d.ts +6 -0
- package/src/lib/utils/artifacts.js +44 -0
- package/src/lib/utils/artifacts.js.map +1 -0
- package/src/lib/utils/aws/copy-s3-folder.d.ts +7 -0
- package/src/lib/utils/aws/copy-s3-folder.js +43 -0
- package/src/lib/utils/aws/copy-s3-folder.js.map +1 -0
- package/src/lib/utils/aws/download-json-from-bucket.d.ts +8 -0
- package/src/lib/utils/aws/download-json-from-bucket.js +42 -0
- package/src/lib/utils/aws/download-json-from-bucket.js.map +1 -0
- package/src/lib/utils/aws/get-s3-client.d.ts +2 -0
- package/src/lib/utils/aws/get-s3-client.js +39 -0
- package/src/lib/utils/aws/get-s3-client.js.map +1 -0
- package/src/lib/utils/aws/is-s3-file-exists.d.ts +6 -0
- package/src/lib/utils/aws/is-s3-file-exists.js +36 -0
- package/src/lib/utils/aws/is-s3-file-exists.js.map +1 -0
- package/src/lib/utils/aws/is-s3-folder-exists.d.ts +8 -0
- package/src/lib/utils/aws/is-s3-folder-exists.js +33 -0
- package/src/lib/utils/aws/is-s3-folder-exists.js.map +1 -0
- package/src/lib/utils/aws/list-s3-folders.d.ts +8 -0
- package/src/lib/utils/aws/list-s3-folders.js +32 -0
- package/src/lib/utils/aws/list-s3-folders.js.map +1 -0
- package/src/lib/utils/aws/mime-type-mapping.d.ts +2 -0
- package/src/lib/utils/aws/mime-type-mapping.js +8624 -0
- package/src/lib/utils/aws/mime-type-mapping.js.map +1 -0
- package/src/lib/utils/aws/upload-json-to-bucket.d.ts +9 -0
- package/src/lib/utils/aws/upload-json-to-bucket.js +31 -0
- package/src/lib/utils/aws/upload-json-to-bucket.js.map +1 -0
- package/src/lib/utils/aws/upload-to-aws-bucket.d.ts +9 -0
- package/src/lib/utils/aws/upload-to-aws-bucket.js +60 -0
- package/src/lib/utils/aws/upload-to-aws-bucket.js.map +1 -0
- package/src/lib/utils/github/tags.d.ts +10 -0
- package/src/lib/utils/github/tags.js +71 -0
- package/src/lib/utils/github/tags.js.map +1 -0
- package/src/lib/utils/listr2/create-exec-task.d.ts +8 -0
- package/src/lib/utils/listr2/create-exec-task.js +38 -0
- package/src/lib/utils/listr2/create-exec-task.js.map +1 -0
- package/src/lib/utils/listr2/defaults.d.ts +4 -0
- package/src/lib/utils/listr2/defaults.js +25 -0
- package/src/lib/utils/listr2/defaults.js.map +1 -0
- package/src/lib/utils/prompts/prompts.d.ts +24 -0
- package/src/lib/utils/prompts/prompts.js +184 -0
- package/src/lib/utils/prompts/prompts.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/confirm.d.ts +19 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/confirm.js +75 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/confirm.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/index.d.ts +4 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/index.js +12 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/index.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/prompt.d.ts +12 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/prompt.js +55 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/prompt.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/select.d.ts +30 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/select.js +106 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/select.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/text.d.ts +35 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/text.js +130 -0
- package/src/lib/utils/prompts/vendor/prompts/elements/text.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/index.d.ts +9 -0
- package/src/lib/utils/prompts/vendor/prompts/index.js +66 -0
- package/src/lib/utils/prompts/vendor/prompts/index.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/prompts.d.ts +27 -0
- package/src/lib/utils/prompts/vendor/prompts/prompts.js +52 -0
- package/src/lib/utils/prompts/vendor/prompts/prompts.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/util/action.d.ts +1 -0
- package/src/lib/utils/prompts/vendor/prompts/util/action.js +39 -0
- package/src/lib/utils/prompts/vendor/prompts/util/action.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/util/clear.d.ts +1 -0
- package/src/lib/utils/prompts/vendor/prompts/util/clear.js +17 -0
- package/src/lib/utils/prompts/vendor/prompts/util/clear.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/util/figures.d.ts +9 -0
- package/src/lib/utils/prompts/vendor/prompts/util/figures.js +21 -0
- package/src/lib/utils/prompts/vendor/prompts/util/figures.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/util/index.d.ts +6 -0
- package/src/lib/utils/prompts/vendor/prompts/util/index.js +14 -0
- package/src/lib/utils/prompts/vendor/prompts/util/index.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/util/strip.d.ts +1 -0
- package/src/lib/utils/prompts/vendor/prompts/util/strip.js +12 -0
- package/src/lib/utils/prompts/vendor/prompts/util/strip.js.map +1 -0
- package/src/lib/utils/prompts/vendor/prompts/util/style.d.ts +27 -0
- package/src/lib/utils/prompts/vendor/prompts/util/style.js +30 -0
- package/src/lib/utils/prompts/vendor/prompts/util/style.js.map +1 -0
- package/src/lib/utils/read-json-file.d.ts +6 -0
- package/src/lib/utils/read-json-file.js +19 -0
- package/src/lib/utils/read-json-file.js.map +1 -0
- package/src/lib/utils/unisphere/augment-workspace-config.d.ts +2 -0
- package/src/lib/utils/unisphere/augment-workspace-config.js +212 -0
- package/src/lib/utils/unisphere/augment-workspace-config.js.map +1 -0
- package/src/lib/utils/unisphere/build-unisphere-elements.d.ts +16 -0
- package/src/lib/utils/unisphere/build-unisphere-elements.js +67 -0
- package/src/lib/utils/unisphere/build-unisphere-elements.js.map +1 -0
- package/src/lib/utils/unisphere/find-unisphere-workspace-file.d.ts +2 -0
- package/src/lib/utils/unisphere/find-unisphere-workspace-file.js +35 -0
- package/src/lib/utils/unisphere/find-unisphere-workspace-file.js.map +1 -0
- package/src/lib/utils/unisphere/get-global-file.d.ts +2 -0
- package/src/lib/utils/unisphere/get-global-file.js +27 -0
- package/src/lib/utils/unisphere/get-global-file.js.map +1 -0
- package/src/lib/utils/unisphere/types.d.ts +88 -0
- package/src/lib/utils/unisphere/types.js +97 -0
- package/src/lib/utils/unisphere/types.js.map +1 -0
- package/src/lib/utils/unisphere/workspace.d.ts +5 -0
- package/src/lib/utils/unisphere/workspace.js +50 -0
- package/src/lib/utils/unisphere/workspace.js.map +1 -0
- package/src/lib/utils/unisphere-utils.d.ts +7 -0
- package/src/lib/utils/unisphere-utils.js +33 -0
- package/src/lib/utils/unisphere-utils.js.map +1 -0
- package/src/lib/utils/utils.d.ts +9 -0
- package/src/lib/utils/utils.js +33 -0
- package/src/lib/utils/utils.js.map +1 -0
- package/src/lib/utils/validator.d.ts +33 -0
- package/src/lib/utils/validator.js +109 -0
- package/src/lib/utils/validator.js.map +1 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPublishCommand = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const commander_1 = require("commander");
|
|
6
|
+
const utils_1 = require("../../../utils/utils");
|
|
7
|
+
const prepare_1 = require("./prepare/prepare");
|
|
8
|
+
const fs = require("fs-extra");
|
|
9
|
+
const process = require("process");
|
|
10
|
+
const debug_1 = require("debug");
|
|
11
|
+
const execute_1 = require("./execute/execute");
|
|
12
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
13
|
+
const debug = (0, debug_1.default)('unisphere:context:publish');
|
|
14
|
+
const createPublishCommand = (parentCommand) => {
|
|
15
|
+
const publishCommand = parentCommand.command('publish');
|
|
16
|
+
publishCommand.description('publish all Unisphere contexts of the current project');
|
|
17
|
+
const prepareCommand = publishCommand.command('prepare');
|
|
18
|
+
const executeCommand = publishCommand.command('execute');
|
|
19
|
+
const tagsCheckOption = new commander_1.Option('--no-tags-check', 'bypass github tags checks');
|
|
20
|
+
tagsCheckOption.defaultValue = true;
|
|
21
|
+
tagsCheckOption.hidden = true;
|
|
22
|
+
const noCIOption = new commander_1.Option('--no-ci', 'do not run in CI mode');
|
|
23
|
+
noCIOption.defaultValue = true;
|
|
24
|
+
noCIOption.hidden = true;
|
|
25
|
+
const noLintOption = new commander_1.Option('--no-lint', 'skip linting');
|
|
26
|
+
noLintOption.defaultValue = true;
|
|
27
|
+
noLintOption.hidden = true;
|
|
28
|
+
const cacheKeyOption = new commander_1.Option('--cache-key <name>', 'the cache key');
|
|
29
|
+
cacheKeyOption.hidden = true;
|
|
30
|
+
prepareCommand
|
|
31
|
+
.description('prepare all Unisphere contexts of the current project for upload')
|
|
32
|
+
.option('--verbose', 'output debug logs', false)
|
|
33
|
+
.option('--cwd <name>', 'the working directory')
|
|
34
|
+
.addOption(tagsCheckOption)
|
|
35
|
+
.addOption(noCIOption)
|
|
36
|
+
.addOption(noLintOption)
|
|
37
|
+
.addOption(cacheKeyOption)
|
|
38
|
+
.hook('preAction', utils_1.printVerboseHook)
|
|
39
|
+
.action((options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
debug(`options: ${JSON.stringify(options)}`);
|
|
41
|
+
debug(`creating unique folder for artifacts`);
|
|
42
|
+
const artifactsRootFolder = yield (0, artifacts_1.createArtifactsFolder)(options.cacheKey);
|
|
43
|
+
debug(`created unique folder for artifacts: ${artifactsRootFolder}`);
|
|
44
|
+
if (options.ci) {
|
|
45
|
+
if (process.env.GITHUB_OUTPUT) {
|
|
46
|
+
debug(`writing artifactsRootFolder to Github Action output`);
|
|
47
|
+
const output = `artifactsRootFolder=${artifactsRootFolder}\n`;
|
|
48
|
+
yield fs.appendFile(process.env.GITHUB_OUTPUT, output);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
throw new Error('Not running in a GitHub Action environment.');
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
debug(`bypassing CI mode (flag --no-ci provided)`);
|
|
56
|
+
}
|
|
57
|
+
yield (0, prepare_1.prepare)(Object.assign(Object.assign({}, options), { cwd: options.cwd || process.cwd(), artifactsRootFolder }));
|
|
58
|
+
debug(`prepare done`);
|
|
59
|
+
}));
|
|
60
|
+
executeCommand
|
|
61
|
+
.description('Upload all Unisphere contexts of the current project')
|
|
62
|
+
.option('--verbose', 'output debug logs', false)
|
|
63
|
+
.requiredOption('--env <id>', 'the environment to deploy to')
|
|
64
|
+
.requiredOption('--aws-region <value>', 'The AWS region')
|
|
65
|
+
.option('--cwd <name>', 'the working directory')
|
|
66
|
+
.requiredOption('--artifacts-folder <name>', 'the artifacts folder of this project (provided by `deploy contexts prepare` command)')
|
|
67
|
+
.option('--dry-run', 'run the deployment in dry-run mode', false)
|
|
68
|
+
.option('--aws-arn <name>', 'the aws ARN to assume')
|
|
69
|
+
.addOption(tagsCheckOption)
|
|
70
|
+
.hook('preAction', utils_1.printVerboseHook)
|
|
71
|
+
.action((options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
72
|
+
// todo validate others
|
|
73
|
+
if (!options.artifactsFolder) {
|
|
74
|
+
throw new Error('Missing required option --artifacts-folder');
|
|
75
|
+
}
|
|
76
|
+
yield (0, execute_1.execute)(Object.assign(Object.assign({}, options), { cwd: options.cwd || process.cwd() }));
|
|
77
|
+
debug(`sync done`);
|
|
78
|
+
}));
|
|
79
|
+
return publishCommand;
|
|
80
|
+
};
|
|
81
|
+
exports.createPublishCommand = createPublishCommand;
|
|
82
|
+
//# sourceMappingURL=command.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../../../../../../../packages/unisphere-cli/src/lib/commands/context/publish/command.ts"],"names":[],"mappings":";;;;AAAA,yCAA4C;AAC5C,gDAAwD;AACxD,+CAA4C;AAC5C,+BAA+B;AAC/B,mCAAmC;AACnC,iCAA0B;AAC1B,+CAA4C;AAC5C,wDAAiE;AAEjE,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,2BAA2B,CAAC,CAAC;AAE1C,MAAM,oBAAoB,GAAG,CAAC,aAAsB,EAAW,EAAE;IACtE,MAAM,cAAc,GAAG,aAAa,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAExD,cAAc,CAAC,WAAW,CACxB,uDAAuD,CACxD,CAAC;IACF,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEzD,MAAM,eAAe,GAAG,IAAI,kBAAM,CAChC,iBAAiB,EACjB,2BAA2B,CAC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CAAC;QACH,KAAK,CAAC,WAAW,CAAC,CAAC;IACrB,CAAC,CAAA,CAAC,CAAC;IAEL,OAAO,cAAc,CAAC;AACxB,CAAC,CAAC;AA7FW,QAAA,oBAAoB,wBA6F/B"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.execute = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const debug_1 = require("debug");
|
|
6
|
+
const listr2_1 = require("listr2");
|
|
7
|
+
const workspace_1 = require("../../../../utils/unisphere/workspace");
|
|
8
|
+
const sync_element_1 = require("./sync-element");
|
|
9
|
+
const unisphere_utils_1 = require("../../../../utils/unisphere-utils");
|
|
10
|
+
const defaults_1 = require("../../../../utils/listr2/defaults");
|
|
11
|
+
const debug = (0, debug_1.default)('unisphere:context:upload:execute');
|
|
12
|
+
function execute(options) {
|
|
13
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
debug(`options: ${JSON.stringify(options)}`);
|
|
15
|
+
const unisphereWorkspace = yield (0, workspace_1.getUnisphereWorkspace)(options.cwd);
|
|
16
|
+
const unisphereElements = unisphereWorkspace.config.elements;
|
|
17
|
+
debug(`Executing upload for elements in repository ${unisphereWorkspace.name}`);
|
|
18
|
+
const tasks = new listr2_1.Listr([
|
|
19
|
+
{
|
|
20
|
+
title: 'Sync workspace elements',
|
|
21
|
+
task: (ctx, task) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
return task.newListr([
|
|
23
|
+
unisphereElements.workspace
|
|
24
|
+
? {
|
|
25
|
+
title: 'Sync workspace',
|
|
26
|
+
task: (ctx, task) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
27
|
+
var _a;
|
|
28
|
+
if (((_a = unisphereElements.workspace) === null || _a === void 0 ? void 0 : _a.distributionChannel) ===
|
|
29
|
+
'none') {
|
|
30
|
+
task.title = `Skipping workspace runtime because it has no distribution channel`;
|
|
31
|
+
task.skip();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (options.tagsCheck &&
|
|
35
|
+
!unisphereElements.workspace.hasGithubTag) {
|
|
36
|
+
task.title = `Skipping workspace '${unisphereElements.workspace.nxProjectName}' because it doesn't have a github tag`;
|
|
37
|
+
task.skip();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const bucketPrefix = (0, unisphere_utils_1.getWorkspaceBucketPrefix)(unisphereElements.workspace.version);
|
|
41
|
+
yield (0, sync_element_1.syncElement)({
|
|
42
|
+
options,
|
|
43
|
+
name: 'workspace',
|
|
44
|
+
bucketPrefix,
|
|
45
|
+
nxProjectName: unisphereElements.workspace.nxProjectName,
|
|
46
|
+
version: unisphereElements.workspace.version,
|
|
47
|
+
});
|
|
48
|
+
}),
|
|
49
|
+
}
|
|
50
|
+
: null,
|
|
51
|
+
unisphereElements.loader
|
|
52
|
+
? {
|
|
53
|
+
title: 'Sync loader',
|
|
54
|
+
task: (ctx, task) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
var _b;
|
|
56
|
+
if (((_b = unisphereElements.loader) === null || _b === void 0 ? void 0 : _b.distributionChannel) === 'none') {
|
|
57
|
+
task.title = `Skipping loader runtime because it has no distribution channel`;
|
|
58
|
+
task.skip();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (options.tagsCheck &&
|
|
62
|
+
!unisphereElements.loader.hasGithubTag) {
|
|
63
|
+
task.title = `Skipping loader because it doesn't have a github tag`;
|
|
64
|
+
task.skip();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const bucketPrefix = (0, unisphere_utils_1.getLoaderBucketPrefix)(unisphereElements.loader.version);
|
|
68
|
+
yield (0, sync_element_1.syncElement)({
|
|
69
|
+
options,
|
|
70
|
+
bucketPrefix,
|
|
71
|
+
name: 'loader',
|
|
72
|
+
nxProjectName: unisphereElements.loader.nxProjectName,
|
|
73
|
+
version: unisphereElements.loader.version,
|
|
74
|
+
});
|
|
75
|
+
}),
|
|
76
|
+
}
|
|
77
|
+
: null,
|
|
78
|
+
].filter(Boolean));
|
|
79
|
+
}),
|
|
80
|
+
},
|
|
81
|
+
Object.keys(unisphereElements.contexts || {}).length !== 0
|
|
82
|
+
? {
|
|
83
|
+
title: 'Sync contexts',
|
|
84
|
+
task: (ctx, task) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const contextTasks = Object.entries(unisphereElements.contexts || []).map(([context, { hasGithubTag, version, nxProjectName, distributionChannel },]) => ({
|
|
86
|
+
title: `Sync context: ${context}`,
|
|
87
|
+
skip: () => {
|
|
88
|
+
if (distributionChannel === 'none') {
|
|
89
|
+
debug(`Skipping context '${context}' because it has no distribution channel`);
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
if (options.tagsCheck && !hasGithubTag) {
|
|
93
|
+
debug(`Skipping context '${context}' because it doesn't have a github tag`);
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
return false;
|
|
97
|
+
},
|
|
98
|
+
task: () => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
const bucketPrefix = (0, unisphere_utils_1.getElementContextBucketPrefix)(unisphereWorkspace.name, context, version);
|
|
100
|
+
yield (0, sync_element_1.syncElement)({
|
|
101
|
+
options,
|
|
102
|
+
bucketPrefix,
|
|
103
|
+
name: context,
|
|
104
|
+
nxProjectName,
|
|
105
|
+
version,
|
|
106
|
+
});
|
|
107
|
+
}),
|
|
108
|
+
}));
|
|
109
|
+
return task.newListr(contextTasks);
|
|
110
|
+
}),
|
|
111
|
+
}
|
|
112
|
+
: null,
|
|
113
|
+
].filter(Boolean), (0, defaults_1.getDefaultListrOptions)());
|
|
114
|
+
yield tasks.run();
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
exports.execute = execute;
|
|
118
|
+
//# sourceMappingURL=execute.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute.js","sourceRoot":"","sources":["../../../../../../../../../packages/unisphere-cli/src/lib/commands/context/publish/execute/execute.ts"],"names":[],"mappings":";;;;AAAA,iCAA0B;AAC1B,mCAA+B;AAE/B,qEAA8E;AAC9E,iDAA6C;AAC7C,uEAI2C;AAC3C,gEAA2E;AAE3E,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,kCAAkC,CAAC,CAAC;AAExD,SAAsB,OAAO,CAAC,OAAoB;;QAChD,KAAK,CAAC,YAAY,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAE7C,MAAM,kBAAkB,GAAG,MAAM,IAAA,iCAAqB,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACpE,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC;QAE7D,KAAK,CACH,+CAA+C,kBAAkB,CAAC,IAAI,EAAE,CACzE,CAAC;QAEF,MAAM,KAAK,GAAG,IAAI,cAAK,CACrB;YACE;gBACE,KAAK,EAAE,yBAAyB;gBAChC,IAAI,EAAE,CAAO,GAAG,EAAE,IAAI,EAAE,EAAE;oBACxB,OAAO,IAAI,CAAC,QAAQ,CAClB;wBACE,iBAAiB,CAAC,SAAS;4BACzB,CAAC,CAAC;gCACE,KAAK,EAAE,gBAAgB;gCACvB,IAAI,EAAE,CAAO,GAAG,EAAE,IAAI,EAAE,EAAE;;oCACxB,IACE,CAAA,MAAA,iBAAiB,CAAC,SAAS,0CAAE,mBAAmB;wCAChD,MAAM,EACN;wCACA,IAAI,CAAC,KAAK,GAAG,mEAAmE,CAAC;wCACjF,IAAI,CAAC,IAAI,EAAE,CAAC;wCACZ,OAAO;qCACR;oCAED,IACE,OAAO,CAAC,SAAS;wCACjB,CAAC,iBAAiB,CAAC,SAAS,CAAC,YAAY,EACzC;wCACA,IAAI,CAAC,KAAK,GAAG,uBAAuB,iBAAiB,CAAC,SAAS,CAAC,aAAa,wCAAwC,C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AAC,CAAC,IAAI;SACT,CAAC,MAAM,CAAC,OAAO,CAAC,EACjB,IAAA,iCAAsB,GAAE,CACzB,CAAC;QAEF,MAAM,KAAK,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC;CAAA;AAjJD,0BAiJC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SyncOptions } from '../types';
|
|
2
|
+
export declare function syncElement({ name, bucketPrefix, nxProjectName, options, version, }: {
|
|
3
|
+
name: string;
|
|
4
|
+
options: SyncOptions;
|
|
5
|
+
nxProjectName: string;
|
|
6
|
+
bucketPrefix: string;
|
|
7
|
+
version: string;
|
|
8
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.syncElement = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const unisphere_utils_1 = require("../../../../utils/unisphere-utils");
|
|
6
|
+
const fs_extra_1 = require("fs-extra");
|
|
7
|
+
const upload_to_aws_bucket_1 = require("../../../../utils/aws/upload-to-aws-bucket");
|
|
8
|
+
const debug_1 = require("debug");
|
|
9
|
+
const is_s3_folder_exists_1 = require("../../../../utils/aws/is-s3-folder-exists");
|
|
10
|
+
const artifacts_1 = require("../../../../utils/artifacts");
|
|
11
|
+
const debug = (0, debug_1.default)('unisphere:deploy:deploy-workspace');
|
|
12
|
+
// TODO use Listr2 instead
|
|
13
|
+
function syncElement({ name, bucketPrefix, nxProjectName, options, version, }) {
|
|
14
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
debug(`Syncing element '${name}' version '${version}'`);
|
|
16
|
+
const { artifactsPath, statusFilePath } = yield (0, artifacts_1.getProjectArtifactsPaths)(options.artifactsFolder, nxProjectName);
|
|
17
|
+
if (!(yield (0, fs_extra_1.pathExists)(artifactsPath))) {
|
|
18
|
+
throw new Error(`Cannot sync element, artifacts path ${artifactsPath} not found`);
|
|
19
|
+
}
|
|
20
|
+
if (!(yield (0, fs_extra_1.pathExists)(statusFilePath))) {
|
|
21
|
+
throw new Error(`Cannot sync element, status file ${statusFilePath} not found`);
|
|
22
|
+
}
|
|
23
|
+
const bucket = (0, unisphere_utils_1.getBucketName)(options.env);
|
|
24
|
+
const isElementDeployed = yield (0, is_s3_folder_exists_1.isS3FolderExists)({
|
|
25
|
+
bucket,
|
|
26
|
+
prefix: bucketPrefix,
|
|
27
|
+
awsRegion: options.awsRegion,
|
|
28
|
+
awsArn: options.awsArn,
|
|
29
|
+
});
|
|
30
|
+
if (isElementDeployed) {
|
|
31
|
+
debug(`Element '${name}' version '${version}' is already deployed, skipping`);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
debug(`Uploading element '${name}' '${version}' to AWS S3 (from '${options.artifactsFolder}' to bucket '${bucket}' folder '${bucketPrefix}' )`);
|
|
35
|
+
if (!options.dryRun) {
|
|
36
|
+
yield (0, upload_to_aws_bucket_1.uploadToAWSBucket)({
|
|
37
|
+
sourcePath: artifactsPath,
|
|
38
|
+
bucket,
|
|
39
|
+
prefix: bucketPrefix,
|
|
40
|
+
region: options.awsRegion,
|
|
41
|
+
arn: options.awsArn,
|
|
42
|
+
});
|
|
43
|
+
debug(`Uploaded element '${name}' version '${version}' to AWS S3`);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
debug('Dry run mode, skipping upload');
|
|
47
|
+
debug(`await uploadToAWSBucket({
|
|
48
|
+
sourcePath: ${artifactsPath},
|
|
49
|
+
bucket: ${bucket},
|
|
50
|
+
prefix: ${bucketPrefix},
|
|
51
|
+
region: ${options.awsRegion},
|
|
52
|
+
arn: ${options.awsArn},
|
|
53
|
+
});`);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
exports.syncElement = syncElement;
|
|
58
|
+
//# sourceMappingURL=sync-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-element.js","sourceRoot":"","sources":["../../../../../../../../../packages/unisphere-cli/src/lib/commands/context/publish/execute/sync-element.ts"],"names":[],"mappings":";;;;AAAA,uEAG2C;AAC3C,uCAAsC;AACtC,qFAA+E;AAC/E,iCAA0B;AAC1B,mFAA6E;AAE7E,2DAAuE;AACvE,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,mCAAmC,CAAC,CAAC;AAEzD,0BAA0B;AAC1B,SAAsB,WAAW,CAAC,EAChC,IAAI,EACJ,YAAY,EACZ,aAAa,EACb,OAAO,EACP,OAAO,GAOR;;QACC,KAAK,CAAC,oBAAoB,IAAI,cAAc,OAAO,GAAG,CAAC,CAAC;QAExD,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,GAAG,MAAM,IAAA,oCAAwB,EACtE,OAAO,CAAC,eAAe,EACvB,aAAa,CACd,CAAC;QAEF,IAAI,CAAC,CAAC,MAAM,IAAA,qBAAU,EAAC,aAAa,CAAC,CAAC,EAAE;YACtC,MAAM,IAAI,KAAK,CACb,uCAAuC,aAAa,YAAY,CACjE,CAAC;SACH;QAED,IAAI,CAAC,CAAC,MAAM,IAAA,qBAAU,EAAC,cAAc,CAAC,CAAC,EAAE;YACvC,MAAM,IAAI,KAAK,CACb,oCAAoC,cAAc,YAAY,CAC/D,CAAC;SACH;QAED,MAAM,MAAM,GAAG,IAAA,+BAAa,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAE1C,MAAM,iBAAiB,GAAG,MAAM,IAAA,sCAAgB,EAAC;YAC/C,MAAM;YACN,MAAM,EAAE,YAAY;YACpB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAC;QAEH,IAAI,iBAAiB,EAAE;YACrB,KAAK,CACH,YAAY,IAAI,cAAc,OAAO,iCAAiC,CACvE,CAAC;YACF,OAAO;SACR;QAED,KAAK,CACH,sBAAsB,IAAI,MAAM,OAAO,sBAAsB,OAAO,CAAC,eAAe,gBAAgB,MAAM,aAAa,YAAY,KAAK,CACzI,CAAC;QACF,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YACnB,MAAM,IAAA,wCAAiB,EAAC;gBACtB,UAAU,EAAE,aAAa;gBACzB,MAAM;gBACN,MAAM,EAAE,YAAY;gBACpB,MAAM,EAAE,OAAO,CAAC,SAAS;gBACzB,GAAG,EAAE,OAAO,CAAC,MAAM;aACpB,CAAC,CAAC;YACH,KAAK,CAAC,qBAAqB,IAAI,cAAc,OAAO,aAAa,CAAC,CAAC;SACpE;aAAM;YACL,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACvC,KAAK,CAAC;oBACU,aAAa;gBACjB,MAAM;gBACN,YAAY;gBACZ,OAAO,CAAC,SAAS;aACpB,OAAO,CAAC,MAAM;QACnB,CAAC,CAAC;SACP;IACH,CAAC;CAAA;AAtED,kCAsEC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Listr, ListrTaskWrapper } from 'listr2';
|
|
2
|
+
export declare function createListrForBuildingNxRuntimes({ cwd, artifactsRootFolder, nxProjectName, version, context, element, distFolder, parentTask, }: {
|
|
3
|
+
element: string;
|
|
4
|
+
context: string;
|
|
5
|
+
nxProjectName: string;
|
|
6
|
+
cwd: string;
|
|
7
|
+
version: string;
|
|
8
|
+
distFolder: string;
|
|
9
|
+
artifactsRootFolder: string;
|
|
10
|
+
parentTask: ListrTaskWrapper<any, any, any>;
|
|
11
|
+
}): Promise<Listr<any, any, any>>;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createListrForBuildingNxRuntimes = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const fs_extra_1 = require("fs-extra");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
const debug_1 = require("debug");
|
|
8
|
+
const artifacts_1 = require("../../../../utils/artifacts");
|
|
9
|
+
const defaults_1 = require("../../../../utils/listr2/defaults");
|
|
10
|
+
const build_unisphere_elements_1 = require("../../../../utils/unisphere/build-unisphere-elements");
|
|
11
|
+
const debug = (0, debug_1.default)('unisphere:deploy:contexts:prepare');
|
|
12
|
+
function checkIfFileStartsWithImport(filePath) {
|
|
13
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
const fileContent = yield (0, fs_extra_1.readFile)(filePath, 'utf-8');
|
|
15
|
+
return fileContent.trim().startsWith('import ');
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function createListrForBuildingNxRuntimes({ cwd, artifactsRootFolder, nxProjectName, version, context, element, distFolder, parentTask, }) {
|
|
19
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
debug(`Building element '${element}' context '${context}' version ${version} (nxProjectName: ${nxProjectName})`);
|
|
21
|
+
const tasks = parentTask.newListr([
|
|
22
|
+
{
|
|
23
|
+
title: 'Prepare artifacts folders',
|
|
24
|
+
task: (ctx) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const { rootPath, statusFilePath, artifactsPath } = yield (0, artifacts_1.getProjectArtifactsPaths)(artifactsRootFolder, nxProjectName);
|
|
26
|
+
ctx.rootPath = rootPath;
|
|
27
|
+
ctx.statusFilePath = statusFilePath;
|
|
28
|
+
ctx.artifactsPath = artifactsPath;
|
|
29
|
+
yield (0, fs_extra_1.emptyDir)(rootPath);
|
|
30
|
+
yield (0, fs_extra_1.ensureDir)(artifactsPath);
|
|
31
|
+
}),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
title: 'Prepare production bundle',
|
|
35
|
+
task: (ctx, task) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
return task.newListr([
|
|
37
|
+
{
|
|
38
|
+
title: `Building element '${element}' context '${context}' with production mode`,
|
|
39
|
+
task: (context, task) => {
|
|
40
|
+
return (0, build_unisphere_elements_1.createListrForBuildingUnisphereContext)({
|
|
41
|
+
cwd,
|
|
42
|
+
nxProjectName,
|
|
43
|
+
parentTask: task,
|
|
44
|
+
production: true,
|
|
45
|
+
lint: false,
|
|
46
|
+
lintFix: false,
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
title: 'Process production bundle',
|
|
52
|
+
task: (ctx) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
const productionSourceFile = path.join(distFolder, 'index.esm.js');
|
|
54
|
+
if (yield checkIfFileStartsWithImport(productionSourceFile)) {
|
|
55
|
+
throw new Error(`Element '${element}' context '${context}' version ${version} artifact contains imports and cannot be deployed`);
|
|
56
|
+
}
|
|
57
|
+
yield (0, fs_extra_1.copyFile)(productionSourceFile, path.join(ctx.artifactsPath, 'index.esm.js'));
|
|
58
|
+
}),
|
|
59
|
+
},
|
|
60
|
+
]);
|
|
61
|
+
}),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
title: 'Prepare debug bundle',
|
|
65
|
+
task: (ctx, task) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
return task.newListr([
|
|
67
|
+
{
|
|
68
|
+
title: `Building element '${element}' context '${context}' with debug mode`,
|
|
69
|
+
task: (context, task) => {
|
|
70
|
+
return (0, build_unisphere_elements_1.createListrForBuildingUnisphereContext)({
|
|
71
|
+
cwd,
|
|
72
|
+
nxProjectName,
|
|
73
|
+
parentTask: task,
|
|
74
|
+
production: false,
|
|
75
|
+
lint: false,
|
|
76
|
+
lintFix: false,
|
|
77
|
+
});
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
title: 'Process debug bundle',
|
|
82
|
+
task: (ctx) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const debugSourceFile = path.join(distFolder, 'index.dev.esm.js');
|
|
84
|
+
if (yield checkIfFileStartsWithImport(debugSourceFile)) {
|
|
85
|
+
throw new Error(`Element '${element}' context '${context}' version ${version} artifact contains imports and cannot be deployed`);
|
|
86
|
+
}
|
|
87
|
+
debug(`Copying debug bundle to ${ctx.artifactsPath} for element '${element}' context '${context}' version ${version}`);
|
|
88
|
+
yield (0, fs_extra_1.copyFile)(debugSourceFile, path.join(ctx.artifactsPath, 'index.dev.esm.js'));
|
|
89
|
+
}),
|
|
90
|
+
},
|
|
91
|
+
]);
|
|
92
|
+
}),
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
title: 'Generate metadata files',
|
|
96
|
+
task: (ctx) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
yield (0, fs_extra_1.outputFile)(ctx.statusFilePath, '');
|
|
98
|
+
yield (0, fs_extra_1.outputFile)(path.join(ctx.artifactsPath, 'info.json'), JSON.stringify({
|
|
99
|
+
element,
|
|
100
|
+
context,
|
|
101
|
+
version,
|
|
102
|
+
createdAt: new Date().toISOString(),
|
|
103
|
+
}, null, 2));
|
|
104
|
+
debug(`Element '${element}' context '${context}' version ${version} built in ${ctx.rootPath}`);
|
|
105
|
+
}),
|
|
106
|
+
},
|
|
107
|
+
], (0, defaults_1.getDefaultListrOptions)({ collapseSubtasks: true }));
|
|
108
|
+
return tasks;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
exports.createListrForBuildingNxRuntimes = createListrForBuildingNxRuntimes;
|
|
112
|
+
//# sourceMappingURL=build-nx-runtimes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-nx-runtimes.js","sourceRoot":"","sources":["../../../../../../../../../packages/unisphere-cli/src/lib/commands/context/publish/prepare/build-nx-runtimes.ts"],"names":[],"mappings":";;;;AAAA,uCAA+E;AAC/E,6BAA6B;AAC7B,iCAA0B;AAC1B,2DAAuE;AAEvE,gEAA2E;AAC3E,mGAA8G;AAE9G,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,mCAAmC,CAAC,CAAC;AAEzD,SAAe,2BAA2B,CAAC,QAAgB;;QACzD,MAAM,WAAW,GAAG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AAK,CACb,YAAY,OAAO,cAAc,OAAO,aAAa,OAAO,mDAAmD,CAChH,CAAC;iCACH;gCAED,KAAK,CACH,2BAA2B,GAAG,CAAC,aAAa,iBAAiB,OAAO,cAAc,OAAO,aAAa,OAAO,EAAE,CAChH,CAAC;gCAEF,MAAM,IAAA,mBAAQ,EACZ,eAAe,EACf,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,kBAAkB,CAAC,CACjD,CAAC;4BACJ,CAAC,CAAA;yBACF;qBACF,CAAC,CAAC;gBACL,CAAC,CAAA;aACF;YACD;gBACE,KAAK,EAAE,yBAAyB;gBAChC,IAAI,EAAE,CAAO,GAAG,EAAE,EAAE;oBAClB,MAAM,IAAA,qBAAU,EAAC,GAAG,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC;oBACzC,MAAM,IAAA,qBAAU,EACd,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,WAAW,CAAC,EACzC,IAAI,CAAC,SAAS,CACZ;wBACE,OAAO;wBACP,OAAO;wBACP,OAAO;wBACP,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;qBACpC,EACD,IAAI,EACJ,CAAC,CACF,CACF,CAAC;oBAEF,KAAK,CACH,YAAY,OAAO,cAAc,OAAO,aAAa,OAAO,aAAa,GAAG,CAAC,QAAQ,EAAE,CACxF,CAAC;gBACJ,CAAC,CAAA;aACF;SACF,EACD,IAAA,iCAAsB,EAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC,CACnD,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;CAAA;AAxJD,4EAwJC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.prepare = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const debug_1 = require("debug");
|
|
6
|
+
const listr2_1 = require("listr2");
|
|
7
|
+
const workspace_1 = require("../../../../utils/unisphere/workspace");
|
|
8
|
+
const build_nx_runtimes_1 = require("./build-nx-runtimes");
|
|
9
|
+
const defaults_1 = require("../../../../utils/listr2/defaults");
|
|
10
|
+
const debug = (0, debug_1.default)('unisphere:deploy:contexts:prepare');
|
|
11
|
+
function prepare(options) {
|
|
12
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
debug(`options: ${JSON.stringify(options)}`);
|
|
14
|
+
const unisphereWorkspace = yield (0, workspace_1.getUnisphereWorkspace)(options.cwd);
|
|
15
|
+
const unisphereElements = unisphereWorkspace.config.elements;
|
|
16
|
+
const tasks = new listr2_1.Listr([
|
|
17
|
+
{
|
|
18
|
+
title: 'Prepare workspace elements',
|
|
19
|
+
task: (ctx, task) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
return task.newListr([
|
|
21
|
+
unisphereElements.workspace
|
|
22
|
+
? {
|
|
23
|
+
title: 'Prepare workspace runtime',
|
|
24
|
+
task: (ctx, task) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
var _a;
|
|
26
|
+
if (((_a = unisphereElements.workspace) === null || _a === void 0 ? void 0 : _a.distributionChannel) ===
|
|
27
|
+
'none') {
|
|
28
|
+
task.title = `Skipping workspace runtime because it has no distribution channel`;
|
|
29
|
+
task.skip();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (options.tagsCheck &&
|
|
33
|
+
!unisphereElements.workspace.hasGithubTag) {
|
|
34
|
+
task.title = `Skipping workspace runtime as it does not have a GitHub tag`;
|
|
35
|
+
task.skip();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
return (0, build_nx_runtimes_1.createListrForBuildingNxRuntimes)({
|
|
39
|
+
parentTask: task,
|
|
40
|
+
context: '',
|
|
41
|
+
element: 'workspace',
|
|
42
|
+
nxProjectName: unisphereElements.workspace.nxProjectName,
|
|
43
|
+
artifactsRootFolder: options.artifactsRootFolder,
|
|
44
|
+
version: unisphereElements.workspace.version,
|
|
45
|
+
cwd: unisphereWorkspace.repository.repositoryRootPath,
|
|
46
|
+
distFolder: unisphereElements.workspace.distFolder,
|
|
47
|
+
});
|
|
48
|
+
}),
|
|
49
|
+
}
|
|
50
|
+
: null,
|
|
51
|
+
unisphereElements.loader
|
|
52
|
+
? {
|
|
53
|
+
title: 'Prepare loader runtime',
|
|
54
|
+
task: (ctx, task) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
var _b;
|
|
56
|
+
if (((_b = unisphereElements.loader) === null || _b === void 0 ? void 0 : _b.distributionChannel) === 'none') {
|
|
57
|
+
task.title = `Skipping loader runtime because it has no distribution channel`;
|
|
58
|
+
task.skip();
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (options.tagsCheck &&
|
|
62
|
+
!unisphereElements.loader.hasGithubTag) {
|
|
63
|
+
task.title = `Skipping loader runtime as it does not have a GitHub tag`;
|
|
64
|
+
task.skip();
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
return (0, build_nx_runtimes_1.createListrForBuildingNxRuntimes)({
|
|
68
|
+
parentTask: task,
|
|
69
|
+
context: '',
|
|
70
|
+
element: 'loader',
|
|
71
|
+
nxProjectName: unisphereElements.loader.nxProjectName,
|
|
72
|
+
distFolder: unisphereElements.loader.distFolder,
|
|
73
|
+
artifactsRootFolder: options.artifactsRootFolder,
|
|
74
|
+
version: unisphereElements.loader.version,
|
|
75
|
+
cwd: unisphereWorkspace.repository.repositoryRootPath,
|
|
76
|
+
});
|
|
77
|
+
}),
|
|
78
|
+
}
|
|
79
|
+
: null,
|
|
80
|
+
].filter(Boolean));
|
|
81
|
+
}),
|
|
82
|
+
},
|
|
83
|
+
Object.keys(unisphereElements.contexts || {}).length > 0
|
|
84
|
+
? {
|
|
85
|
+
title: 'Prepare contexts',
|
|
86
|
+
task: (ctx, task) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
const contextTasks = Object.entries(unisphereElements.contexts || []).map(([context, { hasGithubTag, version, nxProjectName, distributionChannel, distFolder, },]) => ({
|
|
88
|
+
title: `Build context: ${context}`,
|
|
89
|
+
skip: () => {
|
|
90
|
+
if (distributionChannel === 'none') {
|
|
91
|
+
debug(`Skipping context '${context}' because it has no distribution channel`);
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
if (options.tagsCheck && !hasGithubTag) {
|
|
95
|
+
debug(`Skipping context ${context} as it does not have a GitHub tag`);
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
return false;
|
|
99
|
+
},
|
|
100
|
+
task: (ctx, task) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
return (0, build_nx_runtimes_1.createListrForBuildingNxRuntimes)({
|
|
102
|
+
parentTask: task,
|
|
103
|
+
element: unisphereWorkspace.config.name,
|
|
104
|
+
context,
|
|
105
|
+
nxProjectName,
|
|
106
|
+
artifactsRootFolder: options.artifactsRootFolder,
|
|
107
|
+
version,
|
|
108
|
+
cwd: unisphereWorkspace.repository.repositoryRootPath,
|
|
109
|
+
distFolder,
|
|
110
|
+
});
|
|
111
|
+
}),
|
|
112
|
+
}));
|
|
113
|
+
return task.newListr(contextTasks);
|
|
114
|
+
}),
|
|
115
|
+
}
|
|
116
|
+
: null,
|
|
117
|
+
].filter(Boolean), (0, defaults_1.getDefaultListrOptions)());
|
|
118
|
+
yield tasks.run();
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
exports.prepare = prepare;
|
|
122
|
+
//# sourceMappingURL=prepare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../../../../../../../../packages/unisphere-cli/src/lib/commands/context/publish/prepare/prepare.ts"],"names":[],"mappings":";;;;AAAA,iCAA0B;AAC1B,mCAA+B;AAE/B,qEAA8E;AAC9E,2DAAuE;AACvE,gEAA2E;AAE3E,MAAM,KAAK,GAAG,IAAA,eA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AAC;QAEF,MAAM,KAAK,CAAC,GAAG,EAAE,CAAC;IACpB,CAAC;CAAA;AA7ID,0BA6IC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface SyncOptions {
|
|
2
|
+
cwd: string;
|
|
3
|
+
dryRun: boolean;
|
|
4
|
+
env: string;
|
|
5
|
+
awsRegion: string;
|
|
6
|
+
awsArn: string;
|
|
7
|
+
artifactsFolder: string;
|
|
8
|
+
tagsCheck: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface PrepareOptions {
|
|
11
|
+
lint: boolean;
|
|
12
|
+
cwd: string;
|
|
13
|
+
artifactsRootFolder: string;
|
|
14
|
+
tagsCheck: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../../packages/unisphere-cli/src/lib/commands/context/publish/types.ts"],"names":[],"mappings":""}
|