Skip to content

Commit fb558ae

Browse files
committed
Build: replace grunt tasks with npm scripts
Includes: - **lint**: lint all code using new eslint flat config - **build**: build using rollup, minify using uglify, process for dist - **npmcopy**: copy some node module files to the external folder - **start**: watch source files and rebuild on changes using rollup.watch Also: - Update the build function in the release script to use the new build - Update CONTRIBUTING.md and README.md with new scripts - Confirm the min file was identical to the main branch build, aside from the version update. - Keep uglify-js at 3.9.4, which is the last version that officially supported the ie8 argument, which we need for ie9 - update browserstack project name to jquery-migrate - run browserstack at least once a week Closes gh-512
1 parent 3f7103e commit fb558ae

39 files changed

+1193
-2307
lines changed

.eslintignore

-6
This file was deleted.

.eslintrc-browser.json

-32
This file was deleted.

.eslintrc-node.json

-18
This file was deleted.

.eslintrc.json

-14
This file was deleted.

.github/workflows/browserstack-3.x.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- main
7+
# Once a week every Tuesday
8+
schedule:
9+
- cron: "12 2 * * 2"
710

811
jobs:
912
test:
@@ -70,8 +73,8 @@ jobs:
7073
- name: Install dependencies
7174
run: npm install
7275

73-
- name: Build
74-
run: npm run build
76+
- name: Pretest script
77+
run: npm run pretest
7578

7679
- name: Test
7780
run: |

.github/workflows/browserstack-git.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
push:
55
branches:
66
- main
7+
# Once a week every Tuesday
8+
schedule:
9+
- cron: "42 1 * * 2"
710

811
jobs:
912
test:
@@ -55,8 +58,8 @@ jobs:
5558
- name: Install dependencies
5659
run: npm install
5760

58-
- name: Build
59-
run: npm run build
61+
- name: Pretest script
62+
run: npm run pretest
6063

6164
- name: Test
6265
run: |

.gitignore

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,9 @@ CDN
88
/*.html
99
.DS_Store
1010
.sizecache.json
11+
.eslintcache
1112

12-
# Ignore everything in dist folder except for eslint config
13-
/dist/*
14-
!/dist/.eslintrc.json
15-
13+
/dist
1614
/external
1715
/node_modules
1816

CONTRIBUTING.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,8 @@ See: [jQuery Core Style Guide](http://docs.jquery.com/JQuery_Core_Style_Guidelin
6868

6969
To test the plugin you will need:
7070

71-
* Some kind of localhost server(any will do)
7271
* Node.js
7372
* NPM (comes with the latest version of Node.js)
74-
* Grunt (install with: `npm install grunt -g`)
75-
7673

7774
### Build a Local Copy of the plugin
7875

@@ -108,13 +105,19 @@ Get in the habit of pulling in the "upstream" `main` branch to stay up to date a
108105
$ git pull upstream main
109106
```
110107

111-
Run the Grunt tools:
108+
Run the build and rebuild when source files change:
109+
110+
```bash
111+
$ npm start
112+
```
113+
114+
In another terminal, run the test server:
112115

113116
```bash
114-
$ grunt && grunt watch
117+
$ npm run test:server
115118
```
116119

117-
Now open the jQuery test suite in a browser at http://localhost/test. If there is a port, be sure to include it.
120+
Now open the jQuery test suite in a browser at http://localhost:3000/test/.
118121

119122
Success! You just built and tested jQuery!
120123

Gruntfile.js

-155
This file was deleted.

README.md

+4-11
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,12 @@ Build and run tests:
8989
====================================================
9090

9191
## Build with `npm` commands
92-
```sh
93-
$ git clone git://github.com/jquery/jquery-migrate.git
94-
$ cd jquery-migrate
95-
$ npm install
96-
$ npm run build
97-
```
98-
99-
## Build with [`grunt`](http://gruntjs.com/)
10092

10193
```sh
10294
$ git clone git://github.com/jquery/jquery-migrate.git
10395
$ cd jquery-migrate
10496
$ npm install
105-
$ npm install -g grunt-cli
106-
$ grunt build
97+
$ npm run build
10798
```
10899

109100
### Run tests
@@ -115,5 +106,7 @@ $ npm test
115106
### Or
116107

117108
```sh
118-
$ grunt test
109+
$ npm run test:server
119110
```
111+
112+
and open http://localhost:3000/test/ in your browser.

0 commit comments

Comments
 (0)