Skip to content

Commit

Permalink
chore(deps): update workbox to v7
Browse files Browse the repository at this point in the history
[bump]
  • Loading branch information
DuCanhGH committed Jun 6, 2023
1 parent a5f9b2d commit b9dff21
Show file tree
Hide file tree
Showing 73 changed files with 1,104 additions and 1,747 deletions.
7 changes: 7 additions & 0 deletions .changeset/cool-news-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@ducanh2912/next-pwa": minor
---

chore(deps): updated workbox to v7

- This version updates workbox to v7 and other dependencies to latest. It's nice to see that workbox is finally maintained again :)
7 changes: 7 additions & 0 deletions .changeset/honest-buckets-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@ducanh2912/next-pwa": patch
---

feat: documentation

- Added a new docs website and replaced links.
29 changes: 26 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,32 @@ yarn-error.log*
# changelog (generated by semantic-release)
CHANGELOG.md

# nOn-StAnDaRd FiLe types
# typescript
*.tsbuildinfo
next-env.d.ts

# examples
/.next/
/out/

/build

/coverage

.DS_Store
*.pem

*.css
*.json

# typescript
tsconfig.tsbuildinfo
.vercel

**/public/workbox**
**/public/sw**
**/public/worker**
**/public/fallback**
**/public/precache**

