Precommit hooks

All css, js, json and yml files will be checked for parsing errors (using aberlaas lint internally), and if errors are found it will attempt to automatically fix them. If errors persist, it will prevent the commit and let you know which file contains errors so you can fix them before committing again.

Whenever you commit a .js file that has a test attached (or a test file directly), aberlaas test will be run on those files. If the tests don't pass, your commit will be rejected.

Those two measures ensure that you'll never "break the build", by committing invalid files or code that does not pass the test. If you want to ignore this behavior, you can always add the -n option to your git commit command to skip the hooks.

Releasing

aberlaas release will release the package to npm. It will update the version in package.json as well as creating the related git tag.

When called without arguments, it will prompt you for the next version to package. If called with an argument, this will be used as the next version number (for example, yarn run release 1.1.3). You can also use SemVer increments (for example, yarn run release minor).

Use --dry-run to start a dry-run. It will simulate a release but won't actually push anything to GitHub or npm.

Continuous Integration

aberlaas ci is triggered by CI Servers (currently only CircleCI is supported), and won't do anything when run locally.

When on a CI server it will first display the current node and yarn version, and then test and lint scripts in that order. It will fail whenever one of them fails, or succeed if they all succeed.

The node and yarn version used both locally and on the CI server will be the same. A .nvmrc file is created when running yarn run aberlaas init that will force local users to use the specified version. The same version is also specified in the Docker image pulled by CircleCI. As for Yarn, a local copy of the whole yarn program is added to the repository when first initializing it, so both locals and CI servers will use it.

Building (with Babel)

This command is still available but deprecated. aberlaas expect code to use node >= v12, and require in place of import

aberlaas build can build all files located in ./lib into ./build using Babel.

CLI Argument

Default value

Description

[...]

./lib

Files or directory to build

--config

./babel.config.js

Babel config file to use

--out-dir

./build

Build directory

--ignore {pattern}

empty

Define patterns of files to ignore. Accepts globs, and can be passed more than once

--watch

false

If enabled, will listen for changes on files and rebuild

You can extend the internal Babel by editing the babel.config.js created at the root of your project.

File structure

./lib/configs contain the default configuration for all the tools. They are exported by the package and thus can be imported in userland.

./templates contains default configurations files copied to userland. Each extends the configuration exported in the previous files. Copying files to userland allows user to change the files if they want to change the behavior.

babel.config.js, .eslintrc.js, .stylelintrc.js, jest.config.js and .huskyrc.js are local configuration files for aberlaas itself. They eat their own dog food by referencing the same configs as above.