@adobe/sizewatcher 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.2
4
+
5
+ Fixes:
6
+
7
+ - [#143](https://github.com/adobe/sizewatcher/pull/143) Handle empty or comments-only `.sizewatcher.yml` config file gracefully after js-yaml 5 upgrade
8
+ - [#150](https://github.com/adobe/sizewatcher/pull/150) Fix tests on Node 26.8+ by replacing mock-fs with real temp directories
9
+
10
+ Improvements:
11
+
12
+ - [#143](https://github.com/adobe/sizewatcher/pull/143) Upgrade js-yaml to v5.4.1 (major version, includes security fixes)
13
+ - [#139](https://github.com/adobe/sizewatcher/pull/139) [#140](https://github.com/adobe/sizewatcher/pull/140) Upgrade tmp to v0.2.7 (security fixes)
14
+ - [#151](https://github.com/adobe/sizewatcher/pull/151) CI: update CircleCI config to version 2.1, README example uses `cimg/node:lts` image
15
+ - [#152](https://github.com/adobe/sizewatcher/pull/152) Set `root: true` in ESLint config
16
+ - CI: update GitHub actions to v7, disable fail-fast on node version matrix
17
+ - Renovate: keep mocha 11 and nyc 17 to retain Node 18 support
18
+ - Various dev dependency updates
19
+
20
+ ## 1.4.1
21
+
22
+ Fixes:
23
+
24
+ - [#136](https://github.com/adobe/sizewatcher/pull/136) [#116](https://github.com/adobe/sizewatcher/issues/116) npm_package: use `npm pack` instead of `npm publish --dry-run`
25
+
26
+ Improvements:
27
+
28
+ - [#123](https://github.com/adobe/sizewatcher/pull/123) Update tmp to v0.2.4 (security fix)
29
+ - [#133](https://github.com/adobe/sizewatcher/pull/133) Update js-yaml to v4.1.1 (security fix)
30
+ - [#128](https://github.com/adobe/sizewatcher/pull/128) Update debug to v4.4.3
31
+ - [#130](https://github.com/adobe/sizewatcher/pull/130) Renovate: ignore whatwg-url from package.json overrides
32
+ - [#134](https://github.com/adobe/sizewatcher/pull/134) Update mocha to v11.7.5
33
+
3
34
  ## 1.4.0
4
35
 
5
36
  Major changes:
package/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  [![Version](https://img.shields.io/npm/v/@adobe/sizewatcher.svg)](https://npmjs.org/package/@adobe/sizewatcher)
2
2
  [![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)
3
3
  [![Coverage Status](https://coveralls.io/repos/github/adobe/sizewatcher/badge.svg)](https://coveralls.io/github/adobe/sizewatcher)
4
- [![Travis](https://travis-ci.com/adobe/sizewatcher.svg?branch=main)](https://travis-ci.com/adobe/sizewatcher)
5
4
  [![CircleCI](https://circleci.com/gh/adobe/sizewatcher.svg?style=shield)](https://circleci.com/gh/adobe/sizewatcher)
6
5
  [![Github Actions Node.js CI Status](https://github.com/adobe/sizewatcher/workflows/Node.js%20CI/badge.svg)](https://github.com/adobe/sizewatcher/actions?query=workflow%3A%22Node.js+CI%22)
7
6
  [![CodeQL Status](https://github.com/adobe/sizewatcher/workflows/CodeQL/badge.svg)](https://github.com/adobe/sizewatcher/actions?query=workflow%3ACodeQL)
@@ -320,17 +319,22 @@ For [CircleCI](https://circleci.com) you need to
320
319
  Example `.circleci/config.yml`:
321
320
 
322
321
  ```yaml
323
- version: 2
322
+ version: 2.1
324
323
 
325
324
  jobs:
326
325
  build:
327
326
  docker:
328
- - image: circleci/node:14
327
+ - image: cimg/node:lts
329
328
  steps:
330
329
  - checkout
331
330
 
332
331
  # ---------- this runs sizewatcher ------------
333
332
  - run: npx @adobe/sizewatcher
333
+
334
+ workflows:
335
+ build-and-test:
336
+ jobs:
337
+ - build
334
338
  ```
335
339
 
336
340
  ### Other CIs
@@ -512,13 +516,13 @@ Configuration: supports `dir`
512
516
 
513
517
  ### npm_package
514
518
 
515
- Compares the size of an npm package tarball by running `npm publish --dry-run`.
519
+ Compares the size of an npm package tarball by running `npm pack --dry-run`.
516
520
 
517
521
  Name: `npm_package`
518
522
 
519
523
  Trigger: Runs if a `package.json` is found.
520
524
 
521
- Details: Prints the package contents and metadata using the output of `npm publish --dry-run`.
525
+ Details: Prints the package contents and metadata using the output of `npm pack --dry-run`.
522
526
 
523
527
  ---
524
528
  Package contents:
@@ -30,8 +30,8 @@ async function getSize(dir) {
30
30
  };
31
31
  }
32
32
 
33
- debug(`running npm publish --dry-run inside ${dir}...`);
34
- let { stderr } = await exec("npm publish --dry-run", { cwd: dir });
33
+ debug(`running npm pack --dry-run inside ${dir}...`);
34
+ let { stderr } = await exec("npm pack --dry-run", { cwd: dir });
35
35
 
36
36
  stderr = stderr.replace(/npm notice /g, "");
37
37
 
package/lib/config.js CHANGED
@@ -39,7 +39,9 @@ function load() {
39
39
 
40
40
  if (fs.existsSync(CONFIG_FILE)) {
41
41
  const data = fs.readFileSync(CONFIG_FILE, "utf8");
42
- const loadedConfig = yaml.load(data) || {};
42
+ // js-yaml 5+ load() throws on empty input (including comments-only files),
43
+ // loadAll() returns [] instead and thus handles an empty config file gracefully
44
+ const loadedConfig = yaml.loadAll(data)[0] || {};
43
45
 
44
46
  config = deepmerge(DEFAULT_CONFIG, loadedConfig);
45
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/sizewatcher",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Warns if your pull requests introduce large size increases.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -33,24 +33,23 @@
33
33
  "coveralls": "^3.1.0",
34
34
  "eslint": "^8.0.0",
35
35
  "mocha": "^11.0.0",
36
- "mock-fs": "^5.5.0",
37
36
  "nyc": "^17.0.0",
38
37
  "supports-color": "^8.1.1"
39
38
  },
40
39
  "dependencies": {
41
40
  "@octokit/rest": "19.0.3",
42
- "debug": "4.4.0",
41
+ "debug": "4.4.3",
43
42
  "deepmerge": "4.3.1",
44
43
  "get-folder-size": "5.0.0",
45
44
  "glob": "10.3.5",
46
- "js-yaml": "4.1.0",
45
+ "js-yaml": "5.4.1",
47
46
  "pretty-bytes": "5.6.0",
48
47
  "require-dir": "1.2.0",
49
48
  "simple-git": "3.22.0",
50
- "tmp": "0.2.3",
49
+ "tmp": "0.2.7",
51
50
  "xbytes": "1.9.1"
52
51
  },
53
52
  "overrides": {
54
- "whatwg-url": "^14.0.0"
53
+ "whatwg-url": "14.2.0"
55
54
  }
56
55
  }