From 7825856c747add7cee71a0858174d62247e93402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 11 Jul 2024 00:33:56 +0200 Subject: [PATCH] Release: Fix the release script PR gh-503 erroneously removed the `enquirer` dependency, required for the release process. Restore it. In addition, update built-in module imports to use the `node:` prefix and add a missing "utf8" value in one `fs.readFileSync`. Ref gh-503 --- build/release.js | 8 ++++---- package-lock.json | 23 +++++++++++++++++++++++ package.json | 1 + 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/build/release.js b/build/release.js index 5743c59..88a2f75 100644 --- a/build/release.js +++ b/build/release.js @@ -7,9 +7,9 @@ var dryrun = false, skipRemote = false; -import fs from "fs"; -import child from "child_process"; -import path from "path"; +import fs from "node:fs"; +import child from "node:child_process"; +import path from "node:path"; import chalk from "chalk"; import enquirer from "enquirer"; import { build } from "./tasks/build"; @@ -98,7 +98,7 @@ function initialize( next ) { if ( !( fs.existsSync || path.existsSync )( packageFile ) ) { die( "No " + packageFile + " in this directory" ); } - pkg = JSON.parse( fs.readFileSync( packageFile ) ); + pkg = JSON.parse( fs.readFileSync( packageFile, "utf8" ) ); status( "Current version is " + pkg.version + "; generating release " + releaseVersion ); version = rsemver.exec( pkg.version ); diff --git a/package-lock.json b/package-lock.json index 5c8d63d..be318c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "chalk": "5.3.0", "commitplease": "3.2.0", "diff": "5.2.0", + "enquirer": "2.4.1", "eslint": "8.57.0", "eslint-config-jquery": "3.0.2", "eslint-plugin-import": "2.29.1", @@ -645,6 +646,15 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1253,6 +1263,19 @@ "node": ">= 0.8" } }, + "node_modules/enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/es-abstract": { "version": "1.23.3", "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.3.tgz", diff --git a/package.json b/package.json index 167edd2..22626ba 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,7 @@ "chalk": "5.3.0", "commitplease": "3.2.0", "diff": "5.2.0", + "enquirer": "2.4.1", "eslint": "8.57.0", "eslint-config-jquery": "3.0.2", "eslint-plugin-import": "2.29.1",