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.
Files changed (135) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +1 -1
  3. package/tasks/grab-jsdoc.js +125 -0
  4. package/tasks/serve.js +2 -0
  5. package/package-loc1k copy.json +0 -35281
  6. package/package-lock copy2.json +0 -35281
  7. package/public/resources/scripts/helpers/additionalOpts.min.js +0 -2
  8. package/public/resources/scripts/helpers/additionalOpts.min.js.map +0 -1
  9. package/public/resources/scripts/helpers/calls-only.min.js +0 -2
  10. package/public/resources/scripts/helpers/calls-only.min.js.map +0 -1
  11. package/public/resources/scripts/helpers/getPhoneAssignmentData.min.js +0 -2
  12. package/public/resources/scripts/helpers/getPhoneAssignmentData.min.js.map +0 -1
  13. package/public/resources/scripts/helpers/initNumericOnlyFields.min.js +0 -2
  14. package/public/resources/scripts/helpers/initNumericOnlyFields.min.js.map +0 -0
  15. package/public/resources/scripts/helpers/initQSForm.min.js +0 -0
  16. package/public/resources/scripts/helpers/initQSForm.min.js.map +0 -0
  17. package/public/resources/scripts/helpers/initQuadTransform.min.js +0 -0
  18. package/public/resources/scripts/helpers/initQuadTransform.min.js.map +0 -0
  19. package/public/resources/scripts/helpers/isZipCodeValid.min.js +0 -0
  20. package/public/resources/scripts/helpers/isZipCodeValid.min.js.map +0 -0
  21. package/public/resources/scripts/helpers/opts.min.js +0 -0
  22. package/public/resources/scripts/helpers/opts.min.js.map +0 -0
  23. package/public/resources/scripts/trusted-form.hbs +0 -38
  24. package/public/resources/scripts/trusted-form.html +0 -38
  25. package/src/resources/data/tcpa.json +0 -4
  26. package/src/resources/templates/modals/about/index.hbs +0 -9
  27. package/src/resources/templates/modals/about/index.html +0 -9
  28. package/src/resources/templates/modals/contact-us/index.hbs +0 -348
  29. package/src/resources/templates/modals/contact-us/index.html +0 -348
  30. package/src/resources/templates/modals/e-sign-consent/index.hbs +0 -35
  31. package/src/resources/templates/modals/e-sign-consent/index.html +0 -35
  32. package/src/resources/templates/modals/faq/index.hbs +0 -9
  33. package/src/resources/templates/modals/faq/index.html +0 -9
  34. package/src/resources/templates/modals/privacy/index.hbs +0 -238
  35. package/src/resources/templates/modals/privacy/index.html +0 -238
  36. package/src/resources/templates/modals/terms/index.hbs +0 -166
  37. package/src/resources/templates/modals/terms/index.html +0 -166
  38. package/src/shared-components/call-tracking/_call-tracking.scss +0 -0
  39. package/src/shared-components/call-tracking/call-tracking-icon.html +0 -0
  40. package/src/shared-components/call-tracking/call-tracking.html +0 -0
  41. package/src/shared-components/call-tracking/phone.svg +0 -0
  42. package/src/shared-components/card-button/_card-button.scss +0 -0
  43. package/src/shared-components/card-button/card-button.html +0 -0
  44. package/src/shared-components/carousel/_carousel.scss +0 -0
  45. package/src/shared-components/carousel/carousel.html +0 -0
  46. package/src/shared-components/carousel/carousel.js +0 -0
  47. package/src/shared-components/carousel/carousel.js.map +0 -0
  48. package/src/shared-components/carousel/carousel.min.js +0 -0
  49. package/src/shared-components/carousel/carousel.min.js.map +0 -0
  50. package/src/shared-components/checkbox/_checkbox.scss +0 -0
  51. package/src/shared-components/checkbox/checkbox.html +0 -0
  52. package/src/shared-components/consent-capture/_consent-capture.scss +0 -0
  53. package/src/shared-components/consent-capture/tcpa.html +0 -0
  54. package/src/shared-components/expand-collapse/_expand-collapse.scss +0 -0
  55. package/src/shared-components/expand-collapse/expand-collapse.html +0 -0
  56. package/src/shared-components/expand-collapse/expand-collapse.js +0 -0
  57. package/src/shared-components/expand-collapse/expand-collapse.min.js +0 -0
  58. package/src/shared-components/expand-collapse/expand-collapse.min.js.map +0 -0
  59. package/src/shared-components/featured-block/_featured-block.scss +0 -0
  60. package/src/shared-components/featured-block/featured-block.html +0 -0
  61. package/src/shared-components/foot-assets/foot-assets.html +0 -0
  62. package/src/shared-components/form-tcpa/form-tcpa-spanish.html +0 -0
  63. package/src/shared-components/form-tcpa/form-tcpa.html +0 -0
  64. package/src/shared-components/gtm-body/gtm-body.html +0 -0
  65. package/src/shared-components/head/head.html +0 -0
  66. package/src/shared-components/header/_header.scss +0 -0
  67. package/src/shared-components/header/header.html +0 -0
  68. package/src/shared-components/hero/_hero.scss +0 -0
  69. package/src/shared-components/hero/hero.html +0 -0
  70. package/src/shared-components/how-it-works/_how-it-works.scss +0 -0
  71. package/src/shared-components/how-it-works/how-it-works.html +0 -0
  72. package/src/shared-components/input/_input.scss +0 -0
  73. package/src/shared-components/input/input.html +0 -0
  74. package/src/shared-components/preloader/_preloader.scss +0 -0
  75. package/src/shared-components/preloader/preloader.html +0 -0
  76. package/src/shared-components/progress-bar/_progress-bar.scss +0 -0
  77. package/src/shared-components/progress-bar/progress-bar.html +0 -0
  78. package/src/shared-components/progress-bar/progress-bar.js +0 -0
  79. package/src/shared-components/progress-bar/progress-bar.min.js +0 -0
  80. package/src/shared-components/progress-bar/progress-bar.min.js.map +0 -0
  81. package/src/shared-components/radio-button/_radio-button.scss +0 -0
  82. package/src/shared-components/radio-button/radio-button.html +0 -0
  83. package/src/shared-components/reviews/_reviews.scss +0 -0
  84. package/src/shared-components/reviews/reviews.html +0 -0
  85. package/src/shared-components/section-deals/_partials/article-card.html +0 -0
  86. package/src/shared-components/section-deals/_partials/article-content.html +0 -0
  87. package/src/shared-components/section-deals/_partials/articles-list.html +0 -0
  88. package/src/shared-components/section-deals/_partials/author.html +0 -0
  89. package/src/shared-components/section-deals/_partials/contractors.html +0 -0
  90. package/src/shared-components/section-deals/_partials/hero.html +0 -0
  91. package/src/shared-components/section-deals/_partials/page-card-zip.html +0 -0
  92. package/src/shared-components/section-deals/_partials/page-card.html +0 -0
  93. package/src/shared-components/section-deals/_partials/site-data-script.html +0 -0
  94. package/src/shared-components/section-deals/components/article-template.html +0 -0
  95. package/src/shared-components/section-deals/components/button.html +0 -0
  96. package/src/shared-components/section-deals/components/card-info.html +0 -0
  97. package/src/shared-components/section-deals/components/contractor-card.html +0 -0
  98. package/src/shared-components/section-deals/components/contractors-cards-list.html +0 -0
  99. package/src/shared-components/section-deals/components/footer.html +0 -0
  100. package/src/shared-components/section-deals/components/header.html +0 -0
  101. package/src/shared-components/section-deals/components/modal.html +0 -0
  102. package/src/shared-components/section-deals/components/off-canvas-menu.html +0 -0
  103. package/src/shared-components/section-deals/components/review-stars.html +0 -0
  104. package/src/shared-components/section-deals/components/sidebar-nav-toggle.html +0 -0
  105. package/src/shared-components/section-deals/components/table-of-contents.html +0 -0
  106. package/src/shared-components/section-deals/components/trade-hub-template.html +0 -0
  107. package/src/shared-components/section-deals/icons/icon-menu.svg +0 -0
  108. package/src/shared-components/section-deals/icons/icon-news.svg +0 -0
  109. package/src/shared-components/section-deals/sitemap.xml +0 -0
  110. package/src/shared-components/section-deals/styles/_article-template.scss +0 -0
  111. package/src/shared-components/section-deals/styles/_article-trade-template.scss +0 -0
  112. package/src/shared-components/section-deals/styles/_articles.scss +0 -0
  113. package/src/shared-components/section-deals/styles/_buttons.scss +0 -0
  114. package/src/shared-components/section-deals/styles/_contractor-cards.scss +0 -0
  115. package/src/shared-components/section-deals/styles/_footer.scss +0 -0
  116. package/src/shared-components/section-deals/styles/_header.scss +0 -0
  117. package/src/shared-components/section-deals/styles/_input-group-btn.scss +0 -0
  118. package/src/shared-components/section-deals/styles/_modal.scss +0 -0
  119. package/src/shared-components/section-deals/styles/_trade-hub-template.scss +0 -0
  120. package/src/shared-components/select/_select.scss +0 -0
  121. package/src/shared-components/select/select.html +0 -0
  122. package/src/shared-components/steps/_steps.scss +0 -0
  123. package/src/shared-components/steps/defaultFormFieldConfig.json +0 -0
  124. package/src/shared-components/steps/step-fields.html +0 -0
  125. package/src/shared-components/steps/steps.html +0 -0
  126. package/src/shared-components/textarea/_textarea.scss +0 -0
  127. package/src/shared-components/textarea/textarea.html +0 -0
  128. package/src/shared-components/theme-toggle/_theme-toggle.scss +0 -0
  129. package/src/shared-components/theme-toggle/theme-toggle.html +0 -0
  130. package/src/shared-components/tile/_tile.scss +0 -0
  131. package/src/shared-components/tile/tile.html +0 -0
  132. package/src/shared-components/value-props/_value-props.scss +0 -0
  133. package/src/shared-components/value-props/value-props.html +0 -0
  134. package/src/shared-components/zip-control/_zip-control.scss +0 -0
  135. 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.79-beta.1",
3
+ "version": "4.0.80-beta.1",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -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);