Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Centralizes some frontend deps to workspace, updates knip #2762

Merged
merged 7 commits into from
Oct 1, 2024
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
8 changes: 4 additions & 4 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend/apps/web
working-directory: frontend
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -22,7 +22,7 @@ jobs:
cache: npm
cache-dependency-path: ./frontend/package-lock.json

- run: npm install
- run: npm ci
- run: npm run knip:production

prettier:
Expand All @@ -42,7 +42,7 @@ jobs:
cache: npm
cache-dependency-path: ./frontend/package-lock.json

- run: npm install
- run: npm ci
- run: npm run prettier:check

build:
Expand All @@ -62,7 +62,7 @@ jobs:
cache: npm
cache-dependency-path: ./frontend/package-lock.json

- run: npm install
- run: npm ci
- name: Build
run: npm run build
env:
Expand Down
27 changes: 27 additions & 0 deletions docs/knip.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"$schema": "https://unpkg.com/knip@5/schema-jsonc.json",
"ignore": [
"babel.config.js",
"docusaurus.config.ts",
"sidebars.ts",
"proto-sidebars.ts",
"protos/**",
"static/sync-dark-mode.js",
"src/**",
"src/theme/**",
],
"ignoreDependencies": [
"@docusaurus/preset-classic",
"@radix-ui/react-icons",
"autoprefixer",
"postcss",
"prism-react-renderer",
"react-icons",
"tailwindcss",
"class-variance-authority",
"tailwind-merge",
"docusaurus-protobuffet",
"posthog-docusaurus",
],
"ignoreBinaries": [],
}
29 changes: 0 additions & 29 deletions docs/knip.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ function verifySignature(
untrustedSignature: string
): boolean {
const signature = createHmac('sha256', secret).update(body).digest('hex');
const trusted = Buffer.from(signature, 'ascii');
const untrusted = Buffer.from(untrustedSignature, 'ascii');
const trusted = new Uint8Array(Buffer.from(signature, 'ascii'));
const untrusted = new Uint8Array(Buffer.from(untrustedSignature, 'ascii'));
Comment on lines +151 to +152
Copy link
Member Author

@nickzelei nickzelei Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was a new build error. the node docs say a buffer is allowed but I think the nodejs types might be broken or something. either way this should work just fine.

return timingSafeEqual(trusted, untrusted);
}

Expand Down
4 changes: 2 additions & 2 deletions frontend/apps/web/app/api/webhooks/keycloak/slack/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ function verifySignature(
untrustedSignature: string
): boolean {
const signature = createHmac('sha256', secret).update(body).digest('hex');
const trusted = Buffer.from(signature, 'ascii');
const untrusted = Buffer.from(untrustedSignature, 'ascii');
const trusted = new Uint8Array(Buffer.from(signature, 'ascii'));
const untrusted = new Uint8Array(Buffer.from(untrustedSignature, 'ascii'));
return timingSafeEqual(trusted, untrusted);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ function verifySignature(
untrustedSignature: string
): boolean {
const signature = createHmac('sha256', secret).update(body).digest('hex');
const trusted = Buffer.from(signature, 'ascii');
const untrusted = Buffer.from(untrustedSignature, 'ascii');
const trusted = new Uint8Array(Buffer.from(signature, 'ascii'));
const untrusted = new Uint8Array(Buffer.from(untrustedSignature, 'ascii'));
return timingSafeEqual(trusted, untrusted);
}
38 changes: 0 additions & 38 deletions frontend/apps/web/components/ui/checkbox.tsx

This file was deleted.

42 changes: 0 additions & 42 deletions frontend/apps/web/knip.ts

This file was deleted.

7 changes: 1 addition & 6 deletions frontend/apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"latest-tag": "git tag --sort=creatordate | tail -1",
"knip": "knip",
"knip:production": "knip --production --strict",
"typecheck": "tsc --noEmit",
Expand All @@ -26,7 +25,6 @@
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-alert-dialog": "^1.1.1",
"@radix-ui/react-avatar": "^1.1.0",
"@radix-ui/react-checkbox": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.1",
"@radix-ui/react-dropdown-menu": "^2.1.1",
"@radix-ui/react-icons": "^1.3.0",
Expand Down Expand Up @@ -68,7 +66,6 @@
"sql-formatter": "^15.4.2",
"tailwind-merge": "^2.5.1",
"tailwindcss-animate": "^1.0.7",
"use-resize-observer": "^9.1.0",
"usehooks-ts": "^3.1.0",
"yaml": "^2.5.1",
"yup": "^1.4.0"
Expand All @@ -85,11 +82,9 @@
"eslint": "8.57.0",
"eslint-config-next": "^14.2.5",
"jest": "^29.7.0",
"knip": "^5.27.2",
"postcss": "^8.4.41",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.9",
"ts-jest": "^29.2.4",
"typescript": "5.5.4"
"ts-jest": "^29.2.4"
}
}
7 changes: 7 additions & 0 deletions frontend/knip.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://unpkg.com/knip@5/schema-jsonc.json",
"ignore": ["apps/web/components/ui/**"],
"ignoreWorkspaces": ["packages/sdk"],
"ignoreDependencies": ["tailwindcss-animate"],
"ignoreBinaries": [],
}
Loading