@squiz/component-cli-lib 1.2.1-alpha.100

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.
Files changed (50) hide show
  1. package/.gitlab-ci.yml +113 -0
  2. package/CHANGELOG.md +690 -0
  3. package/jest.config.ts +16 -0
  4. package/jest.integration.config.ts +17 -0
  5. package/lib/component-dev.d.ts +13 -0
  6. package/lib/component-dev.js +40 -0
  7. package/lib/component-dev.js.map +1 -0
  8. package/lib/component-dev.spec.d.ts +1 -0
  9. package/lib/component-dev.spec.js +91 -0
  10. package/lib/component-dev.spec.js.map +1 -0
  11. package/lib/index.d.ts +2 -0
  12. package/lib/index.js +8 -0
  13. package/lib/index.js.map +1 -0
  14. package/lib/integration-tests/__components__/big-package/manifest.json +32 -0
  15. package/lib/integration-tests/__components__/cmp-static-file-test/manifest.json +36 -0
  16. package/lib/integration-tests/__components__/invalid-manifest/manifest.json +24 -0
  17. package/lib/integration-tests/helper.d.ts +18 -0
  18. package/lib/integration-tests/helper.js +70 -0
  19. package/lib/integration-tests/helper.js.map +1 -0
  20. package/lib/integration-tests/service-deployment.spec.d.ts +1 -0
  21. package/lib/integration-tests/service-deployment.spec.js +16 -0
  22. package/lib/integration-tests/service-deployment.spec.js.map +1 -0
  23. package/lib/integration-tests/test-setup.d.ts +0 -0
  24. package/lib/integration-tests/test-setup.js +3 -0
  25. package/lib/integration-tests/test-setup.js.map +1 -0
  26. package/lib/integration-tests/upload-and-render-component.spec.d.ts +1 -0
  27. package/lib/integration-tests/upload-and-render-component.spec.js +135 -0
  28. package/lib/integration-tests/upload-and-render-component.spec.js.map +1 -0
  29. package/lib/upload-component-folder.d.ts +3 -0
  30. package/lib/upload-component-folder.js +127 -0
  31. package/lib/upload-component-folder.js.map +1 -0
  32. package/package.json +41 -0
  33. package/src/component-dev.spec.ts +111 -0
  34. package/src/component-dev.ts +34 -0
  35. package/src/index.ts +2 -0
  36. package/src/integration-tests/__components__/big-package/manifest.json +33 -0
  37. package/src/integration-tests/__components__/big-package/render-json.js +5 -0
  38. package/src/integration-tests/__components__/cmp-static-file-test/main.js +10 -0
  39. package/src/integration-tests/__components__/cmp-static-file-test/manifest.json +40 -0
  40. package/src/integration-tests/__components__/cmp-static-file-test/public/static-library-file.js +1 -0
  41. package/src/integration-tests/__components__/invalid-manifest/main.js +7 -0
  42. package/src/integration-tests/__components__/invalid-manifest/manifest.json +26 -0
  43. package/src/integration-tests/__components__/invalid-upload/main.js +7 -0
  44. package/src/integration-tests/helper.ts +74 -0
  45. package/src/integration-tests/service-deployment.spec.ts +21 -0
  46. package/src/integration-tests/test-setup.ts +1 -0
  47. package/src/integration-tests/upload-and-render-component.spec.ts +137 -0
  48. package/src/upload-component-folder.ts +136 -0
  49. package/tsconfig.json +21 -0
  50. package/tsconfig.tsbuildinfo +1 -0
