Skip to content

Commit

Permalink
Merge branch 'master' into pr/env-var-parsing-for-generator-binaryTar…
Browse files Browse the repository at this point in the history
…gets

* master: (69 commits)
  chore: remove unused printDatamodelDiff (#7686)
  chore: upgrade pnpm from v5 to v6 (#7685)
  chore(deps): update devdependencies (non-major) (#7636)
  chore(deps): update react-prisma (#7637)
  fix(client): delete transactionId field in middleware (#7662)
  fix(client): env-var loading (#7669)
  fix(client): ensure autoinstall looks for the correct client (#7670)
  fix(seed): add empty export {} for TypeScript --isolatedModules (#7666)
  fix(migrate): cleanup datasource printing for SQLServer & default to postgres for pg (#7654)
  fix(cli): remove --provider from init for now (#7667)
  fix(migrate): Make phrasing of migrate warning messages more accurate (#7664)
  fix(deps): update engines to v2.25.0-36.c838e79f39885bc8e1611849b1eb28b5bb5bc922 (#7649)
  chore(deps): update dependency @prisma/studio-server to v0.400.0 (#7645)
  fix(deps): update engines to v2.25.0-35.ec38a348006215c00435291bf23ddf6096ecccb9 (#7647)
  fix: disable Node-API with M1 (#7601)
  fix(deps): update engines to v2.25.0-30.149261944d529dc4c506db7e017bb4dfd26ef398 (#7623)
  fix(deps): update engines to v2.25.0-29.6d6abdeb152d51c75fcf8ab498150c5a6a79d805 (#7619)
  refactor(migrate): Simplify engine API of evaluateDataLoss in Migrate (#7576)
  ci: fix detect-jobs-to-run (#7616)
  fix(deps): update engines to v2.25.0-28.2456c6fa85cf119868d31902130d1c8401345c53 (#7572)
  ...

# Conflicts:
#	src/packages/cli/package.json
#	src/packages/client/package.json
#	src/packages/engine-core/package.json
#	src/packages/fetch-engine/package.json
#	src/packages/migrate/package.json
#	src/packages/sdk/package.json
#	src/pnpm-lock.yaml
  • Loading branch information
Jolg42 committed Jun 17, 2021
2 parents 809d7f1 + d1543af commit 8df860a
Show file tree
Hide file tree
Showing 110 changed files with 2,904 additions and 4,367 deletions.
12 changes: 11 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": ["config:base", ":disableRateLimiting"],
"schedule": ["at any time"],
"semanticCommits": "enabled",
"masterIssue": true,
"dependencyDashboard": true,
"reviewers": ["@jolg42", "@williamluke4", "millsp"],
"rebaseWhen": "conflicted",
"ignoreDeps": ["esbuild", "sqlite3"],
Expand Down Expand Up @@ -59,6 +59,16 @@
"updateTypes": ["patch", "minor"],
"reviewers": ["@Weakky", "jolg42"]
},
{
"groupName": "jest",
"automerge": "true",
"packageNames": ["jest", "@types/jest", "ts-jest"]
},
{
"groupName": "node-fetch",
"ignoreUnstable": false,
"packageNames": ["node-fetch"]
},
{
"groupName": "react-prisma",
"paths": ["src/packages/react-prisma/**"],
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/detect-jobs-to-run.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/usr/bin/env node
// @ts-check

const { stdin } = process;

// From https://github.com/sindresorhus/get-stdin/blob/main/index.js
async function getStdin() {
let result = "";

if (stdin.isTTY) {
return result;
}

stdin.setEncoding("utf8");

for await (const chunk of stdin) {
result += chunk;
}

return result;
}

async function main() {
const stdinData = await getStdin();
console.log("stdin:", stdinData);

/**
* @type string[]
**/
const filesChanged = JSON.parse(stdinData);
console.log("filesChanged:", filesChanged);

const jobsToRun = [];

// If changes are located only in one of the paths below
if (
filesChanged.every((fileChanged) =>
fileChanged.startsWith("src/packages/cli/")
)
) {
jobsToRun.push("-cli-");
} else if (
filesChanged.every((fileChanged) =>
fileChanged.startsWith("src/packages/client/")
)
) {
jobsToRun.push("-client-");
jobsToRun.push("-integration-tests-");
jobsToRun.push("-cli-");
} else if (
filesChanged.every((fileChanged) =>
fileChanged.startsWith("src/packages/integration-tests/")
)
) {
jobsToRun.push("-integration-tests-");
} else if (
filesChanged.every((fileChanged) =>
fileChanged.startsWith("src/packages/migrate/")
)
) {
jobsToRun.push("-migrate-");
jobsToRun.push("-cli-");
} else {
jobsToRun.push("-all-");
}

console.log("jobsToRun:", jobsToRun);
console.log("::set-output name=jobs::" + jobsToRun.join());
}

main().then(function () {
console.log("Done");
});
2 changes: 1 addition & 1 deletion .github/workflows/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -ex

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

pnpm i --no-prefer-frozen-lockfile
cd src
Expand Down
44 changes: 42 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,29 @@ env:
PRISMA_TELEMETRY_INFORMATION: 'prisma test.yml'

jobs:
detect_jobs_to_run:
name: Detect jobs to run
runs-on: ubuntu-latest
outputs:
jobs: ${{ steps.detect.outputs.jobs }}
steps:
- id: checkout
uses: actions/checkout@v2
- id: files
uses: Ana06/get-changed-files@v1.2 # it's a fork of jitterbit/get-changed-files@v1 which works better with pull requests
with:
format: 'json'
- id: detect
run: ./.github/workflows/detect-jobs-to-run.js <<<'${{ steps.files.outputs.all }}'

# From https://github.com/marketplace/actions/skip-duplicate-actions
# This action cleans up previously running instances of a workflow on the same branch.
# This accomplishes the task of automatically cancelling CI runs on pushes to the same branch,
# which is a common feature in most CI systems but currently not possible with GitHub actions.
cleanup-runs:
continue-on-error: true
runs-on: ubuntu-20.04
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master' && !contains(github.actor, 'renovate')"
steps:
- uses: fkirc/skip-duplicate-actions@v3.4.0

Expand All @@ -62,7 +77,9 @@ jobs:
lint:
timeout-minutes: 7
runs-on: ubuntu-20.04

# Ignore if renovate (dependency update)
if: "!contains(github.actor, 'renovate')"

steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -93,6 +110,9 @@ jobs:
timeout-minutes: 20
runs-on: ${{ matrix.os }}

needs: detect_jobs_to_run
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') || contains(needs.detect_jobs_to_run.outputs.jobs, '-client-') }}

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -151,6 +171,10 @@ jobs:
client-types:
timeout-minutes: 10
runs-on: ubuntu-20.04

needs: detect_jobs_to_run
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') || contains(needs.detect_jobs_to_run.outputs.jobs, '-client-') }}

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -194,6 +218,10 @@ jobs:
integration-tests:
timeout-minutes: 20
runs-on: ubuntu-20.04

needs: detect_jobs_to_run
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') || contains(needs.detect_jobs_to_run.outputs.jobs, '-integration-tests-') }}

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -268,6 +296,9 @@ jobs:
timeout-minutes: 5
runs-on: ${{ matrix.os }}

needs: detect_jobs_to_run
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') }}

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -319,6 +350,9 @@ jobs:
timeout-minutes: 7
runs-on: ${{ matrix.os }}

needs: detect_jobs_to_run
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') || contains(needs.detect_jobs_to_run.outputs.jobs, '-migrate-') }}

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -384,6 +418,9 @@ jobs:
timeout-minutes: 10
runs-on: ${{ matrix.os }}

needs: detect_jobs_to_run
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') || contains(needs.detect_jobs_to_run.outputs.jobs, '-cli-') }}

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -435,6 +472,9 @@ jobs:
timeout-minutes: 10
runs-on: ${{ matrix.os }}

needs: detect_jobs_to_run
if: ${{ contains(needs.detect_jobs_to_run.outputs.jobs, '-all-') }}

strategy:
fail-fast: false
matrix:
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To setup and build the packages, follow these steps:

```bash
git clone https://github.com/prisma/prisma.git
npm i -g pnpm@5.15.1 --unsafe-perm
npm i -g pnpm@6 --unsafe-perm
cd prisma/src
pnpm i
pnpm run setup
Expand All @@ -36,7 +36,7 @@ Note for Windows: Use the latest version of [Git Bash](https://gitforwindows.org

1. Node.js `>=12.2` minimum, [latest LTS is recommended](https://nodejs.org/en/about/releases/)
1. Install [`yarn@1`](https://classic.yarnpkg.com/en/docs/install/) (for building a "pack" version of the client)
1. Install [`pnpm@5.15.1`](https://pnpm.js.org/) (for installing npm dependencies)
1. Install [`pnpm@6`](https://pnpm.js.org/) (for installing npm dependencies)
1. Install [`docker`](https://www.docker.com/products/docker-desktop) (for managing test databases)
1. Install [`ts-node`](https://github.com/TypeStrong/ts-node) (for running Node scripts written in TypeScript)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Prisma is a **next-generation ORM** that consists of these tools:
- [**Prisma Migrate**](https://www.prisma.io/docs/concepts/components/prisma-migrate): Declarative data modeling & migration system
- [**Prisma Studio**](https://github.com/prisma/studio): GUI to view and edit data in your database

Prisma Client can be used in _any_ Node.js or TypeScript backend application (including serverless applications and microservices). This can be a [REST API](https://www.prisma.io/docs/understand-prisma/prisma-in-your-stack/rest), a [GraphQL API](https://www.prisma.io/docs/understand-prisma/prisma-in-your-stack/graphql) a gRPC API or anything else that needs a database.
Prisma Client can be used in _any_ Node.js or TypeScript backend application (including serverless applications and microservices). This can be a [REST API](https://www.prisma.io/docs/understand-prisma/prisma-in-your-stack/rest), a [GraphQL API](https://www.prisma.io/docs/understand-prisma/prisma-in-your-stack/graphql) a gRPC API, or anything else that needs a database.

> **Are you looking for Prisma 1? The Prisma 1 repository has been renamed to [`prisma/prisma1`](https://github.com/prisma/prisma1)**.
Expand Down Expand Up @@ -138,7 +138,7 @@ Refer to the documentation for more information about ["generating the Prisma cl

#### Using Prisma Client to send queries to your database

Once Prisma Client was generated, you can import in your code and send queries to your database. This is what the setup code looks like.
Once the Prisma Client is generated, you can import it in your code and send queries to your database. This is what the setup code looks like.

##### Import and instantiate Prisma Client

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@
},
"devDependencies": {
"@types/benchmark": "2.1.0",
"@types/node": "14.17.1",
"@typescript-eslint/eslint-plugin": "4.25.0",
"@typescript-eslint/parser": "4.25.0",
"@types/node": "14.17.3",
"@typescript-eslint/eslint-plugin": "4.27.0",
"@typescript-eslint/parser": "4.27.0",
"arg": "5.0.0",
"benchmark": "2.1.4",
"chalk": "4.1.1",
"eslint": "7.27.0",
"eslint": "7.28.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-eslint-comments": "3.2.0",
"eslint-plugin-jest": "24.3.6",
"eslint-plugin-prettier": "3.4.0",
"execa": "5.0.1",
"execa": "5.1.1",
"globby": "11.0.3",
"husky": "4.3.8",
"p-map": "4.0.0",
"prettier": "2.3.0",
"prettier": "2.3.1",
"staged-git-files": "1.2.0",
"ts-node": "9.1.1",
"ts-node": "10.0.0",
"typescript": "4.3.2"
},
"husky": {
Expand Down

0 comments on commit 8df860a

Please sign in to comment.