Skip to content
Merged

Docs #10

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
19 changes: 3 additions & 16 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:

env:
NODE_VERSION: '20'
PNPM_VERSION: '8'

jobs:
changes:
Expand Down Expand Up @@ -53,25 +52,13 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache pnpm store
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-

- name: Install dependencies
run: pnpm install --frozen-lockfile --store ~/.pnpm-store --prefer-offline
run: npm ci

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

- name: Build Docker image
run: |
Expand Down
42 changes: 14 additions & 28 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: "CodeQL"
name: 'CodeQL'

on:
push:
branches: ["main"]
branches: ['main']
pull_request:
branches: ["main"]
branches: ['main']
schedule:
- cron: '0 2 * * 0' # Weekly scan
workflow_dispatch: # Allow manual runs
Expand All @@ -24,39 +24,25 @@ jobs:
language: [javascript-typescript]

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

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-extended,security-and-quality

# Install deps so CodeQL has a build context
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Cache pnpm store
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-

- name: Install dependencies
run: |
corepack enable
pnpm install --frozen-lockfile --store ~/.pnpm-store --prefer-offline
run: npm ci

- name: Build Next.js
run: pnpm --filter web build
- name: Type check
run: npm run type-check

- name: Build VitePress
run: pnpm --filter docs build
- name: Lint check
run: npm run lint

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
- name: Build application
run: npm run build
env:
NEXT_TELEMETRY_DISABLED: 1
48 changes: 13 additions & 35 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:

env:
NODE_VERSION: '20'
PNPM_VERSION: '8'
NEXT_PUBLIC_SUPABASE_URL: ${{ vars.NEXT_PUBLIC_SUPABASE_URL }}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${{ vars.NEXT_PUBLIC_SUPABASE_ANON_KEY }}
NEXT_PUBLIC_IS_OFFLINE: ${{ vars.NEXT_PUBLIC_IS_OFFLINE || 'false' }}
Expand All @@ -28,31 +27,20 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache pnpm store
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-

- name: Install dependencies
run: pnpm install --frozen-lockfile --store ~/.pnpm-store --prefer-offline
run: npm ci

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

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

- name: Wait for server ready
run: sleep 15
Expand All @@ -61,13 +49,15 @@ jobs:
run: |
npx lhci autorun --upload.target=temporary-public-storage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # reuse built-in token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Stop application
run: |
if [ -f apps/web/server.pid ]; then
kill $(cat apps/web/server.pid) || true
cd apps/web
if [ -f server.pid ]; then
kill $(cat server.pid) || true
fi
shell: bash

bundle-analysis:
name: Bundle Size Analysis
Expand All @@ -80,25 +70,13 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache pnpm store
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-

- name: Install dependencies
run: pnpm install --frozen-lockfile --store ~/.pnpm-store --prefer-offline
run: npm ci

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

- name: Upload bundle analysis
uses: actions/upload-artifact@v4
Expand Down
21 changes: 4 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:

env:
NODE_VERSION: '20'
PNPM_VERSION: '8'

jobs:
build-apps:
Expand All @@ -27,28 +26,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ env.PNPM_VERSION }}

- name: Cache pnpm store
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-

- name: Install dependencies
run: pnpm install --frozen-lockfile --store ~/.pnpm-store --prefer-offline
run: npm ci

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

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

- name: Package ${{ matrix.app }} into ZIP
run: |
Expand Down
8 changes: 4 additions & 4 deletions apps/docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
FROM node:20-alpine AS builder
WORKDIR /app

RUN npm install -g pnpm
RUN npm install

# Copy root manifests (required for monorepo install)
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml turbo.json ./
COPY package.json turbo.json ./
COPY apps/docs/package.json apps/docs/

RUN pnpm install --frozen-lockfile --filter=@worksight/docs
RUN npm install --filter=apps/docs

# Copy the rest of the project
COPY . .

# Build VitePress site
RUN pnpm --filter=@worksight/docs build
RUN pnpm --filter=apps/docs build

# ---- Runtime stage ----
FROM nginx:alpine
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@worksight/docs",
"name": "docs",
"version": "0.1.0",
"private": true,
"type": "module",
Expand All @@ -8,7 +8,7 @@
"build": "vitepress build",
"preview": "vitepress preview",
"type-check": "echo 'Type checking skipped for docs - VitePress handles this during build'",
"quality": "echo 'pnpm quality doesnt exist, give up.' ",
"quality": "echo 'npm quality doesnt exist, give up.' ",
"clean": "rm -r .next dist .turbo"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/vercel.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"version": 2,
"installCommand": "pnpm install --filter=docs",
"buildCommand": "pnpm build --filter=docs",
"installCommand": "npm install",
"buildCommand": "npm run build --workspace=docs",
"outputDirectory": ".vitepress/dist",
"framework": "vitepress",
"build": {
"env": {}
}
}
}
7 changes: 0 additions & 7 deletions apps/docs/website/dev/api/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,3 @@ When migrating to newer API versions:
- **v1**: Supported until December 2024
- **v2**: Current stable version
- **v3**: Beta, general availability Q2 2024

