mits-ui v1.1.1
MITS-UI
Shared Svelte components package for MITS frontend services.
Known issues
- Using these components in .astro files cause TypeScript errors as astro has trouble getting the types. Fix currently unknown
- It is difficult to ensure that Tailwind styles defined in the package
work in consumer projects as there seems to be another bug related to the PostCSS integration
or something else, not exactly sure atm, for example
mb-3
does not work when importing the package in a different project butmb-4
does. Something to keep in mind. Current workaround is to@apply
the problematic Tailwind classes.
Local development
Everything that should be exported must be in src/lib/*
, that's the folder
that gets built during publishing.
Local publishing
During development phase you shouldn't publish WIP code, to test your new solution in a consumer project, you should follow these steps to accurately simulate the publishing of this package.
Once you're ready to "publish" and have ensured that all necessary stuff is in the correct folder, run
npm run package
to lint your package and build yourdist
folder.To create a local version of the npm package, run
npm pack
The output will be a file named mits-ui-<package.json version>.tgz
Locally consuming the package
package.json
allows us to reference an npm module locally, so we can utilize this to consume the mits-ui
package.
Go to the project where you intend to use this package and modify the dependencies.
Simply give the mits-ui
dependency a path to the file you generated in the last step.
Example:
{
"dependencies": {
"mits-ui": "../packages/mits-ui/mits-ui-x.x.x.tgz"
}
}
After this, in the consumer project, you should npm install
if you
didn't have this package before and npm update mits-ui
if you did.
If you have trouble synching changes between mits-ui and your consumer project then always try running the update command, npm might not pull in new changes if you haven't bumped package.json version which you shouldn't do during development.
Publishing the package
Once you're satisfied with your changes and are ready to publish, simply bump the
package version in package.json
.
NB! If you don't know what Semantic Versioning is then read THIS before you fuck up the package version.
After bumping the package version you're ready to publish. Run,
npm publish --access=public
and you're done.