Skip to content

Commit

Permalink
pref: Add NODE_ENV production for deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
aXenDeveloper committed Jan 6, 2025
1 parent b0fab51 commit 10658ef
Show file tree
Hide file tree
Showing 22 changed files with 845 additions and 801 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
run: pnpm i --prod --ignore-scripts

- name: Build shared projects
run: pnpm build --filter=vitnode-shared
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
run: pnpm i --prod --ignore-scripts

- name: Build shared projects
run: pnpm build --filter=vitnode-shared
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
node-version: 22

- name: Install dependencies
run: pnpm install
run: pnpm i --prod --ignore-scripts

- name: Build CLI
run: pnpm run build:scripts
Expand Down
2 changes: 1 addition & 1 deletion apps/backend/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN turbo prune backend --docker
FROM base AS installer
WORKDIR /app
COPY --from=builder /app/out/json/ .
RUN pnpm i
RUN pnpm i --prod --ignore-scripts
COPY --from=builder /app/out/full/ .
RUN pnpm config:init -- --skip-database
RUN pnpm turbo build --filter=backend...
Expand Down
4 changes: 2 additions & 2 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"@nestjs/schematics": "^10.2.3",
"@swc/cli": "^0.5.2",
"@types/express": "^5.0.0",
"@types/node": "^22.10.2",
"@types/react": "^19.0.2",
"@types/node": "^22.10.5",
"@types/react": "^19.0.3",
"cross-env": "^7.0.3",
"eslint-config-typescript-vitnode": "workspace:*",
"shared": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN turbo prune frontend --docker
FROM base AS installer
WORKDIR /app
COPY --from=builder /app/out/json/ .
RUN pnpm i --ignore-scripts
RUN pnpm i --prod --ignore-scripts
COPY --from=builder /app/out/full/ .
COPY --from=builder /app/.prettierrc.mjs ./

