@majordigital/create-acorn 1.6.6 → 1.6.7
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/bin/create-acorn.mjs +20 -8
- package/package.json +1 -1
package/bin/create-acorn.mjs
CHANGED
|
@@ -116,23 +116,35 @@ async function setupPreDeploy() {
|
|
|
116
116
|
cpSync(scriptsSrc, scriptsDest, { recursive: true, force: true });
|
|
117
117
|
console.log('Pre-deploy scripts copied to scripts/.');
|
|
118
118
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
// Write devDependencies and scripts into package.json explicitly, rather than
|
|
120
|
+
// relying on `npm install --save-dev` to persist them. When the packages are
|
|
121
|
+
// already present in node_modules, npm reports "up to date" and may skip
|
|
122
|
+
// updating package.json — leaving the deps unrecorded.
|
|
123
|
+
const preDeployDeps = {
|
|
124
|
+
lighthouse: '^13',
|
|
125
|
+
'chrome-launcher': '^1',
|
|
126
|
+
playwright: '^1',
|
|
127
|
+
linkinator: '^7',
|
|
128
|
+
};
|
|
125
129
|
try {
|
|
130
|
+
if (!pkg.devDependencies) pkg.devDependencies = {};
|
|
131
|
+
for (const [name, range] of Object.entries(preDeployDeps)) {
|
|
132
|
+
if (!pkg.devDependencies[name]) pkg.devDependencies[name] = range;
|
|
133
|
+
}
|
|
126
134
|
if (!pkg.scripts) pkg.scripts = {};
|
|
127
135
|
pkg.scripts['lighthouse'] = 'node scripts/lighthouse-audit.mjs';
|
|
128
136
|
pkg.scripts['check-links'] = 'node scripts/check-links.mjs';
|
|
129
137
|
pkg.scripts['cross-browser'] = 'node scripts/cross-browser-check.mjs';
|
|
130
138
|
writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
131
|
-
console.log('Added pre-deploy scripts to package.json.');
|
|
139
|
+
console.log('Added pre-deploy scripts and dependencies to package.json.');
|
|
132
140
|
} catch {
|
|
133
|
-
console.log('Warning: Could not
|
|
141
|
+
console.log('Warning: Could not update package.json with pre-deploy setup.');
|
|
134
142
|
}
|
|
135
143
|
console.log('');
|
|
144
|
+
|
|
145
|
+
console.log('Installing pre-deploy tools (Lighthouse, Playwright, linkinator)...');
|
|
146
|
+
await runCommand('npm', ['install', '--legacy-peer-deps']);
|
|
147
|
+
console.log('');
|
|
136
148
|
}
|
|
137
149
|
|
|
138
150
|
async function setupNextApp() {
|
package/package.json
CHANGED