Skip to content

Commit e805f29

Browse files
committed
Update README
1 parent 3ea8a87 commit e805f29

File tree

4 files changed

+38
-37
lines changed

4 files changed

+38
-37
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Version 5.x *(unreleased)*
44

5-
## Version 5.0.0 *(unreleased)*
5+
## Version 5.0.0 *(2023-05-13)*
66
* Support configuration-cache on Gradle 8.1 [#271](https://github.com/node-gradle/gradle-node-plugin/issues/271)
77
* Store node directories on NodeExtension
88
* Deprecate parts of PlatformHelper that require executing commands during configuration

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
![Build Status](https://github.com/node-gradle/gradle-node-plugin/workflows/Build/badge.svg?branch=master)
66
[![License](https://img.shields.io/github/license/node-gradle/gradle-node-plugin.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
7-
![Version](https://img.shields.io/badge/Version-4.0.0-orange.svg)
7+
![Version](https://img.shields.io/badge/Version-5.0.0-orange.svg)
88

99
This plugin enables you to use a lot of [Node.js](https://nodejs.org)-based technologies as part of your
1010
build without having Node.js installed locally on your system. It integrates the following Node.js-based system
@@ -39,7 +39,8 @@ issue to [GitHub Issues](https://github.com/node-gradle/gradle-node-plugin/issue
3939

4040
Here's the documentation for older releases of the plugin:
4141

42-
* [4.0.0](https://github.com/node-gradle/gradle-node-plugin/blob/4.0.0/README.md) (current)
42+
* [5.0.0](https://github.com/node-gradle/gradle-node-plugin/blob/5.0.0/README.md) (current)
43+
* [4.0.0](https://github.com/node-gradle/gradle-node-plugin/blob/4.0.0/README.md)
4344
* [3.6.0](https://github.com/node-gradle/gradle-node-plugin/blob/3.6.0/README.md)
4445
* [3.5.1](https://github.com/node-gradle/gradle-node-plugin/blob/3.5.1/README.md)
4546
* [3.5.0](https://github.com/node-gradle/gradle-node-plugin/blob/3.5.0/README.md)

docs/installation.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Installation
22

3-
Installing the node-related plugins can be done in multiple ways. The easiest is to use the `plugins`-closure
3+
Installing the node-related plugins can be done in multiple ways. The easiest is to use the `plugins`-closure
44
in your `build.gradle` file:
55

66
```gradle
77
plugins {
8-
id "com.github.node-gradle.node" version "4.0.0"
8+
id "com.github.node-gradle.node" version "5.0.0"
99
}
1010
```
1111

@@ -18,7 +18,7 @@ buildscript {
1818
}
1919
2020
dependencies {
21-
classpath "com.github.node-gradle:gradle-node-plugin:4.0.0"
21+
classpath "com.github.node-gradle:gradle-node-plugin:5.0.0"
2222
}
2323
}
2424

docs/usage.md

+31-31
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ It is also able to install [Yarn](https://yarnpkg.com/) by downloading it from a
1212

1313
The version of each tool to use can be specified in the configuration.
1414

15-
To start using the plugin, add this into your `build.gradle`
15+
To start using the plugin, add this into your `build.gradle`
1616
file (see [Installing](installation.md) for details):
1717

1818

1919
```gradle
2020
plugins {
21-
id "com.github.node-gradle.node" version "4.0.0"
21+
id "com.github.node-gradle.node" version "5.0.0"
2222
}
2323
```
2424

2525
## Running a Node.js Script
2626

27-
To use this plugin you have to define some tasks in your `build.gradle` file. If you have a Node.js
27+
To use this plugin you have to define some tasks in your `build.gradle` file. If you have a Node.js
2828
script in `src/scripts/my.js`, then you can execute this by defining the following Gradle task:
2929

3030
```gradle
@@ -51,14 +51,14 @@ task myScript(type: NodeTask) {
5151
}
5252
```
5353

54-
When executing this task for the first time, it will run a `nodeSetup` task that downloads Node.js
55-
(for your platform) and NPM (Node Package Manager) if on Windows (other platforms include
54+
When executing this task for the first time, it will run a `nodeSetup` task that downloads Node.js
55+
(for your platform) and NPM (Node Package Manager) if on Windows (other platforms include
5656
it into the distribution).
5757

5858
## Executing `npm` Tasks
5959

60-
When adding the node plugin, you will have a `npmInstall` task already added. This task will
61-
execute `npm install` and installs all dependencies in `package.json`. It will only run when changes
60+
When adding the node plugin, you will have a `npmInstall` task already added. This task will
61+
execute `npm install` and installs all dependencies in `package.json`. It will only run when changes
6262
are made to `package.json`, `npm-shrinkwrap.json`, `package-lock.json` or `node_modules`. Execute it like this:
6363

6464
```bash
@@ -77,7 +77,7 @@ $ gradle npm_cache_clean
7777
...
7878
```
7979

80-
These however are not shown when running gradle tasks, as they generated dynamically. However they can
80+
These however are not shown when running gradle tasks, as they generated dynamically. However they can
8181
be used for dependency declarations, such as:
8282

8383
```gradle
@@ -104,19 +104,19 @@ task installExpress(type: NpmTask) {
104104
## Executing `npm` Commands via `npx`
105105

106106
[As of 5.2](https://blog.npmjs.org/post/162869356040/introducing-npx-an-npm-package-runner),
107-
`npm` is bundled with a new command called [`npx`](https://www.npmjs.com/package/npx) which is aimed at running CLI
108-
commands from NPM packages.
107+
`npm` is bundled with a new command called [`npx`](https://www.npmjs.com/package/npx) which is aimed at running CLI
108+
commands from NPM packages.
109109

110-
It enables to execute `npm` commands without needing to declare them as a `script` in the `package.json` file and run
110+
It enables to execute `npm` commands without needing to declare them as a `script` in the `package.json` file and run
111111
thanks to the `npm run` command.
112112

113-
It does not require the command to be locally or globally installed. If the command is not already installed, the
113+
It does not require the command to be locally or globally installed. If the command is not already installed, the
114114
corresponding package is installed then the command is run. In this case, it is necessary to indicate the package
115115
name instead of the command name.
116-
117-
The `NpxTask` is able to execute some `npx` commands. It depends on the `npmSetup` to ensure `npx` is available.
118116

119-
To generate a new Angular project with the `ng` command coming from `@angular/cli` which is not installed
117+
The `NpxTask` is able to execute some `npx` commands. It depends on the `npmSetup` to ensure `npx` is available.
118+
119+
To generate a new Angular project with the `ng` command coming from `@angular/cli` which is not installed
120120
(note that we can specify the version):
121121

122122
```gradle
@@ -142,8 +142,8 @@ task buildAngularApp(type: NpxTask) {
142142

143143
## Executing Yarn Tasks
144144

145-
When adding the node plugin, you will have a yarn task already added. This task will
146-
execute `yarn` and installs all dependencies in `package.json`. It will only run when changes
145+
When adding the node plugin, you will have a yarn task already added. This task will
146+
execute `yarn` and installs all dependencies in `package.json`. It will only run when changes
147147
are made to `package.json`, `yarn.lock`, or `node_modules`. Execute it like this:
148148

149149
```bash
@@ -160,7 +160,7 @@ $ gradle yarn_cache_clean
160160
...
161161
```
162162

163-
These however are not shown when running gradle tasks, as they generated dynamically. However they can be
163+
These however are not shown when running gradle tasks, as they generated dynamically. However they can be
164164
used for dependency declarations, such as:
165165

166166
```gradle
@@ -191,7 +191,7 @@ You can configure the plugin through the `node` extension.
191191
Here is the list of all available configuration properties using the Groovy DSL.
192192
See [here](../src/test/resources/fixtures/kotlin/build.gradle.kts) to see a Kotlin DSL example.
193193

194-
The values shown here are the default ones. We recommend to define only the ones for which the
194+
The values shown here are the default ones. We recommend to define only the ones for which the
195195
default value is not satisfying.
196196

197197
```gradle
@@ -201,51 +201,51 @@ node {
201201
// If true, it will download node using above parameters
202202
// Note that npm is bundled with Node.js
203203
download = false
204-
204+
205205
// Version of node to download and install (only used if download is true)
206206
// It will be unpacked in the workDir
207207
version = "16.14.0"
208-
208+
209209
// Version of npm to use
210210
// If specified, installs it in the npmWorkDir
211211
// If empty, the plugin will use the npm command bundled with Node.js
212212
npmVersion = ""
213-
213+
214214
// Version of Yarn to use
215215
// Any Yarn task first installs Yarn in the yarnWorkDir
216216
// It uses the specified version if defined and the latest version otherwise (by default)
217217
yarnVersion = ""
218-
218+
219219
// Base URL for fetching node distributions
220220
// Only used if download is true
221221
// Change it if you want to use a mirror
222222
// Or set to null if you want to add the repository on your own.
223223
distBaseUrl = "https://nodejs.org/dist"
224-
224+
225225
// Specifies whether it is acceptable to communicate with the Node.js repository over an insecure HTTP connection.
226226
// Only used if download is true
227227
// Change it to true if you use a mirror that uses HTTP rather than HTTPS
228228
// Or set to null if you want to use Gradle's default behaviour.
229229
allowInsecureProtocol = null
230-
230+
231231
// The npm command executed by the npmInstall task
232232
// By default it is install but it can be changed to ci
233233
npmInstallCommand = "install"
234-
235-
// The directory where Node.js is unpacked (when download is true)
234+
235+
// The directory where Node.js is unpacked (when download is true)
236236
workDir = file("${project.projectDir}/.gradle/nodejs")
237-
237+
238238
// The directory where npm is installed (when a specific version is defined)
239239
npmWorkDir = file("${project.projectDir}/.gradle/npm")
240-
240+
241241
// The directory where yarn is installed (when a Yarn task is used)
242242
yarnWorkDir = file("${project.projectDir}/.gradle/yarn")
243-
243+
244244
// The Node.js project directory location
245245
// This is where the package.json file and node_modules directory are located
246246
// By default it is at the root of the current project
247247
nodeProjectDir = file("${project.projectDir}")
248-
248+
249249
// Whether the plugin automatically should add the proxy configuration to npm and yarn commands
250250
// according the proxy configuration defined for Gradle
251251
// Disable this option if you want to configure the proxy for npm or yarn on your own

0 commit comments

Comments
 (0)