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

Support Node v14.15+ #2202

Merged
merged 7 commits into from
Dec 16, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/new-hats-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
'astro': minor
'@astrojs/parser': minor
'@astrojs/prism': minor
'create-astro': minor
'@astrojs/renderer-preact': minor
'@astrojs/renderer-react': minor
'@astrojs/renderer-solid': minor
'@astrojs/renderer-svelte': minor
'@astrojs/renderer-vue': minor
'@astrojs/astro-test-builtins-dep': minor
'@astrojs/test-custom-element-renderer': minor
'@astrojs/markdown-remark': minor
'@astrojs/renderer-lit': minor
---

Support for Node v14.15+, dropping Node v12.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/---01-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ body:
Thank you for taking the time to file a bug report! Please fill out this form as completely as possible.

✅ I am using the **latest version of Astro** and all plugins.
✅ I am using a version of Node that supports ESM (`v12.20.0+`, `v14.13.1+`, or `v16.0.0+`)
✅ I am using a version of Node that supports ESM (`v14.15.0+`, or `v16.0.0+`)
- type: input
attributes:
label: What version of `astro` are you using?
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
node_version: [12, 14, 16]
node_version: [14, 16]
include:
- os: windows-latest
node_version: 16
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We welcome contributions of any size and skill level. As an open source project,
### Prerequisite

```shell
node: "^12.20.0 || ^14.13.1 || >=16.0.0"
node: "^14.15.0 || >=16.0.0"
yarn: "^1.22.10"
# otherwise, your build will fail
```
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/de/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Es gibt verschiedene Möglichkeiten Astro mit einem neuen Projekt zu installiere

## Vorbereitungen

