Create a new library:
npx @stoplight/scripts create:lib
sl-scripts build
sl-scripts bundle
sl-scripts create:lib
sl-scripts help [COMMAND]
sl-scripts release
sl-scripts release:docs
Build source code
USAGE
$ sl-scripts build
OPTIONS
--verbose moar logs
EXAMPLE
$ sl-scripts build
See code: dist/commands/build/index.ts
Bundle source code
USAGE
$ sl-scripts bundle
OPTIONS
--minify minify output using terser
--verbose moar logs
EXAMPLE
$ sl-scripts bundle
See code: dist/commands/bundle/index.ts
Scaffold out a new library.
USAGE
$ sl-scripts create:lib
EXAMPLE
$ sl-scripts create:lib
See code: dist/commands/create/lib.ts
display help for sl-scripts
USAGE
$ sl-scripts help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
Publish new src or docs release.
USAGE
$ sl-scripts release
OPTIONS
--verbose moar logs
EXAMPLES
$ sl-scripts release
$ sl-scripts release:docs
See code: dist/commands/release/index.ts
Push built docs to github pages.
USAGE
$ sl-scripts release:docs
OPTIONS
--dry-run run the release process but do not publish
--verbose moar logs
EXAMPLE
$ sl-scripts release:docs
See code: dist/commands/release/docs.ts
Simply create a jest.config.js
file in the root of your project, and extend the default config. For example:
// ./jest.config.js
module.exports = {
preset: "@stoplight/scripts",
};
Simply create a tsconfig.json
file in the root of your project, and extend the default config. For example:
// ./tsconfig.json
{
"extends": "@stoplight/scripts/tsconfig.json",
"include": ["src"],
"compilerOptions": {
"outDir": "dist"
}
}
Simply create a tslint.json
file in the root of your project, and extend the default config. For example:
// ./tslint.json
{
"extends": ["@stoplight/scripts/tslint.json"]
}
Simply add a release
property to your package.json
file. For example:
// ./package.json
{
// ... props
"release": {
"pkgRoot": "dist",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator"
]
}
// ... props
}
By default all dependencies
and peerDependencies
declared in your package.json
will be treated as external deps during sl-scripts bundle
. If you would like to always bundle a dep, list those deps in your package.json
file like so:
{
"name": "your-package",
"version": "0.0.0",
"rollup": {
"bundleDeps": ["dep-1", "dep-2"]
}
}