Skip to content

Commit

Permalink
examples: update turborepo example (remix-run#3984)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcansh authored and freeman committed Sep 7, 2022
1 parent b2ac723 commit 9618726
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 90 deletions.
9 changes: 8 additions & 1 deletion examples/turborepo-vercel/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
node_modules
build
dist
.turbo
.turbo
.vercel
.cache
.env
.output
apps/**/public/build
apps/**/api/index.js
apps/**/api/index.js.map
2 changes: 1 addition & 1 deletion examples/turborepo-vercel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Many turborepo examples don't build the `ui` package, but if we don't, remix is

In order for this to work, your Vercel config should look like this:

![Vercel project config](./vercel-project-config-example.png)
![Vercel project config](./vercel-project-config-example.jpg)
10 changes: 0 additions & 10 deletions examples/turborepo-vercel/apps/remix-app/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions examples/turborepo-vercel/apps/remix-app/api/api.js

This file was deleted.

28 changes: 12 additions & 16 deletions examples/turborepo-vercel/apps/remix-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,24 @@
"private": true,
"sideEffects": false,
"scripts": {
"build": "remix build && rollup -c",
"build": "remix build",
"dev": "remix dev"
},
"dependencies": {
"@remix-run/node": "1.2.3",
"@remix-run/react": "1.2.3",
"@remix-run/serve": "1.2.3",
"@remix-run/vercel": "1.2.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"@remix-run/node": "1.6.7",
"@remix-run/react": "1.6.7",
"@remix-run/vercel": "1.6.7",
"react": "18.2.0",
"react-dom": "18.2.0",
"ui": "*"
},
"devDependencies": {
"@remix-run/dev": "1.2.3",
"@remix-run/eslint-config": "1.2.3",
"@rollup/plugin-commonjs": "^21.0.2",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.1.3",
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.13",
"rollup": "^2.69.0",
"typescript": "^4.7.4"
"@remix-run/dev": "1.6.7",
"@remix-run/eslint-config": "1.6.7",
"@remix-run/serve": "1.6.7",
"@types/react": "18.0.17",
"@types/react-dom": "18.0.6",
"typescript": "4.7.4"
},
"engines": {
"node": ">=14"
Expand Down
18 changes: 12 additions & 6 deletions examples/turborepo-vercel/apps/remix-app/remix.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
/** @type {import('@remix-run/dev').AppConfig} */
/**
* @type {import('@remix-run/dev').AppConfig}
*/
module.exports = {
ignoredRouteFiles: ["**/.*"],
// appDirectory: "app",
// assetsBuildDirectory: "public/build",
// serverBuildPath: "build/index.js",
// publicPath: "/build/",
serverBuildTarget: "vercel",
appDirectory: "app",
ignoredRouteFiles: [".*"],
assetsBuildDirectory: "public/build",
// 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",
serverDependenciesToBundle: [/.*/],
};
18 changes: 0 additions & 18 deletions examples/turborepo-vercel/apps/remix-app/rollup.config.js

This file was deleted.

4 changes: 4 additions & 0 deletions examples/turborepo-vercel/apps/remix-app/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { createRequestHandler } from "@remix-run/vercel";
import * as build from "@remix-run/dev/server-build";

export default createRequestHandler({ build, mode: process.env.NODE_ENV });
7 changes: 0 additions & 7 deletions examples/turborepo-vercel/apps/remix-app/vercel.json

This file was deleted.

22 changes: 2 additions & 20 deletions examples/turborepo-vercel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,11 @@
},
"dependencies": {},
"devDependencies": {
"prettier": "^2.5.1",
"turbo": "latest"
"prettier": "2.7.1",
"turbo": "1.4.3"
},
"engines": {
"node": ">=14.0.0",
"npm": ">=7.0.0"
},
"turbo": {
"pipeline": {
"build": {
"dependsOn": [
"^build"
],
"outputs": [
"dist/**"
]
},
"dev": {
"dependsOn": [
"^build"
],
"cache": false
}
}
}
}
11 changes: 5 additions & 6 deletions examples/turborepo-vercel/packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
"dev": "tsup src/index.tsx --format esm,cjs --watch --dts --external react"
},
"devDependencies": {
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.13",
"react": "^17.0.2",
"scripts": "*",
"tsup": "^5.11.13",
"typescript": "^4.7.4"
"@types/react": "18.0.17",
"@types/react-dom": "18.0.6",
"react": "18.2.0",
"tsup": "6.2.2",
"typescript": "4.7.4"
}
}
25 changes: 25 additions & 0 deletions examples/turborepo-vercel/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "https://turborepo.org/schema.json",
"baseBranch": "origin/main",
"pipeline": {
"build": {
"outputs": ["dist/**", ".next/**", "public/dist/**"],
"dependsOn": ["^build"]
},
"remix-app#build": {
"dependsOn": ["^build"],
"outputs": ["api/index.js", "api/build/**", "public/build/**"]
},
"test": {
"outputs": ["coverage/**"],
"dependsOn": []
},
"lint": {
"dependsOn": ["^build"],
"outputs": []
},
"dev": {
"cache": false
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.

0 comments on commit 9618726

Please sign in to comment.