🌐 AI搜索 & 代理 主页
Skip to content

Commit 1a42d10

Browse files
committed
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.
1 parent a4cb015 commit 1a42d10

File tree

17 files changed

+41085
-2885
lines changed

17 files changed

+41085
-2885
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ 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"

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>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright 2013 jQuery Foundation and other contributors
2+
http://jquery.com/
3+
4+
Permission is hereby granted, free of charge, to any person obtaining
5+
a copy of this software and associated documentation files (the
6+
"Software"), to deal in the Software without restriction, including
7+
without limitation the rights to use, copy, modify, merge, publish,
8+
distribute, sublicense, and/or sell copies of the Software, and to
9+
permit persons to whom the Software is furnished to do so, subject to
10+
the following conditions:
11+
12+
The above copyright notice and this permission notice shall be
13+
included in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)