Building is done with command npm run build
or with the equivalent command tsc & vite build
.
After building is done, build files are located in dist folder in project root.
To generate compressed package ready for local deployment use command npm pack
. Command npm pack
produces
compressed file adnet_components-x.y.z.tgz .
Let's say that local npm package resides in desktop folder of user Mark (C:\Users\Mark\Desktop). To install local
npm package use command npm install C:\Users\Mark\Desktop\adnet_components-x.y.z.tgz
.
TODO - explain how to install package from private library repository
Inter.ttf font is bundled in project library. To include it in host project something like this
@font-face {
font-family: Inter;
src: url('../../node_modules/adnet_components/dist/fonts/Inter.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
html {
height: 100%;
font-family: Inter, monospace;
}
should be put in one of hosts css file.
-
In tsconfig.json file noUnusedLocals and noUnusedParameters are set to false. Return them to true and fix code so build would pass with stricter typescript rules.
-
In file vite.config.ts under external properties are listed npm packages that are not bundled into library. Packages date-fns and date-fns-tz should probably also be added. On that note, peer dependency list should be included in package.json file.
-
React contexts are not exported in index.ts file. Should probably be added.
-
Decide what content from folders lib, locale, Models should also be included in index.ts file.
-
All icons exported in index.ts file should probably be replaced with icon factory component.
-
Npm command
npm run build-storybook
or equivalentstorybook build
is not working because of package storybook-fixtures. -
Package storybook-fixtures should be moved from dependencies to devDependencies.