@incodetech/create-dashboard
v0.6.8
Published
CLI tool to create new Incode dashboard applications
Maintainers
Keywords
Readme
@incodetech/create-dashboard
A CLI tool to quickly scaffold a new Incode dashboard application from a template.
Features
- Downloads the latest dashboard template from the IncodeTechnologies/dashboards-ui repository
- Sets up a new project directory with the template code
- Optionally copies the source code of the dashboard UI components instead of using the npm dependency (see
-coption) - Automatically updates the project name and version in
package.json - Guides you through the next steps to get started
Prerequisites
- Node.js (v20 or higher recommended)
- Git with SSH access to GitHub (your SSH key must be added to your GitHub account)
- NPM you also need to be a part of @incodetech org on npm, or you can obtain INCODE_DASHBOARD_NPM_TOKEN from org member in order to install the dependencies which are under private scope of the org.
Installation
You can use this CLI directly with npx
export INCODE_DASHBOARD_NPM_TOKEN=npm_myorgtoken
npx @incodetech/create-dashboard my-dashboardUsage
Create a new dashboard project
npx @incodetech/create-dashboard [options] <project-directory>- Replace
<project-directory>with your desired project name. - If you omit the project name, the CLI will prompt you for one.
Options
-c,--copy-components-source-codeCopy the source code of the dashboard UI components into your new project instead of adding@incodetech/dashboard-uias an npm dependency. This is useful if you want to customize or directly inspect the component implementations.If you do not specify this option, you will be prompted interactively.
What happens?
- The CLI clones the dashboard template from the IncodeTechnologies/dashboards-ui repository using a sparse checkout (only the template app is downloaded).
- It copies the template to your new project directory.
- If you use the
-coption, it copies the source code of the dashboard UI components into your project (undersrc/components) and updates imports accordingly. Otherwise, it adds@incodetech/dashboard-uias a dependency. - It updates the
package.jsonwith your project name and resets the version to0.1.0. - It cleans up any temporary files.
Next steps
After the CLI finishes, follow the instructions:
cd my-dashboard
npm install
npm run devOr if you wish to use yarn:
cd my-dashboard
touch yarn.lock
yarn install
yarn devExample
Create a dashboard project using the npm package for UI components (default):
export INCODE_DASHBOARD_NPM_TOKEN=npm_myorgtoken
npx @incodetech/create-dashboard awesome-dashboardCreate a dashboard project and copy the dashboard UI component source code:
export INCODE_DASHBOARD_NPM_TOKEN=npm_myorgtoken
npx @incodetech/create-dashboard awesome-dashboard -cTroubleshooting
- SSH required: Make sure your GitHub SSH key is set up and you have access to the IncodeTechnologies/dashboards-ui repository.
- Directory already exists: The CLI will not overwrite existing directories.
