This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from isoppp/server-runner
support express app runenr
- Loading branch information
Showing
14 changed files
with
1,295 additions
and
37 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 |
---|---|---|
@@ -1,7 +1,42 @@ | ||
/node_modules | ||
*.log | ||
.DS_Store | ||
.env* | ||
/.cache | ||
/public/build | ||
|
||
# ============ filter from ls -al . | ||
/.dockerignore | ||
/.env.local | ||
#/.env.production | ||
/.env.test | ||
/.git | ||
/.github | ||
/.gitignore | ||
/.idea | ||
/.npmrc | ||
/.scaffdog | ||
/.storybook | ||
#/.tool-versions | ||
/Dockerfile | ||
/README.md | ||
#/app | ||
/biome.jsonc | ||
/build | ||
/components.json | ||
/docker-compose.yml | ||
/eslint.config.js | ||
#/index.ts | ||
/lefthook.yml | ||
/node_modules | ||
#/package.json | ||
#/pnpm-lock.yaml | ||
#/postcss.config.js | ||
#/prisma | ||
#/public | ||
#/server | ||
/server-build | ||
#/tailwind.config.ts | ||
#/tsconfig.json | ||
/vite.config.sb.ts | ||
#/vite.config.ts | ||
/vitest-example | ||
/vitest.workspace.ts |
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,5 @@ | ||
NODE_ENV=production | ||
APP_ENV=production | ||
|
||
# this is for local testing, set by actual env variable in production | ||
#DATABASE_URL="postgresql://postgres:postgres@localhost:5456/mydb?schema=public" |
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ node_modules | |
|
||
/.cache | ||
/build | ||
/server-build | ||
.env | ||
|
||
*storybook.log | ||
*storybook.log |
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,5 @@ | ||
import { createContext, useContext } from 'react' | ||
|
||
export const NonceContext = createContext<string>('') | ||
export const NonceProvider = NonceContext.Provider | ||
export const useNonce = () => useContext(NonceContext) |
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,33 @@ | ||
// https://github.com/epicweb-dev/epic-stack/blob/main/index.js | ||
|
||
import * as fs from 'node:fs' | ||
import chalk from 'chalk' | ||
import closeWithGrace from 'close-with-grace' | ||
import sourceMapSupport from 'source-map-support' | ||
sourceMapSupport.install({ | ||
retrieveSourceMap: (source) => { | ||
// get source file without the `file://` prefix or `?t=...` suffix | ||
const match = source.match(/^file:\/\/(.*)\?t=[.\d]+$/) | ||
if (match) { | ||
return { | ||
url: source, | ||
map: fs.readFileSync(`${match[1]}.map`, 'utf8'), | ||
} | ||
} | ||
return null | ||
}, | ||
}) | ||
|
||
closeWithGrace(async ({ err }) => { | ||
if (err) { | ||
console.error(chalk.red(err)) | ||
console.error(chalk.red(err.stack)) | ||
process.exit(1) | ||
} | ||
}) | ||
|
||
if (process.env.APP_ENV !== 'local') { | ||
await import('./server-build/index.js') | ||
} else { | ||
await import('./server/index.ts') | ||
} |
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 |
---|---|---|
|
@@ -5,9 +5,11 @@ | |
"type": "module", | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
"start": "echo $DATABASE_URL && pnpm prisma migrate deploy && remix-serve ./build/server/index.js", | ||
"build": "remix vite:build", | ||
"dev": "dotenv -e .env.local remix vite:dev", | ||
"start": "dotenv -e .env.production -- bash -c 'echo $DATABASE_URL && npx prisma migrate deploy && node index.js'", | ||
"build": "run-s build:*", | ||
"build:remix": "remix vite:build", | ||
"build:server": "tsx ./scripts/build-server.ts", | ||
"dev": "dotenv -e .env.local -- node ./server/dev-server.js", | ||
"lint": "eslint .", | ||
"check": "pnpm biome check", | ||
"lint-fix": "pnpm lint --fix && pnpm check --write", | ||
|
@@ -26,20 +28,32 @@ | |
"dependencies": { | ||
"@prisma/client": "5.19.1", | ||
"@radix-ui/react-icons": "1.3.0", | ||
"@remix-run/express": "2.11.2", | ||
"@remix-run/node": "2.11.2", | ||
"@remix-run/react": "2.11.2", | ||
"@remix-run/serve": "2.11.2", | ||
"@tanstack/react-query": "5.55.0", | ||
"@trpc/client": "11.0.0-rc.502", | ||
"@trpc/react-query": "11.0.0-rc.502", | ||
"@trpc/server": "11.0.0-rc.502", | ||
"chalk": "5.3.0", | ||
"class-variance-authority": "0.7.0", | ||
"close-with-grace": "2.1.0", | ||
"clsx": "2.1.1", | ||
"compression": "1.7.4", | ||
"dotenv-cli": "7.4.2", | ||
"execa": "9.3.1", | ||
"express": "4.19.2", | ||
"express-rate-limit": "7.4.0", | ||
"get-port": "7.1.0", | ||
"helmet": "7.1.0", | ||
"isbot": "5.1.17", | ||
"lucide-react": "0.438.0", | ||
"morgan": "1.10.0", | ||
"prisma": "5.19.1", | ||
"react": "18.3.1", | ||
"react-dom": "18.3.1", | ||
"source-map-support": "0.5.21", | ||
"tailwind-merge": "2.5.2", | ||
"tailwindcss-animate": "1.0.7", | ||
"valibot": "0.41.0" | ||
|
@@ -55,18 +69,26 @@ | |
"@storybook/react-vite": "8.2.9", | ||
"@storybook/test": "8.2.9", | ||
"@testing-library/react": "16.0.1", | ||
"@types/compression": "1.7.5", | ||
"@types/express": "4.17.21", | ||
"@types/fs-extra": "11.0.4", | ||
"@types/morgan": "1.9.9", | ||
"@types/react": "18.3.5", | ||
"@types/react-dom": "18.3.0", | ||
"@types/source-map-support": "0.5.10", | ||
"@typescript-eslint/parser": "8.4.0", | ||
"@vitejs/plugin-react": "4.3.1", | ||
"@vitest/browser": "2.0.5", | ||
"autoprefixer": "10.4.20", | ||
"dotenv-cli": "7.4.2", | ||
"esbuild": "0.23.1", | ||
"eslint": "9.9.1", | ||
"eslint-plugin-storybook": "0.8.0", | ||
"eslint-plugin-tailwindcss": "3.17.4", | ||
"fs-extra": "11.2.0", | ||
"glob": "11.0.0", | ||
"globals": "15.9.0", | ||
"lefthook": "1.7.15", | ||
"npm-run-all": "4.1.5", | ||
"playwright": "1.47.0", | ||
"postcss": "8.4.45", | ||
"scaffdog": "4.0.0", | ||
|
@@ -79,7 +101,7 @@ | |
"vitest": "2.0.5" | ||
}, | ||
"engines": { | ||
"node": ">=20.0.0" | ||
"node": "22" | ||
}, | ||
"eslintConfig": { | ||
"extends": ["plugin:storybook/recommended"] | ||
|
Oops, something went wrong.