-
Notifications
You must be signed in to change notification settings - Fork 448
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
feat(cli): add non-studio app template #8394
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
No changes to documentation |
⚡️ Editor Performance ReportUpdated Tue, 04 Feb 2025 21:22:58 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
Component Testing Report Updated Feb 4, 2025 9:21 PM (UTC) ❌ Failed Tests (1) -- expand for details
|
42d8ae5
to
c90602e
Compare
c90602e
to
e35c207
Compare
e35c207
to
b83bada
Compare
b83bada
to
c97abf7
Compare
c97abf7
to
324407c
Compare
324407c
to
39e48de
Compare
2014f8d
to
09723d8
Compare
09723d8
to
b06dc67
Compare
b06dc67
to
a428dd6
Compare
67539d7
to
63b3ca3
Compare
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.
Tested it locally with the canary and everything looks good. Code looking good as well, thanks for the effort!
Changing the hostname or port number might require a new CORS-entry to be added. | ||
|
||
Options | ||
--port <port> TCP port to start server on. [default: 3333] |
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.
Might be a good quality of life of improvement if it's different port from studio but if it's too much work than don't worry about it.
--port <port> TCP port to start server on. [default: 3333] | |
--port <port> TCP port to start server on. [default: 3334] |
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.
Yeh, I agree this would be a nice fast-follow improvement
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.
High level the changes make sense to me
Changing the hostname or port number might require a new CORS-entry to be added. | ||
|
||
Options | ||
--port <port> TCP port to start server on. [default: 3333] |
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.
Yeh, I agree this would be a nice fast-follow improvement
Description
This PR adds a template for applications that are not Sanity Studios. Because we are still considering requirements and scope, this app is a very minimal Vite / React application, but this may be expanded in the future.
We would still like these applications to be behind the
sanity
CLI runtime, so we've made some tweaks to allowsanity dev
,sanity build
and so on to run a Vite app.A TLDR of what's included in this PR:
a. The Document / index.html file
b. The
sanity.cli.ts|js
filec. The
app.js
entrypoint__experimental_coreAppConfiguration
. Right now it only determines framework and an entry path.sanity init
and template bootstrapping commands. If a non-studio application template is detected, it will not prompt for project-specific information or add studio-specific files and dependencies.What to review
This PR is not a complete vision. There will be fast follows to add the following:
dev
should default to running in a framed application.Beyond that, I'm interested in opinions on things like:
Testing
I didn't see ways to easily add tests for this -- our command tests (like
dev
andbuild
) do not seem to accept CLI configuration options. Probably the best way to test is to:mkdir core-app
cd core-app
pnpx [email protected]+df28986158 init --template core-app
sanity
entry in yourpackage.json
devDependencies
to3.72.2-canary.32+df28986158
andpnpm install
pnpm dev
,pnpm build
,pnpm start
OR you could the following:
cd ./packages/sanity
pwd
of where you are for future use (for me, it is/Users/carolina/code/sanity/packages/sanity
)pnpm build
andpnpm watch
(if you'd like to make changes){pwd}/bin/sanity init --template core-app
(so something like/Users/carolina/code/sanity/packages/sanity/bin/sanity init --template core-app
)pnpm link {your output from step #3}
so something likepnpm link /Users/carolina/code/sanity/packages/sanity
pnpm dev
,pnpm build
andpnpm start
Notes for release
None, internal