diff --git a/integration/helpers/create-fixture.tsx b/integration/helpers/create-fixture.tsx index 6e82b6a48e5..388c54be105 100644 --- a/integration/helpers/create-fixture.tsx +++ b/integration/helpers/create-fixture.tsx @@ -23,7 +23,16 @@ const REMIX_SOURCE_BUILD_DIR = path.join(process.cwd(), "build"); interface FixtureInit { files: { [filename: string]: string }; - template?: string; + template?: + | "arc" + | "cloudflare-pages" + | "cloudflare-workers" + | "deno" + | "express" + | "fly" + | "netlify" + | "remix" + | "vercel"; } export type Fixture = Awaited>; diff --git a/integration/helpers/global-setup.ts b/integration/helpers/global-setup.ts index 83cff497801..12bb43e84ef 100644 --- a/integration/helpers/global-setup.ts +++ b/integration/helpers/global-setup.ts @@ -1,17 +1,13 @@ -import fs from "fs/promises"; +import fse from "fs-extra"; import path from "path"; import setupPuppeteer from "jest-environment-puppeteer/setup"; -export const TMP_DIR = path.join(process.cwd(), ".tmp"); +export const TMP_DIR = path.join(process.cwd(), ".tmp", "integration"); // TODO: get rid of React Router `console.warn` when no routes match when testing console.warn = () => {}; export default async function setup(globalConfig: any) { await setupPuppeteer(globalConfig); - await fs.rm(TMP_DIR, { - force: true, - recursive: true, - }); - await fs.mkdir(TMP_DIR); + await fse.emptyDir(TMP_DIR); } diff --git a/jest.config.js b/jest.config.js index a0dd3ae6ebe..fd6be0cde3c 100644 --- a/jest.config.js +++ b/jest.config.js @@ -32,6 +32,7 @@ module.exports = { setupFilesAfterEnv: [ "/packages/remix-dev/__tests__/setupAfterEnv.ts", ], + globalSetup: process.env.CI ? undefined : "/jest/buildRemix.ts", }, { displayName: "remix-express", diff --git a/packages/remix-dev/__tests__/cli-test.ts b/packages/remix-dev/__tests__/cli-test.ts index e2f81e672ba..f444787f934 100644 --- a/packages/remix-dev/__tests__/cli-test.ts +++ b/packages/remix-dev/__tests__/cli-test.ts @@ -1,6 +1,5 @@ import childProcess from "child_process"; -import fs from "fs"; -import fsp from "fs/promises"; +import fse from "fs-extra"; import path from "path"; import util from "util"; import { pathToFileURL } from "url"; @@ -16,13 +15,14 @@ const remix = path.resolve( "../../../build/node_modules/@remix-run/dev/cli.js" ); +const TEMP_DIR = path.join(process.cwd(), ".tmp", "create-remix"); + describe("remix cli", () => { beforeAll(() => { - if (!fs.existsSync(remix)) { + if (!fse.existsSync(remix)) { throw new Error(`Cannot run Remix CLI tests w/out building Remix`); } }); - describe("the --help flag", () => { it("prints help info", async () => { let { stdout } = await execFile("node", [remix, "--help"], { @@ -134,6 +134,10 @@ describe("remix cli", () => { }); describe("the create command", () => { + beforeAll(async () => { + await fse.emptyDir(TEMP_DIR); + }); + afterAll(() => { /** * This prevents the console for spitting out a bunch of junk like this for @@ -147,22 +151,21 @@ describe("remix cli", () => { */ async function renamePkgJsonApp(dir: string) { let pkgPath = path.join(dir, "package.json"); - let pkg = await fsp.readFile(pkgPath); + let pkg = await fse.readFile(pkgPath); let obj = JSON.parse(pkg.toString()); obj.name = path.basename(dir); - await fsp.writeFile(pkgPath, JSON.stringify(obj, null, 2) + "\n"); + await fse.writeFile(pkgPath, JSON.stringify(obj, null, 2) + "\n"); } - let dirs = fs.readdirSync(path.join(process.cwd(), ".tmp")); + let dirs = fse.readdirSync(TEMP_DIR); for (let dir of dirs) { - renamePkgJsonApp(path.join(process.cwd(), ".tmp", dir)); + renamePkgJsonApp(path.join(TEMP_DIR, dir)); } }); function getProjectDir(name: string) { return path.join( - process.cwd(), - ".tmp", + TEMP_DIR, `${name}-${Math.random().toString(32).slice(2)}` ); } @@ -181,8 +184,12 @@ describe("remix cli", () => { expect(stdout.trim()).toBe( `💿 That's it! \`cd\` into "${projectDir}" and check the README for development and deploy instructions!` ); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.tsx"))).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); }); it("works for templates in the remix org", async () => { @@ -199,8 +206,12 @@ describe("remix cli", () => { `💿 You've opted out of installing dependencies so we won't run the remix.init/index.js script for you just yet. Once you've installed dependencies, you can run it manually with \`npx remix init\` 💿 That's it! \`cd\` into "${projectDir}" and check the README for development and deploy instructions!` ); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.tsx"))).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); }); it("works for GitHub username/repo combo", async () => { @@ -216,8 +227,12 @@ describe("remix cli", () => { expect(stdout.trim()).toBe( `💿 That's it! \`cd\` into "${projectDir}" and check the README for development and deploy instructions!` ); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.tsx"))).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); }); it("works for remote tarballs", async () => { @@ -233,11 +248,15 @@ describe("remix cli", () => { expect(stdout.trim()).toBe( `💿 That's it! \`cd\` into "${projectDir}" and check the README for development and deploy instructions!` ); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.tsx"))).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); }); - it("works for different branches", async () => { + it.skip("works for different branches", async () => { let projectDir = getProjectDir("diff-branch"); let { stdout } = await execFile("node", [ remix, @@ -250,8 +269,12 @@ describe("remix cli", () => { expect(stdout.trim()).toBe( `💿 That's it! \`cd\` into "${projectDir}" and check the README for development and deploy instructions!` ); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.jsx"))).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); }); it("works for a path to a tarball on disk", async () => { @@ -267,8 +290,12 @@ describe("remix cli", () => { expect(stdout.trim()).toBe( `💿 That's it! \`cd\` into "${projectDir}" and check the README for development and deploy instructions!` ); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.tsx"))).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); }); it("works for a file URL to a tarball on disk", async () => { @@ -286,8 +313,50 @@ describe("remix cli", () => { expect(stdout.trim()).toBe( `💿 That's it! \`cd\` into "${projectDir}" and check the README for development and deploy instructions!` ); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.tsx"))).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); + }); + + it("converts a template to javascript", async () => { + let projectDir = getProjectDir("template-to-js"); + let { stdout } = await execFile("node", [ + remix, + "create", + projectDir, + "--template", + "blues-stack", + "--no-install", + "--no-typescript", + ]); + expect(stdout.trim()).toBe( + `💿 You've opted out of installing dependencies so we won't run the remix.init/index.js script for you just yet. Once you've installed dependencies, you can run it manually with \`npx remix init\` +💿 That's it! \`cd\` into "${projectDir}" and check the README for development and deploy instructions!` + ); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.jsx")) + ).toBeTruthy(); + expect(fse.existsSync(path.join(projectDir, "app/root.tsx"))).toBeFalsy(); + expect( + fse.existsSync(path.join(projectDir, "tsconfig.json")) + ).toBeFalsy(); + expect( + fse.existsSync(path.join(projectDir, "jsconfig.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/session.server.js")) + ).toBeTruthy(); + let pkgJSON = JSON.parse( + fse.readFileSync(path.join(projectDir, "package.json"), "utf-8") + ); + expect(Object.keys(pkgJSON.devDependencies)).not.toContain("typescript"); + expect(Object.keys(pkgJSON.scripts)).not.toContain("typecheck"); }); it("works for a file path to a directory on disk", async () => { @@ -303,8 +372,12 @@ describe("remix cli", () => { expect(stdout.trim()).toBe( `💿 That's it! \`cd\` into "${projectDir}" and check the README for development and deploy instructions!` ); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.tsx"))).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); }); it("works for a file URL to a directory on disk", async () => { @@ -320,8 +393,12 @@ describe("remix cli", () => { expect(stdout.trim()).toBe( `💿 That's it! \`cd\` into "${projectDir}" and check the README for development and deploy instructions!` ); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.tsx"))).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); }); it("runs remix.init script when installing dependencies", async () => { @@ -338,10 +415,14 @@ describe("remix cli", () => { `💿 That's it! \`cd\` into "${projectDir}" and check the README for development and deploy instructions!` ); expect(stdout.trim()).toContain(`💿 Running remix.init script`); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.tsx"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "test.txt"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "remix.init"))).toBeFalsy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); + expect(fse.existsSync(path.join(projectDir, "test.txt"))).toBeTruthy(); + expect(fse.existsSync(path.join(projectDir, "remix.init"))).toBeFalsy(); // deps can take a bit to install }, 60_000); @@ -364,11 +445,15 @@ describe("remix cli", () => { }); expect(initResult.stdout.trim()).toBe(""); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.tsx"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "test.txt"))).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); + expect(fse.existsSync(path.join(projectDir, "test.txt"))).toBeTruthy(); // if you run `remix init` keep around the remix.init directory for future use - expect(fs.existsSync(path.join(projectDir, "remix.init"))).toBeTruthy(); + expect(fse.existsSync(path.join(projectDir, "remix.init"))).toBeTruthy(); // deps can take a bit to install }, 60_000); @@ -385,10 +470,14 @@ describe("remix cli", () => { ]) ).rejects.toThrowError(`🚨 Oops, remix.init failed`); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.tsx"))).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); // we should keep remix.init around if the init script fails - expect(fs.existsSync(path.join(projectDir, "remix.init"))).toBeTruthy(); + expect(fse.existsSync(path.join(projectDir, "remix.init"))).toBeTruthy(); // deps can take a bit to install }, 60_000); @@ -412,10 +501,14 @@ describe("remix cli", () => { cwd: projectDir, }) ).rejects.toThrowError(`🚨 Oops, remix.init failed`); - expect(fs.existsSync(path.join(projectDir, "package.json"))).toBeTruthy(); - expect(fs.existsSync(path.join(projectDir, "app/root.tsx"))).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "package.json")) + ).toBeTruthy(); + expect( + fse.existsSync(path.join(projectDir, "app/root.tsx")) + ).toBeTruthy(); // we should keep remix.init around if the init script fails - expect(fs.existsSync(path.join(projectDir, "remix.init"))).toBeTruthy(); + expect(fse.existsSync(path.join(projectDir, "remix.init"))).toBeTruthy(); // deps can take a bit to install }, 60_000); }); diff --git a/packages/remix-dev/cli/create.ts b/packages/remix-dev/cli/create.ts index c9f841871e7..5590c99af55 100644 --- a/packages/remix-dev/cli/create.ts +++ b/packages/remix-dev/cli/create.ts @@ -9,6 +9,13 @@ import * as semver from "semver"; import { fileURLToPath } from "url"; import { execSync } from "child_process"; import sortPackageJSON from "sort-package-json"; +import glob from "fast-glob"; +import * as babel from "@babel/core"; +// @ts-expect-error these modules dont have types +import babelPluginSyntaxJSX from "@babel/plugin-syntax-jsx"; +// @ts-expect-error these modules dont have types +import babelPresetTypeScript from "@babel/preset-typescript"; +import prettier from "prettier"; import packageJson from "../package.json"; @@ -28,7 +35,7 @@ export async function createApp({ projectDir, remixVersion = remixDevPackageVersion, installDeps, - useTypeScript, + useTypeScript = true, githubToken = process.env.GITHUB_TOKEN, }: CreateAppArgs) { // Check the node version @@ -135,15 +142,10 @@ export async function createApp({ appPkg = sortPackageJSON(appPkg); await fse.writeJSON(path.join(projectDir, "package.json"), appPkg, { spaces: 2, - replacer: null, }); if (!useTypeScript) { - // TODO: - // 1. Convert all .ts files in the template to .js - // 2. Rename the tsconfig.json to jsconfig.json - // 3. Remove @types/* and typescript from package.json - // 4. Remove typecheck npm script from package.json + await convertTemplateToJavaScript(projectDir); } if (installDeps) { @@ -198,9 +200,7 @@ async function downloadAndExtractTemplateOrExample( let cwd = path.dirname(projectDir); let desiredDir = path.basename(projectDir); - let exampleOrTemplateName = - type === "templates" && options.useTypeScript ? `${name}-ts` : name; - let templateDir = path.join(desiredDir, type, exampleOrTemplateName); + let templateDir = path.join(desiredDir, type, name); await pipeline( response.body.pipe(gunzip()), tar.extract(cwd, { @@ -391,9 +391,8 @@ async function isRemixTemplate( ); } let results = await promise.json(); - let possibleTemplateName = useTypeScript ? `${name}-ts` : name; let template = results.find((result: any) => { - return result.name === possibleTemplateName; + return result.name === name; }); if (!template) return undefined; return template.name; @@ -415,7 +414,9 @@ async function isRemixExample(name: string, token?: string) { ); } let results = await promise.json(); - let example = results.find((result: any) => result.name === name); + let example = results.find((result: any) => { + return result.name === name; + }); if (!example) return undefined; return example.name; } @@ -451,3 +452,84 @@ async function detectTemplateType( } return "remoteTarball"; } + +function convertToJavaScript( + filename: string, + source: string, + projectDir: string +): string { + let result = babel.transformSync(source, { + filename, + presets: [[babelPresetTypeScript, { jsx: "preserve" }]], + plugins: [babelPluginSyntaxJSX], + compact: false, + retainLines: true, + cwd: projectDir, + }); + + if (!result || !result.code) { + throw new Error("Could not parse typescript"); + } + + /* + Babel's `compact` and `retainLines` options are both bad at formatting code. + Use Prettier for nicer formatting. + */ + return prettier.format(result.code, { parser: "babel" }); +} + +async function convertTemplateToJavaScript(projectDir: string) { + // 1. Convert all .ts files in the template to .js + let entries = glob.sync("**/*.+(ts|tsx)", { + cwd: projectDir, + absolute: true, + }); + for (let entry of entries) { + if (entry.endsWith(".d.ts")) { + fse.removeSync(entry); + continue; + } + + let contents = fse.readFileSync(entry, "utf8"); + let filename = path.basename(entry); + let javascript = convertToJavaScript(filename, contents, projectDir); + + fse.writeFileSync(entry, javascript, "utf8"); + if (entry.endsWith(".tsx")) { + fse.renameSync(entry, entry.replace(/\.tsx?$/, ".jsx")); + } else { + fse.renameSync(entry, entry.replace(/\.ts?$/, ".js")); + } + } + + // 2. Rename the tsconfig.json to jsconfig.json + if (fse.existsSync(path.join(projectDir, "tsconfig.json"))) { + fse.renameSync( + path.join(projectDir, "tsconfig.json"), + path.join(projectDir, "jsconfig.json") + ); + } + + // 3. Remove @types/* and typescript from package.json + let packageJson = path.join(projectDir, "package.json"); + if (!fse.existsSync(packageJson)) { + throw new Error("Could not find package.json"); + } + let pkg = JSON.parse(fse.readFileSync(packageJson, "utf8")); + let devDeps = pkg.devDependencies || {}; + let newPackageJson = { + ...pkg, + devDependencies: Object.fromEntries( + Object.entries(devDeps).filter(([name]) => { + return !name.startsWith("@types/") && name !== "typescript"; + }) + ), + }; + // 4. Remove typecheck npm script from package.json + if (pkg.scripts && pkg.scripts.typecheck) { + delete pkg.scripts.typecheck; + } + fse.writeJSONSync(path.join(projectDir, "package.json"), newPackageJson, { + spaces: 2, + }); +} diff --git a/templates/arc-ts/.eslintrc b/templates/arc-ts/.eslintrc deleted file mode 100644 index 71569754629..00000000000 --- a/templates/arc-ts/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node"] -} diff --git a/templates/arc-ts/.gitignore b/templates/arc-ts/.gitignore deleted file mode 100644 index 592d769e5d8..00000000000 --- a/templates/arc-ts/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -node_modules - -/.cache -/server/index.js -/public/build -preferences.arc -sam.json -sam.yaml -.env diff --git a/templates/arc-ts/README.md b/templates/arc-ts/README.md deleted file mode 100644 index 042789e57a9..00000000000 --- a/templates/arc-ts/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# Welcome to Remix! - -- [Remix Docs](https://remix.run/docs) - -## Architect Setup - -When deploying to AWS Lambda with Architect, you'll need: - -- Architect (`arc`) CLI -- AWS SDK - -Architect recommends installing these globally: - -```sh -npm i -g @architect/architect aws-sdk -``` - -## Development - -You will be running two processes during development when using Architect as your server. - -- Your Architect server sandbox in one -- The Remix development server in another - -```sh -# in one tab -arc sandbox - -# in another -npm run dev -``` - -Open up [http://localhost:3333](http://localhost:3333) and you should be ready to go! - -If you'd rather run everything in a single tab, you can look at [concurrently](https://npm.im/concurrently) or similar tools to run both processes in one tab. - -## Deploying - -Before you can deploy, you'll need to do some setup with AWS: - -- First [install the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html) -- Then [follow the Architect setup instructions](https://arc.codes/docs/en/guides/get-started/detailed-aws-setup). - -If you make it through all of that, you're ready to deploy! - -1. build the app for production: - - ```sh - npm run build - ``` - -2. Deploy with `arc` - - ```sh - arc deploy production - ``` - -You're in business! diff --git a/templates/arc-ts/app.arc b/templates/arc-ts/app.arc deleted file mode 100644 index 4e472fca56b..00000000000 --- a/templates/arc-ts/app.arc +++ /dev/null @@ -1,14 +0,0 @@ -@app -remix-architect-app - -@http -/* - method any - src server - -@static - -# @aws -# profile default -# region us-west-1 - \ No newline at end of file diff --git a/templates/arc-ts/package.json b/templates/arc-ts/package.json deleted file mode 100644 index 47b2849ecdb..00000000000 --- a/templates/arc-ts/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "remix-template-arc-ts", - "private": true, - "description": "", - "license": "", - "sideEffects": false, - "scripts": { - "build": "remix build", - "dev:remix": "remix watch", - "dev:arc": "cross-env NODE_ENV=development arc sandbox", - "dev": "remix build && run-p dev:*", - "postinstall": "remix setup node", - "start": "cross-env NODE_ENV=production arc sandbox" - }, - "dependencies": { - "@remix-run/architect": "*", - "@remix-run/react": "*", - "cross-env": "^7.0.3", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "remix": "*" - }, - "devDependencies": { - "@remix-run/dev": "*", - "@remix-run/eslint-config": "*", - "@types/react": "^17.0.24", - "@types/react-dom": "^17.0.9", - "eslint": "^8.11.0", - "npm-run-all": "^4.1.5", - "typescript": "^4.5.5" - }, - "engines": { - "node": ">=14" - } -} diff --git a/templates/arc-ts/remix.config.js b/templates/arc-ts/remix.config.js deleted file mode 100644 index ad1e1898bef..00000000000 --- a/templates/arc-ts/remix.config.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @type {import('@remix-run/dev').AppConfig} - */ -module.exports = { - serverBuildTarget: "arc", - server: "./server.js", - ignoredRouteFiles: [".*"], - // appDirectory: "app", - // assetsBuildDirectory: "public/build", - // serverBuildPath: "server/index.js", - // publicPath: "/_static/build/", -}; diff --git a/templates/arc-ts/server.js b/templates/arc-ts/server.js deleted file mode 100644 index 11817bb6b63..00000000000 --- a/templates/arc-ts/server.js +++ /dev/null @@ -1,7 +0,0 @@ -import { createRequestHandler } from "@remix-run/architect"; -import * as build from "@remix-run/dev/server-build"; - -export const handler = createRequestHandler({ - build, - mode: process.env.NODE_ENV, -}); diff --git a/templates/arc-ts/server/config.arc b/templates/arc-ts/server/config.arc deleted file mode 100644 index 3d11ce0fc30..00000000000 --- a/templates/arc-ts/server/config.arc +++ /dev/null @@ -1,5 +0,0 @@ -@aws -runtime nodejs14.x -# memory 1152 -# timeout 30 -# concurrency 1 diff --git a/templates/arc/app/entry.client.jsx b/templates/arc/app/entry.client.jsx deleted file mode 100644 index a19979b2527..00000000000 --- a/templates/arc/app/entry.client.jsx +++ /dev/null @@ -1,4 +0,0 @@ -import { hydrate } from "react-dom"; -import { RemixBrowser } from "remix"; - -hydrate(, document); diff --git a/templates/arc-ts/app/entry.client.tsx b/templates/arc/app/entry.client.tsx similarity index 100% rename from templates/arc-ts/app/entry.client.tsx rename to templates/arc/app/entry.client.tsx diff --git a/templates/arc/app/entry.server.jsx b/templates/arc/app/entry.server.jsx deleted file mode 100644 index 496f0348c27..00000000000 --- a/templates/arc/app/entry.server.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import { renderToString } from "react-dom/server"; -import { RemixServer } from "remix"; - -export default function handleRequest( - request, - responseStatusCode, - responseHeaders, - remixContext -) { - let markup = renderToString( - - ); - - responseHeaders.set("Content-Type", "text/html"); - - return new Response("" + markup, { - status: responseStatusCode, - headers: responseHeaders, - }); -} diff --git a/templates/arc-ts/app/entry.server.tsx b/templates/arc/app/entry.server.tsx similarity index 100% rename from templates/arc-ts/app/entry.server.tsx rename to templates/arc/app/entry.server.tsx diff --git a/templates/arc/app/root.jsx b/templates/arc/app/root.jsx deleted file mode 100644 index 2e065156521..00000000000 --- a/templates/arc/app/root.jsx +++ /dev/null @@ -1,33 +0,0 @@ -import { - Links, - LiveReload, - Meta, - Outlet, - Scripts, - ScrollRestoration, -} from "remix"; - -export function meta() { - return { - charset: "utf-8", - title: "New Remix App", - viewport: "width=device-width,initial-scale=1", - }; -} - -export default function App() { - return ( - - - - - - - - - - - - - ); -} diff --git a/templates/arc-ts/app/root.tsx b/templates/arc/app/root.tsx similarity index 100% rename from templates/arc-ts/app/root.tsx rename to templates/arc/app/root.tsx diff --git a/templates/arc/app/routes/index.jsx b/templates/arc/app/routes/index.jsx deleted file mode 100644 index cbca6124ea7..00000000000 --- a/templates/arc/app/routes/index.jsx +++ /dev/null @@ -1,32 +0,0 @@ -export default function Index() { - return ( - - ); -} diff --git a/templates/arc-ts/app/routes/index.tsx b/templates/arc/app/routes/index.tsx similarity index 100% rename from templates/arc-ts/app/routes/index.tsx rename to templates/arc/app/routes/index.tsx diff --git a/templates/arc/jsconfig.json b/templates/arc/jsconfig.json deleted file mode 100644 index 02effea5b1f..00000000000 --- a/templates/arc/jsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "baseUrl": ".", - "paths": { - "~/*": ["./app/*"] - } - } -} diff --git a/templates/arc/package.json b/templates/arc/package.json index 5c9bb73ad45..c407da33025 100644 --- a/templates/arc/package.json +++ b/templates/arc/package.json @@ -23,8 +23,11 @@ "devDependencies": { "@remix-run/dev": "*", "@remix-run/eslint-config": "*", + "@types/react": "^17.0.24", + "@types/react-dom": "^17.0.9", "eslint": "^8.11.0", - "npm-run-all": "^4.1.5" + "npm-run-all": "^4.1.5", + "typescript": "^4.5.5" }, "engines": { "node": ">=14" diff --git a/templates/arc-ts/remix.env.d.ts b/templates/arc/remix.env.d.ts similarity index 100% rename from templates/arc-ts/remix.env.d.ts rename to templates/arc/remix.env.d.ts diff --git a/templates/arc-ts/tsconfig.json b/templates/arc/tsconfig.json similarity index 100% rename from templates/arc-ts/tsconfig.json rename to templates/arc/tsconfig.json diff --git a/templates/cloudflare-pages-ts/.eslintrc b/templates/cloudflare-pages-ts/.eslintrc deleted file mode 100644 index 8828ca31d3a..00000000000 --- a/templates/cloudflare-pages-ts/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["@remix-run/eslint-config"] -} diff --git a/templates/cloudflare-pages-ts/.gitignore b/templates/cloudflare-pages-ts/.gitignore deleted file mode 100644 index e42f442a59f..00000000000 --- a/templates/cloudflare-pages-ts/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules - -/.cache -/functions/\[\[path\]\].js -/public/build -.env diff --git a/templates/cloudflare-pages-ts/.node-version b/templates/cloudflare-pages-ts/.node-version deleted file mode 100644 index d77ff0e21ac..00000000000 --- a/templates/cloudflare-pages-ts/.node-version +++ /dev/null @@ -1 +0,0 @@ -16.7.0 \ No newline at end of file diff --git a/templates/cloudflare-pages-ts/README.md b/templates/cloudflare-pages-ts/README.md deleted file mode 100644 index 130feb1486c..00000000000 --- a/templates/cloudflare-pages-ts/README.md +++ /dev/null @@ -1,22 +0,0 @@ -# Welcome to Remix! - -- [Remix Docs](https://remix.run/docs) - -## Development - -You will be utilizing Wrangler for local development to emulate the Cloudflare runtime. This is already wired up in your package.json as the `dev` script: - -```sh -# start the remix dev server and wrangler -npm run dev -``` - -Open up [http://127.0.0.1:8788](http://127.0.0.1:8788) and you should be ready to go! - -## Deployment - -Cloudflare Pages are currently only deployable through their Git provider integrations. - -If you don't already have an account, then [create a Cloudflare account here](https://dash.cloudflare.com/sign-up/pages) and after verifying your email address with Cloudflare, go to your dashboard and follow the [Cloudflare Pages deployment guide](https://developers.cloudflare.com/pages/framework-guides/deploy-anything). - -Configure the "Build command" should be set to `npm run build`, and the "Build output directory" should be set to `public`. diff --git a/templates/cloudflare-pages-ts/package.json b/templates/cloudflare-pages-ts/package.json deleted file mode 100644 index b2fe93f2d24..00000000000 --- a/templates/cloudflare-pages-ts/package.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "remix-template-cloudflare-pages-ts", - "private": true, - "description": "", - "license": "", - "sideEffects": false, - "scripts": { - "build": "remix build", - "dev:remix": "remix watch", - "dev:wrangler": "cross-env NODE_ENV=development wrangler pages dev ./public", - "dev": "remix build && run-p dev:*", - "postinstall": "remix setup cloudflare-pages", - "start": "cross-env NODE_ENV=production npm run dev:wrangler" - }, - "dependencies": { - "@remix-run/cloudflare-pages": "*", - "@remix-run/react": "*", - "cross-env": "^7.0.3", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "remix": "*" - }, - "devDependencies": { - "@cloudflare/workers-types": "^3.2.0", - "@remix-run/dev": "*", - "@remix-run/eslint-config": "*", - "@types/react": "^17.0.24", - "@types/react-dom": "^17.0.9", - "eslint": "^8.11.0", - "npm-run-all": "^4.1.5", - "typescript": "^4.5.5", - "wrangler": "beta" - }, - "engines": { - "node": ">=14" - } -} diff --git a/templates/cloudflare-pages-ts/public/_headers b/templates/cloudflare-pages-ts/public/_headers deleted file mode 100644 index 2fb104e7af1..00000000000 --- a/templates/cloudflare-pages-ts/public/_headers +++ /dev/null @@ -1,2 +0,0 @@ -/build/* - Cache-Control: public, max-age=31536000, s-maxage=31536000 diff --git a/templates/cloudflare-pages-ts/public/favicon.ico b/templates/cloudflare-pages-ts/public/favicon.ico deleted file mode 100644 index 8830cf6821b..00000000000 Binary files a/templates/cloudflare-pages-ts/public/favicon.ico and /dev/null differ diff --git a/templates/cloudflare-pages-ts/remix.config.js b/templates/cloudflare-pages-ts/remix.config.js deleted file mode 100644 index d12eed25c39..00000000000 --- a/templates/cloudflare-pages-ts/remix.config.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @type {import('@remix-run/dev').AppConfig} - */ -module.exports = { - serverBuildTarget: "cloudflare-pages", - server: "./server.js", - devServerBroadcastDelay: 1000, - ignoredRouteFiles: [".*"], - // appDirectory: "app", - // assetsBuildDirectory: "public/build", - // serverBuildPath: "functions/[[path]].js", - // publicPath: "/build/", -}; diff --git a/templates/cloudflare-pages-ts/server.js b/templates/cloudflare-pages-ts/server.js deleted file mode 100644 index 56f2749608e..00000000000 --- a/templates/cloudflare-pages-ts/server.js +++ /dev/null @@ -1,12 +0,0 @@ -import { createPagesFunctionHandler } from "@remix-run/cloudflare-pages"; -import * as build from "@remix-run/dev/server-build"; - -const handleRequest = createPagesFunctionHandler({ - build, - mode: process.env.NODE_ENV, - getLoadContext: (context) => context.env, -}); - -export function onRequest(context) { - return handleRequest(context); -} diff --git a/templates/cloudflare-pages/app/entry.client.jsx b/templates/cloudflare-pages/app/entry.client.jsx deleted file mode 100644 index a19979b2527..00000000000 --- a/templates/cloudflare-pages/app/entry.client.jsx +++ /dev/null @@ -1,4 +0,0 @@ -import { hydrate } from "react-dom"; -import { RemixBrowser } from "remix"; - -hydrate(, document); diff --git a/templates/cloudflare-pages-ts/app/entry.client.tsx b/templates/cloudflare-pages/app/entry.client.tsx similarity index 100% rename from templates/cloudflare-pages-ts/app/entry.client.tsx rename to templates/cloudflare-pages/app/entry.client.tsx diff --git a/templates/cloudflare-pages/app/entry.server.jsx b/templates/cloudflare-pages/app/entry.server.jsx deleted file mode 100644 index 496f0348c27..00000000000 --- a/templates/cloudflare-pages/app/entry.server.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import { renderToString } from "react-dom/server"; -import { RemixServer } from "remix"; - -export default function handleRequest( - request, - responseStatusCode, - responseHeaders, - remixContext -) { - let markup = renderToString( - - ); - - responseHeaders.set("Content-Type", "text/html"); - - return new Response("" + markup, { - status: responseStatusCode, - headers: responseHeaders, - }); -} diff --git a/templates/cloudflare-pages-ts/app/entry.server.tsx b/templates/cloudflare-pages/app/entry.server.tsx similarity index 100% rename from templates/cloudflare-pages-ts/app/entry.server.tsx rename to templates/cloudflare-pages/app/entry.server.tsx diff --git a/templates/cloudflare-pages/app/root.jsx b/templates/cloudflare-pages/app/root.jsx deleted file mode 100644 index 2e065156521..00000000000 --- a/templates/cloudflare-pages/app/root.jsx +++ /dev/null @@ -1,33 +0,0 @@ -import { - Links, - LiveReload, - Meta, - Outlet, - Scripts, - ScrollRestoration, -} from "remix"; - -export function meta() { - return { - charset: "utf-8", - title: "New Remix App", - viewport: "width=device-width,initial-scale=1", - }; -} - -export default function App() { - return ( - - - - - - - - - - - - - ); -} diff --git a/templates/cloudflare-pages-ts/app/root.tsx b/templates/cloudflare-pages/app/root.tsx similarity index 100% rename from templates/cloudflare-pages-ts/app/root.tsx rename to templates/cloudflare-pages/app/root.tsx diff --git a/templates/cloudflare-pages/app/routes/index.jsx b/templates/cloudflare-pages/app/routes/index.jsx deleted file mode 100644 index cbca6124ea7..00000000000 --- a/templates/cloudflare-pages/app/routes/index.jsx +++ /dev/null @@ -1,32 +0,0 @@ -export default function Index() { - return ( - - ); -} diff --git a/templates/cloudflare-pages-ts/app/routes/index.tsx b/templates/cloudflare-pages/app/routes/index.tsx similarity index 100% rename from templates/cloudflare-pages-ts/app/routes/index.tsx rename to templates/cloudflare-pages/app/routes/index.tsx diff --git a/templates/cloudflare-pages/jsconfig.json b/templates/cloudflare-pages/jsconfig.json deleted file mode 100644 index 02effea5b1f..00000000000 --- a/templates/cloudflare-pages/jsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "baseUrl": ".", - "paths": { - "~/*": ["./app/*"] - } - } -} diff --git a/templates/cloudflare-pages/package.json b/templates/cloudflare-pages/package.json index 3b295a45e14..62ecd2c1dd8 100644 --- a/templates/cloudflare-pages/package.json +++ b/templates/cloudflare-pages/package.json @@ -24,8 +24,11 @@ "@cloudflare/workers-types": "^3.2.0", "@remix-run/dev": "*", "@remix-run/eslint-config": "*", + "@types/react": "^17.0.24", + "@types/react-dom": "^17.0.9", "eslint": "^8.11.0", "npm-run-all": "^4.1.5", + "typescript": "^4.5.5", "wrangler": "beta" }, "engines": { diff --git a/templates/cloudflare-pages-ts/remix.env.d.ts b/templates/cloudflare-pages/remix.env.d.ts similarity index 100% rename from templates/cloudflare-pages-ts/remix.env.d.ts rename to templates/cloudflare-pages/remix.env.d.ts diff --git a/templates/cloudflare-pages-ts/tsconfig.json b/templates/cloudflare-pages/tsconfig.json similarity index 100% rename from templates/cloudflare-pages-ts/tsconfig.json rename to templates/cloudflare-pages/tsconfig.json diff --git a/templates/cloudflare-workers-ts/.eslintrc b/templates/cloudflare-workers-ts/.eslintrc deleted file mode 100644 index 8828ca31d3a..00000000000 --- a/templates/cloudflare-workers-ts/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["@remix-run/eslint-config"] -} diff --git a/templates/cloudflare-workers-ts/.gitignore b/templates/cloudflare-workers-ts/.gitignore deleted file mode 100644 index f0421bd7025..00000000000 --- a/templates/cloudflare-workers-ts/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -node_modules - -/.cache -/build -/dist -/public/build -/.mf -.env diff --git a/templates/cloudflare-workers-ts/README.md b/templates/cloudflare-workers-ts/README.md deleted file mode 100644 index 0d47d674c64..00000000000 --- a/templates/cloudflare-workers-ts/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# Welcome to Remix! - -- [Remix Docs](https://remix.run/docs) - -## Development - -You will be running two processes during development: - -- The Miniflare server (miniflare is a local environment for Cloudflare Workers) -- The Remix development server - -Both are started with one command: - -```sh -npm run dev -``` - -Open up [http://127.0.0.1:8787](http://127.0.0.1:8787) and you should be ready to go! - -If you want to check the production build, you can stop the dev server and run following commands: - -```sh -npm run build -npm start -``` - -Then refresh the same URL in your browser (no live reload for production builds). - -## Deployment - -Use [wrangler](https://developers.cloudflare.com/workers/cli-wrangler) to build and deploy your application to Cloudflare Workers. If you don't have it yet, follow [the installation guide](https://developers.cloudflare.com/workers/cli-wrangler/install-update) to get it setup. Be sure to [authenticate the CLI](https://developers.cloudflare.com/workers/cli-wrangler/authentication) as well. - -If you don't already have an account, then [create a cloudflare account here](https://dash.cloudflare.com/sign-up) and after verifying your email address with Cloudflare, go to your dashboard and set up your free custom Cloudflare Workers subdomain. - -Once that's done, you should be able to deploy your app: - -```sh -npm run deploy -``` diff --git a/templates/cloudflare-workers-ts/package.json b/templates/cloudflare-workers-ts/package.json deleted file mode 100644 index 4b4d05ffd8c..00000000000 --- a/templates/cloudflare-workers-ts/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "remix-template-cloudflare-workers-ts", - "private": true, - "description": "", - "license": "", - "sideEffects": false, - "main": "build/index.js", - "scripts": { - "build": "remix build", - "deploy": "npm run build && wrangler publish", - "dev:remix": "remix watch", - "dev:miniflare": "cross-env NODE_ENV=development miniflare ./build/index.js --watch", - "dev": "remix build && run-p dev:*", - "postinstall": "remix setup cloudflare-workers", - "start": "cross-env NODE_ENV=production miniflare ./build/index.js" - }, - "dependencies": { - "@remix-run/cloudflare-workers": "*", - "@remix-run/react": "*", - "cross-env": "^7.0.3", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "remix": "*" - }, - "devDependencies": { - "@cloudflare/workers-types": "^2.2.2", - "@remix-run/dev": "*", - "@remix-run/eslint-config": "*", - "@types/react": "^17.0.24", - "@types/react-dom": "^17.0.9", - "eslint": "^8.11.0", - "miniflare": "^2.1.0", - "npm-run-all": "^4.1.5", - "typescript": "^4.5.5" - }, - "engines": { - "node": ">=14" - } -} diff --git a/templates/cloudflare-workers-ts/public/favicon.ico b/templates/cloudflare-workers-ts/public/favicon.ico deleted file mode 100644 index 8830cf6821b..00000000000 Binary files a/templates/cloudflare-workers-ts/public/favicon.ico and /dev/null differ diff --git a/templates/cloudflare-workers-ts/remix.config.js b/templates/cloudflare-workers-ts/remix.config.js deleted file mode 100644 index df37633db9a..00000000000 --- a/templates/cloudflare-workers-ts/remix.config.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * @type {import('@remix-run/dev').AppConfig} - */ -module.exports = { - serverBuildTarget: "cloudflare-workers", - server: "./server.js", - devServerBroadcastDelay: 1000, - ignoredRouteFiles: [".*"], - // appDirectory: "app", - // assetsBuildDirectory: "public/build", - // serverBuildPath: "build/index.js", - // publicPath: "/build/", -}; diff --git a/templates/cloudflare-workers-ts/server.js b/templates/cloudflare-workers-ts/server.js deleted file mode 100644 index 4f4b2ad0aff..00000000000 --- a/templates/cloudflare-workers-ts/server.js +++ /dev/null @@ -1,7 +0,0 @@ -import { createEventHandler } from "@remix-run/cloudflare-workers"; -import * as build from "@remix-run/dev/server-build"; - -addEventListener( - "fetch", - createEventHandler({ build, mode: process.env.NODE_ENV }) -); diff --git a/templates/cloudflare-workers-ts/wrangler.toml b/templates/cloudflare-workers-ts/wrangler.toml deleted file mode 100644 index f12c0a92335..00000000000 --- a/templates/cloudflare-workers-ts/wrangler.toml +++ /dev/null @@ -1,17 +0,0 @@ -name = "remix-cloudflare-workers" -type = "javascript" - -zone_id = "" -account_id = "" -route = "" -workers_dev = true - -[site] -bucket = "./public" -entry-point = "." - -[build] -command = "npm run build" - -[build.upload] -format="service-worker" diff --git a/templates/cloudflare-workers/app/entry.client.jsx b/templates/cloudflare-workers/app/entry.client.jsx deleted file mode 100644 index a19979b2527..00000000000 --- a/templates/cloudflare-workers/app/entry.client.jsx +++ /dev/null @@ -1,4 +0,0 @@ -import { hydrate } from "react-dom"; -import { RemixBrowser } from "remix"; - -hydrate(, document); diff --git a/templates/cloudflare-workers-ts/app/entry.client.tsx b/templates/cloudflare-workers/app/entry.client.tsx similarity index 100% rename from templates/cloudflare-workers-ts/app/entry.client.tsx rename to templates/cloudflare-workers/app/entry.client.tsx diff --git a/templates/cloudflare-workers/app/entry.server.jsx b/templates/cloudflare-workers/app/entry.server.jsx deleted file mode 100644 index 496f0348c27..00000000000 --- a/templates/cloudflare-workers/app/entry.server.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import { renderToString } from "react-dom/server"; -import { RemixServer } from "remix"; - -export default function handleRequest( - request, - responseStatusCode, - responseHeaders, - remixContext -) { - let markup = renderToString( - - ); - - responseHeaders.set("Content-Type", "text/html"); - - return new Response("" + markup, { - status: responseStatusCode, - headers: responseHeaders, - }); -} diff --git a/templates/cloudflare-workers-ts/app/entry.server.tsx b/templates/cloudflare-workers/app/entry.server.tsx similarity index 100% rename from templates/cloudflare-workers-ts/app/entry.server.tsx rename to templates/cloudflare-workers/app/entry.server.tsx diff --git a/templates/cloudflare-workers/app/root.jsx b/templates/cloudflare-workers/app/root.jsx deleted file mode 100644 index 2e065156521..00000000000 --- a/templates/cloudflare-workers/app/root.jsx +++ /dev/null @@ -1,33 +0,0 @@ -import { - Links, - LiveReload, - Meta, - Outlet, - Scripts, - ScrollRestoration, -} from "remix"; - -export function meta() { - return { - charset: "utf-8", - title: "New Remix App", - viewport: "width=device-width,initial-scale=1", - }; -} - -export default function App() { - return ( - - - - - - - - - - - - - ); -} diff --git a/templates/cloudflare-workers-ts/app/root.tsx b/templates/cloudflare-workers/app/root.tsx similarity index 100% rename from templates/cloudflare-workers-ts/app/root.tsx rename to templates/cloudflare-workers/app/root.tsx diff --git a/templates/cloudflare-workers/app/routes/index.jsx b/templates/cloudflare-workers/app/routes/index.jsx deleted file mode 100644 index cbca6124ea7..00000000000 --- a/templates/cloudflare-workers/app/routes/index.jsx +++ /dev/null @@ -1,32 +0,0 @@ -export default function Index() { - return ( - - ); -} diff --git a/templates/cloudflare-workers-ts/app/routes/index.tsx b/templates/cloudflare-workers/app/routes/index.tsx similarity index 100% rename from templates/cloudflare-workers-ts/app/routes/index.tsx rename to templates/cloudflare-workers/app/routes/index.tsx diff --git a/templates/cloudflare-workers/jsconfig.json b/templates/cloudflare-workers/jsconfig.json deleted file mode 100644 index 02effea5b1f..00000000000 --- a/templates/cloudflare-workers/jsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "baseUrl": ".", - "paths": { - "~/*": ["./app/*"] - } - } -} diff --git a/templates/cloudflare-workers/package.json b/templates/cloudflare-workers/package.json index 10bb61342d8..4080f5efa77 100644 --- a/templates/cloudflare-workers/package.json +++ b/templates/cloudflare-workers/package.json @@ -26,9 +26,12 @@ "@cloudflare/workers-types": "^2.2.2", "@remix-run/dev": "*", "@remix-run/eslint-config": "*", + "@types/react": "^17.0.24", + "@types/react-dom": "^17.0.9", "eslint": "^8.11.0", "miniflare": "^2.1.0", - "npm-run-all": "^4.1.5" + "npm-run-all": "^4.1.5", + "typescript": "^4.5.5" }, "engines": { "node": ">=14" diff --git a/templates/cloudflare-workers-ts/remix.env.d.ts b/templates/cloudflare-workers/remix.env.d.ts similarity index 100% rename from templates/cloudflare-workers-ts/remix.env.d.ts rename to templates/cloudflare-workers/remix.env.d.ts diff --git a/templates/cloudflare-workers-ts/tsconfig.json b/templates/cloudflare-workers/tsconfig.json similarity index 100% rename from templates/cloudflare-workers-ts/tsconfig.json rename to templates/cloudflare-workers/tsconfig.json diff --git a/templates/deno-ts/public/favicon.ico b/templates/deno-ts/public/favicon.ico deleted file mode 100644 index 8830cf6821b..00000000000 Binary files a/templates/deno-ts/public/favicon.ico and /dev/null differ diff --git a/templates/deno-ts/.gitignore b/templates/deno/.gitignore similarity index 100% rename from templates/deno-ts/.gitignore rename to templates/deno/.gitignore diff --git a/templates/deno-ts/.vscode/settings.json b/templates/deno/.vscode/settings.json similarity index 100% rename from templates/deno-ts/.vscode/settings.json rename to templates/deno/.vscode/settings.json diff --git a/templates/deno-ts/README.md b/templates/deno/README.md similarity index 100% rename from templates/deno-ts/README.md rename to templates/deno/README.md diff --git a/templates/deno-ts/app/deps/@remix-run/react.ts b/templates/deno/app/deps/@remix-run/react.ts similarity index 100% rename from templates/deno-ts/app/deps/@remix-run/react.ts rename to templates/deno/app/deps/@remix-run/react.ts diff --git a/templates/deno-ts/app/deps/@remix-run/server-runtime.ts b/templates/deno/app/deps/@remix-run/server-runtime.ts similarity index 100% rename from templates/deno-ts/app/deps/@remix-run/server-runtime.ts rename to templates/deno/app/deps/@remix-run/server-runtime.ts diff --git a/templates/deno-ts/app/deps/README.md b/templates/deno/app/deps/README.md similarity index 100% rename from templates/deno-ts/app/deps/README.md rename to templates/deno/app/deps/README.md diff --git a/templates/deno-ts/app/deps/react-dom-server.ts b/templates/deno/app/deps/react-dom-server.ts similarity index 100% rename from templates/deno-ts/app/deps/react-dom-server.ts rename to templates/deno/app/deps/react-dom-server.ts diff --git a/templates/deno-ts/app/deps/react-dom.ts b/templates/deno/app/deps/react-dom.ts similarity index 100% rename from templates/deno-ts/app/deps/react-dom.ts rename to templates/deno/app/deps/react-dom.ts diff --git a/templates/deno-ts/app/deps/react.ts b/templates/deno/app/deps/react.ts similarity index 100% rename from templates/deno-ts/app/deps/react.ts rename to templates/deno/app/deps/react.ts diff --git a/templates/deno-ts/app/entry.client.tsx b/templates/deno/app/entry.client.tsx similarity index 100% rename from templates/deno-ts/app/entry.client.tsx rename to templates/deno/app/entry.client.tsx diff --git a/templates/deno-ts/app/entry.server.tsx b/templates/deno/app/entry.server.tsx similarity index 100% rename from templates/deno-ts/app/entry.server.tsx rename to templates/deno/app/entry.server.tsx diff --git a/templates/deno-ts/app/root.tsx b/templates/deno/app/root.tsx similarity index 100% rename from templates/deno-ts/app/root.tsx rename to templates/deno/app/root.tsx diff --git a/templates/deno-ts/app/routes/index.tsx b/templates/deno/app/routes/index.tsx similarity index 100% rename from templates/deno-ts/app/routes/index.tsx rename to templates/deno/app/routes/index.tsx diff --git a/templates/deno-ts/deno.json b/templates/deno/deno.json similarity index 100% rename from templates/deno-ts/deno.json rename to templates/deno/deno.json diff --git a/templates/deno-ts/package.json b/templates/deno/package.json similarity index 93% rename from templates/deno-ts/package.json rename to templates/deno/package.json index 7b79578266d..dcba327bafb 100644 --- a/templates/deno-ts/package.json +++ b/templates/deno/package.json @@ -1,5 +1,5 @@ { - "name": "remix-template-deno-ts", + "name": "remix-template-deno", "private": true, "sideEffects": false, "scripts": { diff --git a/templates/arc-ts/public/favicon.ico b/templates/deno/public/favicon.ico similarity index 100% rename from templates/arc-ts/public/favicon.ico rename to templates/deno/public/favicon.ico diff --git a/templates/deno-ts/remix-deno/README.md b/templates/deno/remix-deno/README.md similarity index 100% rename from templates/deno-ts/remix-deno/README.md rename to templates/deno/remix-deno/README.md diff --git a/templates/deno-ts/remix-deno/crypto.ts b/templates/deno/remix-deno/crypto.ts similarity index 100% rename from templates/deno-ts/remix-deno/crypto.ts rename to templates/deno/remix-deno/crypto.ts diff --git a/templates/deno-ts/remix-deno/deps/@remix-run/server-runtime.ts b/templates/deno/remix-deno/deps/@remix-run/server-runtime.ts similarity index 100% rename from templates/deno-ts/remix-deno/deps/@remix-run/server-runtime.ts rename to templates/deno/remix-deno/deps/@remix-run/server-runtime.ts diff --git a/templates/deno-ts/remix-deno/implementations.ts b/templates/deno/remix-deno/implementations.ts similarity index 100% rename from templates/deno-ts/remix-deno/implementations.ts rename to templates/deno/remix-deno/implementations.ts diff --git a/templates/deno-ts/remix-deno/index.ts b/templates/deno/remix-deno/index.ts similarity index 100% rename from templates/deno-ts/remix-deno/index.ts rename to templates/deno/remix-deno/index.ts diff --git a/templates/deno-ts/remix-deno/server.ts b/templates/deno/remix-deno/server.ts similarity index 100% rename from templates/deno-ts/remix-deno/server.ts rename to templates/deno/remix-deno/server.ts diff --git a/templates/deno-ts/remix-deno/sessions/fileStorage.ts b/templates/deno/remix-deno/sessions/fileStorage.ts similarity index 100% rename from templates/deno-ts/remix-deno/sessions/fileStorage.ts rename to templates/deno/remix-deno/sessions/fileStorage.ts diff --git a/templates/deno-ts/remix.config.js b/templates/deno/remix.config.js similarity index 100% rename from templates/deno-ts/remix.config.js rename to templates/deno/remix.config.js diff --git a/templates/deno-ts/server.ts b/templates/deno/server.ts similarity index 100% rename from templates/deno-ts/server.ts rename to templates/deno/server.ts diff --git a/templates/express-ts/.eslintrc b/templates/express-ts/.eslintrc deleted file mode 100644 index 71569754629..00000000000 --- a/templates/express-ts/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node"] -} diff --git a/templates/express-ts/.gitignore b/templates/express-ts/.gitignore deleted file mode 100644 index d9418258dbd..00000000000 --- a/templates/express-ts/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules - -/.cache -/server/build -/public/build -.env diff --git a/templates/express-ts/README.md b/templates/express-ts/README.md deleted file mode 100644 index 4b7950d7666..00000000000 --- a/templates/express-ts/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Welcome to Remix! - -- [Remix Docs](https://remix.run/docs) - -## Development - -You'll need to run two terminals (or bring in a process manager like concurrently/pm2-dev if you like): - -Start the Remix development asset server - -```sh -npm run dev -``` - -This starts your app in development mode, which will purge the server require cache when Remix rebuilds assets so you don't need a process manager restarting the express server. - -## Deployment - -First, build your app for production: - -```sh -npm run build -``` - -Then run the app in production mode: - -```sh -npm start -``` - -Now you'll need to pick a host to deploy it to. - -### DIY - -If you're familiar with deploying express applications you should be right at home just make sure to deploy the output of `remix build` - -- `server/build/` -- `public/build/` - -### Using a Template - -When you ran `npx create-remix@latest` there were a few choices for hosting. You can run that again to create a new project, then copy over your `app/` folder to the new project that's pre-configured for your target server. - -```sh -cd .. -# create a new project, and pick a pre-configured host -npx create-remix@latest -cd my-new-remix-app -# remove the new project's app (not the old one!) -rm -rf app -# copy your app over -cp -R ../my-old-remix-app/app app -``` diff --git a/templates/express-ts/package.json b/templates/express-ts/package.json deleted file mode 100644 index f57b2229759..00000000000 --- a/templates/express-ts/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "remix-template-express-ts", - "private": true, - "description": "", - "license": "", - "sideEffects": false, - "scripts": { - "build": "remix build", - "dev": "remix build && run-p dev:*", - "dev:node": "cross-env NODE_ENV=development nodemon ./build/index.js --watch ./build/index.js", - "dev:remix": "remix watch", - "postinstall": "remix setup node", - "start": "cross-env NODE_ENV=production node ./build/index.js" - }, - "dependencies": { - "@remix-run/express": "*", - "@remix-run/react": "*", - "compression": "^1.7.4", - "cross-env": "^7.0.3", - "express": "^4.17.1", - "morgan": "^1.10.0", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "remix": "*" - }, - "devDependencies": { - "@remix-run/dev": "*", - "@remix-run/eslint-config": "*", - "@types/react": "^17.0.24", - "@types/react-dom": "^17.0.9", - "eslint": "^8.11.0", - "nodemon": "^2.0.15", - "npm-run-all": "^4.1.5", - "typescript": "^4.5.5" - }, - "engines": { - "node": ">=14" - } -} diff --git a/templates/express-ts/public/favicon.ico b/templates/express-ts/public/favicon.ico deleted file mode 100644 index 8830cf6821b..00000000000 Binary files a/templates/express-ts/public/favicon.ico and /dev/null differ diff --git a/templates/express-ts/remix.config.js b/templates/express-ts/remix.config.js deleted file mode 100644 index 98d4bf836c0..00000000000 --- a/templates/express-ts/remix.config.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @type {import('@remix-run/dev').AppConfig} - */ -module.exports = { - server: "./server.js", - ignoredRouteFiles: [".*"], - devServerBroadcastDelay: 1000, - // appDirectory: "app", - // assetsBuildDirectory: "public/build", - // serverBuildPath: "build/index.js", - // publicPath: "/build/", -}; diff --git a/templates/express-ts/server.js b/templates/express-ts/server.js deleted file mode 100644 index 44942e744dd..00000000000 --- a/templates/express-ts/server.js +++ /dev/null @@ -1,38 +0,0 @@ -import express from "express"; -import compression from "compression"; -import morgan from "morgan"; -import { createRequestHandler } from "@remix-run/express"; -import * as serverBuild from "@remix-run/dev/server-build"; - -const app = express(); - -app.use(compression()); - -// http://expressjs.com/en/advanced/best-practice-security.html#at-a-minimum-disable-x-powered-by-header -app.disable("x-powered-by"); - -// Remix fingerprints its assets so we can cache forever. -app.use( - "/build", - express.static("public/build", { immutable: true, maxAge: "1y" }) -); - -// Everything else (like favicon.ico) is cached for an hour. You may want to be -// more aggressive with this caching. -app.use(express.static("public", { maxAge: "1h" })); - -app.use(morgan("tiny")); - -app.all( - "*", - createRequestHandler({ - build: serverBuild, - mode: process.env.NODE_ENV, - }) -); - -const port = process.env.PORT || 3000; - -app.listen(port, () => { - console.log(`Express server listening on port ${port}`); -}); diff --git a/templates/express/README.md b/templates/express/README.md index 3c4944ef0cb..4b7950d7666 100644 --- a/templates/express/README.md +++ b/templates/express/README.md @@ -12,12 +12,6 @@ Start the Remix development asset server npm run dev ``` -In a new tab start your express app: - -```sh -npm run start:dev -``` - This starts your app in development mode, which will purge the server require cache when Remix rebuilds assets so you don't need a process manager restarting the express server. ## Deployment diff --git a/templates/express/app/entry.client.jsx b/templates/express/app/entry.client.jsx deleted file mode 100644 index a19979b2527..00000000000 --- a/templates/express/app/entry.client.jsx +++ /dev/null @@ -1,4 +0,0 @@ -import { hydrate } from "react-dom"; -import { RemixBrowser } from "remix"; - -hydrate(, document); diff --git a/templates/express-ts/app/entry.client.tsx b/templates/express/app/entry.client.tsx similarity index 100% rename from templates/express-ts/app/entry.client.tsx rename to templates/express/app/entry.client.tsx diff --git a/templates/express/app/entry.server.jsx b/templates/express/app/entry.server.jsx deleted file mode 100644 index 496f0348c27..00000000000 --- a/templates/express/app/entry.server.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import { renderToString } from "react-dom/server"; -import { RemixServer } from "remix"; - -export default function handleRequest( - request, - responseStatusCode, - responseHeaders, - remixContext -) { - let markup = renderToString( - - ); - - responseHeaders.set("Content-Type", "text/html"); - - return new Response("" + markup, { - status: responseStatusCode, - headers: responseHeaders, - }); -} diff --git a/templates/express-ts/app/entry.server.tsx b/templates/express/app/entry.server.tsx similarity index 100% rename from templates/express-ts/app/entry.server.tsx rename to templates/express/app/entry.server.tsx diff --git a/templates/express/app/root.jsx b/templates/express/app/root.jsx deleted file mode 100644 index 2e065156521..00000000000 --- a/templates/express/app/root.jsx +++ /dev/null @@ -1,33 +0,0 @@ -import { - Links, - LiveReload, - Meta, - Outlet, - Scripts, - ScrollRestoration, -} from "remix"; - -export function meta() { - return { - charset: "utf-8", - title: "New Remix App", - viewport: "width=device-width,initial-scale=1", - }; -} - -export default function App() { - return ( - - - - - - - - - - - - - ); -} diff --git a/templates/express-ts/app/root.tsx b/templates/express/app/root.tsx similarity index 100% rename from templates/express-ts/app/root.tsx rename to templates/express/app/root.tsx diff --git a/templates/express/app/routes/index.jsx b/templates/express/app/routes/index.jsx deleted file mode 100644 index cbca6124ea7..00000000000 --- a/templates/express/app/routes/index.jsx +++ /dev/null @@ -1,32 +0,0 @@ -export default function Index() { - return ( - - ); -} diff --git a/templates/express-ts/app/routes/index.tsx b/templates/express/app/routes/index.tsx similarity index 100% rename from templates/express-ts/app/routes/index.tsx rename to templates/express/app/routes/index.tsx diff --git a/templates/express/jsconfig.json b/templates/express/jsconfig.json deleted file mode 100644 index 02effea5b1f..00000000000 --- a/templates/express/jsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "baseUrl": ".", - "paths": { - "~/*": ["./app/*"] - } - } -} diff --git a/templates/express/package.json b/templates/express/package.json index 0480ecdf446..545d5d06bff 100644 --- a/templates/express/package.json +++ b/templates/express/package.json @@ -26,9 +26,12 @@ "devDependencies": { "@remix-run/dev": "*", "@remix-run/eslint-config": "*", + "@types/react": "^17.0.24", + "@types/react-dom": "^17.0.9", "eslint": "^8.11.0", "nodemon": "^2.0.15", - "npm-run-all": "^4.1.5" + "npm-run-all": "^4.1.5", + "typescript": "^4.5.5" }, "engines": { "node": ">=14" diff --git a/templates/express-ts/remix.env.d.ts b/templates/express/remix.env.d.ts similarity index 100% rename from templates/express-ts/remix.env.d.ts rename to templates/express/remix.env.d.ts diff --git a/templates/express-ts/tsconfig.json b/templates/express/tsconfig.json similarity index 100% rename from templates/express-ts/tsconfig.json rename to templates/express/tsconfig.json diff --git a/templates/fly-ts/.eslintrc b/templates/fly-ts/.eslintrc deleted file mode 100644 index 71569754629..00000000000 --- a/templates/fly-ts/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node"] -} diff --git a/templates/fly-ts/.gitignore b/templates/fly-ts/.gitignore deleted file mode 100644 index 3f7bf98da3e..00000000000 --- a/templates/fly-ts/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules - -/.cache -/build -/public/build -.env diff --git a/templates/fly-ts/README.md b/templates/fly-ts/README.md deleted file mode 100644 index d08f126df36..00000000000 --- a/templates/fly-ts/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Welcome to Remix! - -- [Remix Docs](https://remix.run/docs) - -## Fly Setup - -1. [Install `flyctl`](https://fly.io/docs/getting-started/installing-flyctl/) - -2. Sign up and log in to Fly - -```sh -flyctl auth signup -``` - -3. Setup Fly. It might ask if you want to deploy, say no since you haven't built the app yet. - -```sh -flyctl launch -``` - -## Development - -From your terminal: - -```sh -npm run dev -``` - -This starts your app in development mode, rebuilding assets on file changes. - -## Deployment - -If you've followed the setup instructions already, all you need to do is run this: - -```sh -npm run deploy -``` - -You can run `flyctl info` to get the url and ip address of your server. - -Check out the [fly docs](https://fly.io/docs/getting-started/node/) for more information. diff --git a/templates/fly-ts/package.json b/templates/fly-ts/package.json deleted file mode 100644 index cf14c19f049..00000000000 --- a/templates/fly-ts/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "remix-template-fly-ts", - "private": true, - "description": "", - "license": "", - "sideEffects": false, - "scripts": { - "build": "remix build", - "deploy": "fly deploy --remote-only", - "dev": "remix dev", - "postinstall": "remix setup node", - "start": "remix-serve build" - }, - "dependencies": { - "@remix-run/react": "*", - "@remix-run/serve": "*", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "remix": "*" - }, - "devDependencies": { - "@remix-run/dev": "*", - "@remix-run/eslint-config": "*", - "@types/react": "^17.0.24", - "@types/react-dom": "^17.0.9", - "eslint": "^8.11.0", - "typescript": "^4.5.5" - }, - "engines": { - "node": ">=14" - } -} diff --git a/templates/fly-ts/public/favicon.ico b/templates/fly-ts/public/favicon.ico deleted file mode 100644 index 8830cf6821b..00000000000 Binary files a/templates/fly-ts/public/favicon.ico and /dev/null differ diff --git a/templates/fly-ts/remix.config.js b/templates/fly-ts/remix.config.js deleted file mode 100644 index 1755894599a..00000000000 --- a/templates/fly-ts/remix.config.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @type {import('@remix-run/dev').AppConfig} - */ -module.exports = { - ignoredRouteFiles: [".*"], - // appDirectory: "app", - // assetsBuildDirectory: "public/build", - // serverBuildPath: "build/index.js", - // publicPath: "/build/", -}; diff --git a/templates/fly/app/entry.client.jsx b/templates/fly/app/entry.client.jsx deleted file mode 100644 index a19979b2527..00000000000 --- a/templates/fly/app/entry.client.jsx +++ /dev/null @@ -1,4 +0,0 @@ -import { hydrate } from "react-dom"; -import { RemixBrowser } from "remix"; - -hydrate(, document); diff --git a/templates/fly-ts/app/entry.client.tsx b/templates/fly/app/entry.client.tsx similarity index 100% rename from templates/fly-ts/app/entry.client.tsx rename to templates/fly/app/entry.client.tsx diff --git a/templates/fly/app/entry.server.jsx b/templates/fly/app/entry.server.jsx deleted file mode 100644 index 496f0348c27..00000000000 --- a/templates/fly/app/entry.server.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import { renderToString } from "react-dom/server"; -import { RemixServer } from "remix"; - -export default function handleRequest( - request, - responseStatusCode, - responseHeaders, - remixContext -) { - let markup = renderToString( - - ); - - responseHeaders.set("Content-Type", "text/html"); - - return new Response("" + markup, { - status: responseStatusCode, - headers: responseHeaders, - }); -} diff --git a/templates/fly-ts/app/entry.server.tsx b/templates/fly/app/entry.server.tsx similarity index 100% rename from templates/fly-ts/app/entry.server.tsx rename to templates/fly/app/entry.server.tsx diff --git a/templates/fly/app/root.jsx b/templates/fly/app/root.jsx deleted file mode 100644 index 2e065156521..00000000000 --- a/templates/fly/app/root.jsx +++ /dev/null @@ -1,33 +0,0 @@ -import { - Links, - LiveReload, - Meta, - Outlet, - Scripts, - ScrollRestoration, -} from "remix"; - -export function meta() { - return { - charset: "utf-8", - title: "New Remix App", - viewport: "width=device-width,initial-scale=1", - }; -} - -export default function App() { - return ( - - - - - - - - - - - - - ); -} diff --git a/templates/fly-ts/app/root.tsx b/templates/fly/app/root.tsx similarity index 100% rename from templates/fly-ts/app/root.tsx rename to templates/fly/app/root.tsx diff --git a/templates/fly/app/routes/index.jsx b/templates/fly/app/routes/index.jsx deleted file mode 100644 index cbca6124ea7..00000000000 --- a/templates/fly/app/routes/index.jsx +++ /dev/null @@ -1,32 +0,0 @@ -export default function Index() { - return ( - - ); -} diff --git a/templates/fly-ts/app/routes/index.tsx b/templates/fly/app/routes/index.tsx similarity index 100% rename from templates/fly-ts/app/routes/index.tsx rename to templates/fly/app/routes/index.tsx diff --git a/templates/fly/jsconfig.json b/templates/fly/jsconfig.json deleted file mode 100644 index 02effea5b1f..00000000000 --- a/templates/fly/jsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "baseUrl": ".", - "paths": { - "~/*": ["./app/*"] - } - } -} diff --git a/templates/fly/package.json b/templates/fly/package.json index 9f573baaafc..c36768d8d8a 100644 --- a/templates/fly/package.json +++ b/templates/fly/package.json @@ -21,7 +21,10 @@ "devDependencies": { "@remix-run/dev": "*", "@remix-run/eslint-config": "*", - "eslint": "^8.11.0" + "@types/react": "^17.0.24", + "@types/react-dom": "^17.0.9", + "eslint": "^8.11.0", + "typescript": "^4.5.5" }, "engines": { "node": ">=14" diff --git a/templates/fly-ts/remix.env.d.ts b/templates/fly/remix.env.d.ts similarity index 100% rename from templates/fly-ts/remix.env.d.ts rename to templates/fly/remix.env.d.ts diff --git a/templates/fly-ts/tsconfig.json b/templates/fly/tsconfig.json similarity index 100% rename from templates/fly-ts/tsconfig.json rename to templates/fly/tsconfig.json diff --git a/templates/netlify-ts/.eslintrc b/templates/netlify-ts/.eslintrc deleted file mode 100644 index 71569754629..00000000000 --- a/templates/netlify-ts/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node"] -} diff --git a/templates/netlify-ts/.gitignore b/templates/netlify-ts/.gitignore deleted file mode 100644 index 247227b1d59..00000000000 --- a/templates/netlify-ts/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules - -/.cache -/public/build -/.netlify -.env diff --git a/templates/netlify-ts/README.md b/templates/netlify-ts/README.md deleted file mode 100644 index 33a5c947c31..00000000000 --- a/templates/netlify-ts/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Welcome to Remix! - -- [Remix Docs](https://remix.run/docs) - -## Netlify Setup - -1. Install the [Netlify CLI](https://www.netlify.com/products/dev/): - -```sh -npm i -g netlify-cli -``` - -If you have previously installed the Netlify CLI, you should update it to the latest version: - -```sh -npm i -g netlify-cli@latest -``` - -2. Sign up and log in to Netlify: - -```sh -netlify login -``` - -3. Create a new site: - -```sh -netlify init -``` - -## Development - -The Netlify CLI starts your app in development mode, rebuilding assets on file changes. - -```sh -npm run dev -``` - -Open up [http://localhost:3000](http://localhost:3000), and you should be ready to go! - -## Deployment - -There are two ways to deploy your app to Netlify, you can either link your app to your git repo and have it auto deploy changes to Netlify, or you can deploy your app manually. If you've followed the setup instructions already, all you need to do is run this: - -```sh -npm run build -# preview deployment -netlify deploy - -# production deployment -netlify deploy --prod -``` diff --git a/templates/netlify-ts/netlify.toml b/templates/netlify-ts/netlify.toml deleted file mode 100644 index fd51b27efe4..00000000000 --- a/templates/netlify-ts/netlify.toml +++ /dev/null @@ -1,17 +0,0 @@ -[build] - command = "remix build" - publish = "public" - -[dev] - command = "remix watch" - port = 3000 - -[[redirects]] - from = "/*" - to = "/.netlify/functions/server" - status = 200 - -[[headers]] - for = "/build/*" - [headers.values] - "Cache-Control" = "public, max-age=31536000, s-maxage=31536000" diff --git a/templates/netlify-ts/package.json b/templates/netlify-ts/package.json deleted file mode 100644 index f797a0d70d8..00000000000 --- a/templates/netlify-ts/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "remix-template-netlify-ts", - "private": true, - "description": "", - "license": "", - "sideEffects": false, - "scripts": { - "build": "remix build", - "dev": "cross-env NODE_ENV=development netlify dev", - "postinstall": "remix setup node", - "start": "cross-env NODE_ENV=production netlify dev" - }, - "dependencies": { - "@netlify/functions": "^0.10.0", - "@remix-run/netlify": "*", - "@remix-run/react": "*", - "cross-env": "^7.0.3", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "remix": "*" - }, - "devDependencies": { - "@remix-run/dev": "*", - "@remix-run/eslint-config": "*", - "@types/react": "^17.0.24", - "@types/react-dom": "^17.0.9", - "eslint": "^8.11.0", - "typescript": "^4.5.5" - }, - "engines": { - "node": ">=14" - } -} diff --git a/templates/netlify-ts/public/favicon.ico b/templates/netlify-ts/public/favicon.ico deleted file mode 100644 index 8830cf6821b..00000000000 Binary files a/templates/netlify-ts/public/favicon.ico and /dev/null differ diff --git a/templates/netlify-ts/remix.config.js b/templates/netlify-ts/remix.config.js deleted file mode 100644 index 4df8db6341a..00000000000 --- a/templates/netlify-ts/remix.config.js +++ /dev/null @@ -1,12 +0,0 @@ -/** - * @type {import('@remix-run/dev').AppConfig} - */ -module.exports = { - serverBuildTarget: "netlify", - server: "./server.js", - ignoredRouteFiles: [".*"], - // appDirectory: "app", - // assetsBuildDirectory: "public/build", - // serverBuildPath: ".netlify/functions-internal/server.js", - // publicPath: "/build/", -}; diff --git a/templates/netlify-ts/server.js b/templates/netlify-ts/server.js deleted file mode 100644 index 77b6e97904a..00000000000 --- a/templates/netlify-ts/server.js +++ /dev/null @@ -1,47 +0,0 @@ -import { createRequestHandler } from "@remix-run/netlify"; -import * as build from "@remix-run/dev/server-build"; - -/* - * Returns a context object with at most 3 keys: - * - `netlifyGraphToken`: raw authentication token to use with Netlify Graph - * - `clientNetlifyGraphAccessToken`: For use with JWTs generated by - * `netlify-graph-auth`. - * - `netlifyGraphSignature`: a signature for subscription events. Will be - * present if a secret is set. - */ -function getLoadContext(event, context) { - let rawAuthorizationString; - let netlifyGraphToken; - - if (event.authlifyToken != null) { - netlifyGraphToken = event.authlifyToken; - } - - let authHeader = event.headers["authorization"]; - let graphSignatureHeader = event.headers["x-netlify-graph-signature"]; - - if (authHeader != null && /Bearer /gi.test(authHeader)) { - rawAuthorizationString = authHeader.split(" ")[1]; - } - - let loadContext = { - clientNetlifyGraphAccessToken: rawAuthorizationString, - netlifyGraphToken: netlifyGraphToken, - netlifyGraphSignature: graphSignatureHeader, - }; - - // Remove keys with undefined values - Object.keys(loadContext).forEach((key) => { - if (loadContext[key] == null) { - delete loadContext[key]; - } - }); - - return loadContext; -} - -export const handler = createRequestHandler({ - build, - getLoadContext, - mode: process.env.NODE_ENV, -}); diff --git a/templates/netlify/app/entry.client.jsx b/templates/netlify/app/entry.client.jsx deleted file mode 100644 index a19979b2527..00000000000 --- a/templates/netlify/app/entry.client.jsx +++ /dev/null @@ -1,4 +0,0 @@ -import { hydrate } from "react-dom"; -import { RemixBrowser } from "remix"; - -hydrate(, document); diff --git a/templates/netlify-ts/app/entry.client.tsx b/templates/netlify/app/entry.client.tsx similarity index 100% rename from templates/netlify-ts/app/entry.client.tsx rename to templates/netlify/app/entry.client.tsx diff --git a/templates/netlify/app/entry.server.jsx b/templates/netlify/app/entry.server.jsx deleted file mode 100644 index 496f0348c27..00000000000 --- a/templates/netlify/app/entry.server.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import { renderToString } from "react-dom/server"; -import { RemixServer } from "remix"; - -export default function handleRequest( - request, - responseStatusCode, - responseHeaders, - remixContext -) { - let markup = renderToString( - - ); - - responseHeaders.set("Content-Type", "text/html"); - - return new Response("" + markup, { - status: responseStatusCode, - headers: responseHeaders, - }); -} diff --git a/templates/netlify-ts/app/entry.server.tsx b/templates/netlify/app/entry.server.tsx similarity index 100% rename from templates/netlify-ts/app/entry.server.tsx rename to templates/netlify/app/entry.server.tsx diff --git a/templates/netlify/app/root.jsx b/templates/netlify/app/root.jsx deleted file mode 100644 index 2e065156521..00000000000 --- a/templates/netlify/app/root.jsx +++ /dev/null @@ -1,33 +0,0 @@ -import { - Links, - LiveReload, - Meta, - Outlet, - Scripts, - ScrollRestoration, -} from "remix"; - -export function meta() { - return { - charset: "utf-8", - title: "New Remix App", - viewport: "width=device-width,initial-scale=1", - }; -} - -export default function App() { - return ( - - - - - - - - - - - - - ); -} diff --git a/templates/netlify-ts/app/root.tsx b/templates/netlify/app/root.tsx similarity index 100% rename from templates/netlify-ts/app/root.tsx rename to templates/netlify/app/root.tsx diff --git a/templates/netlify/app/routes/index.jsx b/templates/netlify/app/routes/index.jsx deleted file mode 100644 index cbca6124ea7..00000000000 --- a/templates/netlify/app/routes/index.jsx +++ /dev/null @@ -1,32 +0,0 @@ -export default function Index() { - return ( - - ); -} diff --git a/templates/netlify-ts/app/routes/index.tsx b/templates/netlify/app/routes/index.tsx similarity index 100% rename from templates/netlify-ts/app/routes/index.tsx rename to templates/netlify/app/routes/index.tsx diff --git a/templates/netlify/jsconfig.json b/templates/netlify/jsconfig.json deleted file mode 100644 index 02effea5b1f..00000000000 --- a/templates/netlify/jsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "baseUrl": ".", - "paths": { - "~/*": ["./app/*"] - } - } -} diff --git a/templates/netlify/package.json b/templates/netlify/package.json index 8e8209f1dd8..733e6f8e569 100644 --- a/templates/netlify/package.json +++ b/templates/netlify/package.json @@ -22,7 +22,10 @@ "devDependencies": { "@remix-run/dev": "*", "@remix-run/eslint-config": "*", - "eslint": "^8.11.0" + "@types/react": "^17.0.24", + "@types/react-dom": "^17.0.9", + "eslint": "^8.11.0", + "typescript": "^4.5.5" }, "engines": { "node": ">=14" diff --git a/templates/netlify-ts/remix.env.d.ts b/templates/netlify/remix.env.d.ts similarity index 100% rename from templates/netlify-ts/remix.env.d.ts rename to templates/netlify/remix.env.d.ts diff --git a/templates/netlify-ts/tsconfig.json b/templates/netlify/tsconfig.json similarity index 100% rename from templates/netlify-ts/tsconfig.json rename to templates/netlify/tsconfig.json diff --git a/templates/remix-ts/.eslintrc b/templates/remix-ts/.eslintrc deleted file mode 100644 index 71569754629..00000000000 --- a/templates/remix-ts/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node"] -} diff --git a/templates/remix-ts/.gitignore b/templates/remix-ts/.gitignore deleted file mode 100644 index 3f7bf98da3e..00000000000 --- a/templates/remix-ts/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules - -/.cache -/build -/public/build -.env diff --git a/templates/remix-ts/README.md b/templates/remix-ts/README.md deleted file mode 100644 index 9659e785e03..00000000000 --- a/templates/remix-ts/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# Welcome to Remix! - -- [Remix Docs](https://remix.run/docs) - -## Development - -From your terminal: - -```sh -npm run dev -``` - -This starts your app in development mode, rebuilding assets on file changes. - -## Deployment - -First, build your app for production: - -```sh -npm run build -``` - -Then run the app in production mode: - -```sh -npm start -``` - -Now you'll need to pick a host to deploy it to. - -### DIY - -If you're familiar with deploying node applications, the built-in Remix app server is production-ready. - -Make sure to deploy the output of `remix build` - -- `build/` -- `public/build/` - -### Using a Template - -When you ran `npx create-remix@latest` there were a few choices for hosting. You can run that again to create a new project, then copy over your `app/` folder to the new project that's pre-configured for your target server. - -```sh -cd .. -# create a new project, and pick a pre-configured host -npx create-remix@latest -cd my-new-remix-app -# remove the new project's app (not the old one!) -rm -rf app -# copy your app over -cp -R ../my-old-remix-app/app app -``` diff --git a/templates/remix-ts/package.json b/templates/remix-ts/package.json deleted file mode 100644 index 301d46c0e4d..00000000000 --- a/templates/remix-ts/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "remix-template-remix-ts", - "private": true, - "description": "", - "license": "", - "sideEffects": false, - "scripts": { - "build": "remix build", - "dev": "remix dev", - "postinstall": "remix setup node", - "start": "remix-serve build" - }, - "dependencies": { - "@remix-run/react": "*", - "@remix-run/serve": "*", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "remix": "*" - }, - "devDependencies": { - "@remix-run/dev": "*", - "@remix-run/eslint-config": "*", - "@types/react": "^17.0.24", - "@types/react-dom": "^17.0.9", - "eslint": "^8.11.0", - "typescript": "^4.5.5" - }, - "engines": { - "node": ">=14" - } -} diff --git a/templates/remix-ts/public/favicon.ico b/templates/remix-ts/public/favicon.ico deleted file mode 100644 index 8830cf6821b..00000000000 Binary files a/templates/remix-ts/public/favicon.ico and /dev/null differ diff --git a/templates/remix-ts/remix.config.js b/templates/remix-ts/remix.config.js deleted file mode 100644 index 1755894599a..00000000000 --- a/templates/remix-ts/remix.config.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * @type {import('@remix-run/dev').AppConfig} - */ -module.exports = { - ignoredRouteFiles: [".*"], - // appDirectory: "app", - // assetsBuildDirectory: "public/build", - // serverBuildPath: "build/index.js", - // publicPath: "/build/", -}; diff --git a/templates/remix/app/entry.client.jsx b/templates/remix/app/entry.client.jsx deleted file mode 100644 index a19979b2527..00000000000 --- a/templates/remix/app/entry.client.jsx +++ /dev/null @@ -1,4 +0,0 @@ -import { hydrate } from "react-dom"; -import { RemixBrowser } from "remix"; - -hydrate(, document); diff --git a/templates/remix-ts/app/entry.client.tsx b/templates/remix/app/entry.client.tsx similarity index 100% rename from templates/remix-ts/app/entry.client.tsx rename to templates/remix/app/entry.client.tsx diff --git a/templates/remix/app/entry.server.jsx b/templates/remix/app/entry.server.jsx deleted file mode 100644 index 496f0348c27..00000000000 --- a/templates/remix/app/entry.server.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import { renderToString } from "react-dom/server"; -import { RemixServer } from "remix"; - -export default function handleRequest( - request, - responseStatusCode, - responseHeaders, - remixContext -) { - let markup = renderToString( - - ); - - responseHeaders.set("Content-Type", "text/html"); - - return new Response("" + markup, { - status: responseStatusCode, - headers: responseHeaders, - }); -} diff --git a/templates/remix-ts/app/entry.server.tsx b/templates/remix/app/entry.server.tsx similarity index 100% rename from templates/remix-ts/app/entry.server.tsx rename to templates/remix/app/entry.server.tsx diff --git a/templates/remix/app/root.jsx b/templates/remix/app/root.jsx deleted file mode 100644 index 2e065156521..00000000000 --- a/templates/remix/app/root.jsx +++ /dev/null @@ -1,33 +0,0 @@ -import { - Links, - LiveReload, - Meta, - Outlet, - Scripts, - ScrollRestoration, -} from "remix"; - -export function meta() { - return { - charset: "utf-8", - title: "New Remix App", - viewport: "width=device-width,initial-scale=1", - }; -} - -export default function App() { - return ( - - - - - - - - - - - - - ); -} diff --git a/templates/remix-ts/app/root.tsx b/templates/remix/app/root.tsx similarity index 100% rename from templates/remix-ts/app/root.tsx rename to templates/remix/app/root.tsx diff --git a/templates/remix/app/routes/index.jsx b/templates/remix/app/routes/index.jsx deleted file mode 100644 index cbca6124ea7..00000000000 --- a/templates/remix/app/routes/index.jsx +++ /dev/null @@ -1,32 +0,0 @@ -export default function Index() { - return ( - - ); -} diff --git a/templates/remix-ts/app/routes/index.tsx b/templates/remix/app/routes/index.tsx similarity index 100% rename from templates/remix-ts/app/routes/index.tsx rename to templates/remix/app/routes/index.tsx diff --git a/templates/remix/jsconfig.json b/templates/remix/jsconfig.json deleted file mode 100644 index 02effea5b1f..00000000000 --- a/templates/remix/jsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "baseUrl": ".", - "paths": { - "~/*": ["./app/*"] - } - } -} diff --git a/templates/remix/package.json b/templates/remix/package.json index 786b302f0ed..03706689b3e 100644 --- a/templates/remix/package.json +++ b/templates/remix/package.json @@ -20,7 +20,10 @@ "devDependencies": { "@remix-run/dev": "*", "@remix-run/eslint-config": "*", - "eslint": "^8.11.0" + "@types/react": "^17.0.24", + "@types/react-dom": "^17.0.9", + "eslint": "^8.11.0", + "typescript": "^4.5.5" }, "engines": { "node": ">=14" diff --git a/templates/remix-ts/remix.env.d.ts b/templates/remix/remix.env.d.ts similarity index 100% rename from templates/remix-ts/remix.env.d.ts rename to templates/remix/remix.env.d.ts diff --git a/templates/remix-ts/tsconfig.json b/templates/remix/tsconfig.json similarity index 100% rename from templates/remix-ts/tsconfig.json rename to templates/remix/tsconfig.json diff --git a/templates/vercel-ts/.eslintrc b/templates/vercel-ts/.eslintrc deleted file mode 100644 index 71569754629..00000000000 --- a/templates/vercel-ts/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["@remix-run/eslint-config", "@remix-run/eslint-config/node"] -} diff --git a/templates/vercel-ts/.gitignore b/templates/vercel-ts/.gitignore deleted file mode 100644 index 67dd546d779..00000000000 --- a/templates/vercel-ts/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -node_modules - -.cache -.env -.vercel -.output - -/build/ -/public/build -/api/index.js diff --git a/templates/vercel-ts/README.md b/templates/vercel-ts/README.md deleted file mode 100644 index 944936b3429..00000000000 --- a/templates/vercel-ts/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Welcome to Remix! - -- [Remix Docs](https://remix.run/docs) - -## Deployment - -After having run the `create-remix` command and selected "Vercel" as a deployment target, you only need to [import your Git repository](https://vercel.com/new) into Vercel, and it will be deployed. - -If you'd like to avoid using a Git repository, you can also deploy the directory by running [Vercel CLI](https://vercel.com/cli): - -```sh -npm i -g vercel -vercel -``` - -It is generally recommended to use a Git repository, because future commits will then automatically be deployed by Vercel, through its [Git Integration](https://vercel.com/docs/concepts/git). - -## Development - -To run your Remix app locally, make sure your project's local dependencies are installed: - -```sh -npm install -``` - -Afterwards, start the Remix development server like so: - -```sh -npm run dev -``` - -Open up [http://localhost:3000](http://localhost:3000) and you should be ready to go! - -If you're used to using the `vercel dev` command provided by [Vercel CLI](https://vercel.com/cli) instead, you can also use that, but it's not needed. diff --git a/templates/vercel-ts/package.json b/templates/vercel-ts/package.json deleted file mode 100644 index af8d73d20b4..00000000000 --- a/templates/vercel-ts/package.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "remix-template-vercel-ts", - "private": true, - "description": "", - "license": "", - "sideEffects": false, - "scripts": { - "build": "remix build", - "dev": "remix dev", - "postinstall": "remix setup node" - }, - "dependencies": { - "@remix-run/react": "*", - "@remix-run/vercel": "*", - "react": "^17.0.2", - "react-dom": "^17.0.2", - "remix": "*" - }, - "devDependencies": { - "@remix-run/dev": "*", - "@remix-run/eslint-config": "*", - "@remix-run/serve": "*", - "@types/react": "^17.0.24", - "@types/react-dom": "^17.0.9", - "eslint": "^8.11.0", - "typescript": "^4.5.5" - }, - "engines": { - "node": ">=14" - } -} diff --git a/templates/vercel-ts/public/favicon.ico b/templates/vercel-ts/public/favicon.ico deleted file mode 100644 index 8830cf6821b..00000000000 Binary files a/templates/vercel-ts/public/favicon.ico and /dev/null differ diff --git a/templates/vercel-ts/remix.config.js b/templates/vercel-ts/remix.config.js deleted file mode 100644 index 271a612cf66..00000000000 --- a/templates/vercel-ts/remix.config.js +++ /dev/null @@ -1,15 +0,0 @@ -/** - * @type {import('@remix-run/dev').AppConfig} - */ -module.exports = { - serverBuildTarget: "vercel", - // When running locally in development mode, we use the built in remix - // server. This does not understand the vercel lambda module format, - // so we default back to the standard build output. - server: process.env.NODE_ENV === "development" ? undefined : "./server.js", - ignoredRouteFiles: [".*"], - // appDirectory: "app", - // assetsBuildDirectory: "public/build", - // serverBuildPath: "api/index.js", - // publicPath: "/build/", -}; diff --git a/templates/vercel-ts/server.js b/templates/vercel-ts/server.js deleted file mode 100644 index 4e2a0e00e7c..00000000000 --- a/templates/vercel-ts/server.js +++ /dev/null @@ -1,4 +0,0 @@ -import { createRequestHandler } from "@remix-run/vercel"; -import * as build from "@remix-run/dev/server-build"; - -export default createRequestHandler({ build, mode: process.env.NODE_ENV }); diff --git a/templates/vercel-ts/vercel.json b/templates/vercel-ts/vercel.json deleted file mode 100644 index dcfba92eda5..00000000000 --- a/templates/vercel-ts/vercel.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "build": { - "env": { - "ENABLE_FILE_SYSTEM_API": "1" - } - } -} diff --git a/templates/vercel/app/entry.client.jsx b/templates/vercel/app/entry.client.jsx deleted file mode 100644 index a19979b2527..00000000000 --- a/templates/vercel/app/entry.client.jsx +++ /dev/null @@ -1,4 +0,0 @@ -import { hydrate } from "react-dom"; -import { RemixBrowser } from "remix"; - -hydrate(, document); diff --git a/templates/vercel-ts/app/entry.client.tsx b/templates/vercel/app/entry.client.tsx similarity index 100% rename from templates/vercel-ts/app/entry.client.tsx rename to templates/vercel/app/entry.client.tsx diff --git a/templates/vercel/app/entry.server.jsx b/templates/vercel/app/entry.server.jsx deleted file mode 100644 index 496f0348c27..00000000000 --- a/templates/vercel/app/entry.server.jsx +++ /dev/null @@ -1,20 +0,0 @@ -import { renderToString } from "react-dom/server"; -import { RemixServer } from "remix"; - -export default function handleRequest( - request, - responseStatusCode, - responseHeaders, - remixContext -) { - let markup = renderToString( - - ); - - responseHeaders.set("Content-Type", "text/html"); - - return new Response("" + markup, { - status: responseStatusCode, - headers: responseHeaders, - }); -} diff --git a/templates/vercel-ts/app/entry.server.tsx b/templates/vercel/app/entry.server.tsx similarity index 100% rename from templates/vercel-ts/app/entry.server.tsx rename to templates/vercel/app/entry.server.tsx diff --git a/templates/vercel/app/root.jsx b/templates/vercel/app/root.jsx deleted file mode 100644 index 2e065156521..00000000000 --- a/templates/vercel/app/root.jsx +++ /dev/null @@ -1,33 +0,0 @@ -import { - Links, - LiveReload, - Meta, - Outlet, - Scripts, - ScrollRestoration, -} from "remix"; - -export function meta() { - return { - charset: "utf-8", - title: "New Remix App", - viewport: "width=device-width,initial-scale=1", - }; -} - -export default function App() { - return ( - - - - - - - - - - - - - ); -} diff --git a/templates/vercel-ts/app/root.tsx b/templates/vercel/app/root.tsx similarity index 100% rename from templates/vercel-ts/app/root.tsx rename to templates/vercel/app/root.tsx diff --git a/templates/vercel/app/routes/index.jsx b/templates/vercel/app/routes/index.jsx deleted file mode 100644 index cbca6124ea7..00000000000 --- a/templates/vercel/app/routes/index.jsx +++ /dev/null @@ -1,32 +0,0 @@ -export default function Index() { - return ( - - ); -} diff --git a/templates/vercel-ts/app/routes/index.tsx b/templates/vercel/app/routes/index.tsx similarity index 100% rename from templates/vercel-ts/app/routes/index.tsx rename to templates/vercel/app/routes/index.tsx diff --git a/templates/vercel/jsconfig.json b/templates/vercel/jsconfig.json deleted file mode 100644 index 02effea5b1f..00000000000 --- a/templates/vercel/jsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "compilerOptions": { - "jsx": "react-jsx", - "baseUrl": ".", - "paths": { - "~/*": ["./app/*"] - } - } -} diff --git a/templates/vercel/package.json b/templates/vercel/package.json index 921163d7451..c4e3d21adc0 100644 --- a/templates/vercel/package.json +++ b/templates/vercel/package.json @@ -20,7 +20,10 @@ "@remix-run/dev": "*", "@remix-run/eslint-config": "*", "@remix-run/serve": "*", - "eslint": "^8.11.0" + "@types/react": "^17.0.24", + "@types/react-dom": "^17.0.9", + "eslint": "^8.11.0", + "typescript": "^4.5.5" }, "engines": { "node": ">=14" diff --git a/templates/vercel-ts/remix.env.d.ts b/templates/vercel/remix.env.d.ts similarity index 100% rename from templates/vercel-ts/remix.env.d.ts rename to templates/vercel/remix.env.d.ts diff --git a/templates/vercel-ts/tsconfig.json b/templates/vercel/tsconfig.json similarity index 100% rename from templates/vercel-ts/tsconfig.json rename to templates/vercel/tsconfig.json