@squiz/component-cli-lib 1.69.1 → 1.70.0

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 (68) hide show
  1. package/lib/index.js +63 -63
  2. package/lib/index.js.map +2 -2
  3. package/package.json +10 -7
  4. package/.env.example +0 -11
  5. package/.gitlab-ci.yml +0 -141
  6. package/CHANGELOG.md +0 -664
  7. package/build.js +0 -28
  8. package/jest.config.ts +0 -28
  9. package/jest.integration.config.ts +0 -27
  10. package/job-runner-lib.tgz +0 -0
  11. package/lib/job-runner-lib.tgz +0 -0
  12. package/localStart.ts +0 -11
  13. package/src/component-dev-folder-structures.integration.spec.ts +0 -91
  14. package/src/component-dev.integration.spec.ts +0 -71
  15. package/src/component-dev.ts +0 -102
  16. package/src/component-edge-dev.ts +0 -75
  17. package/src/component-init.spec.ts +0 -258
  18. package/src/component-init.ts +0 -81
  19. package/src/index.ts +0 -5
  20. package/src/integration-tests/__components__/big-package/manifest.json +0 -36
  21. package/src/integration-tests/__components__/big-package/render-json.js +0 -5
  22. package/src/integration-tests/__components__/cmp-format-string/main.js +0 -7
  23. package/src/integration-tests/__components__/cmp-format-string/manifest.json +0 -41
  24. package/src/integration-tests/__components__/cmp-no-api-key/main.js +0 -25
  25. package/src/integration-tests/__components__/cmp-no-api-key/manifest.json +0 -41
  26. package/src/integration-tests/__components__/cmp-property-order/main.js +0 -6
  27. package/src/integration-tests/__components__/cmp-property-order/manifest.json +0 -60
  28. package/src/integration-tests/__components__/cmp-static-file-test/main.js +0 -6
  29. package/src/integration-tests/__components__/cmp-static-file-test/manifest.json +0 -42
  30. package/src/integration-tests/__components__/cmp-static-file-test/public/static-library-file.js +0 -1
  31. package/src/integration-tests/__components__/invalid-manifest/main.js +0 -3
  32. package/src/integration-tests/__components__/invalid-manifest/manifest.json +0 -29
  33. package/src/integration-tests/__components__/invalid-upload/main.js +0 -3
  34. package/src/integration-tests/__components__/matrix-asset-uri/main.js +0 -7
  35. package/src/integration-tests/__components__/matrix-asset-uri/manifest.json +0 -42
  36. package/src/integration-tests/__components__/test-page-render/main.js +0 -3
  37. package/src/integration-tests/__components__/test-page-render/manifest.json +0 -46
  38. package/src/integration-tests/__components__/test-page-render/public/static-library-script.js +0 -1
  39. package/src/integration-tests/__components__/test-page-render/public/static-library-styles.css +0 -3
  40. package/src/integration-tests/__jobs__/invalid-manifest/main.js +0 -3
  41. package/src/integration-tests/__jobs__/invalid-manifest/manifest.json +0 -28
  42. package/src/integration-tests/__jobs__/invalid-upload/main.js +0 -3
  43. package/src/integration-tests/__jobs__/simple-job/main.js +0 -3
  44. package/src/integration-tests/__jobs__/simple-job/manifest.json +0 -25
  45. package/src/integration-tests/helper.ts +0 -227
  46. package/src/integration-tests/service-deployment.integration.spec.ts +0 -74
  47. package/src/integration-tests/test-setup.ts +0 -1
  48. package/src/upload-component-folder.ts +0 -130
  49. package/src/upload-job.ts +0 -101
  50. package/src/utils.spec.ts +0 -370
  51. package/src/utils.ts +0 -149
  52. package/templates/advanced/build.js +0 -43
  53. package/templates/advanced/main.js +0 -3
  54. package/templates/advanced/manifest.json +0 -60
  55. package/templates/advanced/package-lock.json +0 -916
  56. package/templates/advanced/package.json +0 -11
  57. package/templates/advanced/previews/example.data.json +0 -1
  58. package/templates/advanced/previews/preview.html +0 -9
  59. package/templates/advanced/static/default.js +0 -1
  60. package/templates/advanced/static/default.scss +0 -1
  61. package/templates/basic/main.js +0 -3
  62. package/templates/basic/manifest.json +0 -62
  63. package/templates/basic/previews/example.data.json +0 -1
  64. package/templates/basic/previews/preview.html +0 -9
  65. package/templates/basic/static/default.css +0 -1
  66. package/templates/basic/static/default.js +0 -1
  67. package/tsconfig.json +0 -26
  68. package/tsconfig.tsbuildinfo +0 -1
