Skip to content

Commit

Permalink
chore(prisma): type discovery + fast builds + clean monorepo (prisma#…
Browse files Browse the repository at this point in the history
…8497)

Co-authored-by: Joël <[email protected]>
  • Loading branch information
millsp and Jolg42 authored Aug 2, 2021
1 parent 9236d0e commit 0d0dc83
Show file tree
Hide file tree
Showing 1,365 changed files with 8,066 additions and 9,266 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const globby = require("globby");
const fs = require("fs");
const path = require("path");

const ignoreFiles = globby.sync("src/packages/*/.eslintignore");
const ignoreFiles = globby.sync("packages/*/.eslintignore");

const ignorePatterns = flatten(
flatten(
Expand Down Expand Up @@ -33,7 +33,7 @@ module.exports = {
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
project: ["./src/packages/*/tsconfig.eslint.json"],
project: ["./packages/*/tsconfig.eslint.json"],
// debugLevel: true,
},
ignorePatterns,
Expand Down
34 changes: 17 additions & 17 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
* @Jolg42 @williamluke4 @millsp
* @Jolg42 @williamluke4 @millsp

# root
/.github/ @Jolg42 @williamluke4
/.github/ @Jolg42 @williamluke4
/.github/workflows/benchmark.yml @williamluke4
/scripts/ @Jolg42 @williamluke4
/graphs/ @williamluke4
/scripts/ @Jolg42 @williamluke4
/graphs/ @williamluke4

# src
/src/.buildkite/ @Jolg42 @williamluke4
/src/scripts/ @Jolg42
/.buildkite/ @Jolg42 @williamluke4 @millsp
/scripts/ @Jolg42

# src/packages
/src/packages/cli/ @Jolg42 @williamluke4 @millsp
/src/packages/client/ @williamluke4 @millsp
/src/packages/debug/ @williamluke4 @millsp
/src/packages/engine-core/ @williamluke4 @millsp
/src/packages/generator-helper/ @williamluke4 @millsp
/src/packages/get-platform/ @williamluke4 @millsp
/src/packages/migrate/ @Jolg42
/src/packages/react-prisma/ @williamluke4 @millsp
/src/packages/sdk/ @Jolg42 @williamluke4 @millsp
/src/packages/integration-tests/ @williamluke4 @millsp
# packages
/packages/cli/ @Jolg42 @williamluke4 @millsp
/packages/client/ @williamluke4 @millsp
/packages/debug/ @williamluke4 @millsp
/packages/engine-core/ @williamluke4 @millsp
/packages/generator-helper/ @williamluke4 @millsp
/packages/get-platform/ @williamluke4 @millsp
/packages/migrate/ @Jolg42
/packages/react-prisma/ @williamluke4 @millsp
/packages/sdk/ @Jolg42 @williamluke4 @millsp
/packages/integration-tests/ @williamluke4 @millsp
2 changes: 1 addition & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
{
"groupName": "react-prisma",
"paths": ["src/packages/react-prisma/**"],
"paths": ["packages/react-prisma/**"],
"rangeStrategy": "replace",
"schedule": ["before 8am on Wednesday"]
}
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ on:
paths-ignore:
# Any update here needs to be done for
# - `pull_request` see below
# - https://github.com/prisma/prisma/blob/master/src/.buildkite/test/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/master/src/.buildkite/publish/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/master/.buildkite/test/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/master/.buildkite/publish/buildkite-entry.sh
- "*.md"
- ".vscode/**"
- "docs/**"
- "examples/**"
- "LICENSE"
- '.github/CODEOWNERS'
- "src/.buildkite/**"
- "src/.dockerignore"
- "src/scripts/ci/publish.ts"
- "src/graphs/**"
- ".dockerignore"
- "scripts/ci/publish.ts"
- "graphs/**"

env:
PRISMA_TELEMETRY_INFORMATION: "prisma benchmark.yml"
Expand Down Expand Up @@ -47,7 +47,6 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}

# This is required as setup.sh can modify pnpm-lock.yml
- run: rm -f src/pnpm-lock.yaml
- run: rm -f ./pnpm-lock.yaml

- name: Run benchmarks
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/detect-jobs-to-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ async function main() {
// If changes are located only in one of the paths below
if (
filesChanged.every((fileChanged) =>
fileChanged.startsWith("src/packages/cli/")
fileChanged.startsWith("packages/cli/")
)
) {
jobsToRun.push("-cli-");
} else if (
filesChanged.every((fileChanged) =>
fileChanged.startsWith("src/packages/client/")
fileChanged.startsWith("packages/client/")
)
) {
jobsToRun.push("-client-");
jobsToRun.push("-integration-tests-");
jobsToRun.push("-cli-");
} else if (
filesChanged.every((fileChanged) =>
fileChanged.startsWith("src/packages/integration-tests/")
fileChanged.startsWith("packages/integration-tests/")
)
) {
jobsToRun.push("-integration-tests-");
} else if (
filesChanged.every((fileChanged) =>
fileChanged.startsWith("src/packages/migrate/")
fileChanged.startsWith("packages/migrate/")
)
) {
jobsToRun.push("-migrate-");
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ set -ex

npm i --silent -g pnpm@6 --unsafe-perm

pnpm i --no-prefer-frozen-lockfile
cd src

pnpm i --no-prefer-frozen-lockfile

pnpm run setup
66 changes: 33 additions & 33 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
paths-ignore:
# Any update here needs to be done for
# - `pull_request` see below
# - https://github.com/prisma/prisma/blob/master/src/.buildkite/test/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/master/src/.buildkite/publish/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/master/.buildkite/test/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/master/.buildkite/publish/buildkite-entry.sh
- '*.md'
- '.vscode/**'
- '.github/ISSUE_TEMPLATE/**'
Expand All @@ -18,16 +18,16 @@ on:
- 'LICENSE'
- '.github/CODEOWNERS'
- 'src/.buildkite/**'
- 'src/.dockerignore'
- '.dockerignore'
- '*.bench.ts'
- 'src/scripts/ci/publish.ts'
- 'src/graphs/**'
- 'scripts/ci/publish.ts'
- 'graphs/**'
pull_request:
paths-ignore:
# Any update here needs to be done for
# - `push`see before
# - https://github.com/prisma/prisma/blob/master/src/.buildkite/test/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/master/src/.buildkite/publish/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/master/.buildkite/test/buildkite-entry.sh
# - https://github.com/prisma/prisma/blob/master/.buildkite/publish/buildkite-entry.sh
- '*.md'
- '.vscode/**'
- '.github/ISSUE_TEMPLATE/**'
Expand All @@ -36,10 +36,10 @@ on:
- 'LICENSE'
- '.github/CODEOWNERS'
- 'src/.buildkite/**'
- 'src/.dockerignore'
- '.dockerignore'
- '*.bench.ts'
- 'src/scripts/ci/publish.ts'
- 'src/graphs/**'
- 'scripts/ci/publish.ts'
- 'graphs/**'

env:
PRISMA_TELEMETRY_INFORMATION: 'prisma test.yml'
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
run: |
echo "PRISMA_FORCE_NAPI=true" >> $GITHUB_ENV
- run: docker-compose -f src/docker/docker-compose.yml up --detach postgres postgres_isolated mysql mysql_isolated mssql
- run: docker-compose -f docker/docker-compose.yml up --detach postgres postgres_isolated mysql mysql_isolated mssql

- name: Cache .pnpm-store # From https://pnpm.io/continuous-integration
uses: actions/cache@v1
Expand All @@ -147,7 +147,7 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}

- run: pnpm run test -- --testPathIgnorePatterns src/__tests__/types/types.test.ts --verbose
working-directory: src/packages/client
working-directory: packages/client
env:
CI: true
SKIP_GIT: true
Expand All @@ -161,7 +161,7 @@ jobs:

- uses: codecov/codecov-action@v2
with:
files: ./src/packages/client/src/__tests__/coverage/clover.xml
files: ./packages/client/src/__tests__/coverage/clover.xml
flags: client,${{ matrix.os }}
name: client-${{ matrix.os }}

Expand Down Expand Up @@ -200,15 +200,15 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}

- run: pnpm run test src/__tests__/types/types.test.ts
working-directory: src/packages/client
working-directory: packages/client
env:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}

