Describe your question/issue in detail
This is not a bug (I believe), so I am not recording a video. I want to create a new NextJS app but use an existing Prismic repository. I use create-next-app, cd into the directory and then:
@slicemachine/init@latest --repository nameofrepo
The custom types are imported beautifully. However, there's no slice information that comes over. I don't expect any of the slice JSX (.js, .jsx, .ts, .tsx) files to be populated, but I would hope/expect the mocks.json and models.json to come over.
As it stands now, when you run slicemachine after the init, all slices are set to be deleted on the next push from slicemachine.
This would result in some hefty data loss in all prismic documents.
Impacted feature
As explained above, reusing a prismic repository for a new NextJS project can result in a quick deletion of document content in the repository.
What steps have you taken to resolve this issue already?
I have tried this on two separate repositories to see if the behavior was limited to one. n=1 is not good. Not that n=2 is much better.
Errors
None
Your Role
Developer
Hosting provider
Vercel
Package.json file
{
"name": "next-prismic-foundation",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint",
"slicemachine": "start-slicemachine"
},
"dependencies": {
"@prismicio/client": "^7.17.2",
"@prismicio/next": "^2.0.1",
"@prismicio/react": "^3.2.1",
"next": "15.3.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@slicemachine/adapter-next": "^0.3.74",
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "15.3.0",
"slice-machine-ui": "^2.15.1",
"tailwindcss": "^4",
"typescript": "^5"
}
}
Steps to reproduce
Explained in the first section.