-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
…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.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -3,7 +3,7 @@ | |||
"private": true, | |||
"workspaces": [ | |||
"packages/*", | |||
"apps/docs" | |||
"apps/*" |
There was a problem hiding this comment.
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.
apps/blank-app/public/cococube.svg
Outdated
There was a problem hiding this comment.
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.)
<NimbusProvider> | ||
<App /> | ||
</NimbusProvider> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This is how Nimbus is set up, everything that needs access to Nimbus components and tokens needs to be wrapped with the
NimbusProvider
component.
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="/src/main.tsx"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 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 tomain.tsx
via the script-tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This is the actual app. The
main.tsx
file wrapped it with theNimbusProvider
component already, and to prove the app has access to components, tokens, icons and mode, I added a bit of functionality.
There was a problem hiding this 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)
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, followthese steps:
blank-app
directory within theapps
directory.kebab-case (e.g.,
fancy-app
).package.json
: Open thepackage.json
file inside your new appfolder (e.g.,
apps/fancy-app/package.json
) and change thename
propertyto match your folder name (e.g.,
"name": "fancy-app"
).pnpm install
from the root directory of therepository. This will install dependencies for all workspaces, including
your new app.
folder (e.g.,
cd apps/fancy-app
).pnpm dev
to start the Vitedevelopment server for your application.
Note
This template is based on Vite's
react-swc-ts
template with minoradjustments:
package.json
includes references to Nimbus catalog dependencies.root-level ESLint configuration is already present in the repository.