Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,20 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache: "pnpm"

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Lint
run: npm run lint --workspace=@worksight/${{ matrix.app }}
run: pnpm --filter @worksight/${{ matrix.app }} lint

- name: Build Docker image
run: |
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/ci-fallback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,35 @@ on:
pull_request:
branches: [main, dev]

# This workflow uses npm as a fallback if pnpm issues persist
jobs:
quality-npm:
name: Quality Checks (npm)
quality:
name: Quality Checks
runs-on: ubuntu-latest
if: false # Disabled by default, enable if pnpm CI fails
if: false # Disabled by default

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Type check
run: npm run type-check
run: pnpm type-check

- name: Lint check
run: npm run lint
run: pnpm lint

- name: Build application
run: npm run build
run: pnpm build
env:
NEXT_TELEMETRY_DISABLED: 1
13 changes: 8 additions & 5 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,25 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Type check
run: npm run type-check
run: pnpm type-check

- name: Lint check
run: npm run lint
run: pnpm lint

- name: Build application
run: npm run build
run: pnpm build
env:
NEXT_TELEMETRY_DISABLED: 1
22 changes: 14 additions & 8 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,25 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Build web app
run: npm run build --workspace=@worksight/web
run: pnpm --filter @worksight/web build

- name: Start application
run: |
cd apps/web
npm start &
pnpm start &
echo $! > server.pid
shell: bash

Expand All @@ -47,7 +50,7 @@ jobs:

- name: Run Lighthouse CI
run: |
npx lhci autorun --upload.target=temporary-public-storage
pnpm dlx @lhci/cli autorun --upload.target=temporary-public-storage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -66,17 +69,20 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Analyze bundle
run: npm run build:analyze --workspace=@worksight/web
run: pnpm --filter @worksight/web build:analyze

- name: Upload bundle analysis
uses: actions/upload-artifact@v4
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,29 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: npm ci
run: pnpm install --frozen-lockfile

- name: Lint ${{ matrix.app }}
run: npm run lint --workspace=${{ matrix.app }}
run: pnpm --filter ${{ matrix.app }} lint

- name: Build ${{ matrix.app }}
run: npm run build --workspace=${{ matrix.app }}
run: pnpm --filter ${{ matrix.app }} build

- name: Package ${{ matrix.app }} into ZIP
run: |
mkdir -p release/${{ matrix.app }}
cp -r apps/${{ matrix.app }}/.next release/${{ matrix.app }}/
cp -r apps/${{ matrix.app }}/.next release/${{ matrix.app }}/ || true
cp -r apps/${{ matrix.app }}/.vitepress/dist release/${{ matrix.app }}/ || true
cp -r apps/${{ matrix.app }}/package.json release/${{ matrix.app }}/
cd release
zip -r ../${{ matrix.app }}-${GITHUB_REF_NAME}.zip ${{ matrix.app }}
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ node_modules/
!.yarn/plugins
!.yarn/releases
!.yarn/versions
pnpm-lock.yaml
pnpm-workspace.yaml
.pnpm-debug.log*

######################
Expand Down
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@nestjs/platform-express": "^11.1.6",
"@nestjs/swagger": "^11.2.0",
"@supabase/supabase-js": "^2.58.0",
"@worksight/common": "*",
"@worksight/common": "workspace:*",
"class-transformer": "^0.5.1",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.2"
Expand Down
14 changes: 5 additions & 9 deletions apps/docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,23 @@
FROM node:24-alpine AS builder
WORKDIR /app

# Copy root manifests (required for monorepo install)
COPY package.json turbo.json ./
RUN corepack enable && corepack prepare pnpm@10.33.0 --activate

COPY package.json pnpm-workspace.yaml pnpm-lock.yaml turbo.json ./
COPY apps/docs/package.json apps/docs/

# Install dependencies for the docs workspace
RUN npm install --workspace=@worksight/docs --legacy-peer-deps
RUN pnpm install --frozen-lockfile --filter @worksight/docs...

# Copy the rest of the project
COPY . .

# Build VitePress site for production
RUN npm --workspace=@worksight/docs run build
RUN pnpm --filter @worksight/docs build

