Commit Graph

39 Commits

Author SHA1 Message Date
Timmy Willison
2bdecf8b7b
Build: migrate most grunt tasks off of grunt
Updated tasks include:

- lint
- npmcopy
- build, minify, and process for distribution.
- new custom build command using yargs
- compare size of minified/gzip built files
- pretest scripts, including qunit-fixture, babel transpilation, and npmcopy
- node smoke tests
- promises aplus tests
- new watch task using `rollup.watch` directly

Also:

- upgraded husky and added the new lint command
- updated lint config to use new "flat" config format. See https://eslint.org/docs/latest/use/configure/configuration-files-new
- Temporarily disabled one lint rule until flat config is supported by eslint-plugin-import. See https://github.com/import-js/eslint-plugin-import/issues/2556
- committed package-lock.json
- updated all test scripts to use the new build
- added an express test server that uses middleware-mockserver (this can be used to run tests without karma)
- build-all-variants is now build:all

Close gh-5318
2023-09-18 12:39:00 -04:00
Michał Gołębiowski-Owczarek
8be4c0e4f8
Build: Add exports to package.json, export slim & esm builds
Summary of the changes:
* define the `exports` field in `package.json`; `jQuery` & `$` are also
  exported as named exports in ESM builds now
* declare `"type": "module"` globally except for the `build` folder
* add the `--esm` option to `grunt custom`, generating jQuery as an ECMAScript
  module into the `dist-module` folder
* expand `node_smoke_tests` to test the slim & ESM builds and their various
  combinations; also, test both jQuery loaded via a path to the file as well
  as from module specifiers that should be parsed via the `exports` feature
* add details about ESM usage to the release package README
* run `compare_size` on all built minified files; don't run it anymore on
  unminified files where they don't provide lots of value
* remove the remove_map_comment task; SWC doesn't insert the
`//# sourceMappingURL=` pragma by default so there's nothing to strip

Fixes gh-4592
Closes gh-5255
2023-07-10 19:14:08 +02:00
Michał Gołębiowski-Owczarek
5701957b72
Build: Drop individual AMD modules
With this change, jQuery build no longer generates the `amd` directory with
AMD modules transpiled from source `src` ECMAScript Modules. To use individual
jQuery modules from source, ESM is now required.

Note that this DOES NOT affect the main `"jquery"` AMD module defined by built
jQuery files; those remain supported.

Closes gh-5276
2023-06-27 18:23:58 +02:00
Michał Gołębiowski-Owczarek
a684e6ba83
Build: Restore the external directory
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
2021-03-24 23:36:25 +01:00
Michał Gołębiowski-Owczarek
0f780ba7cc
Build:Tests: Fix custom build tests, verify on Travis
This commit fixes unit tests for the following builds:

