Skip to content

Releases: swissquote/crafty

[1.13.3] Small bugfix

19 Oct 11:41
Compare
Choose a tag to compare
  • Fix watch mode startup
  • Update and fix documentation theme

[1.13.2] Small bugfix

09 Oct 13:00
Compare
Choose a tag to compare

Fix runtime detection in babel configuration in case the package doesn't have dependencies

[1.13.1] Failed release

09 Oct 12:59
Compare
Choose a tag to compare
Pre-release

Please ignore this

[1.13.0] TypeScript 4, ESLint 7, lots of improvements

09 Oct 12:27
Compare
Choose a tag to compare

Highlights

  • Upgraded to TypeScript 4.
  • Upgraded to ESLint 7, including some configuration improvements.
  • Fixed a bug with node_modules imports in Jest.
  • Removed Enzyme from crafty-preset-react.
  • TypeScript files are now run through Babel for all three current runners. (only Webpack was doing it before)
  • Treat @babel/runtime as an external dependency to reduce bundle sizes.
  • @swissquote/rollup-plugin-eslint replaces rollup-plugin-eslint.
  • Extract Terser options into @swissquote/crafty-preset-terser.

TypeScript 4

TypeScript 4 is out and brings a lot of new features like Variadic Tuple Types, Labeled Tuple Elements and inference of types from constructor types.

All runners have been updated to support those features.

For more details you can check their release notes : https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/

ESLint 7 and configuration improvements

ESLint 7 has been released and while it changes a lot internally and in the way it's configured.
Crafty's upgrade does all the heavy lifting for you.

For more information you can check their release notes : https://eslint.org/blog/2020/05/eslint-v7.0.0-released

Some configuration improvements

  • Fix typescript-eslint/naming-convention configuration; shouldn't report any false positives anymore.
  • Add eslint-plugin-react-hooks to our ESLint preset. The official rules for React Hooks, should help catch some gotchas in your React Hooks.
  • A newer version of eslint-plugin-react was making too many false positives in jsx-handler-names and it has been disabled while we investigate the matter.

Jest module imports bugfix

A configuration mistake in Jest broke module resolution sometimes, this has now been fixed and module resolution should be more reliable now.

If you had a workaround like this in your crafty.config.js:

  jest(crafty, options) {
    options.moduleDirectories.push("node_modules");
  }

You can now remove it safely

Removed Enzyme from crafty-preset-react

It's used by only few people and making it work with multiple versions of React makes it's not worth it to keep around.

TypeScript files are now run through Babel for all three current runners

When using crafty-preset-typescript with the gulp and rollup runner, compilation will also go through Babel (Webpack already did the same). This makes it easier to add optimization for all cases.

Treat @babel/runtime as an external dependency to reduce bundle sizes

When compiling with Babel, some code has to be added to files (to handle default imports, class creations, destructuring ...)
If you compile using the gulp or Rollup runners (meant for libraries) These pieces of code are better left outside of your codebase, since re-declaring exactly the same snippets of code for each module or even file, can become big very fast.

Now, if you add @babel/runtime as a dependency to your project. Crafty will automatically keep these snippets external to your codebase.
This way it is the job of the final project to import all helpers and it can do a better job at de-duplicating them.

You can override this behaviour with the inlineRuntime option for your bundles.
Defaults to true when nothing is specified, and to false when a dependency to @babel/runtime is found.

@swissquote/rollup-plugin-eslint replaces rollup-plugin-eslint

This plugin is a fork of rollup-plugin-eslint with a few differences

  1. It's compatible with ESLint 7
  2. Linting is done on all files and a single report is printed at the end of the run
    this allows to lint all files and not fail after the first one.

Extract Terser options into @swissquote/crafty-preset-terser

Options for Terser were duplicated and scattered accross multiple files.
These options are now moved to a separate preset, and the uglifyJS option has been renamed to terser.

Updates

ESLint related updates

  • eslint from 6.8.0 to 7.10.0
  • @typescript-eslint/eslint-plugin from 3.6.0 to 4.4.0
  • @typescript-eslint/parser from 3.6.0 to 4.4.0
  • gulp-eslint replaced with gulp-eslint7
  • eslint-config-prettier from 6.11.0 to 6.12.0
  • eslint-import-resolver-typescript from 2.0.0 to 2.3.0
  • eslint-plugin-import from 2.22.0 to 2.22.1
  • eslint-plugin-react from 7.20.3 to 7.21.3