Expand Down
6 changes: 3 additions & 3 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
"react-dom": "^19.0.0",
"react-hook-form": "^7.54.2",
"recharts": "^2.15.0",
"shiki": "^1.24.4",
"shiki": "^1.26.1",
"sonner": "^1.7.1",
"vitnode-frontend": "workspace:*",
"zod": "^3.24.1"
},
"devDependencies": {
"@next/bundle-analyzer": "^15.1.3",
"@types/node": "^22.10.2",
"@types/react": "^19.0.2",
"@types/node": "^22.10.5",
"@types/react": "^19.0.3",
"@types/react-dom": "^19.0.2",
"autoprefixer": "^10.4.20",
"cross-env": "^7.0.3",
Expand Down
2 changes: 1 addition & 1 deletion apps/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"devDependencies": {
"@types/multer": "^1.4.12",
"@types/node": "^22.10.2",
"@types/node": "^22.10.5",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"eslint-config-typescript-vitnode": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"config:init:skip-database": "cd apps/backend && pnpm config:init --skip-database && cd ../..",
"config:init": "turbo config:init",
"build:scripts": "turbo build:scripts && pnpm i",
"build:scripts": "turbo build:scripts && pnpm i --ignore-scripts",
"build": "turbo build:packages && turbo build",
"build:packages": "turbo build:packages",
"start": "turbo start",
Expand All @@ -29,7 +29,7 @@
}
},
"devDependencies": {
"@types/node": "^22.10.2",
"@types/node": "^22.10.5",
"eslint-config-typescript-vitnode": "workspace:*",
"turbo": "^2.3.3"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-email-resend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"resend"
],
"devDependencies": {
"@types/node": "^22.10.2",
"@types/node": "^22.10.5",
"eslint-config-typescript-vitnode": "workspace:*",
"typescript": "^5.7.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/backend-email-smtp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"smtp"
],
"devDependencies": {
"@types/node": "^22.10.2",
"@types/node": "^22.10.5",
"@types/nodemailer": "^6.4.17",
"eslint-config-typescript-vitnode": "workspace:*",
"typescript": "^5.7.2"
Expand Down
6 changes: 3 additions & 3 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@
"@types/cookie-parser": "^1.4.8",
"@types/express": "^5.0.0",
"@types/multer": "^1.4.12",
"@types/node": "^22.10.2",
"@types/node": "^22.10.5",
"@types/pg": "^8.11.10",
"@types/react": "^19.0.2",
"@types/react": "^19.0.3",
"@types/ua-parser-js": "^0.7.39",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
Expand All @@ -115,7 +115,7 @@
"@nestjs/swagger": "^8.1.0",
"@nestjs/throttler": "^6.3.0",
"@react-email/render": "^1.0.3",
"ai": "^4.0.22",
"ai": "^4.0.27",
"cache-manager": "^6.3.2",
"cookie-parser": "^1.4.7",
"dotenv": "^16.4.7",
Expand Down
12 changes: 6 additions & 6 deletions packages/create-vitnode-app/helpers/create-packages-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ export const createPackagesJSON = async ({
'react-dom': '^19.0.0',
'react-hook-form': '^7.54.2',
recharts: '^2.15.0',
shiki: '^1.24.4',
shiki: '^1.26.1',
sonner: '^1.7.1',
'vitnode-frontend': `^${pkg.version}`,
zod: '^3.24.1',
},
devDependencies: {
'@types/node': '^22.10.2',
'@types/react': '^19.0.2',
'@types/node': '^22.10.5',
'@types/react': '^19.0.3',
'@types/react-dom': '^19.0.2',
autoprefixer: '^10.4.20',
'eslint-config-typescript-vitnode': `^${pkg.version}`,
Expand Down Expand Up @@ -150,8 +150,8 @@ export const createPackagesJSON = async ({
'@nestjs/schematics': '^10.2.3',
'@swc/cli': '^0.5.2',
'@types/express': '^5.0.0',
'@types/node': '^22.10.2',
'@types/react': '^19.0.2',
'@types/node': '^22.10.5',
'@types/react': '^19.0.3',
'cross-env': '^7.0.3',
'eslint-config-typescript-vitnode': `^${pkg.version}`,
shared: packageManager.startsWith('npm') ? '*' : 'workspace:*',
Expand Down Expand Up @@ -188,7 +188,7 @@ export const createPackagesJSON = async ({
},
devDependencies: {
'@types/multer': '^1.4.12',
'@types/node': '^22.10.2',
'@types/node': '^22.10.5',
'class-transformer': '^0.5.1',
'class-validator': '^0.14.1',
'eslint-config-typescript-vitnode': `^${pkg.version}`,
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vitnode-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"devDependencies": {
"@types/cross-spawn": "^6.0.6",
"@types/figlet": "^1.7.0",
"@types/node": "^22.10.2",
"@types/node": "^22.10.5",
"@types/prompts": "^2.4.9",
"@types/validate-npm-package-name": "^4.0.2",
"commander": "^13.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN turbo prune backend --docker
FROM base AS installer
WORKDIR /app
COPY --from=builder /app/out/json/ .
RUN pnpm i
RUN pnpm i --prod --ignore-scripts
COPY --from=builder /app/out/full/ .
RUN pnpm config:init -- --skip-database
RUN pnpm turbo build --filter=backend...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN turbo prune frontend --docker
FROM base AS installer
WORKDIR /app
COPY --from=builder /app/out/json/ .
RUN pnpm i --ignore-scripts
RUN pnpm i --prod --ignore-scripts
COPY --from=builder /app/out/full/ .
COPY --from=builder /app/.prettierrc.mjs ./

Expand Down
1 change: 1 addition & 0 deletions packages/create-vitnode-app/templates/docker/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ if [ ! -f "./.env" ]; then
echo "DB_USER=$DB_USER" >> "./.env"
echo "DB_PASSWORD=$DB_PASSWORD" >> "./.env"
echo "DB_DATABASE=$DB_DATABASE" >> "./.env"
echo "NODE_ENV=production" >> "./.env"
else
echo ".env file already exists. Skipping creation."
fi
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-config-typescript-vitnode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
"eslint": "^9.17.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-perfectionist": "^4.4.0",
"eslint-plugin-perfectionist": "^4.6.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.3",
"eslint-plugin-react-compiler": "19.0.0-beta-df7b47d-20241124",
"eslint-plugin-react-hooks": "^5.1.0",
"globals": "^15.14.0",
"prettier-plugin-tailwindcss": "^0.6.9",
"typescript-eslint": "^8.19.0"
"typescript-eslint": "^8.19.1"
}
}
11 changes: 5 additions & 6 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@
"@hookform/resolvers": "^3.9.1",
"@swc/cli": "^0.5.2",
"@swc/core": "^1.10.4",
"@types/lodash": "^4.17.13",
"@types/node": "^22.10.2",
"@types/node": "^22.10.5",
"@types/nprogress": "^0.2.3",
"@types/react": "^19.0.2",
"@types/react": "^19.0.3",
"@types/react-dom": "^19.0.2",
"concurrently": "^9.1.2",
"eslint-config-typescript-vitnode": "workspace:*",
Expand All @@ -125,7 +124,7 @@
"react-dom": "^19.0.0",
"react-hook-form": "^7.54.2",
"recharts": "^2.15.0",
"shiki": "^1.24.4",
"shiki": "^1.26.1",
"sonner": "^1.7.1",
"tailwindcss": "^3.4.17",
"tsup": "^8.3.5",
Expand Down Expand Up @@ -159,7 +158,7 @@
"@radix-ui/react-tooltip": "^1.1.6",
"@radix-ui/react-visually-hidden": "^1.1.1",
"@tailwindcss/container-queries": "^0.1.1",
"@tanstack/react-query": "^5.62.11",
"@tanstack/react-query": "^5.62.15",
"@tiptap/extension-code-block": "^2.11.0",
"@tiptap/extension-color": "^2.11.0",
"@tiptap/extension-heading": "^2.11.0",
Expand All @@ -180,7 +179,7 @@
"embla-carousel-react": "^8.5.1",
"emoji-mart": "^5.6.0",
"html-react-parser": "^5.2.2",
"input-otp": "^1.4.1",
"input-otp": "^1.4.2",
"next-themes": "^0.4.4",
"nextjs-toploader": "^3.7.15",
"nprogress": "^0.2.0",
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/api/revalidate-tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const revalidateTags = {
revalidateTag(RevalidateTagEnum.Admin_Core_Sessions);
},
terms: (code: string, prevCode?: string) => {
revalidateTag(RevalidateTagEnum.Core_Terms_Show);
revalidateTag(`${RevalidateTagEnum.Core_Terms_Show}--${code}`);
if (prevCode) {
revalidateTag(`${RevalidateTagEnum.Core_Terms_Show}--${prevCode}`);
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"devDependencies": {
"@types/multer": "^1.4.12",
"@types/node": "^22.10.2",
"@types/node": "^22.10.5",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"eslint-config-typescript-vitnode": "workspace:*",
Expand Down
Loading

0 comments on commit 10658ef

Please sign in to comment.