]> source.dussan.org Git - jquery.git/commitdiff
Build: Restore the external directory
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>
Wed, 24 Mar 2021 22:36:25 +0000 (23:36 +0100)
committerGitHub <noreply@github.com>
Wed, 24 Mar 2021 22:36:25 +0000 (23:36 +0100)
In gh-4466, we removed the `external` directory in favor of loading some files
directly from `node_modules`. This works fine locally but when deploying code
for tests, this makes it impossible to not deploy `node_modules` as well. To
avoid the issue, this change restores usage of the `external` directory.

One change is that we no longer commit this directory to the repository, its
only purpose is to have clear isolation from `node_modules`.

Ref gh-4466
Closess gh-4865

.eslintignore
.gitignore
.npmignore
Gruntfile.js
package.json
test/index.html
test/karma.debug.html

index 6bc5c48b6f0f8e4d87d5c4637e301f13f439fcbf..e1d456ddfdb5a6620fdd3c8fed65fe71a73c7e74 100644 (file)
@@ -1,4 +1,5 @@
 amd
+external
 node_modules
 *.min.js
 dist/**
index 836cb81c451e2850c93328a81c42492a1dd4ffc9..9cc148904e624582c0c67908c05f1b06336fc881 100644 (file)
@@ -17,7 +17,7 @@ npm-debug.log*
 !/dist/.eslintrc.json
 
 /amd
-
+/external
 /node_modules
 
 /test/data/core/jquery-iterability-transpiled.js
index 4dde6c8cd01e3f78e90c6f20db44e665107f1efd..58ba3ab2bf3cdc8d9e2cc27e1c7fd774a359b197 100644 (file)
@@ -7,6 +7,7 @@
 /.travis.yml
 
 /build
+/external
 /speed
 /test
 /Gruntfile.js
index 5021c59e9e8e082f313d0a8b9f184344285521fd..4afbec9212cc1cd5bd82738ae01eae55b4ab6f4d 100644 (file)
@@ -71,6 +71,25 @@ module.exports = function( grunt ) {
                                }
                        }
                },
+               npmcopy: {
+                       all: {
+                               options: {
+                                       destPrefix: "external"
+                               },
+                               files: {
+                                       "npo/npo.js": "native-promise-only/lib/npo.src.js",
+
+                                       "qunit/qunit.js": "qunit/qunit/qunit.js",
+                                       "qunit/qunit.css": "qunit/qunit/qunit.css",
+                                       "qunit/LICENSE.txt": "qunit/LICENSE.txt",
+
+                                       "requirejs/require.js": "requirejs/require.js",
+
+                                       "sinon/sinon.js": "sinon/pkg/sinon.js",
+                                       "sinon/LICENSE.txt": "sinon/LICENSE"
+                               }
+                       }
+               },
                jsonlint: {
                        pkg: {
                                src: [ "package.json" ]
@@ -162,9 +181,9 @@ module.exports = function( grunt ) {
                                },
                                files: [
                                        "test/data/jquery-1.9.1.js",
-                                       "node_modules/sinon/pkg/sinon.js",
-                                       "node_modules/native-promise-only/lib/npo.src.js",
-                                       "node_modules/requirejs/require.js",
+                                       "external/sinon/sinon.js",
+                                       "external/npo/npo.js",
+                                       "external/requirejs/require.js",
                                        "test/data/testinit.js",
 
                                        "test/jquery.js",
@@ -188,7 +207,7 @@ module.exports = function( grunt ) {
                                                served: true,
                                                nocache: true
                                        },
-                                       { pattern: "node_modules/**", included: false, served: true },
+                                       { pattern: "external/**", included: false, served: true },
                                        {
                                                pattern: "test/**/*.@(js|css|jpg|html|xml|svg)",
                                                included: false,
@@ -343,6 +362,7 @@ module.exports = function( grunt ) {
        ] );
 
        grunt.registerTask( "test:prepare", [
+               "npmcopy",
                "qunit_fixture",
                "babel:tests"
        ] );
index eeac68c93ec08151e92785e2e1ab0939fa9cf3cd..092067e247d453758dc9fe3df088792f8db56da4 100644 (file)
@@ -42,6 +42,7 @@
     "grunt-jsonlint": "2.1.2",
     "grunt-karma": "4.0.0",
     "grunt-newer": "1.3.0",
+    "grunt-npmcopy": "0.2.0",
     "gzip-js": "0.3.2",
     "husky": "4.2.5",
     "insight": "0.10.3",
index 27032f5c57d72e8e41eb07deba022ce137288e83..b3c64aedee2ac51e314a0d4a267f88f265311128 100644 (file)
@@ -3,7 +3,7 @@
 <head>
        <meta charset="utf-8">
        <title>jQuery Test Suite</title>
-       <link rel="stylesheet" href="../node_modules/qunit/qunit/qunit.css" />
+       <link rel="stylesheet" href="../external/qunit/qunit.css" />
        <link rel="stylesheet" href="data/testsuite.css" />
 
        <!--
        -->
        <script src="data/jquery-1.9.1.js"></script>
 
-       <script src="../node_modules/qunit/qunit/qunit.js"></script>
-       <script src="../node_modules/sinon/pkg/sinon.js"></script>
-       <script src="../node_modules/native-promise-only/lib/npo.src.js"></script>
-       <script src="../node_modules/requirejs/require.js"></script>
+       <script src="../external/qunit/qunit.js"></script>
+       <script src="../external/sinon/sinon.js"></script>
+       <script src="../external/npo/npo.js"></script>
+       <script src="../external/requirejs/require.js"></script>
        <!-- See testinit for the list of tests -->
        <script src="data/testinit.js"></script>
 
index 8040ef2cd344afff80b38dd550d54f5fc849b38e..9eb6c9885eb7d3d1f080e323f110b0b4c5333a14 100644 (file)
@@ -5,7 +5,7 @@
        <title>DEBUG</title>
        <meta charset="utf-8">
        <!-- Karma serves this page from /context.html. Other files are served from /base -->
-       <link rel="stylesheet" href="/base/node_modules/qunit/qunit/qunit.css" />
+       <link rel="stylesheet" href="/base/external/qunit/qunit/qunit.css" />
        <link rel="stylesheet" href="/base/test/data/testsuite.css" />
 </head>
 <body id="body">