Differences between revisions 7 and 8
Revision 7 as of 2022-05-31 10:43:18
Size: 4086
Editor: ?yadd
Comment:
Revision 8 as of 2022-06-04 06:10:53
Size: 4483
Editor: ?yadd
Comment:
Deletions are marked like this. Additions are marked like this.
Line 29: Line 29:
}}}

== coffeescript 2 ==

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

{{{#!highlight json
- constructor: (@currentSnapshot, @newSnapshot, @isPreview) ->
+ constructor: (currentSnapshot, newSnapshot, isPreview) ->
+ super currentSnapshot, newSnapshot, isPreview
+ @currentSnapshot = currentSnapshot
+ @newSnapshot = newSnapshot
+ @isPreview = isPreview

Known patches

builtins 3

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

chalk 5

node-chalk provides 2 distinct API:

  • ES API which is chalk@5
  • CommonJS API which is both compatible with chalk@4 and chalk@5 (done to help during transition)

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.

  • download chalk@^4 and copy index.d.ts

  • create @types/chalk/package.json with this content:

   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 

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:

  • lookup() renamed to getType()

  • extension() renamed to getExtension()

  • charset() and load() methods have been removed

   1 -  resp = mime.lookup(type)
   2 +  resp = mime.getType(type)
   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 

is-plain-object 5

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

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';

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 

semver 7

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

yargs 15

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