Skip to content

Commit

Permalink
refactor(core): Use biomejs and fix next-intl
Browse files Browse the repository at this point in the history
  • Loading branch information
wootsbot committed Dec 18, 2024
1 parent c19b1b3 commit 1b2301b
Show file tree
Hide file tree
Showing 119 changed files with 4,318 additions and 6,001 deletions.
26 changes: 13 additions & 13 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "wootsbot/X-boilerplate" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [],
"privatePackages": {
"version": true,
"tag": true
}
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "wootsbot/X-boilerplate" }],
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": [],
"privatePackages": {
"version": true,
"tag": true
}
}
78 changes: 39 additions & 39 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
{
"mode": "pre",
"tag": "beta",
"initialVersions": {
"x-boilerplate": "0.1.0"
},
"changesets": [
"afraid-otters-shave",
"angry-pandas-exist",
"chilled-hairs-tease",
"dirty-shoes-lick",
"eight-oranges-accept",
"eighty-adults-protect",
"empty-ants-watch",
"fifty-lemons-behave",
"fresh-panthers-drive",
"giant-zoos-glow",
"gold-squids-allow",
"grumpy-tomatoes-shave",
"happy-hats-dress",
"honest-kids-lie",
"light-dolls-remember",
"lucky-parents-fix",
"mean-pumas-beam",
"nice-phones-invent",
"proud-hounds-smoke",
"purple-maps-return",
"quick-pens-shake",
"rude-bags-lick",
"serious-ties-talk",
"sharp-colts-wait",
"spicy-rings-dress",
"strange-seals-decide",
"tidy-panthers-dance",
"tricky-flowers-hunt",
"twelve-humans-work",
"warm-bats-search",
"witty-tips-check",
"young-jars-sell"
]
"mode": "pre",
"tag": "beta",
"initialVersions": {
"x-boilerplate": "0.1.0"
},
"changesets": [
"afraid-otters-shave",
"angry-pandas-exist",
"chilled-hairs-tease",
"dirty-shoes-lick",
"eight-oranges-accept",
"eighty-adults-protect",
"empty-ants-watch",
"fifty-lemons-behave",
"fresh-panthers-drive",
"giant-zoos-glow",
"gold-squids-allow",
"grumpy-tomatoes-shave",
"happy-hats-dress",
"honest-kids-lie",
"light-dolls-remember",
"lucky-parents-fix",
"mean-pumas-beam",
"nice-phones-invent",
"proud-hounds-smoke",
"purple-maps-return",
"quick-pens-shake",
"rude-bags-lick",
"serious-ties-talk",
"sharp-colts-wait",
"spicy-rings-dress",
"strange-seals-decide",
"tidy-panthers-dance",
"tricky-flowers-hunt",
"twelve-humans-work",
"warm-bats-search",
"witty-tips-check",
"young-jars-sell"
]
}
5 changes: 5 additions & 0 deletions .changeset/two-carpets-compete.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"x-boilerplate": minor
---

Use biomejs and fix next-intl
2 changes: 0 additions & 2 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ AUTH_SECRET="" # Added by `npx auth`. Read more: https://cli.authjs.dev
# Optional
NEXT_PUBLIC_DEFAULT_LANGUAGE_KEY="en"

NEXT_PUBLIC_LANGUAGE=en


NEXT_PUBLIC_PERSONAL_GITHUB_TOKEN=""
11 changes: 0 additions & 11 deletions .eslintrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm commitlint --edit $1
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

