Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 5c78599

Browse files
author
Lisi Linhart
authored
Merge pull request #29 from storyblok/next
Next Release
2 parents 491639b + 6154194 commit 5c78599

33 files changed

+21226
-1777
lines changed

.DS_Store

-6 KB
Binary file not shown.

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
templates/**
1+
/dist

.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": [
3+
"oclif",
4+
"oclif-typescript"
5+
]
6+
}

.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: Release
33

44
on:
55
push:
6-
branches:
7-
- main
6+
branches: [main, next]
87

98
jobs:
109
release:

.github/workflows/test.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
name: Test
3+
4+
on: push
5+
6+
jobs:
7+
release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-node@v3
12+
with:
13+
node-version: 18
14+
cache: 'yarn'
15+
- name: Install dependencies
16+
run: npm ci
17+
- run: npm run test

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
/yarn-lock.json
66
/tmp
77
node_modules
8-
/test*
8+
9+
.DS_Store

.mocharc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"require": [
3+
"test/helpers/init.js",
4+
"ts-node/register"
5+
],
6+
"watch-extensions": [
7+
"ts"
8+
],
9+
"recursive": true,
10+
"reporter": "spec",
11+
"timeout": 60000
12+
}

README.md

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
<div align="center">
22
<a href="https://www.storyblok.com?utm_source=github.com&utm_medium=readme&utm_campaign=create-storyblok-app" align="center">
3-
<img src="https://a.storyblok.com/f/88751/1776x360/51af0ebe23/shared_logos_framework.png" alt="Storyblok Logo">
3+
<img src="https://a.storyblok.com/f/88751/1776x360/795b73df6d/create-demo-app.png/m/" alt="Storyblok Create Demo CLI">
44
</a>
55
<h1 align="center">Create Storyblok Demo</h1>
6-
<p align="center">A CLI to quickly start a project with your favourite framework, already set up with <a href="http://www.storyblok.com?utm_source=github.com&utm_medium=readme&utm_campaign=create-storyblok-app" target="_blank">Storyblok</a>, Headless CMS.</p> <br />
7-
<p>Supports <a href="https://nextjs.org/" target="_blank">Next.js</a>, <a href="https://nuxtjs.org/" target="_blank">Nuxt.js (2 & 3)</a>, <a href="https://www.gatsbyjs.com/" target="_blank">Gatsby.js</a>, <a href="https://vuejs.org/" target="_blank">Vue.js</a>, <a href="https://reactjs.org/" target="_blank">React.js</a>, <a href="https://remix.run/" target="_blank">Remix</a> and <a href="https://svelte.dev/" target="_blank">Svelte</a></p>
6+
<p align="center">A CLI to quickly start a project with your favorite framework, already set up with <a href="http://www.storyblok.com?utm_source=github.com&utm_medium=readme&utm_campaign=create-storyblok-app" target="_blank">Storyblok</a>, Headless CMS.</p> <br />
7+
<p>Supports
8+
<a href="https://nextjs.org/" target="_blank">Next.js</a>,
9+
<a href="https://nuxtjs.org/" target="_blank">Nuxt.js (2 & 3)</a>,
10+
<a href="https://www.gatsbyjs.com/" target="_blank">Gatsby.js</a>,
11+
<a href="https://vuejs.org/" target="_blank">Vue.js</a>,
12+
<a href="https://reactjs.org/" target="_blank">React.js</a>,
13+
<a href="https://astro.build/" target="_blank">Astro</a>,
14+
<a href="https://remix.run/" target="_blank">Remix</a>,
15+
and <a href="https://kit.svelte.dev/" target="_blank">SvelteKit</a></p>
816
</div>
917

1018
<p align="center">
11-
<a href="https://oclif.io">
12-
<img src="https://img.shields.io/badge/cli-oclif-brightgreen.svg">
13-
</a>
14-
<a href="https://npmjs.org/package/create-storyblok-app">
15-
<img src="https://img.shields.io/npm/v/create-storyblok-app.svg">
19+
20+
<a href="https://npmjs.org/package/@storyblok/create-demo">
21+
<img src="https://img.shields.io/npm/v/%40storyblok%2Fcreate-demo">
1622
</a>
17-
<a href="https://npmjs.org/package/create-storyblok-app">
18-
<img src="https://img.shields.io/npm/dw/create-storyblok-app.svg">
23+
<a href="https://npmjs.org/package/@storyblok/create-demo">
24+
<img src="https://img.shields.io/npm/dw/%40storyblok%2Fcreate-demo">
1925
</a>
2026
<a href="https://github.com/storyblok/create-storyblok-app/blob/master/package.json">
2127
<img src="https://img.shields.io/npm/l/create-storyblok-app.svg">
@@ -34,54 +40,53 @@
3440

3541
# Getting Started
3642

37-
1. Signup at https://app.storyblok.com/
38-
2. Create a new space and retrieve the space preview token under Space -> Settings -> Api Keys
39-
3. Execute follwing command with the space preview access token:
43+
1. Signup at https://app.storyblok.com/;
44+
2. Create a new space and retrieve the space preview token under your space in "Settings -> Access Tokens" menu item;
45+
3. Execute the following commands (use your preview access token when prompted when running the `npx` command):
4046

41-
```sh-session
47+
~~~bash
4248
npx @storyblok/create-demo@latest
4349

4450
cd my-app
4551
npm i && npm run dev
46-
```
52+
~~~
4753

48-
4. Open the Storyblok editor and directly edit your content locally: http://localhost:3000/editor.html
54+
4. Open the Storyblok App following the URL suggested by the output provided by the commands. It depends on the HTTPS configuration and the port used by the frameworks.
4955

5056
# CLI Options
5157

52-
The CLI has different options that can be filled, you can see all the options by running `npx @storyblok/create-demo --help`:
58+
The CLI has different options that can be filled, you can see all the options by running `npx @storyblok/create-demo --help`:
5359

54-
```
60+
~~~
5561
OPTIONS
5662
-d, --folder=folder Folder path for the demo (e.g. my-demo)
5763
-f, --framework=framework Framework to use (e.g. remix)
5864
-h, --help show CLI help
5965
-k, --key=key Storyblok Access Token
60-
-l, --localmode using the local mode
6166
-p, --packagemanager=packagemanager Package manager to use (yarn or npm)
62-
-r, --region=region Space region (e.g. us-east-1)
67+
-r, --region=region Space region (EU, US). The support for the China region will be introduced in the next release.
6368
-v, --version show CLI version
64-
```
69+
~~~
6570

66-
By using this you can skip the "questions" of the CLI and fill it with your options directly like so:
71+
By using this, you can skip the "questions" of the CLI and fill it with your options directly like so:
6772

68-
```
69-
npx @storyblok/create-demo@latest --key YOUR_STORYBLOK_PREVIEW_TOKEN --region us-east-1
70-
```
73+
~~~bash
74+
npx @storyblok/create-demo@latest --key YOUR_STORYBLOK_PREVIEW_TOKEN --region US
75+
~~~
7176

7277

7378
### Local Development
7479

75-
If you want to contribute you can run the CLI locally and test it with this command:
80+
If you want to contribute, you can run the CLI locally and test it with this command:
7681

77-
```sh-session
82+
~~~bash
7883
npm i
79-
./bin/run --key YOUR_STORYBLOK_PREVIEW_TOKEN
80-
```
84+
./bin/dev --key YOUR_STORYBLOK_PREVIEW_TOKEN
85+
~~~
8186

8287
#### Framework Options
8388

84-
The framework options can be set in `src/frameworks.js` and work in combination with the [getting-started](https://github.com/storyblok/getting-started) repository
89+
The framework options can be set in `src/lib/frameworks.ts` and work in combination with the [getting-started](https://github.com/storyblok/getting-started) or The Ultimate Tutorial repositories:
8590

8691
- `name`: name of the framework
8792
- `value`: cli value to use for reference
@@ -90,9 +95,9 @@ The framework options can be set in `src/frameworks.js` and work in combination
9095
- `config`: file that has the access token
9196
- `bridge`: file that is loading the bridge
9297
- `public`: public folder path for the static files
93-
- `port`: port the framework starts,
94-
- `branch`: (optional) for testing other branches on the `getting-started` repository
98+
- `port`: port the framework starts,
99+
- `repositoryUrl`: (optional) the URL repository for cloning the template;
100+
- `branch`: (optional) for setting a specific branches
95101
- `https`: (optional) if the framework starts with https
96102
- `submodules`: (optional) if the framework in `getting-started` is a submodule
97103
- `tutorialLink`: (optional) - link to the framwork tutorial
98-

bin/dev

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env node
2+
3+
const oclif = require('@oclif/core')
4+
5+
const path = require('path')
6+
const project = path.join(__dirname, '..', 'tsconfig.json')
7+
8+
// In dev mode -> use ts-node and dev plugins
9+
process.env.NODE_ENV = 'development'
10+
11+
require('ts-node').register({ project })
12+
13+
// In dev mode, always show stack traces
14+
oclif.settings.debug = true;
15+
16+
17+
// Start the CLI
18+
oclif.run().then(oclif.flush).catch(oclif.Errors.handle)

0 commit comments

Comments
 (0)