@cedarjs/codemods 3.0.0-canary.13507 → 3.0.0-canary.13509
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.
|
@@ -39,47 +39,61 @@ const command = "prisma-v7-prep";
|
|
|
39
39
|
const description = "(v2.7.x) Prepares for Prisma v7 by funneling imports through src/lib/db";
|
|
40
40
|
const handler = async () => {
|
|
41
41
|
const context = await (0, import_prismaV7Prep.getPrismaV7PrepContext)();
|
|
42
|
-
await import_tasuku.default
|
|
43
|
-
task2(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
await (0, import_tasuku.default)("Prisma v7 Prep", async ({ task: task2 }) => {
|
|
43
|
+
await task2.group(
|
|
44
|
+
(task3) => [
|
|
45
|
+
task3("Add api/src/lib/db re-export", async ({ setOutput }) => {
|
|
46
|
+
const result = await (0, import_prismaV7Prep.updateDbFile)(context.dbFilePath);
|
|
47
|
+
if (result === "skipped") {
|
|
48
|
+
setOutput(
|
|
49
|
+
"Skipped (no api/src/lib/db.ts or api/src/lib/db.js found)"
|
|
50
|
+
);
|
|
51
|
+
return;
|
|
52
|
+
} else if (result === "unmodified") {
|
|
53
|
+
setOutput("Skipped (no changes needed)");
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
setOutput(`Updated ${context.dbFilePath}`);
|
|
57
|
+
}),
|
|
58
|
+
task3(
|
|
59
|
+
"Rewrite imports in api/src",
|
|
60
|
+
() => (0, import_prismaV7Prep.rewritePrismaImportsInDirectory)(
|
|
61
|
+
context.paths.api.src,
|
|
62
|
+
context.dbFilePath
|
|
63
|
+
)
|
|
64
|
+
),
|
|
65
|
+
task3(
|
|
66
|
+
"Rewrite imports in api/db/dataMigrations",
|
|
67
|
+
async ({ setOutput }) => {
|
|
68
|
+
const result = await (0, import_prismaV7Prep.rewritePrismaImportsInDirectory)(
|
|
69
|
+
context.dataMigrationsPath,
|
|
70
|
+
context.dbFilePath
|
|
71
|
+
);
|
|
72
|
+
if (result === "skipped") {
|
|
73
|
+
setOutput("No data migrations found");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
task3("Rewrite imports in scripts", async ({ setOutput }) => {
|
|
78
|
+
const result = await (0, import_prismaV7Prep.rewritePrismaImportsInDirectory)(
|
|
79
|
+
context.paths.scripts,
|
|
80
|
+
context.dbFilePath
|
|
81
|
+
);
|
|
82
|
+
if (result === "skipped") {
|
|
83
|
+
setOutput("Skipped (directory missing or empty)");
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
],
|
|
87
|
+
{
|
|
88
|
+
concurrency: Infinity
|
|
51
89
|
}
|
|
52
|
-
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
() => (0, import_prismaV7Prep.rewritePrismaImportsInDirectory)(
|
|
57
|
-
context.paths.api.src,
|
|
58
|
-
context.dbFilePath
|
|
59
|
-
)
|
|
60
|
-
),
|
|
61
|
-
task2("Rewrite imports in api/db/dataMigrations", async ({ setOutput }) => {
|
|
62
|
-
const result = await (0, import_prismaV7Prep.rewritePrismaImportsInDirectory)(
|
|
63
|
-
context.dataMigrationsPath,
|
|
64
|
-
context.dbFilePath
|
|
90
|
+
);
|
|
91
|
+
await task2("One more thing...", async ({ setOutput }) => {
|
|
92
|
+
setOutput(
|
|
93
|
+
"\n\nSome imports might be in the wrong order. If that's the case,\nyou can run `yarn cedar lint --fix` to reorder them."
|
|
65
94
|
);
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
}),
|
|
70
|
-
task2("Rewrite imports in scripts", async ({ setOutput }) => {
|
|
71
|
-
const result = await (0, import_prismaV7Prep.rewritePrismaImportsInDirectory)(
|
|
72
|
-
context.paths.scripts,
|
|
73
|
-
context.dbFilePath
|
|
74
|
-
);
|
|
75
|
-
if (result === "skipped") {
|
|
76
|
-
setOutput("Skipped (directory missing or empty)");
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
]);
|
|
80
|
-
console.log(
|
|
81
|
-
"Some imports might be in the wrong order. If that's the case, you can run `yarn cedar lint --fix` to reorder them."
|
|
82
|
-
);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
83
97
|
};
|
|
84
98
|
// Annotate the CommonJS export names for ESM import in node:
|
|
85
99
|
0 && (module.exports = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/codemods",
|
|
3
|
-
"version": "3.0.0-canary.
|
|
3
|
+
"version": "3.0.0-canary.13509+9efdad526",
|
|
4
4
|
"description": "Codemods to ease upgrading a CedarJS Project",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"@babel/plugin-transform-typescript": "^7.26.8",
|
|
31
31
|
"@babel/runtime-corejs3": "7.29.0",
|
|
32
32
|
"@babel/traverse": "7.29.0",
|
|
33
|
-
"@cedarjs/project-config": "3.0.0-canary.
|
|
33
|
+
"@cedarjs/project-config": "3.0.0-canary.13509",
|
|
34
34
|
"@svgr/core": "8.1.0",
|
|
35
35
|
"@svgr/plugin-jsx": "8.1.0",
|
|
36
36
|
"@vscode/ripgrep": "1.17.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"yargs": "17.7.2"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@cedarjs/framework-tools": "3.0.0-canary.
|
|
52
|
+
"@cedarjs/framework-tools": "3.0.0-canary.13509",
|
|
53
53
|
"@types/babel__core": "7.20.5",
|
|
54
54
|
"@types/jscodeshift": "0.12.0",
|
|
55
55
|
"@types/yargs": "17.0.35",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public"
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "9efdad526daf7e6bb4292bb0cd3ef8961235e3b8"
|
|
66
66
|
}
|