forked from shadowwalker/next-pwa
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[bump]
- Loading branch information
Showing
73 changed files
with
1,104 additions
and
1,747 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.