@squiz/component-cli-lib 1.63.1-alpha.7 → 1.63.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@squiz/component-cli-lib",
3
- "version": "1.63.1-alpha.7",
3
+ "version": "1.63.1",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
+ "private": false,
7
+ "publishConfig": {
8
+ "access": "public"
9
+ },
6
10
  "scripts": {
7
11
  "compile": "node build.js && tsc",
8
12
  "test": "jest -c jest.config.ts",
@@ -13,12 +17,12 @@
13
17
  "author": "",
14
18
  "license": "ISC",
15
19
  "devDependencies": {
16
- "@squiz/component-lib": "1.63.1-alpha.7",
20
+ "@squiz/component-lib": "1.63.1",
17
21
  "@squiz/component-web-api-lib": "1.63.1-alpha.7",
18
- "@squiz/dx-common-lib": "1.63.1-alpha.7",
22
+ "@squiz/dx-common-lib": "1.63.1",
19
23
  "@squiz/dx-json-schema-lib": "1.63.1-alpha.7",
20
24
  "@squiz/dx-logger-lib": "1.63.1-alpha.7",
21
- "@squiz/dxp-session-lib": "1.63.1-alpha.7",
25
+ "@squiz/dxp-session-lib": "1.63.1",
22
26
  "@squiz/virus-scanner-lib": "1.63.1-alpha.7",
23
27
  "@types/cli-color": "2.0.2",
24
28
  "@types/express": "4.17.17",
@@ -33,13 +37,12 @@
33
37
  "typescript": "4.9.4"
34
38
  },
35
39
  "dependencies": {
36
- "@squiz/render-runtime-lib": "1.63.1-alpha.7",
37
- "@squiz/runtime-sandbox-node": "1.63.1-alpha.7",
40
+ "@squiz/render-runtime-lib": "1.63.1",
41
+ "@squiz/runtime-sandbox-node": "1.63.1",
38
42
  "archiver": "5.3.1",
39
43
  "axios": "1.6.0",
40
44
  "cli-color": "^2.0.2",
41
45
  "open": "^8.4.0",
42
46
  "supertest": "^6.2.3"
43
- },
44
- "gitHead": "5ae8c433076d96683b0a98113f0e69f7c0dd0bff"
47
+ }
45
48
  }
@@ -1,4 +1,5 @@
1
1
  import {
2
+ ComponentRootUrlResolver,
2
3
  ComponentPreviewService,
3
4
  ComponentRunnerServiceWithWorkers,
4
5
  RenderInputService,
@@ -42,6 +43,7 @@ export function startDevelopmentRender(
42
43
  const dataMountPoint = path.resolve(process.cwd(), componentPath);
43
44
 
44
45
  const rootUrl = `http://localhost:${options.port}`;
46
+ const componentRootUrlResolver: ComponentRootUrlResolver = () => rootUrl;
45
47
 
46
48
  const apiKeyService = new DevelopmentApiKeyService();
47
49
  const sandbox = new NodeSandbox({
@@ -54,7 +56,7 @@ export function startDevelopmentRender(
54
56
  },
55
57
  });
56
58
  const componentRunnerService = new ComponentRunnerServiceWithWorkers(sandbox, logger, devComponentLogger);
57
- const componentFunctionService = new ComponentFunctionService(rootUrl);
59
+ const componentFunctionService = new ComponentFunctionService();
58
60
  const componentSetService = new ComponentSetServiceForLocalDev(logger);
59
61
  const manifestService = new ManifestServiceForDev(dataMountPoint, logger);
60
62
  const contentItemService = undefined;
@@ -64,7 +66,7 @@ export function startDevelopmentRender(
64
66
  manifestService,
65
67
  componentFunctionService,
66
68
  contentItemService,
67
- rootUrl,
69
+ componentRootUrlResolver,
68
70
  );
69
71
  const webServer = setupRenderRuntimeServer({
70
72
  logger,
@@ -76,6 +78,7 @@ export function startDevelopmentRender(
76
78
  renderInputService,
77
79
  apiKeyService,
78
80
  sandbox,
81
+ componentRootUrlResolver,
79
82
  });
80
83
 
81
84
  const server = webServer.listen(options.port, () => {
@@ -65,10 +65,13 @@ describe('PageRenderController- Integration', () => {
65
65
  version: DxpSessionVersion.version1,
66
66
  });
67
67
  const page = await pageRenderService.get(`p/${PAGE_CONTENT_ID}`, {
68
- headers: { 'x-dxp-session': mockSession },
68
+ headers: {
69
+ 'x-dxp-session': mockSession,
70
+ 'x-dxp-service-request-url': 'https://mock.url/__dxp/service/page-render',
71
+ },
69
72
  });
70
73
  expect(page.data).toEqual(
71
- `<div class="container"><h1>Hello World!</h1><esi:include src="/__dxp/au/components-render/${process.env.TENANT_ID}/r/unit-test-components/test-page-render/1.0.0/main?_componentSet=${COMPONENT_SET_WEB_PATH}&_contentItemId=${COMPONENT_CONTENT_ID}"/><p>Bottom text</p></div>`,
74
+ `<div class="container"><h1>Hello World!</h1><esi:include src="https://mock.url/__dxp/service/components-render/r/unit-test-components/test-page-render/1.0.0/main?_componentSet=${COMPONENT_SET_WEB_PATH}&_contentItemId=${COMPONENT_CONTENT_ID}"/><p>Bottom text</p></div>`,
72
75
  );
73
76
  });
74
77
 
@@ -169,7 +172,10 @@ describe('PageRenderController- Integration', () => {
169
172
  'renders the matching variation for %s',
170
173
  async (description: string, session: DxpSession, expectedBody: string, expectedCacheAccess: DxpCacheAccess) => {
171
174
  const page = await pageRenderService.get(`p/${PAGE_CONTENT_ID}`, {
172
- headers: { 'x-dxp-session': buildDevelopmentSession(session) },
175
+ headers: {
176
+ 'x-dxp-session': buildDevelopmentSession(session),
177
+ 'x-dxp-service-request-url': 'https://mock.url/__dxp/service/page-render',
178
+ },
173
179
  });
174
180
  const dxpCacheAccess = JSON.parse(Buffer.from(page.headers['x-dxp-cache-access'], 'base64').toString());
175
181