diff --git a/.husky/commit-msg b/.husky/commit-msg index f187983..9f7e393 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - bunx commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit index a278a9a..fd941bd 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - bun run format:write && bun run lint diff --git a/biome.json b/biome.json index ae81606..17a9d15 100644 --- a/biome.json +++ b/biome.json @@ -1,18 +1,15 @@ { - "$schema": "https://biomejs.dev/schemas/1.2.2/schema.json", - "organizeImports": { - "enabled": true, - "ignore": ["dist", "*.bs.js", "lib"] - }, + "$schema": "https://biomejs.dev/schemas/2.4.11/schema.json", + "assist": { "actions": { "source": { "organizeImports": "on" } } }, "linter": { "enabled": true, "rules": { "recommended": true }, - "ignore": ["dist", "*.bs.js", "lib"] + "includes": ["**", "!**/dist", "!**/*.bs.js", "!**/lib"] }, "formatter": { "enabled": true, - "ignore": ["dist", "*.bs.js", "lib"] + "includes": ["**", "!**/dist", "!**/*.bs.js", "!**/lib"] } } diff --git a/bun.lockb b/bun.lockb index 1988d9f..3e0abd8 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 42bc57c..baac867 100644 --- a/package.json +++ b/package.json @@ -1,63 +1,62 @@ { - "name": "rspack-rescript-react", - "private": true, - "version": "1.0.0", - "scripts": { - "dev": "concurrently \"bun run res:dev\" \"rspack serve\"", - "build": "cross-env NODE_ENV=production rspack build", - "res:build": "rescript build", - "res:dev": "rescript watch", - "res:clean": "rescript clean", - "tokens:build": "style-dictionary build", - "tokens:build:light": "style-dictionary build --config config.light.json", - "tokens:build:dark": "style-dictionary build --config config.dark.json", - "tokens:watch": "style-dictionary build --watch", - "prepare": "husky install", - "commit": "git-cz", - "format:check": "biome check .", - "format:write": "biome format . --write", - "lint:check": "biome lint .", - "lint": "biome lint --apply .", - "test": "vitest run", - "test:watch": "vitest" - }, - "dependencies": { - "@emotion/css": "^11.11.2", - "@emotion/server": "^11.11.0", - "@rescript/core": "1.6.1", - "@rescript/react": "0.14.2", - "react": "^19.2.5", - "react-dom": "^19.2.5", - "rescript": "12.2.0" - }, - "devDependencies": { - "@biomejs/biome": "1.2.2", - "@commitlint/cli": "^17.7.2", - "@commitlint/config-conventional": "^17.7.0", - "@commitlint/cz-commitlint": "^17.7.2", - "@rspack/cli": "1.7.11", - "@rspack/core": "^1.7.11", - "@rspack/plugin-react-refresh": "1.6.2", - "@svgr/webpack": "^8.1.0", - "@testing-library/dom": "^10.4.1", - "@testing-library/jest-dom": "^6.9.1", - "@testing-library/react": "^16.3.2", - "@types/react": "^19.2.14", - "@types/react-dom": "^19.2.3", - "commitizen": "^4.3.0", - "concurrently": "^8.2.1", - "cross-env": "^7.0.3", - "husky": "^8.0.3", - "inquirer": "^9.2.11", - "jsdom": "^29.0.2", - "style-dictionary": "^5.0.4", - "typescript": "^5.0.4", - "vitest": "^4.1.4", - "webpack-bundle-analyzer": "^4.9.1" - }, - "config": { - "commitizen": { - "path": "@commitlint/cz-commitlint" - } - } -} \ No newline at end of file + "name": "rspack-rescript-react", + "private": true, + "version": "1.0.0", + "scripts": { + "dev": "concurrently \"bun run res:dev\" \"rspack serve\"", + "build": "cross-env NODE_ENV=production rspack build", + "res:build": "rescript build", + "res:dev": "rescript watch", + "res:clean": "rescript clean", + "tokens:build": "style-dictionary build", + "tokens:build:light": "style-dictionary build --config config.light.json", + "tokens:build:dark": "style-dictionary build --config config.dark.json", + "tokens:watch": "style-dictionary build --watch", + "prepare": "husky", + "commit": "git-cz", + "format:check": "biome check .", + "format:write": "biome format . --write", + "lint:check": "biome lint .", + "lint": "biome lint --write .", + "test": "vitest run", + "test:watch": "vitest" + }, + "dependencies": { + "@emotion/css": "^11.13.5", + "@emotion/server": "^11.11.0", + "@rescript/core": "1.6.1", + "@rescript/react": "0.14.2", + "react": "^19.2.5", + "react-dom": "^19.2.5", + "rescript": "12.2.0" + }, + "devDependencies": { + "@biomejs/biome": "^2.4.11", + "@commitlint/cli": "^20.5.0", + "@commitlint/config-conventional": "^20.5.0", + "@commitlint/cz-commitlint": "^20.5.1", + "@rspack/cli": "1.7.11", + "@rspack/core": "^1.7.11", + "@rspack/plugin-react-refresh": "1.6.2", + "@svgr/webpack": "^8.1.0", + "@testing-library/dom": "^10.4.1", + "@testing-library/jest-dom": "^6.9.1", + "@testing-library/react": "^16.3.2", + "@types/react": "^19.2.14", + "@types/react-dom": "^19.2.3", + "commitizen": "^4.3.1", + "concurrently": "^9.2.1", + "cross-env": "^10.1.0", + "husky": "^9.1.7", + "inquirer": "^13.4.1", + "jsdom": "^29.0.2", + "style-dictionary": "^5.4.0", + "typescript": "^6.0.2", + "vitest": "^4.1.4" + }, + "config": { + "commitizen": { + "path": "@commitlint/cz-commitlint" + } + } +} diff --git a/rspack.config.js b/rspack.config.js index 195b35b..e4fdee3 100644 --- a/rspack.config.js +++ b/rspack.config.js @@ -1,5 +1,3 @@ -const BundleAnalyzerPlugin = - require("webpack-bundle-analyzer").BundleAnalyzerPlugin; const rspack = require("@rspack/core"); const ReactRefreshPlugin = require("@rspack/plugin-react-refresh"); const isProduction = process.env.NODE_ENV === "production"; @@ -9,7 +7,6 @@ const isProduction = process.env.NODE_ENV === "production"; */ module.exports = { plugins: [ - // new BundleAnalyzerPlugin(), new rspack.HtmlRspackPlugin({ template: "./index.html" }), new rspack.DefinePlugin({ "process.env.NODE_ENV": JSON.stringify(