@farm.js/cli 0.1.0-beta.3 → 0.1.0-beta.4
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/farm.js +3 -3
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/index.js +11 -21
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2067,7 +2067,7 @@ async function createFrameworkMigrationPlan(root, source, options = {}) {
|
|
|
2067
2067
|
};
|
|
2068
2068
|
if (source === "next") await planNextMigration(root, packageJson, plan, options);
|
|
2069
2069
|
else await planTanStackMigration(root, packageJson, plan, options);
|
|
2070
|
-
addSharedFarmFiles(root, packageJson, plan,
|
|
2070
|
+
addSharedFarmFiles(root, packageJson, plan, options);
|
|
2071
2071
|
return plan;
|
|
2072
2072
|
}
|
|
2073
2073
|
async function planNextMigration(root, packageJson, plan, options) {
|
|
@@ -2147,32 +2147,22 @@ async function planTanStackMigration(root, packageJson, plan, options) {
|
|
|
2147
2147
|
plan.manual.push("Review loaders, beforeLoad hooks, search params, and Route.use* calls; Farm page modules should move that logic into props, API routes, or server helpers.");
|
|
2148
2148
|
if (packageJson) addPackageOperation(root, plan, createMigratedPackageJson(packageJson, "tanstack"));
|
|
2149
2149
|
}
|
|
2150
|
-
function addSharedFarmFiles(root, packageJson, plan,
|
|
2150
|
+
function addSharedFarmFiles(root, packageJson, plan, options) {
|
|
2151
2151
|
if (![
|
|
2152
2152
|
"farm.config.ts",
|
|
2153
2153
|
"farm.config.mts",
|
|
2154
2154
|
"farm.config.js",
|
|
2155
2155
|
"farm.config.mjs"
|
|
2156
|
-
].map((file) => path.join(root, file)).find((file) => existsSync(file))) {
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
});
|
|
2162
|
-
` : `import { defineConfig } from "@farm.js/core";
|
|
2156
|
+
].map((file) => path.join(root, file)).find((file) => existsSync(file))) plan.operations.push({
|
|
2157
|
+
kind: "write-file",
|
|
2158
|
+
path: path.join(root, "farm.config.ts"),
|
|
2159
|
+
description: "Create farm.config.ts",
|
|
2160
|
+
content: `import { defineConfig } from "@farm.js/core";
|
|
2163
2161
|
|
|
2164
|
-
export default defineConfig({
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
plan.operations.push({
|
|
2169
|
-
kind: "write-file",
|
|
2170
|
-
path: path.join(root, "farm.config.ts"),
|
|
2171
|
-
description: "Create farm.config.ts",
|
|
2172
|
-
content: output,
|
|
2173
|
-
skipped: false
|
|
2174
|
-
});
|
|
2175
|
-
}
|
|
2162
|
+
export default defineConfig({});
|
|
2163
|
+
`,
|
|
2164
|
+
skipped: false
|
|
2165
|
+
});
|
|
2176
2166
|
const layoutPath = path.join(root, "src", "app", "layout.tsx");
|
|
2177
2167
|
if (!existsSync(layoutPath)) plan.operations.push({
|
|
2178
2168
|
kind: "write-file",
|