- **Node.js** - `v12.20.0`, `v14.13.1`, `v16.0.0` oder höher
- **Node.js** - `v14.15.0`, `v16.0.0` oder höher
- **Texteditor** - Wir empfehlen [VS Code](https://code.visualstudio.com/) mit unserer [offiziellen Astro-Erweiterung](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode)
- **Terminal** - Astro wird im Wesentlichen über die Befehlszeile des Terminals gesteuert

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/de/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Die einfachste Weg schnell mit Astro loszulegen.
---

```shell
# Vorbereitung: Überprüfe, ob Node.js die Version 12.20.0+, 14.13.1+, oder 16+ ist
# Vorbereitung: Überprüfe, ob Node.js die Version 14.15.0+, oder 16+ ist
node --version

# Erstelle einen neues Projektverzeichnis und navigiere direkt dorthin
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/es/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Hay diferentes formas de instalar Astro en un nuevo proyecto.

## Prerrequisitos

- **Node.js** - `v12.20.0`, `v14.13.1`, `v16.0.0`, o mayor.
- **Node.js** - `v14.15.0`, `v16.0.0`, o mayor.
- **Editor de texto** - Te recomendamos [VS Code](https://code.visualstudio.com/) con nuestra [extensión oficial de Astro](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode).
- **Terminal** - Principalmente, puedes ingresar a Astro por medio de linea de comando del terminal.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/es/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lang: es
---

```shell
# prerrequisitos: revisa que Node.js está en la versión 12.20.0+, 14.13.1+, ó 16+
# prerrequisitos: revisa que Node.js está en la versión 14.15.0+, ó 16+
node --version

# crea un nuevo proyecto en el directorio y entra a él
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/fi/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Astron voi asentaa parilla eri tavalla uuteen projektiin.

## Vaatimukset

- **Node.js** - `v12.20.0`, `v14.13.1`, `v16.0.0` tai uudempi.
- **Node.js** - `v14.15.0`, `v16.0.0` tai uudempi.
- **Tekstieditori** - Suosittelemme [VS Codea](https://code.visualstudio.com/) yhdessä [Astro-laajennoksen](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode) kanssa.
- **Terminaali** - Astroa käytetään pääasiassa komentorivin kautta.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/fi/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lang: fi
---

```shell
# vaatimukset: varmista että Node.js on vähintään versiota 12.20.0+, 14.13.1+ tai 16+
# vaatimukset: varmista että Node.js on vähintään versiota 14.15.0+ tai 16+
node --version

# luo uuden projektin hakemisto ja siirry siihen
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/fr/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Il y a plusieurs façons d'installer Astro dans un nouveau projet.

## Prérequis

- **Node.js** - `v12.20.0`, `v14.13.1`, `v16.0.0`, or plus.
- **Node.js** - `v14.15.0`, `v16.0.0`, or plus.
- **Éditeur de texte** - Privilégiez [VS Code](https://code.visualstudio.com/) et [l'extension Astro officielle](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode).
- **Terminal** - Astro s'utilise principalement en ligne de commande.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/fr/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lang: fr
---

```shell
# Prérequis : vérifiez que Node.js est en version 12.20.0+, 14.13.1+, ou 16+
# Prérequis : vérifiez que Node.js est en version 14.15.0+, ou 16+
node --version

# Créez un nouveau dossier, et placez-vous dedans
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ There are a few different ways to install Astro in a new project.

## Prerequisites

- **Node.js** - `v12.20.0`, `v14.13.1`, `v16.0.0`, or higher.
- **Node.js** - `14.15.0`, `v16.0.0`, or higher.
- **Text editor** - We recommend [VS Code](https://code.visualstudio.com/) with our [Official Astro extension](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode).
- **Terminal** - Astro is mainly accessed via the terminal's command-line.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/ja/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ lang: ja

## 事前準備

- **Node.js** - `v12.20.0`、`v14.13.1`、`v16.0.0`、またはそれ以上。
- **Node.js** -`v14.15.0`、`v16.0.0`、またはそれ以上。
- **テキストエディター** - [VS Code](https://code.visualstudio.com/) と [公式 Astro extension](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode)をオススメします。
- **ターミナル** - Astro は主にターミナルのコマンドラインからアクセスします。

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/ja/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lang: ja
---

```shell
# 必須条件: Node.jsが12.20.0+、14.13.1+、または16+であることを確認する。
# 必須条件: Node.jsが14.15.0+、または16+であることを確認する。
node --version

# 新しいプロジェクトディレクトリを作成し、その中に直接移動します
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/nl/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: De makkelijkste manier om snel te beginnen met Astro.
---

```shell
# voorwaarde: check dat Node.js versie een van de volgende is: 12.20.0+, 14.13.1+, of 16+
# voorwaarde: check dat Node.js versie een van de volgende is: 14.15.0+, of 16+
node --version

# maak een nieuwe project folder en navigeer naar deze folder
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: The easiest way to get started quickly with Astro.
---

```shell
# prerequisite: check that Node.js is 12.20.0+, 14.13.1+, or 16+
# prerequisite: check that Node.js is 14.15.0+, or 16+
node --version

# Make a new project directory, and navigate directly into it
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/ru/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Быстрый старт
---

```shell
# Заметка: проверьте, что у вас установлена Node.js версии 12.20.0+, 14.13.1+, или 16+
# Заметка: проверьте, что у вас установлена Node.js версии 14.15.0+, или 16+
node --version

# Создайте новую директорию и перейдите в неё
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/zh-CN/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ lang: zh-CN

## 环境要求

- **Node.js** - `v12.20.0`、`v14.13.1` 和 `v16.0.0`,或更高版本。
- **Node.js** - `v14.15.0` 和 `v16.0.0`,或更高版本。
- **文本编辑器** - 我们推荐使用 [VS Code](https://code.visualstudio.com/) 搭配 [Astro 官方插件](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode)。
- **命令行终端** - Astro 主要是通过终端的命令行执行。

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/zh-CN/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lang: zh-CN
---

```shell
# 环境要求:确保 Node.js 版本是 12.20.0+、14.13.1+ 或 16 及以上。
# 环境要求:确保 Node.js 版本是 14.15.0+ 或 16 及以上。
node --version

# 创建并进入新项目目录
Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/zh-TW/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ lang: zh-Hant-TW

## 環境需求

- **Node.js** - `v12.20.0`、`v14.13.1` 和 `v16.0.0`,或更之後的版本。
- **Node.js** - `v14.15.0` 和 `v16.0.0`,或更之後的版本。
- **文字編輯器** - 我們推薦使用 [VS Code](https://code.visualstudio.com/) 和 [Astro 官方擴充套件](https://marketplace.visualstudio.com/items?itemName=astro-build.astro-vscode)。
- **終端機** - Astro 主要透過終端機指令進行。

Expand Down
2 changes: 1 addition & 1 deletion docs/src/pages/zh-TW/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lang: zh-Hant-TW
---

```shell
# 環境需求:檢查 Node.js 版本是 12.20.0+、14.13.1+ 或 16+。
# 環境需求:檢查 Node.js 版本是 14.15.0+ 或 16+。
node --version

# 開新專案資料夾,並且直接移動到該處
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@
"typescript": "4.5.2"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": "^14.15.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/astro-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"astro-scripts": "0.0.1"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0",
"node": "^14.15.0 || >=16.0.0",
"npm": ">=6.14.0"
}
}
2 changes: 1 addition & 1 deletion packages/astro-parser/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "../../tsconfig.base.json",
"include": ["src"],
"compilerOptions": {
"target": "ES2019",
"target": "ES2020",
"module": "CommonJS",
"outDir": "./dist"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/astro-prism/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"prismjs": "^1.23.0"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": "^14.15.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/astro/astro.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function main() {
// it's okay to hard-code the valid Node versions here since they will not change over time.
if (typeof require === 'undefined') {
console.error(`\nNode.js v${version} is not supported by Astro!
Please upgrade to a version of Node.js with complete ESM support: "^12.20.0 || ^14.13.1 || >=16.0.0"\n`);
Please upgrade to a version of Node.js with complete ESM support: "^14.15.0 || >=16.0.0"\n`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required in this PR, but we may now be able to remove supports-esm and most of the logic in this file and just check that process.versions.node > '14.15' instead of each ESM feature individually.

The context is that most of these checks were needed because Node v12 changed from version-to-version, and Node v14 was still actively supported and undergoing changes from version-to-version. Now it should be safe to do the more general > '14.15' check and leave it at that.

}

// Not supported: Report the most helpful error message possible.
Expand Down
2 changes: 1 addition & 1 deletion packages/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"vite": "^2.6.10"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0",
"node": "^14.15.0 || >=16.0.0",
"npm": ">=6.14.0"
}
}
4 changes: 0 additions & 4 deletions packages/astro/test/builtins.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ before(async () => {

describe('Node builtins', () => {
it('Can be used with the node: prefix', async () => {
// node:fs/promise is not supported in Node v12. Test currently throws.
if (process.versions.node <= '13') {
return;
}
const html = await fixture.readFile('/index.html');
const $ = cheerio.load(html);

Expand Down
2 changes: 1 addition & 1 deletion packages/astro/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"declarationDir": "./dist/types",
"module": "ES2020",
"outDir": "./dist",
"target": "ES2019",
"target": "ES2020",
"types": ["vite/client"]
}
}
2 changes: 1 addition & 1 deletion packages/create-astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@
"uvu": "^0.5.1"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": "^14.15.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/create-astro/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"include": ["src", "index.d.ts"],
"compilerOptions": {
"allowJs": true,
"target": "ES2019",
"target": "ES2020",
"module": "ES2020",
"outDir": "./dist",
"declarationDir": "./dist/types"
Expand Down
2 changes: 1 addition & 1 deletion packages/markdown/remark/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"include": ["src"],
"compilerOptions": {
"allowJs": true,
"target": "ES2019",
"target": "ES2020",
"module": "ES2020",
"outDir": "./dist"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/renderers/renderer-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"preact-render-to-string": "^5.1.19"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": "^14.15.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/renderers/renderer-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"react-dom": "^17.0.2"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": "^14.15.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/renderers/renderer-solid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"solid-js": "^1.2.3"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": "^14.15.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/renderers/renderer-svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"svelte-preprocess": "^4.9.8"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": "^14.15.0 || >=16.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/renderers/renderer-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"vue": "^3.2.22"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": "^14.15.0 || >=16.0.0"
}
}
4 changes: 1 addition & 3 deletions scripts/cmd/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ const defaultConfig = {
minify: false,
format: 'esm',
platform: 'node',
// There's an issue with 'node12.20' compiling ESM to CJS
// so use 'node13.2' instead. V8 support should be similar.
target: 'node13.2',
target: 'node14',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me happy!

sourcemap: 'inline',
sourcesContent: false,
};
Expand Down
Loading