@fleet.co/tarmac
TypeScript icon, indicating that this package has built-in type declarations

3.10.16 • Public • Published

Tarmac : Fleet Design System

NPM JavaScript Style Guide





Tarmac is fleet.co's Design System.
It is based on create-react-library, styled-components.



List of components

  • Modal ({Modal})
  • Confirmation Modal : yes or no modals ({ConfirmationModal})
  • Alert : alert message, mainly used in modals ({Alert})
  • Switch/Toggle ({Switch})
  • Label ({Label})
  • Line : grey line to separate items ({Line})
  • Title ({Title})

Ongoing development : Button ({Button}), , Input



Install

npm install @fleet.co/tarmac



Use local version in your project

First, make a local copy of this repo and reach to its folder with your IDE.
Run command

npm build

This will create a dist folder. Reach to it with your IDE and run command

npm link

Now reach to your project's folder and run

npm link @fleet.co/tarmac

In your project's folder, navigate to your node_modules/react folder then

npm link

Go back to the Design System folder and

npm link react

This will create 2 symlinks to use your local DS in your local project. Now launch your design system and your project

npm run start



Use example

To ease the new components creation, you will find an example project within the Design System itself.
To launch it, navigate to your DS folder/example and write

npm run start

In the App.js file in the example folder, call your newly created components as described in "Usage" section.



Publish a new version

To publish the new version of your DS to npm, run

npm run publish-package

This will create a new build, patch the current version, publish to npm and push changes to master.
If everything went smoothly, you will see the following message in your IDE : "Design System successfully updated to X.X.X"

Wait for the new version to be released on npm, then go back to your project's folder and install it

npm i @fleet.co/tarmac



Usage

import React from 'react'

import { MyComponent } from '@fleet.co/tarmac'

const myPage = () => {
  return <MyComponent />
}



Troubleshooting

In case you're facing issue at installing the DS locally, please make sure no process is currently running in both your project and the DS. If so, kill them all and try the "use locally" procedure again.
You may also have to delete your node_modules folders in both your project and the DS. Then reinstall all packages in both folders and try the "use locally" procedure again.
If you get an error related to React Hooks after launching your project, it is probably related to the fact you have two different instance of React running in your project and in the DS (ie your symlink didn't work). Kill all process, redo the react symlink and start again.



License

MIT © @fleet.co

Readme

Keywords

none

Package Sidebar

Install

npm i @fleet.co/tarmac

Weekly Downloads

321

Version

3.10.16

License

MIT

Unpacked Size

1.73 MB

Total Files

72

Last publish

Collaborators

  • mathildebordeau
  • augustinfleet
  • mathiasbn
  • lorys_fleetos
  • bbrizzi
  • nellyfleet