slice-machine
slice-machine copied to clipboard
When Creating a new Slice Machine Project with a new Next project, the sm.json configuration is set to previousNext
Versions
- slice-machine-ui: 0.4.1
- node: 16
Reproduction
After creating a new next project from scratch with create-next-app and then running slicemachine init. The sm.json default is set to PreviousNext
{
"_latest": "0.3.0",
"apiEndpoint": "https://.prismic.io/api/v2",
"libraries": [
"@/slices"
],
"framework": "previousNext",
"localSliceSimulatorURL": "http://localhost:3000/slice-simulator"
}
Steps to reproduce
What is expected?
To default to the latest next version
What is actually happening?
See above
Did some research, it appears this is due to this migration script still being run on new projects: https://github.com/prismicio/slice-machine/blob/HEAD/packages/slice-machine/scripts/migration/versions/0.3.0/index.ts
OK, after further investigation it looks like 5fd2faa
in [Release Branch]: v0.4.0
#473 moved the install dependencies step of @slicemachine/init
after project configuration.
This prevents the "configure project" step to detect the installed version of Slice Machine (as it's now installed after), making it default to the first one relevant for migrations (0.0.41), see: https://github.com/prismicio/slice-machine/blob/master/packages/init/src/steps/configure-project.ts#L91-L93
Did this fix it? https://github.com/prismicio/slice-machine/pull/546
Looks like it does indeed! Awesome :) (I let you close when relevant)
The fix has been released, closing this.