-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
JH
committed
Oct 23, 2023
1 parent
60f53d7
commit 622bf58
Showing
44 changed files
with
6,522 additions
and
7,247 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
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,5 +1,5 @@ | ||
/lib | ||
node_modules | ||
/coverage | ||
yarn-error.log | ||
dist | ||
lib/lib | ||
.pnpm-store |
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 |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
**/.hg | ||
**/node_modules | ||
**/.next | ||
**/dist | ||
**/lib/lib |
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,31 @@ | ||
FROM node:20 AS base | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
COPY . /app | ||
WORKDIR /app | ||
|
||
FROM base AS prod-deps | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile | ||
|
||
FROM base AS build | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
RUN pnpm run -r build | ||
|
||
FROM base AS lib | ||
COPY --from=prod-deps /app/lib/node_modules/ /app/lib/node_modules | ||
COPY --from=build /app/lib/dist /app/lib/dist | ||
|
||
FROM lib AS express | ||
COPY --from=prod-deps /app/examples/express/node_modules/ /app/examples/express/node_modules | ||
COPY --from=build /app/examples/express/dist /app/examples/express/dist | ||
WORKDIR /app/examples/express | ||
EXPOSE 3000 | ||
CMD [ "pnpm", "start" ] | ||
|
||
FROM lib AS next | ||
COPY --from=prod-deps /app/packages/app2/node_modules/ /app/packages/app2/node_modules | ||
COPY --from=build /app/packages/app2/dist /app/packages/app2/dist | ||
WORKDIR /app/packages/app2 | ||
EXPOSE 30001 | ||
CMD [ "pnpm", "start" ] |
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,28 +1,33 @@ | ||
services: | ||
varnish: | ||
image: varnish:7.3 | ||
image: varnish:stable | ||
container_name: varnish | ||
volumes: | ||
- ./default.vcl:/etc/varnish/default.vcl:ro | ||
tmpfs: | ||
- /var/lib/varnish/varnishd:exec | ||
ports: | ||
- "8080:80" | ||
restart: always | ||
restart: unless-stopped | ||
depends_on: | ||
- node | ||
|
||
node: | ||
image: node:18 | ||
image: node:20 | ||
working_dir: /home/node/app | ||
user: node | ||
# user: node | ||
init: true | ||
volumes: | ||
- ./:/home/node/app | ||
command: yarn dev | ||
ports: | ||
- "3000:3000" | ||
- ../../:/home/node/app | ||
command: corepack pnpm --filter esi-express dev | ||
# ports: | ||
# - "3000:3000" | ||
environment: | ||
- NODE_ENV=development | ||
- REACT_ESI_SECRET=secret | ||
restart: always | ||
|
||
restart: unless-stopped | ||
|
||
volumes: | ||
node_modules: | ||
node_modules-lib: | ||
node_modules-express: |
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,8 @@ | ||
#!/bin/sh | ||
# entrypoint.sh | ||
|
||
# Install dependencies | ||
corepack pnpm --filter=!esi-next install --frozen-lockfile --force | ||
|
||
# Start the application | ||
corepack pnpm --filter esi-express run dev |
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,31 +1,35 @@ | ||
{ | ||
"name": "esi-express", | ||
"version": "1.0.0", | ||
"private": true, | ||
"description": "An example project to demonstrate usage of ESI with Express", | ||
"repository": "https://github.com/dunglas/react-esi/examples/express", | ||
"license": "MIT", | ||
"author": "Kévin Dunglas", | ||
"main": "dist/app.js", | ||
"scripts": { | ||
"build": "esbuild src/main.jsx --bundle --outfile=dist/app.js", | ||
"dev": "tsx src/server.jsx", | ||
"postinstall": "corepack pnpm build", | ||
"start": "cross-env NODE_ENV=production tsx src/server.jsx" | ||
}, | ||
"dependencies": { | ||
"express": "^4.18.2", | ||
"prop-types": "^15.8.1", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-esi": "latest" | ||
"react-esi": "workspace:*" | ||
}, | ||
"description": "An example project to demonstrate usage of ESI with Express", | ||
"devDependencies": { | ||
"@types/express": "^4.17.20", | ||
"@types/node": "^18.17.4", | ||
"@types/react": "^18.2.21", | ||
"@types/react-dom": "^18.2.7", | ||
"esbuild": "^0.19.0", | ||
"nodemon": "^3.0.1", | ||
"@types/prop-types": "^15.7.9", | ||
"@types/react": "^18.2.30", | ||
"@types/react-dom": "^18.2.14", | ||
"cross-env": "^7.0.3", | ||
"esbuild": "^0.19.5", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^5.1.6" | ||
}, | ||
"license": "MIT", | ||
"main": "index.js", | ||
"name": "esi-express-example", | ||
"repository": "https://github.com/dunglas/react-esi/examples/express", | ||
"scripts": { | ||
"dev": "nodemon", | ||
"start": "cross-env NODE_ENV=production ts-node --project tsconfig.server.json src/server.jsx", | ||
"build": "esbuild src/main.jsx --bundle --outfile=dist/app.js", | ||
"postinstall": "yarn build" | ||
}, | ||
"version": "1.0.0" | ||
} | ||
"tsx": "^3.14.0", | ||
"typescript": "^5.2.2" | ||
} | ||
} |
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,4 +1,3 @@ | ||
import React from "react"; | ||
import { hydrateRoot } from "react-dom/client"; | ||
import App from "./pages/App"; | ||
|
||
|
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,24 +1,18 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es6", | ||
"lib": ["dom", "dom.iterable", "esnext"], | ||
"target": "ES5", | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"strict": false, | ||
"forceConsistentCasingInFileNames": true, | ||
"noEmit": true, | ||
"esModuleInterop": true, | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"moduleResolution": "bundler", | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"jsx": "preserve", | ||
"allowSyntheticDefaultImports": true, | ||
"incremental": true, | ||
"paths": { | ||
"react-esi/*": ["../../src/*"] | ||
} | ||
"jsx": "react-jsx", | ||
"incremental": true | ||
}, | ||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "../../src/*"], | ||
"include": ["**/*.jsx"], | ||
"exclude": ["node_modules"] | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.