Skip to content

Commit 639984d

Browse files
committed
build and release project using Node.js 16 and npm 8
- update version of Node.js in .nvmrc to 16 - recommend the use of npm ci to install dependencies - recommend invoking gulp using npx - use npm ci to install dependencies in the release job - upgrade the dependency lock file to version 3 and regenerate - update instructions in README - remove unused GitLab CI config
1 parent 317ebfb commit 639984d

File tree

6 files changed

+11942
-9207
lines changed

6 files changed

+11942
-9207
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,12 @@ jobs:
2121
with:
2222
fetch-depth: 2
2323
- name: Install Node.js
24-
uses: actions/setup-node@v2-beta
24+
uses: actions/setup-node@v2
2525
with:
26-
node-version: '10'
26+
node-version: '16'
2727
- name: Install dependencies
28-
run: npm i
28+
run: npm ci
2929
- name: Tag and release
3030
env:
3131
GITHUB_API_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
32-
run: |
33-
$(npm bin)/gulp release
32+
run: npx gulp release

.gitlab-ci.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
10
1+
16

README.adoc

Lines changed: 20 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ endif::[]
2222
:url-asciidoctor: https://asciidoctor.org
2323
:url-git: https://git-scm.com
2424
:url-git-dl: {url-git}/downloads
25-
:url-gulp: http://gulpjs.com
2625
:url-opendevise: https://opendevise.com
2726
:url-nodejs: https://nodejs.org
2827
:url-nvm: https://github.com/creationix/nvm
@@ -65,8 +64,7 @@ A more comprehensive tutorial can be found in the documentation at {url-antora-d
6564
To preview and bundle the UI, you need the following software on your computer:
6665

6766
* {url-git}[git] (command: `git`)
68-
* {url-nodejs}[Node.js] (commands: `node` and `npm`)
69-
* {url-gulp}[Gulp CLI] (command: `gulp`)
67+
* {url-nodejs}[Node.js] (commands: `node`, `npm`, and `npx`)
7068

7169
==== git
7270

@@ -83,48 +81,25 @@ Next, make sure that you have Node.js installed (which also provides npm).
8381
$ node --version
8482

8583
If this command fails with an error, you don't have Node.js installed.
86-
If the command doesn't report an LTS version of Node.js (e.g., v10.15.3), it means you don't have a suitable version of Node.js installed.
87-
In this guide, we'll be installing Node.js 10.
84+
If the command doesn't report an active LTS version of Node.js (e.g., v16.13.2), it means you don't have a suitable version of Node.js installed.
85+
In this guide, we'll be installing Node.js 16.
8886

8987
While you can install Node.js from the official packages, we strongly recommend that you use {url-nvm}[nvm] (Node Version Manager) to manage your Node.js installation(s).
9088
Follow the {url-nvm-install}[nvm installation instructions] to set up nvm on your machine.
9189

92-
Once you've installed nvm, open a new terminal and install Node.js 10 using the following command:
90+
Once you've installed nvm, open a new terminal and install Node.js 16 using the following command:
9391

94-
$ nvm install 10
92+
$ nvm install 16
9593

9694
You can switch to this version of Node.js at any time using the following command:
9795

98-
$ nvm use 10
96+
$ nvm use 16
9997

100-
To make Node.js 10 the default in new terminals, type:
98+
To make Node.js 16 the default in new terminals, type:
10199

102-
$ nvm alias default 10
100+
$ nvm alias default 16
103101

104-
Now that you have Node.js installed, you can proceed with installing the Gulp CLI.
105-
106-
==== Gulp CLI
107-
108-
You'll need the Gulp command-line interface (CLI) to run the build.
109-
The Gulp CLI package provides the `gulp` command which, in turn, executes the version of Gulp declared by the project.
110-
111-
You can install the Gulp CLI globally (which resolves to a location in your user directory if you're using nvm) using the following command:
112-
113-
$ npm install -g gulp-cli
114-
115-
Verify the Gulp CLI is installed and on your PATH by running:
116-
117-
$ gulp --version
118-
119-
If you prefer to install global packages using Yarn, run this command instead:
120-
121-
$ yarn global add gulp-cli
122-
123-
Alternately, you can use the `gulp` command that is installed by the project's dependencies.
124-
125-
$ $(npm bin)/gulp --version
126-
127-
Now that you have the prerequisites installed, you can fetch and build the UI project.
102+
Now that you have Node.js installed, you can proceed with cloning and initializing the project.
128103

129104
=== Clone and Initialize the UI Project
130105

@@ -140,7 +115,7 @@ Stay in this project folder when executing all subsequent commands.
140115
Use npm to install the project's dependencies inside the project.
141116
In your terminal, execute the following command:
142117

143-
$ npm install
118+
$ npm ci
144119

145120
This command installs the dependencies listed in [.path]_package.json_ into the [.path]_node_modules/_ folder inside the project.
146121
This folder does not get included in the UI bundle and should _not_ be committed to the source control repository.
@@ -154,15 +129,15 @@ These pages provide a representative sample and kitchen sink of content from the
154129

155130
To build the UI and preview it in a local web server, run the `preview` command:
156131

157-
$ gulp preview
132+
$ npx gulp preview
158133

159134
[TIP]
160135
====
161136
Alternatively, you can use the following command:
162137
163138
$ npm start
164139
165-
In fact, if you use `npm start`, you don't need to have the Gulp CLI installed.
140+
When using `npm start`, you don't have to prefix the `npm` command with `npx`.
166141
====
167142

168143
You'll see a URL listed in the output of this command:
@@ -184,7 +159,7 @@ Press kbd:[Ctrl+C] to stop the preview server and end the continuous build.
184159

185160
If you need to package the UI so you can use it to generate the documentation site locally, run the following command:
186161

187-
$ gulp bundle
162+
$ npx gulp bundle
188163

189164
If any errors are reported by lint, you'll need to fix them.
190165

@@ -193,7 +168,7 @@ You can point Antora at this bundle using the `--ui-bundle-url` command-line opt
193168

194169
If you have the preview running, and you want to bundle without causing the preview to be clobbered, use:
195170

196-
$ gulp bundle:pack
171+
$ npx gulp bundle:pack
197172

198173
The UI bundle will again be available at [.path]_build/ui-bundle.zip_.
199174

@@ -209,7 +184,7 @@ The mapping they provide allows the debugger to present the original source rath
209184
In preview mode, source maps are enabled automatically, so there's nothing you have to do to make use of them.
210185
If you need to include source maps in the bundle, you can do so by setting the `SOURCEMAPS` environment varible to `true` when you run the bundle command:
211186

212-
$ SOURCEMAPS=true gulp bundle
187+
$ SOURCEMAPS=true npx gulp bundle
213188

214189
In this case, the bundle will include the source maps, which can be used for debuggging your production site.
215190

@@ -242,7 +217,7 @@ The temporary preview URL will automatically be decommissioned once the PR is cl
242217

243218
== Releases
244219

245-
Releases are handled by the `gulp release` task, which is automated by a CI job.
220+
Releases are handled by the `npx gulp release` task, which is automated by a CI job.
246221
The release process boils down to the following steps:
247222

248223
. Pack the UI bundle.
@@ -252,12 +227,12 @@ The release process boils down to the following steps:
252227
. Update the README to reference the URL of the lastest bundle and commit that update to the repository.
253228

254229
Fortunately, you don't have to do any of these steps yourself.
255-
These steps are fully automated by the `gulp release` task.
230+
These steps are fully automated by the `npx gulp release` task.
256231
In fact, you don't even have to run this task.
257-
Whenever a commit is pushed to the master branch of the repository, it triggers the CI job on master, which executes the `gulp release` task using pre-configured credentials.
232+
Whenever a commit is pushed to the master branch of the repository, it triggers the CI job on master, which executes the `npx gulp release` task using pre-configured credentials.
258233

259234
IMPORTANT: A release will only be made if the project validates (i.e., all lint tasks pass).
260-
To validate the project, run `gulp lint` before pushing your changes to GitHub.
235+
To validate the project, run `npx gulp lint` before pushing your changes to GitHub.
261236

262237
The CI job is already configured, so there's nothing you need to do to make automated release work.
263238
All you have to do is commit your changes and push those commits to the master branch of the git repository.
@@ -281,7 +256,7 @@ No other scopes are required (as long as the asciidoctor-docbot user has write a
281256
=== CI Job
282257

283258
The {url-ci}[CI job] is executed by GitHub Actions and is defined in the file [.path]_.github/workflows/release.yml_.
284-
It boils down to running the `gulp release` task on the main branch.
259+
It boils down to running the `npx gulp release` task on the main branch.
285260
The GITHUB_API_TOKEN environment variable is defined in the job configuration.
286261

287262
Once the CI job runs and a new UI bundle is available, you can update the URL of the UI bundle in the Antora playbook file.

0 commit comments

Comments
 (0)