-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Allow for custom server to participate in bundling (#1504)
feat: updated templates to make use of new compiler defaults feat: added node polyfills for "neutral" server platforms that are not deno fix(create-remix): make sure app has required properties before merging fix(create-remix): add missing dependencies ci: remove some junk from deployment scripts chore(create-remix): workers requires a build command feat: remove extra build step from CF template fix: made getLoadContext optional for arc handler Co-authored-by: Logan McAnsh <logan@mcan.sh>
- Loading branch information
1 parent
01bf570
commit 505d087
Showing
65 changed files
with
939 additions
and
592 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
node_modules/ | ||
yarn-error.log | ||
|
||
/jacob | ||
/MICHAEL_TODOS.md | ||
/fixtures/cloudflare | ||
/fixtures/test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { createCookieSessionStorage } from "remix"; | ||
|
||
export let sessionStorage = createCookieSessionStorage({ | ||
cookie: { | ||
name: "redirectslogin", | ||
path: "/", | ||
httpOnly: true, | ||
sameSite: true, | ||
secure: process.env.NODE_ENV !== "development" | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { createCookieSessionStorage } from "remix"; | ||
|
||
export let sessionStorage = createCookieSessionStorage({ | ||
cookie: { | ||
name: "theme-css", | ||
secrets: ["fjdlafjdkla"] | ||
} | ||
}); | ||
|
||
export let defaultStyles: Record<string, string> = { | ||
"--nc-tx-1": "#ffffff", | ||
"--nc-tx-2": "#eeeeee", | ||
"--nc-bg-1": "#000000", | ||
"--nc-bg-2": "#111111", | ||
"--nc-bg-3": "#222222", | ||
"--nc-lk-1": "#3291FF", | ||
"--nc-lk-2": "#0070F3", | ||
"--nc-lk-tx": "#FFFFFF", | ||
"--nc-ac-1": "#7928CA", | ||
"--nc-ac-tx": "#FFFFFF" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
node_modules | ||
|
||
/.cache | ||
/server/build | ||
/server/index.js | ||
/public/build | ||
|
||
sam.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,17 @@ | ||
{ | ||
"scripts": { | ||
"postinstall": "remix setup node", | ||
"build": "remix build", | ||
"dev": "remix watch", | ||
"start": "arc sandbox" | ||
"build": "cross-env NODE_ENV=production remix build", | ||
"dev:remix": "cross-env NODE_ENV=development remix watch", | ||
"dev:arc": "cross-env NODE_ENV=development arc sandbox", | ||
"dev": "cross-env NODE_ENV=development remix build && run-p dev:*", | ||
"start": "cross-env NODE_ENV=production arc sandbox" | ||
}, | ||
"dependencies": { | ||
"@remix-run/architect": "*" | ||
"@remix-run/architect": "*", | ||
"cross-env": "^7.0.3" | ||
}, | ||
"devDependencies": { | ||
"npm-run-all": "^4.1.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
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 | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
node_modules | ||
|
||
/.cache | ||
/build | ||
/functions/[[path]].js | ||
/public/build |
12 changes: 5 additions & 7 deletions
12
packages/create-remix/templates/cloudflare-pages/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
{ | ||
"main": "dist/worker.js", | ||
"scripts": { | ||
"postinstall": "remix setup cloudflare-pages", | ||
"build": "cross-env NODE_ENV=production remix build", | ||
"dev:remix": "remix watch", | ||
"dev:wrangler": "wrangler pages dev ./public --watch ./build", | ||
"dev": "cross-env NODE_ENV=development run-p dev:*", | ||
"start": "npm run dev:wrangler" | ||
"dev:remix": "cross-env NODE_ENV=development remix watch", | ||
"dev:wrangler": "cross-env NODE_ENV=development wrangler pages dev ./public", | ||
"dev": "cross-env NODE_ENV=development remix build && run-p dev:*", | ||
"start": "cross-env NODE_ENV=production npm run dev:wrangler" | ||
}, | ||
"dependencies": { | ||
"@remix-run/cloudflare-pages": "*" | ||
}, | ||
"devDependencies": { | ||
"@cloudflare/workers-types": "^3.2.0", | ||
"cross-env": "^7.0.3", | ||
"esbuild": "0.13.14", | ||
"npm-run-all": "^4.1.5", | ||
"wrangler": "alpha" | ||
"wrangler": "beta" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...es/cloudflare-pages/functions/[[path]].js → ...emix/templates/cloudflare-pages/server.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 9 additions & 8 deletions
17
packages/create-remix/templates/cloudflare-workers/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
{ | ||
"main": "dist/worker.js", | ||
"main": "build/index.js", | ||
"scripts": { | ||
"postinstall": "remix setup cloudflare-workers", | ||
"build:worker": "esbuild --define:process.env.NODE_ENV='\"production\"' --minify --bundle --sourcemap --outdir=dist ./worker", | ||
"build": "remix build", | ||
"dev": "remix watch", | ||
"dev:worker": "esbuild --define:process.env.NODE_ENV='\"development\"' --bundle --sourcemap --outdir=dist ./worker", | ||
"start": "miniflare --build-command \"npm run dev:worker\" --watch", | ||
"build": "cross-env NODE_ENV=production remix build", | ||
"dev:remix": "cross-env NODE_ENV=development remix watch", | ||
"dev:miniflare": "cross-env NODE_ENV=development miniflare ./build/index.js --watch", | ||
"dev": "cross-env NODE_ENV=development remix build && run-p dev:*", | ||
"start": "cross-env NODE_ENV=production miniflare ./build/index.js", | ||
"deploy": "npm run build && wrangler publish" | ||
}, | ||
"dependencies": { | ||
"@remix-run/cloudflare-workers": "*" | ||
}, | ||
"devDependencies": { | ||
"@cloudflare/workers-types": "^2.2.2", | ||
"esbuild": "0.13.14", | ||
"miniflare": "2.0.0-next.3" | ||
"cross-env": "^7.0.3", | ||
"miniflare": "^2.1.0", | ||
"npm-run-all": "^4.1.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
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 }) | ||
); |
5 changes: 0 additions & 5 deletions
5
packages/create-remix/templates/cloudflare-workers/worker/index.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
{ | ||
"scripts": { | ||
"postinstall": "remix setup node", | ||
"dev": "remix watch", | ||
"start": "cross-env NODE_ENV=production node server/index.js", | ||
"start:dev": "cross-env NODE_ENV=development node server/index.js" | ||
"build": "cross-env NODE_ENV=production remix build", | ||
"dev": "cross-env NODE_ENV=development remix build && run-p dev:*", | ||
"dev:remix": "cross-env NODE_ENV=development remix watch", | ||
"dev:node": "cross-env NODE_ENV=development nodemon ./build/index.js", | ||
"start": "cross-env NODE_ENV=production node ./build/index.js" | ||
}, | ||
"dependencies": { | ||
"@remix-run/express": "*", | ||
"compression": "^1.7.4", | ||
"cross-env": "^7.0.3", | ||
"express": "^4.17.1", | ||
"morgan": "^1.10.0" | ||
"morgan": "^1.10.0", | ||
"npm-run-all": "^4.1.5" | ||
}, | ||
"devDependencies": { | ||
"nodemon": "^2.0.15" | ||
} | ||
} |
Oops, something went wrong.