npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

tc-ui-toolkit

v6.2.9

Published

React components used to develop tools for the desktop app translationCore

Downloads

540

Readme

tc-ui-toolkit

Build Status npm npm

React components used to develop tools for the desktop app translationCore.

Usage

First, install the package using npm:

  npm install tc-ui-toolkit --save

Then, require the package and use it like so:

import { CheckInfoCard } from 'tc-ui-toolkit';

class App extends Component {
  render() {
    return (
      <CheckInfoCard />
    )
    ;
  }
}

Contributing

Environment setup

  • Run npm run setup

    or

  • npm i

  • npm run build

  • npm link or sudo npm link

  • cd tc-ui-toolkit-test

  • npm i

  • npm link tc-ui-toolkit

Git Branch Management

Note:

  • I am using the feature branch named my-feature-branch which is a branch you would have created on the unfoldingWord/tc-ui-toolkit repo for your feature implementation.
  • You do not have to do anything different if your changes are reflected in a translationCore tool. Because the tool will get its node_modules from translationCore during runtime.
  1. Checkout the master branch for tc-ui-toolkit(pull latest), create/checkout your branch called my-feature-branch.
  2. Implement your feature on my-feature-branch and test it in the tc-ui-toolkit-test app (That workflow is outlined below)
  3. Push your changes from my-feature-branch to the tc-ui-toolkit origin
  4. Once you are ready to test your app on the translationCore repo run npm i unfoldingWord/tc-ui-toolkit#my-feature-branch in your translationCore root directory
    • This will give you the changes you made on tc-ui-toolkit/my-feature-branch without having to do a premature npm publish
  5. Ensure all changes work as expected on translationCore branch.
    • Note the workflow to make more changes from your my-feature-branch and test them on translationCore is to simply repeat step 3, and then run rm -rf node_modules/tc-ui-toolkit; npm i tc-ui-toolkit; in the translationCore root directory. This will give you the pushed changes without having to re-install all the node_modules
  6. When the feature you implemented is ready and all tests are passing then you are ready for PRs.
  7. run npm uninstall tc-ui-toolkit; npm i tc-ui-toolkit; in the translationCore root directory
    • This will ensure that you do not have the tc-ui-toolkit branch as a npm version. That was merely for testing, not production.
  8. Make a PR on the unfoldingWord/tc-ui-toolkit repo with your feature implementation my-feature-branch
  9. After the feature branch on tc-ui-toolkit gets merged make a PR on the translationCore repo with a new branch that includes the latest tc-ui-toolkit version
    • Note: up until now you did not have to push any changes to a branch for the tc-ui-toolkit feature implementation. At this point you will have to do so in order to see changes you made in my-feature-branch, reflected in translationCore.
  10. Once the PR has been merged, verify the fix from my-feature-branch is still working.

Publish Workflow

  1. Review and test PR
  2. If requirements are met merge it
  3. Checkout to master branch
  4. run git pull
  5. Bump package version number
    • Usually will usually be a minor version check for me https://docs.npmjs.com/cli/version
  6. npm i
  7. npm publish
  8. git push

Component Development

tc-ui-toolkit components should be developed inside their own folder in the src folder.

Use the CheckInfoCard component as a guide to develop your own tc-ui-toolkit components.

Commands to get your development rolling

  • Terminal 1
    • In the root directory of tc-ui-toolkit
      • npm start so that webpack watches your changes and reloads (Live hot reloading). or
      • npm build src to build your components code without watching for changes.
  • Terminal 2
    • In the tc-ui-toolkit-test directory (To render the component in the browser)
      • cd to tc-ui-toolkit-test
      • run npm start
      • Then the tc-ui-toolkit-test app should open in your default browser.

Directory & file structure (Root directory of components within tc-ui-toolkit)

src
│  index.js
│  index.test.js
│
└───CheckInforCard
│   │   CheckInfoCard.js
│   │   CheckInfoCard.test.js
│   │   CheckInfoCard.styles.css
│   │   index.js
│   │   ...
│
└───ComponentName
│   │   ComponentName.js
│   │   ComponentName.test.js
│   │   ComponentName.styles.css
│   │   index.js
│   │   ...
│   └───SubComponentName
│   │    │   ComponentName.test.js
│   │    │   ComponentName.styles.css
│   │    │   index.js
│   │    │   ...
│   └───SubComponentName
│       │   ComponentName.test.js
│       │   ComponentName.styles.css
│       │   index.js
│       │   ...
│
└───ComponentName
    │   ComponentName.js
    │   ComponentName.test.js
    │   ComponentName.styles.css
    │   index.js
    │   ...

Rendering your Component UI in the browser

  • To render your Component UI in the browser edit the App.js file inside the src folder in tc-ui-toolkit-test by including/importing the component as follow:
import { CheckInfoCard } from 'tc-ui-toolkit';

If you want to add additional components then import them as follow:

import { CheckInfoCard, OtherComponentName } from 'tc-ui-toolkit';

Then use the UI component as follow:

class App extends Component {
  render() {
    return (
      <div style={{ padding: '10px' }}>
        <CheckInfoCard
          title="save, saves, saved, safe, salvation"
          phrase='The term "save" refers to keeping someone from experiencing something bad or harmful. To "be safe" means to be protected from harm or danger.'
          seeMoreLabel="See More"
          showSeeMoreButton={false}
          onSeeMoreClick={() => console.log('clicked')}
        />
      </div>
    );
  }
}

References:

For material-ui-next related questions go to the material-ui-next website