Skip to content

Commit 85c6619

Browse files
abrulicAlemTuzlak
andauthored
added warning message that package is deprecated (#152)
* added warning message that package is deprecated * comments updated * added unused binaries in knip ignore binaries * changed the message --------- Co-authored-by: Alem Tuzlak <[email protected]>
1 parent 5081e7a commit 85c6619

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,4 @@ dist
135135

136136
# IDE
137137
.idea
138-
.tsup
138+
.tsup

src/vite/plugin.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ type RemixViteConfig = {
3232
/** The directory where the remix app is located. Defaults to the "./app" relative to where vite.config is being defined. */
3333
remixDir?: string
3434
editor?: EditorConfig
35+
/**
36+
* If the package is marked as deprecated, a warning will be logged in the console
37+
* To disable this warning, set the option to true
38+
* @default false
39+
*/
40+
suppressDeprecationWarning?: boolean
3541
}
3642

3743
export const defineRdtConfig = (config: RemixViteConfig) => config
@@ -167,6 +173,14 @@ export const remixDevTools: (args?: RemixViteConfig) => Plugin[] = (args) => {
167173
return shouldInject(config.mode)
168174
},
169175
async configResolved(resolvedViteConfig) {
176+
if (!args?.suppressDeprecationWarning && resolvedViteConfig.appType === "custom") {
177+
// Log a warning message
178+
console.log(
179+
`\n\n⚠️ ${chalk.yellowBright("remix-development-tools")} are going to be deprecated and will be renamed to ${chalk.greenBright("react-router-devtools ")} when React Router v7 is released ⚠️`,
180+
`\n⚠️ Set suppressDeprecationWarning to true in your ${chalk.greenBright("vite.config.ts")} file to silence this warning ⚠️`
181+
)
182+
}
183+
170184
const remixIndex = resolvedViteConfig.plugins.findIndex((p) => p.name === "remix")
171185
const devToolsIndex = resolvedViteConfig.plugins.findIndex((p) => p.name === "remix-development-tools")
172186

test-apps/remix-vite/vite.config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ const config = defineRdtConfig({
1818
},
1919
pluginDir: "./plugins",
2020
includeInProd: true,
21+
// Set this option to true to suppress deprecation warnings
22+
// suppressDeprecationWarning: true,
2123
server: {
22-
serverTimingThreshold: 250
24+
serverTimingThreshold: 250,
2325
}
2426
});
2527

@@ -35,6 +37,6 @@ export default defineConfig({
3537
],
3638
server: {
3739
open: true,
38-
port: 3005 ,
40+
port: 3005,
3941
},
4042
});

0 commit comments

Comments
 (0)