39 Commits

Author SHA1 Message Date
Felix Boehm
5f4e84b19b Bump dev deps, use @typescript-eslint type checked style preset (#4313) 2024-12-23 12:15:54 +00:00
Felix Boehm
b824ba85b6 fix(website): Fix ReactLiveScope examples (#3980)
Fixes #3601
2024-08-08 07:59:25 +00:00
Felix Boehm
d4eb8d314c Remove deprecated exports (#3974) 2024-08-06 00:06:55 +00:00
Felix Boehm
c07bbf0168 Fix web builds (#3973) 2024-08-05 23:34:17 +00:00
Felix Boehm
caab0694ff Update build tooling, update imports, require Node 16 (#3970) 2024-08-05 23:02:58 +00:00
dependabot[bot]
8ce7ff5aff build(deps-dev): bump prettier from 3.0.3 to 3.1.1 (#3536)
* build(deps-dev): bump prettier from 3.0.3 to 3.1.1

Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.1.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/3.0.3...3.1.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* format

* format

* format

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Felix Boehm <188768+fb55@users.noreply.github.com>
2024-01-02 18:30:22 +00:00
Felix
cc838c1b03 refactor: Add eslint-plugin-unicorn, fix errors (#2893)
Standardises some syntax, and makes us use current syntax (eg. top-level await)
2022-12-11 22:30:24 +00:00
Felix
e1b2e5d7a4 refactor: Use consistent type imports (#2891) 2022-12-11 10:57:44 +00:00
Felix
82a121ade0 feat: Add functions to load buffers, streams & URLs in NodeJS (#2857) 2022-11-28 23:13:30 +00:00
Felix
94fc9b1dcc chore(deps): Replace eslint-plugin-node with -n, bump jest (#2863) 2022-11-22 16:49:52 +00:00
Felix
17cb83f132 feat: Add ESM (#2508) 2022-04-30 19:47:59 +01:00
Felix Böhm
1eaab1a0d0 chore(benchmark): Ignore TS import error 2022-04-30 18:02:17 +01:00
Felix Böhm
726f94a467 refactor: Convert to TypeScript 2021-05-06 13:40:27 +01:00
Felix Böhm
6e8c9c073d refactor: Rename files from JS to TS 2021-05-06 13:40:27 +01:00
Felix Böhm
8b0792d91b refactor: Automatically modernize with eslint 2021-05-06 13:40:27 +01:00
Felix Böhm
208bce1ee8 refactor: Enable strict mode for all files (#1650)
Only a single change (in `lib/static.js`) was necessery as a consequence.
2021-01-04 12:49:12 -08:00
Felix Böhm
075cc5d826 chore(lint): Add jest & node eslint plugins (#1642)
And fixes all reported issues.
2021-01-04 10:33:33 -08:00
XhmikosR
2fb25aab28 chore: Merge .gitattributes (#1646) 2021-01-04 03:38:43 -08:00
XhmikosR
fc2c7d53f2 chore(ESLint): enable no-unused-expressions rule (#1630) 2021-01-02 08:54:19 +01:00
XhmikosR
21de2c55d0 chore(lint): Enable several rules (#1617)
* Add back `--ignore-path .gitignore`

* Disable `allowElseIf` in `no-else-return` rule

* Enable `no-void` rule

* Enable `array-callback-return` rule

* Enable `no-useless-call` rule

* api/traversing.js: replace if statement with a ternary

* Use `Array.isArray`

* Use `new Error` instead of `Error`

* Enable `no-lonely-if` rule

* test/cheerio.js: fix require

* Enable `yoda` rule
2020-12-29 20:35:16 +01:00
Felix Böhm
69ae30875d refactor: Declare vars when used, streamline code (#1588)
* Remove unnecessary branches
* Improve comments
* Declare vars when used
* Use `function` statements
* Use `domEach` where appropriate
* Disallow shadowing, use before define
2020-12-24 09:38:22 +00:00
Felix Böhm
96a5be3b35 refactor(eslint): Update eslint rules, format 2020-12-08 16:44:05 -08:00
Felix Böhm
35f64ff4e7 Fix jsdom breaking change 2020-09-09 17:24:11 -07:00
Felix Böhm
2b75704ed7 Upgrade dependencies 2020-09-09 17:24:03 -07:00
Felix Böhm
b9131426cf Fix benchmark 2020-09-09 17:16:35 -07:00
greenkeeper[bot]
32297231bb Update jsdom to the latest version 🚀 (#1008) 2020-09-09 14:44:12 -07:00
Felix Böhm
2df92fdeb6 Use eslint & prettier, add precommit hook (#1152) 2020-09-09 14:41:27 -07:00
dzcpy
7a9ff22f68 Update dependencies & fix vulnerability (#1281)
* update dependencies

* update dependencies

* Update package.json

* Update package.json

* Fix weird xml mode issue

* Fix package-lock.json and update vulnerable modules

* Remove Node 0.12 from Travis test environments

* Fix JSDOM API issue

* Fix JSDOM new API

* Delete package-lock.json
2019-04-21 10:38:12 -07:00
jugglinmike
e2f8436170 Revert "v1.0.0 (#1145)" (#1231)
This reverts commit ca6963c09a.

The `v1.0.0` branch was a long-running feature branch containing a large
amount of disparate commits from many authors. It was squashed into a
single commit prior to being merged to the project's `master` branch.

For the purposes of attribution, reference, and history analysis, the
composite commits should be preserved, and the branch should be
incorporated into `master` via a dedicated merge commit.
2018-10-08 14:13:46 -05:00
Felix Böhm
ca6963c09a v1.0.0 (#1145)
* Use parse5 as a default parser (closes #863)

* Use documents via $.load

* Add test for #997

* Change options format

* Update unit test

Update test phrasing according to recent changes in parsing logic.

* 1.0.0-rc.1

* Improve release process

Limit responsibility of "pre-publish" script to simply validate the
project's `History.md` file (by verifying an entry for the current
release). Define a separate script for history generation. Separating
the workflow in this way allows for manual modification of the release
notes.

* Correct errors in Readme.md

* Document advanced usage with htmlparser2

* Update History.md (and include migration guide)

* Remove documentation for `xmlMode` option

Simply expose an option named `xml` that enables XML parsing via
htmlparser2 with the ability to specify additional options for that
parser.

* Rename `useHtmlParser2` option

This flag is used to control parsing behavior internally, but it is not
intended for use by consumers. Prefix the name with an underscore in
order to discourage users from relying on it.

* Re-write migration guide for version 1.0 (#1078)

Incorporate recent feedback from consumers who have experimented with
the version 1.0 release candidate.

* Pass locationInfo option to parse5 (#1155)

* Update css-select to the latest version 🚀 (#1158)

Breaking change: Invalid selectors now throw Errors, not SyntaxErrors.

* Use eslint & prettier, add precommit hook (#1152)

* chore(package): update mocha to version 5.0.4 (#1088)

* Ensure text nodes expose the DOM level 1 API

Since enabling the `withDomLvl1` parsing option, nodes cannot be created
with an object literal. Create new text nodes using the `evaluate`
function to ensure they expose the correct attributes.

* fixing missing prop(‘outerHTML’) implementation.
Added an ‘outerHTML’ case to the switch in the prop function, which wraps a clone of  in a container element, and sets  to that container's HTML (#945)

* Do not lint files excluded from version control (#1162)

This includes code coverage reports as generated by the command `make
test-cov`.

* Correct typo in git hook configuration (#1163)

* Correct typo in git hook configuration

* Reformat package manifest to satisfy linter

* Fix .text with a function as the argument

* Fix `.text` being called on a collection with size > 1 with a function

* chore(package): update coveralls to version 3.0.0 (#1086)

* Update jsdom to the latest version 🚀 (#1008)

* Throw a useful error on invalid input to cheerio.load() (#1087)

* Procedurally generate API documentation from source (#1165)

* Use parse5 to serialize the DOM, use lodash to clone dom

* Fix DoS/RCE vulnerability in lodash@4.15.0 (#1179)

fixes #1175

*  Add eslint-plugin-jsdoc, improve documentation (#1168)

* Improve variable names (#1183)

Promote consistency in variable names within the project's source and
unit tests. This helps to highlight the distinction between the object
exported by the module and the function produced by the `load` method.
The latter value is expected to mimic the jQuery API, while the former
value generally should only be used for a small set of methods specific
to Cheerio:

- `load`
- `html`
- `xml`
- `text`

Other usages of the exported object are discouraged, and a future patch
will update the unit tests to reflect the usages that are endorsed for
long-term stability.

* Formally test deprecated APIs (#1184)

Methods named `load`, `html`, `xml`, and `text` are defined in many
locations:

Today, Cheerio defines multiple versions of methods named `load`,
`html`, `xml`, `text`, and `parseHTML`. These alternate versions may be
defined in up to three distinct parts of the API:

- exported by the Cheerio module
- as static methods of the "loaded" Cheerio factory function
- as instance methods of the "loaded" Cheerio factory function

Some of these are surperfluous, and because some unecessarily conflict
with idiomatic jQuery coding patterns, they have been designated for
future removal [1].

Add tests for the deprecated methods in order to avoid regressions prior
to their removal. Insert comments to delineate the methods which are
endorsed and which have been deprecated. For the latter group of
methods, include recommendation for the preferred alternatives.

[1] https://github.com/cheeriojs/cheerio/issues/1122

* Implement for...of iterator via Symbol.iterator (#1197)

* Implement for...of iterator via Symbol.iterator

Similar to jQuery: 1ea092a54b/src/core.js (L371-L373)

Fixes #1191

* Assert that the iterator ends

https://github.com/cheeriojs/cheerio/pull/1197#discussion_r187807553
2018-10-03 17:55:28 +01:00
Felix Böhm
4ccb41b9d8 Use jQuery from the jquery module in benchmarks (#871) 2016-06-12 10:57:55 -07:00
Felix Böhm
79d4e5e6f2 Update versions (#870)
- move jsdom to devDependencies
- fix issues with benchmark upgrade
- run benchmark on travis and test on node@6
- update benchmark jQuery to 3.0.0
2016-06-11 22:23:25 -07:00
David Chambers
f6a40d6b54 fix make bench 2014-05-08 08:43:50 -07:00
kpdecker
39f84c2345 Add cheerio-only bench option 2014-02-22 16:58:46 -06:00
kpdecker
165c7a92c8 Add independent html benchmark
Covers parser and rendering from initial html content.
2014-02-22 03:31:32 -06:00
kpdecker
892e290a26 Add html rendering bench case 2014-02-22 03:30:59 -06:00
kpdecker
92aa778866 Add single element benchmark case 2014-02-21 17:27:32 -06:00
kpdecker
fd0d79dc85 Add benchmark coverage for all $ APIs 2014-01-27 12:53:29 -06:00
Mike Pennisi
c7a1d8e14c Introduce rudimentary benchmark suite
Compare the performance of Cheerio at HEAD with jsdom [1] using jQuery.
Include a new GNU Make target: `bench`.

[1] https://github.com/tmpvar/jsdom
2013-11-30 17:57:59 -05:00