- uses: codecov/codecov-action@v2
with:
files: ./src/packages/client/src/__tests__/coverage/clover.xml
files: ./packages/client/src/__tests__/coverage/clover.xml
flags: client-types,${{ matrix.os }}
name: client-types-${{ matrix.os }}

Expand Down Expand Up @@ -242,7 +242,7 @@ jobs:
run: |
echo "PRISMA_FORCE_NAPI=true" >> $GITHUB_ENV
- run: docker-compose -f src/docker/docker-compose.yml up --detach ${{matrix.database}}
- run: docker-compose -f docker/docker-compose.yml up --detach ${{matrix.database}}
if: matrix.database != 'sqlite'

- name: Cache .pnpm-store # From https://pnpm.io/continuous-integration
Expand All @@ -263,14 +263,14 @@ jobs:

- run: pnpm i [email protected] --unsafe-perm --reporter=silent
if: ${{ matrix.database == 'sqlite' }}
working-directory: src/packages/integration-tests
working-directory: packages/integration-tests

# temp
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- run: pnpm run jest integration/${{ matrix.database }} -- --maxConcurrency=8
working-directory: src/packages/integration-tests
working-directory: packages/integration-tests
env:
CI: true
SKIP_GIT: true
Expand All @@ -285,7 +285,7 @@ jobs:

