kaabu-template v1.0.0
Kaabu Template
Design system for creating Kaabu-like UI components.
Installation
npm install kaabu-template
Configuration
Configure in your own project
How to create and configure your own npm repository
Let's take "example" as our new project name:
Create and open the directory
mkdir example cd example
Initialize the npm project
npm init -y
Install typescript:
npm install typescript
We are using typescript, so copy these settings:
{
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"/dist"
],
}
Initialize typescript
npx tsx --init
Setup tsconfig.json base options (you can customize it to your needs)
{ "compilerOptions": { "module": "CommonJS", "target": "ES2015", "sourceMap": true, "outDir": "./dist", "moduleResolution": "node", "noImplicitAny": true, "declaration": true }, "include": "src/*/", "exclude": "node_modules" }
Create the source directory and add an index file
mkdir src cd src touch index.ts
Add whatever files you want and export them
Once you're finished editing your project and are ready to publish:
let's convert our typescript to javascript
npx tsc
It creates the dist folder with all the typescript files converted.
We are now ready to publish our library to npm.
Login to npm
npm login
2 years ago