# other files
*.css
*.json
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = {
node: true,
},
extends: [
"next/core-web-vitals",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"turbo",
Expand Down
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Contributing to `next-pwa`

- Read about our [Code of Conduct](.//CODE_OF_CONDUCT.md).
- Before jumping into a PR be sure to search [existing PRs](https://github.com/DuCanhGH/next-pwa/pulls) or [issues](https://github.com/DuCanhGH/next-pwa/issues) for an item that is related to your submission.

## Repository

- [Linting](./contributing/repository/linting.md)

## Documentation

- [Adding documentation](./contributing/docs/adding-docs.md)

## Examples

To contribute to [our examples](./examples), please see

- [Adding examples](./contributing/examples/adding-examples.md)

## Core

- [Developing](./contributing/core/developing.md)
- [Adding a new feature](./contributing/core/adding-features.md)
12 changes: 12 additions & 0 deletions contributing/core/adding-features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Adding a new feature

Anyone can propose a change. However, adding new features often requires community discussions before proceeding with the implementation.

Therefore, before opening a PR, you should use the [Feature Request discussion template](https://github.com/DuCanhGH/next-pwa/discussions/new?category=ideas) and collect feedback.

## Why use a discussion?

The discussion's goal is to achieve the following:

1. **Verify the validity of the feature request**: The community can upvote discussions. Highly upvoted feature requests are more likely to be considered.
2. **Understanding the consequences**: Any feature added is likely to be around for a long time. This means that a new feature has to cover use cases, needs to consider how it affects users.
33 changes: 33 additions & 0 deletions contributing/core/developing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Developing

- The development branch is `master`.
- All pull requests should be opened against `master`.

To develop locally:

1. Clone the `next-pwa` repository:
```bash
git clone https://github.com/DuCanhGH/next-pwa -- --depth=3000 --branch master --single-branch
```
1. Create a new branch:
```bash
git checkout -b MY_BRANCH_NAME origin/master
```
1. Install the dependencies with:
```bash
pnpm install
```
1. Start developing and watch for code changes (this is not working with Turborepo right now, needs help fixing!):
```bash
pnpm dev
```
1. When your changes are finished, commit them to the branch:
```
git add .
git commit -m "DESCRIBE_YOUR_CHANGES_HERE"
```
1. When you are ready to push, make a fork and then run:
```
git remote set-url origin https://github.com/YOURNAME/next-pwa
git push
```
41 changes: 41 additions & 0 deletions contributing/docs/adding-docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Adding documentation

- The development branch is `master`.
- All pull requests should be opened against `master`.

To develop locally:

1. Clone the `next-pwa` repository:
```bash
git clone https://github.com/DuCanhGH/next-pwa -- --depth=3000 --branch master --single-branch
```
1. Create a new branch:
```bash
git checkout -b MY_BRANCH_NAME origin/master
```
1. Install the dependencies with:
```bash
pnpm install
```
1. `cd` into `docs`:
```bash
cd docs
```
1. Start developing:

```bash
pnpm dev
```

And then edit the content in `docs/content`. The app should automatically reflect the changes!

1. When your changes are finished, commit them to the branch:
```
git add .
git commit -m "DESCRIBE_YOUR_CHANGES_HERE"
```
1. When you are ready to push, make a fork and then run:
```
git remote set-url origin https://github.com/YOURNAME/next-pwa
git push
```
58 changes: 58 additions & 0 deletions contributing/examples/adding-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## Adding examples

When you add an example to the [examples](https://github.com/DuCanhGH/next-pwa/tree/master/examples) directory, please follow these guidelines:

- TypeScript should be leveraged for new examples.
- If API routes aren't used in an example, they should be omitted.
- If an example exists for a certain library and you would like to showcase a specific feature of that library, the existing example should be updated (instead of adding a new example).
- Package manager specific config should not be added (e.g. `resolutions` in `package.json`).
- Dependencies' versions should be up-to-date (you can run `pnpm deps` in this repo's root directory to update everything in it).
- Use `const Page = () => <></>; export default Page;` for page components and `export const GET = () => {}` for API Routes.
- Example directories should not be prefixed with `with-`.
- Make sure linting passes (you can run `pnpm build && pnpm examples:lint` to verify and `pnpm examples:lint -- --fix` for automatic fixes).
- Avoid running `pnpm examples:build` as it is resource-heavy.

Also, don’t forget to add a `README.md` file with the following format:

- Replace `DIRECTORY_NAME` with the directory name you’re adding.
- Fill in `next-pwa - Example Name` and `DESCRIPTION`.
- To add additional notes, add `## Notes` section at the end.

````markdown
# next-pwa - Example Name

This example demonstrates how to use `next-pwa` with DESCRIPTION.

## Usage

[![Open in Gitpod and run](https://img.shields.io/badge/Open%20In-Gitpod.io-%231966D2?style=for-the-badge&logo=gitpod)](https://gitpod.io/#https://github.com/DuCanhGH/next-pwa/)

```bash
cd examples/DIRECTORY_NAME
pnpm build
pnpm start
```

or

Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init), [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/), or [pnpm](https://pnpm.io) to bootstrap the example:

```bash
npx create-next-app --example https://github.com/DuCanhGH/next-pwa/tree/master/examples/DIRECTORY_NAME DIRECTORY_NAME-app
```

```bash
yarn create next-app --example https://github.com/DuCanhGH/next-pwa/tree/master/examples/DIRECTORY_NAME DIRECTORY_NAME-app
```

```bash
pnpm create next-app --example https://github.com/DuCanhGH/next-pwa/tree/master/examples/DIRECTORY_NAME DIRECTORY_NAME-app
```

## Recommended `.gitignore`

```gitignore
**/public/workbox-*.js
**/public/sw.js
```
````
29 changes: 29 additions & 0 deletions contributing/repository/linting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Linting

The `next-pwa` repository runs [ESLint](https://eslint.org), [Prettier](https://prettier.io) to lint and format the codebase.

To lint the codebase (except `examples` and `docs`) you can run:

```sh
pnpm lint
```

If you get errors, you can run the ESLint and Prettier auto-fix using:

```sh
pnpm lint -- --fix
```

Not all rules can be auto-fixed, so some manual changes might be required.

## ESLint

We recommend installing the [ESLint plugin for VS Code](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint).

You can find the enabled rules in the [ESLint config](../../.eslintrc.cjs).

## Prettier

We recommend installing the [Prettier plugin for VS Code](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode).

You can find the format configuration in the [Prettier config](../../.prettierrc.json).
14 changes: 7 additions & 7 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
"dependencies": {
"@ducanh2912/next-pwa": "workspace:*",
"@mantine/hooks": "6.0.13",
"@tabler/icons-react": "2.20.0",
"@tabler/icons-react": "2.21.0",
"client-only": "0.0.1",
"contentlayer": "0.3.2",
"contentlayer": "0.3.3",
"highlight.js": "11.8.0",
"next": "13.4.4",
"next-contentlayer": "0.3.2",
"next-contentlayer": "0.3.3",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-wrap-balancer": "0.5.0",
"server-only": "0.0.1",
"tailwind-merge": "1.12.0",
"tailwind-merge": "1.13.0",
"uuid": "9.0.0",
"zustand": "4.3.8"
},
Expand All @@ -31,11 +31,11 @@
"@types/mdast": "3.0.11",
"@types/mdx": "2.0.5",
"@types/node": "20.2.5",
"@types/react": "18.2.7",
"@types/react": "18.2.8",
"@types/react-dom": "18.2.4",
"@types/uuid": "9.0.1",
"autoprefixer": "10.4.14",
"eslint": "8.41.0",
"eslint": "8.42.0",
"eslint-config-next": "13.4.4",
"extend": "3.0.2",
"github-slugger": "2.0.0",
Expand All @@ -50,7 +50,7 @@
"rehype-highlight": "6.0.0",
"rehype-sanitize": "5.0.1",
"tailwindcss": "3.3.2",
"typescript": "5.2.0-dev.20230530",
"typescript": "5.2.0-dev.20230606",
"unified": "10.1.2",
"unist-util-is": "5.2.1",
"unist-util-visit": "4.1.2"
Expand Down
Loading

0 comments on commit b9dff21

Please sign in to comment.