|
| 1 | +## Package development |
| 2 | + |
| 3 | +The repository has a [`gitpod.yml`](.gitpod.yml) and [GitPod](https://gitpod.io/) offers 50 hours/month for free for working on public repos. The easiest way to get started with development. |
| 4 | + |
| 5 | +### Run an e2e app development server with local packages |
| 6 | + |
| 7 | +Run in repo root: |
| 8 | + |
| 9 | +``` |
| 10 | +yarn dev |
| 11 | +``` |
| 12 | + |
| 13 | +It will rebuild and rebundle packages on changes and run `next dev` of the e2e test app in parallel. |
| 14 | + |
| 15 | + |
| 16 | +### Serve an e2e app production build with local packages |
| 17 | + |
| 18 | +Required to test and evaluate things around strict CSPs. Run in repo root: |
| 19 | + |
| 20 | +``` |
| 21 | +yarn start |
| 22 | +``` |
| 23 | + |
| 24 | +It will (re)build all packages in the repo that have changed and serve a production build of the e2e app with `next start` and local package builds. |
| 25 | + |
| 26 | + |
| 27 | +### Deploy the e2e app with local packages to Vercel |
| 28 | +So see the behavior of the package in a production environment, you can deploy the e2e app to Vercel. |
| 29 | +It will always use the local packages built from the last commit you pushed/deployed. |
| 30 | + |
| 31 | +First, [fork this repo](https://github.com/nibtime/next-safe-middleware/fork). Then click the deploy button and import your fork: |
| 32 | + |
| 33 | +[](https://vercel.com/new/project) |
| 34 | + |
| 35 | +Afterwards, you need to customize commands in Vercel project settings to make it work with [Yarn 3 monorepo structure](#repository-structure). |
| 36 | + |
| 37 | +#### In your Vercel project settings |
| 38 | + |
| 39 | +Set `apps/e2e` as "Root Directory" and enable "Include source files outside of the Root Directory in the Build Step." |
| 40 | + |
| 41 | +In "Build & Development Settings": |
| 42 | + |
| 43 | +Set "Framework Preset" to `Next.js` |
| 44 | + |
| 45 | +and override the following commands: |
| 46 | + |
| 47 | +**Build Command:** |
| 48 | +``` |
| 49 | +cd ../.. && yarn build:e2e:vercel |
| 50 | +``` |
| 51 | +**Install Command:** |
| 52 | +``` |
| 53 | +yarn install --immutable --immutable-cache |
| 54 | +``` |
| 55 | + |
| 56 | +## Submit PRs |
| 57 | +TODO |
| 58 | + |
| 59 | +## Report bugs |
| 60 | +TODO |
| 61 | + |
| 62 | +## Suggest features and enhancements |
| 63 | +TODO |
| 64 | + |
| 65 | +## Ask questions |
| 66 | +TODO |
| 67 | + |
| 68 | +## Commit and code conventions |
| 69 | +TODO + setup for ESLint, Prettier, husky and lint-staged will be provided at some point. |
| 70 | + |
| 71 | +## Repository structure |
| 72 | +TODO |
| 73 | + |
| 74 | +## Attributions |
| 75 | + |
| 76 | +Policy icon in [README](packages/next-safe-middleware/_README.md) created by [Kiranshastry - Flaticon](https://www.flaticon.com/free-icons/policy) |
0 commit comments