0.26.0 • Published 2 days ago

@botonic/dx v0.26.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 days ago

Botonic CI (continuous integration)

What Does This Package Do?

This package simplifies the configuration of all CI tasks for projects which use botonic.

Features

  • eslint
  • typescript type checking

Setup

  • Install this package
npm install -D @botonic/dx
  • Copy the contents of the sample-config folder to the root of your project (Merge this package.json's scripts into your project ones)
  • The files at sample-config just import the configuration maintained within this project. To adapt them to your project needs, you just need to patch the specific options after importing the baseline. See instructions on each of these files.

package.json

Instructions here because it cannot contain comments

  • Even if you don't plan to publish your package, it's important to correctly configure the "files" field. Otherwise, you may get the node/no-unpublished-import eslint error when importing a dev dependency from a test or a configuration file (remove --cache from eslint command after updating your package.json).

Usage

eslint

For a project to use our proposed eslint configuration, you'll need to:

  • Add the scripts starting with lint from sample-config/package.json to your package.json.
  • npm run lint will now perform a quick check which will also fix some of the detected issues.
  • npm run lint-ci will perform a slower check which detects more issues. It will not fix any issue, since it's designed to be integrated into your CI pipeline.

Due to an eslint_d issue, --fix --quiet does not autofix issues.

Please check the eslint user guide for adapting this configuration to your needs.

Typescript

In case your project uses typescript (or contains .d.ts files), add the scripts starting with build from sample-config/package.json to your package.json

  • npm run build will transpile into JS.
  • npm run build-ci will validate your project source code and tests using your tsconfig.test.json configuration

Implementation details

Depends on @botonic/eslint-config. As per the official documentation, the eslint plugins are configured there as peer dependencies. This is why they appear here again as dependencies, but with free version (*), to avoid duplicating the version specification.

Dependencies

@types/node must be a direct dependency. If only defined in a parent package.json, we get TSC errors for symbols from these libs: "ES2016.Array.Include", "ES2017.object"

Version

Due to a npm bug, npm version interaction with git (check clean stage, commit and create tag) is broken. Hence, sample-config manually checks that there are no modifications in git files.

npm

This package must be published with npm 7. With v6, there's no way to install hidden files (required for sample-config files) However, looks like "engines" restriction does not work. Also, npm 7 still has issues with our monorepo (hangs and spurious errors).

How to deploy with npm7

So, so far it's recommended to:

  • Leave npm 6 globally installed
  • Install npm 7 locally in an empty project (cd <project_with_npm7> && npm init && npm i npm)
  • cd botonic/packages/botonic-dx && <project_with_npm7>/node_modules/.bin/npm publish

Future work

.js files not yet processed with eslint because some rules require the typescript parser, which runs only on .ts files. It will be fixed by applying these rules only to .ts files.

0.26.0

2 days ago

0.25.0

1 month ago

0.25.0-beta.0

1 month ago

0.25.0-alpha.6

2 months ago

0.25.0-alpha.7

2 months ago

0.25.0-alpha.5

2 months ago

0.25.0-alpha.1

2 months ago

0.25.0-alpha.2

2 months ago

0.25.0-alpha.3

2 months ago

0.25.0-alpha.4

2 months ago

0.25.0-alpha.0

3 months ago

0.21.1-alpha.3.1

7 months ago

0.21.1-alpha.4

7 months ago

0.21.1-alpha.3

7 months ago

0.21.1-alpha.2

7 months ago

0.22.0

7 months ago

0.21.1-alpha.4.1

7 months ago

0.21.1-alpha.1

8 months ago

0.21.1-alpha.8

7 months ago

0.21.1-alpha.6

7 months ago

0.21.1-alpha.5

7 months ago

0.21.1-alpha.0.1

8 months ago

0.21.1-alpha.9

7 months ago

0.21.1-alpha.0

1 year ago

0.21.0

1 year ago

1.0.0-dev.0

3 years ago

1.0.0-alpha.0

3 years ago

0.19.0

3 years ago

0.19.0-alpha.17

3 years ago

0.19.0-alpha.18

3 years ago

0.19.0-alpha.19

3 years ago

0.19.0-alpha.16

3 years ago

0.19.0-alpha.14

3 years ago

0.19.0-alpha.15

3 years ago

0.19.0-alpha.13

3 years ago

0.19.0-alpha.12

3 years ago

0.19.0-alpha.11

3 years ago

0.19.0-alpha.10

3 years ago

0.19.0-alpha.9

3 years ago

0.19.0-alpha.8

3 years ago

0.19.0-alpha.7

3 years ago

0.19.0-alpha.6

3 years ago

0.19.0-alpha.5

3 years ago

0.19.0-alpha.4

3 years ago

0.19.0-alpha.3

3 years ago

0.19.0-alpha.2

3 years ago

0.19.0-alpha.1

3 years ago

0.19.0-alpha.0

3 years ago