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

Refactor each component into it's own separate folder #83

Open
the-halfbloodprince opened this issue Oct 25, 2021 · 10 comments
Open

Refactor each component into it's own separate folder #83

the-halfbloodprince opened this issue Oct 25, 2021 · 10 comments

Comments

@the-halfbloodprince
Copy link
Contributor

Refactor each component into it's own separate folder. for eg.

IMPORTANT: Branch to contribute to: convert_to_npm

Current:

components
|---Button.js
|---Button.tsx
|---Button.md
|---Button.d.ts

Desired:

components
|---Button
      |---Button.js
      |---Button.tsx
      |---Button.md
      |---Button.d.ts

IMPORTANT: Also accordingly fix its import in index.js and index.ts for each component appropriately.

@smabbett
Copy link

Can you assign this to me?

@the-halfbloodprince
Copy link
Contributor Author

Sure go ahead! @smabbett

@smabbett
Copy link

I'm having trouble running the project. Yarn installed, and I ran 'yarn start'. I'm getting some warnings. Is there anything else I need to install?

@the-halfbloodprince
Copy link
Contributor Author

the-halfbloodprince commented Oct 25, 2021

There was some heavy refactoring in the past couple of days which aren't yet fully completed as this is an active development branch as you can tell. Sorry for the hassle. Can you share screenshots of the warnings @smabbett ?

If something's quite serious at the moment, you can use the library this way (I'll update this somewhere for future reference) :

  1. Open the artix folder on your local machine and run npm link. This is kindof a local equivalent of publishing the project to npm. However, this won't actually publish it to npm, it will just tell your local npm cli that if some other project tries to install a package with this name, this is the package, just copy it from here to that project's node_modules.
  2. Open any other project, preferably a dummy or a new react project, and run npm link artix. This is the equivalent of npm install artix. This will copy the contents from the artix project to the node_modules of this project.
  3. Now you can import stuff into your dummy/new project from artix as you would do from any component library.

Refer to this simple article if I wasn't clear enough: https://simplernerd.com/test-npm-package-locally/

Hope this helps. Sorry for all the trouble. Do let me know if you face any difficulties.

@smabbett
Copy link

Screen Shot 2021-10-25 at 2 27 09 PM

Here's some of the warnings. they all say the same thing I think.

@the-halfbloodprince
Copy link
Contributor Author

Okay I'll take a look at them. Read my previous comment to see how to actually use it, and for this issue, given we didn't see this earlier, you can still work for now without running it as it involves just some easy refactors, till we fix this. Works? @smabbett

@smabbett
Copy link

I did a pull request

@the-halfbloodprince
Copy link
Contributor Author

Yeah @smabbett it's merged. But I see you didn't fix the imports so could you send another PR fixing the imports in the index.js and index.ts files? I mentioned it as the last line in the description of this issue. Take a look.

@smabbett
Copy link

Sorry, I'm pretty new to this. I don't see index.js or index.ts files.

@the-halfbloodprince
Copy link
Contributor Author

@smabbett It's in the components folder itself... along with all the folders you created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants