From 83888234757e49c8e05b9f770eb1b05f57429368 Mon Sep 17 00:00:00 2001 From: Mark Dalgleish Date: Wed, 16 Oct 2024 16:08:19 +1100 Subject: [PATCH] Migrate to route-config package --- integration/vite-fs-routes-test.ts | 8 ++++---- packages/remix-dev/package.json | 11 ----------- .../__tests__/routeManifestToRouteConfig-test.ts | 2 +- packages/remix-fs-routes/index.ts | 5 ++++- packages/remix-fs-routes/manifest.ts | 2 +- packages/remix-fs-routes/package.json | 4 ++-- pnpm-lock.yaml | 4 ++-- 7 files changed, 14 insertions(+), 22 deletions(-) diff --git a/integration/vite-fs-routes-test.ts b/integration/vite-fs-routes-test.ts index b0f7ca1241f..e3709d99967 100644 --- a/integration/vite-fs-routes-test.ts +++ b/integration/vite-fs-routes-test.ts @@ -27,7 +27,7 @@ test.describe("fs-routes", () => { }); `, "app/routes.ts": js` - import { type RouteConfig } from "@remix-run/dev/routes"; + import { type RouteConfig } from "@remix-run/route-config"; import { flatRoutes } from "@remix-run/fs-routes"; export const routes: RouteConfig = flatRoutes({ @@ -230,7 +230,7 @@ test.describe("emits warnings for route conflicts", async () => { }); `, "app/routes.ts": js` - import { type RouteConfig } from "@remix-run/dev/routes"; + import { type RouteConfig } from "@remix-run/route-config"; import { flatRoutes } from "@remix-run/fs-routes"; export const routes: RouteConfig = flatRoutes({ @@ -302,7 +302,7 @@ test.describe("", () => { }); `, "app/routes.ts": js` - import { type RouteConfig } from "@remix-run/dev/routes"; + import { type RouteConfig } from "@remix-run/route-config"; import { flatRoutes } from "@remix-run/fs-routes"; export const routes: RouteConfig = flatRoutes({ @@ -349,7 +349,7 @@ test.describe("pathless routes and route collisions", () => { }); `, "app/routes.ts": js` - import { type RouteConfig } from "@remix-run/dev/routes"; + import { type RouteConfig } from "@remix-run/route-config"; import { flatRoutes } from "@remix-run/fs-routes"; export const routes: RouteConfig = flatRoutes({ diff --git a/packages/remix-dev/package.json b/packages/remix-dev/package.json index 3a9e59b94bd..c285e9141c2 100644 --- a/packages/remix-dev/package.json +++ b/packages/remix-dev/package.json @@ -14,17 +14,6 @@ "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - }, - "./routes": { - "types": "./dist/routes.d.ts", - "default": "./dist/routes.js" - }, - "./*": "./*" - }, "bin": { "remix": "dist/cli.js" }, diff --git a/packages/remix-fs-routes/__tests__/routeManifestToRouteConfig-test.ts b/packages/remix-fs-routes/__tests__/routeManifestToRouteConfig-test.ts index 7831511b20a..d4e9be71597 100644 --- a/packages/remix-fs-routes/__tests__/routeManifestToRouteConfig-test.ts +++ b/packages/remix-fs-routes/__tests__/routeManifestToRouteConfig-test.ts @@ -1,4 +1,4 @@ -import { route } from "@remix-run/dev/routes"; +import { route } from "@remix-run/route-config"; import { routeManifestToRouteConfig } from "../manifest"; diff --git a/packages/remix-fs-routes/index.ts b/packages/remix-fs-routes/index.ts index 64161752af3..a0ccc39fefd 100644 --- a/packages/remix-fs-routes/index.ts +++ b/packages/remix-fs-routes/index.ts @@ -1,6 +1,9 @@ import fs from "node:fs"; import path from "node:path"; -import { type RouteConfigEntry, getAppDirectory } from "@remix-run/dev/routes"; +import { + type RouteConfigEntry, + getAppDirectory, +} from "@remix-run/route-config"; import { routeManifestToRouteConfig } from "./manifest"; import { flatRoutes as flatRoutesImpl } from "./flatRoutes"; diff --git a/packages/remix-fs-routes/manifest.ts b/packages/remix-fs-routes/manifest.ts index 540997f0de6..3b9ea7ae1d8 100644 --- a/packages/remix-fs-routes/manifest.ts +++ b/packages/remix-fs-routes/manifest.ts @@ -1,4 +1,4 @@ -import type { RouteConfigEntry } from "@remix-run/dev/routes"; +import type { RouteConfigEntry } from "@remix-run/route-config"; export interface RouteManifestEntry { path?: string; diff --git a/packages/remix-fs-routes/package.json b/packages/remix-fs-routes/package.json index 55e5d2c7cda..5f803ade36b 100644 --- a/packages/remix-fs-routes/package.json +++ b/packages/remix-fs-routes/package.json @@ -27,11 +27,11 @@ "minimatch": "^9.0.0" }, "devDependencies": { - "@remix-run/dev": "workspace:*", + "@remix-run/route-config": "workspace:*", "typescript": "^5.1.6" }, "peerDependencies": { - "@remix-run/dev": "workspace:^", + "@remix-run/route-config": "workspace:*", "typescript": "^5.1.0" }, "peerDependenciesMeta": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c8568e08ab6..5cd2a9a540e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1198,9 +1198,9 @@ importers: specifier: ^9.0.0 version: 9.0.3 devDependencies: - '@remix-run/dev': + '@remix-run/route-config': specifier: workspace:* - version: link:../remix-dev + version: link:../remix-route-config typescript: specifier: ^5.1.6 version: 5.1.6