@madgex/fert 7.0.1 → 7.0.3

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.
@@ -10,8 +10,10 @@ import { getAssetsPath } from '../utils/get-assets-path.js';
10
10
  import {
11
11
  ASSET_STORE_API,
12
12
  AWS_PARAM_NAME,
13
+ REMOTE_UPLOAD_BASE_OLD,
13
14
  REMOTE_UPLOAD_BASE,
14
15
  UPLOAD_DIR,
16
+ ASSET_STORE_INVALIDATION_PATH_OLD,
15
17
  ASSET_STORE_INVALIDATION_PATH,
16
18
  } from '../../constants.js';
17
19
 
@@ -38,10 +40,22 @@ export async function publish(options) {
38
40
  fertConfig,
39
41
  };
40
42
 
43
+ /**
44
+ * As we are using production service to store both prod & dev versions.
45
+ * In our transition period, production assets are still uploaded into the "root" dir using `_OLD` constants.
46
+ * Dev assets are uploading to a sub folder "/dev", its environment name "dev".
47
+ *
48
+ * TODO: remove `_OLD` constants, move production assets to `/production` env folder https://jira.wiley.com/browse/MP-216
49
+ */
50
+ const isProd = options.target === 'production';
51
+ const remoteBasePath = Hoek.reachTemplate(templateCtx, isProd ? REMOTE_UPLOAD_BASE_OLD : REMOTE_UPLOAD_BASE);
52
+ const assetStoreInvPath = Hoek.reachTemplate(
53
+ templateCtx,
54
+ isProd ? ASSET_STORE_INVALIDATION_PATH_OLD : ASSET_STORE_INVALIDATION_PATH,
55
+ );
56
+
41
57
  const localDir = path.resolve(fertConfig.workingDir, UPLOAD_DIR);
42
- const remoteBasePath = Hoek.reachTemplate(templateCtx, REMOTE_UPLOAD_BASE);
43
58
  const apiKeyParamPath = Hoek.reachTemplate(templateCtx, AWS_PARAM_NAME);
44
- const assetStoreInvPath = Hoek.reachTemplate(templateCtx, ASSET_STORE_INVALIDATION_PATH);
45
59
 
46
60
  const apiKey = await getAwsParam(apiKeyParamPath);
47
61
 
@@ -38,7 +38,7 @@ export async function getAssetsPath(fertConfig, environment) {
38
38
  const data = await response.json();
39
39
  const { publicUrl } = Array.isArray(data) ? data[0] : data;
40
40
 
41
- // TODO: temporarily removing environment for production until all repos are on new version
41
+ // TODO: temporarily removing environment for production until all repos are on new version https://jira.wiley.com/browse/MP-216
42
42
  // return new URL(`${publicUrl}/${environment}`);
43
43
  return new URL(`${publicUrl}${environment === 'dev' ? '/dev' : ''}`);
44
44
  }
package/constants.js CHANGED
@@ -35,12 +35,16 @@ export const AWS_PARAM_NAME =
35
35
  '/production/jobboard/kong/internal/consumer-key/jobseekers-frontend_{fertConfig.client.rootClientPropertyId}';
36
36
  /**
37
37
  * important to have the correct service name and cpid so assets are uploaded to the correct unique place per-service.
38
+ * TODO: remove `_OLD` constants, move production assets to `/production` env folder https://jira.wiley.com/browse/MP-216
38
39
  */
40
+ export const REMOTE_UPLOAD_BASE_OLD = '/api/assets/{fertConfig.serviceName}/{fertConfig.clientPropertyId}';
39
41
  export const REMOTE_UPLOAD_BASE = '/api/assets/{fertConfig.serviceName}/{fertConfig.clientPropertyId}/{env}';
40
42
  /**
41
43
  * invalidates the real asset store key path, which is related to `REMOTE_UPLOAD_BASE`
42
44
  * asset-store puts things in `rootClientPropertyId` based on the AWS_PARAM_NAME used, and the rest of the path relates to `REMOTE_UPLOAD_BASE`
45
+ * TODO: remove `_OLD` constants, move production assets to `/production` env folder https://jira.wiley.com/browse/MP-216
43
46
  */
