Skip to content

initial version of react router 7 integration (new remix) #220

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .changeset/swift-bears-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@dmno/react-router-integration": patch
---

react-router 7 integration - initial version
6 changes: 6 additions & 0 deletions packages/integrations/react-router/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: ["@dmno/eslint-config/base"],
ignorePatterns: ["tsup.config.ts"],
rules: {
},
};
48 changes: 48 additions & 0 deletions packages/integrations/react-router/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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/).

If you have any questions, please reach out to us on [Discord](https://chat.dmno.dev).

----

# @dmno/remix-integration [![npm](https://img.shields.io/npm/v/@dmno/remix-integration)](https://www.npmjs.com/package/@dmno/remix-integration)

Provides tooling to integrate dmno into your Remix dev/build workflow

### Installation

```bash
# let dmno init automatically add the integration
npx dmno init
```

```bash
# or do it manually
npm add @dmno/remix-integration
```

### Example Usage

Import and initialize our remix integration and add to your `vite.config.ts` file.
You must add both the Vite plugin and the Remix preset.

```typescript
import { dmnoRemixVitePlugin, dmnoRemixPreset } from "@dmno/remix-integration";
import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";

export default defineConfig({
plugins: [
dmnoRemixVitePlugin(),
remix({
future: {
v3_fetcherPersist: true,
v3_relativeSplatPath: true,
v3_throwAbortReason: true,
},
presets: [dmnoRemixPreset() as any],
}),
tsconfigPaths(),
],
});
```
22 changes: 22 additions & 0 deletions packages/integrations/react-router/dmno.meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"integrationForPackage": "react-router",
"publicPrefix": "VITE_",
"installationCodemods": [
{
"glob": "vite.config.*",
"imports": [ {
"moduleName": "@dmno/react-router-integration",
"importVars": [ "dmnoReactRouterVitePlugin" ],
} ],
"updates": [
{
"symbol": "EXPORT",
"path": [ "plugins" ],
"action": {
"arrayContains": "dmnoReactRouterVitePlugin()"
}
}
]
}
],
}
69 changes: 69 additions & 0 deletions packages/integrations/react-router/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"name": "@dmno/react-router-integration",
"version": "0.0.0",
"description": "tools for integrating dmno into react router 7+ (formerly Remix)",
"author": "dmno-dev",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/dmno-dev/dmno.git",
"directory": "packages/integrations/react-router"
},
"bugs": "https://github.com/dmno-dev/dmno/issues",
"homepage": "https://dmno.dev/docs/integrations/react-router",
"keywords": [
"dmno",
"react-router",
"config",
"env vars",
"environment variables",
"secrets",
"integration",
"react-router-preset",
"dmno-integration"
],
"type": "module",
"exports": {
".": {
"ts-src": "./src/index.ts",
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"./meta": {
"default": "./dmno.meta.json"
}
},
"files": [
"/dist",
"/dmno.meta.json"
],
"scripts": {
"build": "tsup",
"build:ifnodist": "[ -d \"./dist\" ] && echo 'dist exists' || pnpm build",
"dev": "pnpm run build --watch",
"lint": "eslint src --ext .ts,.cjs",
"lint:fix": "pnpm run lint --fix"
},
"devDependencies": {
"@dmno/eslint-config": "workspace:*",
"@dmno/ts-lib": "workspace:*",
"@dmno/tsconfig": "workspace:*",
"@types/async": "^3.2.24",
"@types/debug": "catalog:",
"@types/lodash-es": "catalog:",
"@types/node": "catalog:",
"dmno": "workspace:*",
"tsup": "catalog:",
"typescript": "catalog:",
"vite": "^6.2.6"
},
"peerDependencies": {
"react-router": "^7",
"dmno": "^0",
"vite": ">=6"
},
"dependencies": {
"debug": "catalog:",
"lodash-es": "catalog:"
}
}
Loading
Loading