@squiz/component-cli-lib 1.2.13-alpha.2 → 1.2.13-alpha.4
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 +17 -0
- package/build.js +23 -0
- package/lib/index.js +247 -8
- package/lib/index.js.map +7 -1
- package/lib/integration-tests/helper.d.ts +1 -1
- package/package.json +12 -10
- package/src/component-dev.ts +6 -1
- package/src/integration-tests/__components__/cmp-format-string/manifest.json +1 -1
- package/src/integration-tests/helper.ts +17 -12
- package/src/integration-tests/upload-and-render-component.integration.spec.ts +38 -24
- package/tsconfig.json +4 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/component-dev-folder-structures.integration.spec.js +0 -73
- package/lib/component-dev-folder-structures.integration.spec.js.map +0 -1
- package/lib/component-dev.integration.spec.js +0 -57
- package/lib/component-dev.integration.spec.js.map +0 -1
- package/lib/component-dev.js +0 -60
- package/lib/component-dev.js.map +0 -1
- package/lib/integration-tests/__components__/big-package/manifest.json +0 -35
- package/lib/integration-tests/__components__/cmp-format-string/manifest.json +0 -40
- package/lib/integration-tests/__components__/cmp-static-file-test/manifest.json +0 -39
- package/lib/integration-tests/__components__/invalid-manifest/manifest.json +0 -27
- package/lib/integration-tests/helper.js +0 -141
- package/lib/integration-tests/helper.js.map +0 -1
- package/lib/integration-tests/service-deployment.integration.spec.js +0 -51
- package/lib/integration-tests/service-deployment.integration.spec.js.map +0 -1
- package/lib/integration-tests/test-setup.js +0 -3
- package/lib/integration-tests/test-setup.js.map +0 -1
- package/lib/integration-tests/upload-and-render-component.integration.spec.js +0 -237
- package/lib/integration-tests/upload-and-render-component.integration.spec.js.map +0 -1
- package/lib/upload-component-folder.js +0 -117
- package/lib/upload-component-folder.js.map +0 -1
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const supertest_1 = __importDefault(require("supertest"));
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
9
|
-
const render_runtime_lib_1 = require("@squiz/render-runtime-lib");
|
|
10
|
-
const component_dev_1 = require("./component-dev");
|
|
11
|
-
jest.setTimeout(20000);
|
|
12
|
-
describe('component-dev', () => {
|
|
13
|
-
describe('production style folder structure', () => {
|
|
14
|
-
let server;
|
|
15
|
-
let request;
|
|
16
|
-
beforeAll(async () => {
|
|
17
|
-
server = (0, component_dev_1.startDevelopmentRender)(render_runtime_lib_1.TestHelpers.getTestComponentFolder(), { port: 0, noBrowser: true });
|
|
18
|
-
request = (0, supertest_1.default)(server);
|
|
19
|
-
});
|
|
20
|
-
afterAll(async () => {
|
|
21
|
-
server.close();
|
|
22
|
-
});
|
|
23
|
-
it('should find the component', async () => {
|
|
24
|
-
const response = await request.get(`/r/unit-test-components/test-component/1.0.0?_componentSet=set&something=hello`);
|
|
25
|
-
expect(response.text).toEqual('<div>hello - {"_componentSet":"set","something":"hello"}</div>');
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
describe('local developer style folders', () => {
|
|
29
|
-
let version;
|
|
30
|
-
let componentName;
|
|
31
|
-
let fixtureDirectory;
|
|
32
|
-
let server;
|
|
33
|
-
let request;
|
|
34
|
-
beforeAll(async () => {
|
|
35
|
-
const { fixtureDirectory: createdFixtureDirectory, version: createdVersion, componentName: createdName, } = await render_runtime_lib_1.TestHelpers.ComponentFixture.setupFullComponentDirectory('<h1>Hello World</h1>');
|
|
36
|
-
version = createdVersion;
|
|
37
|
-
fixtureDirectory = createdFixtureDirectory;
|
|
38
|
-
componentName = createdName;
|
|
39
|
-
server = (0, component_dev_1.startDevelopmentRender)(fixtureDirectory, { port: 0, noBrowser: true });
|
|
40
|
-
request = (0, supertest_1.default)(server);
|
|
41
|
-
});
|
|
42
|
-
afterAll(async () => {
|
|
43
|
-
server.close();
|
|
44
|
-
});
|
|
45
|
-
afterAll(async () => {
|
|
46
|
-
await promises_1.default.rm(path_1.default.join(fixtureDirectory, componentName), { force: true, recursive: true });
|
|
47
|
-
});
|
|
48
|
-
it('should handle recursing folders to find the component', async () => {
|
|
49
|
-
const response = await request.get(`/r/some-namespace/${componentName}/${version}?_componentSet=set`);
|
|
50
|
-
expect(response.text).toEqual('<h1>Hello World</h1>');
|
|
51
|
-
}, 30000);
|
|
52
|
-
it('should handle serving static files from single component directory', async () => {
|
|
53
|
-
const response = await request.get(`/s/some-namespace/${componentName}/${version}/static.txt?_componentSet=set-x`);
|
|
54
|
-
expect(response.text).toEqual('hello');
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
describe('It should pass a simple test and not launch the browser if the -nb flag is present', () => {
|
|
58
|
-
let server;
|
|
59
|
-
let request;
|
|
60
|
-
beforeAll(async () => {
|
|
61
|
-
server = (0, component_dev_1.startDevelopmentRender)(render_runtime_lib_1.TestHelpers.getTestComponentFolder(), { port: 0, noBrowser: true });
|
|
62
|
-
request = (0, supertest_1.default)(server);
|
|
63
|
-
});
|
|
64
|
-
afterAll(async () => {
|
|
65
|
-
server.close();
|
|
66
|
-
});
|
|
67
|
-
it('should find the component', async () => {
|
|
68
|
-
const response = await request.get(`/r/unit-test-components/test-component/1.0.0?_componentSet=set&something=hello`);
|
|
69
|
-
expect(response.text).toEqual('<div>hello - {"_componentSet":"set","something":"hello"}</div>');
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=component-dev-folder-structures.integration.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-dev-folder-structures.integration.spec.js","sourceRoot":"","sources":["../src/component-dev-folder-structures.integration.spec.ts"],"names":[],"mappings":";;;;;AAAA,0DAAkC;AAClC,gDAAwB;AACxB,2DAA8B;AAE9B,kEAAwD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AS,CAAC,KAAK,IAAI,EAAE;YACnB,MAAM,GAAG,IAAA,sCAAsB,EAAC,gCAAW,CAAC,sBAAsB,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACpG,OAAO,GAAG,IAAA,mBAAS,EAAC,MAAM,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,KAAK,IAAI,EAAE;YAClB,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,2BAA2B,EAAE,KAAK,IAAI,EAAE;YACzC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,gFAAgF,CACjF,CAAC;YACF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,gEAAgE,CAAC,CAAC;QAClG,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const render_runtime_lib_1 = require("@squiz/render-runtime-lib");
|
|
7
|
-
const component_dev_1 = require("./component-dev");
|
|
8
|
-
const supertest_1 = __importDefault(require("supertest"));
|
|
9
|
-
jest.setTimeout(20000);
|
|
10
|
-
describe('component-dev', () => {
|
|
11
|
-
describe('accessing local dev routes', () => {
|
|
12
|
-
let server;
|
|
13
|
-
let request;
|
|
14
|
-
beforeAll(async () => {
|
|
15
|
-
server = (0, component_dev_1.startDevelopmentRender)(render_runtime_lib_1.TestHelpers.getTestComponentFolder(), { port: 0, noBrowser: true });
|
|
16
|
-
request = (0, supertest_1.default)(server);
|
|
17
|
-
});
|
|
18
|
-
afterAll(async () => {
|
|
19
|
-
server.close();
|
|
20
|
-
});
|
|
21
|
-
it('should fail validation when requesting a function with a missing entry file', async () => {
|
|
22
|
-
const response = await request.get('/r/unit-test-components/test-component/1.0.3/non-existent-entry-file?_componentSet=set&something=not-used');
|
|
23
|
-
expect(response.body).toEqual({
|
|
24
|
-
message: '"main\'s" entry file "missing-entry-file.js" is inaccessible',
|
|
25
|
-
});
|
|
26
|
-
expect(response.statusCode).toEqual(500);
|
|
27
|
-
});
|
|
28
|
-
describe('definition routes', () => {
|
|
29
|
-
const server = (0, component_dev_1.startDevelopmentRender)(render_runtime_lib_1.TestHelpers.getTestComponentFolder(), { port: 0, noBrowser: true });
|
|
30
|
-
const request = () => (0, supertest_1.default)(server);
|
|
31
|
-
render_runtime_lib_1.routeTests.definition(request, 'http://localhost:0');
|
|
32
|
-
afterAll(() => {
|
|
33
|
-
server.close();
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
describe('static routes', () => {
|
|
37
|
-
const server = (0, component_dev_1.startDevelopmentRender)(render_runtime_lib_1.TestHelpers.getTestComponentFolder(), { port: 0, noBrowser: true });
|
|
38
|
-
const request = () => (0, supertest_1.default)(server);
|
|
39
|
-
render_runtime_lib_1.routeTests.static(request);
|
|
40
|
-
afterAll(() => {
|
|
41
|
-
server.close();
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
describe('render routes', () => {
|
|
45
|
-
const server = (0, component_dev_1.startDevelopmentRender)(render_runtime_lib_1.TestHelpers.getTestComponentFolder(), { port: 0, noBrowser: true });
|
|
46
|
-
const request = () => (0, supertest_1.default)(server);
|
|
47
|
-
render_runtime_lib_1.routeTests.render(request, 'http://localhost:0');
|
|
48
|
-
afterAll(() => {
|
|
49
|
-
server.close();
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
describe('preview tests', () => {
|
|
53
|
-
render_runtime_lib_1.routeTests.preview(() => request, 'http://localhost:0');
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
//# sourceMappingURL=component-dev.integration.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-dev.integration.spec.js","sourceRoot":"","sources":["../src/component-dev.integration.spec.ts"],"names":[],"mappings":";;;;;AAAA,kEAAoE;AACpE,mDAAyD;AACzD,0DAAkC;AAGlC,IAAI,CAAC,UAAU,CAAC,KAAM,CAAC,CAAC;AAExB,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;QAC1C,IAAI,MAAc,CAAC;QACnB,IAAI,OAA4C,CAAC;QAEjD,SAAS,CAAC,KAAK,IAAI,EAAE;YACnB,MAAM,GAAG,IAAA,sCAAsB,EAAC,gCAAW,CAAC,sBAAsB,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACpG,OAAO,GAAG,IAAA,mBAAS,EAAC,MAAM,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,KAAK,IAAI,EAAE;YAClB,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6EAA6E,EAAE,KAAK,IAAI,EAAE;YAC3F,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,2GAA2G,CAC5G,CAAC;YAEF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC;gBAC5B,OAAO,EAAE,8DAA8D;aACxE,CAAC,CAAC;YACH,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;YACjC,MAAM,MAAM,GAAG,IAAA,sCAAsB,EAAC,gCAAW,CAAC,sBAAsB,EAAE,EAAE,EAAE,IAAI,EAAE,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AE;YAC7B,+BAAU,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/lib/component-dev.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.startDevelopmentRender = void 0;
|
|
7
|
-
const render_runtime_lib_1 = require("@squiz/render-runtime-lib");
|
|
8
|
-
const dx_logger_lib_1 = require("@squiz/dx-logger-lib");
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const component_lib_1 = require("@squiz/component-lib");
|
|
11
|
-
const open_1 = __importDefault(require("open"));
|
|
12
|
-
const dx_common_lib_1 = require("@squiz/dx-common-lib");
|
|
13
|
-
const dx_json_schema_lib_1 = require("@squiz/dx-json-schema-lib");
|
|
14
|
-
/**
|
|
15
|
-
* startDevelopmentRender starts a dev-mode render stack for any
|
|
16
|
-
* local directory. This should start an express server on a random unused port
|
|
17
|
-
* which can be accessed for viewing the component in development.
|
|
18
|
-
*
|
|
19
|
-
* @param {string} componentPath - The directory with the component to be rendered
|
|
20
|
-
* @param {object} options - Additional configuration for the dev stack
|
|
21
|
-
* @returns a function to stop the render stack
|
|
22
|
-
*/
|
|
23
|
-
function startDevelopmentRender(componentPath, options) {
|
|
24
|
-
const logger = (0, dx_logger_lib_1.getLogger)({ name: 'component-dev', format: options.loggingFormat || 'human' });
|
|
25
|
-
const dataMountPoint = path_1.default.resolve(process.cwd(), componentPath);
|
|
26
|
-
const rootUrl = `http://localhost:${options.port}`;
|
|
27
|
-
const componentRunnerService = new render_runtime_lib_1.ComponentRunnerServiceWithWorkers({
|
|
28
|
-
dataMountPoint,
|
|
29
|
-
shouldCacheResponses: false,
|
|
30
|
-
workerTimeout: 5000,
|
|
31
|
-
}, logger);
|
|
32
|
-
const jsonValidationService = new dx_json_schema_lib_1.JsonValidationService();
|
|
33
|
-
const componentFunctionService = new component_lib_1.ComponentFunctionService(rootUrl, jsonValidationService);
|
|
34
|
-
const componentSetService = new component_lib_1.ComponentSetServiceForLocalDev(logger);
|
|
35
|
-
const manifestService = new component_lib_1.ManifestServiceForDev(dataMountPoint, logger, jsonValidationService);
|
|
36
|
-
const contentItemService = undefined;
|
|
37
|
-
const renderInputService = new render_runtime_lib_1.RenderInputService(componentSetService, manifestService, componentFunctionService, contentItemService, rootUrl);
|
|
38
|
-
const webServer = (0, render_runtime_lib_1.setupRenderRuntimeServer)({
|
|
39
|
-
logger,
|
|
40
|
-
componentRunnerService,
|
|
41
|
-
componentFunctionService,
|
|
42
|
-
componentPreviewService: new render_runtime_lib_1.ComponentPreviewService(),
|
|
43
|
-
componentSetService,
|
|
44
|
-
manifestService,
|
|
45
|
-
renderInputService,
|
|
46
|
-
apiKeyService: new dx_common_lib_1.DevelopmentApiKeyService(),
|
|
47
|
-
});
|
|
48
|
-
const server = webServer.listen(options.port, () => {
|
|
49
|
-
logger.info(`Component development webserver started on port ${rootUrl}`);
|
|
50
|
-
});
|
|
51
|
-
if ((options === null || options === void 0 ? void 0 : options.noBrowser) !== true) {
|
|
52
|
-
(0, open_1.default)(rootUrl);
|
|
53
|
-
}
|
|
54
|
-
server.on('close', async () => {
|
|
55
|
-
await componentRunnerService.stop();
|
|
56
|
-
});
|
|
57
|
-
return server;
|
|
58
|
-
}
|
|
59
|
-
exports.startDevelopmentRender = startDevelopmentRender;
|
|
60
|
-
//# sourceMappingURL=component-dev.js.map
|
package/lib/component-dev.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-dev.js","sourceRoot":"","sources":["../src/component-dev.ts"],"names":[],"mappings":";;;;;;AAAA,kEAKmC;AACn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C9C,CAAC,CAAC;IAEH,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,EAAE;QACjD,MAAM,CAAC,IAAI,CAAC,mDAAmD,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,MAAK,IAAI,EAAE;QAC/B,IAAA,cAAI,EAAC,OAAO,CAAC,CAAC;KACf;IAED,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,KAAK,IAAI,EAAE;QAC5B,MAAM,sBAAsB,CAAC,IAAI,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AArDD,wDAqDC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://localhost:3000/schemas/v1.json#",
|
|
3
|
-
"name": "big-package",
|
|
4
|
-
"version": "1.0.2",
|
|
5
|
-
"mainFunction": "render-json",
|
|
6
|
-
"namespace": "smoke-test-components",
|
|
7
|
-
"displayName": "some-displayName",
|
|
8
|
-
"description": "some-description",
|
|
9
|
-
"functions": [
|
|
10
|
-
{
|
|
11
|
-
"name": "render-json",
|
|
12
|
-
"entry": "render-json.js",
|
|
13
|
-
"input": {
|
|
14
|
-
"type": "object",
|
|
15
|
-
"properties": {
|
|
16
|
-
"something": {
|
|
17
|
-
"type": "string"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"required": ["something"]
|
|
21
|
-
},
|
|
22
|
-
"output": {
|
|
23
|
-
"responseType": "json",
|
|
24
|
-
"definition": {
|
|
25
|
-
"properties": {
|
|
26
|
-
"my-prop": {
|
|
27
|
-
"type": "string"
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"required": ["my-prop"]
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
]
|
|
35
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://localhost:3000/schemas/v1.json#",
|
|
3
|
-
"name": "cmp-format-string",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"mainFunction": "main",
|
|
6
|
-
"displayName": "some-display-name",
|
|
7
|
-
"namespace": "fixtures",
|
|
8
|
-
"description": "some-description",
|
|
9
|
-
"functions": [
|
|
10
|
-
{
|
|
11
|
-
"name": "main",
|
|
12
|
-
"entry": "main.js",
|
|
13
|
-
"input": {
|
|
14
|
-
"type": "object",
|
|
15
|
-
"properties": {
|
|
16
|
-
"text": {
|
|
17
|
-
"type": "string",
|
|
18
|
-
"format": "multi-line"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"required": ["text"]
|
|
22
|
-
},
|
|
23
|
-
"output": { "responseType": "html" }
|
|
24
|
-
}
|
|
25
|
-
],
|
|
26
|
-
"previews": {
|
|
27
|
-
"test-preview": {
|
|
28
|
-
"functionData": {
|
|
29
|
-
"main": {
|
|
30
|
-
"inputData": {
|
|
31
|
-
"type": "inline",
|
|
32
|
-
"value": {
|
|
33
|
-
"text": "this is a test"
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://localhost:3000/schemas/v1.json#",
|
|
3
|
-
"name": "cmp-static-file-test",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"mainFunction": "main",
|
|
6
|
-
"namespace": "smoke-test-components",
|
|
7
|
-
"displayName": "some-displayName",
|
|
8
|
-
"description": "some-description",
|
|
9
|
-
"functions": [
|
|
10
|
-
{
|
|
11
|
-
"entry": "main.js",
|
|
12
|
-
"name": "main",
|
|
13
|
-
"input": {
|
|
14
|
-
"type": "object",
|
|
15
|
-
"properties": {
|
|
16
|
-
"something": {
|
|
17
|
-
"type": "string"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"required": ["something"]
|
|
21
|
-
},
|
|
22
|
-
"output": {
|
|
23
|
-
"responseType": "html",
|
|
24
|
-
"staticFiles": [
|
|
25
|
-
{
|
|
26
|
-
"location": "header",
|
|
27
|
-
"file": {
|
|
28
|
-
"filepath": "static-library-file.js",
|
|
29
|
-
"type": "js"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
],
|
|
36
|
-
"staticFiles": {
|
|
37
|
-
"locationRoot": "public"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://localhost:3000/schemas/v1.json#",
|
|
3
|
-
"name": "invalid-manifes@t",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"mainFunction": "main",
|
|
6
|
-
"namespace": "smoke-test-components",
|
|
7
|
-
"displayName": "some-displayName",
|
|
8
|
-
"description": "some-description",
|
|
9
|
-
"functions": [
|
|
10
|
-
{
|
|
11
|
-
"entry": "main.js",
|
|
12
|
-
"name": "main",
|
|
13
|
-
"input": {
|
|
14
|
-
"type": "object",
|
|
15
|
-
"properties": {
|
|
16
|
-
"something": {
|
|
17
|
-
"type": "string"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"required": ["something"]
|
|
21
|
-
},
|
|
22
|
-
"output": {
|
|
23
|
-
"responseType": "html"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
]
|
|
27
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.deleteContentItem = exports.addContentItem = exports.addComponentSet = exports.deleteComponentSet = exports.removeFile = exports.createFile = exports.getTestComponents = exports.ci_buildBranch = exports.ci_buildVersion = exports.contentService = exports.renderService = exports.managementServiceRoot = exports.managementService = exports.authToken = void 0;
|
|
7
|
-
const axios_1 = __importDefault(require("axios"));
|
|
8
|
-
const fs_1 = __importDefault(require("fs"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
11
|
-
const crypto_1 = require("crypto");
|
|
12
|
-
const dx_common_lib_1 = require("@squiz/dx-common-lib");
|
|
13
|
-
const dotenv_1 = require("dotenv");
|
|
14
|
-
const child_process_1 = require("child_process");
|
|
15
|
-
(0, dotenv_1.config)();
|
|
16
|
-
const configObj = {
|
|
17
|
-
managementServiceUrl: (0, dx_common_lib_1.parseEnvVarForVar)('COMPONENT_MANAGEMENT_SERVICE_URL').replace(/\/+$/, ''),
|
|
18
|
-
renderServiceUrl: (0, dx_common_lib_1.parseEnvVarForVar)('COMPONENT_RENDER_SERVICE_URL').replace(/\/+$/, ''),
|
|
19
|
-
contentServiceUrl: (0, dx_common_lib_1.parseEnvVarForVar)('CONTENT_API_URL').replace(/\/+$/, ''),
|
|
20
|
-
ci_buildVersion: (0, dx_common_lib_1.parseEnvVarForVar)('CI_COMMIT_SHORT_SHA'),
|
|
21
|
-
ci_buildBranch: (0, dx_common_lib_1.parseEnvVarForVar)('CI_COMMIT_REF_NAME'),
|
|
22
|
-
};
|
|
23
|
-
if (!configObj.ci_buildVersion) {
|
|
24
|
-
configObj.ci_buildVersion = (0, child_process_1.execSync)('git rev-parse --short HEAD', { encoding: 'utf-8' }).trim();
|
|
25
|
-
}
|
|
26
|
-
if (!configObj.ci_buildBranch) {
|
|
27
|
-
configObj.ci_buildBranch = (0, child_process_1.execSync)('git branch --show-current', { encoding: 'utf-8' }).trim();
|
|
28
|
-
}
|
|
29
|
-
exports.default = configObj;
|
|
30
|
-
const DXP_SERVICE_NAME = 'dxpComponents';
|
|
31
|
-
const ALL_PERMISSIONS_ROLE = {
|
|
32
|
-
privileges: [
|
|
33
|
-
'COMPONENT_DEPLOY',
|
|
34
|
-
'COMPONENT_DELETE',
|
|
35
|
-
'COMPONENT_READ',
|
|
36
|
-
'COMPONENT_SET_RULES_READ',
|
|
37
|
-
'COMPONENT_SET_RULES_WRITE',
|
|
38
|
-
'COMPONENT_SET_READ',
|
|
39
|
-
'COMPONENT_SET_WRITE',
|
|
40
|
-
'COMPONENT_SET_ENVIRONMENT_READ',
|
|
41
|
-
'COMPONENT_SET_ENVIRONMENT_WRITE',
|
|
42
|
-
],
|
|
43
|
-
};
|
|
44
|
-
const validToken = {
|
|
45
|
-
organisationId: 'aa',
|
|
46
|
-
permission: '',
|
|
47
|
-
tenant: 'zz',
|
|
48
|
-
tenantId: 'zz',
|
|
49
|
-
userId: 'zz',
|
|
50
|
-
service: {
|
|
51
|
-
[DXP_SERVICE_NAME]: {
|
|
52
|
-
privileges: ALL_PERMISSIONS_ROLE.privileges,
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
exports.authToken = `Bearer xxx.${Buffer.from(JSON.stringify(validToken)).toString('base64')}.zzz`;
|
|
57
|
-
exports.managementService = axios_1.default.create({
|
|
58
|
-
baseURL: configObj.managementServiceUrl + '/v1',
|
|
59
|
-
headers: {
|
|
60
|
-
authorization: exports.authToken,
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
exports.managementServiceRoot = axios_1.default.create({
|
|
64
|
-
baseURL: configObj.managementServiceUrl,
|
|
65
|
-
headers: {
|
|
66
|
-
authorization: exports.authToken,
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
exports.renderService = axios_1.default.create({
|
|
70
|
-
baseURL: configObj.renderServiceUrl,
|
|
71
|
-
headers: {
|
|
72
|
-
authorization: exports.authToken,
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
exports.contentService = axios_1.default.create({
|
|
76
|
-
baseURL: configObj.contentServiceUrl,
|
|
77
|
-
headers: {
|
|
78
|
-
authorization: exports.authToken,
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
exports.ci_buildVersion = configObj.ci_buildVersion;
|
|
82
|
-
exports.ci_buildBranch = configObj.ci_buildBranch;
|
|
83
|
-
function getTestComponents() {
|
|
84
|
-
const componets = [];
|
|
85
|
-
const componentsDir = path_1.default.join(__dirname, '/__components__/');
|
|
86
|
-
const files = fs_1.default.readdirSync(componentsDir);
|
|
87
|
-
for (const file of files) {
|
|
88
|
-
const stat = fs_1.default.statSync(path_1.default.join(componentsDir, file));
|
|
89
|
-
if (stat.isDirectory() && file.substring(0, 4) === 'cmp-') {
|
|
90
|
-
componets.push(file);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return componets;
|
|
94
|
-
}
|
|
95
|
-
exports.getTestComponents = getTestComponents;
|
|
96
|
-
async function createFile(filePath, sizeInMB) {
|
|
97
|
-
const content = (0, crypto_1.randomBytes)(sizeInMB * 1000000);
|
|
98
|
-
await promises_1.default.writeFile(`${filePath}`, content);
|
|
99
|
-
}
|
|
100
|
-
exports.createFile = createFile;
|
|
101
|
-
function removeFile(filePath) {
|
|
102
|
-
promises_1.default.unlink(filePath);
|
|
103
|
-
}
|
|
104
|
-
exports.removeFile = removeFile;
|
|
105
|
-
async function deleteComponentSet(webPath) {
|
|
106
|
-
try {
|
|
107
|
-
await exports.managementService.delete(`/component-set/${webPath}`);
|
|
108
|
-
}
|
|
109
|
-
catch (error) {
|
|
110
|
-
// no ops
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
exports.deleteComponentSet = deleteComponentSet;
|
|
114
|
-
async function addComponentSet(componentSet) {
|
|
115
|
-
try {
|
|
116
|
-
await exports.managementService.post(`/component-set`, componentSet);
|
|
117
|
-
}
|
|
118
|
-
catch (error) {
|
|
119
|
-
//no ops
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
exports.addComponentSet = addComponentSet;
|
|
123
|
-
async function addContentItem(contentItem) {
|
|
124
|
-
try {
|
|
125
|
-
await exports.contentService.post(`/content-item`, contentItem);
|
|
126
|
-
}
|
|
127
|
-
catch (error) {
|
|
128
|
-
//no ops
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
exports.addContentItem = addContentItem;
|
|
132
|
-
async function deleteContentItem(contentItemId) {
|
|
133
|
-
try {
|
|
134
|
-
await exports.contentService.delete(`/content-item/${contentItemId}`);
|
|
135
|
-
}
|
|
136
|
-
catch (error) {
|
|
137
|
-
//no ops
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
exports.deleteContentItem = deleteContentItem;
|
|
141
|
-
//# sourceMappingURL=helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","sourceRoot":"","sources":["../../src/integration-tests/helper.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAAoB;AACpB,gDAAwB;AAExB,2DAA8B;AAC9B,mCAAqC;AAErC,wDAAyD;AAEzD,mCAAgC;AAChC,iDAAyC;AAEzC,IAAA,eAAM,GAAE,CAAC;AAUT,MAAM,SAAS,GAAW;IACxB,oBAAoB,EAAE,IAAA,iCAAiB,EAAC,kCAAkC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAC/F,gBAAgB,EAAE,IAAA,iCAAiB,EAAC,8BAA8B,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IACvF,iBAAiB,EAAE,IAAA,iCAAiB,EAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAC3E,eAAe,EAAE,IAAA,iCAAiB,EAAC,qBAAqB,CAAC;IACzD,cAAc,EAAE,IAAA,iCAAiB,EAAC,oBAAoB,CAAC;CACxD,CAAC;AAEF,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE;IAC9B,SAAS,CAAC,eAAe,GAAG,IAAA,wBAAQ,EAAC,4BAA4B,EAA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C,kBAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACvB,CAAC;AAFD,gCAEC;AAEM,KAAK,UAAU,kBAAkB,CAAC,OAAe;IACtD,IAAI;QACF,MAAM,yBAAiB,CAAC,MAAM,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAC;KAC7D;IAAC,OAAO,KAAK,EAAE;QACd,SAAS;KACV;AACH,CAAC;AAND,gDAMC;AAEM,KAAK,UAAU,eAAe,CAAC,YAA2C;IAC/E,IAAI;QACF,MAAM,yBAAiB,CAAC,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;KAC9D;IAAC,OAAO,KAAK,EAAE;QACd,QAAQ;KACT;AACH,CAAC;AAND,0CAMC;AAEM,KAAK,UAAU,cAAc,CAAC,WAA2C;IAC9E,IAAI;QACF,MAAM,sBAAc,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;KACzD;IAAC,OAAO,KAAK,EAAE;QACd,QAAQ;KACT;AACH,CAAC;AAND,wCAMC;AAEM,KAAK,UAAU,iBAAiB,CAAC,aAAqB;IAC3D,IAAI;QACF,MAAM,sBAAc,CAAC,MAAM,CAAC,iBAAiB,aAAa,EAAE,CAAC,CAAC;KAC/D;IAAC,OAAO,KAAK,EAAE;QACd,QAAQ;KACT;AACH,CAAC;AAND,8CAMC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const helper_1 = require("./helper");
|
|
4
|
-
describe('Verify latest services deployments', () => {
|
|
5
|
-
it('Should have latest Management API service', async () => {
|
|
6
|
-
const response = (await helper_1.managementServiceRoot.get('/health')).data;
|
|
7
|
-
expect(response.buildVersion).toBe(helper_1.ci_buildVersion);
|
|
8
|
-
expect(response.buildBranch).toBe(helper_1.ci_buildBranch);
|
|
9
|
-
});
|
|
10
|
-
it('Should return 200 for Management API docs', async () => {
|
|
11
|
-
const req = await helper_1.managementService.get('/docs');
|
|
12
|
-
expect(req.status).toBe(200);
|
|
13
|
-
expect(req.headers['content-type']).toEqual('text/html; charset=utf-8');
|
|
14
|
-
});
|
|
15
|
-
it('Should return 200 for Management API docs.json', async () => {
|
|
16
|
-
const req = await helper_1.managementService.get('/docs.json');
|
|
17
|
-
expect(req.status).toBe(200);
|
|
18
|
-
expect(req.headers['content-type']).toEqual('application/json; charset=UTF-8');
|
|
19
|
-
});
|
|
20
|
-
it('Should have latest Render Runtime service', async () => {
|
|
21
|
-
const response = (await helper_1.renderService.get('/health')).data;
|
|
22
|
-
expect(response.buildVersion).toBe(helper_1.ci_buildVersion);
|
|
23
|
-
expect(response.buildBranch).toBe(helper_1.ci_buildBranch);
|
|
24
|
-
});
|
|
25
|
-
it('Should return 200 for Render Runtime API docs', async () => {
|
|
26
|
-
const req = await helper_1.renderService.get('/docs');
|
|
27
|
-
expect(req.status).toBe(200);
|
|
28
|
-
expect(req.headers['content-type']).toEqual('text/html; charset=utf-8');
|
|
29
|
-
});
|
|
30
|
-
it('Should return 200 for Render Runtime API docs.json', async () => {
|
|
31
|
-
const req = await helper_1.renderService.get('/docs.json');
|
|
32
|
-
expect(req.status).toBe(200);
|
|
33
|
-
expect(req.headers['content-type']).toEqual('application/json; charset=UTF-8');
|
|
34
|
-
});
|
|
35
|
-
it('Should have latest Content API service', async () => {
|
|
36
|
-
const response = (await helper_1.contentService.get('/health')).data;
|
|
37
|
-
expect(response.buildVersion).toBe(helper_1.ci_buildVersion);
|
|
38
|
-
expect(response.buildBranch).toBe(helper_1.ci_buildBranch);
|
|
39
|
-
});
|
|
40
|
-
it('Should return 200 for Content API docs', async () => {
|
|
41
|
-
const req = await helper_1.contentService.get('/docs');
|
|
42
|
-
expect(req.status).toBe(200);
|
|
43
|
-
expect(req.headers['content-type']).toEqual('text/html; charset=utf-8');
|
|
44
|
-
});
|
|
45
|
-
it('Should return 200 for Content API docs.json', async () => {
|
|
46
|
-
const req = await helper_1.contentService.get('/docs.json');
|
|
47
|
-
expect(req.status).toBe(200);
|
|
48
|
-
expect(req.headers['content-type']).toEqual('application/json; charset=UTF-8');
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=service-deployment.integration.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service-deployment.integration.spec.js","sourceRoot":"","sources":["../../src/integration-tests/service-deployment.integration.spec.ts"],"names":[],"mappings":";;AAAA,qCAOkB;AAQlB,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAClD,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,QAAQ,GAAe,CAAC,MAAM,8BAAqB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/E,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,wBAAe,CAAC,CAAC;QACpD,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,uBAAc,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,GAAG,GAAG,MAAM,0BAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACjD,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7B,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,KAAK,IAAI,EAAE;QAC9D,MAAM,GAAG,GAAG,MAAM,0BAAiB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;QACtD,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7B,MAAM,CAAC,GA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