Skip to content

Commit

Permalink
Comment out obsolete Next.js patch code
Browse files Browse the repository at this point in the history
  • Loading branch information
karlhorky committed Oct 29, 2023
1 parent 0019e17 commit f01c94c
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions bin/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,29 @@ import {
import { dirname, join, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';

const projectPackageJsonPath = join(process.cwd(), 'package.json');
const projectPackageJson = JSON.parse(
readFileSync(projectPackageJsonPath, 'utf-8'),
readFileSync(join(process.cwd(), 'package.json'), 'utf-8'),
);

const projectDependencies = projectPackageJson.dependencies || {};
const projectDevDependencies = projectPackageJson.devDependencies || {};

if ('next' in projectDependencies) {
// Remove previous patches in package.json
if (projectPackageJson?.pnpm?.patchedDependencies) {
projectPackageJson.pnpm.patchedDependencies = Object.fromEntries(
Object.entries(projectPackageJson.pnpm.patchedDependencies).filter(
([packageName]) => !packageName.startsWith('next@'),
),
);
}
}

writeFileSync(
projectPackageJsonPath,
JSON.stringify(projectPackageJson, null, 2) + '\n',
);
// if ('next' in projectDependencies) {
// // Remove previous patches in package.json
// if (projectPackageJson?.pnpm?.patchedDependencies) {
// projectPackageJson.pnpm.patchedDependencies = Object.fromEntries(
// Object.entries(projectPackageJson.pnpm.patchedDependencies).filter(
// ([packageName]) => !packageName.startsWith('next@'),
// ),
// );
// }
// }

// writeFileSync(
// projectPackageJsonPath,
// JSON.stringify(projectPackageJson, null, 2) + '\n',
// );

const newDevDependenciesToInstall = [
// pnpm v8+ automatically installs peer dependencies (auto-install-peers=true
Expand Down

0 comments on commit f01c94c

Please sign in to comment.