1. The no-deprecated build: `custom:-deprecated`
2. The current slim build: `custom:-ajax,-effects`
3. The future (#4553) slim build: `custom:-ajax,-callbacks,-deferred,-effects`

It also adds separate Travis jobs for the no-deprecated & slim builds. 

Closes gh-4577
2020-01-07 23:59:08 +01:00
Michał Gołębiowski-Owczarek
f37c2e51f3
Build: Auto-convert sources to AMD
jQuery source has been migrated in gh-4541 from AMD to ES modules. To maintain
support for consumers of our AMD modules, this commits adds a task transpiling
the ES modules sources in `src/` to AMD in `amd/`.

A "Load with AMD" checkbox was also restored to the QUnit setup. Note that,
contrary to jQuery 3.x, AMD files need to be generated via `grunt amd` or
`grunt` as sources are not authored in ECMAScript modules. To achieve a similar
no-compile experience during jQuery 4.x testing, use the new "Load as modules"
checkbox which works in all supported browsers except for IE & Edge (the
legacy, EdgeHTML-based one).

Ref gh-4541
Closes gh-4554
2019-12-09 20:00:44 +01:00
Michał Gołębiowski-Owczarek
9cb124ed00
Build: Update jsdom; migrate a test with Symbol polyfill to an iframe test
So far, we've been testing that jQuery element iteration works with polyfilled
Symbol & transpiled for-of via a Node test with jsdom with the Symbol global
removed. Unfortunately, jsdom now requires Symbol to be present for its internal
functionality so such a test is no longer possible. Instead, it's been migrated
to an iframe test with transpiled JavaScript.

This PR also enables us to use ECMAScript 2017 or newer in Node.js code.

Closes gh-4305
2019-03-04 18:30:51 +01:00
Michał Gołębiowski-Owczarek
7037facc22 Build: Remove package-lock.json, add it to .gitignore
npm 5, even the version included in the latest Node.js 8.5.0 re-generates
`package-lock.json` on each install. And when it does on a system that doesn't
support all the optional dependencies that are supported on the OS where the
lockfile was generated, it removes those optional deps from the lockfile.

The effect is that everyone firing `npm install` on our repo on any OS other
than macOS will immediately get a dirty state of the repo as the `fsevents`
dependency subtree gets removed from `package-lock.json`. That's a really bad
experience.

This commit removes package-lock.json from the repository and adds it to
.gitignore. We'll start committing the file again once the issue is resolved
on npm's part.

Fixes gh-3792
2017-09-25 19:34:28 +02:00
CDAGaming
31783e60f5
Build: update node dependencies; commit package-lock.json
- Also ignore yarn.lock
Close gh-3669
2017-06-26 11:04:51 -04:00
Oleg Gaidarenko
308e4b534b Build: Simplify Gruntfile constructions
Fixes gh-3246
2016-08-02 20:58:01 +03:00
Oleg Gaidarenko
25d8ccd111 Build: Improve ESLint configuration (#3188)
* Bump eslint-config-jquery package to 0.1.4 version

* Add subtask "dist" to "eslint" task and add it to the build task list

* Make gitignore globs more flexible for the "dist" folder

Fixes gh-3169
2016-06-22 19:41:57 +04:00
Oleg Gaidarenko
58c6ca9822 Build: ESLint details
Use eslint pragmas, fix new errors, etc

Closes gh-3148
2016-06-11 10:41:33 +03:00
Oleg Gaidarenko
288028b520 Build: add npm-debug.log to .gitignore 2016-02-13 22:35:59 +03:00
Michał Gołębiowski
bb026fc12c Core: Make jQuery objects iterable
Make iterating over jQuery objects possible using ES 2015 for-of:

    for ( node of $( "<div id=narwhal>" ) ) {
        console.log( node.id ); // "narwhal"
    }

Fixes gh-1693
2015-06-13 23:14:36 +02:00
Timmy Willison
e1949f4371 Build: drop bower; use npm for front-end deps
Fixes #15186
Closes gh-1620
2014-07-17 09:02:59 -07:00
Michał Gołębiowski
2d73150511 Build: Use absolute paths in .gitignore and .npmignore.
.gitignore/.npmignore treat all its paths as relative to *every*
directory in the repository. In most cases that’s not what’s desired.
2013-12-18 15:16:21 +01:00
Timmy Willison
f9ad13c9ec Manage bower dependencies with grunt-bowercopy
Tracked bower dependencies are located at "src/sizzle" and "test/libs".
The source-destination mapping is in the Gruntfile.

When updating a bower dependency, update the version in bower.json, run
`grunt bower`, and then commit the result. When adding a dependency,
update the bowercopy task accordingly.

Fixes #14615.
Closes gh-1452.
2013-12-06 16:04:35 -05:00
Michał Gołębiowski
21c218eabb Keep bower_components in .gitignore. 2013-11-15 15:50:31 +01:00
Timmy Willison
ac7ff97f8b Use grunt and bower packages as local dependencies. Close gh-1433. 2013-11-14 10:17:18 -05:00
Timmy Willison
6318ae6ab9 AMD-ify jQuery sourcegit s! Woo! Fixes #14113, #14163. 2013-08-15 14:15:49 -04:00
Timmy Willison
b13d8229ae Include Sizzle and Qunit with bower. Fixes #14118. 2013-07-10 12:00:26 -04:00
Dave Methvin
8be9cd1ce7 Add warnings and ignore the built Sizzle file. 2013-02-27 22:45:55 -05:00
Rick Waldron
8265fa0837 Allow users to store custom dist destinations in dist/.destination.json
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
2012-06-05 13:10:01 -04:00
Rick Waldron
7c23b77af2 Strips IIFEs from modules; Always require built jQuery for tests. 2012-06-04 12:48:18 -04:00
Richard Gibson
7f2cc46955 Fix #11767. Modularize build and unit tests for exluding effects.
Closes gh-785. To build a version of jQuery without effects, use `grunt build:*:*:-effects`. The unit tests feature-check for the interfaces and skip the unit tests for effects if they don't detect it.
2012-05-28 22:36:23 -04:00
Rick Waldron
82d4c72fb1 Adds back dist/.sizecache.json; maintain build/.sizecache.json until build dir is removed 2012-05-28 22:20:37 -04:00
timmywil
9efad09d68 Add .sizecache.json to the gitignore 2012-05-28 21:39:31 -04:00
Rick Waldron waldron.rick@gmail.com
1434b5b567 Initial grunt implementation 2012-04-18 16:07:35 -04:00
jaubourg
4092e3d275 $.Callbacks, $.Topic and notify/progress on $.Deferred. 2011-09-19 15:42:30 -04:00
Corey Frang
61277d2864 Landing pull request 511. Adding a little Makefile jQuery sizing utility to easily see differences in size between makes. Fixes #10308.
More Details:
 - https://github.com/jquery/jquery/pull/511
2011-09-19 15:27:43 -04:00
Carl Fürstenberg
150d3decb5 Introduce submodules, closes #8536
Instead of the manual clone of sizzle and qunit, use git submodules
instead. this will ensure that all future releases can be recreated by
checking out an tag.
2011-03-15 20:16:09 +01:00
John Resig
616aceef84 Adding .DS_Store to Git ignore. 2009-12-09 23:49:13 -08:00
John Resig
5473b041c0 Ignore html files living in the main directory (likely being used for testing). 2009-12-09 23:45:56 -08:00
jeresig
6798df54f4 Switched from using Git Submodules to just doing a straight clone of the QUnit and Sizzle directories. Works much better for what we want. 2009-11-30 15:45:16 -05:00
jeresig
84857abefc Ignore diff and patch files. 2009-11-30 13:00:06 -05:00
John Resig
0a7232cc39 Hide the .settings file in the gitignore. 2009-11-15 00:27:06 -05:00
Kim Dalsgaard
d338b1a1e7 Ignoring src/selector.js (build) and Emacs backup files 2009-11-15 12:14:31 +08:00
John Resig
4a51b12b95 We don't want to filter out the qunit file. 2009-10-22 21:26:28 -04:00
Yehuda Katz
0e2f4a0fe3 Added gitignore for people using git-svn 2009-07-16 07:31:22 +00:00