-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #64 from lumpinif/main
build(chrome): Add extension version sync check between package.json and manifest.json in case forgetting to update version accidentally in pre-commit
- Loading branch information
Showing
4 changed files
with
140 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,80 @@ | ||
{ | ||
"name": "thinking-claude", | ||
"version": "3.2.2", | ||
"description": "Chrome extension for letting Claude think like a real human", | ||
"type": "module", | ||
"scripts": { | ||
"watch": "webpack --config webpack/webpack.dev.js --watch", | ||
"build": "webpack --config webpack/webpack.prod.js", | ||
"start": "webpack serve --config webpack/webpack.dev.js", | ||
"test": "bun test", | ||
"test:watch": "bun test --watch", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix", | ||
"lint:staged": "lint-staged", | ||
"lint:types": "tsc --noEmit", | ||
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,md}\"", | ||
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,css,md}\"", | ||
"fix": "bun run format && bun run lint:fix", | ||
"type-check": "tsc --noEmit" | ||
}, | ||
"dependencies": { | ||
"@radix-ui/react-accordion": "^1.2.1", | ||
"@radix-ui/react-collapsible": "^1.1.1", | ||
"@radix-ui/react-icons": "^1.3.2", | ||
"@radix-ui/react-scroll-area": "^1.2.1", | ||
"@radix-ui/react-select": "^2.1.2", | ||
"@radix-ui/react-slot": "^1.1.0", | ||
"@radix-ui/react-tooltip": "^1.1.4", | ||
"class-variance-authority": "^0.7.0", | ||
"clsx": "^2.1.1", | ||
"lucide-react": "^0.460.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"tailwind-merge": "^1.14.0" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "^9.15.0", | ||
"@ianvs/prettier-plugin-sort-imports": "^3.7.2", | ||
"@types/chrome": "^0.0.246", | ||
"@types/node": "^20.8.2", | ||
"@types/react": "^18.2.24", | ||
"@types/react-dom": "^18.2.8", | ||
"@typescript-eslint/eslint-plugin": "^8.15.0", | ||
"@typescript-eslint/parser": "^8.15.0", | ||
"@vitest/runner": "^2.1.5", | ||
"autoprefixer": "^10.4.16", | ||
"copy-webpack-plugin": "^11.0.0", | ||
"css-loader": "^6.8.1", | ||
"eslint": "^9.15.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-react": "^7.37.2", | ||
"eslint-plugin-react-hooks": "^5.0.0", | ||
"husky": "^9.1.7", | ||
"identity-obj-proxy": "^3.0.0", | ||
"lint-staged": "^14.0.1", | ||
"markdownlint-cli2": "^0.15.0", | ||
"mini-css-extract-plugin": "^2.9.2", | ||
"postcss": "^8.4.31", | ||
"postcss-loader": "^7.3.3", | ||
"postcss-nesting": "^12.0.1", | ||
"style-loader": "^3.3.3", | ||
"tailwindcss": "^3.3.3", | ||
"tailwindcss-animate": "^1.0.7", | ||
"ts-loader": "^9.4.4", | ||
"typescript": "^5.2.2", | ||
"vitest": "^2.1.5", | ||
"webpack": "^5.88.2", | ||
"webpack-cli": "^5.1.4", | ||
"webpack-dev-server": "^4.15.1", | ||
"webpack-merge": "^5.9.0" | ||
}, | ||
"lint-staged": { | ||
"*.{ts,tsx}": ["eslint --fix", "prettier --write"], | ||
"*.md": "markdownlint-cli2 --config .markdownlint-cli2.jsonc --fix" | ||
} | ||
"name": "thinking-claude", | ||
"version": "3.2.3", | ||
"description": "Chrome extension for letting Claude think like a real human", | ||
"type": "module", | ||
"scripts": { | ||
"watch": "webpack --config webpack/webpack.dev.js --watch", | ||
"build": "webpack --config webpack/webpack.prod.js", | ||
"start": "webpack serve --config webpack/webpack.dev.js", | ||
"test": "bun test", | ||
"test:watch": "bun test --watch", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix", | ||
"lint:staged": "lint-staged", | ||
"lint:types": "tsc --noEmit", | ||
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,md}\"", | ||
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,css,md}\"", | ||
"fix": "bun run format && bun run lint:fix", | ||
"type-check": "tsc --noEmit", | ||
"check-version-sync": "bun ./scripts/check-version-sync.ts" | ||
}, | ||
"dependencies": { | ||
"@radix-ui/react-accordion": "^1.2.1", | ||
"@radix-ui/react-collapsible": "^1.1.1", | ||
"@radix-ui/react-icons": "^1.3.2", | ||
"@radix-ui/react-scroll-area": "^1.2.1", | ||
"@radix-ui/react-select": "^2.1.2", | ||
"@radix-ui/react-slot": "^1.1.0", | ||
"@radix-ui/react-tooltip": "^1.1.4", | ||
"class-variance-authority": "^0.7.0", | ||
"clsx": "^2.1.1", | ||
"lucide-react": "^0.460.0", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"tailwind-merge": "^1.14.0" | ||
}, | ||
"devDependencies": { | ||
"@eslint/js": "^9.15.0", | ||
"@ianvs/prettier-plugin-sort-imports": "^3.7.2", | ||
"@types/chrome": "^0.0.246", | ||
"@types/node": "^20.8.2", | ||
"@types/react": "^18.2.24", | ||
"@types/react-dom": "^18.2.8", | ||
"@typescript-eslint/eslint-plugin": "^8.15.0", | ||
"@typescript-eslint/parser": "^8.15.0", | ||
"@vitest/runner": "^2.1.5", | ||
"autoprefixer": "^10.4.16", | ||
"copy-webpack-plugin": "^11.0.0", | ||
"css-loader": "^6.8.1", | ||
"eslint": "^9.15.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-plugin-react": "^7.37.2", | ||
"eslint-plugin-react-hooks": "^5.0.0", | ||
"husky": "^9.1.7", | ||
"identity-obj-proxy": "^3.0.0", | ||
"lint-staged": "^14.0.1", | ||
"markdownlint-cli2": "^0.15.0", | ||
"mini-css-extract-plugin": "^2.9.2", | ||
"postcss": "^8.4.31", | ||
"postcss-loader": "^7.3.3", | ||
"postcss-nesting": "^12.0.1", | ||
"style-loader": "^3.3.3", | ||
"tailwindcss": "^3.3.3", | ||
"tailwindcss-animate": "^1.0.7", | ||
"ts-loader": "^9.4.4", | ||
"typescript": "^5.2.2", | ||
"vitest": "^2.1.5", | ||
"webpack": "^5.88.2", | ||
"webpack-cli": "^5.1.4", | ||
"webpack-dev-server": "^4.15.1", | ||
"webpack-merge": "^5.9.0" | ||
}, | ||
"lint-staged": { | ||
"*.{ts,tsx}": [ | ||
"eslint --fix", | ||
"prettier --write" | ||
], | ||
"*.md": "markdownlint-cli2 --config .markdownlint-cli2.jsonc --fix" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env node | ||
import fs from "fs" | ||
import path from "path" | ||
import { fileURLToPath } from "url" | ||
|
||
interface PackageJson { | ||
version: string | ||
[key: string]: unknown | ||
} | ||
|
||
interface ManifestJson { | ||
manifest_version: number | ||
name: string | ||
version: string | ||
description: string | ||
[key: string]: unknown | ||
} | ||
|
||
const __filename: string = fileURLToPath(import.meta.url) | ||
const __dirname: string = path.dirname(__filename) | ||
|
||
const packageJsonPath: string = path.resolve(__dirname, "..", "package.json") | ||
const manifestJsonPath: string = path.resolve( | ||
__dirname, | ||
"..", | ||
"public", | ||
"manifest.json" | ||
) | ||
|
||
try { | ||
const packageJson: PackageJson = JSON.parse( | ||
fs.readFileSync(packageJsonPath, "utf8") | ||
) | ||
const manifestJson: ManifestJson = JSON.parse( | ||
fs.readFileSync(manifestJsonPath, "utf8") | ||
) | ||
|
||
if (packageJson.version !== manifestJson.version) { | ||
console.error("\x1b[31mError: Version mismatch!\x1b[0m") | ||
console.error(`package.json version: ${packageJson.version}`) | ||
console.error(`manifest.json version: ${manifestJson.version}`) | ||
console.error( | ||
"\nPlease update the version in public/manifest.json to match package.json" | ||
) | ||
process.exit(1) | ||
} | ||
|
||
console.log("\x1b[32mVersions are in sync ✓\x1b[0m") | ||
process.exit(0) | ||
} catch (error: unknown) { | ||
console.error( | ||
"\x1b[31mError checking version sync:\x1b[0m", | ||
error instanceof Error ? error.message : error | ||
) | ||
process.exit(1) | ||
} |