# auth0-toolkit **Repository Path**: mirrors_auth0/auth0-toolkit ## Basic Information - **Project Name**: auth0-toolkit - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-08 - **Last Updated**: 2026-05-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
CLI toolkit for common scripts for JS/TS Auth0 projects
--- Inspired by ["Tools without config"](https://blog.kentcdodds.com/automation-without-config-412ab5e47229), ["The Melting Pot of JavaScript"](https://youtu.be/G39lKaONAlA), and [kcd-scripts](https://github.com/kentcdodds/kcd-scripts). - [Usage](#usage) - [Configuration](#configuration) - [Overriding Configuration](#overriding-configuration) - [API](#api) - [Modules](#modules) - [build](#build) - [doc](#doc) - [format](#format) - [init](#init) - [lint](#lint) - [precommit](#precommit) - [test](#test) - [validate](#validate) - [Author](#author) - [License](#license) ## Usage 1. Create a project: - `npm init new-auth0-project` - If it's a TypeScript project: add `types` into `package.json`. For example: - `{ "types": "lib/index" }` 1. Install auth-toolkit: - `npm install --save-dev auth0-toolkit` 1. Run the initialization script: - `npx auth0-toolkit init` 1. Use included scripts: - `npm run build -- --watch` - `npm run build:doc` - `npm run validate` - `npm run format` - `npm run lint` - ... etc. # Configuration This toolkit exposes a bin called `auth0-toolkit`. All scripts are stored in `lib/scripts` and all configuration files are stored in `lib/config`. The toolkit determines whether a project is a TypeScript project or JavaScript project depending on whether the `types` property exists in `package.json`. All included tools can have their configuration overwritten by adding flags to the command or by including configuration files in the root of your project. For example: running `auth0-toolkit format` will run Prettier with the included configuration, but having a `.prettierrc` in your project will cause the toolkit to use that configuration instead. ## Overriding Configuration During the toolkit setup process, configuration files for the libraries used by the toolkit are created in the project root. Libraries natively supporting an "extend" feature will use those by default to allow for toolkit configuration to be used as a starting point. All configuration can be overridden with configuration files, `package.json` properties, or arguments passed to the toolkit binary. # API ## ModulesBuild project using TypeScript or Babel based on project type.
TypeScript
rsync, because tsc does not allow --allowJs and --declaration parameters at the same time.Babel
--ignore parameter presents, ignores by default: __tests__, __mocks__, __test_supplements__, __test_helpers__, *.(test|spec).(js|ts|jsx|tsx)Generates documentation files.
README.md from the README.hbs handlebars template file and
from JSDoc comments in source files.--configure parameter is present and no configuration file is available, uses the builtin configuration provided by this library.--files parameter given, uses all files recursively in src directory.--template parameter given, uses README.hbs` in project root.Formats project files using prettier.
--config, prettier.config.js, or prettierrc in package.json), the default Prettier configuration will be used.--ignore-path flag is provided or no .prettierignore file is present, the ignore file provided by the library will be used.Initializes the project
The init script generates necessary files and updates package.json. This script is executed automatically during preinstall and postinstall stages.
It can also be manually executed.
The following entries added to package.json:
The following files are created:
Lint project using TSLint or ESLint based on project type.
TSLint
tslint.json or --config is given, uses builtin configuration provided by this library.--project argument is given, uses default TypeScript project directory provided by tsconfig.json in the root of the project.Babel
.eslintrc.js or eslintConfig in package.json) or no --config is given, uses builtin configuration provided by this library.--ignore-path argument is provided, uses .gitignore.--cache by default. (can be disabled with --no-cache)The script that is automatically executed before a commit using lintstaged
--config, lint-staged.config.js, or lint-staged in package.json), uses builtin configuration.lint-staged.Test project using Jest
BABEL_ENV and NODE_ENV to test.--no-watch, --coverage, --updateSnapshot or --watchAll, watches changes.--config, jest.config.js etc.) uses builtin configuration provided by this library.Runs all relevant validation steps on the project
Executes all the validation tasks that are relevent to the project from this list:
linttesttypescriptIf the event that triggers the validation script running is the precommit script,
lint and test will be skipped since they are already ran separately.
Build project using TypeScript or Babel based on project type.
TypeScript
rsync, because tsc does not allow --allowJs and --declaration parameters at the same time.Babel
--ignore parameter presents, ignores by default: __tests__, __mocks__, __test_supplements__, __test_helpers__, *.(test|spec).(js|ts|jsx|tsx)lib | Output destination for built files. (Babel)
| | [--outDir] |lib | Output destination for built files. (Typescript)
| | [--no-clean] | |If present, does not clean target directory.
| | [OTHERS] | |All CLI options used by related binary. (tsc or babel)
Generates documentation files.
README.md from the README.hbs handlebars template file and
from JSDoc comments in source files.--configure parameter is present and no configuration file is available, uses the builtin configuration provided by this library.--files parameter given, uses all files recursively in src directory.--template parameter given, uses README.hbs` in project root.All CLI options used by related binary. (jsdoc2md)
Formats project files using prettier.
--config, prettier.config.js, or prettierrc in package.json), the default Prettier configuration will be used.--ignore-path flag is provided or no .prettierignore file is present, the ignore file provided by the library will be used.If provided, files will not be written to disk. (Defaults to writing to disk)
| | [OTHERS] |All CLI options used by the related binary. (prettier)
Initializes the project
The init script generates necessary files and updates package.json. This script is executed automatically during preinstall and postinstall stages.
It can also be manually executed.
The following entries added to package.json:
The following files are created:
Files to lint
| | [--no-cache] |Disables ESLint --cache arg which is added by this script.
All CLI options used by the related binary. (eslint or tslint)
Lint project using TSLint or ESLint based on project type.
TSLint
tslint.json or --config is given, uses builtin configuration provided by this library.--project argument is given, uses default TypeScript project directory provided by tsconfig.json in the root of the project.Babel
.eslintrc.js or eslintConfig in package.json) or no --config is given, uses builtin configuration provided by this library.--ignore-path argument is provided, uses .gitignore.--cache by default. (can be disabled with --no-cache)A list of files to lint.
| | [--no-cache] |Disables ESLint's --cache arg.
All CLI options used by related binary. (TSLint or ESLint)
| **Example** ```js $ npm run lint $ npm run lint my-file.ts -- --config my-config.json $ npx auth0-toolkit lint $ npx auth0-toolkit lint --no-cache $ npx auth0-toolkit lint my-file.ts ``` ## precommitThe script that is automatically executed before a commit using lintstaged
--config, lint-staged.config.js, or lint-staged in package.json), uses builtin configuration.lint-staged.All CLI options used by the related binary. (lint-staged)
Test project using Jest
BABEL_ENV and NODE_ENV to test.--no-watch, --coverage, --updateSnapshot or --watchAll, watches changes.--config, jest.config.js etc.) uses builtin configuration provided by this library.If provided, tests run once. (Default is watch mode)
| | [OTHERS] |All CLI options used by the related binary. (jest)
Runs all relevant validation steps on the project
Executes all the validation tasks that are relevent to the project from this list:
linttesttypescriptIf the event that triggers the validation script running is the precommit script,
lint and test will be skipped since they are already ran separately.
A list of scripts to specifically run.
| **Example** ```js $ npm run validate custom-validator $ npx auth0-toolkit validate $ npx auth0-toolkit validate custom-validator,another-validator ``` # Author [Auth0](auth0.com) # License This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.