|
1 | | - |
2 | | - |
3 | 1 | <div align="center"> |
4 | | - <h1>Storyblok CLI</h1> |
5 | | - <p align="center">A powerful CLI for scaffolding <a href="https://www.storyblok.com?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok" target="_blank">Storyblok</a> projects and fieldtypes.</p> |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | +<h1>Storyblok CLI</h1> |
| 6 | + <p>A powerful CLI tool to improve the DX of your <a href="https://www.storyblok.com?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok" target="_blank">Storyblok</a> projects.</p> |
6 | 7 | <br /> |
7 | 8 | </div> |
8 | 9 |
|
9 | 10 | <p align="center"> |
10 | 11 | <a href="https://npmjs.com/package/storyblok"> |
11 | | - <img src="https://img.shields.io/npm/v/storyblok/latest.svg?style=flat-square" alt="Storyblok JS" /> |
| 12 | + <img src="https://img.shields.io/npm/v/storyblok/latest.svg?style=flat-square&color=8d60ff" alt="Storyblok JS Client" /> |
12 | 13 | </a> |
13 | 14 | <a href="https://npmjs.com/package/storyblok" rel="nofollow"> |
14 | | - <img src="https://img.shields.io/npm/dt/storyblok.svg?style=flat-square" alt="npm"> |
| 15 | + <img src="https://img.shields.io/npm/dt/storyblok.svg?style=appveyor&color=8d60ff" alt="npm"> |
15 | 16 | </a> |
16 | | -</p> |
17 | | - |
18 | | -<p align="center"> |
19 | 17 | <a href="https://discord.gg/jKrbAMz"> |
20 | | - <img src="https://img.shields.io/discord/700316478792138842?label=Join%20Our%20Discord%20Community&style=appveyor&logo=discord&color=09b3af"> |
| 18 | + <img src="https://img.shields.io/discord/700316478792138842?label=Join%20Our%20Discord%20Community&style=appveyor&logo=discord&color=8d60ff"> |
21 | 19 | </a> |
22 | 20 | <a href="https://twitter.com/intent/follow?screen_name=storyblok"> |
23 | | - <img src="https://img.shields.io/badge/Follow-%40storyblok-09b3af?style=appveyor&logo=twitter" alt="Follow @Storyblok" /> |
24 | | - </a> |
25 | | - <a href="https://app.storyblok.com/#!/signup?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-richtext"> |
26 | | - <img src="https://img.shields.io/badge/Try%20Storyblok-Free-09b3af?style=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAHqADAAQAAAABAAAAHgAAAADpiRU/AAACRElEQVRIDWNgGGmAEd3D3Js3LPrP8D8WXZwSPiMjw6qvPoHhyGYwIXNAbGpbCjbzP0MYuj0YFqMroBV/wCxmIeSju64eDNzMBJUxvP/9i2Hnq5cM1devMnz984eQsQwETeRhYWHgIcJiXqC6VHlFBjUeXgav40cIWkz1oLYXFmGwFBImaDFBHyObcOzdW4aSq5eRhRiE2dgYlpuYoYSKJi8vw3GgWnyAJIs/AuPu4scPGObd/fqVQZ+PHy7+6udPOBsXgySLDfn5GRYYmaKYJcXBgWLpsx8/GPa8foWiBhuHJIsl2DkYQqWksZkDFgP5PObcKYYff//iVAOTIDlx/QPqRMb/YSYBaWlOToZIaVkGZmAZSQiQ5OPtwHwacuo4iplMQEu6tXUZMhSUGDiYmBjylFQYvv/7x9B04xqKOnQOyT5GN+Df//8M59ASXKyMHLoyDD5JPtbj42OYrm+EYgg70JfuYuIoYmLs7AwMjIzA+uY/zjAnyWJpDk6GOFnCvrn86SOwmsNtKciVFAc1ileBHFDC67lzG10Yg0+SjzF0ownsf/OaofvOLYaDQJoQIGix94ljv1gIZI8Pv38zPvj2lQWYf3HGKbpDCFp85v07NnRN1OBTPY6JdRSGxcCw2k6sZuLVMZ5AV4s1TozPnGGFKbz+/PE7IJsHmC//MDMyhXBw8e6FyRFLv3Z0/IKuFqvFyIqAzd1PwBzJw8jAGPfVx38JshwlbIygxmYY43/GQmpais0ODDHuzevLMARHBcgIAQAbOJHZW0/EyQAAAABJRU5ErkJggg==" alt="Follow @Storyblok" /> |
| 21 | + <img src="https://img.shields.io/badge/Follow-%40storyblok-8d60ff?style=appveyor&logo=twitter" alt="Follow @Storyblok" /> |
| 22 | + </a><br/> |
| 23 | + <a href="https://app.storyblok.com/#!/signup?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-cli"> |
| 24 | + <img src="https://img.shields.io/badge/Try%20Storyblok-Free-8d60ff?style=appveyor&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAABGdBTUEAALGPC/xhBQAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAHqADAAQAAAABAAAAHgAAAADpiRU/AAACRElEQVRIDWNgGGmAEd3D3Js3LPrP8D8WXZwSPiMjw6qvPoHhyGYwIXNAbGpbCjbzP0MYuj0YFqMroBV/wCxmIeSju64eDNzMBJUxvP/9i2Hnq5cM1devMnz984eQsQwETeRhYWHgIcJiXqC6VHlFBjUeXgav40cIWkz1oLYXFmGwFBImaDFBHyObcOzdW4aSq5eRhRiE2dgYlpuYoYSKJi8vw3GgWnyAJIs/AuPu4scPGObd/fqVQZ+PHy7+6udPOBsXgySLDfn5GRYYmaKYJcXBgWLpsx8/GPa8foWiBhuHJIsl2DkYQqWksZkDFgP5PObcKYYff//iVAOTIDlx/QPqRMb/YSYBaWlOToZIaVkGZmAZSQiQ5OPtwHwacuo4iplMQEu6tXUZMhSUGDiYmBjylFQYvv/7x9B04xqKOnQOyT5GN+Df//8M59ASXKyMHLoyDD5JPtbj42OYrm+EYgg70JfuYuIoYmLs7AwMjIzA+uY/zjAnyWJpDk6GOFnCvrn86SOwmsNtKciVFAc1ileBHFDC67lzG10Yg0+SjzF0ownsf/OaofvOLYaDQJoQIGix94ljv1gIZI8Pv38zPvj2lQWYf3HGKbpDCFp85v07NnRN1OBTPY6JdRSGxcCw2k6sZuLVMZ5AV4s1TozPnGGFKbz+/PE7IJsHmC//MDMyhXBw8e6FyRFLv3Z0/IKuFqvFyIqAzd1PwBzJw8jAGPfVx38JshwlbIygxmYY43/GQmpais0ODDHuzevLMARHBcgIAQAbOJHZW0/EyQAAAABJRU5ErkJggg==" alt="Follow @Storyblok" /> |
27 | 25 | </a> |
28 | 26 | </p> |
29 | 27 |
|
| 28 | +## Features |
| 29 | + |
| 30 | +- 🛡️ **Type Safety** - Generate TypeScript type definitions for your Storyblok components, ensuring type safety in your frontend applications |
| 31 | +- 🔐 **Authentication** - Secure login system with support for different regions and CI environments |
| 32 | +- 🧩 **Component Management** - Pull and push component schemas, groups, presets, and internal tags between spaces |
| 33 | +- 🔄 **Migration System** - Generate and run migrations to transform or update field values across your Storyblok content |
| 34 | +- 🌐 **Language Management** - Pull and manage languages for your Storyblok space |
| 35 | +- 📁 **File Organization** - Organized file structure with the `.storyblok` directory as default |
| 36 | +- 🛠️ **Customizable Paths** - Flexible path configuration for all generated files |
| 37 | +- 📝 **Naming Conventions** - Consistent file naming with customizable suffixes and prefixes |
| 38 | +- 📂 **Separate Files Support** - Option to work with individual component files or consolidated files |
| 39 | +- 👀 **Dry Run Mode** - Preview migrations changes before applying them to your Storyblok space |
| 40 | +- 🔍 **Filtering Capabilities** - Filter components and stories using glob patterns and Storyblok query syntax |
| 41 | +- 📊 **Verbose Logging** - Improved error handling and detailed logging options for debugging and monitoring |
| 42 | + |
30 | 43 | ## Pre-requisites |
31 | 44 |
|
32 | 45 | - [Node.js >= 18.0.0](https://nodejs.org/en/download/) |
33 | 46 | - Storyblok account (sign up [here](https://app.storyblok.com/#!/signup?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-cli)) |
34 | 47 | - Personal access token from Storyblok (get it [here](https://app.storyblok.com/#/me/account?tab=token)) |
35 | 48 |
|
36 | | -## 🚀 Usage |
37 | | - |
38 | | -### Installation |
39 | | - |
40 | | -```bash |
41 | | -npm install storyblok -g |
42 | | -``` |
43 | | - |
44 | | -If you prefer not to install the package globally you can use `npx`: |
45 | | - |
46 | | -```bash |
47 | | -npx storyblok <command> |
48 | | -``` |
49 | | - |
50 | | -## Breaking Changes ⚠️ |
51 | | - |
52 | | -### `.storyblok` directory as default |
53 | | - |
54 | | -All the commands that generate files will now use the `.storyblok` directory as the default directory to interact with those files. This aims to encapsulate all Storyblok CLI operations instead of filling them on the root. Users would be able to customize the directory by using the `--path` flag. |
55 | | - |
56 | | -Example: |
57 | | - |
58 | | -```bash |
59 | | -storyblok pull-languages --space=12345 |
60 | | -``` |
61 | | - |
62 | | -Will generate the languages in the `.storyblok/languages` directory. |
63 | | - |
64 | | -> [!TIP] |
65 | | -> If you prefer to avoid pushing the `.storyblok` directory to your repository you can add it to your `.gitignore` file. |
66 | | -
|
67 | | -### Generated filename syntax conventions |
68 | | - |
69 | | -The generated files will now follow a more consistent naming convention. The files will be named using the following syntax: |
70 | | - |
71 | | -``` |
72 | | -<filename>.<suffix>.<extension> |
73 | | -``` |
| 49 | +## Documentation |
74 | 50 |
|
75 | | -Where: |
76 | | - |
77 | | -- `<filename>` is the name of the file. Customizable by the user with the `--filename` flag |
78 | | -- `<suffix>` is an optional suffix to differentiate the files. By default is going to be the `spaceId` and is customizable by the user with the `--suffix` flag |
79 | | -- `<extension>` is the file extension. By default is `json` (Not configurable) |
80 | | - |
81 | | -Example: |
82 | | - |
83 | | -```bash |
84 | | -storyblok pull-languages --space=12345 --filename=my-languages --suffix=dev |
85 | | -``` |
86 | | - |
87 | | -Will generate the languages in the following path `.storyblok/languages/my-languages.dev.json` |
88 | | - |
89 | | -If you would like to use a timestamp as the suffix you can use: |
90 | | - |
91 | | -```bash |
92 | | -storyblok pull-languages --space=12345 --filename=my-languages --suffix="$(date +%s)" |
93 | | -``` |
94 | | - |
95 | | -> [!WARNING] |
96 | | -> The `--filename` will be ignored in the case that `--separate-files` is used on the commands that supports it. |
| 51 | +For complete documentation, please visit [https://storyblok.com/docs](https://storyblok.com/docs/packages/my-joyful-package) |
97 | 52 |
|
98 | 53 | ## Setup |
99 | 54 |
|
100 | | -First clone the repository and install the dependencies: |
| 55 | +This package relies on [pnpm](https://pnpm.io/) to manage dependencies. For instructions on how to install pnpm, please visit [pnpm.io](https://pnpm.io/installation). |
101 | 56 |
|
102 | 57 | ```bash |
103 | 58 | pnpm install |
104 | 59 | ``` |
105 | 60 |
|
106 | | -Then you can stub and run the CLI with: |
107 | | - |
108 | | -```bash |
109 | | -pnpm run dev <command> |
110 | | -``` |
111 | | - |
112 | | -For example: |
| 61 | +## Build |
113 | 62 |
|
114 | 63 | ```bash |
115 | | -pnpm run dev login |
| 64 | +pnpm build |
116 | 65 | ``` |
117 | 66 |
|
118 | 67 | ### Testing |
@@ -145,7 +94,35 @@ Then you can set breakpoints directly to the typescript files and the debugger w |
145 | 94 |
|
146 | 95 |  |
147 | 96 |
|
148 | | -### Contributing |
| 97 | +## Community |
| 98 | + |
| 99 | +For help, discussion about best practices, or any other conversation that would benefit from being searchable: |
| 100 | + |
| 101 | +- [Discuss Storyblok on Github Discussions](https://github.com/storyblok/storyblok/discussions) |
| 102 | + |
| 103 | +For community support, chatting with other users, please visit: |
| 104 | + |
| 105 | +- [Discuss Storyblok on Discord](https://discord.gg/jKrbAMz) |
| 106 | + |
| 107 | +## Support |
| 108 | + |
| 109 | +For bugs or feature requests, please [submit an issue](https://github.com/storyblok/my-joyful-package/issues/new/choose). |
| 110 | + |
| 111 | +> [!IMPORTANT] |
| 112 | +> Please search existing issues before submitting a new one. Issues without a minimal reproducible example will be closed. [Why reproductions are Required](https://antfu.me/posts/why-reproductions-are-required). |
| 113 | +
|
| 114 | +### I can't share my company project code |
| 115 | + |
| 116 | +We understand that you might not be able to share your company's project code. Please provide a minimal reproducible example that demonstrates the issue by using tools like [Stackblitz](https://stackblitz.com) or a link to a Github Repo lease make sure you include a README file with the instructions to build and run the project, important not to include any access token, password or personal information of any kind. |
| 117 | + |
| 118 | +### I only have a question |
| 119 | + |
| 120 | +If you have a question, please ask in the [Discuss Storyblok on Discord](https://discord.gg/jKrbAMz) channel. |
| 121 | + |
| 122 | +## Contributing |
| 123 | + |
| 124 | +If you're interested in contributing to my-joyful-package, please read our [contributing docs](https://github.com/storyblok/.github/blob/main/CONTRIBUTING.md) before submitting a pull request. |
| 125 | + |
| 126 | +## License |
149 | 127 |
|
150 | | -Please see our [contributing guidelines](https://github.com/storyblok/.github/blob/main/contributing.md) and our [code of conduct](https://www.storyblok.com/trust-center#code-of-conduct?utm_source=github.com&utm_medium=readme&utm_campaign=storyblok-js). |
151 | | -This project use [semantic-release](https://semantic-release.gitbook.io/semantic-release/) for generate new versions by using commit messages and we use the Angular Convention to naming the commits. Check [this question](https://semantic-release.gitbook.io/semantic-release/support/faq#how-can-i-change-the-type-of-commits-that-trigger-a-release) about it in semantic-release FAQ |
| 128 | +[License](/LICENSE) |
0 commit comments