@disqada/workspace

1.5.1 • Public • Published

Workspace

Badges

github npm

version monthly downloads

Test semantic-release

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

npm scripts

The tool is used via npm scripts that are already defined in it's package.json file, and can be called from your project npm scripts directly.

Below are the available npm scripts:

  • setup: Install the required packages as dev dependencies
  • config: Read and cache the configuration file
  • types: Generate declarations using cached configurations then clean
  • clean: Clean the declaration files
  • doc/docs: Generate documentations using cached configurations

First thing to do is to run the following command to install all the necessary dependencies

npm explore @disqada/workspace -- npm run setup

You'll most likely have the following scripts, use the setup script on initialisation and every time you update the configuration file, then use the types and doc/docs scripts for generating declarations and documentation

"scripts": {
    "config": "npm explore @disqada/workspace -- npm run config",
    "types": "npm explore @disqada/workspace -- npm run types",
    "docs": "npm explore @disqada/workspace -- npm run docs"
}

If you're constantly changing the configurations, you can make one script that reads the configurations and generates the declarations/documentation like the following example:

"scripts": {
    "types": "npm explore @disqada/workspace -- npm run config && npm explore @disqada/workspace -- npm run types",
    "docs": "npm explore @disqada/workspace -- npm run config && npm explore @disqada/workspace -- npm run docs"
}

Package Sidebar

Install

npm i @disqada/workspace

Weekly Downloads

5

Version

1.5.1

License

Apache-2.0

Unpacked Size

34.6 kB

Total Files

14

Last publish

Collaborators

  • nabil_alsaiad