Compare commits
6 Commits
feature/cm
...
v1.6.0
| Author | SHA1 | Date | |
|---|---|---|---|
| d7cec1fa0e | |||
| 67c2af958a | |||
| 015e295370 | |||
| c9952bfd1d | |||
| f9aaf3712e | |||
| d2bbfe3b40 |
@@ -1,7 +1,7 @@
|
|||||||
node_modules
|
node_modules
|
||||||
.next
|
.next
|
||||||
.git
|
.git
|
||||||
.npmrc
|
# .npmrc is allowed as it contains the registry template
|
||||||
dist
|
dist
|
||||||
build
|
build
|
||||||
out
|
out
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ name: Monorepo Pipeline
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
branches:
|
||||||
|
- '**'
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
@@ -15,6 +17,8 @@ jobs:
|
|||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
|
env:
|
||||||
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -28,12 +32,9 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node_version: 20
|
node_version: 20
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
env:
|
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: pnpm lint
|
run: pnpm lint
|
||||||
@@ -69,7 +70,6 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node_version: 20
|
node_version: 20
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ COPY packages/cli/package.json ./packages/cli/package.json
|
|||||||
COPY packages/observability/package.json ./packages/observability/package.json
|
COPY packages/observability/package.json ./packages/observability/package.json
|
||||||
COPY packages/next-observability/package.json ./packages/next-observability/package.json
|
COPY packages/next-observability/package.json ./packages/next-observability/package.json
|
||||||
COPY packages/husky-config/package.json ./packages/husky-config/package.json
|
COPY packages/husky-config/package.json ./packages/husky-config/package.json
|
||||||
COPY packages/ui/package.json ./packages/ui/package.json
|
|
||||||
|
|
||||||
# Use a secret for NPM_TOKEN and a cache mount for the pnpm store
|
# Use a secret for NPM_TOKEN and a cache mount for the pnpm store
|
||||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
|
|||||||
@@ -5,15 +5,34 @@ WORKDIR /app
|
|||||||
RUN corepack enable pnpm
|
RUN corepack enable pnpm
|
||||||
|
|
||||||
# Step 2: Install dependencies
|
# Step 2: Install dependencies
|
||||||
# We copy everything first because we have a .dockerignore
|
ENV NPM_TOKEN=placeholder
|
||||||
# and we need the workspace structure for pnpm to work correctly
|
# Copy manifest files specifically for better layer caching
|
||||||
COPY . .
|
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json .npmrc ./
|
||||||
|
# Copy package manifest files individually to preserve directory structure
|
||||||
|
COPY packages/cli/package.json ./packages/cli/
|
||||||
|
COPY packages/cms-infra/package.json ./packages/cms-infra/
|
||||||
|
COPY packages/customer-manager/package.json ./packages/customer-manager/
|
||||||
|
COPY packages/eslint-config/package.json ./packages/eslint-config/
|
||||||
|
COPY packages/feedback-commander/package.json ./packages/feedback-commander/
|
||||||
|
COPY packages/gatekeeper/package.json ./packages/gatekeeper/
|
||||||
|
COPY packages/husky-config/package.json ./packages/husky-config/
|
||||||
|
COPY packages/infra/package.json ./packages/infra/
|
||||||
|
COPY packages/mail/package.json ./packages/mail/
|
||||||
|
COPY packages/next-config/package.json ./packages/next-config/
|
||||||
|
COPY packages/next-feedback/package.json ./packages/next-feedback/
|
||||||
|
COPY packages/next-observability/package.json ./packages/next-observability/
|
||||||
|
COPY packages/next-utils/package.json ./packages/next-utils/
|
||||||
|
COPY packages/observability/package.json ./packages/observability/
|
||||||
|
COPY packages/tsconfig/package.json ./packages/tsconfig/
|
||||||
|
# packages/ui does not have a package.json
|
||||||
|
|
||||||
# Use a secret for NPM_TOKEN to authenticate with private registry
|
# Use a secret for NPM_TOKEN and a standardized cache mount
|
||||||
RUN --mount=type=cache,target=/root/.local/share/pnpm/store/v3 \
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||||
--mount=type=secret,id=NPM_TOKEN \
|
--mount=type=secret,id=NPM_TOKEN \
|
||||||
export NPM_TOKEN=$(cat /run/secrets/NPM_TOKEN) && \
|
export NPM_TOKEN=$(cat /run/secrets/NPM_TOKEN) && \
|
||||||
|
pnpm config set store-dir /pnpm/store && \
|
||||||
pnpm i --frozen-lockfile
|
pnpm i --frozen-lockfile
|
||||||
|
|
||||||
# Step 3: Build shared packages
|
# Step 3: Build shared packages
|
||||||
|
COPY . .
|
||||||
RUN pnpm --filter "./packages/*" -r build
|
RUN pnpm --filter "./packages/*" -r build
|
||||||
|
|||||||
@@ -1,19 +1,22 @@
|
|||||||
FROM node:20-alpine
|
FROM node:20-alpine AS runner
|
||||||
|
RUN apk add --no-cache libc6-compat curl
|
||||||
|
|
||||||
# Install essential production utilities
|
WORKDIR /app
|
||||||
RUN apk add --no-cache curl libc6-compat
|
|
||||||
|
|
||||||
# Set standard production environment
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
ENV HOSTNAME="0.0.0.0"
|
ENV HOSTNAME="0.0.0.0"
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Create non-root user for security
|
# Create non-root user for security
|
||||||
RUN addgroup --system --gid 1001 nodejs && \
|
RUN addgroup --system --gid 1001 nodejs && \
|
||||||
adduser --system --uid 1001 nextjs
|
adduser --system --uid 1001 nextjs
|
||||||
|
|
||||||
# Expose the default Next.js port
|
# Set correct permissions
|
||||||
|
RUN chown -R nextjs:nodejs /app
|
||||||
|
|
||||||
|
USER nextjs
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
|
CMD ["node", "server.js"]
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
"@mintel/tsconfig": "workspace:*",
|
"@mintel/tsconfig": "workspace:*",
|
||||||
"@types/react": "^19.0.0",
|
"@types/react": "^19.0.0",
|
||||||
"@types/react-dom": "^19.0.0",
|
"@types/react-dom": "^19.0.0",
|
||||||
|
"prettier": "^3.8.1",
|
||||||
"tsup": "^8.3.5",
|
"tsup": "^8.3.5",
|
||||||
"typescript": "^5.0.0",
|
"typescript": "^5.0.0",
|
||||||
"vitest": "^3.0.4"
|
"vitest": "^3.0.4"
|
||||||
|
|||||||
23
packages/mail/vitest.config.ts
Normal file
23
packages/mail/vitest.config.ts
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import { defineConfig } from "vitest/config";
|
||||||
|
import path from "path";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
test: {
|
||||||
|
environment: "node",
|
||||||
|
alias: {
|
||||||
|
"prettier/plugins/html": path.resolve(
|
||||||
|
process.cwd(),
|
||||||
|
"../../node_modules/prettier/plugins/html.js",
|
||||||
|
),
|
||||||
|
"prettier/parser-html": path.resolve(
|
||||||
|
process.cwd(),
|
||||||
|
"../../node_modules/prettier/plugins/html.js",
|
||||||
|
),
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
deps: {
|
||||||
|
inline: [/@react-email/],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -23,8 +23,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsup",
|
"build": "tsup",
|
||||||
"dev": "tsup --watch",
|
"dev": "tsup --watch",
|
||||||
"lint": "eslint src/",
|
"lint": "eslint src/"
|
||||||
"test": "vitest run"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@directus/sdk": "^21.0.0",
|
"@directus/sdk": "^21.0.0",
|
||||||
|
|||||||
9
pnpm-lock.yaml
generated
9
pnpm-lock.yaml
generated
@@ -517,6 +517,9 @@ importers:
|
|||||||
'@types/react-dom':
|
'@types/react-dom':
|
||||||
specifier: ^19.0.0
|
specifier: ^19.0.0
|
||||||
version: 19.2.3(@types/react@19.2.10)
|
version: 19.2.3(@types/react@19.2.10)
|
||||||
|
prettier:
|
||||||
|
specifier: ^3.8.1
|
||||||
|
version: 3.8.1
|
||||||
tsup:
|
tsup:
|
||||||
specifier: ^8.3.5
|
specifier: ^8.3.5
|
||||||
version: 8.5.1(@swc/core@1.15.11(@swc/helpers@0.5.18))(jiti@2.6.1)(postcss@8.5.6)(tsx@4.21.0)(typescript@5.9.3)(yaml@2.8.2)
|
version: 8.5.1(@swc/core@1.15.11(@swc/helpers@0.5.18))(jiti@2.6.1)(postcss@8.5.6)(tsx@4.21.0)(typescript@5.9.3)(yaml@2.8.2)
|
||||||
@@ -681,7 +684,7 @@ importers:
|
|||||||
version: 5.9.3
|
version: 5.9.3
|
||||||
vitest:
|
vitest:
|
||||||
specifier: ^2.0.0
|
specifier: ^2.0.0
|
||||||
version: 2.1.9(@types/node@25.2.2)(@vitest/ui@4.0.18)(happy-dom@20.4.0)(jsdom@27.4.0)(lightningcss@1.30.2)(sass@1.97.3)(terser@5.46.0)
|
version: 2.1.9(@types/node@25.2.2)(@vitest/ui@4.0.18(vitest@4.0.18))(happy-dom@20.4.0)(jsdom@27.4.0)(lightningcss@1.30.2)(sass@1.97.3)(terser@5.46.0)
|
||||||
|
|
||||||
packages/tsconfig: {}
|
packages/tsconfig: {}
|
||||||
|
|
||||||
@@ -14041,7 +14044,7 @@ snapshots:
|
|||||||
sirv: 3.0.2
|
sirv: 3.0.2
|
||||||
tinyglobby: 0.2.15
|
tinyglobby: 0.2.15
|
||||||
tinyrainbow: 3.0.3
|
tinyrainbow: 3.0.3
|
||||||
vitest: 4.0.18(@opentelemetry/api@1.9.0)(@types/node@22.19.10)(@vitest/ui@4.0.18)(happy-dom@20.4.0)(jiti@2.6.1)(jsdom@27.4.0)(lightningcss@1.30.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.21.0)(yaml@2.8.2)
|
vitest: 4.0.18(@opentelemetry/api@1.9.0)(@types/node@20.19.30)(@vitest/ui@4.0.18)(happy-dom@20.4.0)(jiti@2.6.1)(jsdom@27.4.0)(lightningcss@1.30.2)(sass@1.97.3)(terser@5.46.0)(tsx@4.21.0)(yaml@2.8.2)
|
||||||
|
|
||||||
'@vitest/utils@2.1.9':
|
'@vitest/utils@2.1.9':
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -20481,7 +20484,7 @@ snapshots:
|
|||||||
tsx: 4.21.0
|
tsx: 4.21.0
|
||||||
yaml: 2.8.2
|
yaml: 2.8.2
|
||||||
|
|
||||||
vitest@2.1.9(@types/node@25.2.2)(@vitest/ui@4.0.18)(happy-dom@20.4.0)(jsdom@27.4.0)(lightningcss@1.30.2)(sass@1.97.3)(terser@5.46.0):
|
vitest@2.1.9(@types/node@25.2.2)(@vitest/ui@4.0.18(vitest@4.0.18))(happy-dom@20.4.0)(jsdom@27.4.0)(lightningcss@1.30.2)(sass@1.97.3)(terser@5.46.0):
|
||||||
dependencies:
|
dependencies:
|
||||||
'@vitest/expect': 2.1.9
|
'@vitest/expect': 2.1.9
|
||||||
'@vitest/mocker': 2.1.9(vite@5.4.21(@types/node@25.2.2)(lightningcss@1.30.2)(sass@1.97.3)(terser@5.46.0))
|
'@vitest/mocker': 2.1.9(vite@5.4.21(@types/node@25.2.2)(lightningcss@1.30.2)(sass@1.97.3)(terser@5.46.0))
|
||||||
|
|||||||
Reference in New Issue
Block a user