pnpm lint-staged
pnpm lint
13 changes: 0 additions & 13 deletions .prettierignore

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"typescript.tsdk": "node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
"typescript.tsdk": "node_modules/.pnpm/typescript@4.9.5/node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,4 @@ Many of this boilerplate features are based on the philosophy of being optional.
- [husky](https://typicode.github.io/husky/#/) - Husky improves your commits and more 🐶 woof!.

- [VS Code Extensions](./.vscode/extensions.json)
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) - Code formatter using prettier.
- [Formatting Toggle](https://marketplace.visualstudio.com/items?itemName=tombonnike.vscode-status-bar-format-toggle) - You to toggle formatting settings ON and OFF.
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [biome](https://marketplace.visualstudio.com/items?itemName=biomejs.biome) - Biome Extension for VS Code.
79 changes: 79 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": [".next/**", "public/**", "node_modules/**", "pnpm-lock.yaml", "playwright-report/**"]
},
"formatter": {
"enabled": true,
"useEditorconfig": true,
"formatWithErrors": false,
"indentStyle": "tab",
"indentWidth": 2,
"lineEnding": "lf",
"lineWidth": 120,
"attributePosition": "auto",
"bracketSpacing": true,
"ignore": [".next", "node_modules", "pnpm-lock.yaml", "playwright-report"]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noUselessElse": "error",
"useImportType": "error",
"useShorthandFunctionType": "error",
"useAsConstAssertion": "error",
"noNamespace": "error",
"noInferrableTypes": "error"
},
"suspicious": {
"noConsoleLog": "warn",
"noEmptyInterface": "warn",
"noExplicitAny": "warn",
"noExtraNonNullAssertion": "error"
},
"correctness": {
"useHookAtTopLevel": "error",
"useExhaustiveDependencies": "warn",
"noChildrenProp": "error",
"noPrecisionLoss": "error",
"noUnusedVariables": "error",
"noUnusedImports": "error"
},
"performance": {
"noDelete": "error"
},
"complexity": {
"noBannedTypes": "error",
"noUselessThisAlias": "error",
"noForEach": "error",
"noUselessTypeConstraint": "error",
"useLiteralKeys": "error",
"useOptionalChain": "error"
}
}
},
"javascript": {
"formatter": {
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"trailingCommas": "all",
"semicolons": "always",
"arrowParentheses": "always",
"bracketSameLine": false,
"quoteStyle": "double",
"attributePosition": "auto",
"bracketSpacing": true
}
}
}
24 changes: 12 additions & 12 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'body-leading-blank': [2, 'always'],
'body-max-line-length': [2, 'always', 200],
'header-max-length': [2, 'always', 200],
'scope-empty': [2, 'never'],
'subject-case': [2, 'always', ['sentence-case', 'start-case', 'pascal-case', 'upper-case']],
'subject-empty': [2, 'never'],
'subject-full-stop': [2, 'never', '.'],
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
},
extends: ["@commitlint/config-conventional"],
rules: {
"body-leading-blank": [2, "always"],
"body-max-line-length": [2, "always", 200],
"header-max-length": [2, "always", 200],
"scope-empty": [2, "never"],
"subject-case": [2, "always", ["sentence-case", "start-case", "pascal-case", "upper-case"]],
"subject-empty": [2, "never"],
"subject-full-stop": [2, "never", "."],
"type-case": [2, "always", "lower-case"],
"type-empty": [2, "never"],
},
};
56 changes: 28 additions & 28 deletions e2e/flows/home.spec.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
import { expect, test } from '@playwright/test';
import { expect, test } from "@playwright/test";

test.describe('Home Page', () => {
test('must has title', async ({ page }) => {
await page.goto('/');
await expect(page).toHaveTitle(/X Boilerplate/);
});
test.describe("Home Page", () => {
test("must has title", async ({ page }) => {
await page.goto("/");
await expect(page).toHaveTitle(/X Boilerplate/);
});

// test('get started link', async ({ page }) => {
// await page.goto('/');
// test('get started link', async ({ page }) => {
// await page.goto('/');

// await page.click('text=🍍 State Management X-state');
// await expect(page).toHaveURL(/x-state/);
// await expect(page.locator('h1')).toContainText('🍍');
// await expect(page.getByRole('heading', { name: 'Hi X-State!' })).toBeVisible();
// await expect(page.locator('p')).toContainText('Promise canine example.');
// await expect(page.getByRole('button', { name: 'Get Dog data' })).toBeVisible();
// await expect(page.getByRole('button', { name: 'Reset Dog data' })).toBeVisible();
// await expect(page.getByRole('button', { name: 'Retry Dog data' })).toBeVisible();
// await page.click('text=🍍 State Management X-state');
// await expect(page).toHaveURL(/x-state/);
// await expect(page.locator('h1')).toContainText('🍍');
// await expect(page.getByRole('heading', { name: 'Hi X-State!' })).toBeVisible();
// await expect(page.locator('p')).toContainText('Promise canine example.');
// await expect(page.getByRole('button', { name: 'Get Dog data' })).toBeVisible();
// await expect(page.getByRole('button', { name: 'Reset Dog data' })).toBeVisible();
// await expect(page.getByRole('button', { name: 'Retry Dog data' })).toBeVisible();

// await page.getByRole('button', { name: /Get Dog data/i }).click();
// await expect(page.getByText('Loading Image...')).toBeVisible();
// await expect(page.getByRole('img', { name: 'dog' })).toBeVisible();
// await page.getByRole('button', { name: /Get Dog data/i }).click();
// await expect(page.getByText('Loading Image...')).toBeVisible();
// await expect(page.getByRole('img', { name: 'dog' })).toBeVisible();

// await page.getByRole('button', { name: /Reset Dog data/i }).click();
// await expect(page.getByText('Loading Image...')).not.toBeVisible();
// await expect(page.getByRole('img', { name: 'dog' })).not.toBeVisible();
// await page.getByRole('button', { name: /Reset Dog data/i }).click();
// await expect(page.getByText('Loading Image...')).not.toBeVisible();
// await expect(page.getByRole('img', { name: 'dog' })).not.toBeVisible();

// await page.getByRole('button', { name: /Retry Dog data/i }).click();
// await expect(page.getByText('Loading Image...')).toBeVisible();
// await expect(page.getByRole('img', { name: 'dog' })).toBeVisible();
// await page.getByRole('button', { name: /Retry Dog data/i }).click();
// await expect(page.getByText('Loading Image...')).toBeVisible();
// await expect(page.getByRole('img', { name: 'dog' })).toBeVisible();

// await page.click('text=Go back');
// await expect(page).toHaveURL('/');
// });
// await page.click('text=Go back');
// await expect(page).toHaveURL('/');
// });
});
Loading

0 comments on commit 1b2301b

Please sign in to comment.