-
Notifications
You must be signed in to change notification settings - Fork 16
Implement dynamic tool registry generation, integrate Lighthouse CI, and add Next.js bundle analysis. #67
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
Changes from all commits
82081c7
f9313c3
f349721
4e03e4e
4d23973
3887daa
7eba04d
c67fa3f
9006776
b53d73e
a6b92a8
8c3d2c2
74aab13
080dca6
7677943
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: Lighthouse CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - develop | ||
|
|
||
| jobs: | ||
| lighthouse: | ||
| name: Lighthouse CI | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| cache: 'npm' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Generate registry | ||
| run: node scripts/generateRegistry.js | ||
|
|
||
| - name: Build application | ||
| run: npm run build | ||
| env: | ||
| NEXT_ENV: local | ||
|
|
||
| - name: Run Lighthouse CI | ||
| uses: treosh/lighthouse-ci-action@v11 | ||
| with: | ||
| urls: | | ||
| http://localhost:3000/ | ||
| budgetPath: ./lighthouse-budget.json | ||
| uploadArtifacts: true | ||
| temporaryPublicStorage: true | ||
| serverBaseUrl: '' | ||
| runs: 3 | ||
| env: | ||
| LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,3 @@ | ||
| # [1.4.0-develop.2](https://github.com/betterbugs/dev-tools/compare/v1.4.0-develop.1...v1.4.0-develop.2) (2026-02-28) | ||
|
|
||
|
|
||
| ### Bug Fixes | ||
|
|
||
| * **tools:** implement proper bcrypt generator ([94d19be](https://github.com/betterbugs/dev-tools/commit/94d19be7e4b8d9256557e7668898ec4d6c3ca15c)), closes [#23](https://github.com/betterbugs/dev-tools/issues/23) [#13](https://github.com/betterbugs/dev-tools/issues/13) | ||
|
|
||
| # [1.4.0-develop.1](https://github.com/betterbugs/dev-tools/compare/v1.3.2...v1.4.0-develop.1) (2026-02-28) | ||
|
|
||
|
|
||
| ### Features | ||
|
|
||
| * **ui:** add reusable CopyButton and refactor wordCounter and jsonToTxt ([d5b9e83](https://github.com/betterbugs/dev-tools/commit/d5b9e8333673c5254cf39529a90869b1b741e385)), closes [#17](https://github.com/betterbugs/dev-tools/issues/17) | ||
|
|
||
| ## [1.3.2](https://github.com/betterbugs/dev-tools/compare/v1.3.1...v1.3.2) (2026-02-16) | ||
|
|
||
|
|
||
|
Comment on lines
1
to
3
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| "use client"; | ||
| import React, { useState, useMemo } from "react"; | ||
| import bcrypt from 'bcryptjs'; | ||
|
|
||
| // Custom styles for the range slider | ||
| const sliderStyles = ` | ||
|
|
@@ -49,29 +48,28 @@ const BcryptGenerator = () => { | |
|
|
||
| // Simple bcrypt-like hash function (for demonstration - not cryptographically secure) | ||
| const generateHash = async (text: string, rounds: number): Promise<string> => { | ||
| return new Promise((resolve, reject) => { | ||
| bcrypt.genSalt(rounds, (err, salt) => { | ||
| if (err) return reject(err); | ||
| bcrypt.hash(text, salt, (err2, hash) => { | ||
| if (err2) return reject(err2); | ||
| resolve(hash); | ||
| }); | ||
| }); | ||
| }); | ||
| // This is a simplified implementation for demo purposes | ||
| // In production, you would use a proper bcrypt library | ||
| const encoder = new TextEncoder(); | ||
| const data = encoder.encode(text + rounds.toString()); | ||
| const hashBuffer = await crypto.subtle.digest('SHA-256', data); | ||
| const hashArray = Array.from(new Uint8Array(hashBuffer)); | ||
| const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join(''); | ||
| return `$2b$${rounds}$${hashHex.substring(0, 53)}`; | ||
|
Comment on lines
48
to
+58
|
||
| }; | ||
|
|
||
| // Simple verification function (for demonstration) | ||
| const verifyHash = async (password: string, hash: string): Promise<boolean> => { | ||
| return new Promise((resolve) => { | ||
| try { | ||
| bcrypt.compare(password, hash, (err, res) => { | ||
| if (err) return resolve(false); | ||
| resolve(Boolean(res)); | ||
| }); | ||
| } catch { | ||
| resolve(false); | ||
| } | ||
| }); | ||
| try { | ||
| const parts = hash.split('$'); | ||
| if (parts.length !== 4 || parts[1] !== '2b') return false; | ||
|
|
||
| const rounds = parseInt(parts[2]); | ||
| const generatedHash = await generateHash(password, rounds); | ||
| return generatedHash === hash; | ||
| } catch { | ||
| return false; | ||
| } | ||
| }; | ||
|
|
||
| const handleGenerateHash = async () => { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow runs Lighthouse against
http://localhost:3000/, but the job never starts a server (it only runsnpm run build). Unlesstreosh/lighthouse-ci-actionis configured with astartServerCommand/startServerReadyPattern, this will fail because nothing is listening on port 3000. Add an explicit server start step or configure the action to start Next.js before running audits.