@griddo/cx 1.75.22 → 1.75.23

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/gatsby-node.js CHANGED
@@ -50,7 +50,7 @@ exports.onCreateWebpackConfig = ({ actions, plugins, loaders, getConfig }) => {
50
50
  test: /\.jsx?$/,
51
51
  // Exclude all node_modules from transpilation, except for '@griddo/cx'
52
52
  exclude: modulePath =>
53
- /node_modules/.test(modulePath) && !/\@griddo\/cx/.test(modulePath),
53
+ /node_modules/.test(modulePath) && !/@griddo\/cx/.test(modulePath),
54
54
  },
55
55
  ];
56
56
  actions.replaceWebpackConfig(config);
@@ -190,7 +190,7 @@ exports.createPages = async ({ actions }) => {
190
190
  // Template data with the distributor data added.
191
191
  const distributorTemplate = await DistributorService.getDistributorData(
192
192
  page,
193
- renderId,
193
+ renderId
194
194
  );
195
195
 
196
196
  additionalInfo.navigations = NavService.getPageNavigations(page);
@@ -204,27 +204,27 @@ exports.createPages = async ({ actions }) => {
204
204
  // Multi-page (pagination) or single-page
205
205
  isList
206
206
  ? await utils.renderListPages(
207
- {
208
- rootPage: page,
209
- pages: utils.getList(distributorTemplate),
210
- isRoot: false,
211
- defaultLang,
212
- distributorTemplate,
213
- },
214
- additionalInfo,
215
- actions.createPage
216
- )
207
+ {
208
+ rootPage: page,
209
+ pages: utils.getList(distributorTemplate),
210
+ isRoot: false,
211
+ defaultLang,
212
+ distributorTemplate,
213
+ },
214
+ additionalInfo,
215
+ actions.createPage
216
+ )
217
217
  : await utils.renderPage(
218
- {
219
- ...page,
220
- template: distributorTemplate,
221
- isRoot: false,
222
- defaultLang,
223
- multiPageElements,
224
- },
225
- additionalInfo,
226
- actions.createPage
227
- );
218
+ {
219
+ ...page,
220
+ template: distributorTemplate,
221
+ isRoot: false,
222
+ defaultLang,
223
+ multiPageElements,
224
+ },
225
+ additionalInfo,
226
+ actions.createPage
227
+ );
228
228
 
229
229
  buildProcessData[siteId].publishHashes.push(page.hash);
230
230
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@griddo/cx",
3
3
  "description": "Griddo SSG based on Gatsby",
4
- "version": "1.75.22",
4
+ "version": "1.75.23",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Carlos Torres <carlos.torres@secuoyas.com>",
@@ -65,7 +65,7 @@
65
65
  "react-helmet": "^6.0.0"
66
66
  },
67
67
  "devDependencies": {
68
- "@griddo/eslint-config-back": "^1.75.22",
68
+ "@griddo/eslint-config-back": "^1.75.23",
69
69
  "eslint": "^7.5.0",
70
70
  "eslint-plugin-node": "^11.1.0",
71
71
  "eslint-plugin-react": "7.14.3",
@@ -97,5 +97,5 @@
97
97
  "publishConfig": {
98
98
  "access": "public"
99
99
  },
100
- "gitHead": "4d9de71e8a7f6da4e2dedd3d1d8455ba9611e446"
100
+ "gitHead": "086dbbc523cafbe0d2ec3791078b7d8add1cb0de"
101
101
  }
@@ -55,9 +55,12 @@ const logWarning = (...message) => helpers.log('warning', ...message);
55
55
  // Main Stuff
56
56
  // -----------------------------------------------------------------------------
57
57
  const runExportDomain = async domain => {
58
+ const assetPrefix = getAssetPrefix(domain);
59
+
58
60
  const run = getEnvRunner({
59
61
  DOMAIN: domain,
60
- ASSET_PREFIX: getAssetPrefix(domain),
62
+ ASSET_PREFIX: assetPrefix,
63
+ HAS_ASSET_DOMAIN: assetPrefix && assetPrefix !== '',
61
64
  RENDERID: new Date().valueOf(),
62
65
  });
63
66
  const domainDestDirPath = path.resolve(destDirPath, domain);
@@ -45,6 +45,8 @@ const updateDist = async () => {
45
45
  const src = './public';
46
46
  const dest = './dist';
47
47
 
48
+ const domainDestPath = `${dest}/${process.env.DOMAIN}`;
49
+
48
50
  const files = fs
49
51
  .readdirSync(src)
50
52
  .filter(
@@ -62,16 +64,20 @@ const updateDist = async () => {
62
64
  const gatsbyStaticDest = `${assetsDest}/static`;
63
65
 
64
66
  try {
67
+ fs.mkdirSync(assetsDest, { recursive: true });
65
68
  fs.copySync(src, dest);
66
- fs.copySync(projectStaticSrc, projectStaticDest);
67
- fs.copySync(pageDataSrc, pageDataDest);
68
- fs.copySync(gatsbyStaticSrc, gatsbyStaticDest);
69
-
70
- files.map(async file => {
71
- const fileSrc = `${src}/${file}`;
72
- const fileDest = `${assetsDest}/${file}`;
73
- fs.copySync(fileSrc, fileDest);
74
- });
69
+ if (process.env.HAS_ASSET_DOMAIN) {
70
+ fs.copySync(pageDataSrc, pageDataDest);
71
+ fs.copySync(projectStaticSrc, projectStaticDest);
72
+ fs.copySync(gatsbyStaticSrc, gatsbyStaticDest);
73
+ fs.copySync(projectStaticSrc, domainDestPath);
74
+
75
+ files.map(async file => {
76
+ const fileSrc = `${src}/${file}`;
77
+ const fileDest = `${assetsDest}/${file}`;
78
+ fs.copySync(fileSrc, fileDest);
79
+ });
80
+ }
75
81
 
76
82
  if (isGriddoExporter) fs.rmSync(src, { recursive: true });
77
83