Skip to content
Snippets Groups Projects
readme.md 2.86 KiB
Newer Older
  • Learn to ignore specific revisions
  • Markus Kaarto's avatar
    Markus Kaarto committed
    # HUDS developer guide, basic workflow
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    ## Install
    
    1. `yarn install`
    2. `yarn start` should start a dev server in port 3333. It displays the content from src/index.html
    
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    ## Stencil
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    1. Have discussions with designers, agree on basic functionality
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    2. run `yarn generate` to generate a blanc component and start developing
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    3. Review the design with designer and PO or a colleague
    4. Check with basic accessibility tools (TBD which tools?!?)
    5. Build the library with `yarn build`. This will generate a .md file with some technical documentation to the components folder. Add your own desicription and instructions. At least it should
    
    Markus Kaarto's avatar
    Markus Kaarto committed
       1. Have a short introduction
       2. List all states the component can be in.
       3. List all variants the component can have
       4. Include code examples
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    6. Write unit tests where it makes sense. We use jest and puppeteer.
    7. Make a merge request and ask a colleague for a review
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    ## Adding documentation to Vuepress
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    You should install the documentation project from https://version.helsinki.fi/julkiset-sivut/design-system.
    
    To run it with your version of the design system, follow these steps:
    
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    1. Clone the repo and install dependencies with `yarn install`
    2. By default the library uses the latest version from npm. To use newer library version, see linking instructions below
    3. Add necessary .md files to VuePress /docs folder and update `.vuepress/config.js`
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    In case you want to develop and see the component inside documentation right away, you can adapt the following workflow:
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    Inside the library folder, make a dynamic link of the library:
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    `yarn link`
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    `yarn build.watch` (this builds the library on each save, so your changes will be reflected inside VuePress, thanks to the dynamic link)
    
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    Inside the Vuepress project
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    `yarn link <library project name>`
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    `yarn docs:dev`
    
    Markus Kaarto's avatar
    Markus Kaarto committed
    Currently you need to manually sync .md files between the library and VuePress code bases. Best workflow could be to write documentation inside VuePress and then finally sync with matching file in library.
    
    
    ## Running with Docker (WIP)
    
    If you don't want or cannot install node and other dependencies, you can run the development setup locally in a container like this:
    
    
    Joni Korhonen's avatar
    Joni Korhonen committed
    `docker-compose up`
    
    Image can be rebuilt with `docker-compose build` if needed for example after a node package was added.
    
    
    ## Making a release
    
    After review is passed for both the library and documentation, changes can be merged to development branch. Both the library and the VuePress documentation follows similar process.
    
    NOTE: remeber to check that the documentation project has a correct library dependency (version number) before making the merge.
    
    The release process:
    
    1. Merge the development branch into master
    2. Run `yarn version` and bump the version number. This automatically creates a git tag with the new version
    3. Push your changes. Then remeber also to update the tags in the remote like this: `git push origin --tags`