hale-commenting-system 2.2.4 → 2.2.5
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 +3 -3
- package/scripts/integrate.js +23 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hale-commenting-system",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
4
4
|
"description": "An open source build scaffolding utility for web apps.",
|
|
5
5
|
"repository": "https://github.com/patternfly/patternfly-react-seed.git",
|
|
6
6
|
"homepage": "https://patternfly-react-seed.surge.sh",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"@patternfly/react-core": "^6.4.0",
|
|
80
80
|
"@patternfly/react-icons": "^6.4.0",
|
|
81
81
|
"@patternfly/react-styles": "^6.4.0",
|
|
82
|
-
"inquirer": "^
|
|
83
|
-
"node-fetch": "^
|
|
82
|
+
"inquirer": "^8.2.6",
|
|
83
|
+
"node-fetch": "^2.7.0",
|
|
84
84
|
"react": "^18",
|
|
85
85
|
"react-dom": "^18",
|
|
86
86
|
"sirv-cli": "^3.0.0"
|
package/scripts/integrate.js
CHANGED
|
@@ -11,6 +11,27 @@ const fs = require('fs');
|
|
|
11
11
|
const path = require('path');
|
|
12
12
|
const { execSync } = require('child_process');
|
|
13
13
|
|
|
14
|
+
// Check Node.js version (fetch is only available natively in Node 18+)
|
|
15
|
+
function checkNodeVersion() {
|
|
16
|
+
const nodeVersion = process.version;
|
|
17
|
+
const majorVersion = parseInt(nodeVersion.slice(1).split('.')[0], 10);
|
|
18
|
+
|
|
19
|
+
if (majorVersion < 18) {
|
|
20
|
+
console.error('❌ Error: Node.js version 18 or higher is required.');
|
|
21
|
+
console.error(` Current version: ${nodeVersion}`);
|
|
22
|
+
console.error(' The webpack middleware uses native fetch() which requires Node 18+.');
|
|
23
|
+
console.error(' Please upgrade Node.js: https://nodejs.org/\n');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (majorVersion === 18) {
|
|
28
|
+
console.log('⚠️ Warning: Node.js 18 detected. Some features may work better with Node 20+.\n');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Run version check immediately
|
|
33
|
+
checkNodeVersion();
|
|
34
|
+
|
|
14
35
|
// Check if required dependencies are available
|
|
15
36
|
let parser, traverse, generate, types;
|
|
16
37
|
try {
|
|
@@ -501,8 +522,10 @@ function integrateWebpackMiddleware() {
|
|
|
501
522
|
}
|
|
502
523
|
|
|
503
524
|
// Webpack middleware template (inline since we don't have a separate template file)
|
|
525
|
+
// Note: This middleware uses native fetch() which requires Node.js 18+
|
|
504
526
|
const middlewareCode = `
|
|
505
527
|
// Load env vars for local OAuth/token exchange without bundling secrets into the client.
|
|
528
|
+
// Note: Requires Node.js 18+ for native fetch() support
|
|
506
529
|
try {
|
|
507
530
|
const dotenv = require('dotenv');
|
|
508
531
|
dotenv.config({ path: path.resolve(__dirname, '.env') });
|