Known patches

builtins 3

   1 -  builtins.forEach(function (builtin) {
   2 +  builtins().forEach(function (builtin) {
   3 

chalk 5

node-chalk provides 2 distinct API:

   1 @@ -2,7 +2,7 @@
   2  const EventEmitter = require('events')
   3  const { resolve, dirname, join } = require('path')
   4  const Config = require('@npmcli/config')
   5 -const chalk = require('chalk')
   6 +const {Chalk} = require('chalk')
   7  const which = require('which')
   8  const fs = require('fs/promises')
   9 
  10 @@ -352,7 +352,7 @@
  11        if (!this.color) {
  12          level = 0
  13        }
  14 -      this.#chalk = new chalk.Instance({ level })
  15 +      this.#chalk = new Chalk({ level })
  16      }
  17      return this.#chalk
  18    }

This works well except during typescript transpilation. For package that needs chalk@4 typescript declarations, a workaround can be to install in node_modules (for dh-sequence-nodejs packages: in debian/build_modules) a forged @types/chalk and drop node_modules/chalk link.

   1 {
   2  "name": "@types/chalk",
   3  "types": "index.d.ts"
   4 }

coffeescript 2

See http://coffeescript.org/v2/#breaking-changes-super-this

   1 -  constructor: (@currentSnapshot, @newSnapshot, @isPreview) ->
   2 +  constructor: (currentSnapshot, newSnapshot, isPreview) ->
   3 +    super currentSnapshot, newSnapshot, isPreview
   4 +    @currentSnapshot = currentSnapshot
   5 +    @newSnapshot = newSnapshot
   6 +    @isPreview = isPreview

cosmi-config 7

   1 -  const config = require('cosmiconfig')
   2 -  opts = config('postcss', options)
   3 +  const {cosmiconfig} = require('cosmiconfig')
   4 +  opts = cosmiconfig('postcss', options)
   5 
   6 -  const config = require('cosmiconfig')
   7 -  const result = config('postcss', options).searchSync(path)
   8 +  const {cosmiconfigSync} = require('cosmiconfig')
   9 +  const result = cosmiconfigSync('postcss', options).search(path)
  10 

crypto-random-string 3

   1 -  res = cryptoRandomString(32);
   2 +  res = cryptoRandomString({length:32});
   3 

execa 6

   1 -  const execa = require('execa');
   2 +  const {execa} = require('execa');
   3 
   4 -  const execa = require('execa');
   5 -  res = execa.sync(cmd);
   6 +  const {execaSync} = require('execa');
   7 +  res = execaSync(cmd);
   8 

formidable 3

   1 -const formidable = require('formidable');
   2 +const {formidable} = require('formidable');
   3 

is-plain-object 5

-  const isPlainObject = require('is-plain-object');
+  const {isPlainObject} = require('is-plain-object');

jest 29

Snapshot format changed with jest 29. To go back to previous format, simply add this in package.json

   1 +  "jest": {
   2 +     "snapshotFormat": {
   3 +       "escapeString": true,
   4 +       "printBasicPrototype": true
   5 +     }
   6 +  },
   7 

See https://jestjs.io/docs/upgrading-to-jest29 for more

js-tokens 6

js-token was a regex until version 6, then a function.

   1 -var jsTokens = require('js-tokens').default;
   2 +var jsTokens = require('js-tokens');
   3 
   4 -  var parts = src.match(jsTokens);
   5 +  var parts = Array.from(jsTokens(src), (token) => token.value);
   6 

js-yaml 4

   1 -  contents = require('js-yaml').safeLoad(data);
   2 +  contents = require('js-yaml').load(contents);
   3 
   4 -  error    = require('js-yaml').safeDump(config, opts)
   5 +  error    = require('js-yaml').dump(config, opts);
   6 

mime 2

Version 2 is a breaking change from 1.x. Specifically:

   1 -  resp = mime.lookup(type)
   2 +  resp = mime.getType(type)
   3 

minimatch 9

   1 -const minimatch = require('minimatch');
   2 +const {minimatch} = require('minimatch');
   3 

mkdirp 1

   1 -  mkdirp( path.dirname(dest), (err) => {
   2 -    if (err) return reportError(err);
   3 -    doRename();
   4 -  });
   5 +  mkdirp( path.dirname(dest) ).then( () => {
   6 +    doRename();
   7 +  })
   8 +  .catch( err => {
   9 +    return reportError(err);
  10 +  });
  11 

path-to-regex 6 (also express)

- pathToRegex('*')
+ pathToRegex('(*)')
+ // OR
+ pathToRegex(':foo*')

In express:

- app.get("*", ...args)
+ app.get("(*)", ...args)

readable-stream 3

   1 -var Writable = require('readable-stream/writable');
   2 +var Writable = require('readable-stream/lib/_stream_writable.js');
   3 

regenerate-unicode-properties 10

   1 -  arr = require("regenerate-unicode-properties").get("General_Category")
   2 +  arr = require("regenerate-unicode-properties").characters.get("General_Category")
   3 

rollup 3

"rollup 3" no longer accepts hybrid ES/CJS configuration files. Example:

   1 --- a/rollup.config.js
   2 +++ b/rollup.config.js
   3 @@ -1,7 +1,7 @@
   4 -import buble from 'rollup-plugin-buble';
   5 -import pkg from './package.json';
   6 +const buble = require('rollup-plugin-buble');
   7 +const pkg = require('./package.json');
   8 
   9 -export default {
  10 +module.exports = {
  11         input: 'src/index.js',
  12 
  13         external: [

schema-utils 3

-  const validateOptions = require("schema-utils");
+  const validateOptions = require("schema-utils").validate;

-  import validateOptions from 'schema-utils';
+  import { validate as validateOptions } from 'schema-utils';

semver 7

   1 -  parsed = semver(wanted);
   2 +  parsed = new semver.SemVer(wanted);
   3 

signal-exit 4

   1 -  import onExit from 'signal-exit';
   2 +  import { onExit } from 'signal-exit';
   3 

yargs 15

   1 -  var parser = yargs.usage(usage, cliOptions);
   2 +  var parser = yargs.usage(usage).options(cliOptions);
   3