0.47.6 • Published 5 years ago
treact-ui v0.47.6
Treact UI Components
Requirements
Installation & Usage
Project Setup:
create-react-app my-app
cd my-app
touch .npmrc
Copy the content of this proejct's .npmrc.azure file to your project's .npmrc and enter your credentials (password etc.) in this file for the placeholders.
Then on command line:
npm install @tls/treact-ui styled-components
In your global CSS:
html,
body {
font-size: 1px;
}
And last but not least, in one of your React components:
import React from 'react';
import { Atoms } from '@tls/treact-ui';
const { ContentButtonPrimary } = Atoms;
const App = () => {
return (
<div>
<ContentButtonPrimary label="Click me" />
</div>
);
};
export default App;
You are ready to go.
Relative Imports
Keep the bundle size small with relative imports:
import React from 'react';
import ContentButtonPrimary from '@tls/treact-ui/lib/ContentButtonPrimary';
const App = () => {
return (
<div>
<ContentButtonPrimary label="Click me" />
</div>
);
};
export default App;
Contribution to Library
Setup:
git clone git@gitlab.com:TRUMPF-corp/treui/ui-components.git
cd ui-components
- follow .npmrc
npm install
.npmrc
Add npm credentials from azure feed to your local .npmrc file. The credentials can be obtained by going to the TcXLibrary Feed: Connect To Feed > NPM > Generate NPM Credentials.
- Rename .npmrc.azure to .npmrc
- Add your password credentials from Azure Dev Ops to .npmrc
Scripts
Run Storybook:
npm run storybook
Build Storybook:
npm install -g http-server
npm run storybook-build
http-server dist/
Build Library:
npm run build
Run Tests:
npm test
npm run test:watch