Phil
(Phil Snow)
October 21, 2020, 3:06pm
3
Hey Bob,
Welcome to the community! Sorry about the delay in the reply.
At the moment that is not quite possible to configure your library to be installed with the sm --setup
but you will be able to do this very soon as we are almost ready with the necessary integrations in Slicemachine. You'll need to register your library on npm then you'll run the command sm --setup --lib my-npm-dep
.
You can find all the details here:
opened 02:59PM - 30 Jun 20 UTC
closed 12:48PM - 05 May 23 UTC
rfc
## Context
When using the command `prismic sm --setup` the slice machine CLI wi… ll generate a new prismic repository and import in your project a set of default Open Source components.
For nuxt.js : https://github.com/prismicio/vue-essential-slices
For next.js : https://github.com/prismicio/essential-slices
We had different request to be able to specify your own custom library instead of the default one
## Solution
We will create a new argument for the prismic sm --setup command allowing you to specify your own custom library. (This should be a npm package)
`prismic sm --setup --lib my-npm-package`
This command will
### Generate a new repository and configure your project to be linked to your newly created repository
As the current setup command, the command will create a new repository
The CLI command will generate a new prismic repository & add the different files in your codebase to link your project to your prismic endpoint & setup the toolbar
### Download your custom library as a dependency
1. Add & download the dependency in your project
2. Reference your library in the sm-resolver to use those slices automatically in the Slicezone.
### Import your custom slices in your first created custom type.
1. Generate a new prismic repository
2. Create a page custom type
3. Add all slices definition to your page custom type.
For your second question, what you are describing is our 'Shared Slices' feature, which we are also planning to release in our next iteration.
You can read about both of these features in the full iteration description here:
Hey Team,
It's been a long time since we updated you on what we're currently working on for Slice Machine. The truth is that that we've been working for two months now on a fascinating addition, and we didn't want to spoil the surprise. We will reveal all in due time during or next product meetup the 28th of October, so if you want to know more it's free, so sign up now.
Anyway, we are continuing to release new improvements, and we wanted to update you on the new shiny things for Slice Machine…
Thanks.