47
+ export const ASSET_STORE_INVALIDATION_PATH_OLD = `/{fertConfig.client.rootClientPropertyId}/{fertConfig.serviceName}/{fertConfig.clientPropertyId}/*`;
44
48
  export const ASSET_STORE_INVALIDATION_PATH = `/{fertConfig.client.rootClientPropertyId}/{fertConfig.serviceName}/{fertConfig.clientPropertyId}/{env}/*`;
45
49
 
46
50
  export const ASSET_STORE_USER_GUID = 'a386d4b6-f2df-4b80-ad1f-0349e23f530b';
@@ -59,22 +63,24 @@ export const MOCK_AUTH_OBJECT = {
59
63
  username: 'Samus Aran',
60
64
  },
61
65
  artifacts: {
62
- recruiters: [
63
- {
64
- id: 1,
65
- name: 'Recruiter 1',
66
- basketCount: 0,
67
- isPrimary: true,
68
- hasCredits: true,
69
- },
70
- {
71
- id: 2,
72
- name: 'Recruiter 2',
73
- basketCount: 0,
74
- isPrimary: false,
75
- hasCredits: false,
76
- },
77
- ],
66
+ recruiterSummary: {
67
+ recruiters: [
68
+ {
69
+ id: 1,
70
+ name: 'Recruiter 1',
71
+ basketCount: 0,
72
+ isPrimary: true,
73
+ hasCredits: true,
74
+ },
75
+ {
76
+ id: 2,
77
+ name: 'Recruiter 2',
78
+ basketCount: 0,
79
+ isPrimary: false,
80
+ hasCredits: false,
81
+ },
82
+ ],
83
+ },
78
84
  },
79
85
  },
