@contrail/cli 3.7.0-alpha.3c9e156 → 3.7.0-alpha.53f04e6
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/README.md +1 -1
- package/dist/helpers/app/app-deployer.js +4 -3
- package/dist/helpers/app/app-template-parsers.js +4 -1
- package/dist/helpers/app/app-template-parsers.spec.d.ts +1 -0
- package/dist/helpers/app/app-template-parsers.spec.js +15 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ $ npm install -g @contrail/cli
|
|
|
17
17
|
$ contrail COMMAND
|
|
18
18
|
running command...
|
|
19
19
|
$ contrail (--version)
|
|
20
|
-
@contrail/cli/3.7.0-alpha.
|
|
20
|
+
@contrail/cli/3.7.0-alpha.53f04e6 linux-x64 node-v24.22.2
|
|
21
21
|
$ contrail --help [COMMAND]
|
|
22
22
|
USAGE
|
|
23
23
|
$ contrail COMMAND
|
|
@@ -152,6 +152,9 @@ class AppDeployer {
|
|
|
152
152
|
return app;
|
|
153
153
|
}
|
|
154
154
|
async publishPrereleaseVersion(appDeclaration, existingApp) {
|
|
155
|
+
const externalLinks = appDeclaration.externalLinks
|
|
156
|
+
? app_template_parsers_1.ExternalLinkParser.validateAndGetExternalLinks(appDeclaration.externalLinks)
|
|
157
|
+
: [];
|
|
155
158
|
const appCodePackage = await createNodePackage(appDeclaration.appIdentifier, this.debug, this.dryRun);
|
|
156
159
|
if (this.dryRun) {
|
|
157
160
|
logger_1.default.info('Dry run, not creating app version');
|
|
@@ -169,9 +172,7 @@ class AppDeployer {
|
|
|
169
172
|
triggerKeyDefinitions: appDeclaration.triggers
|
|
170
173
|
? app_template_parsers_1.TriggerKeyDefinitionParser.buildTriggersArray(appDeclaration)
|
|
171
174
|
: undefined,
|
|
172
|
-
externalLinks
|
|
173
|
-
? app_template_parsers_1.ExternalLinkParser.validateAndGetExternalLinks(appDeclaration.externalLinks)
|
|
174
|
-
: [],
|
|
175
|
+
externalLinks,
|
|
175
176
|
appCodePackageId: appCodePackage.id,
|
|
176
177
|
frameworkVersion: 2,
|
|
177
178
|
nodeRuntime: appDeclaration.nodeRuntime ?? existingApp.nodeRuntime,
|
|
@@ -53,7 +53,10 @@ class ExternalLinkParser {
|
|
|
53
53
|
}
|
|
54
54
|
for (const link of externalLinks) {
|
|
55
55
|
if (!link.name || typeof link.name !== 'string') {
|
|
56
|
-
throw new Error('externalLinks must have a
|
|
56
|
+
throw new Error('externalLinks must have a name property (string)');
|
|
57
|
+
}
|
|
58
|
+
if (!link.label || typeof link.label !== 'string') {
|
|
59
|
+
throw new Error('externalLinks must have a label property (string)');
|
|
57
60
|
}
|
|
58
61
|
if (!link.link || typeof link.link !== 'string') {
|
|
59
62
|
throw new Error('externalLinks must have a link property (string)');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const app_template_parsers_1 = require("./app-template-parsers");
|
|
4
|
+
describe('ExternalLinkParser', () => {
|
|
5
|
+
const externalLink = { name: 'docs', label: 'Docs', link: 'https://example.com' };
|
|
6
|
+
it('should return the external links when each has a name, label and link', () => {
|
|
7
|
+
expect(app_template_parsers_1.ExternalLinkParser.validateAndGetExternalLinks([externalLink])).toEqual([externalLink]);
|
|
8
|
+
});
|
|
9
|
+
it('should throw if an external link has no label', () => {
|
|
10
|
+
expect(() => app_template_parsers_1.ExternalLinkParser.validateAndGetExternalLinks([{ ...externalLink, label: undefined }])).toThrow('externalLinks must have a label property (string)');
|
|
11
|
+
});
|
|
12
|
+
it('should throw if an external link has no name', () => {
|
|
13
|
+
expect(() => app_template_parsers_1.ExternalLinkParser.validateAndGetExternalLinks([{ ...externalLink, name: undefined }])).toThrow('externalLinks must have a name property (string)');
|
|
14
|
+
});
|
|
15
|
+
});
|
package/oclif.manifest.json
CHANGED