Build: Drop support for Node 10

Ref gh-2249
This commit is contained in:
Michał Gołębiowski-Owczarek 2024-05-12 01:29:44 +02:00
parent fb19b03dc6
commit 99250fe517
No known key found for this signature in database
2 changed files with 3 additions and 46 deletions

View File

@ -133,31 +133,3 @@ jobs:
- name: Test - name: Test
run: npm run test:unit -- -b safari --jquery ${{ matrix.JQUERY }} --retries 3 run: npm run test:unit -- -b safari --jquery ${{ matrix.JQUERY }} --retries 3
legacy-build:
runs-on: ubuntu-latest
name: Build on Node 10.x
env:
NODE_VERSION: 10.x
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
- name: Install npm dependencies
run: npm install
- name: Build
run: npm run build

View File

@ -84,15 +84,6 @@ const htmllintBad = [
"tests/unit/tabs/data/test.html" "tests/unit/tabs/data/test.html"
]; ];
const nodeV16OrNewer = !/^v1[0-5]\./.test( process.version );
// Support: Node.js <16
// Skip running tasks that dropped support for Node.js 10-15
// in this Node version.
function runIfNewNode( task ) {
return nodeV16OrNewer ? task : "print_old_node_message:" + task;
}
function mapMinFile( file ) { function mapMinFile( file ) {
return "dist/" + file.replace( /ui\//, "minified/" ); return "dist/" + file.replace( /ui\//, "minified/" );
} }
@ -357,13 +348,7 @@ grunt.initConfig( {
} ); } );
// grunt plugins // grunt plugins
require( "load-grunt-tasks" )( grunt, { require( "load-grunt-tasks" )( grunt );
pattern: nodeV16OrNewer ? [ "grunt-*" ] : [
"grunt-*",
"!grunt-eslint",
"!grunt-html"
]
} );
// local tasks // local tasks
grunt.loadTasks( "build/tasks" ); grunt.loadTasks( "build/tasks" );
@ -406,9 +391,9 @@ grunt.registerTask( "print_old_node_message", ( ...args ) => {
// Keep this task list in sync with the testing steps in our GitHub action test workflow file! // Keep this task list in sync with the testing steps in our GitHub action test workflow file!
grunt.registerTask( "lint", [ grunt.registerTask( "lint", [
"asciilint", "asciilint",
runIfNewNode( "eslint" ), "eslint",
"csslint", "csslint",
runIfNewNode( "htmllint" ) "htmllint"
] ); ] );
grunt.registerTask( "build", [ "requirejs", "concat" ] ); grunt.registerTask( "build", [ "requirejs", "concat" ] );
grunt.registerTask( "default", [ "lint", "build" ] ); grunt.registerTask( "default", [ "lint", "build" ] );