Code Monkey home page Code Monkey logo

readr-ui's Introduction

Readr UI

A monorepo for READr UI Vue.js Componets.

Workflow dependencies

  • Lerna for managing monorepo workflow.
  • vue-sfc-rollup for scaffolds a minimal setup for Vue Single File Component (SFC).
  • Storybook with development environment for UI components.

Utilities dependencies

Dependency management

Use yarn instead of npm, since we take advantage of Yarn Workspaces to increase the bootstrap performance. For more information about Lerna + Yarn Workspaces, check this article.

Scripts

Bootstrapping

# Install dependencies
yarn install

# Link local packages together and install remaining package dependencies
# https://github.com/lerna/lerna/tree/master/commands/bootstrap#readme
# you can omit npx if you had installed lerna globally.
npx lerna bootstrap

Developing

# Scaffolds a minimal setup for Vue Single File Component (SFC)
yarn sfc-init

Caveats

  • Naming
    • Package's name is scoped with @readr-ui, for example: @readr-ui/new-component.
    • Folder's name pattern of packages is: /packages/readr-ui-*/.
    • Entry SFC name pattern is: readr-ui-*.vue.
  • Workflow
    • Choose "Single Component mode" after yarn sfc-init.
    • Remember to add "publishConfig": { "access": "public" } to scoped package's package.json.
    • Modify the version in scoped package's package.json below to 1.0.0, for better developing experence with lerna publish, since lerna will always bump the version when publishing.
# For rapid prototyping a single Vue.js SFC
yarn serve packages/readr-ui-*/src/readr-ui-*.vue
# Start the storybook at localhost:6006
yarn storybook

Add packages

# Install package-1 to package-2
npx lerna add package-1 --scope=package-2
  • For more information about lerna add, check the doc.
  • You could add local or remote package as dependency to packages in the current Lerna repo.
    • Example of add remote package: lerna add babel --scope=@readr-ui/app-header.
    • Example of add local package: lerna add @readr-ui/logo --scope=@readr-ui/app-header.

Linting

# Lint all the .js and .vue files in the codebase
yarn lintall

# Fix all the lint errors and warnings
yarn lintfix

Publishing to npm

# Publish packages in the current project
npx lerna publish

Caveats

  • DO NOT PUSH COMMITS MANUALLY after commit your changes, let lerna publish do this job.
    • lerna publish will calling lerna version behind the scenes, for more information, check the doc.

readr-ui's People

Contributors

kwhsiung avatar hsuehyungtan avatar yeefun avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.