Rollup related updates

  • @rollup/plugin-commonjs from 13.0.1 to 15.1.0
  • @rollup/plugin-node-resolve from 8.4.0 to 9.0.0
  • rollup from 2.21.0 to 2.28.2
  • rollup-plugin-babel replaced with @rollup/plugin-babel
  • rollup-plugin-terser from 6.1.0 to 7.0.2
  • rollup-plugin-typescript2 from 0.27.1 to 0.27.3

Webpack related updates

  • mini-css-extract-plugin from 0.9.0 to 0.12.0
  • fork-ts-checker-webpack-plugin from 4.1.6 to 5.2.0
  • terser-webpack-plugin from 3.0.6 to 4.2.3
  • webpack from 4.43.0 to 4.44.2
  • webpack-chain from 6.5.0 to 6.5.1
  • webpack-merge from 5.0.9 to 5.2.0
  • style-loader from 1.2.1 to 1.3.0
  • ts-loader from 8.0.0 to 8.0.4

PostCSS Related updates

  • browserslist from 4.13.0 to 4.14.5
  • css-loader from 3.6.0 to 4.3.0
  • postcss from 7.0.32 to 7.0.35
  • postcss-loader from 3.0.0 to 4.0.3
  • postcss-selector-parser from 6.0.2 to 6.0.4

Other updates

  • babel from 7.10.* to 7.11.*
  • jest from 26.1.0 to 26.5.2
  • gulp-terser from 1.2.0 to 1.4.0
  • enhanced-resolve from 4.2.0 to 5.2.0
  • find-up from ^4.0.0 to ^5.0.0
  • react-hot-loader from 4.12.21 to 4.13.0
  • stylelint from 13.6.1 to 13.7.2
  • ts-jest from 26.1.2 to 26.4.1
  • typescript from 3.9.6 to 4.0.3
  • undertaker from 1.2.1 to 1.3.0
  • yargs-parser from ^18.0.0 to ^20.0.0

Internal

  • Replace Lerna with oao
  • Replace glob-watcher with an inlined, up-to-date, version

[1.12.0] Jest 26, TypeScript 3.9, Babel 7.10, Browser list update

13 Jul 15:23
Compare
Choose a tag to compare

Highlights

  • Change default list of supported browsers to > 0.25%, Edge >= 17, Safari >= 11, iOS >= 11, Chrome >= 66, Firefox >= 60, IE >= 11, not op_mini all
  • New crafty browsers command ton know for which browsers you compile
  • Jest 26
  • TypeScript 3.9
  • Babel 7.10

Browser list update

With the recent update of the list of supported browsers at Swissquote we are now updating our tooling to reflect that.
With that change comes a new crafty command, that shows the current resolved configuration and what browsers it includes :

❯ crafty browsers
[17:20:44] Starting Crafty 1.12.0...
Your browserslist query:
    '> 0.25%, Edge >= 17, Safari >= 11, iOS >= 11, Chrome >= 66, Firefox >= 60, IE >= 11, not op_mini all'
Contains 63 browsers covering 93.08% of global usage.

Chrome for Android       81
UC Browser for Android   12.12
Chrome                   83, 81, 80, 79, 78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 49
Edge                     83, 81, 80, 79, 18, 17
Firefox                  78, 77, 76, 75, 74, 73, 72, 71, 70, 69, 68, 67, 66, 65, 64, 63, 62, 61, 60
IE                       11
iOS Safari               13.4-13.5, 13.3, 13.2, 13.0-13.1, 12.2-12.4, 12.0-12.1, 11.3-11.4, 11.0-11.2
Opera                    68
Safari                   13.1, 13, 12.1, 12, 11.1, 11
Samsung Internet         11.1-11.2, 4

This should help fine tune your queries and debug if you aren't sure what browsers should be supported. Note that the browserslist 'your_browserlist' command is similar, however it gives less information.

Updates

