@next/codemod 15.0.1 → 15.0.2-canary.0
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/upgrade.js
CHANGED
|
@@ -328,7 +328,7 @@ function isUsingAppDir(projectPath) {
|
|
|
328
328
|
*/
|
|
329
329
|
async function suggestTurbopack(packageJson) {
|
|
330
330
|
const devScript = packageJson.scripts['dev'];
|
|
331
|
-
if (devScript
|
|
331
|
+
if (devScript?.includes('--turbopack'))
|
|
332
332
|
return;
|
|
333
333
|
const responseTurbopack = await (0, prompts_1.default)({
|
|
334
334
|
type: 'confirm',
|
package/package.json
CHANGED
|
@@ -507,14 +507,14 @@ function transformDynamicProps(source, _api, filePath) {
|
|
|
507
507
|
? paramsProperty.name
|
|
508
508
|
: null;
|
|
509
509
|
const paramPropertyName = paramsPropertyName || matchedPropName;
|
|
510
|
-
//
|
|
511
|
-
// also skip the transformation
|
|
510
|
+
// If propName is an identifier and not used in lower scope,
|
|
511
|
+
// also skip the transformation.
|
|
512
512
|
const hasUsedInBody = j(functionBodyPath)
|
|
513
513
|
.find(j.Identifier, {
|
|
514
514
|
name: paramPropertyName,
|
|
515
515
|
})
|
|
516
516
|
.size() > 0;
|
|
517
|
-
if (!hasUsedInBody &&
|
|
517
|
+
if (!hasUsedInBody && j.Identifier.check(paramsProperty))
|
|
518
518
|
continue;
|
|
519
519
|
// Search the usage of propName in the function body,
|
|
520
520
|
// if they're all awaited or wrapped with use(), skip the transformation
|