@squiz/component-cli-lib 1.2.1-alpha.68 → 1.2.1-alpha.70
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/.gitlab-ci.yml +69 -7
- package/CHANGELOG.md +16 -0
- package/lib/component-dev.js +1 -0
- package/lib/component-dev.js.map +1 -1
- package/lib/component-dev.spec.js +72 -45
- package/lib/component-dev.spec.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -87
- package/lib/index.js.map +1 -1
- package/lib/integration-tests/__components__/big-package/manifest.json +32 -0
- package/lib/integration-tests/helper.d.ts +2 -0
- package/lib/integration-tests/helper.js +12 -1
- package/lib/integration-tests/helper.js.map +1 -1
- package/lib/integration-tests/test-setup.js +1 -1
- package/lib/integration-tests/upload-and-render-component.spec.js +36 -9
- package/lib/integration-tests/upload-and-render-component.spec.js.map +1 -1
- package/lib/test.js +4 -10
- package/lib/test.js.map +1 -1
- package/lib/upload-component-folder.d.ts +1 -0
- package/lib/upload-component-folder.js +90 -0
- package/lib/upload-component-folder.js.map +1 -0
- package/package.json +8 -8
- package/src/component-dev.spec.ts +82 -42
- package/src/component-dev.ts +2 -0
- package/src/index.ts +1 -91
- package/src/integration-tests/__components__/big-package/manifest.json +33 -0
- package/src/integration-tests/__components__/big-package/render-json.js +5 -0
- package/src/integration-tests/helper.ts +10 -0
- package/src/integration-tests/test-setup.ts +1 -1
- package/src/integration-tests/upload-and-render-component.spec.ts +42 -14
- package/src/test.ts +4 -7
- package/src/upload-component-folder.ts +91 -0
- package/tsconfig.tsbuildinfo +1 -1
package/.gitlab-ci.yml
CHANGED
|
@@ -12,14 +12,35 @@
|
|
|
12
12
|
when: on_success
|
|
13
13
|
- when: never
|
|
14
14
|
|
|
15
|
+
.rules:when-other-branch:
|
|
16
|
+
rules:
|
|
17
|
+
- if: $CI_COMMIT_BRANCH != $TARGET_BRANCH_DEVELOPMENT && $CI_COMMIT_BRANCH != $TARGET_BRANCH_UAT
|
|
18
|
+
when: on_success
|
|
19
|
+
- when: never
|
|
20
|
+
|
|
21
|
+
.get-service-urls:
|
|
22
|
+
stage: smoke-test-setup
|
|
23
|
+
image:
|
|
24
|
+
name: amazon/aws-cli
|
|
25
|
+
variables:
|
|
26
|
+
GIT_LAB_CI: "true"
|
|
27
|
+
DEPLOYMENT_LABEL: $CI_COMMIT_BRANCH
|
|
28
|
+
tags:
|
|
29
|
+
- access/aws-dx-nonprod
|
|
30
|
+
script:
|
|
31
|
+
- set -e
|
|
32
|
+
- echo "COMPONENT_MANAGEMENT_SERVICE_URL=$(aws --region $AWS_REGION cloudformation describe-stacks --stack-name dx-${DEPLOYMENT_LABEL}-cmp --max-items 1 --query "Stacks[].Outputs[?contains(OutputKey,'managementServiceURL')].OutputValue" --output text)" >> service-urls.env
|
|
33
|
+
- echo "COMPONENT_RENDER_SERVICE_URL=$(aws --region $AWS_REGION cloudformation describe-stacks --stack-name dx-${DEPLOYMENT_LABEL}-cmp --max-items 1 --query "Stacks[].Outputs[?contains(OutputKey,'renderServiceURL')].OutputValue" --output text)" >> service-urls.env
|
|
34
|
+
artifacts:
|
|
35
|
+
reports:
|
|
36
|
+
dotenv: service-urls.env
|
|
37
|
+
|
|
15
38
|
.smoke-test:
|
|
16
39
|
stage: smoke-test
|
|
17
40
|
tags:
|
|
18
41
|
- access/aws-dx-nonprod
|
|
19
|
-
variables:
|
|
20
|
-
COMPONENT_MANAGEMENT_SERVICE_URL: $COMPONENT_MANAGEMENT_SERVICE_URL
|
|
21
|
-
COMPONENT_RENDER_SERVICE_URL: $COMPONENT_RENDER_SERVICE_URL
|
|
22
42
|
script:
|
|
43
|
+
- env
|
|
23
44
|
- npm i
|
|
24
45
|
- npm run bootstrap
|
|
25
46
|
- npm run clean
|
|
@@ -34,10 +55,21 @@
|
|
|
34
55
|
- runner_system_failure
|
|
35
56
|
- stuck_or_timeout_failure
|
|
36
57
|
|
|
37
|
-
|
|
58
|
+
get-branch-service-urls:
|
|
59
|
+
extends:
|
|
60
|
+
- .rules:when-other-branch
|
|
61
|
+
- .get-service-urls
|
|
62
|
+
needs:
|
|
63
|
+
- job: deploy-update-branch-render-service
|
|
64
|
+
- job: deploy-update-branch-management-service
|
|
65
|
+
environment:
|
|
66
|
+
name: non-production-development
|
|
67
|
+
url: components.dev.dx.squiz.cloud
|
|
68
|
+
|
|
69
|
+
get-development-service-urls:
|
|
38
70
|
extends:
|
|
39
71
|
- .rules:when-development
|
|
40
|
-
- .
|
|
72
|
+
- .get-service-urls
|
|
41
73
|
needs:
|
|
42
74
|
- job: deploy-update-development-render-service
|
|
43
75
|
- job: deploy-update-development-management-service
|
|
@@ -45,13 +77,43 @@ smoke-test-development:
|
|
|
45
77
|
name: non-production-development
|
|
46
78
|
url: components.dev.dx.squiz.cloud
|
|
47
79
|
|
|
48
|
-
|
|
80
|
+
get-uat-service-urls:
|
|
49
81
|
extends:
|
|
50
82
|
- .rules:when-uat
|
|
51
|
-
- .
|
|
83
|
+
- .get-service-urls
|
|
52
84
|
needs:
|
|
53
85
|
- job: deploy-update-uat-render-service
|
|
54
86
|
- job: deploy-update-uat-management-service
|
|
87
|
+
environment:
|
|
88
|
+
name: non-production-development
|
|
89
|
+
url: components.dev.dx.squiz.cloud
|
|
90
|
+
|
|
91
|
+
smoke-test-branch:
|
|
92
|
+
extends:
|
|
93
|
+
- .rules:when-other-branch
|
|
94
|
+
- .smoke-test
|
|
95
|
+
needs:
|
|
96
|
+
- job: get-branch-service-urls
|
|
97
|
+
environment:
|
|
98
|
+
name: non-production-development
|
|
99
|
+
url: components.dev.dx.squiz.cloud
|
|
100
|
+
|
|
101
|
+
smoke-test-development:
|
|
102
|
+
extends:
|
|
103
|
+
- .rules:when-development
|
|
104
|
+
- .smoke-test
|
|
105
|
+
needs:
|
|
106
|
+
- job: get-development-service-urls
|
|
107
|
+
environment:
|
|
108
|
+
name: non-production-development
|
|
109
|
+
url: components.dev.dx.squiz.cloud
|
|
110
|
+
|
|
111
|
+
smoke-test-uat:
|
|
112
|
+
extends:
|
|
113
|
+
- .rules:when-uat
|
|
114
|
+
- .smoke-test
|
|
115
|
+
needs:
|
|
116
|
+
- job: get-uat-service-urls
|
|
55
117
|
environment:
|
|
56
118
|
name: non-production-uat
|
|
57
119
|
url: components.uat.dx.squiz.cloud
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.2.1-alpha.70](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.67...v1.2.1-alpha.70) (2022-07-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @squiz/component-cli-lib
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.2.1-alpha.69](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.67...v1.2.1-alpha.69) (2022-07-19)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @squiz/component-cli-lib
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [1.2.1-alpha.68](https://gitlab.squiz.net/developer-experience/cmp/compare/v1.2.1-alpha.67...v1.2.1-alpha.68) (2022-07-05)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @squiz/component-cli-lib
|
package/lib/component-dev.js
CHANGED
|
@@ -21,6 +21,7 @@ async function startDevelopmentRender(componentPath, options) {
|
|
|
21
21
|
webserver: {
|
|
22
22
|
port: options.port,
|
|
23
23
|
rootUrl: `http://localhost:${options.port}`,
|
|
24
|
+
shouldRunMigrations: false,
|
|
24
25
|
},
|
|
25
26
|
componentRunner: {
|
|
26
27
|
// Considering the component path will be passed in from CLI
|
package/lib/component-dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-dev.js","sourceRoot":"","sources":["../src/component-dev.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA8E;AAC9E,gDAAwB;AAExB;;;;;;;;;GASG;AACI,KAAK,UAAU,sBAAsB,CAAC,aAAqB,EAAE,OAAyB;IAC3F,MAAM,IAAA,qCAAgB,EAAC;QACrB,SAAS,EAAE;YACT,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,oBAAoB,OAAO,CAAC,IAAI,EAAE;
|
|
1
|
+
{"version":3,"file":"component-dev.js","sourceRoot":"","sources":["../src/component-dev.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA8E;AAC9E,gDAAwB;AAExB;;;;;;;;;GASG;AACI,KAAK,UAAU,sBAAsB,CAAC,aAAqB,EAAE,OAAyB;IAC3F,MAAM,IAAA,qCAAgB,EAAC;QACrB,SAAS,EAAE;YACT,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,oBAAoB,OAAO,CAAC,IAAI,EAAE;YAC3C,mBAAmB,EAAE,KAAK;SAC3B;QACD,eAAe,EAAE;YACf,4DAA4D;YAC5D,0DAA0D;YAC1D,cAAc,EAAE,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,CAAC;YAC1D,WAAW,EAAE,IAAI;YAEjB,aAAa,EAAE,KAAM;SACtB;KACF,CAAC,CAAC;IAEH,OAAO,GAAG,EAAE,CAAC,IAAA,oCAAe,GAAE,CAAC;AACjC,CAAC;AAlBD,wDAkBC"}
|
|
@@ -4,55 +4,82 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const path_1 = __importDefault(require("path"));
|
|
7
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
7
8
|
const render_runtime_lib_1 = require("@squiz/render-runtime-lib");
|
|
8
9
|
const component_dev_1 = require("./component-dev");
|
|
10
|
+
const supertest_1 = __importDefault(require("supertest"));
|
|
9
11
|
jest.setTimeout(20000);
|
|
10
12
|
describe('component-dev', () => {
|
|
11
|
-
describe('folder
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
13
|
+
describe('production style folder structure', () => {
|
|
14
|
+
let doStopStack;
|
|
15
|
+
beforeAll(async () => {
|
|
16
|
+
doStopStack = await (0, component_dev_1.startDevelopmentRender)(path_1.default.join(__dirname, '../../../test-components'), { port: 0 });
|
|
17
|
+
});
|
|
18
|
+
afterAll(async () => {
|
|
19
|
+
await doStopStack();
|
|
20
|
+
});
|
|
21
|
+
it('should find the component', async () => {
|
|
22
|
+
const testServer = render_runtime_lib_1.TestHelpers.getTestServer();
|
|
23
|
+
const response = await testServer.get(`/r/set/test-component/1.0.0?something=hello`);
|
|
24
|
+
expect(response.text).toEqual('<h1>hello</h1>');
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
describe('local developer style folders', () => {
|
|
28
|
+
let doStopStack;
|
|
29
|
+
let version;
|
|
30
|
+
let componentName;
|
|
31
|
+
let fixtureDirectory;
|
|
32
|
+
beforeAll(async () => {
|
|
33
|
+
const { fixtureDirectory: ceratedFixtureDirectory, version: createdVersion, componentName: createdName, } = await render_runtime_lib_1.TestHelpers.ComponentFixture.setupFullComponentDirectory('<h1>Hello World</h1>');
|
|
34
|
+
version = createdVersion;
|
|
35
|
+
fixtureDirectory = ceratedFixtureDirectory;
|
|
36
|
+
componentName = createdName;
|
|
37
|
+
doStopStack = await (0, component_dev_1.startDevelopmentRender)(fixtureDirectory, { port: 0 });
|
|
38
|
+
});
|
|
39
|
+
afterAll(async () => {
|
|
40
|
+
await doStopStack();
|
|
41
|
+
await promises_1.default.rm(path_1.default.join(fixtureDirectory, componentName), { force: true, recursive: true });
|
|
42
|
+
});
|
|
43
|
+
it('should handle recursing folders to find the component', async () => {
|
|
44
|
+
const testServer = render_runtime_lib_1.TestHelpers.getTestServer();
|
|
45
|
+
const response = await testServer.get(`/r/set/${componentName}/${version}/`);
|
|
46
|
+
expect(response.text).toEqual('<h1>Hello World</h1>');
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
describe('accessing local dev routes', () => {
|
|
50
|
+
let stopServer;
|
|
51
|
+
const port = 3006;
|
|
52
|
+
const url = `http://localhost:${port}`;
|
|
53
|
+
const request = (0, supertest_1.default)(url);
|
|
54
|
+
beforeAll(async () => {
|
|
55
|
+
const compDir = path_1.default.join(__dirname, '../', '../../test-components');
|
|
56
|
+
stopServer = await (0, component_dev_1.startDevelopmentRender)(compDir, {
|
|
57
|
+
port: port,
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
afterAll(async () => {
|
|
61
|
+
await stopServer();
|
|
62
|
+
});
|
|
63
|
+
describe('definition routes', () => {
|
|
64
|
+
render_runtime_lib_1.routeTests.definition(url, url);
|
|
65
|
+
});
|
|
66
|
+
describe('static routes', () => {
|
|
67
|
+
render_runtime_lib_1.routeTests.static(url);
|
|
68
|
+
});
|
|
69
|
+
describe('render routes', () => {
|
|
70
|
+
render_runtime_lib_1.routeTests.render(url, url);
|
|
71
|
+
});
|
|
72
|
+
describe('GET /r/set/test-component/1.0.1', () => {
|
|
73
|
+
//
|
|
74
|
+
// this scenario is different to the 'production' tests
|
|
75
|
+
// this is should 500 in prod and 404 locally
|
|
76
|
+
it('should fail validation if trying to render a component with an invalid schema', async () => {
|
|
77
|
+
const response = await request.get('/r/set/test-component/1.0.1?something=not-used');
|
|
78
|
+
expect(response.statusCode).toEqual(404);
|
|
79
|
+
expect(response.body).toEqual({
|
|
80
|
+
message: 'manifest could not be found',
|
|
81
|
+
});
|
|
82
|
+
});
|
|
56
83
|
});
|
|
57
84
|
});
|
|
58
85
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-dev.spec.js","sourceRoot":"","sources":["../src/component-dev.spec.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;
|
|
1
|
+
{"version":3,"file":"component-dev.spec.js","sourceRoot":"","sources":["../src/component-dev.spec.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,2DAA8B;AAE9B,kEAAoE;AACpE,mDAAyD;AACzD,0DAAkC;AAElC,IAAI,CAAC,UAAU,CAAC,KAAM,CAAC,CAAC;AAExB,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,mCAAmC,EAAE,GAAG,EAAE;QACjD,IAAI,WAA+D,CAAC;QAEpE,SAAS,CAAC,KAAK,IAAI,EAAE;YACnB,WAAW,GAAG,MAAM,IAAA,sCAAsB,EAAC,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,0BAA0B,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QAC5G,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,KAAK,IAAI,EAAE;YAClB,MAAM,WAAW,EAAE,CAAC;QACtB,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2BAA2B,EAAE,KAAK,IAAI,EAAE;YACzC,MAAM,UAAU,GAAG,gCAAW,CAAC,aAAa,EAAE,CAAC;YAC/C,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC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,CAAC,gDAAgD,CAAC,CAAC;gBAErF,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBACzC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;oBAC5B,OAAO,EAAE,6BAA6B;iBACvC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,92 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
10
|
-
const path_1 = __importDefault(require("path"));
|
|
11
|
-
const axios_1 = __importDefault(require("axios"));
|
|
12
|
-
const cli_color_1 = __importDefault(require("cli-color"));
|
|
3
|
+
exports.startDevelopmentRender = exports.uploadComponentFolder = void 0;
|
|
4
|
+
var upload_component_folder_1 = require("./upload-component-folder");
|
|
5
|
+
Object.defineProperty(exports, "uploadComponentFolder", { enumerable: true, get: function () { return upload_component_folder_1.uploadComponentFolder; } });
|
|
13
6
|
var component_dev_1 = require("./component-dev");
|
|
14
7
|
Object.defineProperty(exports, "startDevelopmentRender", { enumerable: true, get: function () { return component_dev_1.startDevelopmentRender; } });
|
|
15
|
-
async function uploadComponentFolder(folderPath, componentServiceManagementUrl) {
|
|
16
|
-
const tmpDir = path_1.default.resolve(await promises_1.default.mkdtemp('cmp-upload'));
|
|
17
|
-
try {
|
|
18
|
-
const axiosInstance = axios_1.default.create({
|
|
19
|
-
baseURL: componentServiceManagementUrl,
|
|
20
|
-
});
|
|
21
|
-
console.log('Initial scanning');
|
|
22
|
-
const zip = await (0, component_lib_1.zipDirectory)(folderPath, tmpDir);
|
|
23
|
-
const initialUpload = await handleResponse(axiosInstance.post('upload-component'));
|
|
24
|
-
console.log(`deployment id: ${initialUpload.id} status: transferring`);
|
|
25
|
-
await (0, virus_scanner_lib_1.uploadFile)(initialUpload, zip);
|
|
26
|
-
await watchAndWaitForUploadAndScanComplete(initialUpload.id, axiosInstance);
|
|
27
|
-
console.log(`deployment id: ${initialUpload.id} status: deploying component folder`);
|
|
28
|
-
const result = await handleResponse(axiosInstance.post(`upload-component/next/${initialUpload.id}`));
|
|
29
|
-
await promises_1.default.rm(tmpDir, { force: true, recursive: true });
|
|
30
|
-
if (result.status === 'successful') {
|
|
31
|
-
console.log(`deployment id: ${initialUpload.id} status: ${cli_color_1.default.green('success')}`);
|
|
32
|
-
console.log(`uploaded location: ${result.accessLink}`);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
console.error('failed for an unknown reason', cli_color_1.default.red(result));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
catch (e) {
|
|
39
|
-
await promises_1.default.rm(tmpDir, { force: true, recursive: true });
|
|
40
|
-
if (e instanceof Error) {
|
|
41
|
-
console.error(cli_color_1.default.red(e.message));
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
throw e;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.uploadComponentFolder = uploadComponentFolder;
|
|
49
|
-
async function watchAndWaitForUploadAndScanComplete(id, axiosInstance) {
|
|
50
|
-
const poll = () => handleResponse(axiosInstance.get('upload-component/status/' + id));
|
|
51
|
-
return new Promise((resolve, reject) => {
|
|
52
|
-
const recurse = () => poll().then(async (req) => {
|
|
53
|
-
if (req.status == 'Success') {
|
|
54
|
-
resolve();
|
|
55
|
-
}
|
|
56
|
-
else if (req.status == 'Flagged') {
|
|
57
|
-
reject(new Error('upload has been flagged as a virus'));
|
|
58
|
-
}
|
|
59
|
-
else if (req.status == 'Error') {
|
|
60
|
-
reject(new Error('there has been an error'));
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
setTimeout(async () => {
|
|
64
|
-
await recurse();
|
|
65
|
-
}, 1000);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
recurse();
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
async function handleResponse(axiosInstance) {
|
|
72
|
-
const result = axiosInstance
|
|
73
|
-
.then((response) => response.data)
|
|
74
|
-
.catch((error) => {
|
|
75
|
-
throw handleAxiosError(error);
|
|
76
|
-
});
|
|
77
|
-
return result;
|
|
78
|
-
}
|
|
79
|
-
function handleAxiosError(error) {
|
|
80
|
-
const { response } = error;
|
|
81
|
-
if (!response || (typeof error == 'object' && !error.isAxiosError)) {
|
|
82
|
-
return error;
|
|
83
|
-
}
|
|
84
|
-
const message = response.data.message;
|
|
85
|
-
if (message) {
|
|
86
|
-
return new Error(`Unexpected response code ${response.status}. message: ${message}`);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
return new Error(`Unexpected response code ${response.status}.`);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
8
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA;AAC9B,iDAAyD;AAAhD,uHAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://localhost:3000/schemas/v1.json#",
|
|
3
|
+
"name": "big-package",
|
|
4
|
+
"version": "1.0.2",
|
|
5
|
+
"main-function": "render-json",
|
|
6
|
+
"functions": [
|
|
7
|
+
{
|
|
8
|
+
"name": "render-json",
|
|
9
|
+
"entry": "render-json.js",
|
|
10
|
+
"input": {
|
|
11
|
+
"type": "object",
|
|
12
|
+
"properties": {
|
|
13
|
+
"something": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": ["something"]
|
|
18
|
+
},
|
|
19
|
+
"output": {
|
|
20
|
+
"response-type": "json",
|
|
21
|
+
"definition": {
|
|
22
|
+
"properties": {
|
|
23
|
+
"my-prop": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"required": ["my-prop"]
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export declare const managementService: import("axios").AxiosInstance;
|
|
2
2
|
export declare const renderService: import("axios").AxiosInstance;
|
|
3
3
|
export declare function getTestComponents(): string[];
|
|
4
|
+
export declare function createFile(filePath: string, sizeInMB: number): Promise<void>;
|
|
5
|
+
export declare function removeFile(filePath: string): void;
|
|
@@ -3,11 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getTestComponents = exports.renderService = exports.managementService = void 0;
|
|
6
|
+
exports.removeFile = exports.createFile = exports.getTestComponents = exports.renderService = exports.managementService = void 0;
|
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const config_1 = __importDefault(require("../config"));
|
|
11
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
12
|
+
const crypto_1 = require("crypto");
|
|
11
13
|
exports.managementService = axios_1.default.create({
|
|
12
14
|
baseURL: config_1.default.managementServiceUrl,
|
|
13
15
|
});
|
|
@@ -27,4 +29,13 @@ function getTestComponents() {
|
|
|
27
29
|
return componets;
|
|
28
30
|
}
|
|
29
31
|
exports.getTestComponents = getTestComponents;
|
|
32
|
+
async function createFile(filePath, sizeInMB) {
|
|
33
|
+
const content = (0, crypto_1.randomBytes)(sizeInMB * 1000000);
|
|
34
|
+
await promises_1.default.writeFile(`${filePath}`, content);
|
|
35
|
+
}
|
|
36
|
+
exports.createFile = createFile;
|
|
37
|
+
function removeFile(filePath) {
|
|
38
|
+
promises_1.default.unlink(filePath);
|
|
39
|
+
}
|
|
40
|
+
exports.removeFile = removeFile;
|
|
30
41
|
//# sourceMappingURL=helper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../src/integration-tests/helper.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAAoB;AACpB,gDAAwB;AACxB,uDAAmC;
|
|
1
|
+
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../src/integration-tests/helper.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAAoB;AACpB,gDAAwB;AACxB,uDAAmC;AACnC,2DAA8B;AAC9B,mCAAqC;AAExB,QAAA,iBAAiB,GAAG,eAAK,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,gBAAU,CAAC,oBAAoB;CACzC,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,eAAK,CAAC,MAAM,CAAC;IACxC,OAAO,EAAE,gBAAU,CAAC,gBAAgB;CACrC,CAAC,CAAC;AAEH,SAAgB,iBAAiB;IAC/B,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,MAAM,aAAa,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;IAC/D,MAAM,KAAK,GAAG,YAAE,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;IAC5C,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACxB,MAAM,IAAI,GAAG,YAAE,CAAC,QAAQ,CAAC,cAAI,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC;QACzD,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,MAAM,EAAE;YACzD,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACtB;KACF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAXD,8CAWC;AACM,KAAK,UAAU,UAAU,CAAC,QAAgB,EAAE,QAAgB;IACjE,MAAM,OAAO,GAAG,IAAA,oBAAW,EAAC,QAAQ,GAAG,OAAO,CAAC,CAAC;IAChD,MAAM,kBAAG,CAAC,SAAS,CAAC,GAAG,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAHD,gCAGC;AAED,SAAgB,UAAU,CAAC,QAAgB;IACzC,kBAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACvB,CAAC;AAFD,gCAEC"}
|
|
@@ -15,10 +15,15 @@ const orgConsoleError = console.error;
|
|
|
15
15
|
afterAll(async () => {
|
|
16
16
|
// clean up the component added by the test
|
|
17
17
|
(0, helper_1.getTestComponents)().forEach(async (componentName) => {
|
|
18
|
-
|
|
18
|
+
try {
|
|
19
|
+
await helper_1.managementService.delete(`/component/${componentName}`);
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
// no op
|
|
23
|
+
}
|
|
19
24
|
});
|
|
20
25
|
});
|
|
21
|
-
describe('
|
|
26
|
+
describe('Test isolated test cases', () => {
|
|
22
27
|
beforeEach(() => {
|
|
23
28
|
console.error = mockConsoleError;
|
|
24
29
|
console.log = mockConsoleLog;
|
|
@@ -26,25 +31,47 @@ describe('Deploy basic component having a static file', () => {
|
|
|
26
31
|
afterEach(() => {
|
|
27
32
|
console.error = orgConsoleError;
|
|
28
33
|
});
|
|
34
|
+
it('Should fail uploading the component that has size more than 100MB', async () => {
|
|
35
|
+
const componentPath = path_1.default.join(__dirname, '/__components__/big-package');
|
|
36
|
+
const filePath = `${componentPath}/105mb-file`;
|
|
37
|
+
await (0, helper_1.createFile)(filePath, 105); // Higher limit has been used because compression reduces the size if you use closer to 100MB
|
|
38
|
+
await (0, index_1.uploadComponentFolder)(componentPath, config_1.default.managementServiceUrl);
|
|
39
|
+
expect(mockConsoleError.mock.calls[0][0]).toEqual(cli_color_1.default.red(['Request body larger than maxBodyLength limit'].join('')));
|
|
40
|
+
(0, helper_1.removeFile)(filePath);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
describe('Deploy basic component having a static file', () => {
|
|
29
44
|
// component to deploy for this test
|
|
30
45
|
const componentPath = path_1.default.join(__dirname, '/__components__/cmp-static-file-test');
|
|
31
|
-
|
|
46
|
+
beforeAll(async () => {
|
|
47
|
+
try {
|
|
48
|
+
await helper_1.managementService.delete(`/component/cmp-static-file-test`);
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
// no op
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
beforeEach(() => {
|
|
55
|
+
console.error = mockConsoleError;
|
|
56
|
+
console.log = mockConsoleLog;
|
|
57
|
+
});
|
|
58
|
+
afterEach(() => {
|
|
59
|
+
console.error = orgConsoleError;
|
|
60
|
+
});
|
|
32
61
|
it('Should upload the component and return a valid url to preview', async () => {
|
|
33
62
|
var _a, _b;
|
|
34
63
|
mockConsoleLog.mockClear();
|
|
35
64
|
await (0, index_1.uploadComponentFolder)(componentPath, config_1.default.managementServiceUrl);
|
|
36
|
-
url = ((_a = /uploaded location: (.*)/.exec(mockConsoleLog.mock.lastCall)) === null || _a === void 0 ? void 0 : _a[1]) || '';
|
|
65
|
+
const url = ((_a = /uploaded location: (.*)/.exec(mockConsoleLog.mock.lastCall)) === null || _a === void 0 ? void 0 : _a[1]) || '';
|
|
37
66
|
const uploadedComponent = '<a href="/r/set/cmp-static-file-test/1.0.0">1.0.0</a>';
|
|
38
|
-
const get = await (0, supertest_1.default)(url).get('');
|
|
67
|
+
const get = await (0, supertest_1.default)(url).get('/');
|
|
39
68
|
expect(get.status).toEqual(200);
|
|
40
69
|
expect((_b = get === null || get === void 0 ? void 0 : get.res) === null || _b === void 0 ? void 0 : _b.text).toContain(uploadedComponent);
|
|
41
70
|
});
|
|
42
71
|
it('Should fail upload the component with same version', async () => {
|
|
72
|
+
mockConsoleError.mockClear();
|
|
43
73
|
await (0, index_1.uploadComponentFolder)(componentPath, config_1.default.managementServiceUrl);
|
|
44
|
-
expect(mockConsoleError.mock.calls[0][0]).toEqual(cli_color_1.default.red(
|
|
45
|
-
'Unexpected response code 400. message: ',
|
|
46
|
-
'cmp-static-file-test version 1.0.0 already exists and cannot be uploaded',
|
|
47
|
-
].join('')));
|
|
74
|
+
expect(mockConsoleError.mock.calls[0][0]).toEqual(cli_color_1.default.red('Unexpected response code 400. message: Component cmp-static-file-test 1.0.0 already exists'));
|
|
48
75
|
});
|
|
49
76
|
it('Should render component', async () => {
|
|
50
77
|
const response = await helper_1.renderService.get('/r/set/cmp-static-file-test/1.0.0/?something=hello');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload-and-render-component.spec.js","sourceRoot":"","sources":["../../src/integration-tests/upload-and-render-component.spec.ts"],"names":[],"mappings":";;;;;AAAA,oCAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"upload-and-render-component.spec.js","sourceRoot":"","sources":["../../src/integration-tests/upload-and-render-component.spec.ts"],"names":[],"mappings":";;;;;AAAA,oCAAiD;AACjD,qCAAuG;AACvG,uDAAmC;AACnC,0DAA8B;AAC9B,gDAAwB;AACxB,0DAAkC;AAElC,MAAM,gBAAgB,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AACnC,MAAM,cAAc,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC;AAEjC,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC;AAEtC,QAAQ,CAAC,KAAK,IA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AC,SAAS,EAAE,CAAC;QAC7B,MAAM,IAAA,6BAAqB,EAAC,aAAa,EAAE,gBAAU,CAAC,oBAAoB,CAAC,CAAC;QAC5E,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAC/C,mBAAK,CAAC,GAAG,CAAC,4FAA4F,CAAC,CACxG,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACvC,MAAM,QAAQ,GAAG,MAAM,sBAAa,CAAC,GAAG,CAAC,oDAAoD,CAAC,CAAC;QAC/F,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACrC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAC3B;YACE,yBAAyB;YACzB,kCAAkC;YAClC,GAAG,gBAAU,CAAC,gBAAgB,uDAAuD;SACtF,CAAC,IAAI,CAAC,EAAE,CAAC,CACX,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/lib/test.js
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11
|
-
const componentManagementURL = config_1.default.managementServiceUrl || process.argv[3];
|
|
12
|
-
(0, _1.uploadComponentFolder)(dir, componentManagementURL);
|
|
3
|
+
const component_dev_1 = require("./component-dev");
|
|
4
|
+
(0, component_dev_1.startDevelopmentRender)('/Users/wfagerstrom/Code/component-service/test-components', { port: 3000 }).then(() => {
|
|
5
|
+
console.log('starting');
|
|
6
|
+
});
|
|
13
7
|
//# sourceMappingURL=test.js.map
|
package/lib/test.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":";;AAAA,mDAAyD;AAEzD,IAAA,sCAAsB,EAAC,2DAA2D,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE;IAC5G,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAC1B,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function uploadComponentFolder(folderPath: string, componentServiceManagementUrl: string): Promise<void>;
|