Package from to
autoprefixer 9.7.6 9.8.5
@babel/* 7.9.* 7.10.*
browserslist 4.11.1 4.13.0
css-loader 3.5.2 3.6.0
enhanced-resolve 4.1.1 4.2.0
eslint-config-prettier 6.10.1 6.11.0
eslint-loader 4.0.0 4.0.2
eslint-plugin-import 2.20.2 2.22.0
eslint-plugin-react 7.19.0 7.20.3
fork-ts-checker-webpack-plugin 4.1.3 4.1.6
gulp-svgmin 2.2.0 3.0.0
inspectpack 4.4.0 4.5.2
jest 25.3.0 26.1.0
postcss 7.0.27 7.0.32
postcss-color-hex-alpha 5.0.3 6.0.0
postcss-color-rebeccapurple 5.0.0 6.0.0
postcss-font-family-system-ui 4.2.0 4.3.0
postcss-nested 4.2.1 4.2.3
postcss-scss 2.0.0 2.1.1
postcss-value-parser 4.0.3 4.1.0
react-hot-loader 4.12.20 4.12.21
@rollup/plugin-commonjs 11.1.0 13.0.1
@rollup/plugin-json 4.0.2 4.1.0
@rollup/plugin-node-resolve 7.1.3 8.4.0
rollup 2.6.1 2.21.0
rollup-plugin-terser 5.3.0 6.1.0
rollup-plugin-typescript2 0.27.0 0.27.1
style-loader 1.1.3 1.2.1
stylelint 13.3.2 13.6.1
stylelint-scss 13.17.0 13.18.0
terser-webpack-plugin 2.3.5 3.0.6
through2 ^3.0.0 ^4.0.0
tmp 0.1.0 0.2.1
ts-jest 25.3.1 26.1.2
ts-loader 6.2.2 8.0.0
typescript 3.8.3 2.9.6
@typescript-eslint/eslint-plugin 2.28.0 3.6.0
webpack 4.42.1 4.43.0
webpack-chain 6.4.0 6.5.0
webpack-dev-server 3.10.3 3.11.0
webpack-merge 4.2.2 5.0.9

[1.11.1] Fix linting

15 Apr 08:04
Compare
Choose a tag to compare

Highlights

  • Linting bugfixes
  • Remove eslintReactVersion settting

Linting bugfixes

  • Using jsLint --preset format did not work correctly with ES2015+
  • Using jsLint --preset recommended --preset node did not parse TypeScript correctly.
  • Add eslint-config-prettier 6.10.1 to disable all prettier-related rules automatically
  • Add eslint-import-resolver-typescript 2.0.0 to disable all rules handled by TypeScript

Remove eslintReactVersion from crafty.config.js

use detect as React's version in eslint-plugin-react, can still be overriden with the eslint configuration

Package Updates

  • Update jest to 25.3.0
  • Update @babel/* to 7.9.5
  • Update eslint-loader to 4.0.0
  • Update css-loader to 3.5.2
  • Update stylelint to 13.3.2
  • Update fork-ts-checker-webpack-plugin to 4.1.3
  • Update rollup-plugin-typescript2 to 0.27.0
  • Update @rollup/plugin-commonjs to 11.1.0
  • Update @rollup/plugin-node-resolve to 7.1.3
  • Update rollup to 2.6.1
  • Update mkdirp to 1.0.4
  • Update autoprefixer to 9.7.6
  • Update browserslist to 4.11.1
  • Update stylelint-scss to 3.17.0
  • Update @typescript-eslint/eslint-plugin to 2.28.0
  • Update eslint-plugin-import 2.20.2
  • Update eslint-plugin-prettier 3.1.3

Rollup 2, TypeScript 3.8, Jest 25, Other updates

27 Mar 08:34
Compare
Choose a tag to compare

Highlights

  • Update to Jest 25.2
  • Update to TypeScript 3.8.3
  • Update to Rollup 2.2.0
  • Update to Babel 7.9

Jest 25

https://jestjs.io/blog/2020/01/21/jest-25

TypeScript 3.8

https://devblogs.microsoft.com/typescript/announcing-typescript-3-8/

Rollup 2.2.0

https://github.com/rollup/rollup/releases/tag/v2.0.0

Babel 7.9

https://babeljs.io/blog/2020/03/16/7.9.0

Disabled no-explicit-any for typescript

This rule can be annoying and we mostly ignore it because it's a warning, we trust you to use it responsibly.

Updates

Dependency Old Now
jest 24.9.0 25.2.3
@babel/* 7.8.3 7.9.4
babel-loader 8.0.6 8.1.0
babel-preset-jest 24.9.0 25.2.1
rollup-plugin-babel 4.3.3 4.4.0
gulp-imagemin 7.0.0 7.1.0
postcss 7.0.26 7.0.27
stylelint 13.0.0 13.2.1
webpack 4.41.5 4.42.1
react-hot-loader 4.12.18 4.12.20
react-test-renderer 16.12.0 16.13.1
fork-ts-checker-webpack-plugin 3.1.1 4.1.2
rollup-plugin-typescript2 0.25.3 0.26.0
ts-jest 24.3.0 25.2.1
ts-loader 6.2.1 6.2.2
typescript 3.7.5 3.8.3
@rollup/plugin-commonjs 11.0.1 11.0.2
@rollup/plugin-json 4.0.1 4.0.2
@rollup/plugin-node-resolve 7.0.0 7.1.1
@rollup/plugin-replace 2.3.0 2.3.1
rollup 1.29.1 2.2.0
rollup-plugin-terser 5.2.0 5.3.0
inspectpack 4.3.1 4.4.0
mkdirp 0.5.1 1.0.3
terser-webpack-plugin 2.3.2 2.3.5
webpack-chain 6.3.0 6.4.0
webpack-dev-server 3.10.1 3.10.3
browserslist 4.8.5 4.11.0
yargs-parser ^16 ^18
@typescript-eslint/* 2.17.0 2.25.0
babel-eslint 10.0.3 10.1.0
eslint-plugin-import 2.20.0 2.20.1
eslint-plugin-react 7.18.0 7.19.0
autoprefixer 9.7.4 9.7.5
postcss-advanced-variables 3.0.0 3.0.1
postcss-calc 7.0.1 7.0.2
postcss-color-rebeccapurple 4.0.1 5.0.0
postcss-color-rgba-fallback 3.0.0 4.0.0
postcss-value-parser 4.0.2 4.0.3
stylelint-scss 3.13.0 3.16.0

Dependencies updates and small fixes

22 Jan 10:53
Compare
Choose a tag to compare

Highlights

  • Allow to use Crafty's ESLint integration as a global tool
  • Webpack configuration improvements
  • Drop Node 8 support

ESLint module resolver patch

The node module resolution used by ESLint depends on finding modules in the current working directory.
If used within a GitHub hook, or similar, it won't work. We are currently patching ESLint to allow this to work. With the hope to be able to remove it once ESLint offers more configuration options for global modules

Webpack options changes

  • Automatically exclude the dist folder from watch, to avoid compilation loops
  • Allow to change the host for the devServer
  • Read the port from the configuration for the devServer in case it was changed by a preset
  • Set the publicPath only if it wasn't defined yet

Drop Node 8 support

Since node 8 isn't supported anymore and many of our dependencies dropped it; we are dropping the support as well.

Internal

  • Replace Dependabot with Renovate
  • Remove most of the builds from Travis, use Github Actions instead

Dependency Replacement

  • rollup-plugin-commonjs replaced with @rollup/plugin-commonjs
  • rollup-plugin-json replaced with @rollup/plugin-json
  • rollup-plugin-node-resolve replaced with @rollup/plugin-node-resolve
  • rollup-plugin-replace replaced with @rollup/plugin-replace

Dependency Updates

  • node to >=10.0.0
  • @babel/* from 7.7.5 to 7.8.3
  • autoprefixer from 9.7.3 to 9.7.4
  • babel-plugin-istanbulfrom 5.2.0 to 6.0.0
  • browserslist from 4.8.2 to 4.8.5
  • case-sensitive-paths-webpack-plugin from 2.2.0 to 2.3.0
  • css-loader from 3.3.2 to 3.4.2
  • enzyme-adapter-react-16 from 1.15.1 to 1.15.2
  • enzyme from 3.10.0 to 3.11.0
  • eslint from 6.7.2 to 6.8.0
  • eslint-plugin-import from 2.19.1 to 2.20.0
  • eslint-plugin-prettier from 3.1.1 to 3.1.2
  • eslint-plugin-react from 7.17.0 to 7.18.0
  • execa from 3.2.0 to 4.0.0
  • gulp-imagemin from 6.2.0 to 7.0.0
  • inspectpack from 4.2.2 to 4.3.1
  • mini-css-extract-plugin from 0.8.0 to 0.9.0
  • postcss-font-family-system-ui from 4.1.1 to 4.2.0
  • postcss from 7.0.24 to 7.0.26
  • rollup from 1.27.12 to 1.29.1
  • rollup-plugin-pnp-resolve from ^1.0.1 to ^2.0.0
  • rollup-plugin-terser from 5.1.3 to 5.2.0
  • stylelint from 12.0.0 to 13.0.0
  • stylelint-prettier from 1.1.1 to 1.1.2
  • style-loader from 1.0.1 to 1.1.3
  • terser-webpack-plugin from 2.3.0 to 2.3.2
  • ts-jest from 24.2.0 to 24.3.0
  • @typescript-eslint/* from 2.11.0 to 2.17.0
  • typescript from 3.7.3 to 3.7.5
  • typescript from 3.7.3 to 3.7.5
  • webpack-chain from 6.0.0 to 6.3.0
  • webpack-dev-server from 3.9.0 to 3.10.1
  • webpack from 4.41.2 to 4.41.5
  • xml2js from 0.4.22 to 0.4.23

Fix crafty jest not failing when tests fail

13 Dec 20:57
Compare
Choose a tag to compare

This release fixes that when jest tests fail in crafty test it doesn't set the exit code to 1.

Lots of updates, TypeScript 3.7, configuration fine tuning

13 Dec 20:52
Compare
Choose a tag to compare

Highlights

  • Change how configuration is done for the jest test runner, #611 Thanks @vitalishapovalov
  • Change Webpack devServer configuration, allows HTTPS to be used. #578, #622 Thanks @AdrienS-SQ
  • Improve Webpack's TypeScript loader configuration to use the new experimental Watcher API

JavaScript Updates

  • @babel/* to 7.7.6

TypeScript Updates

  • fork-ts-checker-webpack-plugin from 1.5.0 to 3.1.1
  • rollup-plugin-typescript2 0.24.1 0.25.3
  • ts-loader from 6.1.0 to 6.2.1
  • typescript from 3.6.3 to 3.7.3

Styles Updates

  • autoprefixer from 9.6.1 to 9.7.3
  • css-loader from 3.2.0 to 3.3.2
  • postcss from 7.0.18 to 7.0.24
  • postcss-csso from 3.0.0 to 4.0.0
  • postcss-initial from 3.0.1 to 3.0.2
  • postcss-nested 4.1.2 to 4.2.1
  • style-loader from 1.0.0 to 1.0.1

Eslint Updates

  • eslint from 6.3.0 to 6.7.2
  • eslint-loader from 3.0.0 to 3.0.3
  • eslint-plugin-import from 2.18.2 to 2.19.1
  • eslint-plugin-prettier from 3.1.0 to 3.1.1
  • eslint-plugin-react from 7.14.3 to 7.17.0
  • eslint-plugin-sonarjs from 0.4.0 to 0.5.0
  • @typescript-eslint/* from 2.2.0 to 2.11.0
  • confusing-browser-globals from 1.0.8 to 1.0.9

Stylelint updates

  • stylelint from 10.1.0 to 12.0.0
  • stylelint-no-unsupported-browser-features from 3.0.2 to 4.0.0
  • stylelint-scss from 3.10.1 to 3.13.0

Webpack updates

  • terser-webpack-plugin from 2.0.1 to 2.3.0
  • webpack from 4.39.3 to 4.41.2
  • webpack-dev-server from 3.8.0 to 3.9.0

Rollup updates

  • rollup from 1.21.2 to 1.27.12
  • rollup-plugin-terser from 5.1.1 to 5.1.3

React updates

  • react-hot-loader 4.12.12 to 4.12.18
  • react-test-renderer 16.9.0 to 16.12.0

Other Updates

  • browserslist from 4.7.0 to 4.8.2
  • end-of-stream from 1.4.1 to 1.4.4
  • enhanced-resolve 4.1.0 to 4.1.1
  • enzyme-adapter-react-16 from 1.14.0 to 1.15.1
  • execa from 2.0.4 to 3.2.0
  • gulp-imagemin from 6.1.0 to 6.2.0
  • gulp-rename 1.4.0 to 2.0.0
  • ts-jest from 24.0.2 to 24.2.0
  • yargs-parser 14.0.0 to 16.0.0