@disqada/workspace
v1.6.2
Published
Generate types and docs with a click
Downloads
17
Maintainers
Readme
Workspace
Badges
Table of Contents
About
This tool is used to generate both declarations and documentations with couple of clicks.
License
Copyright © 2022 DisQada
This framework is licensed under the Apache License, Version 2.0.
See the LICENSE file for more information.
Getting Started
Configurations
Add the file workspace.json
to your project, below a table of all possible configurations that can be used.
| Property | Type | Default value | Description | | -------- | ------ | ------------- | -------------------------------------- | | root | string | src | Source code folder | | types | string | types | Generate declarations into this folder | | out | string | docs | Generate documentation this folder | | npm | string | name | Project name in npm | | github | string | Name | Project name in GitHub |
Usage
Shell Command
To call the package's functionality, use the workspace
shell command, which accepts the following properties:
| Name | Type | required | description | | ------------- | -------- | -------- | ---------------------------------------------------- | | path | Argument | NO | configuration file path, default: "./workspace.json" | | --no-config | Option | NO | Use it to not re-setup the configurations | | --types OR -t | Option | NO | Emit declarations files | | --docs OR -d | Option | NO | Emit documentations files |
npm Scripts
Below are the recommended npm scripts:
We recommend regenerating the types every time the docs are created to be sure that we're documenting the latest types
types
: Generates declarations after re-setting up configurationsdocs
: runestypes
then generates documentations
"scripts": {
"types": "workspace ./workspace.json -t",
"docs": "workspace ./workspace.json -t -d",
}
If you rarely change the configurations, you can make two script for each script to reduce the run time
"scripts": {
"types": "workspace ./workspace.json -t --no-config",
"types:conf": "workspace ./workspace.json -t",
"docs": "workspace ./workspace.json -t -d --no-config",
"docs:conf": "workspace ./workspace.json -t -d",
}