Update to webpack.config.js
to replace asset
option with filename
option.
compression-webpack-plugin
(v3.0.1
) and webpack
(4.41.2
) upgraded to fix vulnerability in serialize-javascript
.
eslint-plugin-react-hooks
v2.3.0
dependency added and eslintrc
updated to support linting react hooks.
plugin-proposal-function-bind
v7.7.4
dependency added and babel config updated to include this plugin to replace "stage 0", other babel dependencies also bumped to latest.
The package-lock.json
was updated to upgrade handlebars
a dependency of jest
and jest-cli
to fix high security vulnerabilities
Change relative path to absolute path in webpack.config.js
to fix build issue on demo site
The package-lock.json
was updated to fix vulnerability in handlebars
The package-lock.json
was updated to bump the version of jest
to 24.9.0
to fix 2 high security warnings
The package-lock.json
was updated to bump the version of eslint-utils
to fix critical security warning
The package-lock.json
was updated to bump the version of mixin-deep
used by webpack-dev-server
Update to webpack.config.js
to support corejs v3
Update to babel.config.js
to support corejs v3
Removed @babel/polyfill
and babel-core
from package.json
-webpack-dev-server
has been dropped back to 3.2.1
as the demo site will not launch locally when set to latest version.
optimize-css-assets-webpack-plugin
, jest
, jest-cli
, babel-jest
and tslint
versions have been bumped to latest to fix vulnerabilities.
webpack-bundle-analyzer
version has been bumped to latest to fix vulnerabilities.
webpack-dev-server
, babel
, eslint
and node-sass
versions have been bumped to latest to fix vulnerabilities.
webpack-dev-server
version has been bumped to latest.
webpack.config.js
is now configured to handle .ts
and .tsx
file extensions, this includes updating babel-loader
to handle these new extensions.
Range of dependencies added to allow support for components to be built using .ts
and .tsx
extensions.
tsconfig.json
defines the rules for how .ts
and .tsx
files should be compiled. For more information about comilier options see https://www.typescriptlang.org/docs/handbook/compiler-options.html
Updates have been made to jest.conf.json
to allow it to handle the transformation of .tsx
syntax.
tslint.json
is added to apply linting to files with Typescript file extensions, whilst .eslintrc
continues to handle JavaScript files.
- babel has been upgraded to version 7. As part of this change we have updated the
.babelrc
file supplied by carbon-factory to ababel.config.js
. We recommend you transform your.babelrc
to reflect this change. The babel modules have changed in name format as well, this will effect your application if you directly reference any of these. For example you might be importing babel's polyfills withimport 'babel-polyfill';
, this should be changed toimport '@babel/polyfill';
. For more information on the babel upgrade please see the official documentation: https://babeljs.io/docs/en/v7-migration
- Added support to the webpack config to enable code splitting. See the React docs for more information.
- Enabled source maps for production, these will get generated as an external file with the extension
.js.map
. To enable these turn them on withproductionSourcemaps: true
in the webpack config. Please note that you should only enable these if you can ensure they're not publicly accessible.
webpack.config.js
has been fixed to support either .js
files or .jsx
files.
.babelrc
has been updated to include babel-preset-env support for at least IE11. If you want to use this, import babel-polyfill
into the root of your project.
We no longer use Parcelify Loader in our webpack config. You should now import any static assets such as stylesheets, fonts, or icons, directly in the JavaScript files that need them.
If you wish to continue using Parcelify Loader please see their README for details on how to configure it with webpack.
Remove the uglify-webpack-plugin
that we used in production builds. webpack uses this by default for production builds, and with the same options we used, so we don't need to include it here.
Bump the version number in package-lock.json
.
We now generate sourcemaps when running in development mode.
We have added support for analysing your Webpack bundle using the BundleAnalyzerPlugin. To use it pass --stats
when running Webpack.
Jest will now automatically pick up test files either called __spec__.js
or *.spec.js
.
We have now officially dropped support for gulp. This includes removing all gulp tasks supplied by carbon-factory as well as any dependencies related to gulp.
For notes on upgrading please see the guide for setting up Webpack.
Alternatively take a look at the create-carbon-app project to generate a scaffold.
We are aware that we have some projects that are not fully compliant with our lint rules, and therefore require support to not fail a build for a error threshold.
To accommodate this we recommend you create an .eslintrc
file that changes any rules you have outstanding into warnings, for example:
{
"rules": {
"react/prefer-stateless-function": 1
}
}
You can then use the --max-warnings
option to set a limit to your number of expected warnings. Over time you can work on reducing this number and returning the warnings back to errors.
We have removed any unused dependencies. If you have builds that still require a particular dependency then you may have to install and manage it yourself.
We have updated various dependencies including babel, Jest, ESLint and Webpack.
With the ESLint upgrade it has introduced some new rules. Most should be able to be auto-fixed, others may need some manual intervention.
We have upgraded to use babel-preset-env
- this should have no effect on your application other than remove a deprecation notice.
Turns CSS processor options to safe to fix compilation issues.
Fixes config for gzip
when it is disabled.
We have updated how paths are resolved to support multiple environments. For this reason you might have to update your config:
- Any absolute paths should now be relative paths:
entryPoint: '/src/main.js' // bad
entryPoint: './src/main.js' // good
- Parcelify loader does not support paths cross-platform that do not use
path.resolve
. We have fixed our config, but you may need to also fix any you have defined in your local project.
For example change the following:
const path = require('path');
parcelifyPaths: [`${process.cwd()}/src`] // bad
parcelifyPaths: [path.resolve(process.cwd(), 'src')] // good
We no longer gzip images as part of the production build.
Updated packages to resolve issues highlighted by npm audit
.
We no longer gzip images as part of the production build.
We now provide a preconfigured setup for using Webpack to build assets.
Please see the Webpack guide for more information on setting up your project or for migrating to using Webpack.
Hoists @import
CSS rules to the top of the CSS file.
Updated versions of packages. Please see commit for all changes. Build tasks should still work, however some tests may need updating.
You can now prepend the assets URL with a different address.
By default assets are rendered in the CSS file with /assets/my-file
. You can now pass gulp build --assetsUrl /custom-url
and the output will be /custom-url/assets/my-file
.
- Update eslint from 4.16.0 to 4.17.0
- Update gulp-eslint from 3.0.0 to 4.0.2
- Update babel-eslint from 6.1.2 to 8.2.1
- Update eslint-config-airbnb from 13.0.0 to 16.10
- Update eslint-plugin-import from 2.2.0 to 2.8.0
- Update eslint-plugin-jsx-a11y from 2.2.3 to 6.0.3
- Update eslint-plugin-react from 6.8.0 to 7.6.1
:note: Upgrading these dependencies updates some rules and introduces some new ones. You may need to resolve these issues or you can configure your application's .eslintrc
file to turn them down to warnings. Using --fix
may be the easiest solution. We do not recommend turning these rules off entirely.
The dir
option for the spec task uses Jest's rootDir
instead of roots
.
Gzipped assets are no longer created with a .gz
extension.
As part of the build task we will now gzip your assets if using the --production
flag. You can disable gzip compression by passing gzip: false
to the config.
We now run Clean CSS on the compiled stylesheet.
- Update eslint from 4.16.0 to 4.17.0
- Update gulp-eslint from 3.0.0 to 4.0.2
- Update babel-eslint from 6.1.2 to 8.2.1
- Update eslint-config-airbnb from 13.0.0 to 16.10
- Update eslint-plugin-import from 2.2.0 to 2.8.0
- Update eslint-plugin-jsx-a11y from 2.2.3 to 6.0.3
- Update eslint-plugin-react from 6.8.0 to 7.6.1
:note: Upgrading these dependencies updates some rules and introduces some new ones. You may need to resolve these issues or you can configure your application's .eslintrc
file to turn them down to warnings. Using --fix
may be the easiest solution. We do not recommend turning these rules off entirely.
dir
option for Build and Lint tasks. Settings this value allows you to control which directory to search in to run tests.- Update eslint from 3.19 to 4.16
- Fixes multi line issue with build spinner.
- Adds a spinner to the build task to indicate when it is busy.
- Updated
enzyme-to-json
to3.1.2
to support Enzyme 3. - Upgraded
sass-css-stream
to1.0.0
which includes an upgrade tonode-sass
to4.7.2
.
- Disables
notify
on Jest, as it is causing memory leaks. - Allows additional lookup paths to be defined for the build task.
- Enabled sourcemaps when running in watch mode. Alternatively you can control if they are enabled/disabled with the
--sourcemaps
flag when running gulp. - Removes dependency
node-inspector
, allowing use of Node v8.
- Updated Carbon CLI for setting up applications based on Carbon v2 and Carbon-Factory v2.
- Envify now runs across all node modules.
- Jasmine and Karma have been replaced by Jest. See our migration document for details.
- We have added a new gulp task for just running eslint, you can set it up like this:
import LintTask from 'carbon-factory/lib/gulp/lint';
gulp.task('lint', LinkTask());
You can also pass it additional options to add an error and/or warning threshold:
gulp.task('lint', LinkTask({
errorThreshold: 10,
warningThreshold: 20
}));
- Update the
package.json
created when runningcarbon app myapp
to usecarbon-react
andcarbon-factory
from npm, and to use the same version of common dependendencies as used incarbon-react
.
- Configures 'no-use-before-define' to skip functions and classes.
- Fix overly strict eslint rule to allow object property reassignment
- Fixes an issue where the overriding the coverage ignore option was not being used during gulp.
- Update branch of karma-eslint package to fix build passing when errors present.
- Bump .eslintrc max function params to 5
- Resolves the previously broken version, adding the lib directory to the package.
⚠️ does not include lib directory
- IMPORTANT: From this version on you will need to install the Carbon library as
carbon-react
.
- Change order of babelify, envify transforms to fix parsing error with
process.env.NODE_ENV
- Change package used for coverage reporting to babel-plugin-istanbul to allow
istanbul ignore
- Adds option for
babelTransforms
for spec task.
- Adds option for
babelTransforms
, which is an array of modules to which you want to apply Babel transforms to during compilation.
- Removes the eslint align rule.
- Fixes eslint on spec runner.
- Turns off import/extensions rule.
- Added multiple ESLint packages to report on recommended syntax. To help updating your codebase to comply to these rules you can set the
eslintThreshold
to allow a certain amount on errors through. You can also modify your own.eslintrc
file to add/remove rules as you see fit. - Added the option to skip eslint which you can you use with
--skip-eslint
when running the gulp task. - Output browserify error detail for easier debugging
- Added
eslintThreshold
option to control failing the build. - Added support for TypeScript
gulp.task('test', SpecTask({
eslintThreshold: 1000
});
- LiveReactLoad has been turned off by default. To turn on live reloading pass
--hot
when running gulp.
- Change package used for coverage reporting to babel-plugin-istanbul to allow
istanbul ignore
- Adds option for
babelTransforms
for spec task.
- Adds option for
babelTransforms
, which is an array of modules to which you want to apply Babel transforms to during compilation.
- Installs and implements the
graceful-fs
patch. This is to resolve anyEMFILE
errors that occur due to theulimit
being exhausted.
- Makes
uglify
from gulp production command optional, as it conflicts with Rails uglify and breaks code
Hot reloading will automatically update the UI whenever a developer makes changes to the JavaScript, meaning they will not have to reload the entire page.
You can disable hot-reloading by passing --cold
as an arg to the build task.
- Adds Jasmine support to eslint.
- Run
gulp test --report-slow
to identify tests taking more than 100ms. - Run
gulp test --debug
to run Karma in debug mode for additional info.
- Enzyme requires some configuration tweaks to run with Browserify
- Reverts #81 as it caused builds to pull in spec helpers from
node_modules
directory.
- Upgrades most dependencies.
- Easiest upgrade is to remove all local node_modules and reinstall fresh.
- ESLint upgrade introduces more accurate ruling.
- Updated path to spec_helper for spec task to remove warning
- Removes istanbul comments from compiled code.
- Remove fs dependencies "fs": "0.0.2"
- Added support for image assets
- Upgraded to Babel 6
- Increase watchify speed from ~8s to ~300ms
- Improve error handling. Fast fail when running gulp --build.
- Locked
es5-shim
to version4.5.4
.
- Added new config param to spec task -
coverageEachFile
. This allows developers to define coverage thresholds file by file (with regex, exclude and override support). - Added new config param to spec task -
coverageReporters
. An array to specify what kind of reporters type should karma generate.
- Added new config param to spec task -
reporters
. This allows developers to choose which reporters they want to use in the spec task.
- Fixes coverage bug introduced with
v0.0.6
. - Locks versions to try and mitigate incompatabilities with third party modules.
- Locks eslint to
v1.10.x
to resolve faulty eslint errors. - Locks escope to
v3.3.0
to resolve faulty eslint errors.
- Added new config param to spec task -
ignoreCoverage
. This allows developers to choose which directories are ignored when coverage reports are generated.
Example:
import gulp from 'gulp';
import SpecTask from 'carbon-factory/lib/gulp/spec';
gulp.task('test', SpecTask({
ignoreCoverage: [ '**/node_modules/**', '**/__spec__.js' ]
}));
- Added new config param to build task -
additionalSassTransformDirs
. This allows developers to define additional directories in which Sass transforms should be applied, for example:
var opts = {
additionalSassTransformDirs: ['./node_modules/carbon-sageone']
};
- The build task now outputs a more descriptive message when gulp is ready.
- Carbon Factory now compiles code to lib, allowing developers to no longer require installing babel on their computer.
You can now add src/__spec_helper__/*.js
files to scaffold any global variables required for your tests.
The command line interface generation tools have been updated to better reflect the updates to Carbon. The app
and standalone
tasks also no longer run npm install
automatically for you.
The build task can now be ran as a single run, useful for performing single asset builds. Pass --build
to your gulp build task.
The carbon component task now creates a named javascript file nested within the component directory. It also creates a base package.json
file containing a relative path to the component file and the name of component.
For example the command carbon component foo
will create a folder with three files
components/foo/
__spec__.js
foo.js
package.json
The package.json
file will contain the following
{
"main": "./foo.js",
"name": "foo"
}
ESLint has been added to the gulp test
task. This introduces 3 new dependencies:
- "babel-eslint": "^4.1.5",
- "eslint-plugin-react": "^3.8.0",
- "karma-eslint": "^2.0.1"
You also need a .eslintrc
file in the root of your project. When running the spec task for the first time you will get a message with how to set this up.
The spec gulp task can now be configured to alter the coverage threshold.
import gulp from 'gulp';
import SpecTask from 'carbon-factory/lib/gulp/spec';
gulp.task('test', SpecTask({
coverage: {
statements: 100,
branches: 100,
functions: 100,
lines: 100
}
}));
- No longer makes the code unreadable when running tests and debugging.
- Remembers preferences for console when running tests in Chrome (you may need to add
browser-preferences/
to your.gitignore
file.
Initial prototype release.
Includes:
- Gulp tasks for building the package and running specs.
- CLI for setting up an application and components.