mod-build 4.0.87 → 4.0.88

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.0.88
4
+
5
+ - Added `grab-code-review-rules` task to fetch ROVO code review rules from quote-modernize-com on every `npm run serve`
6
+
3
7
  ## 4.0.87
4
8
 
5
9
  - Increased `gulpHandlebarsFileInclude` file-include recursion limit (`maxRecursion`) to 1000 for smart-campaign-pages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.87",
3
+ "version": "4.0.88",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -0,0 +1,23 @@
1
+ import { defaultSettings } from '../src/data/config.js';
2
+ import { promises as fs } from 'node:fs';
3
+ import axios from 'axios';
4
+
5
+ async function grabRules() {
6
+ try {
7
+ const url = `https://${defaultSettings.nodeEnv}/quote/resources/mod-site/code-review-rules/review-agent.md`;
8
+ const response = await axios.get(url);
9
+
10
+ if (response.status !== 200) {
11
+ throw new Error(`${response.status}: Error while fetching review-agent.md`);
12
+ }
13
+
14
+ await fs.mkdir('.rovodev', { recursive: true });
15
+ await fs.writeFile('.rovodev/.review-agent.md', response.data, 'utf8');
16
+ } catch (error) {
17
+ console.error('Error occurred:', error.message);
18
+ }
19
+ }
20
+
21
+ export default function() {
22
+ grabRules();
23
+ }
package/tasks/serve.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import addEditorConfig from './add-editorconfig.js';
2
+ import grabCodeReviewRules from './grab-code-review-rules.js';
2
3
  import grabGlobalFonts from './grab-global-fonts.js';
3
4
  import grabSharedComponents from './grab-shared-components.js';
4
5
  import grabSharedScripts from './grab-shared-scripts.js';
@@ -12,6 +13,7 @@ import { createStylelintFile, updateConfig } from '../src/scripts/plugins.js';
12
13
 
13
14
  export async function startModBuild(config) {
14
15
  addEditorConfig();
16
+ grabCodeReviewRules();
15
17
  createStylelintFile();
16
18
  await grabGlobalFonts(config);
17
19
  await grabB2BData(config);
@@ -22,7 +24,7 @@ export async function startModBuild(config) {
22
24
  grabFormHelpers(config),
23
25
  grabJSDoc(),
24
26
  templates(config)
25
- ]).then(async () => {
27
+ ]).then(async() => {
26
28
  await grabSharedScripts(config);
27
29
  });
28
30
  await updateConfig(config);