@madgex/fert 1.5.3 → 1.6.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.
package/README.md CHANGED
@@ -71,6 +71,7 @@ e.g.
71
71
  | --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
72
72
  | `clientPropertyId` <String> | The `clientPropertyId` associated with the branding repo (required) |
73
73
  | `entry` <String> | The JavaScript entry file. Any assets (CSS/SCSS/SVGs) included will be processed and be part of the output. Defaults to `['src/index.js']` |
74
+ | `assumeSite` <String> | Which site we want to display, jobseeker site or recruiter site. Values are either `js` or `rs`.
74
75
 
75
76
  The `entry` will be used by Vite to create production bundles.
76
77
 
@@ -80,6 +81,7 @@ e.g.
80
81
  module.exports = {
81
82
  clientPropertyId: "ff6102ff-0f4b-43d1-a2c7-83b835b8dee5",
82
83
  entry: "./src/index.js",
84
+ assumeSite: "js",
83
85
  };
84
86
  ```
85
87
 
@@ -211,22 +213,4 @@ Here are the default npm scripts in a Fert-scaffolded project.
211
213
  }
212
214
  ```
213
215
 
214
- Its expected that a Jenkins pipeline will run `fert publish` to send all built assets to the Asset Store API.
215
-
216
-
217
-
218
- # @madgex/boilerplate-utils
219
-
220
- A collection of utilities for use in branding projects, e.g.
221
-
222
- * Hamburger nav HTML/CSS/JS
223
-
224
- * common SCSS
225
-
226
- * SVGs
227
-
228
- * templates/macros
229
-
230
- If needed, this package can be `npm install`ed in the branding project & consumed from the JS/SCSS.
231
-
232
- Templates/macros will have to be copied into the branding repo as they won't be visible/available to the server rendering the template.
216
+ Its expected that a Jenkins pipeline will run `fert publish` to send all built assets to the Asset Store API.
package/bin/cli.js CHANGED
@@ -18,6 +18,10 @@ const run = () => {
18
18
  .option('--open', 'Automatically open the dev server in your browser')
19
19
  .option('--host [host]', '[string] specify hostname')
20
20
  .option('--port <port>', '[number] specify port')
21
+ .option(
22
+ '--assume-site [site]',
23
+ 'Use jobseeker or recruiter site, "js" or "rs"'
24
+ )
21
25
  .action((...args) => require('./commands/dev-server')(...args));
22
26
 
23
27
  cli
@@ -17,7 +17,9 @@ module.exports = async (root, options = {}) => {
17
17
  console.log(
18
18
  `Starting branding server for ${chalk.green(
19
19
  fertConfig.client.brandName
20
- )} ${chalk.dim(`(${fertConfig.clientPropertyId})`)}\n`
20
+ )} [${fertConfig.assumeSite}] ${chalk.dim(
21
+ `(${fertConfig.clientPropertyId})`
22
+ )}\n`
21
23
  );
22
24
 
23
25
  // watch brand.json & fert.config.js - refresh on change
@@ -1,7 +1,7 @@
1
1
  const path = require('path');
2
2
  const fs = require('fs');
3
3
  const fsp = require('fs/promises');
4
- const { VERSION } = require('../../constants');
4
+ const { VERSION, SITE } = require('../../constants');
5
5
  const chalk = require('chalk');
6
6
  const uuidValidator = require('uuid-validate');
7
7
  const Hoek = require('@hapi/hoek');
@@ -36,6 +36,9 @@ exports.resolveConfig = async (root, options = {}) => {
36
36
 
37
37
  fertConfig.externalAssets = resolveExternalAssets(fertConfig.externalAssets);
38
38
 
39
+ fertConfig.assumeSite =
40
+ SITE[options.assumeSite] || SITE[fertConfig.assumeSite] || SITE.js;
41
+
39
42
  return {
40
43
  ...fertConfig,
41
44
  workingDir,
package/constants.js CHANGED
@@ -34,4 +34,8 @@ module.exports = {
34
34
  display: 'BigWorkBag - populated, example project',
35
35
  },
36
36
  ],
37
+ SITE: {
38
+ js: 'jobseekers-frontend',
39
+ rs: 'recruiterservices-frontend',
40
+ },
37
41
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madgex/fert",
3
- "version": "1.5.3",
3
+ "version": "1.6.0",
4
4
  "description": "Tool to help build the V6 branding",
5
5
  "bin": {
6
6
  "fert": "./bin/cli.js"
package/server/index.js CHANGED
@@ -40,6 +40,7 @@ exports.devServer = async ({ start, fertConfig = {} } = {}) => {
40
40
  templatePath: [path.resolve(fertConfig.workingDir, 'templates')],
41
41
  clientPropertiesApi: PROPERTY_ID_API,
42
42
  assetsApiUrl: ASSETS_API_URL,
43
+ layout: fertConfig.assumeSite,
43
44
  },
44
45
  routes: { prefix: '/_podlet' },
45
46
  });