-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Modernize Deno template #9932
base: dev
Are you sure you want to change the base?
Modernize Deno template #9932
Changes from all commits
5ca3397
a908ba6
454a13c
1e48a52
b94e223
1228943
3daf1b6
1f222bc
d58caab
9576356
ead6719
0b86c3d
196db71
00ab18e
07a9fe7
3d86009
197fc8c
21704c4
c83c7e4
619f6e8
155c20d
1fa4672
c5bc59b
24e3ee5
a3c1bcc
1954f5b
d4004f3
0795f97
4f728c9
65afd86
60f9808
2095f21
7513f3b
b185f29
72e2a9f
343f23e
62fe2d1
f4a1e48
0b65afb
3907b73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"create-remix": minor | ||
--- | ||
|
||
Adds Deno as a compatible package manager to install dependencies with. | ||
Furthermore `create-remix` will now detect if it is running under Deno and automatically use Deno as the package manager. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@remix-run/node": patch | ||
--- | ||
|
||
`installGlobals` is now a no-op when a Deno environment is detected. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@remix-run/dev": minor | ||
--- | ||
|
||
Added Deno project detection which is done by checking for the presence of a deno.json or deno.jsonc file. | ||
It is no longer a hard requirement to have a package.json file in the project. For a Deno project, dependencies can be added via the `deno add` command to a deno.json or deno.jsonc file instead. |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib", | ||
"deno.enablePaths": ["./packages/remix-deno/"], | ||
"deno.importMap": "./.vscode/deno_resolve_npm_imports.json" | ||
"deno.config": "./templates/deno/deno.json", | ||
"deno.enablePaths": ["./packages/remix-deno/", "./templates/deno"], | ||
"deno.disablePaths": ["./templates/deno/app"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
/app/deno.d.ts | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"exclude": ["app/", "build/"], | ||
"nodeModulesDir": "manual", | ||
"unstable": ["kv"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"name": "integration-vite-deno-template", | ||
"version": "0.0.0", | ||
"private": true, | ||
"scripts": { | ||
"build": "deno run -A npm:@remix-run/dev vite:build", | ||
"dev": "deno run -A npm:@remix-run/dev vite:dev", | ||
"typecheck": "deno check '**/*' && deno run -A npm:typescript/tsc", | ||
"typegen": "deno types > ./app/deno.d.ts" | ||
}, | ||
"dependencies": { | ||
"@remix-run/dev": "workspace:*", | ||
"@remix-run/node": "workspace:*", | ||
"@remix-run/react": "workspace:*", | ||
"@remix-run/serve": "workspace:*", | ||
"@remix-run/server-runtime": "workspace:*", | ||
"isbot": "^4.1.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@remix-run/dev": "workspace:*", | ||
"@types/react": "^18.2.20", | ||
"@types/react-dom": "^18.2.7", | ||
"typescript": "^5.1.0", | ||
"vite": "5.1.3", | ||
"vite-tsconfig-paths": "^4.2.1" | ||
}, | ||
"dependenciesMeta": { | ||
"@remix-run/dev": { | ||
"injected": true | ||
}, | ||
"@remix-run/node": { | ||
"injected": true | ||
}, | ||
"@remix-run/react": { | ||
"injected": true | ||
}, | ||
"@remix-run/serve": { | ||
"injected": true | ||
}, | ||
"@remix-run/server-runtime": { | ||
"injected": true | ||
} | ||
} | ||
Comment on lines
+29
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is necessary for deno as these packages are cjs and not esm. deno will refuse to run userland cjs code which is what happens due to the workspace dependencies in node_modules being symlinked by default with pnpm. |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"include": [ | ||
"app/**/*.ts", | ||
"app/**/*.tsx", | ||
"app/**/.server/**/*.ts", | ||
"app/**/.server/**/*.tsx", | ||
"app/**/.client/**/*.ts", | ||
"app/**/.client/**/*.tsx" | ||
], | ||
"compilerOptions": { | ||
"lib": ["DOM", "DOM.Iterable", "ES2022"], | ||
"types": ["vite/client"], | ||
"isolatedModules": true, | ||
"esModuleInterop": true, | ||
"jsx": "react-jsx", | ||
"module": "ESNext", | ||
"moduleResolution": "Bundler", | ||
"resolveJsonModule": true, | ||
"target": "ES2022", | ||
"strict": true, | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"baseUrl": ".", | ||
"paths": { | ||
"~/*": ["./app/*"] | ||
}, | ||
|
||
// Vite takes care of building everything, not tsc. | ||
"noEmit": true | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { vitePlugin as remix } from "@remix-run/dev"; | ||
import { defineConfig } from "vite"; | ||
import tsconfigPaths from "vite-tsconfig-paths"; | ||
|
||
export default defineConfig({ | ||
plugins: [remix(), tsconfigPaths()], | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively this could be
npx create-remix@latest --template remix-run/remix/templates/deno --package-manager deno
, but i think using deno here makes more sense as it avoids needing another runtime + package manager just to scaffold.