Skip to content

Commit e865fdf

Browse files
authored
Build: Update dependencies, keep legacy jQueries in the repository
Apart from updating npm dependencies, we now keep legacy jQuery versions - ones that were not published to npm - directly in the `external-legacy-source` folder instead of installing GitHub repositories as npm packages. The `external` directory is no longer kept in the repository; it's generated on the fly instead. Closes gh-134
1 parent a4cb015 commit e865fdf

File tree

42 files changed

+55
-132755
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+55
-132755
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
dist/**
22
external/**
3+
external-legacy-source/**
34
node_modules/**

.github/workflows/node.js.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
# Node.js 10 is required by jQuery infra
12-
NODE_VERSION: [10.x, 16.x]
12+
NODE_VERSION: [10.x, 18.x]
1313
NPM_SCRIPT: ["ci"]
1414
include:
1515
- NAME: "Browser tests"
16-
NODE_VERSION: "16.x"
16+
NODE_VERSION: "18.x"
1717
NPM_SCRIPT: "browserstack"
1818
steps:
1919
- name: Checkout

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.sizecache.json
22
/dist
3+
/external
34
/node_modules
45
/package-lock.json
56
/*.log

Gruntfile.js

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ minify.svg.files[ min[ 1 ] ] = [ max[ 1 ] ];
4141
minify.combined.files[ min[ 2 ] ] = [ combined ];
4242
concat[ combined ] = [ max[ 0 ], max[ 1 ] ];
4343

44+
const oldNode = /^v10\./.test( process.version );
45+
46+
// Support: Node.js <12
47+
// Skip running tasks that dropped support for Node.js 10
48+
// in this Node version.
49+
function runIfNewNode( task ) {
50+
return oldNode ? "print_old_node_message:" + task : task;
51+
}
52+
4453
require( "load-grunt-tasks" )( grunt );
4554

4655
grunt.initConfig( {
@@ -54,7 +63,7 @@ grunt.initConfig( {
5463
"jquery-color": [
5564
"3.x-git",
5665
"3.x-git.min",
57-
"3.6.0",
66+
"3.6.1",
5867
"3.5.1",
5968
"3.4.1",
6069
"3.3.1",
@@ -73,15 +82,17 @@ grunt.initConfig( {
7382
},
7483

7584
npmcopy: {
76-
all: {
85+
options: {
86+
destPrefix: "external"
87+
},
88+
legacy: {
7789
options: {
78-
destPrefix: "external"
90+
91+
// jQuery `<1.11` and `>=2 <2.1` wasn't published on npm, so
92+
// we maintain their copies directly in the repository.
93+
srcPrefix: "external-legacy-source"
7994
},
8095
files: {
81-
"qunit/qunit.js": "qunit/qunit/qunit.js",
82-
"qunit/qunit.css": "qunit/qunit/qunit.css",
83-
"qunit/LICENSE.txt": "qunit/LICENSE.txt",
84-
8596
"jquery-1.8.3/jquery.js": "jquery-1.8.3/jquery.js",
8697
"jquery-1.8.3/MIT-LICENSE.txt": "jquery-1.8.3/MIT-LICENSE.txt",
8798

@@ -91,15 +102,22 @@ grunt.initConfig( {
91102
"jquery-1.10.2/jquery.js": "jquery-1.10.2/jquery.js",
92103
"jquery-1.10.2/MIT-LICENSE.txt": "jquery-1.10.2/MIT-LICENSE.txt",
93104

105+
"jquery-2.0.3/jquery.js": "jquery-2.0.3/jquery.js",
106+
"jquery-2.0.3/MIT-LICENSE.txt": "jquery-2.0.3/MIT-LICENSE.txt"
107+
}
108+
},
109+
modern: {
110+
files: {
111+
"qunit/qunit.js": "qunit/qunit/qunit.js",
112+
"qunit/qunit.css": "qunit/qunit/qunit.css",
113+
"qunit/LICENSE.txt": "qunit/LICENSE.txt",
114+
94115
"jquery-1.11.3/jquery.js": "jquery-1.11.3/dist/jquery.js",
95116
"jquery-1.11.3/MIT-LICENSE.txt": "jquery-1.11.3/MIT-LICENSE.txt",
96117

97118
"jquery-1.12.4/jquery.js": "jquery-1.12.4/dist/jquery.js",
98119
"jquery-1.12.4/LICENSE.txt": "jquery-1.12.4/LICENSE.txt",
99120

100-
"jquery-2.0.3/jquery.js": "jquery-2.0.3/jquery.js",
101-
"jquery-2.0.3/MIT-LICENSE.txt": "jquery-2.0.3/MIT-LICENSE.txt",
102-
103121
"jquery-2.1.4/jquery.js": "jquery-2.1.4/dist/jquery.js",
104122
"jquery-2.1.4/MIT-LICENSE.txt": "jquery-2.1.4/MIT-LICENSE.txt",
105123

@@ -124,8 +142,8 @@ grunt.initConfig( {
124142
"jquery-3.5.1/jquery.js": "jquery-3.5.1/dist/jquery.js",
125143
"jquery-3.5.1/LICENSE.txt": "jquery-3.5.1/LICENSE.txt",
126144

127-
"jquery-3.6.0/jquery.js": "jquery-3.6.0/dist/jquery.js",
128-
"jquery-3.6.0/LICENSE.txt": "jquery-3.6.0/LICENSE.txt",
145+
"jquery-3.6.1/jquery.js": "jquery-3.6.1/dist/jquery.js",
146+
"jquery-3.6.1/LICENSE.txt": "jquery-3.6.1/LICENSE.txt",
129147

130148
"jquery/jquery.js": "jquery/dist/jquery.js",
131149
"jquery/LICENSE.txt": "jquery/LICENSE.txt"
@@ -306,15 +324,20 @@ grunt.registerTask( "print_no_browserstack_legacy_message", () => {
306324
"tests on legacy browsers skipped..." );
307325
} );
308326

327+
grunt.registerTask( "print_old_node_message", ( ...args ) => {
328+
const task = args.join( ":" );
329+
grunt.log.writeln( "Old Node.js detected, running the task \"" + task + "\" skipped..." );
330+
} );
331+
309332
grunt.registerTask( "default", [
310-
"eslint",
333+
runIfNewNode( "eslint" ),
311334
"npmcopy",
312335
"qunit",
313336
"build",
314337
"compare_size"
315338
] );
316339
grunt.registerTask( "build", [ "max", "concat", "uglify" ] );
317-
grunt.registerTask( "ci", [ "eslint", "qunit" ] );
340+
grunt.registerTask( "ci", [ "default" ] );
318341
grunt.registerTask( "karma-browserstack-current", [
319342
"build",
320343
isBrowserStack ? "karma:browserstack-current" : "karma:local"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ div {
8181
border: 1px solid green;
8282
}
8383
</style>
84-
<script src="http://code.jquery.com/jquery-3.6.0.min.js"></script>
84+
<script src="http://code.jquery.com/jquery-3.6.1.min.js"></script>
8585
<script src="jquery.color.min.js"></script>
8686
</head>
8787
<body>
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)