@@ -0,0 +1,17 @@
1
+ import type { Config } from 'jest';
2
+
3
+ // Sync object
4
+ const config: Config = {
5
+ preset: 'ts-jest',
6
+ testEnvironment: 'node',
7
+ testRegex: '/integration-tests/.*\\.spec\\.ts$',
8
+ setupFiles: ['./src/integration-tests/test-setup.ts'],
9
+ detectOpenHandles: true,
10
+
11
+ globals: {
12
+ BUILD_VERSION: 'undefined',
13
+ BUILD_BRANCH: 'undefined',
14
+ },
15
+ };
16
+
17
+ export default config;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * startDevelopmentRender starts a dev-mode render stack for any
3
+ * local directory. This should start an express server on a random unused port
4
+ * which can be accessed for viewing the component in development.
5
+ *
6
+ * @param {string} componentPath - The directory with the component to be rendered
7
+ * @param {object} options - Additional configuration for the dev stack
8
+ * @returns a function to stop the render stack
9
+ */
10
+ export declare function startDevelopmentRender(componentPath: string, options: {
11
+ port: number;
12
+ previewFile?: string;
13
+ }): Promise<() => Promise<void>>;
@@ -0,0 +1,40 @@
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
+ /**
11
+ * startDevelopmentRender starts a dev-mode render stack for any
12
+ * local directory. This should start an express server on a random unused port
13
+ * which can be accessed for viewing the component in development.
14
+ *
15
+ * @param {string} componentPath - The directory with the component to be rendered
16
+ * @param {object} options - Additional configuration for the dev stack
17
+ * @returns a function to stop the render stack
18
+ */
19
+ async function startDevelopmentRender(componentPath, options) {
20
+ const logger = (0, dx_logger_lib_1.getLogger)({ name: 'component-dev', format: 'human' });
21
+ await (0, render_runtime_lib_1.startRenderStack)({
22
+ logger: logger,
23
+ webserver: {
24
+ port: options.port,
25
+ rootUrl: `http://localhost:${options.port}`,
26
+ shouldRunMigrations: false,
27
+ },
28
+ componentRunner: {
29
+ // Considering the component path will be passed in from CLI
30
+ // We need to generate the path from the calling directory
31
+ dataMountPoint: path_1.default.resolve(process.cwd(), componentPath),
32
+ localDevMode: true,
33
+ previewFile: options.previewFile,
34
+ workerTimeout: 20000,
35
+ },
36
+ });
37
+ return () => (0, render_runtime_lib_1.stopRenderStack)();
38
+ }
39
+ exports.startDevelopmentRender = startDevelopmentRender;
40
+ //# sourceMappingURL=component-dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-dev.js","sourceRoot":"","sources":["../src/component-dev.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA8E;AAC9E,wDAAiD;AACjD,gDAAwB;AAExB;;;;;;;;GAQG;AACI,KAAK,UAAU,sBAAsB,CAAC,aAAqB,EAAE,OAA+C;IACjH,MAAM,MAAM,GAAG,IAAA,yBAAS,EAAC,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IACrE,MAAM,IAAA,qCAAgB,EAAC;QACrB,MAAM,EAAE,MAAM;QACd,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,YAAY,EAAE,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,aAAa,EAAE,KAAM;SACtB;KACF,CAAC,CAAC;IAEH,OAAO,GAAG,EAAE,CAAC,IAAA,oCAAe,GAAE,CAAC;AACjC,CAAC;AApBD,wDAoBC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,91 @@
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 path_1 = __importDefault(require("path"));
7
+ const promises_1 = __importDefault(require("fs/promises"));
8
+ const render_runtime_lib_1 = require("@squiz/render-runtime-lib");
9
+ const component_dev_1 = require("./component-dev");
10
+ const supertest_1 = __importDefault(require("supertest"));
11
+ jest.setTimeout(20000);
12
+ describe('component-dev', () => {
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
+ it('should handle serving static files from single component directory', async () => {
49
+ const testServer = render_runtime_lib_1.TestHelpers.getTestServer();
50
+ const response = await testServer.get(`/s/${componentName}/${version}/static.txt`);
51
+ expect(response.text).toEqual('hello');
52
+ });
53
+ });
54
+ describe('accessing local dev routes', () => {
55
+ let stopServer;
56
+ const port = 3006;
57
+ const url = `http://localhost:${port}`;
58
+ const request = (0, supertest_1.default)(url);
59
+ beforeAll(async () => {
60
+ const compDir = path_1.default.join(__dirname, '../', '../../test-components');
61
+ stopServer = await (0, component_dev_1.startDevelopmentRender)(compDir, {
62
+ port: port,
63
+ });
64
+ });
65
+ afterAll(async () => {
66
+ await stopServer();
67
+ });
68
+ describe('definition routes', () => {
69
+ render_runtime_lib_1.routeTests.definition(url, url);
70
+ });
71
+ describe('static routes', () => {
72
+ render_runtime_lib_1.routeTests.static(url);
73
+ });
74
+ describe('render routes', () => {
75
+ render_runtime_lib_1.routeTests.render(url, url);
76
+ });
77
+ describe('GET /r/set/test-component/1.0.1', () => {
78
+ //
79
+ // this scenario is different to the 'production' tests
80
+ // this is should 500 in prod and 404 locally
81
+ it('should fail validation if trying to render a component with an invalid schema', async () => {
82
+ const response = await request.get('/r/set/test-component/1.0.1?something=not-used');
83
+ expect(response.statusCode).toEqual(404);
84
+ expect(response.body).toEqual({
85
+ message: 'manifest could not be found',
86
+ });
87
+ });
88
+ });
89
+ });
90
+ });
91
+ //# sourceMappingURL=component-dev.spec.js.map
@@ -0,0 +1 @@
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,GAAG,CAAC,6CAA6C,CAAC,CAAC;YACrF,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;QAC7C,IAAI,WAA+D,CAAC;QACpE,IAAI,OAAe,CAAC;QACpB,IAAI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M,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,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 ADDED
@@ -0,0 +1,2 @@
1
+ export { uploadComponentFolder } from './upload-component-folder';
2
+ export { startDevelopmentRender } from './component-dev';
package/lib/index.js ADDED
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
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; } });
6
+ var component_dev_1 = require("./component-dev");
7
+ Object.defineProperty(exports, "startDevelopmentRender", { enumerable: true, get: function () { return component_dev_1.startDevelopmentRender; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
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
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "$schema": "http://localhost:3000/schemas/v1.json#",
3
+ "name": "cmp-static-file-test",
4
+ "version": "1.0.0",
5
+ "main-function": "main",
6
+ "functions": [
7
+ {
8
+ "entry": "main.js",
9
+ "name": "main",
10
+ "input": {
11
+ "type": "object",
12
+ "properties": {
13
+ "something": {
14
+ "type": "string"
15
+ }
16
+ },
17
+ "required": ["something"]
18
+ },
19
+ "output": {
20
+ "response-type": "html",
21
+ "static-files": [
22
+ {
23
+ "location": "header",
24
+ "file": {
25
+ "filepath": "static-library-file.js",
26
+ "type": "js"
27
+ }
28
+ }
29
+ ]
30
+ }
31
+ }
32
+ ],
33
+ "static-files": {
34
+ "location-root": "public"
35
+ }
36
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "$schema": "http://localhost:3000/schemas/v1.json#",
3
+ "name": "invalid-manifes@t",
4
+ "version": "1.0.0",
5
+ "main-function": "main",
6
+ "functions": [
7
+ {
8
+ "entry": "main.js",
9
+ "name": "main",
10
+ "input": {
11
+ "type": "object",
12
+ "properties": {
13
+ "something": {
14
+ "type": "string"
15
+ }
16
+ },
17
+ "required": ["something"]
18
+ },
19
+ "output": {
20
+ "response-type": "html"
21
+ }
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,18 @@
1
+ import { ComponentSet } from '@squiz/component-lib';
2
+ interface Config {
3
+ managementServiceUrl: string;
4
+ renderServiceUrl: string;
5
+ ci_buildVersion: string;
6
+ ci_buildBranch: string;
7
+ }
8
+ declare const configObj: Config;
9
+ export default configObj;
10
+ export declare const managementService: import("axios").AxiosInstance;
11
+ export declare const renderService: import("axios").AxiosInstance;
12
+ export declare const ci_buildVersion: string;
13
+ export declare const ci_buildBranch: string;
14
+ export declare function getTestComponents(): string[];
15
+ export declare function createFile(filePath: string, sizeInMB: number): Promise<void>;
16
+ export declare function removeFile(filePath: string): void;
17
+ export declare function deleteComponentSet(webPath: string): Promise<void>;
18
+ export declare function addComponentSet(componentSet: ComponentSet): Promise<void>;
@@ -0,0 +1,70 @@
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.addComponentSet = exports.deleteComponentSet = exports.removeFile = exports.createFile = exports.getTestComponents = exports.ci_buildBranch = exports.ci_buildVersion = exports.renderService = exports.managementService = 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 component_lib_1 = require("@squiz/component-lib");
13
+ const dotenv_1 = require("dotenv");
14
+ (0, dotenv_1.config)();
15
+ const configObj = {
16
+ managementServiceUrl: (0, component_lib_1.parseEnvVarForVar)('COMPONENT_MANAGEMENT_SERVICE_URL').replace(/\/+$/, ''),
17
+ renderServiceUrl: (0, component_lib_1.parseEnvVarForVar)('COMPONENT_RENDER_SERVICE_URL').replace(/\/+$/, ''),
18
+ ci_buildVersion: (0, component_lib_1.parseEnvVarForVar)('CI_COMMIT_SHORT_SHA'),
19
+ ci_buildBranch: (0, component_lib_1.parseEnvVarForVar)('CI_COMMIT_REF_NAME'),
20
+ };
21
+ exports.default = configObj;
22
+ exports.managementService = axios_1.default.create({
23
+ baseURL: configObj.managementServiceUrl,
24
+ });
25
+ exports.renderService = axios_1.default.create({
26
+ baseURL: configObj.renderServiceUrl,
27
+ });
28
+ exports.ci_buildVersion = configObj.ci_buildVersion;
29
+ exports.ci_buildBranch = configObj.ci_buildBranch;
30
+ function getTestComponents() {
31
+ const componets = [];
32
+ const componentsDir = path_1.default.join(__dirname, '/__components__/');
33
+ const files = fs_1.default.readdirSync(componentsDir);
34
+ for (const file of files) {
35
+ const stat = fs_1.default.statSync(path_1.default.join(componentsDir, file));
36
+ if (stat.isDirectory() && file.substring(0, 4) === 'cmp-') {
37
+ componets.push(file);
38
+ }
39
+ }
40
+ return componets;
41
+ }
42
+ exports.getTestComponents = getTestComponents;
43
+ async function createFile(filePath, sizeInMB) {
44
+ const content = (0, crypto_1.randomBytes)(sizeInMB * 1000000);
45
+ await promises_1.default.writeFile(`${filePath}`, content);
46
+ }
47
+ exports.createFile = createFile;
48
+ function removeFile(filePath) {
49
+ promises_1.default.unlink(filePath);
50
+ }
51
+ exports.removeFile = removeFile;
52
+ async function deleteComponentSet(webPath) {
53
+ try {
54
+ await exports.managementService.delete(`/component-set/${webPath}`);
55
+ }
56
+ catch (error) {
57
+ // no ops
58
+ }
59
+ }
60
+ exports.deleteComponentSet = deleteComponentSet;
61
+ async function addComponentSet(componentSet) {
62
+ try {
63
+ await exports.managementService.post(`/component-set`, componentSet);
64
+ }
65
+ catch (error) {
66
+ //no ops
67
+ }
68
+ }
69
+ exports.addComponentSet = addComponentSet;
70
+ //# sourceMappingURL=helper.js.map
@@ -0,0 +1 @@
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;AACrC,wDAAuE;AACvE,mCAAgC;AAEhC,IAAA,eAAM,GAAE,CAAC;AAST,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,eAAe,EAAE,IAAA,iCAAiB,EAAC,qB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,UAAU,CAAC,QAAgB;IACzC,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,YAA0B;IAC9D,IAAI;QACF,MAAM,yBAAiB,CAAC,IAAI,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;KAC9D;IAAC,OAAO,KAAK,EAAE;QACd,QAAQ;KACT;AACH,CAAC;AAND,0CAMC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
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.managementService.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 have latest Render Runtime service', async () => {
11
+ const response = (await helper_1.renderService.get('/health')).data;
12
+ expect(response.buildVersion).toBe(helper_1.ci_buildVersion);
13
+ expect(response.buildBranch).toBe(helper_1.ci_buildBranch);
14
+ });
15
+ });
16
+ //# sourceMappingURL=service-deployment.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service-deployment.spec.js","sourceRoot":"","sources":["../../src/integration-tests/service-deployment.spec.ts"],"names":[],"mappings":";;AAAA,qCAA6F;AAQ7F,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAClD,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;QACzD,MAAM,QAAQ,GAAe,CAAC,MAAM,0BAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3E,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,QAAQ,GAAe,CAAC,MAAM,sBAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QACvE,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;AACL,CAAC,CAAC,CAAC"}
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ jest.setTimeout(60000);
3
+ //# sourceMappingURL=test-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-setup.js","sourceRoot":"","sources":["../../src/integration-tests/test-setup.ts"],"names":[],"mappings":";AAAA,IAAI,CAAC,UAAU,CAAC,KAAM,CAAC,CAAC"}
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const index_1 = require("../index");
30
+ const helper_1 = __importStar(require("./helper"));
31
+ const cli_color_1 = __importDefault(require("cli-color"));
32
+ const path_1 = __importDefault(require("path"));
33
+ const supertest_1 = __importDefault(require("supertest"));
34
+ const upload_component_folder_1 = require("../upload-component-folder");
35
+ const mockConsoleError = jest.fn();
36
+ const mockConsoleLog = jest.fn();
37
+ const orgConsoleError = console.error;
38
+ const webPath = 'set';
39
+ afterAll(async () => {
40
+ // clean up the component added by the test
41
+ await (0, helper_1.deleteComponentSet)(webPath);
42
+ for (const componentName of (0, helper_1.getTestComponents)()) {
43
+ try {
44
+ await helper_1.managementService.delete(`/component/${componentName}`);
45
+ }
46
+ catch {
47
+ // no op
48
+ }
49
+ }
50
+ });
51
+ describe('Test isolated test cases', () => {
52
+ beforeEach(() => {
53
+ jest.spyOn(upload_component_folder_1.logger, 'error').mockImplementation(mockConsoleError);
54
+ jest.spyOn(upload_component_folder_1.logger, 'info').mockImplementation(mockConsoleLog);
55
+ });
56
+ it('Should fail uploading a component without manifest.json', async () => {
57
+ mockConsoleError.mockClear();
58
+ const componentPath = path_1.default.join(__dirname, '/__components__/invalid-upload');
59
+ await (0, index_1.uploadComponentFolder)(componentPath, helper_1.default.managementServiceUrl, helper_1.default.renderServiceUrl);
60
+ expect(mockConsoleError.mock.calls[0][0]).toEqual(cli_color_1.default.red('manifest could not be found'));
61
+ });
62
+ it('Should fail uploading a component that has invalid manifest.json', async () => {
63
+ mockConsoleError.mockClear();
64
+ const componentPath = path_1.default.join(__dirname, '/__components__/invalid-manifest');
65
+ await (0, index_1.uploadComponentFolder)(componentPath, helper_1.default.managementServiceUrl, helper_1.default.renderServiceUrl);
66
+ expect(mockConsoleError.mock.calls[0][0]).toEqual(cli_color_1.default.red('/name: pattern must match pattern "^[a-zA-Z0-9_\\-]+$"'));
67
+ });
68
+ it('Should fail uploading the component that has size more than 100MB', async () => {
69
+ mockConsoleError.mockClear();
70
+ const componentPath = path_1.default.join(__dirname, '/__components__/big-package');
71
+ const filePath = `${componentPath}/105mb-file`;
72
+ await (0, helper_1.createFile)(filePath, 105); // Higher limit has been used because compression reduces the size if you use closer to 100MB
73
+ await (0, index_1.uploadComponentFolder)(componentPath, helper_1.default.managementServiceUrl, helper_1.default.renderServiceUrl);
74
+ expect(mockConsoleError.mock.calls[0][0]).toEqual(cli_color_1.default.red(['File size exceeds the maximum limit of 100MB'].join('')));
75
+ (0, helper_1.removeFile)(filePath);
76
+ });
77
+ });
78
+ describe('Deploy basic component having a static file', () => {
79
+ // component to deploy for this test
80
+ const componentPath = path_1.default.join(__dirname, '/__components__/cmp-static-file-test');
81
+ beforeAll(async () => {
82
+ await (0, helper_1.deleteComponentSet)(webPath);
83
+ for (const componentName of (0, helper_1.getTestComponents)()) {
84
+ try {
85
+ await helper_1.managementService.delete(`/component/${componentName}`);
86
+ }
87
+ catch {
88
+ // no op
89
+ }
90
+ }
91
+ });
92
+ beforeEach(() => {
93
+ console.error = mockConsoleError;
94
+ console.log = mockConsoleLog;
95
+ });
96
+ afterEach(() => {
97
+ console.error = orgConsoleError;
98
+ });
99
+ it('Should upload the component and return a valid url to preview', async () => {
100
+ var _a, _b;
101
+ mockConsoleLog.mockClear();
102
+ await (0, index_1.uploadComponentFolder)(componentPath, helper_1.default.managementServiceUrl, helper_1.default.renderServiceUrl);
103
+ const url = ((_a = /uploaded location: (.*)/.exec(mockConsoleLog.mock.lastCall)) === null || _a === void 0 ? void 0 : _a[1]) || '';
104
+ const uploadedComponent = '<a href="/r/set/cmp-static-file-test/1.0.0">1.0.0</a>';
105
+ const get = await (0, supertest_1.default)(url).get('/');
106
+ expect(get.status).toEqual(200);
107
+ expect((_b = get === null || get === void 0 ? void 0 : get.res) === null || _b === void 0 ? void 0 : _b.text).toContain(uploadedComponent);
108
+ });
109
+ it('Should fail upload the component with same version', async () => {
110
+ mockConsoleError.mockClear();
111
+ await (0, index_1.uploadComponentFolder)(componentPath, helper_1.default.managementServiceUrl, helper_1.default.renderServiceUrl);
112
+ expect(mockConsoleError.mock.calls[0][0]).toEqual(cli_color_1.default.red('Cannot upload component version, cmp-static-file-test 1.0.0 already exists'));
113
+ });
114
+ it('Should render component', async () => {
115
+ const componentSet = {
116
+ webPath,
117
+ displayName: 'Set',
118
+ description: 'Set description',
119
+ headers: {},
120
+ envVars: {},
121
+ components: {
122
+ 'cmp-static-file-test': [{ envVars: {}, version: '1.0.0' }],
123
+ },
124
+ };
125
+ await (0, helper_1.addComponentSet)(componentSet);
126
+ const response = await helper_1.renderService.get('/r/set/cmp-static-file-test/1.0.0/?something=hello');
127
+ expect(response.status).toEqual(200);
128
+ expect(response.data).toEqual([
129
+ '<div>Input: hello</div>',
130
+ '<div>cmp-static-file-test 1.0.0 ',
131
+ `${helper_1.default.renderServiceUrl}/s/cmp-static-file-test/1.0.0/birthday-cake.png</div>`,
132
+ ].join(''));
133
+ });
134
+ });
135
+ //# sourceMappingURL=upload-and-render-component.spec.js.map
@@ -0,0 +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,mDAQkB;AAClB,0DAA8B;AAC9B,gDAAwB;AACxB,0DAAkC;AAClC,wEAAoD;AAGpD,MAAM,gBAAgB,GAAG,IAAI,CAAC,EAAE,EAAE,CA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are const logger: Logger;
3
+ export declare function uploadComponentFolder(folderPath: string, componentServiceManagementUrl: string, componentRenderServiceUrl: string): Promise<void>;