Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
46 changes: 46 additions & 0 deletions .github/workflows/lighthouse.yml
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/
Copy link

Copilot AI Mar 3, 2026

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 runs npm run build). Unless treosh/lighthouse-ci-action is configured with a startServerCommand/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.

Suggested change
http://localhost:3000/
http://localhost:3000/
startServerCommand: npm run start

Copilot uses AI. Check for mistakes.
budgetPath: ./lighthouse-budget.json
uploadArtifacts: true
temporaryPublicStorage: true
serverBaseUrl: ''
runs: 3
env:
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
14 changes: 0 additions & 14 deletions CHANGELOG.md
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
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

This PR deletes the prerelease entries at the top of CHANGELOG.md. Since the repo uses semantic-release with the changelog plugin, removing existing entries loses release history and can confuse future releases. If this came from conflict resolution, keep the existing entries and let semantic-release append new ones.

Copilot uses AI. Check for mistakes.
Expand Down
38 changes: 18 additions & 20 deletions app/components/developmentToolsComponent/bcryptGenerator.tsx
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 = `
Expand Down Expand Up @@ -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
Copy link

Copilot AI Mar 3, 2026

Choose a reason for hiding this comment

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

This replaces real bcrypt with a SHA-256 based string while still formatting output like a bcrypt hash ($2b$...). That output is not a valid bcrypt hash and could mislead users into thinking they generated a real bcrypt password hash. Either keep using a real bcrypt implementation (e.g., bcryptjs/bcrypt) or rename/relabel the tool and output so it’s clear it’s not bcrypt.

Copilot uses AI. Check for mistakes.
};

// 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 () => {
Expand Down
Loading
Loading