Skip to content

Commit

Permalink
feat(templates/deno): use npm-managed dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed May 9, 2022
1 parent 4b6cb26 commit 5e84dc1
Show file tree
Hide file tree
Showing 22 changed files with 41 additions and 402 deletions.
9 changes: 5 additions & 4 deletions packages/remix-dev/cli/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -452,14 +452,15 @@ function isRemixStack(input: string) {

function isRemixTemplate(input: string) {
return [
"remix",
"express",
"arc",
"cloudflare-pages",
"cloudflare-workers",
"deno",
"express",
"fly",
"netlify",
"remix",
"vercel",
"cloudflare-pages",
"cloudflare-workers",
].includes(input);
}

Expand Down
1 change: 1 addition & 0 deletions templates/deno/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
15 changes: 15 additions & 0 deletions templates/deno/.vscode/resolve_npm_imports.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"// This import map is used solely for the denoland.vscode-deno extension.": "",
"// Remix does not support import maps.": "",
"// Dependency management is done through `npm` and `node_modules/` instead.": "",
"// Deno-only dependencies may be imported via URL imports (without using import maps).": "",

"imports": {
"react": "https://esm.sh/react@18.0.0",
"react-dom": "https://esm.sh/react-dom@18.0.0",
"react-dom/server": "https://esm.sh/react-dom@18.0.0/server",
"@remix-run/dev/server-build": "https://esm.sh/@remix-run/dev@1.4.3/server-build",
"@remix-run/deno": "https://esm.sh/@remix-run/deno@1.4.3",
"@remix-run/react": "https://esm.sh/@remix-run/react@1.4.3"
}
}
3 changes: 2 additions & 1 deletion templates/deno/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"deno.enable": true,
"deno.lint": true
"deno.lint": true,
"deno.importMap": "./.vscode/resolve_npm_imports.json"
}
10 changes: 0 additions & 10 deletions templates/deno/app/deps/@remix-run/react.ts

This file was deleted.

7 changes: 0 additions & 7 deletions templates/deno/app/deps/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions templates/deno/app/deps/react-dom-server.ts

This file was deleted.

1 change: 0 additions & 1 deletion templates/deno/app/deps/react-dom.ts

This file was deleted.

1 change: 0 additions & 1 deletion templates/deno/app/deps/react.ts

This file was deleted.

6 changes: 3 additions & 3 deletions templates/deno/app/entry.client.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "./deps/react.ts";
import ReactDOM from "./deps/react-dom.ts";
import { RemixBrowser } from "./deps/@remix-run/react.ts";
import React from "react";
import ReactDOM from "react-dom";
import { RemixBrowser } from "@remix-run/react";

ReactDOM.hydrate(<RemixBrowser />, document);
8 changes: 4 additions & 4 deletions templates/deno/app/entry.server.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "./deps/react.ts";
import { renderToString } from "./deps/react-dom-server.ts";
import { RemixServer } from "./deps/@remix-run/react.ts";
import type { EntryContext } from "../remix-deno/index.ts";
import React from "react";
import { renderToString } from "react-dom/server";
import { RemixServer } from "@remix-run/react";
import type { EntryContext } from "@remix-run/deno";

export default function handleRequest(
request: Request,
Expand Down
6 changes: 3 additions & 3 deletions templates/deno/app/root.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from "./deps/react.ts";
import React from "react";
import {
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from "./deps/@remix-run/react.ts";
import type { MetaFunction } from "../remix-deno/index.ts";
} from "@remix-run/react";
import type { MetaFunction } from "@remix-run/deno";

export const meta: MetaFunction = () => ({
charset: "utf-8",
Expand Down
2 changes: 1 addition & 1 deletion templates/deno/app/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "../deps/react.ts";
import React from "react";

export default function Index() {
return (
Expand Down
6 changes: 6 additions & 0 deletions templates/deno/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@
},
"engines": {
"node": ">=14"
},
"dependencies": {
"@remix-run/deno": "*",
"@remix-run/react": "*",
"react": "^18.1.0",
"react-dom": "^18.1.0"
}
}
4 changes: 0 additions & 4 deletions templates/deno/remix-deno/README.md

This file was deleted.

55 changes: 0 additions & 55 deletions templates/deno/remix-deno/crypto.ts

This file was deleted.

14 changes: 0 additions & 14 deletions templates/deno/remix-deno/deps/@remix-run/server-runtime.ts

This file was deleted.

15 changes: 0 additions & 15 deletions templates/deno/remix-deno/implementations.ts

This file was deleted.

56 changes: 0 additions & 56 deletions templates/deno/remix-deno/index.ts

This file was deleted.

104 changes: 0 additions & 104 deletions templates/deno/remix-deno/server.ts

This file was deleted.

Loading

0 comments on commit 5e84dc1

Please sign in to comment.