8000 Drop support for Node 10 by timmywil · Pull Request #5436 · jquery/jquery · GitHub
[go: up one dir, main page]

Skip to content

Drop support for Node 10 #5436

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

Merged
merged 2 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ jobs:
- NAME: "Firefox ESR"
NODE_VERSION: "20.x"
NPM_SCRIPT: "test:firefox"
- NAME: "Node 10 Build"
NODE_VERSION: "10.x"
NPM_SCRIPT: "build:main"
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
18 changes: 9 additions & 9 deletions build/tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

"use strict";

const fs = require( "fs" );
const path = require( "path" );
const util = require( "util" );
const exec = util.promisify( require( "child_process" ).exec );
const fs = require( "node:fs/promises" );
Copy link
Member

Choose a reason for hiding this comment

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

Not for this PR but maybe we could eventually make all our Node build files ESM instead of CommonJS?

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe that's something I could tackle in the release PR.

const path = require( "node:path" );
const util = require( "node:util" );
const exec = util.promisify( require( "node:child_process" ).exec );
const rollup = require( "rollup" );
const excludedFromSlim = require( "./lib/slim-exclude" );
const rollupFileOverrides = require( "./lib/rollup-plugin-file-overrides" );
Expand Down Expand Up @@ -38,7 +38,7 @@ const removeWith = {
};

async function read( filename ) {
return fs.promises.readFile( path.join( srcFolder, filename ), "utf8" );
return fs.readFile( path.join( srcFolder, filename ), "utf8" );
}

// Remove the src folder and file extension
Expand All @@ -54,7 +54,7 @@ function moduleName( filename ) {
async function readdirRecursive( dir, all = [] ) {
let files;
try {
files = await fs.promises.readdir( path.join( srcFolder, dir ), {
files = await fs.readdir( path.join( srcFolder, dir ), {
withFileTypes: true
} );
} catch ( e ) {
Expand Down Expand Up @@ -151,7 +151,7 @@ async function writeCompiled( { code, dir, filename, version } ) {
// yyyy-mm-ddThh:mmZ
.replace( /@DATE/g, new Date().toISOString().replace( /:\d+\.\d+Z$/, "Z" ) );

await fs.promises.writeFile( path.join( dir, filename ), compiledContents );
await fs.writeFile( path.join( dir, filename ), compiledContents );
console.log( `[${ getTimestamp() }] ${ filename } v${ version } created.` );
}

Expand Down Expand Up @@ -194,7 +194,7 @@ async function build( {
version += "+slim";
}

await fs.promises.mkdir( dir, { recursive: true } );
await fs.mkdir( dir, { recursive: true } );

// Exclude slim modules when slim is true
const [ excluded, included ] = await checkExclude(
Expand Down Expand Up @@ -343,7 +343,7 @@ async function build( {
// We normally process for dist during minification to save
// file reads. However, some files are not minified and then
// we need to do it separately.
const contents = await fs.promises.readFile(
const contents = await fs.readFile(
path.join( dir, filename ),
"utf8"
);
Expand Down
Loading
0