Skip to content

feat(blank-app): initialize new blank app with Nimbus, Vite & TS #94

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

misama-ct
Copy link
Collaborator

@misama-ct misama-ct commented May 5, 2025

image

In preparation for the upcoming speed-test task, I thought it's a good idea to have a basic app-template at hand which can be used as starting ground for an app that is using Nimbus.

This is the process to create a new app, also documented in the README.md file:

Creating a New App

To create a new application (e.g., fancy-app) based on this template, follow
these steps:

  1. Duplicate the folder: Copy the entire blank-app directory within the
    apps directory.
  2. Rename: Rename the duplicated folder to your desired app name in
    kebab-case (e.g., fancy-app).
  3. Update package.json: Open the package.json file inside your new app
    folder (e.g., apps/fancy-app/package.json) and change the name property
    to match your folder name (e.g., "name": "fancy-app").
  4. Install dependencies: Run pnpm install from the root directory of the
    repository. This will install dependencies for all workspaces, including
    your new app.
  5. Navigate to your app: Change your current directory to your new app's
    folder (e.g., cd apps/fancy-app).
  6. Start the development server: Run pnpm dev to start the Vite
    development server for your application.

Note

This template is based on Vite's react-swc-ts template with minor
adjustments:

  1. The package.json includes references to Nimbus catalog dependencies.
  2. The default ESLint configuration generated by Vite has been removed, as a
    root-level ESLint configuration is already present in the repository.

misama-ct added 2 commits May 5, 2025 11:16
…ipt setup

- Added package.json and pnpm-lock.yaml for dependency management.
- Created initial app structure including index.html, main.tsx, and App component.
- Implemented CocoCube component and integrated Nimbus provider.
- Configured TypeScript with appropriate settings in tsconfig files.
- Added .gitignore to exclude unnecessary files.
- Included README.md with setup instructions and ESLint configuration guidance.
Copy link

vercel bot commented May 5, 2025

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

Name Status Preview Comments Updated (UTC)
nimbus-documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 0:09am
nimbus-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 5, 2025 0:09am

@@ -3,7 +3,7 @@
"private": true,
"workspaces": [
"packages/*",
"apps/docs"
"apps/*"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

every folder inside the apps folder is treated as workspace now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not necessary, but the public folder is copied as-is when bundling with vite, static assets like font's can go here. (Unfortunately though, an empty folder can't be committed, so I put the cube svg image in it.)

Comment on lines +8 to +10
<NimbusProvider>
<App />
</NimbusProvider>
Copy link
Collaborator Author

@misama-ct misama-ct May 5, 2025

Choose a reason for hiding this comment

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

  1. This is how Nimbus is set up, everything that needs access to Nimbus components and tokens needs to be wrapped with the NimbusProvider component.

-> Next

</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
Copy link
Collaborator Author

@misama-ct misama-ct May 5, 2025

Choose a reason for hiding this comment

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

  1. If you are unfamiliar with vite, this file is the entry point, in this case, an html file that is being rendered in the browser. Vite will start here and attempt to resolve every reference to a file. The only reference in here though is the link to main.tsx via the script-tag.

-> Next

Copy link
Collaborator Author

@misama-ct misama-ct May 5, 2025

Choose a reason for hiding this comment

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

  1. This is the actual app. The main.tsx file wrapped it with the NimbusProvider component already, and to prove the app has access to components, tokens, icons and mode, I added a bit of functionality.

Copy link
Contributor

@ByronDWall ByronDWall left a comment

Choose a reason for hiding this comment

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

I think this is a good starting place for a template/starter app, I like that we could build on this to set up more specific example apps down the road (how to set up custom applications with nimbus, for example)

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.

2 participants