Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update references to codemod #4646

Merged
merged 2 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/happy-flies-own.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"remix": patch
"@remix-run/eslint-config": patch
---

Replace references to the old `migrate` command with the new `codemod` command
2 changes: 1 addition & 1 deletion packages/remix-eslint-config/rules/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const WARN = 1;
const ERROR = 2;

const getReplaceRemixImportsMessage = (packageName) =>
`All \`remix\` exports are considered deprecated as of v1.3.3. Please use \`@remix-run/${packageName}\` instead. You can run \`remix migrate --migration replace-remix-imports\` to automatically migrate your code.`;
`All \`remix\` exports are considered deprecated as of v1.3.3. Please use \`@remix-run/${packageName}\` instead. Run \`npx @remix-run/dev@latest codemod replace-remix-magic-imports\` to automatically migrate your code.`;

const replaceRemixImportsOptions = [
{
Expand Down
2 changes: 1 addition & 1 deletion rollup.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ function magicExportsPlugin({ packageName, version }) {
if (magicExports.values) {
let deprecationFunctions =
// eslint-disable-next-line no-template-curly-in-string
"const getDeprecatedMessage = (symbol, packageName) => `All \\`remix\\` exports are considered deprecated as of v1.3.3. Please import \\`${symbol}\\` from \\`${packageName}\\` instead. You can run \\`remix migrate --migration replace-remix-imports\\` to automatically migrate your code.`;\n" +
"const getDeprecatedMessage = (symbol, packageName) => `All \\`remix\\` exports are considered deprecated as of v1.3.3. Please import \\`${symbol}\\` from \\`${packageName}\\` instead. Run \\`npx @remix-run/dev@latest codemod replace-remix-magic-imports\\` to automatically migrate your code.`;\n" +
"const warn = (fn, message) => (...args) => {\n" +
" console.warn(message);\n" +
" return fn(...args);\n" +
Expand Down
10 changes: 5 additions & 5 deletions scripts/run-migration-on-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ const { readdir, stat } = require("fs/promises");
const { join } = require("path");

/**
* @param {string} migration
* @param {string} codemod
*/
const main = async (migration) => {
if (!migration) {
console.error("Please specify a migration to run");
const main = async (codemod) => {
if (!codemod) {
console.error("Please specify a codemod to run");
process.exit(1);
}

Expand All @@ -32,7 +32,7 @@ const main = async (migration) => {
}

execSync(
`node ${cliPath} migrate --migration ${migration} --force ${examplePath}`,
`node ${cliPath} codemod ${codemod} --force ${examplePath}`,
{ stdio: "inherit" }
);
});
Expand Down