-
Notifications
You must be signed in to change notification settings - Fork 53
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
chore: add play
script
#1327
chore: add play
script
#1327
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Quick incomplete review as this is still a draft ^^ Thanks for starting this highly useful work!
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 a really nice advancement to easily work on Slice Machine! Thank you Angelo 😊
localhost:9999
in Chrome:
play-tall-semla-02707b3 [slicemachine]
play-tall-semla-02707b3 [slicemachine] > [email protected] slicemachine
play-tall-semla-02707b3 [slicemachine] > ../../packages/start-slicemachine/bin/start-slicemachine.js
play-tall-semla-02707b3 [slicemachine]
play-tall-semla-02707b3 [next]
play-tall-semla-02707b3 [next] > [email protected] next:dev
play-tall-semla-02707b3 [next] > next dev --port=8001
play-tall-semla-02707b3 [next]
play-tall-semla-02707b3 [next] ▲ Next.js 14.1.4
play-tall-semla-02707b3 [next] - Local: http://localhost:8001
play-tall-semla-02707b3 [next]
play-tall-semla-02707b3 [slicemachine] [HPM] Proxy created: / -> http://localhost:3000
play-tall-semla-02707b3 [slicemachine]
play-tall-semla-02707b3 [slicemachine] Slice Machine v1.26.0 → Running at http://localhost:9999
play-tall-semla-02707b3 [slicemachine]
play-tall-semla-02707b3 [next] ✓ Ready in 1431ms
play-tall-semla-02707b3 [slicemachine] [HPM] Error occurred while proxying request localhost:9999/ to http://localhost:3000/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)
play-tall-semla-02707b3 [slicemachine] [HPM] Error occurred while proxying request localhost:9999/favicon.ico to http://localhost:3000/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)
play-tall-semla-02707b3 [next] ○ Compiling / ...
play-tall-semla-02707b3 [next] ✓ Compiled / in 1237ms (854 modules)
play-tall-semla-02707b3 [next] ○ Compiling /icon.png ...
play-tall-semla-02707b3 [next] ✓ Compiled /icon.png in 509ms (541 modules)
play-tall-semla-02707b3 [slicemachine] [HPM] Error occurred while proxying request localhost:9999/ to http://localhost:3000/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)
play-tall-semla-02707b3 [slicemachine] [HPM] Error occurred while proxying request localhost:9999/favicon.ico to http://localhost:3000/ [ECONNREFUSED] (https://nodejs.org/api/errors.html#errors_common_system_errors)
package.json
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.
clean
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.
We could, but I wonder if we should ask for confirmation before deleting all playgrounds. It's possible a playground could contain a lot of work or a specific set up, and I wouldn't want someone to accidentally lose it all.
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.
Maybe we could create a simple custom scripts/clean.ts
with a prompt?
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.
Oh, you're right. We'll probably have changes we don't want to lose.
Consequently, I think we can either:
- Keep it simple and not change anything.
- Update the
clean
script so that it only deletes well known build/cache directories in the playgrounds. For example, it could delete the nested.next
directories. Of course, it shouldn't accidentally delete content in theplaygrounds/node_modules
directory or other configuration files.
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.
To expedite merging this PR, let's not change the clean
script for now. We can revisit it in a future PR. I like the second idea, perhaps in addition to the ability to delete playgrounds.
You may not have had the Slice Machine development server running. You need to run I considered running |
You're right. I forgot to run |
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 truly excellent and will greatly help us!
I'm approving as there are just 4 comments remaining. Don't forget the little suggestion for the exec
function ^^
Context
We often need a running Slice Machine instance complete with a Prismic repository. We have projects in the
e2e-projects
directory to serve that purpose, but they have the following limitations:The Solution
We can use a script to quickly generate new projects with their own Prismic repositories. Projects are generated using Prismic's minimal starters, just like customers would use.
These projects are called "playgrounds" since they allow us to play with Slice Machine while developing.
This PR introduces a new
yarn play
command. The CLI looks like this:Both Slice Machine and the playground project are started automatically (unless disabled via
--no-start
).Impact / Dependencies
This should make it easier to develop features. It could also streamline how we run end-to-end tests with Playwright.
Checklist before requesting a review