Installation
These instructions may change.
The JDS is still in its early days, and we may still make high level changes, such as what we call the package itself, where the repository is located, and how you import components, as the system matures. Keep an eye on Slack #development for updates.
The Jobilla Design System is managed on Gitlab.
Setup for Jobilla frontend repositories
If you're working on a repository that uses the JDS — including most Jobilla frontend projects, such as JobillaWebSPAs — then you need to set up your local development environment so you can install the JDS as a dependency.
This procedure is required to run yarn on your project, and to add the JDS to an existing project.
Requirements
- Yarn to install dependencies.
- A GitLab account with permissions to access the Jobilla organization.
Setup steps
- Obtain a new Gitlab Personal Access Token from your User Settings. Give it the
read_apiscope to grant access to the package registry. - In your terminal, replacing
$GITLAB_TOKENfor the token you just generated, run:npm config set '//gitlab.com/api/v4/packages/npm/:_authToken' $GITLAB_TOKEN npm config set '//gitlab.com/api/v4/projects/:_authToken' $GITLAB_TOKEN - Run
yarnlike usual.
Adding the JDS to a project
Follow these instructions to start using JDS components in a frontend project.
- Follow the "Setup Steps" above to ensure you can authenticate to Gitlab .
- Within your project's
.yarnrcfile as a separate line:This registers the Jobilla private package registry for"@jobilla:registry" "https://gitlab.com/api/v4/packages/npm"@jobillapackages. - In your terminal, while in the project root directory, run:
yarn add @jobilla/jobilla-design-system - In your vue entry file (often main.ts), apply the JDS as a vue plugin:
import { JobillaDesignSystem }from '@jobilla/jobilla-design-system' Vue.use(JobillaDesignSystem) - To add the JDS-required CSS to your project, if you're running a Vue frontend, in the
src/main.ts(or other entrypoint) file, add:import '@jobilla/jobilla-design-system/jds.css'; - JDS components are globally loaded, so you can directly use the component normally:
<jds-button>Hello World</jds-button> - The JDS has some top-level Providers which you should place near the top of your DOM tree. These providers let you pass in global configurations to the JDS, which get passed down to JDS components down the tree. See the
LocaleProviderandTextProvider.
Peer dependencies
The JDS relies on a few peer dependencies which you are expected to install:
| Vue-tippy | yarn add vue-tippy@^4.5.1, and Vue.use(VueTippy). |
| portal-vue | yarn add portal-vue@^2.1.7, and Vue.use(PortalVue). |
| vee-validate v3 |
|
| vue-i18n | yarn add vue-i18n@^8.0.0, and wire up to the Jobilla translation management system. |
| inert |
You may need a separate CSS file, depending on your content security policy settings. |
Debugging
- Getting a 403 Forbidden on
yarn add: make sure you've completed the "Setup Steps" to add your authentication token.