JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q28954F
  • License ISC

a command line tool to create, rename and delete typed react components and other helpers

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-component-blueprint) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    React Component Blueprint

    A command line helper to generate typed react components.

    Usage

    npm install --save-dev react-component-blueprint

    Create component (Camelcase names)

    The tool will automatically camelerize the component's name

     npx create-component spinner
     # output
     src/components/
        Spinner/
          - index.ts
          - Spinner.tsx
          - Spinner.css
          - Spinner.test.tsx
          - Spinner.stories.tsx

    Creata multiple components

     npx create-component Input Numeric
     # output
     src/components/
        Input/
          - index.ts
          - Input.tsx
          - Input.css
          - Input.test.tsx
          - Input.stories.tsx
    
        Numeric/
          - index.ts
          - Numeric.tsx
          - Numeric.css
          - Numeric.test.tsx
          - Numeric.stories.tsx

    Delete component

    npx delete-component Input
    # delete multiple
    npx delete-component Input Button Other

    Rename a component

    npx rename-component Input CustomInput
    # before
    src/components/
      Input/
        - index.ts
        - Input.tsx
        - Input.css
        - Input.test.tsx
        - Input.stories.tsx
    
    # result
    src/components/
      CustomInput/
        - CustomInput.ts
        - CustomInput.tsx
        - CustomInput.css
        - CustomInput.test.tsx
        - CustomInput.stories.tsx

    Contribution

    git clone git+https://github.com/fabrigeas/react-component-blueprint.git
    cd react-component-blueprint
    git checkout -b feature/your-feature-name
    # make changes and commit
    git push origin feature/your-feature-name
    # create merge request

    Deployment and publishing the npm package

    grunt publish:minor # update the minor npm version and publish
    grunt publish:major # update the major npm version and publish
    grunt publish:patch # update the patch npm version and publish
    grunt publish # is equivalent to grunt publish:patch

    Resources

    https://blog.developer.atlassian.com/scripting-with-node/