0.0.0 • Published 2 years ago
iris-ui-adapter v0.0.0
Iris - UJET Adapter Component Library
Getting Started
Before running the styleguide, make sure to run npm install in the following directories:
- src/components/drag-n-drop
Scripts
- NOTE: This styleguide requires npm 6 and node 12 or higher
bash ujet.shruns the styleguide with the white label service (recommended)startruns the static html page, reloading on file changesstyleguidebuilds and runs the style guidestyleguide-angularjsbuilds and runs an AngularJS sandbox
Tooling configs
For most of the tools, the configuration is in the package.json to reduce the amount of files in your project.
Build & publish a component
- From the root directory of the project (
ujet-fe-ui-component/) runbuild(builds all the components) orbuild:component-name(builds the specific component) - The previous process will generate a
buildfolder, under this folder you will find all the bundled files Runcd build/component-name - Run
npm publish(make sure you've previously configured a Github token)
NOTE: Make sure you bump the version before publishing the library, if you don't change the version and there was a package published before with the same version it won't publish your changes.
Hooking a new component into the build process
- Under the new component folder create a file called
rollup.config.jswith the following content:
import common from '../../../rollup.common.config'
import copy from 'rollup-plugin-copy'
const copyConfig = {
targets: [{ src: 'src/components/{{component-name}}/package.json', dest: 'build/{{component-name}}' }]
}
const mergedConfig = Object.assign({
input: ['src/components/{{component-name}}/{{component-name}}.lit.js'],
output: {
file: 'build/{{component-name}}/{{component-name}}.lit.js',
format: 'es'
}
}, common)
mergedConfig.plugins.push(copy(copyConfig))
export default mergedConfig- Replace all the ocurrences of
{{component-name}}with the name of your component - Modify the
root package.jsonand add a script for building your new component:
"build:component-name": "rollup -c ./src/components/component-name/rollup.config.js",- Finally append this command to the existing build command
"build": "... &&& npm run build:component-name",FAQ
Q: I keep getting "TypeError: url_1.pathToFileURL is not a function" when trying to run the styleguide. What's the issue?
A: Use node v12 or higher.
0.0.0
2 years ago