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

docs: add react with vite installation guide #714

Merged
merged 9 commits into from
Jun 30, 2023

Conversation

thesambayo
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Jun 25, 2023

⚠️ No Changeset found

Latest commit: ea97d91

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jun 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 30, 2023 5:20pm
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-template ⬜️ Ignored (Inspect) Jun 30, 2023 5:20pm

@vercel
Copy link

vercel bot commented Jun 25, 2023

Someone is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@OwaisAD OwaisAD left a comment

Choose a reason for hiding this comment

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

works well

@shadcn
Copy link
Collaborator

shadcn commented Jun 26, 2023

@samuelkurdz Thanks so much for creating the docs for this. Can we move it to installation.mdx?

@dan5py
Copy link
Contributor

dan5py commented Jun 26, 2023

Can we move it to installation.mdx?

I was thinking the same thing. It would be great to have tabs in the Installation page for all the different frameworks.

@thesambayo
Copy link
Contributor Author

@samuelkurdz Thanks so much for creating the docs for this. Can we move it to installation.mdx?

@shadcn Yes of course.
Although I initially created the React with vite page like a sub-page under installation.

 {
  title: "Installation",
  href: "/docs/installation",
  items: [
    {
      title: "React with vite",
      href: "/docs/react-with-vite",
      items: [],
    },
  ],
},

but it did not appear as such.

@dan5py
Copy link
Contributor

dan5py commented Jun 26, 2023

@samuelkurdz Something like this:

image

@thesambayo
Copy link
Contributor Author

thesambayo commented Jun 26, 2023

@dan5py Is anyone on this? or can I?

@dan5py
Copy link
Contributor

dan5py commented Jun 26, 2023

@samuelkurdz I don't think so, go ahead

@thesambayo
Copy link
Contributor Author

@dan5py I kind of have a decision between the page quick links by the right.
so I want to share between the options I created.

1.

Screenshot 2023-06-26 at 14 03 09

2.
Screenshot 2023-06-26 at 14 01 38

@dan5py
Copy link
Contributor

dan5py commented Jun 26, 2023

@samuelkurdz I think the first is cleaner.

@thesambayo
Copy link
Contributor Author

@dan5py PR updated.

Copy link
Contributor

@dan5py dan5py left a comment

Choose a reason for hiding this comment

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

You can remove the classnames from the components since they're already applied in mdx-component.tsx (also the wrapper div)

@thesambayo
Copy link
Contributor Author

mdx-component.tsx

Done!

@thesambayo thesambayo requested a review from dan5py June 26, 2023 15:11
Copy link
Contributor

@dan5py dan5py left a comment

Choose a reason for hiding this comment

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

👍

@shadcn
Copy link
Collaborator

shadcn commented Jun 27, 2023

@samuelkurdz This looks great. Question: do we want the following config in tsconfig.json?

"baseUrl": ".",
"paths": {
  "@/*": ["./src/*"]
}

So that aliases such as @/components/... are resolved?

Here's a CodeSandbox I was testing: https://codesandbox.io/p/sandbox/shadcn-ui-vite-m9ry84?file=%2Ftsconfig.json%3A8%2C22

@dan5py
Copy link
Contributor

dan5py commented Jun 27, 2023

Yeah, this would keep the same aliases for different frameworks.

So I suggest keeping the @ alias format:

- alias: [{ find: "src", replacement: path.resolve(__dirname, "./src/") }],
+ alias: [{ find: "@", replacement: path.resolve(__dirname, "./src/") }],

And also the CLI prompts would remain the default ones:

- Configure the import alias for components: › src/components
- Configure the import alias for utils: › src/lib/utils
+ Configure the import alias for components: › @/components
+ Configure the import alias for utils: › @/lib/utils

@thesambayo
Copy link
Contributor Author

thesambayo commented Jun 27, 2023

@shadcn @dan5py
I experimented with your suggestions and it works if the tsconfig.json and vite.config.ts updates comes first.
So I will be updating this PR. Thanks.

Without that:

Configure the import alias for components: › @/components
Configure the import alias for utils: › @/lib/utils

This above created an @ folder in the root of the application that contains the components and utils file.

By the way, this is my first open-source contribution. Thanks for being nice!

@dan5py
Copy link
Contributor

dan5py commented Jun 27, 2023

This above created an @ folder in the root of the application that contains the components and utils file.

Yeah I'm aware of this. Just add the paths on the Edit tsconfig.json step.

@thesambayo
Copy link
Contributor Author

This above created an @ folder in the root of the application that contains the components and utils file.

Yeah I'm aware of this. Just add the paths on the Edit tsconfig.json step.

Updated!

@thesambayo thesambayo requested a review from dan5py June 27, 2023 11:18
@shadcn
Copy link
Collaborator

shadcn commented Jun 27, 2023

By the way, this is my first open-source contribution. Thanks for being nice!

No. Thank you. This is amazing!

@dan5py
Copy link
Contributor

dan5py commented Jun 27, 2023

By the way, this is my first open-source contribution. Thanks for being nice!

You did a really great job! 🎉

@CarlosZiegler
Copy link

Really nice !!!!!! Thanks for supporting Vite :)

@CarlosZiegler
Copy link

CarlosZiegler commented Jun 27, 2023

Works really fine to me, and I added Dark mode guide for Vite:
#750

@dan5py
Copy link
Contributor

dan5py commented Jun 28, 2023

Hi @samuelkurdz,
@mdloop is developing the installation page with Tabs where the content of each framework has its own file (to keep things cleaner). If #753 gets merged I'd like you to add the docs for vite that you created.

@shadcn
Copy link
Collaborator

shadcn commented Jun 29, 2023

@dan5py Should this one be merged first or #753?

@dan5py
Copy link
Contributor

dan5py commented Jun 29, 2023

@dan5py Should this one be merged first or #753?

First #753. Then @samuelkurdz will update this PR.

@dan5py
Copy link
Contributor

dan5py commented Jun 29, 2023

@samuelkurdz The new layout has been merged to main. You can now add the vite docs. Thanks in advance 💪.

@dan5py dan5py mentioned this pull request Jun 29, 2023
@thesambayo thesambayo requested a review from dan5py June 30, 2023 07:18
Copy link
Contributor

@dan5py dan5py left a comment

Choose a reason for hiding this comment

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

Perfect, thank you.

@shadcn this is ready to merge.

@shadcn
Copy link
Collaborator

shadcn commented Jun 30, 2023

Awesome. Thanks so much @samuelkurdz

@shadcn shadcn merged commit 1f00424 into shadcn-ui:main Jun 30, 2023
suleymanbariseser pushed a commit to suleymanbariseser/shadcn-ui that referenced this pull request Jul 25, 2023
* docs: add react with vite installation guide

* refactor(docs): move Ract with vite page into installation.mdx as tab

* fix(docs): remove classnames and wrapper divs

* fix(docs): update tsconfig file path to default @

* docs(www): fix code style

---------

Co-authored-by: Samuel Adebayo <[email protected]>
Co-authored-by: shadcn <[email protected]>
kjxbyz pushed a commit to muse-ui/muse-ui that referenced this pull request Jun 7, 2024
* docs: add react with vite installation guide

* refactor(docs): move Ract with vite page into installation.mdx as tab

* fix(docs): remove classnames and wrapper divs

* fix(docs): update tsconfig file path to default @

* docs(www): fix code style

---------

Co-authored-by: Samuel Adebayo <[email protected]>
Co-authored-by: shadcn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants