mod-build 4.0.0-alpha.6 → 4.0.0-alpha.7
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
package/tasks/grab-cdn.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { siteData } from '../siteconfig.js'
|
|
2
1
|
import { defaultSettings } from '../src/data/config.js';
|
|
3
|
-
import { templateData } from '../template.js';
|
|
4
2
|
import axios from 'axios';
|
|
5
3
|
import { createWriteStream } from 'node:fs';
|
|
6
4
|
import * as stream from 'node:stream';
|
|
@@ -45,10 +43,9 @@ function streamToDestination(inputPath, destPath, fileName) {
|
|
|
45
43
|
});
|
|
46
44
|
}
|
|
47
45
|
|
|
48
|
-
export default async function(done) {
|
|
46
|
+
export default async function(config, done) {
|
|
49
47
|
const { nodeEnv, isLocal } = defaultSettings;
|
|
50
|
-
const { isQSPage, isWhiteLabel, domain } =
|
|
51
|
-
const { page } = templateData();
|
|
48
|
+
const { isQSPage, isWhiteLabel, domain, page } = config;
|
|
52
49
|
const { themeFile, cssThemes } = page;
|
|
53
50
|
const isModWhiteLabel = isWhiteLabel && !isQSPage
|
|
54
51
|
const domainHasModernize = domain.indexOf('modernize') > -1;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { defaultSettings } from '../src/data/config.js'
|
|
2
|
-
import { siteData } from '../siteconfig.js';
|
|
3
2
|
import axios from 'axios';
|
|
4
3
|
import { createWriteStream } from 'node:fs';
|
|
5
4
|
import * as stream from 'node:stream';
|
|
@@ -7,7 +6,6 @@ import { promisify } from 'node:util';
|
|
|
7
6
|
import fs from 'node:fs';
|
|
8
7
|
|
|
9
8
|
const resourcePath = 'quote/resources/mod-site';
|
|
10
|
-
const componentFolders = siteData.useAccessibleConfig ? ['accessible-components'] : ['shared-components'];
|
|
11
9
|
|
|
12
10
|
const streamSharedCompsToDestination = (defaultSettings, folder, fileName) => {
|
|
13
11
|
const finished = promisify(stream.finished);
|
|
@@ -71,7 +69,8 @@ const getListOfSharedComponents = (defaultSettings, componentFolders) => {
|
|
|
71
69
|
});
|
|
72
70
|
}
|
|
73
71
|
|
|
74
|
-
export default function(done) {
|
|
72
|
+
export default function(config, done) {
|
|
73
|
+
const componentFolders = config.useAccessibleConfig ? ['accessible-components'] : ['shared-components'];
|
|
75
74
|
console.log('running grab-shared-components');
|
|
76
75
|
getListOfSharedComponents(defaultSettings, componentFolders);
|
|
77
76
|
done();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { siteData } from '../siteconfig.js'
|
|
2
1
|
import { defaultSettings } from '../src/data/config.js';
|
|
3
2
|
import axios from 'axios';
|
|
4
3
|
import { createWriteStream } from 'node:fs';
|
|
@@ -238,14 +237,14 @@ function getResource(task, fileNames, resourcePath = 'quote/resources') {
|
|
|
238
237
|
})
|
|
239
238
|
}
|
|
240
239
|
|
|
241
|
-
export default async function(done) {
|
|
240
|
+
export default async function(config, done) {
|
|
242
241
|
const { isLocal } = defaultSettings;
|
|
243
|
-
const isQuotePage = siteData?.
|
|
244
|
-
const useAccessibleComponents = siteData?.
|
|
245
|
-
const useRelativePathForResources = siteData?.
|
|
242
|
+
const isQuotePage = config.siteData?.isQuotePage || config.isQuotePage;
|
|
243
|
+
const useAccessibleComponents = config.siteData?.useAccessibleConfig || config.useAccessibleConfig;
|
|
244
|
+
const useRelativePathForResources = config.siteData?.useRelativePathForResources || config.useRelativePathForResources;
|
|
246
245
|
componentFolderPath = useAccessibleComponents === true ? 'accessible-components' : 'shared-components';
|
|
247
246
|
isQuotePageOrUseRelativePath = isQuotePage === true || useRelativePathForResources === true;
|
|
248
|
-
const isPathSubdirectory = siteData?.
|
|
247
|
+
const isPathSubdirectory = config.siteData?.pathSubdirectory || config.pathSubdirectory;
|
|
249
248
|
pathSubdirectory = !isLocal && isPathSubdirectory ? isPathSubdirectory : '';
|
|
250
249
|
|
|
251
250
|
const tasks = Object.values(TASKS);
|
|
@@ -257,7 +256,7 @@ export default async function(done) {
|
|
|
257
256
|
task.config.mapUrl = 'shared-resources/scripts/abandonment/accessible/abandonment.min.js.map';
|
|
258
257
|
}
|
|
259
258
|
}
|
|
260
|
-
Object.assign(task.config, { defaultSettings,
|
|
259
|
+
Object.assign(task.config, { defaultSettings, config });
|
|
261
260
|
await getResource(task, fileNames);
|
|
262
261
|
});
|
|
263
262
|
|
package/tasks/serve.js
CHANGED
|
@@ -10,4 +10,6 @@ export function done() {
|
|
|
10
10
|
console.log('done');
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
export default
|
|
13
|
+
export default function(config) {
|
|
14
|
+
return gulp.series(clean, () => grabCdn(config), () => grabSharedComponents(config), () => grabSharedScripts(config), () => grabFormHelpers(config), () => templates(config), done);
|
|
15
|
+
}
|