Skip to content

Commit

Permalink
refactor: update with biome
Browse files Browse the repository at this point in the history
  • Loading branch information
unional committed Apr 13, 2024
1 parent 579159c commit e43553b
Show file tree
Hide file tree
Showing 68 changed files with 1,701 additions and 1,368 deletions.
32 changes: 16 additions & 16 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [
"astro-app",
"examples-library",
"tests-node-pkg",
"tests-rollup-pkg",
"tests-webpack5-app-es5",
"tests-webpack5-pkg"
]
"$schema": "https://unpkg.com/@changesets/config@2.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [
"astro-app",
"examples-library",
"tests-node-pkg",
"tests-rollup-pkg",
"tests-webpack5-app-es5",
"tests-webpack5-pkg"
]
}
33 changes: 14 additions & 19 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
{
"mode": "pre",
"tag": "beta",
"initialVersions": {
"global-store": "1.0.0-beta.21",
"stable-store": "0.0.0",
"astro-app": "0.0.1",
"examples-library": "0.0.0",
"stable-versioned-store": "0.0.0",
"tests-node-pkg": "1.0.0",
"tests-rollup-pkg": "1.0.0",
"tests-webpack5-app-es5": "1.0.0",
"tests-webpack5-pkg": "1.0.0"
},
"changesets": [
"fuzzy-coats-exercise",
"thick-pillows-taste",
"three-kangaroos-act",
"wicked-paws-fly"
]
"mode": "pre",
"tag": "beta",
"initialVersions": {
"global-store": "1.0.0-beta.21",
"stable-store": "0.0.0",
"astro-app": "0.0.1",
"examples-library": "0.0.0",
"stable-versioned-store": "0.0.0",
"tests-node-pkg": "1.0.0",
"tests-rollup-pkg": "1.0.0",
"tests-webpack5-app-es5": "1.0.0",
"tests-webpack5-pkg": "1.0.0"
},
"changesets": ["fuzzy-coats-exercise", "thick-pillows-taste", "three-kangaroos-act", "wicked-paws-fly"]
}
4 changes: 1 addition & 3 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"extends": [
"github>unional/renovate-preset"
]
"extends": ["github>unional/renovate-preset"]
}
6 changes: 1 addition & 5 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"astro-build.astro-vscode",
"bradlc.vscode-tailwindcss"
]
"recommendations": ["dbaeumer.vscode-eslint", "astro-build.astro-vscode", "bradlc.vscode-tailwindcss"]
}
109 changes: 67 additions & 42 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,69 @@
{
"cSpell.words": [
"astro",
"astrojs",
"codeql",
"iife",
"immer",
"jsnext",
"libm",
"Optionsinitializer",
"pinst",
"pjson",
"repobuddy",
"rollup",
"snyk",
"systemjs",
"tada",
"tsbuildinfo",
"tsconfigs",
"unsub"
],
"eslint.enable": true,
"javascript.validate.enable": false,
"json.schemas": [
{
"fileMatch": [
"tsconfig.*.json"
],
"url": "http://json.schemastore.org/tsconfig"
}
],
"search.exclude": {
"**/*.code-search": true,
"**/bower_components": true,
"**/dist": true,
"**/lib": true,
"**/libm": true,
"**/node_modules": true,
"**/.yarn": true,
"**/.pnp.*": true
},
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib"
"[javascript]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.maxTokenizationLineLength": 2500
},
"[javascriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
},
"[jsonc]": {
"editor.defaultFormatter": "biomejs.biome",
"editor.quickSuggestions": {
"strings": true
},
"editor.suggest.insertMode": "replace"
},
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"[typescriptreact]": {
"editor.defaultFormatter": "biomejs.biome"
},
"cSpell.words": [
"astro",
"astrojs",
"codeql",
"iife",
"immer",
"jsnext",
"libm",
"Optionsinitializer",
"pinst",
"pjson",
"repobuddy",
"rollup",
"snyk",
"systemjs",
"tada",
"tsbuildinfo",
"tsconfigs",
"unsub"
],
"eslint.enable": true,
"javascript.validate.enable": false,
"json.schemas": [
{
"fileMatch": ["tsconfig.*.json"],
"url": "http://json.schemastore.org/tsconfig"
}
],
"search.exclude": {
"**/*.code-search": true,
"**/.pnp.*": true,
"**/.yarn": true,
"**/bower_components": true,
"**/dist": true,
"**/lib": true,
"**/libm": true,
"**/node_modules": true
},
"typescript.enablePromptUseWorkspaceTsdk": true,
"typescript.tsdk": "node_modules/typescript/lib"
}
7 changes: 7 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"extends": ["@repobuddy/biome/performant"],
"files": {
"ignore": ["coverage", "dist", "esm", "*.astro"]
}
}
8 changes: 4 additions & 4 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-max-line-length': [0]
}
extends: ['@commitlint/config-conventional'],
rules: {
'body-max-line-length': [0]
}
}
4 changes: 2 additions & 2 deletions examples/astro/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
18 changes: 9 additions & 9 deletions examples/astro/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
52 changes: 26 additions & 26 deletions examples/astro/package.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{
"name": "astro-app",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "^2.1.1",
"@astrojs/tailwind": "^3.1.1",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"astro": "^2.3.1",
"examples-library": "workspace:^",
"global-store": "workspace:1.0.0-beta.22",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"stable-store": "workspace:^",
"tailwindcss": "^3.0.24"
},
"devDependencies": {
"@repobuddy/typescript": "^1.1.2"
}
"name": "astro-app",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/react": "^2.1.1",
"@astrojs/tailwind": "^3.1.1",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"astro": "^2.3.1",
"examples-library": "workspace:^",
"global-store": "workspace:1.0.0-beta.22",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"stable-store": "workspace:^",
"tailwindcss": "^3.0.24"
},
"devDependencies": {
"@repobuddy/typescript": "^1.1.2"
}
}
28 changes: 17 additions & 11 deletions examples/astro/src/components/stable_store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,27 @@ import { createContext, useContext, useEffect, useState } from 'react'
export const StableStoreContext = createContext(stableStore)

export function useStableStore() {
return useContext(StableStoreContext)
return useContext(StableStoreContext)
}

export function StableStoreDisplay() {
const store = useStableStore()
const [count, setCount] = useState(store.get().count)
useEffect(() => {
store.onSet((state) => setCount(state.count))
}, [])
return <div>Count: {count}</div>
const store = useStableStore()
const [count, setCount] = useState(store.get().count)
useEffect(() => {
store.onSet((state) => setCount(state.count))
}, [])
return <div>Count: {count}</div>
}

export function StableStoreIncrement() {
const store = useStableStore()
return <button className='border p-1 bg-slate-300'
onClick={() => store.set({ count: store.get().count + 1 })}>Increment</button>
const store = useStableStore()
return (
<button
type="button"
className="border p-1 bg-slate-300"
onClick={() => store.set({ count: store.get().count + 1 })}
>
Increment
</button>
)
}

12 changes: 6 additions & 6 deletions examples/astro/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react",
"moduleResolution": "bundler"
},
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"jsx": "react-jsx",
"jsxImportSource": "react",
"moduleResolution": "bundler"
}
}
6 changes: 2 additions & 4 deletions examples/library/.repobuddy.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{
"plugins": [
"@repobuddy/typescript"
]
}
"plugins": ["@repobuddy/typescript"]
}
Loading

0 comments on commit e43553b

Please sign in to comment.