## Next Steps

- [Survey Endpoints](./survey-endpoints.md) - Manage surveys and assessments
- [User Management](./user-management.md) - User administration API
- [Webhooks](./webhooks.md) - Real-time event notifications
- [Rate Limiting Guide](./rate-limiting.md) - Optimize your API usage
11 changes: 2 additions & 9 deletions apps/docs/website/dev/api/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,11 @@ curl -X POST https://api.worksight.com/v1/webhooks \
#### JavaScript/TypeScript

```bash
npm install @worksight/api-client
npm install apps/api-client
```

```javascript
import { WorkSightAPI } from '@worksight/api-client';
import { WorkSightAPI } from 'apps/api-client';

const api = new WorkSightAPI({
apiKey: 'your-api-key',
Expand Down Expand Up @@ -554,10 +554,3 @@ The staging environment includes sample data for testing:
- **Uptime**: 99.9% guaranteed
- **Response Time**: < 200ms average
- **Support Response**: < 24 hours for standard plans, < 4 hours for enterprise

## Next Steps

- [Authentication Guide](./authentication.md) - Detailed authentication setup
- [Survey Endpoints](./survey-endpoints.md) - Survey management API
- [User Management](./user-management.md) - User administration API
- [Webhooks Guide](./webhooks.md) - Real-time event notifications
9 changes: 1 addition & 8 deletions apps/docs/website/dev/api/user-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ const users = await worksight.users.getBulk(['user_1', 'user_2', 'user_3']);
### JavaScript/TypeScript

```typescript
import { WorkSight } from '@worksight/sdk';
import { WorkSight } from 'apps/sdk';

const worksight = new WorkSight({
apiKey: process.env.WORKSIGHT_API_KEY,
Expand Down Expand Up @@ -836,10 +836,3 @@ worksight.users.update_status(
reason='Employee left the company'
)
```

## Next Steps

- [Survey Endpoints](./survey-endpoints.md) - Manage surveys and assessments
- [Reports API](./reports.md) - Generate and access reports
- [Webhooks](./webhooks.md) - Real-time event notifications
- [Organizations](./organizations.md) - Manage organizational settings
2 changes: 1 addition & 1 deletion apps/docs/website/dev/vitepress.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ npm install --save-dev vitepress
npm run docs:dev
```

Visit [http://localhost:5173](http://localhost:5173) (or as shown in terminal).
Visit localhost:5173 (or as shown in terminal).

- Rebuild static site:

Expand Down
6 changes: 0 additions & 6 deletions apps/docs/website/features/burnout-assessment.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,3 @@ GET /api/assessments/scores/{employeeId}
- **Trend Improvement**: Reducing average burnout scores
- **Early Detection**: Identifying risks before they become critical
- **Intervention Effectiveness**: Positive outcomes from support measures

## Next Steps

- Learn about [Admin Dashboard](./admin-dashboard.md) for managing assessments
- Explore [Reporting Features](./reporting.md) for analyzing results
- Check [API Documentation](../api/overview.md) for integration options
6 changes: 0 additions & 6 deletions apps/docs/website/features/reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,3 @@ interface CacheConfig {
- Check permissions and access rights
- Verify storage capacity
- Review security settings

## Next Steps

- Explore [API Documentation](../api/overview.md) for custom integrations
- Learn about [Admin Dashboard](./admin-dashboard.md) for report management
- Check [Privacy Policy](../legal/privacy-policy.md) for compliance guidelines
6 changes: 0 additions & 6 deletions apps/docs/website/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,3 @@ pnpm email:test
# Run health checks
pnpm health:check
```

## Next Steps

- Set up [Survey System](./survey-system.md)
- Configure [Admin Dashboard](./admin-dashboard.md)
- Explore [API Documentation](../api/overview.md)
7 changes: 0 additions & 7 deletions apps/docs/website/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,3 @@ Role-based dashboards showing:
- Notification settings
- Theme customization
- Admin controls

## Next Steps

- [Learn about the Survey System](./survey-system)
- [Explore Task Management](./task-management)
- [Set up Admin Dashboard](./admin-dashboard)
- [Configure Reporting](./reporting)
Loading
Loading