Skip to content

Commit c28af07

Browse files
committed
initial version of react router 7 integration (new remix)
1 parent 008674f commit c28af07

File tree

11 files changed

+660
-19
lines changed

11 files changed

+660
-19
lines changed

.changeset/swift-bears-carry.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@dmno/react-router-integration": patch
3+
---
4+
5+
react-router 7 integration - initial version
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
extends: ["@dmno/eslint-config/base"],
3+
ignorePatterns: ["tsup.config.ts"],
4+
rules: {
5+
},
6+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Check out the [docs](https://dmno.dev/docs/integrations/remix/) for more information on how to use [DMNO](https://dmno.dev) + [Remix](https://remix.run/).
2+
3+
If you have any questions, please reach out to us on [Discord](https://chat.dmno.dev).
4+
5+
----
6+
7+
# @dmno/remix-integration [![npm](https://img.shields.io/npm/v/@dmno/remix-integration)](https://www.npmjs.com/package/@dmno/remix-integration)
8+
9+
Provides tooling to integrate dmno into your Remix dev/build workflow
10+
11+
### Installation
12+
13+
```bash
14+
# let dmno init automatically add the integration
15+
npx dmno init
16+
```
17+
18+
```bash
19+
# or do it manually
20+
npm add @dmno/remix-integration
21+
```
22+
23+
### Example Usage
24+
25+
Import and initialize our remix integration and add to your `vite.config.ts` file.
26+
You must add both the Vite plugin and the Remix preset.
27+
28+
```typescript
29+
import { dmnoRemixVitePlugin, dmnoRemixPreset } from "@dmno/remix-integration";
30+
import { vitePlugin as remix } from "@remix-run/dev";
31+
import { defineConfig } from "vite";
32+
import tsconfigPaths from "vite-tsconfig-paths";
33+
34+
export default defineConfig({
35+
plugins: [
36+
dmnoRemixVitePlugin(),
37+
remix({
38+
future: {
39+
v3_fetcherPersist: true,
40+
v3_relativeSplatPath: true,
41+
v3_throwAbortReason: true,
42+
},
43+
presets: [dmnoRemixPreset() as any],
44+
}),
45+
tsconfigPaths(),
46+
],
47+
});
48+
```
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"integrationForPackage": "react-router",
3+
"publicPrefix": "VITE_",
4+
"installationCodemods": [
5+
{
6+
"glob": "vite.config.*",
7+
"imports": [ {
8+
"moduleName": "@dmno/react-router-integration",
9+
"importVars": [ "dmnoReactRouterVitePlugin" ],
10+
} ],
11+
"updates": [
12+
{
13+
"symbol": "EXPORT",
14+
"path": [ "plugins" ],
15+
"action": {
16+
"arrayContains": "dmnoReactRouterVitePlugin()"
17+
}
18+
}
19+
]
20+
}
21+
],
22+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"name": "@dmno/react-router-integration",
3+
"version": "0.0.0",
4+
"description": "tools for integrating dmno into react router 7+ (formerly Remix)",
5+
"author": "dmno-dev",
6+
"license": "MIT",
7+
"repository": {
8+
"type": "git",
9+
"url": "git+https://github.com/dmno-dev/dmno.git",
10+
"directory": "packages/integrations/react-router"
11+
},
12+
"bugs": "https://github.com/dmno-dev/dmno/issues",
13+
"homepage": "https://dmno.dev/docs/integrations/react-router",
14+
"keywords": [
15+
"dmno",
16+
"react-router",
17+
"config",
18+
"env vars",
19+
"environment variables",
20+
"secrets",
21+
"integration",
22+
"react-router-preset",
23+
"dmno-integration"
24+
],
25+
"type": "module",
26+
"exports": {
27+
".": {
28+
"ts-src": "./src/index.ts",
29+
"import": "./dist/index.js",
30+
"types": "./dist/index.d.ts"
31+
},
32+
"./meta": {
33+
"default": "./dmno.meta.json"
34+
}
35+
},
36+
"files": [
37+
"/dist",
38+
"/dmno.meta.json"
39+
],
40+
"scripts": {
41+
"build": "tsup",
42+
"build:ifnodist": "[ -d \"./dist\" ] && echo 'dist exists' || pnpm build",
43+
"dev": "pnpm run build --watch",
44+
"lint": "eslint src --ext .ts,.cjs",
45+
"lint:fix": "pnpm run lint --fix"
46+
},
47+
"devDependencies": {
48+
"@dmno/eslint-config": "workspace:*",
49+
"@dmno/ts-lib": "workspace:*",
50+
"@dmno/tsconfig": "workspace:*",
51+
"@types/async": "^3.2.24",
52+
"@types/debug": "catalog:",
53+
"@types/lodash-es": "catalog:",
54+
"@types/node": "catalog:",
55+
"dmno": "workspace:*",
56+
"tsup": "catalog:",
57+
"typescript": "catalog:",
58+
"vite": "^6.2.6"
59+
},
60+
"peerDependencies": {
61+
"react-router": "^7",
62+
"dmno": "^0",
63+
"vite": ">=6"
64+
},
65+
"dependencies": {
66+
"debug": "catalog:",
67+
"lodash-es": "catalog:"
68+
}
69+
}

0 commit comments

Comments
 (0)