@contentful/create-studio-experiences 1.37.1-dev-20250425T1024-b8bfdfb.0
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/LICENSE +21 -0
- package/README.md +62 -0
- package/dist/constants.d.ts +7 -0
- package/dist/constants.js +8 -0
- package/dist/constants.js.map +1 -0
- package/dist/content.d.ts +724 -0
- package/dist/content.js +983 -0
- package/dist/content.js.map +1 -0
- package/dist/copyTemplates.d.ts +1 -0
- package/dist/copyTemplates.js +20 -0
- package/dist/copyTemplates.js.map +1 -0
- package/dist/ctflClient.d.ts +85 -0
- package/dist/ctflClient.js +253 -0
- package/dist/ctflClient.js.map +1 -0
- package/dist/fsClient.d.ts +13 -0
- package/dist/fsClient.js +84 -0
- package/dist/fsClient.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +296 -0
- package/dist/index.js.map +1 -0
- package/dist/models.d.ts +27 -0
- package/dist/models.js +32 -0
- package/dist/models.js.map +1 -0
- package/dist/utils.d.ts +7 -0
- package/dist/utils.js +24 -0
- package/dist/utils.js.map +1 -0
- package/package.json +64 -0
- package/templates/nextjs-marketing-demo/.env.template +5 -0
- package/templates/nextjs-marketing-demo/.eslintrc.json +3 -0
- package/templates/nextjs-marketing-demo/README.md +22 -0
- package/templates/nextjs-marketing-demo/next.config.mjs +21 -0
- package/templates/nextjs-marketing-demo/src/app/[locale]/[slug]/page.tsx +50 -0
- package/templates/nextjs-marketing-demo/src/app/favicon.ico +0 -0
- package/templates/nextjs-marketing-demo/src/app/fonts/GeistMonoVF.woff +0 -0
- package/templates/nextjs-marketing-demo/src/app/fonts/GeistVF.woff +0 -0
- package/templates/nextjs-marketing-demo/src/app/globals.css +37 -0
- package/templates/nextjs-marketing-demo/src/app/layout.tsx +34 -0
- package/templates/nextjs-marketing-demo/src/app/page.module.css +19 -0
- package/templates/nextjs-marketing-demo/src/assets/Logo.svg +8 -0
- package/templates/nextjs-marketing-demo/src/components/ButtonComponentRegistration.tsx +125 -0
- package/templates/nextjs-marketing-demo/src/components/CardComponentRegistration.tsx +54 -0
- package/templates/nextjs-marketing-demo/src/components/Container.tsx +15 -0
- package/templates/nextjs-marketing-demo/src/components/Experience.tsx +16 -0
- package/templates/nextjs-marketing-demo/src/components/Footer/Footer.tsx +42 -0
- package/templates/nextjs-marketing-demo/src/components/Footer/FooterDebugging.tsx +23 -0
- package/templates/nextjs-marketing-demo/src/components/Footer/FooterNav.tsx +34 -0
- package/templates/nextjs-marketing-demo/src/components/Footer/styles.module.css +51 -0
- package/templates/nextjs-marketing-demo/src/components/Header/Header.tsx +15 -0
- package/templates/nextjs-marketing-demo/src/components/Header/HeaderNav.tsx +59 -0
- package/templates/nextjs-marketing-demo/src/components/Header/styles.module.css +30 -0
- package/templates/nextjs-marketing-demo/src/components/Icon.tsx +21 -0
- package/templates/nextjs-marketing-demo/src/components/RatingStarsComponentRegistration.tsx +49 -0
- package/templates/nextjs-marketing-demo/src/getExperience.ts +40 -0
- package/templates/nextjs-marketing-demo/src/middleware.ts +17 -0
- package/templates/nextjs-marketing-demo/src/studio-config.ts +139 -0
- package/templates/nextjs-marketing-demo/tsconfig.json +26 -0
- package/templates/react-vite-ts/.env.template +5 -0
- package/templates/react-vite-ts/README.md +50 -0
- package/templates/react-vite-ts/eslint.config.js +25 -0
- package/templates/react-vite-ts/index.html +13 -0
- package/templates/react-vite-ts/public/vite.svg +1 -0
- package/templates/react-vite-ts/src/App.css +4 -0
- package/templates/react-vite-ts/src/App.tsx +37 -0
- package/templates/react-vite-ts/src/assets/react.svg +1 -0
- package/templates/react-vite-ts/src/index.css +0 -0
- package/templates/react-vite-ts/src/main.tsx +10 -0
- package/templates/react-vite-ts/src/studio-config.ts +67 -0
- package/templates/react-vite-ts/src/vite-env.d.ts +1 -0
- package/templates/react-vite-ts/tsconfig.app.json +24 -0
- package/templates/react-vite-ts/tsconfig.json +4 -0
- package/templates/react-vite-ts/tsconfig.node.json +22 -0
- package/templates/react-vite-ts/vite.config.ts +7 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Contentful
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# @contentful/create-studio-experiences
|
|
2
|
+
|
|
3
|
+
This package is a CLI tool to bootstrap a [React, Vite & TypeScript](https://github.com/vitejs/vite/tree/main/packages/create-vite/template-react-ts) app that renders [Studio Experiences](https://www.contentful.com/developers/docs/experiences/what-are-experiences/).
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
A Contentful Space that has Studio Experiences enabled. See: [How to enable Experiences in a space](https://www.contentful.com/help/enable-spaces-for-experiences/).
|
|
8
|
+
|
|
9
|
+
## Getting started
|
|
10
|
+
|
|
11
|
+
To create a Contentful Studio Experiences project, run this command and follow the prompts.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm init @contentful/studio-experiences
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Navigate to your project directory and start the server. After that, you can manage your Experiences in Contentful.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
cd studio-experiences-react-app
|
|
21
|
+
npm run dev
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Developing locally
|
|
25
|
+
|
|
26
|
+
Run `npm run dev` to start the dev server that will watch and recompile the apps on changes.
|
|
27
|
+
|
|
28
|
+
Once built, you can test the CLI locally by running `npm run create`, which will do the follow:
|
|
29
|
+
|
|
30
|
+
- Copy the templates to the local folder
|
|
31
|
+
- Run `node dist/index.js -d` to start the CLI in dev mode
|
|
32
|
+
- Clean up the templates folder after the CLI has finished
|
|
33
|
+
|
|
34
|
+
## CLI Steps
|
|
35
|
+
|
|
36
|
+
1. Project Type
|
|
37
|
+
2. React Type
|
|
38
|
+
3. Installation Path - The generated project will be installed here.
|
|
39
|
+
4. Connect to Contentful Space _(Optional)_ - Note: only spaces that have Studio Experiences enabled are eligible. See: [How to enable Experiences in a space](https://www.contentful.com/help/enable-spaces-for-experiences/).
|
|
40
|
+
- Select your Contentful Organization.
|
|
41
|
+
- Select your Contentful Space.
|
|
42
|
+
- Select your Environment (if your Space has multiple).
|
|
43
|
+
- Select or Create an API key.
|
|
44
|
+
- Content Type will be created for Experiences if needed.
|
|
45
|
+
- Demo Experience Entry will be created (unless one exists).
|
|
46
|
+
- Content Preview Settings will be configured if needed.
|
|
47
|
+
5. Project Output - The React project will be created, incorporating the [Studio Experiences SDK](https://www.contentful.com/developers/docs/experiences/set-up-experiences-sdk/#usage).
|
|
48
|
+
|
|
49
|
+
## CLI Options
|
|
50
|
+
|
|
51
|
+
- Host - Specify the Contentful host. Defaults to `contentful.com`.
|
|
52
|
+
```bash
|
|
53
|
+
node dist/index.js --host <my_host>
|
|
54
|
+
```
|
|
55
|
+
- Dev - Argument that is likely only applicable if you are actively developing this package. If `--dev` argument is passed, some basic cleanup operations will occur after the bulk of the executable has be run, namely the auth token will be revoked if it was generated by the CLI in that run. Additionally, the react project that was bootstrapped during execution will be deleted.
|
|
56
|
+
```bash
|
|
57
|
+
node dist/index.js --dev
|
|
58
|
+
```
|
|
59
|
+
- Token - If you already have a valid API CLI token, you can optionally pass it as an argument. If you do not pass one, you will be prompted to create one at runtime.
|
|
60
|
+
```bash
|
|
61
|
+
node dist/index.js --token <my_token>
|
|
62
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,QAAQ;IACrB,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,WAAW;CACnB,CAAC"}
|