Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Add Node 12, fix cache, discontinue Node 8 #159

Merged
merged 3 commits into from
Apr 12, 2020
Merged

Commits on Apr 11, 2020

  1. build: Add Node 12 testing. Discontinue Node 8 and earlier

    * The Node 4 LTS reached end-of-life in April 2018.
    * The Node 6 LTS reached end-of-life in April 2019.
    * The Node 8 LTS reached enf-of-life in December 2019.
    
    <https://nodejs.org/en/about/releases/>
    <https://github.com/nodejs/Release#end-of-life-releases>
    
    This is done as preparation before other contributions I plan
    to make to update dependencies (some of which no longer support
    older versions), and some simplifications (some of which would
    require additional packages be added to support older versions).
    
    The previous versions of this package naturally conitinue to
    be available for those using them on older Node.js versions,
    and in the event of a critical bug we could even create an
    "v0.x-release" branch or something and create a new patch release
    from there against the older code.
    Krinkle committed Apr 11, 2020
    Configuration menu
    Copy the full SHA
    2c50ec7 View commit details
    Browse the repository at this point in the history
  2. build: simplify travis and npm-test config

    * Remove 'sudo: false'. This was to make Travis use a fast container,
      instead of a VM. But, this option no longer exits.
      Travis now always uses a VM, and they're relatively fast.
    
    * Use 'cache: npm'.
    
      This repo has package-lock.json, which is great! (thank you).
      When package-lock.json exists, the installer deletes node_modules
      completely and rebuilds it fresh, based on the lock file.
      During local development, this is very fast because npm also has a
      cache at $HOME/.npm (which is not deleted).
    
      The 'cache: npm' shortcut will cache "$HOME/.npm" instead of
      "node_modules". Otherwise, this directory is copied by Travis
      from the cache but then immediately deleted by npm-install/npm-ci.
    
      <https://docs.travis-ci.com/user/languages/javascript-with-nodejs/#caching-with-npm>
    
    * Make 'npm test' include lint checks.
    
      This project uses ESLint and it can be run manually via 'npm run lint'.
      It is also run automatically by Travis.
    
      Make ESLint also executed by default when developers run 'npm test'
      locally. That makes it easier to contribute by not having to learn
      about lint issues after submitting a patch, and not having to read
      .travis.yaml or package.json in detail.
    Krinkle committed Apr 11, 2020
    Configuration menu
    Copy the full SHA
    9d2a184 View commit details
    Browse the repository at this point in the history
  3. Fix deprecation warnings and lint warnings

    * Update from wikimedia eslint 0.8 to 0.15
      - eslint-config-wikimedia now extends eslint, thus eslint is no
        longer needed as explicit dependency.
      - The eslint settings are now separate for browser JS and
        Node.js. Update eslintrc to make this work correctly.
    
    * Use 'Buffer.from(string, encoding)' instead of 'new Buffer()'.
    
      The Buffer constructor has been deprecated as it had too manu
      ambiguous purposes. In this case, the purpose was to convert
      a utf-8 string, for which the explicit method is now Buffer.from().
    
      > new Buffer() is deprecated. Use Buffer.from(), Buffer.alloc(),
      > or Buffer.allocUnsafe() instead
      > [no-buffer-constructor]
      > https://nodejs.org/docs/v10.15.0/api/buffer.html#buffer_new_buffer_string_encoding
    
    * Add line break in 'if (…) { … }'
    
      > This line has 2 statements. Maximum allowed is 1
      > [max-statements-per-line]
    
      This is a style rule part of eslint-config-wikimedia which
      has become stricter. The code mostly followed this style already,
      except for a few cases in examples/, which have been updated
      for consistency.
    
    * Remove redundant '(function (){ …}())' in lib/ files.
    
      This pattern is an Immediate-Invoked-Function-Expression (IIFE),
      which exists mainly for the purpose of creating a private scope
      for variables.
    
      This is useful in client-side JS for a web browser, but not
      in Node.js because every file already has its own private scope
      by default.
    
      This change might be easier to review by setting
      "[x] Hide whitespace changes" in diff settings.
      (Or add ?w=1 to the URL.)
    Krinkle committed Apr 11, 2020
    Configuration menu
    Copy the full SHA
    99160b6 View commit details
    Browse the repository at this point in the history