-
Notifications
You must be signed in to change notification settings - Fork 36
chore: internal docs for beta #187
Changes from 9 commits
598e071
c0323cd
437bd59
283169d
8f01508
24df207
8e37554
d5e1d06
72600e4
f0b64ea
3479d26
198108b
cafdb9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,7 +48,10 @@ | |
|
|
||
| ## Documentation | ||
|
|
||
| For complete documentation, please visit [https://storyblok.com/docs](https://storyblok.com/docs/packages/my-joyful-package) | ||
| > [!WARNING] | ||
| > Official documentation about this package v4 is not yet available. Please refer to the internal documentation for the [v4 beta](src/README.md). | ||
|
|
||
| ~~For complete documentation, please visit [https://storyblok.com/docs](https://storyblok.com/docs/packages/my-joyful-package)~~ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would comment this out until we have the actual documentation link. |
||
|
|
||
| ## Setup | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,53 @@ | ||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| # Storyblok CLI Package Reference | ||||||||||||||||||||||||||||||||
|
alvarosabu marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## Installation | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| For the latest beta version, install the package using the following command: | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||
| npm install storyblok@beta | ||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| Or for an specific beta version: | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||
| npm install storyblok@4.0.0-beta.<version> | ||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||
|
Comment on lines
+7
to
+17
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My suggestion is to keep the non-beta installation command in here. It makes sense for people to want the stable version for a new project.
Suggested change
You can also install the beta version, currently in development: npm install storyblok@betaIt's also possible to target a specific beta version: npm install storyblok@4.0.0-beta.<version>There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @alvarosabu, is this readme going to be in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's going to live on the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's what I thought. 😄 Then feel free to disregard the suggestion from Jeremias here. |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## Command Reference | ||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably |
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| | Command | Status | Notes | | ||||||||||||||||||||||||||||||||
| |---------|--------|-------| | ||||||||||||||||||||||||||||||||
| | [`login`](./commands/login/README.md) | ✅ Ready | Improved DX and credentials storage in ~/.storyblok/credentials.json | | ||||||||||||||||||||||||||||||||
| | [`logout`](./commands/logout/README.md) | ✅ Ready | | | ||||||||||||||||||||||||||||||||
| | [`user`](./commands/user/README.md) | ✅ Ready | | | ||||||||||||||||||||||||||||||||
| | [`languages pull`](./commands/languages/README.md) | ✅ Ready | Replaces previous pull-languages | | ||||||||||||||||||||||||||||||||
| | [`components pull`](./commands/components/pull/README.md) | ✅ Ready | Replaces previous pull-components | | ||||||||||||||||||||||||||||||||
| | [`components push`](./commands/components/push/README.md) | ✅ Ready | Replaces previous push-components. Also handles dependencies such as groups, tags, presets and whitelists. (Datasources is pending) | | ||||||||||||||||||||||||||||||||
| | `components delete` | 📝 Planned | Will replace delete-component and delete-components | | ||||||||||||||||||||||||||||||||
| | [`migrations generate`](./commands/migrations/generate/README.md) | ✅ Ready | Replaces previous generate-migrations | | ||||||||||||||||||||||||||||||||
| | [`migrations run`](./commands/migrations/run/README.md) | ✅ Ready | Replaces previous run-migrations | | ||||||||||||||||||||||||||||||||
| | [`migrations rollback`](./commands/migrations/rollback/README.md) | ✅ Ready | Replaces previous rollback-migrations | | ||||||||||||||||||||||||||||||||
| | [`types generate`](./commands/types/generate/README.md) | ✅ Ready | Replaces previous generate-typescript-typedefs | | ||||||||||||||||||||||||||||||||
| | `sync` | ⚠️ v3 | | | ||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest leaving only the emojis, and adding a legend in the end or before the table. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jeremenichelli I'm also not a fan of emojis, but I think they serve a purpose here.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My intention with the emojis was to help the user to quickly identify the status visually when reading through the table. Normally it would be done with CSS but we don't have that flavor on markdown. Considering this is temporal documentation, I wouldn't be strict about this part. |
||||||||||||||||||||||||||||||||
| | `datasources pull` | 📝 Planned | | | ||||||||||||||||||||||||||||||||
| | `datasources push` | 📝 Planned | | | ||||||||||||||||||||||||||||||||
| | `datasources delete` | 📝 Planned | Will replace delete-datasources | | ||||||||||||||||||||||||||||||||
| | `select` | 💬 TBD | To be discussed | | ||||||||||||||||||||||||||||||||
| | `quickstart` | 💬 TBD | To be discussed | | ||||||||||||||||||||||||||||||||
| | `spaces` | 💬 TBD | To be discussed | | ||||||||||||||||||||||||||||||||
| | `import` | 💬 TBD | To be discussed | | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ## Global Options | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| These options can be used with any command: | ||||||||||||||||||||||||||||||||
|
alvarosabu marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| | Option | Description | Default | | ||||||||||||||||||||||||||||||||
| |--------|-------------|---------| | ||||||||||||||||||||||||||||||||
| | `-v, --verbose` | Enable verbose output for debugging | `false` | | ||||||||||||||||||||||||||||||||
| | `--ci` | Enable CI mode (coming soon) | `false` | | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| > [!TIP] | ||||||||||||||||||||||||||||||||
| > When reporting a bug or opening a support ticket, please run the command with the `--verbose` flag to provide detailed information that will help us better understand and resolve the issue. | ||||||||||||||||||||||||||||||||
|
alvarosabu marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Components Command | ||
|
|
||
| The `components` module provides tools to manage Storyblok components and their dependencies. | ||
|
|
||
| ## Subcommands | ||
|
|
||
| - [`pull`](./pull/README.md): Download components from your Storyblok space. | ||
| - [`push`](./push/README.md): Upload components and their dependencies (groups, tags, presets, whitelists) to your Storyblok space. | ||
| - `delete` (coming soon): Remove components from your Storyblok space. | ||
|
|
||
| > See each subcommand for detailed usage, options, and examples. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,191 @@ | ||
| # Components Pull Command | ||
|
|
||
| The `components pull` command allows you to download components and their dependencies from your Storyblok space. | ||
|
|
||
| ## Basic Usage | ||
|
|
||
| ```bash | ||
| storyblok components pull --space YOUR_SPACE_ID | ||
| ``` | ||
|
|
||
| This will download all components and their dependencies to consolidated files: | ||
| ``` | ||
| .storyblok/ | ||
| └── components/ | ||
| └── YOUR_SPACE_ID/ | ||
| ├── components.json # All components | ||
| ├── groups.json # Component groups | ||
| ├── presets.json # Component presets | ||
| └── tags.json # Component tags | ||
| ``` | ||
|
|
||
| > [!WARNING] | ||
| > The `--filename` option is ignored when using `--separate-files`. Each component will be saved with its own name. | ||
|
|
||
| ## Pull a Single Component | ||
|
|
||
| ```bash | ||
| storyblok components pull COMPONENT_NAME --space YOUR_SPACE_ID | ||
| ``` | ||
|
|
||
| This will download a single component and its dependencies to: | ||
| ``` | ||
| .storyblok/ | ||
| └── components/ | ||
| └── YOUR_SPACE_ID/ | ||
| ├── COMPONENT_NAME.json # Single component | ||
| ├── groups.json # Component groups | ||
| ├── COMPONENT_NAME.presets.json # Component presets | ||
| └── tags.json # Component tags | ||
| ``` | ||
|
|
||
| ## Options | ||
|
|
||
| | Option | Description | Default | | ||
| |--------|-------------|---------| | ||
| | `-s, --space <space>` | (Required) The ID of the space to pull components from | - | | ||
| | `-f, --filename <filename>` | Custom name for the components file | `components` | | ||
| | `--sf, --separate-files` | Create a separate file for each component | `false` | | ||
| | `--su, --suffix <suffix>` | Suffix to add to the files names | | | ||
| | `-p, --path <path>` | Custom path to store the files | `.storyblok/components` | | ||
|
|
||
| ## Examples | ||
|
|
||
| 1. Pull all components with default settings: | ||
| ```bash | ||
| storyblok components pull --space 12345 | ||
| ``` | ||
| Generates: | ||
| ``` | ||
| .storyblok/ | ||
| └── components/ | ||
| └── 12345/ | ||
| ├── components.json # All components | ||
| ├── groups.json # Component groups | ||
| ├── presets.json # Component presets | ||
| └── tags.json # Component tags | ||
| ``` | ||
|
|
||
| 2. Pull a single component: | ||
| ```bash | ||
| storyblok components pull hero --space 12345 | ||
| ``` | ||
| Generates: | ||
| ``` | ||
| .storyblok/ | ||
| └── components/ | ||
| └── 12345/ | ||
| ├── hero.json # Single component | ||
| ├── groups.json # Component groups | ||
| ├── hero.presets.json # Component presets | ||
| └── tags.json # Component tags | ||
| ``` | ||
|
|
||
| 3. Pull components with custom filename: | ||
|
alvarosabu marked this conversation as resolved.
Outdated
|
||
| ```bash | ||
| storyblok components pull --space 12345 --filename my-components | ||
| ``` | ||
| Generates: | ||
| ``` | ||
| .storyblok/ | ||
| └── components/ | ||
| └── 12345/ | ||
| ├── my-components.json # All components | ||
| ├── groups.json # Component groups | ||
| ├── presets.json # Component presets | ||
| └── tags.json # Component tags | ||
| ``` | ||
|
|
||
| 4. Pull components with custom suffix: | ||
| ```bash | ||
| storyblok components pull --space 12345 --suffix dev | ||
| ``` | ||
| Generates: | ||
| ``` | ||
| .storyblok/ | ||
| └── components/ | ||
| └── 12345/ | ||
| ├── components.dev.json # All components | ||
| ├── groups.json # Component groups | ||
| ├── presets.json # Component presets | ||
| └── tags.json # Component tags | ||
| ``` | ||
|
|
||
| 5. Pull components to separate files: | ||
| ```bash | ||
| storyblok components pull --space 12345 --separate-files | ||
| ``` | ||
| Generates: | ||
| ``` | ||
| .storyblok/ | ||
| └── components/ | ||
| └── 12345/ | ||
| ├── hero.json # Individual components | ||
| ├── hero.presets.json # Component presets | ||
| ├── feature.json | ||
| ├── feature.presets.json | ||
| ├── ... | ||
| ├── groups.json # Component groups | ||
| └── tags.json # Component tags | ||
| ``` | ||
|
|
||
| 6. Pull components to a custom path: | ||
| ```bash | ||
| storyblok components pull --space 12345 --path ./backup | ||
| ``` | ||
| Generates: | ||
| ``` | ||
| backup/ | ||
| └── components/ | ||
| └── 12345/ | ||
| ├── components.json # All components | ||
| ├── groups.json # Component groups | ||
| ├── presets.json # Component presets | ||
| └── tags.json # Component tags | ||
| ``` | ||
|
|
||
| ## File Structure | ||
|
|
||
| The command follows this pattern for file generation: | ||
| ``` | ||
| {path}/ | ||
| └── components/ | ||
| └── {spaceId}/ | ||
| ├── {filename}.{suffix}.json # Components file | ||
| ├── groups.json # Component groups | ||
| ├── presets.json # Component presets | ||
| └── tags.json # Component tags | ||
| ``` | ||
|
|
||
| When using `--separate-files`: | ||
| ``` | ||
| {path}/ | ||
| └── components/ | ||
| └── {spaceId}/ | ||
| ├── {componentName1}.json # Individual components | ||
| ├── {componentName1}.presets.json # Component presets | ||
| ├── {componentName2}.json | ||
| ├── {componentName2}.presets.json | ||
| ├── ... | ||
| ├── groups.json # Component groups | ||
| └── tags.json # Component tags | ||
| ``` | ||
|
|
||
| Where: | ||
| - `{path}` is the base path (default: `.storyblok`) | ||
| - `{spaceId}` is your Storyblok space ID | ||
|
alvarosabu marked this conversation as resolved.
Outdated
|
||
| - `{filename}` is the name you specified (default: `components`) | ||
| - `{suffix}` is the suffix you specified (default: space ID) | ||
| - `{componentName}` is the name of the component | ||
|
|
||
| ## Notes | ||
|
|
||
| - You must be logged in to use this command | ||
| - The space ID is required | ||
| - The command will create the necessary directories if they don't exist | ||
| - When using `--separate-files` or single component, presets are saved in separate files named `{componentName}.presets.json` | ||
| - The command downloads: | ||
| - Components | ||
| - Component groups | ||
| - Component presets | ||
| - Component tags | ||
Uh oh!
There was an error while loading. Please reload this page.