@sanity/cli 3.74.0 → 3.74.2-canary.67
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_chunks-cjs/cli.js +146 -82
- package/lib/_chunks-cjs/cli.js.map +1 -1
- package/lib/index.d.mts +10 -0
- package/lib/index.d.ts +10 -0
- package/package.json +9 -9
- package/src/actions/init-project/bootstrapLocalTemplate.ts +35 -20
- package/src/actions/init-project/createCliConfig.ts +5 -47
- package/src/actions/init-project/createCoreAppCliConfig.ts +26 -0
- package/src/actions/init-project/createPackageManifest.ts +1 -1
- package/src/actions/init-project/createStudioConfig.ts +5 -27
- package/src/actions/init-project/determineCoreAppTemplate.ts +13 -0
- package/src/actions/init-project/initProject.ts +41 -13
- package/src/actions/init-project/processTemplate.ts +55 -0
- package/src/actions/init-project/templates/coreApp.ts +31 -0
- package/src/actions/init-project/templates/index.ts +2 -0
- package/src/types.ts +11 -0
- package/templates/core-app/src/App.tsx +26 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
import {createSanityInstance} from '@sanity/sdk'
|
2
|
+
import {SanityProvider} from '@sanity/sdk-react/context'
|
3
|
+
|
4
|
+
export function App() {
|
5
|
+
|
6
|
+
const sanityConfig = {
|
7
|
+
auth: {
|
8
|
+
authScope: 'global'
|
9
|
+
}
|
10
|
+
/*
|
11
|
+
* Apps can access several different projects!
|
12
|
+
* Add the below configuration if you want to connect to a specific project.
|
13
|
+
*/
|
14
|
+
// projectId: 'my-project-id',
|
15
|
+
// dataset: 'my-dataset',
|
16
|
+
}
|
17
|
+
|
18
|
+
const sanityInstance = createSanityInstance(sanityConfig)
|
19
|
+
return (
|
20
|
+
<SanityProvider sanityInstance={sanityInstance}>
|
21
|
+
Hello world!
|
22
|
+
</SanityProvider>
|
23
|
+
)
|
24
|
+
}
|
25
|
+
|
26
|
+
export default App
|