storyblok 4.22.0 → 4.22.2

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/package.json CHANGED
@@ -1,40 +1,40 @@
1
1
  {
2
2
  "name": "storyblok",
3
- "type": "module",
4
- "version": "4.22.0",
3
+ "version": "4.22.2",
5
4
  "description": "Storyblok CLI",
6
- "author": "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)",
5
+ "keywords": [
6
+ "cli",
7
+ "javascript",
8
+ "node",
9
+ "storyblok"
10
+ ],
7
11
  "license": "MIT",
12
+ "author": "Alvaro Saburido <hola@alvarosaburido.dev> (https://github.com/alvarosabu/)",
8
13
  "repository": {
9
14
  "type": "git",
10
- "url": "https://github.com/storyblok/monoblok.git",
15
+ "url": "git+https://github.com/storyblok/monoblok.git",
11
16
  "branch": "main",
12
17
  "directory": "packages/cli"
13
18
  },
14
- "keywords": [
15
- "storyblok",
16
- "cli",
17
- "node",
18
- "javascript"
19
+ "bin": {
20
+ "storyblok": "./dist/index.mjs"
21
+ },
22
+ "files": [
23
+ "dist/**"
19
24
  ],
25
+ "type": "module",
26
+ "main": "./dist/index.mjs",
27
+ "types": "./dist/index.d.mts",
20
28
  "exports": {
21
29
  ".": {
22
- "types": "./dist/index.d.ts",
30
+ "types": "./dist/index.d.mts",
23
31
  "import": "./dist/index.mjs"
24
32
  },
25
33
  "./config": {
26
- "types": "./dist/config/index.d.ts",
34
+ "types": "./dist/config/index.d.mts",
27
35
  "import": "./dist/config/index.mjs"
28
36
  }
29
37
  },
30
- "main": "./dist/index.mjs",
31
- "types": "./dist/index.d.ts",
32
- "bin": {
33
- "storyblok": "./dist/index.mjs"
34
- },
35
- "files": [
36
- "dist/**"
37
- ],
38
38
  "dependencies": {
39
39
  "@inquirer/prompts": "^7.5.1",
40
40
  "@topcli/spinner": "^2.1.2",
@@ -44,9 +44,9 @@
44
44
  "cli-progress": "^3.12.0",
45
45
  "commander": "^13.1.0",
46
46
  "diff": "^8.0.4",
47
- "dotenv": "^16.5.0",
47
+ "dotenv": "^17.3.1",
48
48
  "filenamify": "^6.0.0",
49
- "jiti": "^2.6.1",
49
+ "jiti": "2.7.0",
50
50
  "json-schema-to-typescript": "^15.0.4",
51
51
  "minimatch": "^10.0.3",
52
52
  "octokit": "^5.0.3",
@@ -54,11 +54,11 @@
54
54
  "open": "^10.1.2",
55
55
  "pathe": "^2.0.3",
56
56
  "read-package-up": "^11.0.0",
57
- "@storyblok/region-helper": "1.5.0",
58
- "@storyblok/management-api-client": "0.7.0",
59
- "@storyblok/schema": "0.3.0",
60
57
  "@storyblok/js": "6.3.1",
61
- "storyblok-js-client": "7.7.3"
58
+ "@storyblok/management-api-client": "0.7.1",
59
+ "@storyblok/region-helper": "1.5.0",
60
+ "@storyblok/schema": "0.4.0",
61
+ "storyblok-js-client": "7.7.4"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@release-it/conventional-changelog": "10.0.0",
@@ -66,29 +66,50 @@
66
66
  "@types/diff": "^8.0.0",
67
67
  "@types/inquirer": "^9.0.8",
68
68
  "@types/node": "^24.11.0",
69
- "@vitest/coverage-v8": "^3.1.3",
70
- "@vitest/ui": "^3.1.3",
71
- "eslint": "^9.26.0",
69
+ "@vitest/coverage-v8": "^4.1.10",
70
+ "@vitest/ui": "^4.1.10",
72
71
  "memfs": "^4.17.1",
73
- "msw": "^2.8.2",
72
+ "msw": "^2.12.9",
73
+ "oxlint": "1.76.0",
74
74
  "release-it": "^18.1.2",
75
- "typescript": "5.8.3",
76
- "unbuild": "^3.5.0",
75
+ "tsx": "^4.21.0",
76
+ "typescript": "6.0.3",
77
77
  "uuid": "^11.1.0",
78
- "vite": "^6.4.3",
79
- "vitest": "^3.1.3",
80
- "@storyblok/eslint-config": "0.6.0"
78
+ "vitest": "^4.1.10",
79
+ "@storyblok/lint-config": "0.1.0",
80
+ "@storyblok/openapi-codegen": "0.0.1"
81
+ },
82
+ "nx": {
83
+ "targets": {
84
+ "generate:openapi": {
85
+ "inputs": [
86
+ "{projectRoot}/scripts/generate.ts",
87
+ "{projectRoot}/package.json",
88
+ "openapiCodegen"
89
+ ],
90
+ "outputs": [
91
+ "{projectRoot}/src/generated"
92
+ ],
93
+ "cache": true,
94
+ "dependsOn": [
95
+ "@storyblok/openapi-codegen:build"
96
+ ]
97
+ }
98
+ }
81
99
  },
82
100
  "scripts": {
83
- "build": "unbuild",
101
+ "build": "vp pack",
84
102
  "release": "release-it",
85
- "dev": "pnpm run build && node dist/index.mjs",
103
+ "dev": "vp pack --watch",
86
104
  "debug": "node --inspect-brk --loader tsx src/index.ts",
87
- "lint": "eslint .",
88
- "lint:fix": "eslint . --fix",
89
- "test": "vitest run",
105
+ "lint": "vp lint",
106
+ "lint:fix": "vp lint --fix",
107
+ "test": "vp test run",
90
108
  "test:types": "tsc --noEmit --skipLibCheck",
91
- "test:ui": "vitest --ui",
92
- "coverage": "vitest run --coverage"
109
+ "test:ui": "vp test --ui",
110
+ "start": "pnpm run build && node dist/index.mjs",
111
+ "test:watch": "vp test",
112
+ "test:coverage": "vp test run --coverage",
113
+ "generate:openapi": "tsx scripts/generate.ts"
93
114
  }
94
115
  }
@@ -1,347 +0,0 @@
1
- declare const regionCodes: readonly ["eu", "us", "cn", "ca", "ap"];
2
- type RegionCode = typeof regionCodes[number];
3
-
4
- /**
5
- * Interface representing the default options for a CLI command.
6
- */
7
- interface CommandOptions {
8
- /**
9
- * Indicates whether verbose output is enabled.
10
- */
11
- verbose: boolean;
12
- }
13
-
14
- /**
15
- * Interface representing the options for the `components pull` command.
16
- */
17
- interface PullComponentsOptions extends CommandOptions {
18
- /**
19
- * The filename to save the file as.
20
- * Defaults to `components`. The file will be saved as `<filename>.<space>.json`.
21
- * @default `components
22
- */
23
- filename?: string;
24
- /**
25
- * The suffix to add to the filename.
26
- * Defaults to the space ID.
27
- * @default space
28
- */
29
- suffix?: string;
30
- /**
31
- * Indicates whether to save each component to a separate file.
32
- * @default false
33
- */
34
- separateFiles?: boolean;
35
- /**
36
- * Glob pattern to select components by name. Matching components and their dependencies
37
- * (assigned groups with ancestors, tags, presets, and schema-whitelisted groups/tags) are pulled.
38
- */
39
- filter?: string;
40
- /**
41
- * Component group name(s) or `Parent/Child` path(s) to select. Includes descendant groups.
42
- * Repeatable; multiple values match any of the given groups.
43
- */
44
- group?: string[];
45
- /**
46
- * Component tag name(s) to select. Repeatable and comma-separated; multiple values match any.
47
- */
48
- tag?: string[];
49
- }
50
-
51
- interface PushComponentsOptions extends CommandOptions {
52
- /**
53
- * The glob pattern filter to apply to components before pushing.
54
- * Matching components and all their dependencies (groups, tags, other components)
55
- * will be collected and pushed together.
56
- * @default `.*`
57
- */
58
- filter?: string;
59
- /**
60
- * Indicates whether to save each component to a separate file.
61
- * @default false
62
- */
63
- separateFiles?: boolean;
64
- /**
65
- * The source space id.
66
- */
67
- from?: string;
68
- /**
69
- * Suffix to add to the component name.
70
- */
71
- suffix?: string;
72
- /**
73
- * Component group name(s) or `Parent/Child` path(s) to select from local files. Includes descendants.
74
- * Repeatable; multiple values match any of the given groups.
75
- */
76
- group?: string[];
77
- /**
78
- * Component tag name(s) to select from local files. Repeatable and comma-separated; multiple values match any.
79
- */
80
- tag?: string[];
81
- }
82
-
83
- interface MigrationsGenerateOptions extends CommandOptions {
84
- suffix?: string;
85
- }
86
-
87
- interface MigrationsRunOptions extends CommandOptions {
88
- dryRun?: boolean;
89
- filter?: string;
90
- /**
91
- * The source space id to read migration files from.
92
- */
93
- from?: string;
94
- query?: string;
95
- startsWith?: string;
96
- publish?: 'all' | 'published' | 'published-with-changes';
97
- }
98
-
99
- /**
100
- * Options for the datasources delete command.
101
- */
102
- interface DeleteDatasourceOptions {
103
- /**
104
- * The datasource id to delete by, if provided. If not set, the command will delete by name.
105
- */
106
- id?: string;
107
- /**
108
- * If true, skip confirmation prompt (for CI or automation)
109
- */
110
- force?: boolean;
111
- }
112
-
113
- /**
114
- * Interface representing the options for the `datasources pull` command.
115
- */
116
- interface PullDatasourcesOptions extends CommandOptions {
117
- /**
118
- * The filename to save the file as.
119
- * Defaults to `DEFAULT_DATASOURCES_FILENAME`. The file will be saved as `<filename>.<space>.json`.
120
- * @default DEFAULT_DATASOURCES_FILENAME
121
- */
122
- filename?: string;
123
- /**
124
- * The suffix to add to the filename.
125
- * Defaults to the space ID.
126
- * @default space
127
- */
128
- suffix?: string;
129
- /**
130
- * Indicates whether to save each datasource to a separate file.
131
- * @default false
132
- */
133
- separateFiles?: boolean;
134
- }
135
-
136
- interface PushDatasourcesOptions extends CommandOptions {
137
- /**
138
- * The glob pattern filter to apply to datasources before pushing.
139
- * @default `.*`
140
- */
141
- filter?: string;
142
- /**
143
- * Indicates whether to save each component to a separate file.
144
- * @default false
145
- */
146
- separateFiles?: boolean;
147
- /**
148
- * The source space id.
149
- */
150
- from?: string;
151
- /**
152
- * Suffix to add to the component name.
153
- */
154
- suffix?: string;
155
- }
156
-
157
- type MigrationsRollbackOptions = CommandOptions;
158
-
159
- interface GenerateTypesOptions {
160
- separateFiles?: boolean;
161
- strict?: boolean;
162
- typePrefix?: string;
163
- typeSuffix?: string;
164
- filename?: string;
165
- path?: string;
166
- suffix?: string;
167
- customFieldsParser?: string;
168
- compilerOptions?: string;
169
- }
170
-
171
- /**
172
- * Interface representing the options for the `pull-languages` command.
173
- */
174
- interface PullLanguagesOptions extends CommandOptions {
175
- /**
176
- * The path to save the languages file to.
177
- * Defaults to `.storyblok/languages`.
178
- * @default `.storyblok/languages`
179
- */
180
- path?: string;
181
- /**
182
- * The space ID.
183
- * @required true
184
- */
185
- space: string;
186
- /**
187
- * The filename to save the file as.
188
- * Defaults to `DEFAULT_LANGUAGES_FILENAME`. The file will be saved as `<filename>.<space>.json`.
189
- * @default DEFAULT_LANGUAGES_FILENAME
190
- */
191
- filename?: string;
192
- /**
193
- * The suffix to add to the filename.
194
- * Defaults to the space ID.
195
- * @default space
196
- */
197
- suffix?: string;
198
- }
199
-
200
- interface PullAssetsOptions extends CommandOptions {
201
- dryRun?: boolean;
202
- query?: string;
203
- assetToken?: string;
204
- }
205
-
206
- interface PushAssetsOptions extends CommandOptions {
207
- from?: string;
208
- data?: string;
209
- shortFilename?: string;
210
- folder?: string;
211
- cleanup?: boolean;
212
- updateStories?: boolean;
213
- assetToken?: string;
214
- dryRun?: boolean;
215
- }
216
-
217
- interface PullStoriesOptions extends CommandOptions {
218
- dryRun?: boolean;
219
- query?: string;
220
- startsWith?: string;
221
- }
222
-
223
- interface PushStoriesOptions extends CommandOptions {
224
- from?: string;
225
- dryRun?: boolean;
226
- publish?: string;
227
- cleanup?: boolean;
228
- }
229
-
230
- interface PruneLogsOptions extends CommandOptions {
231
- keep: number;
232
- }
233
-
234
- interface PruneReportsOptions extends CommandOptions {
235
- keep: number;
236
- }
237
-
238
- /**
239
- * Makes all properties in T optional recursively
240
- */
241
- type DeepPartial<T> = T extends object ? {
242
- [P in keyof T]?: DeepPartial<T[P]>;
243
- } : T;
244
-
245
- interface ApiConfig {
246
- maxRetries: number;
247
- rateLimit: number;
248
- /** @deprecated Use `rateLimit` instead. @todo(next-major): Remove this field. */
249
- maxConcurrency?: number;
250
- }
251
- interface LogConsoleConfig {
252
- enabled: boolean;
253
- level: string;
254
- }
255
- interface LogFileConfig {
256
- enabled: boolean;
257
- level: string;
258
- maxFiles: number;
259
- }
260
- interface LogConfig {
261
- console: LogConsoleConfig;
262
- file: LogFileConfig;
263
- }
264
- interface ReportConfig {
265
- enabled: boolean;
266
- maxFiles: number;
267
- }
268
- interface UiConfig {
269
- enabled: boolean;
270
- }
271
- interface GlobalConfig {
272
- region?: RegionCode;
273
- space?: number | string;
274
- path?: string;
275
- api: ApiConfig;
276
- log: LogConfig;
277
- report: ReportConfig;
278
- ui: UiConfig;
279
- verbose: boolean;
280
- }
281
- type StripCommandOption<T> = T extends CommandOptions ? Omit<T, keyof CommandOptions> : T;
282
- type CommandConfig<T> = Partial<StripCommandOption<T>>;
283
- interface SharedConfigOptions {
284
- space?: number | string;
285
- path?: string;
286
- }
287
- interface CommandOptionsMap {
288
- components: {
289
- pull: PullComponentsOptions;
290
- push: PushComponentsOptions;
291
- };
292
- datasources: {
293
- pull: PullDatasourcesOptions;
294
- push: PushDatasourcesOptions;
295
- delete: DeleteDatasourceOptions;
296
- };
297
- migrations: {
298
- generate: MigrationsGenerateOptions;
299
- run: MigrationsRunOptions;
300
- rollback: MigrationsRollbackOptions;
301
- };
302
- types: {
303
- generate: GenerateTypesOptions;
304
- };
305
- languages: {
306
- pull: PullLanguagesOptions;
307
- };
308
- assets: {
309
- pull: PullAssetsOptions;
310
- push: PushAssetsOptions;
311
- };
312
- stories: {
313
- pull: PullStoriesOptions;
314
- push: PushStoriesOptions;
315
- };
316
- logs: {
317
- list: Record<string, never>;
318
- prune: PruneLogsOptions;
319
- };
320
- reports: {
321
- list: Record<string, never>;
322
- prune: PruneReportsOptions;
323
- };
324
- }
325
- type SubcommandConfig<T> = SharedConfigOptions & CommandConfig<T>;
326
- type ModuleConfig<Subs extends Record<string, any>> = SharedConfigOptions & {
327
- [K in keyof Subs]?: SubcommandConfig<Subs[K]>;
328
- };
329
- type ModulesConfig = {
330
- [K in keyof CommandOptionsMap]?: ModuleConfig<CommandOptionsMap[K]>;
331
- };
332
- type ComponentsModuleConfig = ModulesConfig['components'];
333
- type DatasourcesModuleConfig = ModulesConfig['datasources'];
334
- type MigrationsModuleConfig = ModulesConfig['migrations'];
335
- type TypesModuleConfig = ModulesConfig['types'];
336
- type LanguagesModuleConfig = ModulesConfig['languages'];
337
- type AssetsModuleConfig = ModulesConfig['assets'];
338
- type StoriesModuleConfig = ModulesConfig['stories'];
339
- type LogsModuleConfig = ModulesConfig['logs'];
340
- type ReportsModuleConfig = ModulesConfig['reports'];
341
- interface StoryblokConfig extends DeepPartial<GlobalConfig> {
342
- modules?: ModulesConfig;
343
- }
344
- declare function defineConfig<T extends StoryblokConfig>(config: T): T;
345
-
346
- export { defineConfig };
347
- export type { AssetsModuleConfig, ComponentsModuleConfig, DatasourcesModuleConfig, LanguagesModuleConfig, LogsModuleConfig, MigrationsModuleConfig, ModulesConfig, ReportsModuleConfig, StoriesModuleConfig, StoryblokConfig, TypesModuleConfig };
package/dist/index.d.ts DELETED
@@ -1,121 +0,0 @@
1
-
2
- type StoryblokPropertyType = 'asset' | 'multiasset' | 'multilink' | 'table' | 'richtext';
3
- interface StoryblokAsset {
4
- alt: string | null;
5
- fieldtype: 'asset';
6
- id: number;
7
- filename: string | null;
8
- name: string;
9
- title: string | null;
10
- focus: string | null;
11
- copyright?: string | null;
12
- meta_data?: Record<string, any>;
13
- source?: string | null;
14
- is_external_url?: boolean;
15
- is_private?: boolean;
16
- src?: string;
17
- updated_at?: string;
18
- width?: number | null;
19
- height?: number | null;
20
- aspect_ratio?: number | null;
21
- public_id?: string | null;
22
- content_type?: string;
23
- }
24
- interface StoryblokMultiasset extends Array<StoryblokAsset> {
25
- }
26
- interface StoryblokMultilinkStory {
27
- name: string;
28
- created_at: string;
29
- published_at: string;
30
- id: number;
31
- uuid: string;
32
- content: Record<string, any>;
33
- slug: string;
34
- full_slug: string;
35
- sort_by_date?: string;
36
- position?: number;
37
- tag_list?: string[];
38
- is_startpage?: boolean;
39
- parent_id?: number | null;
40
- meta_data?: Record<string, any> | null;
41
- group_id?: string;
42
- first_published_at?: string;
43
- release_id?: number | null;
44
- lang?: string;
45
- path?: string | null;
46
- alternates?: any[];
47
- default_full_slug?: string | null;
48
- translated_slugs?: any[] | null;
49
- }
50
- interface StoryblokMultilinkLink {
51
- id: number;
52
- uuid: string;
53
- slug: string;
54
- path: string | null;
55
- parent_id: number;
56
- name: string;
57
- is_folder: boolean;
58
- published: boolean;
59
- is_startpage: boolean;
60
- position: number;
61
- real_path: string;
62
- }
63
- interface StoryblokMultilinkUrl {
64
- name: string;
65
- id: number;
66
- uuid: string;
67
- slug: string;
68
- url: string;
69
- full_slug: string;
70
- }
71
- interface StoryblokMultilinkBase {
72
- fieldtype: 'multilink';
73
- id: string;
74
- url: string;
75
- cached_url: string;
76
- target?: '_blank' | '_self';
77
- anchor?: string;
78
- rel?: string;
79
- title?: string;
80
- prep?: string;
81
- }
82
- type StoryblokMultilink = (StoryblokMultilinkBase & {
83
- linktype: 'story';
84
- story?: StoryblokMultilinkStory | StoryblokMultilinkLink | StoryblokMultilinkUrl;
85
- }) | (StoryblokMultilinkBase & {
86
- linktype: 'url';
87
- }) | (StoryblokMultilinkBase & {
88
- linktype: 'email';
89
- email: string;
90
- }) | (StoryblokMultilinkBase & {
91
- linktype: 'asset';
92
- });
93
- interface StoryblokTable {
94
- fieldtype: 'table';
95
- thead: Array<{
96
- _uid: string;
97
- value: string;
98
- component: '_table_head';
99
- _editable?: string;
100
- }>;
101
- tbody: Array<{
102
- _uid: string;
103
- component: '_table_row';
104
- _editable?: string;
105
- body: Array<{
106
- _uid: string;
107
- value: string;
108
- component: '_table_col';
109
- _editable?: string;
110
- }>;
111
- }>;
112
- }
113
- interface StoryblokRichtext {
114
- type: string;
115
- content?: StoryblokRichtext[];
116
- marks?: StoryblokRichtext[];
117
- attrs?: Record<string, any>;
118
- text?: string;
119
- }
120
-
121
- export type { StoryblokAsset, StoryblokMultiasset, StoryblokMultilink, StoryblokMultilinkLink, StoryblokMultilinkStory, StoryblokMultilinkUrl, StoryblokPropertyType, StoryblokRichtext, StoryblokTable };