-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54b1938
commit 18a2757
Showing
79 changed files
with
21,537 additions
and
20,771 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -26,26 +26,38 @@ jobs: | |
- 5432:5432 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: 'pnpm' | ||
|
||
- name: Cache Playwright's binary | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ runner.os }}-playwright-bin-v1 | ||
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }} | ||
|
||
- run: node -v | ||
- uses: bahmutov/npm-install@v1 | ||
- name: Install deps and build (with cache) | ||
run: pnpm install | ||
|
||
- name: Next.js cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ github.workspace }}${{ matrix.dir }}/.next/cache | ||
key: ${{ matrix.dir }}-${{ runner.os }}-${{ matrix.node-start }}-${{ hashFiles('**/yarn.lock') }}-nextjs | ||
key: ${{ matrix.dir }}-${{ runner.os }}-${{ matrix.node-start }}-${{ hashFiles('**/pnpm-lock.yaml') }}-nextjs | ||
|
||
- uses: actions/setup-node@v2 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-start }} | ||
|
||
- run: node -v | ||
|
||
- name: if exists, run yarn lint | ||
run: cd examples/${{ matrix.dir }} && cat package.json | if grep --silent '"lint"'; then yarn lint; fi | ||
- run: yarn --cwd examples/${{ matrix.dir }} build | ||
- run: yarn --cwd examples/${{ matrix.dir }} test-start | ||
- run: yarn --cwd examples/${{ matrix.dir }} test-dev | ||
- name: if exists, run pnpm lint | ||
run: cd examples/${{ matrix.dir }} && cat package.json | if grep --silent '"lint"'; then pnpm lint; fi | ||
- run: pnpm --filter ./examples/${{ matrix.dir }} build | ||
- run: pnpm --filter ./examples/${{ matrix.dir }} test-start | ||
- run: pnpm --filter ./examples/${{ matrix.dir }} test-dev |
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 |
---|---|---|
|
@@ -50,30 +50,50 @@ jobs: | |
- 5432:5432 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
cache: 'pnpm' | ||
|
||
- name: Cache Playwright's binary | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ runner.os }}-playwright-bin-v1 | ||
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }} | ||
|
||
- run: node -v | ||
- uses: bahmutov/npm-install@v1 | ||
- name: Install deps and build (with cache) | ||
run: pnpm install | ||
|
||
- name: Cache Playwright's binary | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ runner.os }}-playwright-bin-v1 | ||
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }} | ||
|
||
- name: Install Playwright | ||
run: pnpm playwright install | ||
|
||
- name: Next.js cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ github.workspace }}${{ matrix.dir }}/.next/cache | ||
key: ${{ matrix.dir }}-${{ runner.os }}-${{ matrix.node-start }}-${{ hashFiles('**/yarn.lock') }}-nextjs | ||
key: ${{ matrix.dir }}-${{ runner.os }}-${{ matrix.node-start }}-${{ hashFiles('**/pnpm-lock.yaml') }}-nextjs | ||
|
||
- uses: actions/setup-node@v2 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-start }} | ||
|
||
- run: node -v | ||
|
||
- name: if exists, run yarn lint | ||
run: cd examples/${{ matrix.dir }} && cat package.json | if grep --silent '"lint"'; then yarn lint; fi | ||
- name: if exists, run yarn build | ||
run: cd examples/${{ matrix.dir }} && cat package.json | if grep --silent '"build"'; then yarn build; fi | ||
- name: if exists, run yarn test-start | ||
run: cd examples/${{ matrix.dir }} && cat package.json | if grep --silent '"test-start"'; then yarn test-start; fi | ||
- name: if exists, run yarn test-dev | ||
run: cd examples/${{ matrix.dir }} && cat package.json | if grep --silent '"test-dev"'; then yarn test-dev; fi | ||
- name: if exists, run lint | ||
run: cd examples/${{ matrix.dir }} && cat package.json | if grep --silent '"lint"'; then pnpm lint; fi | ||
- name: if exists, run build | ||
run: cd examples/${{ matrix.dir }} && cat package.json | if grep --silent '"build"'; then pnpm build; fi | ||
- name: if exists, run test-start | ||
run: cd examples/${{ matrix.dir }} && cat package.json | if grep --silent '"test-start"'; then pnpm test-start; fi | ||
- name: if exists, run test-dev | ||
run: cd examples/${{ matrix.dir }} && cat package.json | if grep --silent '"test-dev"'; then pnpm test-dev; fi |
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 |
---|---|---|
|
@@ -6,20 +6,31 @@ concurrency: | |
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
env: | ||
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/playwright | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v1 | ||
- uses: pnpm/[email protected] | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
version: '16.x' | ||
cache: 'pnpm' | ||
|
||
- name: Cache Playwright's binary | ||
uses: actions/cache@v3 | ||
with: | ||
version: 16.x | ||
key: ${{ runner.os }}-playwright-bin-v1 | ||
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }} | ||
|
||
- name: Install deps and build (with cache) | ||
uses: bahmutov/npm-install@v1 | ||
run: pnpm install | ||
|
||
- name: Lint | ||
run: yarn lint | ||
run: pnpm lint | ||
|
||
- run: yarn manypkg check | ||
- run: pnpm manypkg check |
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 |
---|---|---|
|
@@ -5,6 +5,9 @@ jobs: | |
name: Build and test on Node ${{ matrix.node }} and ${{ matrix.os }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
env: | ||
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/playwright | ||
|
||
strategy: | ||
matrix: | ||
node: ['16.x'] | ||
|
@@ -14,16 +17,25 @@ jobs: | |
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
- name: Use Node ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
cache: 'pnpm' | ||
|
||
- name: Cache Playwright's binary | ||
uses: actions/cache@v3 | ||
with: | ||
key: ${{ runner.os }}-playwright-bin-v1 | ||
path: ${{ env.PLAYWRIGHT_BROWSERS_PATH }} | ||
|
||
- name: Install deps and build (with cache) | ||
uses: bahmutov/npm-install@v1 | ||
run: pnpm install | ||
|
||
- name: Test | ||
run: yarn test --ci --coverage --maxWorkers=2 | ||
run: pnpm test -- --ci --coverage --maxWorkers=2 | ||
|
||
- uses: codecov/codecov-action@v1 | ||
with: | ||
|
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,3 @@ | ||
public-hoist-pattern[]=@types/* | ||
public-hoist-pattern[]=playwright-core | ||
side-effects-cache=false |
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,9 @@ | ||
module.exports = { | ||
printWidth: 80, | ||
trailingComma: 'all', | ||
endOfLine: 'auto', | ||
singleQuote: true, | ||
importOrder: ['___', '__', '<THIRD_PARTY_MODULES>', '^[./]'], | ||
importOrderSortSpecifiers: true, | ||
plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')], | ||
}; |
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 |
---|---|---|
|
@@ -4,10 +4,12 @@ So excited to have you here! If you want **any** guidance whatsoever with contri | |
|
||
## Development workflow | ||
|
||
We use [pnpm](https://pnpm.io) as our package manager, so make sure to [install](https://pnpm.io/installation) it first. | ||
|
||
```bash | ||
git clone [email protected]:trpc/trpc.git | ||
cd trpc | ||
yarn | ||
pnpm install | ||
``` | ||
|
||
### Get it running | ||
|
@@ -16,39 +18,39 @@ yarn | |
|
||
```bash | ||
# in project root directory | ||
yarn dev | ||
pnpm dev | ||
``` | ||
|
||
This will start a watcher in parallel which builds all `packages/*` on any file change. | ||
|
||
**Terminal 2:** | ||
|
||
In another terminal, you can for instance navigate to `examples/next-prisma-starter` and run `yarn dev` & it will update whenever code is changed in the packages. | ||
In another terminal, you can for instance navigate to `examples/next-prisma-starter` and run `pnpm dev` & it will update whenever code is changed in the packages. | ||
|
||
### Testing | ||
|
||
> Note: you will want to have `yarn dev` running in parallel in another terminal | ||
> Note: you will want to have `pnpm dev` running in parallel in another terminal | ||
```bash | ||
# in project root directory | ||
yarn test --watch | ||
pnpm test --watch | ||
|
||
# example if you want to test a specific test file: | ||
yarn test --watch --testPathPattern react | ||
pnpm test --watch --testPathPattern react | ||
``` | ||
|
||
Testing is currently coalesced in [./packages/server/test](./packages/server/test); we import the different libs from here, this makes it easier for us to do integration testing + getting test coverage on the whole codebase. | ||
|
||
### Linting | ||
|
||
```bash | ||
yarn lint-fix | ||
pnpm lint-fix | ||
``` | ||
|
||
### Documentation | ||
|
||
```bash | ||
cd www/ && yarn dev | ||
cd www/ && pnpm dev | ||
``` | ||
|
||
## Project overview | ||
|
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
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
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.