Skip to content

Commit

Permalink
refactor(core): create a context
Browse files Browse the repository at this point in the history
[bump]
  • Loading branch information
DuCanhGH committed Jan 11, 2024
1 parent 60b90c9 commit f65e6ab
Show file tree
Hide file tree
Showing 110 changed files with 1,001 additions and 2,975 deletions.
5 changes: 1 addition & 4 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "DuCanhGH/next-pwa" }
],
"changelog": ["@changesets/changelog-github", { "repo": "DuCanhGH/next-pwa" }],
"commit": false,
"fixed": [],
"linked": [],
Expand Down
9 changes: 9 additions & 0 deletions .changeset/heavy-items-relax.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@ducanh2912/next-pwa": minor
---

refactor(core): create a context

- We now leverage a context to share the user's options for Webpack, Next.js, `next-pwa`, TypeScript, etc. across the codebase. This is better than the old approach, which was similar to props drilling, in that it is more readable and less error-prone.
- I'd like to extend my thanks to the `vite-pwa` team for this approach! Learned a lot through forking `vite-plugin-pwa`, that's for sure.
- Additionally, the codebase now leverages Biome.js instead of Prettier and ESLint. For now, pre-commit hooks using Husky are not available.
57 changes: 0 additions & 57 deletions .eslintignore

This file was deleted.

121 changes: 0 additions & 121 deletions .eslintrc.cjs

This file was deleted.

22 changes: 16 additions & 6 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,25 @@ env:
TURBO_REMOTE_ONLY: true
jobs:
build_and_lint_check:
name: 🔎 Typecheck, check formatting and lint
name: 🔎 Typecheck
uses: ./.github/workflows/build-reusable.yml
with:
afterBuild: |
pnpm typecheck &&
pnpm format:check &&
pnpm lint &&
pnpm docs:lint
afterBuild: pnpm typecheck
secrets: inherit
quality:
name: 🔎 Ensure that the code meets our quality standard
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Biome
uses: biomejs/setup-biome@v1
with:
version: latest
- name: Run Biome
run: biome ci .
# test-integration-dev:
# name: ⚫️ Run Jest (development mode) integration tests
# uses: ./.github/workflows/build-reusable.yml
Expand Down
18 changes: 17 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ yarn-error.log*

# production
dist/
.next/
.vercel/
.output/
.contentlayer/
out/

# vscode
.vscode
.vscode

# rollup
.rollup.cache

# next-pwa
**/public/swe-worker**
**/public/sw**
**/public/workbox**
**/public/worker**
**/public/fallback**
**/public/precache**
4 changes: 0 additions & 4 deletions .husky/pre-commit

This file was deleted.

58 changes: 0 additions & 58 deletions .prettierignore

This file was deleted.

9 changes: 0 additions & 9 deletions .prettierrc.json

This file was deleted.

38 changes: 38 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.1/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
"defaultBranch": "master",
"useIgnoreFile": true
},
"files": {
"ignoreUnknown": true
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noNonNullAssertion": "off",
"noParameterAssign": "off"
},
"suspicious": {
"noExplicitAny": "off",
"noAssignInExpressions": "off"
},
"complexity": {
"noForEach": "off"
}
}
},
"formatter": {
"enabled": true,
"indentWidth": 2,
"lineWidth": 150,
"indentStyle": "space"
}
}
3 changes: 0 additions & 3 deletions docs/.eslintrc.json

This file was deleted.

3 changes: 1 addition & 2 deletions docs/contentlayer.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ const Docs = defineDocumentType(() => ({
computedFields: {
url: {
type: "string",
resolve: ({ _raw: { flattenedPath } }) =>
`/docs${flattenedPath === "" ? "" : `/${flattenedPath}`}`,
resolve: ({ _raw: { flattenedPath } }) => `/docs${flattenedPath === "" ? "" : `/${flattenedPath}`}`,
},
headings: {
type: "string",
Expand Down
Loading

0 comments on commit f65e6ab

Please sign in to comment.