mod-build 4.0.79-beta.1 → 4.0.80-beta.1
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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/tasks/grab-jsdoc.js +125 -0
- package/tasks/serve.js +2 -0
- package/package-loc1k copy.json +0 -35281
- package/package-lock copy2.json +0 -35281
- package/public/resources/scripts/helpers/additionalOpts.min.js +0 -2
- package/public/resources/scripts/helpers/additionalOpts.min.js.map +0 -1
- package/public/resources/scripts/helpers/calls-only.min.js +0 -2
- package/public/resources/scripts/helpers/calls-only.min.js.map +0 -1
- package/public/resources/scripts/helpers/getPhoneAssignmentData.min.js +0 -2
- package/public/resources/scripts/helpers/getPhoneAssignmentData.min.js.map +0 -1
- package/public/resources/scripts/helpers/initNumericOnlyFields.min.js +0 -2
- package/public/resources/scripts/helpers/initNumericOnlyFields.min.js.map +0 -0
- package/public/resources/scripts/helpers/initQSForm.min.js +0 -0
- package/public/resources/scripts/helpers/initQSForm.min.js.map +0 -0
- package/public/resources/scripts/helpers/initQuadTransform.min.js +0 -0
- package/public/resources/scripts/helpers/initQuadTransform.min.js.map +0 -0
- package/public/resources/scripts/helpers/isZipCodeValid.min.js +0 -0
- package/public/resources/scripts/helpers/isZipCodeValid.min.js.map +0 -0
- package/public/resources/scripts/helpers/opts.min.js +0 -0
- package/public/resources/scripts/helpers/opts.min.js.map +0 -0
- package/public/resources/scripts/trusted-form.hbs +0 -38
- package/public/resources/scripts/trusted-form.html +0 -38
- package/src/resources/data/tcpa.json +0 -4
- package/src/resources/templates/modals/about/index.hbs +0 -9
- package/src/resources/templates/modals/about/index.html +0 -9
- package/src/resources/templates/modals/contact-us/index.hbs +0 -348
- package/src/resources/templates/modals/contact-us/index.html +0 -348
- package/src/resources/templates/modals/e-sign-consent/index.hbs +0 -35
- package/src/resources/templates/modals/e-sign-consent/index.html +0 -35
- package/src/resources/templates/modals/faq/index.hbs +0 -9
- package/src/resources/templates/modals/faq/index.html +0 -9
- package/src/resources/templates/modals/privacy/index.hbs +0 -238
- package/src/resources/templates/modals/privacy/index.html +0 -238
- package/src/resources/templates/modals/terms/index.hbs +0 -166
- package/src/resources/templates/modals/terms/index.html +0 -166
- package/src/shared-components/call-tracking/_call-tracking.scss +0 -0
- package/src/shared-components/call-tracking/call-tracking-icon.html +0 -0
- package/src/shared-components/call-tracking/call-tracking.html +0 -0
- package/src/shared-components/call-tracking/phone.svg +0 -0
- package/src/shared-components/card-button/_card-button.scss +0 -0
- package/src/shared-components/card-button/card-button.html +0 -0
- package/src/shared-components/carousel/_carousel.scss +0 -0
- package/src/shared-components/carousel/carousel.html +0 -0
- package/src/shared-components/carousel/carousel.js +0 -0
- package/src/shared-components/carousel/carousel.js.map +0 -0
- package/src/shared-components/carousel/carousel.min.js +0 -0
- package/src/shared-components/carousel/carousel.min.js.map +0 -0
- package/src/shared-components/checkbox/_checkbox.scss +0 -0
- package/src/shared-components/checkbox/checkbox.html +0 -0
- package/src/shared-components/consent-capture/_consent-capture.scss +0 -0
- package/src/shared-components/consent-capture/tcpa.html +0 -0
- package/src/shared-components/expand-collapse/_expand-collapse.scss +0 -0
- package/src/shared-components/expand-collapse/expand-collapse.html +0 -0
- package/src/shared-components/expand-collapse/expand-collapse.js +0 -0
- package/src/shared-components/expand-collapse/expand-collapse.min.js +0 -0
- package/src/shared-components/expand-collapse/expand-collapse.min.js.map +0 -0
- package/src/shared-components/featured-block/_featured-block.scss +0 -0
- package/src/shared-components/featured-block/featured-block.html +0 -0
- package/src/shared-components/foot-assets/foot-assets.html +0 -0
- package/src/shared-components/form-tcpa/form-tcpa-spanish.html +0 -0
- package/src/shared-components/form-tcpa/form-tcpa.html +0 -0
- package/src/shared-components/gtm-body/gtm-body.html +0 -0
- package/src/shared-components/head/head.html +0 -0
- package/src/shared-components/header/_header.scss +0 -0
- package/src/shared-components/header/header.html +0 -0
- package/src/shared-components/hero/_hero.scss +0 -0
- package/src/shared-components/hero/hero.html +0 -0
- package/src/shared-components/how-it-works/_how-it-works.scss +0 -0
- package/src/shared-components/how-it-works/how-it-works.html +0 -0
- package/src/shared-components/input/_input.scss +0 -0
- package/src/shared-components/input/input.html +0 -0
- package/src/shared-components/preloader/_preloader.scss +0 -0
- package/src/shared-components/preloader/preloader.html +0 -0
- package/src/shared-components/progress-bar/_progress-bar.scss +0 -0
- package/src/shared-components/progress-bar/progress-bar.html +0 -0
- package/src/shared-components/progress-bar/progress-bar.js +0 -0
- package/src/shared-components/progress-bar/progress-bar.min.js +0 -0
- package/src/shared-components/progress-bar/progress-bar.min.js.map +0 -0
- package/src/shared-components/radio-button/_radio-button.scss +0 -0
- package/src/shared-components/radio-button/radio-button.html +0 -0
- package/src/shared-components/reviews/_reviews.scss +0 -0
- package/src/shared-components/reviews/reviews.html +0 -0
- package/src/shared-components/section-deals/_partials/article-card.html +0 -0
- package/src/shared-components/section-deals/_partials/article-content.html +0 -0
- package/src/shared-components/section-deals/_partials/articles-list.html +0 -0
- package/src/shared-components/section-deals/_partials/author.html +0 -0
- package/src/shared-components/section-deals/_partials/contractors.html +0 -0
- package/src/shared-components/section-deals/_partials/hero.html +0 -0
- package/src/shared-components/section-deals/_partials/page-card-zip.html +0 -0
- package/src/shared-components/section-deals/_partials/page-card.html +0 -0
- package/src/shared-components/section-deals/_partials/site-data-script.html +0 -0
- package/src/shared-components/section-deals/components/article-template.html +0 -0
- package/src/shared-components/section-deals/components/button.html +0 -0
- package/src/shared-components/section-deals/components/card-info.html +0 -0
- package/src/shared-components/section-deals/components/contractor-card.html +0 -0
- package/src/shared-components/section-deals/components/contractors-cards-list.html +0 -0
- package/src/shared-components/section-deals/components/footer.html +0 -0
- package/src/shared-components/section-deals/components/header.html +0 -0
- package/src/shared-components/section-deals/components/modal.html +0 -0
- package/src/shared-components/section-deals/components/off-canvas-menu.html +0 -0
- package/src/shared-components/section-deals/components/review-stars.html +0 -0
- package/src/shared-components/section-deals/components/sidebar-nav-toggle.html +0 -0
- package/src/shared-components/section-deals/components/table-of-contents.html +0 -0
- package/src/shared-components/section-deals/components/trade-hub-template.html +0 -0
- package/src/shared-components/section-deals/icons/icon-menu.svg +0 -0
- package/src/shared-components/section-deals/icons/icon-news.svg +0 -0
- package/src/shared-components/section-deals/sitemap.xml +0 -0
- package/src/shared-components/section-deals/styles/_article-template.scss +0 -0
- package/src/shared-components/section-deals/styles/_article-trade-template.scss +0 -0
- package/src/shared-components/section-deals/styles/_articles.scss +0 -0
- package/src/shared-components/section-deals/styles/_buttons.scss +0 -0
- package/src/shared-components/section-deals/styles/_contractor-cards.scss +0 -0
- package/src/shared-components/section-deals/styles/_footer.scss +0 -0
- package/src/shared-components/section-deals/styles/_header.scss +0 -0
- package/src/shared-components/section-deals/styles/_input-group-btn.scss +0 -0
- package/src/shared-components/section-deals/styles/_modal.scss +0 -0
- package/src/shared-components/section-deals/styles/_trade-hub-template.scss +0 -0
- package/src/shared-components/select/_select.scss +0 -0
- package/src/shared-components/select/select.html +0 -0
- package/src/shared-components/steps/_steps.scss +0 -0
- package/src/shared-components/steps/defaultFormFieldConfig.json +0 -0
- package/src/shared-components/steps/step-fields.html +0 -0
- package/src/shared-components/steps/steps.html +0 -0
- package/src/shared-components/textarea/_textarea.scss +0 -0
- package/src/shared-components/textarea/textarea.html +0 -0
- package/src/shared-components/theme-toggle/_theme-toggle.scss +0 -0
- package/src/shared-components/theme-toggle/theme-toggle.html +0 -0
- package/src/shared-components/tile/_tile.scss +0 -0
- package/src/shared-components/tile/tile.html +0 -0
- package/src/shared-components/value-props/_value-props.scss +0 -0
- package/src/shared-components/value-props/value-props.html +0 -0
- package/src/shared-components/zip-control/_zip-control.scss +0 -0
- package/src/shared-components/zip-control/zip-control.html +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.0.80
|
|
4
|
+
|
|
5
|
+
- Add `grab-jsdoc` task to serve process
|
|
6
|
+
|
|
7
|
+
## 4.0.79
|
|
8
|
+
|
|
9
|
+
- Add `grab-b2b-data` task to serve process
|
|
10
|
+
|
|
3
11
|
## 4.0.78
|
|
4
12
|
|
|
5
13
|
- Updating `mergeDefaultFormFieldConfig` to be recursive and merge to nested fields (so we can wrap multiple fields in a `fieldset`).
|
package/package.json
CHANGED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { defaultSettings } from '../src/data/config.js';
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import { createWriteStream } from 'node:fs';
|
|
4
|
+
import * as stream from 'node:stream';
|
|
5
|
+
import { promisify } from 'node:util';
|
|
6
|
+
import fs from 'node:fs';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import { responseInterceptor } from '../src/scripts/retry-axios.js';
|
|
9
|
+
|
|
10
|
+
const resourcePath = 'quote/resources/mod-form/form';
|
|
11
|
+
const axiosInstance = axios.create();
|
|
12
|
+
const jsdocAxiosInstance = axios.create();
|
|
13
|
+
responseInterceptor(axiosInstance);
|
|
14
|
+
responseInterceptor(jsdocAxiosInstance);
|
|
15
|
+
|
|
16
|
+
// helper to allow us to define an "end" event to multiple streams
|
|
17
|
+
const streamToDestination = (filePath) => {
|
|
18
|
+
if (!filePath) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const finished = promisify(stream.finished);
|
|
23
|
+
// Add cachebuster to avoid server/browser caching issues
|
|
24
|
+
const cachebuster = Math.round(new Date().getTime() / 1000);
|
|
25
|
+
const url = `https://${defaultSettings.nodeEnv}/${resourcePath}/${filePath}?cb=${cachebuster}`;
|
|
26
|
+
const fileName = path.basename(filePath);
|
|
27
|
+
const dirPath = path.dirname(filePath);
|
|
28
|
+
// If dirPath is '.', use root directory, otherwise use the directory path
|
|
29
|
+
const destPath = dirPath === '.' ? '.' : dirPath;
|
|
30
|
+
|
|
31
|
+
return new Promise(resolve => {
|
|
32
|
+
// Create directory if it doesn't exist
|
|
33
|
+
if (destPath !== '.' && !fs.existsSync(destPath)) {
|
|
34
|
+
fs.mkdirSync(destPath, { recursive: true });
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const fileFullPath = destPath === '.' ? fileName : `${destPath}/${fileName}`;
|
|
38
|
+
|
|
39
|
+
// if file exists, do not create it again
|
|
40
|
+
if (fs.existsSync(fileFullPath)) {
|
|
41
|
+
resolve();
|
|
42
|
+
} else {
|
|
43
|
+
const writer = createWriteStream(fileFullPath);
|
|
44
|
+
const options = {
|
|
45
|
+
url,
|
|
46
|
+
method: 'get',
|
|
47
|
+
responseType: 'stream'
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
axiosInstance(options).then(resp => {
|
|
51
|
+
if (resp.status !== 200) {
|
|
52
|
+
throw new Error(`${resp.status}: Error while fetching ${url}`);
|
|
53
|
+
}
|
|
54
|
+
resp.data.pipe(writer);
|
|
55
|
+
console.log(`${fileFullPath} created...`);
|
|
56
|
+
return finished(writer);
|
|
57
|
+
}).then(() => {
|
|
58
|
+
resolve();
|
|
59
|
+
}).catch(error => {
|
|
60
|
+
console.error(error);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}).finally(() => {
|
|
63
|
+
axiosInstance.interceptors.response.eject(responseInterceptor);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function getJSDocFiles() {
|
|
70
|
+
let files = [];
|
|
71
|
+
await new Promise((resolve, reject) => {
|
|
72
|
+
// Add cachebuster to avoid server/browser caching issues
|
|
73
|
+
const cachebuster = Math.round(new Date().getTime() / 1000);
|
|
74
|
+
const options = {
|
|
75
|
+
url: `https://${defaultSettings.nodeEnv}/${resourcePath}/jsdoc.json?cb=${cachebuster}`,
|
|
76
|
+
method: 'get'
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
jsdocAxiosInstance(options).then(resp => {
|
|
80
|
+
if (resp.status !== 200) {
|
|
81
|
+
reject(new Error(`${resp.status}: Error while fetching ${options.url}`));
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
try {
|
|
85
|
+
// axios may parse JSON automatically, so check if it's already an object
|
|
86
|
+
if (typeof resp.data === 'string') {
|
|
87
|
+
files = JSON.parse(resp.data);
|
|
88
|
+
} else {
|
|
89
|
+
files = resp.data;
|
|
90
|
+
}
|
|
91
|
+
} catch (parseError) {
|
|
92
|
+
reject(new Error(`Error parsing jsdoc.json: ${parseError.message}`));
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
resolve();
|
|
96
|
+
}).catch(error => {
|
|
97
|
+
console.error(error);
|
|
98
|
+
reject(error);
|
|
99
|
+
}).finally(() => {
|
|
100
|
+
jsdocAxiosInstance.interceptors.response.eject(responseInterceptor);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return files;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export default async function() {
|
|
108
|
+
const { nodeEnv, isLocal } = defaultSettings;
|
|
109
|
+
|
|
110
|
+
if (!isLocal) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (!nodeEnv) {
|
|
115
|
+
throw new Error('Missing environment variables. Did you start with gulp instead of npm run...?');
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const files = await getJSDocFiles();
|
|
119
|
+
const filesPromiseMap = files.map(async filePath => {
|
|
120
|
+
await streamToDestination(filePath);
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
await Promise.all(filesPromiseMap);
|
|
124
|
+
}
|
|
125
|
+
|
package/tasks/serve.js
CHANGED
|
@@ -5,6 +5,7 @@ import grabCdn from './grab-cdn.js';
|
|
|
5
5
|
import grabB2BData from './grab-b2b-data.js';
|
|
6
6
|
import getDefaultTradeQuestions from './get-default-trade-questions.js';
|
|
7
7
|
import grabFormHelpers from './grab-form-helpers.js';
|
|
8
|
+
import grabJSDoc from './grab-jsdoc.js';
|
|
8
9
|
import templates from './templates.js';
|
|
9
10
|
import { createStylelintFile, updateConfig } from '../src/scripts/plugins.js';
|
|
10
11
|
|
|
@@ -17,6 +18,7 @@ export async function startModBuild(config) {
|
|
|
17
18
|
await Promise.all([
|
|
18
19
|
grabSharedComponents(config),
|
|
19
20
|
grabFormHelpers(config),
|
|
21
|
+
grabJSDoc(),
|
|
20
22
|
templates(config)
|
|
21
23
|
]).then(async () => {
|
|
22
24
|
await grabSharedScripts(config);
|