@next/codemod 16.0.4 → 16.1.0-canary.1
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/next-codemod.js +2 -0
- package/lib/handle-package.js +7 -0
- package/package.json +1 -1
package/bin/next-codemod.js
CHANGED
|
@@ -39,6 +39,8 @@ const program = new commander_1.Command(packageJson.name)
|
|
|
39
39
|
program
|
|
40
40
|
.command('upgrade')
|
|
41
41
|
.description('Upgrade Next.js apps to desired versions with a single command.')
|
|
42
|
+
// The CLI interface must be backwards compatible at all times so that older
|
|
43
|
+
// versions of Next.js can still run the codemod successfully.
|
|
42
44
|
.argument('[revision]', 'Specify the target Next.js version using an NPM dist tag (e.g. "latest", "canary", "rc", "beta") or an exact version number (e.g. "15.0.0").', packageJson.version.includes('-canary.')
|
|
43
45
|
? 'canary'
|
|
44
46
|
: packageJson.version.includes('-rc.')
|
package/lib/handle-package.js
CHANGED
|
@@ -99,6 +99,13 @@ function runInstallation(packageManager, options) {
|
|
|
99
99
|
try {
|
|
100
100
|
execa_1.default.sync(packageManager, ['install'], {
|
|
101
101
|
cwd: options.cwd,
|
|
102
|
+
env: {
|
|
103
|
+
...process.env,
|
|
104
|
+
// In case NODE_ENV=production is set, we still want dev dependencies to
|
|
105
|
+
// be installed. Otherwise we won't be able to check for peer dependencies.
|
|
106
|
+
// --production=false is not implemented by every package manager.
|
|
107
|
+
NODE_ENV: 'development',
|
|
108
|
+
},
|
|
102
109
|
stdio: 'inherit',
|
|
103
110
|
shell: true,
|
|
104
111
|
});
|