80
86
  'jobseekers-frontend': {
package/package.json CHANGED
@@ -1,78 +1,78 @@
1
- {
2
- "name": "@madgex/fert",
3
- "version": "7.0.1",
4
- "description": "Tool to help build the V6 branding",
5
- "bin": {
6
- "fert": "./bin/cli.js"
7
- },
8
- "type": "module",
9
- "scripts": {
10
- "lint": "eslint .",
11
- "format": "prettier --write .",
12
- "lint-staged": "lint-staged",
13
- "semantic-release": "semantic-release",
14
- "test": "node --test --experimental-test-module-mocks \"./bin/**/*.test.js\"",
15
- "prepare": "husky"
16
- },
17
- "repository": {
18
- "type": "git",
19
- "url": "https://github.com/wiley/madgex-frontend-rollout-tool.git"
20
- },
21
- "engines": {
22
- "node": ">=22.3"
23
- },
24
- "author": "Madgex",
25
- "license": "UNLICENSED",
26
- "dependencies": {
27
- "@aws-sdk/client-cloudfront": "^3.857.0",
28
- "@aws-sdk/client-ssm": "^3.857.0",
29
- "@hapi/hapi": "^21.4.0",
30
- "@hapi/hoek": "^11.0.7",
31
- "@hapi/inert": "^7.1.0",
32
- "@hapi/vision": "^7.0.3",
33
- "@hapipal/toys": "^4.0.0",
34
- "@madgex/config-api-sdk": "^1.11.0",
35
- "@madgex/design-system": "^10.1.2",
36
- "@private/header-footer-podlet-server": "github:wiley/madgex-header-footer-podlet",
37
- "axios": "^1.11.0",
38
- "cac": "^6.7.14",
39
- "chalk": "^5.4.1",
40
- "chokidar4": "npm:chokidar@^4.0.3",
41
- "debug": "^4.4.1",
42
- "dedent": "^1.6.0",
43
- "find-up-simple": "^1.0.1",
44
- "flat-cache": "^6.1.12",
45
- "form-data": "^4.0.4",
46
- "joi": "^17.13.3",
47
- "lodash": "^4.17.21",
48
- "nunjucks": "^3.2.4",
49
- "open": "8.4.2",
50
- "ora": "5.4.1",
51
- "prompts": "^2.4.2",
52
- "rimraf": "^6.0.1",
53
- "sass": "^1.89.2",
54
- "simple-git": "^3.28.0",
55
- "simple-update-notifier": "^2.0.0",
56
- "uuid-validate": "^0.0.3",
57
- "vite": "^6.3.5",
58
- "vite-plugin-static-copy": "^2.3.1"
59
- },
60
- "devDependencies": {
61
- "@commitlint/cli": "^19.8.1",
62
- "@commitlint/config-conventional": "^19.8.1",
63
- "@madgex/eslint-config-madgex": "^2.3.0",
64
- "@madgex/prettier-config-madgex": "^2.0.0",
65
- "eslint": "^9.32.0",
66
- "husky": "^9.1.7",
67
- "lint-staged": "^16.1.2",
68
- "prettier": "^3.6.2",
69
- "semantic-release": "^24.2.7"
70
- },
71
- "lint-staged": {
72
- "*.{js,json}": [
73
- "prettier --write",
74
- "eslint --cache --fix",
75
- "eslint"
76
- ]
77
- }
78
- }
1
+ {
2
+ "name": "@madgex/fert",
3
+ "version": "7.0.3",
4
+ "description": "Tool to help build the V6 branding",
5
+ "bin": {
6
+ "fert": "./bin/cli.js"
7
+ },
8
+ "type": "module",
9
+ "scripts": {
10
+ "lint": "eslint .",
11
+ "format": "prettier --write .",
12
+ "lint-staged": "lint-staged",
13
+ "semantic-release": "semantic-release",
14
+ "test": "node --test --experimental-test-module-mocks \"./bin/**/*.test.js\"",
15
+ "prepare": "husky"
16
+ },
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "https://github.com/wiley/madgex-frontend-rollout-tool.git"
20
+ },
21
+ "engines": {
22
+ "node": ">=22.16"
23
+ },
24
+ "author": "Madgex",
25
+ "license": "UNLICENSED",
26
+ "dependencies": {
27
+ "@aws-sdk/client-cloudfront": "3.896.0",
28
+ "@aws-sdk/client-ssm": "3.896.0",
29
+ "@hapi/hapi": "21.4.3",
30
+ "@hapi/hoek": "11.0.7",
31
+ "@hapi/inert": "7.1.0",
32
+ "@hapi/vision": "7.0.3",
33
+ "@hapipal/toys": "4.0.0",
34
+ "@madgex/config-api-sdk": "1.12.8",
35
+ "@madgex/design-system": "12.0.2",
36
+ "@private/header-footer-podlet-server": "github:wiley/madgex-header-footer-podlet",
37
+ "axios": "1.12.2",
38
+ "cac": "6.7.14",
39
+ "chalk": "5.6.2",
40
+ "chokidar4": "npm:chokidar@4.0.3",
41
+ "debug": "4.4.3",
42
+ "dedent": "1.7.0",
43
+ "find-up-simple": "1.0.1",
44
+ "flat-cache": "6.1.14",
45
+ "form-data": "4.0.4",
46
+ "joi": "17.13.3",
47
+ "lodash": "4.17.21",
48
+ "nunjucks": "3.2.4",
49
+ "open": "8.4.2",
50
+ "ora": "5.4.1",
51
+ "prompts": "2.4.2",
52
+ "rimraf": "6.0.1",
53
+ "sass": "1.93.2",
54
+ "simple-git": "3.28.0",
55
+ "simple-update-notifier": "2.0.0",
56
+ "uuid-validate": "0.0.3",
57
+ "vite": "7.1.7",
58
+ "vite-plugin-static-copy": "3.1.2"
59
+ },
60
+ "devDependencies": {
61
+ "@commitlint/cli": "19.8.1",
62
+ "@commitlint/config-conventional": "19.8.1",
63
+ "@madgex/eslint-config-madgex": "2.3.0",
64
+ "@madgex/prettier-config-madgex": "2.0.0",
65
+ "eslint": "9.36.0",
66
+ "husky": "9.1.7",
67
+ "lint-staged": "16.2.1",
68
+ "prettier": "3.6.2",
69
+ "semantic-release": "24.2.9"
70
+ },
71
+ "lint-staged": {
72
+ "*.{js,json}": [
73
+ "prettier --write",
74
+ "eslint --cache --fix",
75
+ "eslint"
76
+ ]
77
+ }
78
+ }