Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

116 - Publish npm package for the design system #141

Merged
merged 24 commits into from
Jul 21, 2023

Conversation

MellyGray
Copy link
Contributor

@MellyGray MellyGray commented Jul 6, 2023

What this PR does / why we need it:

This PR publishes the Dataverse Design System to the npm registry. It includes the necessary changes and configurations to publish the design system components and make them available as an npm package.

Which issue(s) this PR closes:

Closes #116

Special notes for your reviewer:

The automation of the publishing will be developed in this other issue:

The creation of a test registry will be developed in this other issue:

To publish a new version of the package you need to be registered in the npmjs.com IQSS organization. Contact me via slack so I can send you the invite!

Suggestions on how to test this:

Test the published package

To test the package:

  1. Create a new React application. I'll go with the first option which is running npx create-next-app in your machine (ensure you have node installed in your machine)
  2. In your app root folder run npm i to install all the packages of the demo app
  3. Follow the instructions from the README of the package @iqss/dataverse-design-system
  4. If you're using npx create-next-app then go to the src/app/page.tsx file
  5. Place the imports at the top of the file with the other imports import { Col, Container, Form, Row} from "@iqss/dataverse-design-system";. If you are using next-js you'll need to set 'use client' at the top of the file since the design system components are client components
  6. Now copy the example code in the usage section of the package README and paste it somewhere inside the Home function of the src/app/page.tsx file
  7. Run the application using npm run dev and go to http://localhost:3000 to see the application using the design system components

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

None

Is there a release notes update needed for this change?:

Published first version of the Dataverse Design System to the npm registry @iqss/dataverse-design-system

Additional documentation:

Lerna publishing

@MellyGray MellyGray linked an issue Jul 6, 2023 that may be closed by this pull request
@MellyGray MellyGray marked this pull request as ready for review July 7, 2023 10:48
@MellyGray MellyGray added the Size: 10 A percentage of a sprint. 7 hours. label Jul 7, 2023
@GPortas GPortas self-assigned this Jul 11, 2023
@pdurbin pdurbin self-assigned this Jul 11, 2023
@GPortas
Copy link
Contributor

GPortas commented Jul 12, 2023

I created the test app and imported the package following the steps and it works great!

designsystem_import_test

page.tsx code:

'use client'

import { Container, Navbar } from '@iqss/dataverse-design-system'

const brand = {
  logoImgSrc: '',
  title: 'Dataverse',
  href: '/home'
}

export default function Home() {
    return (
      <Container>
        <Navbar brand={brand}>
        <Navbar.Link href="/link-1">Link 1</Navbar.Link>
        <Navbar.Link href="/link-2">Link 2</Navbar.Link>
        <Navbar.Dropdown title="Dropdown" id="dropdown">
          <Navbar.Dropdown.Item href="/sublink-1">Sublink 1</Navbar.Dropdown.Item>
          <Navbar.Dropdown.Item href="/sublink-2">Sublink 2</Navbar.Dropdown.Item>
        </Navbar.Dropdown>
      </Navbar>
      </Container>
    )
}

@@ -11,20 +11,27 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: 19
node-version: 18
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why downgrade?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the workflows are using node 18, and the lint workflow was failing, so I thought that could be the issue. But it wasn't. So we can go back to 19, although I think that all workflows should run on the same node version. And also I'm running node 18 in my machine

Copy link
Contributor

@GPortas GPortas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and works great!

@kcondon kcondon self-assigned this Jul 13, 2023
@kcondon kcondon merged commit c4184bc into develop Jul 21, 2023
10 checks passed
@kcondon kcondon deleted the feature/116-publish-npm-package-for-the-design-system branch July 21, 2023 00:07
jayanthkomarraju pushed a commit to jayanthkomarraju/dataverse-frontend that referenced this pull request May 31, 2024
…-for-the-design-system

116 - Publish npm package for the design system
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: 10 A percentage of a sprint. 7 hours.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish npm package for the Design System
4 participants