Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: drop Node.js 12 and modernize the toolchain #13705

Merged
merged 7 commits into from
Jun 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .buildkite/publish/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.7'
services:
app:
image: node:12-buster
image: node:14-buster
volumes:
- ../../:/app
working_dir: /app
Expand Down
6 changes: 3 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.187.0/containers/typescript-node/.devcontainer/base.Dockerfile

# [Choice] Node.js version: 16, 14, 12
ARG VARIANT="14-buster"
# [Choice] Node.js version: 14, 16, 18
ARG VARIANT="16-buster"
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
Expand All @@ -13,4 +13,4 @@ FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}
# RUN su node -c "source /usr/local/share/nvm/nvm.sh && nvm install ${EXTRA_NODE_VERSION}"

# To install more global node packages
RUN su node -c "npm install -g pnpm ts-node"
RUN su node -c "npm install -g pnpm@6 ts-node"
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"name": "Node.js & TypeScript",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 12, 14, 16
// Update 'VARIANT' to pick a Node version: 14, 16, 18
"args": {
"VARIANT": "14"
"VARIANT": "16"
}
},

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
- uses: actions/setup-node@v3
with:
cache: 'pnpm'
node-version: '12'
node-version: '16'

# https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers
# Matchers are added in setup-node
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
matrix:
queryEngine: ['library', 'binary']
os: [ubuntu-latest]
node: [12, 16]
node: [16, 18]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [12]
node: [16]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -239,7 +239,7 @@ jobs:
fail-fast: false
matrix:
queryEngine: ['library', 'binary']
node: [12]
node: [16]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -304,7 +304,7 @@ jobs:
matrix:
queryEngine: ['library', 'binary']
os: [ubuntu-latest]
node: [12, 16]
node: [16, 18]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -366,7 +366,7 @@ jobs:
matrix:
queryEngine: ['library', 'binary']
os: [ubuntu-latest]
node: [12, 16]
node: [16, 18]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -437,7 +437,7 @@ jobs:
matrix:
queryEngine: ['library', 'binary']
os: [ubuntu-latest]
node: [12, 16]
node: [16, 18]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -492,7 +492,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [12, 16]
node: [16, 18]

steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Welcome to the monorepo for our TypeScript code for the Prisma ORM. (for the Eng

## General Prerequisites

1. Install Node.js `>=12.6` minimum, [latest LTS is recommended](https://nodejs.org/en/about/releases/)
1. Install Node.js `>=14` minimum, [latest LTS is recommended](https://nodejs.org/en/about/releases/)

- Recommended: use [`nvm`](https://github.com/nvm-sh/nvm) for managing Node.js versions

Expand All @@ -26,8 +26,8 @@ https://github.com/direnv/direnv/blob/master/docs/installation.md
Copy paste these commands to install the global dependencies:

```bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
nvm install 14
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
nvm install 16
npm install --global pnpm@6 ts-node
# For direnv see https://github.com/direnv/direnv/blob/master/docs/installation.md
```
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"Alexey Orlenko <orlenko@prisma.io>"
],
"engines": {
"node": ">=12.6",
"pnpm": ">=6.14.1"
"node": ">=14",
"pnpm": ">=6.14.1 <7"
},
"scripts": {
"setup": "ts-node scripts/setup.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"bugs": "https://github.com/prisma/prisma/issues",
"license": "Apache-2.0",
"engines": {
"node": ">=12.6"
"node": ">=14"
},
"prisma": {
"prismaCommit": "placeholder-for-commit-hash-replaced-during-publishing-in-publish-ts"
Expand Down
5 changes: 2 additions & 3 deletions packages/cli/scripts/preinstall.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,10 @@ const white = (str) => WHITE_BRIGHT + str + RESET
export function main() {
const nodeVersions = process.version.split('.')
const nodeMajorVersion = parseInt(nodeVersions[0].slice(1))
const nodeMinorVersion = parseInt(nodeVersions[1])
if (nodeMajorVersion < 12 || (nodeMajorVersion === 12 && nodeMinorVersion < 6)) {
if (nodeMajorVersion < 14) {
console.error(
drawBox({
str: `Prisma only supports Node.js >= 12.6`,
str: `Prisma only supports Node.js >= 14`,
verticalPadding: 1,
horizontalPadding: 3,
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/__tests__/commands/Studio.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Studio } from '../../Studio'

const STUDIO_TEST_PORT = 5678

async function sendRequest(message: any): Promise<any> {
function sendRequest(message: any): Promise<any> {
return fetch(`http://localhost:${STUDIO_TEST_PORT}/api`, {
method: 'POST',
headers: {
Expand Down
4 changes: 2 additions & 2 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"types": "index.d.ts",
"license": "Apache-2.0",
"engines": {
"node": ">=12.6"
"node": ">=14"
},
"homepage": "https://www.prisma.io",
"repository": {
Expand Down Expand Up @@ -120,7 +120,7 @@
"stacktrace-parser": "0.1.10",
"strip-ansi": "6.0.1",
"strip-indent": "3.0.0",
"ts-jest": "28.0.3",
"ts-jest": "28.0.4",
"ts-node": "10.8.0",
"tsd": "0.20.0",
"typescript": "4.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"esbuild": "0.14.39",
"jest": "28.1.0",
"jest-junit": "13.2.0",
"ts-jest": "28.0.3",
"ts-jest": "28.0.4",
"typescript": "4.7.2"
},
"scripts": {
Expand Down