Skip to content

Commit

Permalink
Build: replace grunt tasks with npm scripts
Browse files Browse the repository at this point in the history
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
  • Loading branch information
timmywil authored Jun 10, 2024
1 parent 3f7103e commit 6e7127e
Show file tree
Hide file tree
Showing 39 changed files with 1,022 additions and 2,212 deletions.
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

32 changes: 0 additions & 32 deletions .eslintrc-browser.json

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc-node.json

This file was deleted.

14 changes: 0 additions & 14 deletions .eslintrc.json

This file was deleted.

7 changes: 5 additions & 2 deletions .github/workflows/browserstack-3.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
# Once a week every Tuesday
schedule:
- cron: "12 2 * * 2"

jobs:
test:
Expand Down Expand Up @@ -70,8 +73,8 @@ jobs:
- name: Install dependencies
run: npm install

- name: Build
run: npm run build
- name: Pretest script
run: npm run pretest

- name: Test
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/browserstack-git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- main
# Once a week every Tuesday
schedule:
- cron: "42 1 * * 2"

jobs:
test:
Expand Down Expand Up @@ -55,8 +58,8 @@ jobs:
- name: Install dependencies
run: npm install

- name: Build
run: npm run build
- name: Pretest script
run: npm run pretest

- name: Test
run: |
Expand Down
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ CDN
/*.html
.DS_Store
.sizecache.json
.eslintcache

# Ignore everything in dist folder except for eslint config
/dist/*
!/dist/.eslintrc.json

/dist
/external
/node_modules

Expand Down
15 changes: 9 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,8 @@ See: [jQuery Core Style Guide](http://docs.jquery.com/JQuery_Core_Style_Guidelin

To test the plugin you will need:

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


### Build a Local Copy of the plugin

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

Run the Grunt tools:
Run the build and rebuild when source files change:

```bash
$ npm start
```

In another terminal, run the test server:

```bash
$ grunt && grunt watch
$ npm run test:server
```

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

Success! You just built and tested jQuery!

Expand Down
155 changes: 0 additions & 155 deletions Gruntfile.js

This file was deleted.

15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,12 @@ Build and run tests:
====================================================

## Build with `npm` commands
```sh
$ git clone git://github.com/jquery/jquery-migrate.git
$ cd jquery-migrate
$ npm install
$ npm run build
```

## Build with [`grunt`](http://gruntjs.com/)

```sh
$ git clone git://github.com/jquery/jquery-migrate.git
$ cd jquery-migrate
$ npm install
$ npm install -g grunt-cli
$ grunt build
$ npm run build
```

### Run tests
Expand All @@ -115,5 +106,7 @@ $ npm test
### Or

```sh
$ grunt test
$ npm run test:server
```

and open http://localhost:3000/test/ in your browser.
Loading

0 comments on commit 6e7127e

Please sign in to comment.