hale-commenting-system 2.2.4 → 2.2.6
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 +32 -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.6",
|
|
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 {
|
|
@@ -120,6 +141,15 @@ async function prompt(questions) {
|
|
|
120
141
|
}
|
|
121
142
|
|
|
122
143
|
function findFile(filename, startDir = process.cwd()) {
|
|
144
|
+
// For index.tsx, prioritize src/app/index.tsx over src/index.tsx
|
|
145
|
+
// because src/app/index.tsx contains the App component with Router
|
|
146
|
+
if (filename === 'index.tsx') {
|
|
147
|
+
const appIndexPath = path.join(startDir, 'src', 'app', filename);
|
|
148
|
+
if (fs.existsSync(appIndexPath)) {
|
|
149
|
+
return appIndexPath;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
123
153
|
const possiblePaths = [
|
|
124
154
|
path.join(startDir, filename),
|
|
125
155
|
path.join(startDir, 'src', filename),
|
|
@@ -501,8 +531,10 @@ function integrateWebpackMiddleware() {
|
|
|
501
531
|
}
|
|
502
532
|
|
|
503
533
|
// Webpack middleware template (inline since we don't have a separate template file)
|
|
534
|
+
// Note: This middleware uses native fetch() which requires Node.js 18+
|
|
504
535
|
const middlewareCode = `
|
|
505
536
|
// Load env vars for local OAuth/token exchange without bundling secrets into the client.
|
|
537
|
+
// Note: Requires Node.js 18+ for native fetch() support
|
|
506
538
|
try {
|
|
507
539
|
const dotenv = require('dotenv');
|
|
508
540
|
dotenv.config({ path: path.resolve(__dirname, '.env') });
|