# ---- Runtime stage ----
FROM nginx:mainline-alpine
WORKDIR /usr/share/nginx/html

# Clean default nginx content
RUN rm -rf ./*

# Copy built site
COPY --from=builder /app/apps/docs/.vitepress/dist ./

EXPOSE 80
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/vercel.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 2,
"installCommand": "npm install",
"buildCommand": "npm run build --workspace=@worksight/docs",
"installCommand": "pnpm install --frozen-lockfile",
"buildCommand": "pnpm --filter @worksight/docs build",
"outputDirectory": ".vitepress/dist",
"framework": "vitepress",
"build": {
Expand Down
30 changes: 13 additions & 17 deletions apps/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,49 @@
FROM node:24-alpine AS base
WORKDIR /app

# Enable Corepack (optional, mainly for yarn/pnpm)
RUN corepack enable
RUN corepack enable && corepack prepare pnpm@10.33.0 --activate

# ---- Dependencies (dev + prod for build) ----
FROM base AS deps
WORKDIR /app

# Copy manifests
COPY package.json turbo.json ./
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml turbo.json ./
COPY apps/web/package.json apps/web/
COPY packages/assets/package.json packages/assets/
COPY packages/common/package.json packages/common/

# Install all dependencies (dev + prod) for build
RUN npm install --workspace=@worksight/web --legacy-peer-deps
RUN pnpm install --frozen-lockfile --filter @worksight/web...

# ---- Build ----
FROM deps AS build
WORKDIR /app

# Copy full source code
COPY . .

# Set dummy environment variables for build
ENV NEXT_PUBLIC_SUPABASE_URL="http://localhost:54321"
ENV NEXT_PUBLIC_SUPABASE_ANON_KEY="dummy_anon_key"
ENV NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY="dummy_key"
ENV NEXT_PUBLIC_IS_OFFLINE=false

# Build only the web app workspace
RUN npm --workspace=apps/web run build
RUN pnpm --filter @worksight/web build

# ---- Runtime (production only) ----
FROM node:24-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production

# Copy package manifests
COPY package.json turbo.json ./
RUN corepack enable && corepack prepare pnpm@10.33.0 --activate

COPY package.json pnpm-workspace.yaml pnpm-lock.yaml turbo.json ./
COPY apps/web/package.json apps/web/
COPY packages/assets/package.json packages/assets/
COPY packages/common/package.json packages/common/

# Install only production dependencies for the web workspace
RUN npm install --workspace=apps/web --omit=dev --legacy-peer-deps
RUN pnpm install --frozen-lockfile --prod --filter @worksight/web...

# Copy build artifacts
COPY --from=build /app/apps/web/.next /app/apps/web/.next
COPY --from=build /app/apps/web/public /app/apps/web/public

EXPOSE 3000

# Start the app
CMD ["npm", "--workspace=apps/web", "start"]
CMD ["pnpm", "--filter", "@worksight/web", "start"]
41 changes: 32 additions & 9 deletions apps/web/eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,46 @@
import { FlatCompat } from '@eslint/eslintrc';
import { dirname } from 'path';
import { fileURLToPath } from 'url';
import globals from 'globals';
import reactHooks from 'eslint-plugin-react-hooks';
import baseConfig from '../../eslint.config';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});

export default [
...baseConfig,
// your Next.js specific rules
...compat.extends('next/core-web-vitals'),
{
files: ["**/*.{ts,tsx}"],
files: ['**/*.{ts,tsx}'],
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.jest,
React: 'readonly',
}
}
},
},
},
{
"extends": [
"plugin:react-hooks/recommended"
]
}
];
files: ['**/*.{ts,tsx,js,jsx}'],
plugins: {
'react-hooks': reactHooks,
},
rules: {
...reactHooks.configs.recommended.rules,
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@next/next/no-html-link-for-pages': 'off',
'react/react-in-jsx-scope': 'off',
'react/no-unescaped-entities': 'warn',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-empty': ['error', { allowEmptyCatch: true }],
'prefer-const': 'error',
},
},
];
Loading
Loading