- uses: codecov/codecov-action@v2
with:
files: ./src/packages/integration-tests/src/__tests__/coverage/clover.xml
files: ./packages/integration-tests/src/__tests__/coverage/clover.xml
flags: integration-tests,${{ matrix.database }},${{ matrix.engine }}
name: integration-tests-${{ matrix.database }}-${{ matrix.engine }}

Expand Down Expand Up @@ -331,15 +331,15 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}

- run: pnpm run test
working-directory: src/packages/sdk
working-directory: packages/sdk
env:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}

- uses: codecov/codecov-action@v2
with:
files: ./src/packages/sdk/src/__tests__/coverage/clover.xml
files: ./packages/sdk/src/__tests__/coverage/clover.xml
flags: sdk,${{ matrix.os }}
name: sdk-${{ matrix.os }}

Expand All @@ -363,7 +363,7 @@ jobs:
steps:
- uses: actions/checkout@v2

- run: docker-compose -f src/docker/docker-compose.yml up --detach postgres mysql mssql
- run: docker-compose -f docker/docker-compose.yml up --detach postgres mysql mssql

- name: Set Engine Type
if: ${{ matrix.engine == 'napi' }}
Expand All @@ -387,10 +387,10 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}

- run: pnpm i [email protected] --unsafe-perm --reporter=silent
working-directory: src/packages/cli
working-directory: packages/cli

- run: pnpm run test
working-directory: src/packages/migrate
working-directory: packages/migrate
env:
CI: true
SKIP_GIT: true
Expand All @@ -407,7 +407,7 @@ jobs:

- uses: codecov/codecov-action@v2
with:
files: ./src/packages/migrate/src/__tests__/coverage/clover.xml
files: ./packages/migrate/src/__tests__/coverage/clover.xml
flags: migrate,${{ matrix.os }}
name: migrate-${{ matrix.os }}

Expand Down Expand Up @@ -453,15 +453,15 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}

- run: pnpm run test
working-directory: src/packages/cli
working-directory: packages/cli
env:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}

- uses: codecov/codecov-action@v2
with:
files: ./src/packages/cli/src/__tests__/coverage/clover.xml
files: ./packages/cli/src/__tests__/coverage/clover.xml
flags: cli,${{ matrix.os }}
name: cli-${{ matrix.os }}

Expand Down Expand Up @@ -502,42 +502,42 @@ jobs:

- run: pnpm run test
name: 'debug'
working-directory: src/packages/debug
working-directory: packages/debug
env:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}

- uses: codecov/codecov-action@v2
with:
files: ./src/packages/debug/src/__tests__/coverage/clover.xml
files: ./packages/debug/src/__tests__/coverage/clover.xml
flags: debug,${{ matrix.os }}
name: debug-${{ matrix.os }}

- run: pnpm run test
name: 'engine-core'
working-directory: src/packages/engine-core
working-directory: packages/engine-core
env:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}

- uses: codecov/codecov-action@v2
with:
files: ./src/packages/engine-core/src/__tests__/coverage/clover.xml
files: ./packages/engine-core/src/__tests__/coverage/clover.xml
flags: engine-core,${{ matrix.os }}
name: engine-core-${{ matrix.os }}

- run: pnpm run test
name: 'generator-helper'
working-directory: src/packages/generator-helper
working-directory: packages/generator-helper
env:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}

- uses: codecov/codecov-action@v2
with:
files: ./src/packages/generator-helper/src/__tests__/coverage/clover.xml
files: ./packages/generator-helper/src/__tests__/coverage/clover.xml
flags: generator-helper,${{ matrix.os }}
name: generator-helper-${{ matrix.os }}
1 change: 0 additions & 1 deletion .github/workflows/update-engines-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ jobs:
- name: Update the engines dependencies
run: |
echo 'Updating @prisma/engines, @prisma/engines-version, @prisma/fetch-engine and @prisma/get-platform to ${{ github.event.inputs.version }} using pnpm'
cd src
pnpm update -r @prisma/engines@${{ github.event.inputs.version }} @prisma/engines-version@${{ github.event.inputs.version }} @prisma/fetch-engine@${{ github.event.inputs.version }} @prisma/get-platform@${{ github.event.inputs.version }}
- name: Create Pull Request
Expand Down
Loading

0 comments on commit 0d0dc83

Please sign in to comment.