package/package.json CHANGED
@@ -1,14 +1,17 @@
1
1
  {
2
2
  "name": "@squiz/component-cli-lib",
3
- "version": "1.69.1",
3
+ "version": "1.70.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "private": false,
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
10
+ "files": [
11
+ "lib"
12
+ ],
10
13
  "scripts": {
11
- "compile": "node build.js && tsc && cp ./job-runner-lib.tgz ./lib/job-runner-lib.tgz",
14
+ "compile": "node build.js && tsc",
12
15
  "test": "jest -c jest.config.ts",
13
16
  "test:integration": "jest -c jest.integration.config.ts",
14
17
  "clean": "rimraf \"tsconfig.tsbuildinfo\" \"./lib\"",
@@ -17,7 +20,7 @@
17
20
  "author": "",
18
21
  "license": "ISC",
19
22
  "devDependencies": {
20
- "@squiz/component-lib": "^1.78.1",
23
+ "@squiz/component-lib": "^1.78.2",
21
24
  "@squiz/component-web-api-lib": "^1.65.1",
22
25
  "@squiz/dx-common-lib": "^1.68.3",
23
26
  "@squiz/dx-json-schema-lib": "^1.76.1",
@@ -37,10 +40,10 @@
37
40
  "typescript": "4.9.4"
38
41
  },
39
42
  "dependencies": {
40
- "@squiz/edge-dev-render-runtime-lib": "^2.2.1",
41
- "@squiz/job-runner-lib": "file:job-runner-lib.tgz",
42
- "@squiz/render-runtime-lib": "^1.76.0",
43
- "@squiz/runtime-sandbox-node": "^1.64.2",
43
+ "@squiz/edge-dev-render-runtime-lib": "2.3.0",
44
+ "@squiz/job-runner-lib": "1.66.1",
45
+ "@squiz/render-runtime-lib": "1.77.0",
46
+ "@squiz/runtime-sandbox-node": "1.64.2",
44
47
  "archiver": "5.3.1",
45
48
  "axios": "1.7.4",
46
49
  "cli-color": "^2.0.2",
package/.env.example DELETED
@@ -1,11 +0,0 @@
1
- CI_COMMIT_SHORT_SHA=undefined
2
- CI_COMMIT_REF_NAME=undefined
3
-
4
- COMPONENT_MANAGEMENT_SERVICE_URL=http://localhost:3010
5
- CONTENT_API_URL=http://localhost:3020
6
- COMPONENT_RENDER_SERVICE_URL=http://localhost:3000
7
- PAGE_RENDER_SERVICE_URL=http://localhost:3030
8
- JOB_SERVICE_URL=https://localhost:3040
9
-
10
- SQUIZ_REGION=au
11
- DEPLOYMENT_ENVIRONMENT=dev
package/.gitlab-ci.yml DELETED
@@ -1,141 +0,0 @@
1
- ---
2
-
3
- .rules:when-production:
4
- rules:
5
- - if: $CI_DEPLOY_TO_PROD && $CI_COMMIT_REF_NAME == $TARGET_BRANCH_PRODUCTION
6
- when: on_success
7
-
8
- .rules:when-uat:
9
- rules:
10
- - if: $CI_COMMIT_REF_NAME == $TARGET_BRANCH_UAT && $CI_DEPLOY_TO_PROD == null
11
- when: on_success
12
-
13
- .rules:when-development:
14
- rules:
15
- - if: $CI_COMMIT_REF_NAME == $TARGET_BRANCH_DEVELOPMENT && $CI_DEPLOY_TO_PROD == null
16
- when: on_success
17
-
18
- .rules:when-other-branch:
19
- rules:
20
- - if: $CI_COMMIT_REF_NAME != $TARGET_BRANCH_DEVELOPMENT && $CI_COMMIT_REF_NAME != $TARGET_BRANCH_UAT && $CI_COMMIT_REF_NAME != $TARGET_BRANCH_PRODUCTION && $CI_DEPLOY_TO_PROD == null
21
- when: on_success
22
-
23
- .get-service-urls:
24
- stage: smoke-test-setup
25
- image:
26
- name: $IMAGE_AWS_CLI
27
- entrypoint: [""]
28
- tags:
29
- - ec2glr/aws-dx-np
30
- script:
31
- - echo "Configuring service URLs"
32
- - |2
33
- echo -n "Getting 'COMPONENT_MANAGEMENT_SERVICE_URL' from CloudFormation stack: 'dx-${DEPLOYMENT_LABEL}-cmp' output: 'managementServiceURL'... "
34
- 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)"
35
- [[ $COMPONENT_MANAGEMENT_SERVICE_URL ]] || {
36
- echo "✘";
37
- echo "COMPONENT_MANAGEMENT_SERVICE_URL is empty or unset";
38
- exit 1;
39
- }
40
- echo "✔︎"
41
- - |2
42
- echo -n "Getting 'COMPONENT_RENDER_SERVICE_URL' from CloudFormation stack: 'dx-${DEPLOYMENT_LABEL}-cmp' output: 'renderServiceURL'... "
43
- 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)
44
- [[ $COMPONENT_RENDER_SERVICE_URL ]] || {
45
- echo "✘";
46
- echo "COMPONENT_RENDER_SERVICE_URL is empty or unset";
47
- exit 1;
48
- }
49
- echo "✔︎"
50
- - |2
51
- echo -n "Getting 'CONTENT_API_URL' from CloudFormation stack: 'dx-${DEPLOYMENT_LABEL}-cmp' output: 'contentServiceURL'... "
52
- CONTENT_API_URL="$(aws --region $AWS_REGION cloudformation describe-stacks --stack-name dx-${DEPLOYMENT_LABEL}-cmp --max-items 1 --query "Stacks[].Outputs[?contains(OutputKey,'contentServiceURL')].OutputValue" --output text)"
53
- [[ $CONTENT_API_URL ]] || {
54
- echo "✘";
55
- echo "CONTENT_API_URL is empty or unset";
56
- exit 1;
57
- }
58
- echo "✔︎"
59
- - echo "COMPONENT_MANAGEMENT_SERVICE_URL=${COMPONENT_MANAGEMENT_SERVICE_URL}" >> dot.env
60
- - echo "COMPONENT_RENDER_SERVICE_URL=${COMPONENT_RENDER_SERVICE_URL}" >> dot.env
61
- - echo "CONTENT_API_URL=${CONTENT_API_URL}" >> dot.env
62
- - >2
63
- echo "COMPONENT_MANAGEMENT_SERVICE_URL now has value: '${COMPONENT_MANAGEMENT_SERVICE_URL}'
64
- and will be inherited by other jobs via \"dotenv\" artifact"
65
- - >2
66
- echo "COMPONENT_RENDER_SERVICE_URL now has value: '${COMPONENT_RENDER_SERVICE_URL}'
67
- and will be inherited by other jobs via \"dotenv\" artifact"
68
- - >2
69
- echo "CONTENT_API_URL now has value: '${CONTENT_API_URL}'
70
- and will be inherited by other jobs via \"dotenv\" artifact"
71
- artifacts:
72
- reports:
73
- dotenv: dot.env
74
-
75
- # Disabling smoke tests as they will require an authenticated user
76
- # TODO See DEVX-622
77
- .smoke-test:
78
- stage: smoke-test
79
- # tags:
80
- # - size/l
81
- script:
82
- - npm ci
83
- - npm run bootstrap -- --ci
84
- - npm run compile
85
- - cd packages/component-cli-lib
86
- - npm run test:integration
87
- retry:
88
- max: 2
89
- when:
90
- - runner_system_failure
91
- - stuck_or_timeout_failure
92
-
93
- smoke-test:development:
94
- extends:
95
- - .smoke-test
96
- - .rules:when-development
97
-
98
- smoke-test:uat:
99
- extends:
100
- - .smoke-test
101
- - .rules:when-uat
102
-
103
- smoke-test:production:
104
- extends:
105
- - .smoke-test
106
- - .rules:when-production
107
-
108
- # TODO: Do we need this running for feature branches?
109
- # get-branch-service-urls:
110
- # extends:
111
- # - .rules:when-other-branch
112
- # - .get-service-urls
113
- # environment:
114
- # name: non-production-development
115
- # url: components.dev.dx.squiz.cloud
116
-
117
- get-development-service-urls:
118
- extends:
119
- - .rules:when-development
120
- - .get-service-urls
121
- environment:
122
- name: non-production-development
123
- url: components.dev.dx.squiz.cloud
124
-
125
- get-uat-service-urls:
126
- extends:
127
- - .rules:when-uat
128
- - .get-service-urls
129
- environment:
130
- name: non-production-uat
131
- url: components.stg.dx.squiz.cloud
132
-
133
- get-production-service-urls:
134
- extends:
135
- - .rules:when-production
136
- - .get-service-urls
137
- environment:
138
- name: production
139
- url: components.prod.dx.squiz.cloud
140
- tags:
141
- - ec2glr/aws-dx-p