/zoomint-web-scripts

🔧 A CLI full of useful commands

Primary LanguageTypeScript

Common Web Scripts

Build

Install:

npm i -D @zoomint/web-scripts

Add following scripts to your package.json:

{
  "scripts": {
    "audit": "web-scripts audit",
    "format": "web-scripts format",
    "lint": "web-scripts lint",
    "test": "web-scripts test"
  }
}

Add following files to your project's root directory:

prettier.config.js:

module.exports = require('@zoomint/web-scripts/lib/configs/prettier.config');

Extending default configuration

Web Scripts

Add web-scripts.config.js:

module.exports = Object.assign({}, require('@zoomint/web-scripts/lib/configs/web-scripts.config'), {
  // ...
});

Options:

Property name Default Value Description
auditFilename vulnerabilities Filename of the vulnerabilities report
auditLevel critical Severity level of audit command
testResultsDestination ./test-results Directory for code coverage, vulnerabilities report

Linting

Add .eslintrc.js:

module.exports = {
  extends: ['./node_modules/@zoomint/web-scripts/lib/configs/eslintrc.js'],
  // ...
};

Testing

Add jest.config.js:

module.exports = Object.assign({}, require('@zoomint/web-scripts/lib/configs/jest.config'), {
  // ...
});

Development

Scripts

npm run ... Description
audit runs a security audit
build builds the web scripts
clean cleans ./lib directory
format formats source files
lint runs linter
test runs tests

Sources in no particular order