@storyblok/astro 2.0.4 → 2.0.6

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@storyblok/astro",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "Official Astro integration for the Storyblok Headless CMS",
5
5
  "main": "./dist/storyblok-astro.js",
6
6
  "module": "./dist/storyblok-astro.mjs",
@@ -28,18 +28,18 @@
28
28
  "prepublishOnly": "npm run build && cp ../README.md ./"
29
29
  },
30
30
  "dependencies": {
31
- "@storyblok/js": "^2.0.9",
31
+ "@storyblok/js": "^2.0.10",
32
32
  "camelcase": "^7.0.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@cypress/vite-dev-server": "^5.0.2",
36
- "@rollup/plugin-dynamic-import-vars": "^2.0.2",
37
- "@types/node": "18.11.18",
38
- "astro": "1.9.2",
39
- "cypress": "^12.3.0",
35
+ "@cypress/vite-dev-server": "^5.0.3",
36
+ "@rollup/plugin-dynamic-import-vars": "^2.0.3",
37
+ "@types/node": "18.14.0",
38
+ "astro": "2.0.14",
39
+ "cypress": "^12.6.0",
40
40
  "eslint-plugin-cypress": "^2.12.1",
41
- "start-server-and-test": "^1.15.2",
42
- "typescript": "4.9.4",
41
+ "start-server-and-test": "^1.15.4",
42
+ "typescript": "4.9.5",
43
43
  "vite": "^4.0.4",
44
44
  "vite-plugin-dts": "^1.7.1"
45
45
  },
@@ -1,611 +0,0 @@
1
- export type Platform = 'browser' | 'node' | 'neutral';
2
- export type Format = 'iife' | 'cjs' | 'esm';
3
- export type Loader = 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'json' | 'text' | 'base64' | 'file' | 'dataurl' | 'binary' | 'copy' | 'default';
4
- export type LogLevel = 'verbose' | 'debug' | 'info' | 'warning' | 'error' | 'silent';
5
- export type Charset = 'ascii' | 'utf8';
6
- export type Drop = 'console' | 'debugger';
7
-
8
- interface CommonOptions {
9
- /** Documentation: https://esbuild.github.io/api/#sourcemap */
10
- sourcemap?: boolean | 'linked' | 'inline' | 'external' | 'both';
11
- /** Documentation: https://esbuild.github.io/api/#legal-comments */
12
- legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'external';
13
- /** Documentation: https://esbuild.github.io/api/#source-root */
14
- sourceRoot?: string;
15
- /** Documentation: https://esbuild.github.io/api/#sources-content */
16
- sourcesContent?: boolean;
17
-
18
- /** Documentation: https://esbuild.github.io/api/#format */
19
- format?: Format;
20
- /** Documentation: https://esbuild.github.io/api/#global-name */
21
- globalName?: string;
22
- /** Documentation: https://esbuild.github.io/api/#target */
23
- target?: string | string[];
24
- /** Documentation: https://esbuild.github.io/api/#supported */
25
- supported?: Record<string, boolean>;
26
- /** Documentation: https://esbuild.github.io/api/#platform */
27
- platform?: Platform;
28
-
29
- /** Documentation: https://esbuild.github.io/api/#mangle-props */
30
- mangleProps?: RegExp;
31
- /** Documentation: https://esbuild.github.io/api/#mangle-props */
32
- reserveProps?: RegExp;
33
- /** Documentation: https://esbuild.github.io/api/#mangle-props */
34
- mangleQuoted?: boolean;
35
- /** Documentation: https://esbuild.github.io/api/#mangle-props */
36
- mangleCache?: Record<string, string | false>;
37
- /** Documentation: https://esbuild.github.io/api/#drop */
38
- drop?: Drop[];
39
- /** Documentation: https://esbuild.github.io/api/#minify */
40
- minify?: boolean;
41
- /** Documentation: https://esbuild.github.io/api/#minify */
42
- minifyWhitespace?: boolean;
43
- /** Documentation: https://esbuild.github.io/api/#minify */
44
- minifyIdentifiers?: boolean;
45
- /** Documentation: https://esbuild.github.io/api/#minify */
46
- minifySyntax?: boolean;
47
- /** Documentation: https://esbuild.github.io/api/#charset */
48
- charset?: Charset;
49
- /** Documentation: https://esbuild.github.io/api/#tree-shaking */
50
- treeShaking?: boolean;
51
- /** Documentation: https://esbuild.github.io/api/#ignore-annotations */
52
- ignoreAnnotations?: boolean;
53
-
54
- /** Documentation: https://esbuild.github.io/api/#jsx */
55
- jsx?: 'transform' | 'preserve' | 'automatic';
56
- /** Documentation: https://esbuild.github.io/api/#jsx-factory */
57
- jsxFactory?: string;
58
- /** Documentation: https://esbuild.github.io/api/#jsx-fragment */
59
- jsxFragment?: string;
60
- /** Documentation: https://esbuild.github.io/api/#jsx-import-source */
61
- jsxImportSource?: string;
62
- /** Documentation: https://esbuild.github.io/api/#jsx-development */
63
- jsxDev?: boolean;
64
- /** Documentation: https://esbuild.github.io/api/#jsx-side-effects */
65
- jsxSideEffects?: boolean;
66
-
67
- /** Documentation: https://esbuild.github.io/api/#define */
68
- define?: { [key: string]: string };
69
- /** Documentation: https://esbuild.github.io/api/#pure */
70
- pure?: string[];
71
- /** Documentation: https://esbuild.github.io/api/#keep-names */
72
- keepNames?: boolean;
73
-
74
- /** Documentation: https://esbuild.github.io/api/#color */
75
- color?: boolean;
76
- /** Documentation: https://esbuild.github.io/api/#log-level */
77
- logLevel?: LogLevel;
78
- /** Documentation: https://esbuild.github.io/api/#log-limit */
79
- logLimit?: number;
80
- /** Documentation: https://esbuild.github.io/api/#log-override */
81
- logOverride?: Record<string, LogLevel>;
82
- }
83
-
84
- export interface BuildOptions extends CommonOptions {
85
- /** Documentation: https://esbuild.github.io/api/#bundle */
86
- bundle?: boolean;
87
- /** Documentation: https://esbuild.github.io/api/#splitting */
88
- splitting?: boolean;
89
- /** Documentation: https://esbuild.github.io/api/#preserve-symlinks */
90
- preserveSymlinks?: boolean;
91
- /** Documentation: https://esbuild.github.io/api/#outfile */
92
- outfile?: string;
93
- /** Documentation: https://esbuild.github.io/api/#metafile */
94
- metafile?: boolean;
95
- /** Documentation: https://esbuild.github.io/api/#outdir */
96
- outdir?: string;
97
- /** Documentation: https://esbuild.github.io/api/#outbase */
98
- outbase?: string;
99
- /** Documentation: https://esbuild.github.io/api/#external */
100
- external?: string[];
101
- /** Documentation: https://esbuild.github.io/api/#alias */
102
- alias?: Record<string, string>;
103
- /** Documentation: https://esbuild.github.io/api/#loader */
104
- loader?: { [ext: string]: Loader };
105
- /** Documentation: https://esbuild.github.io/api/#resolve-extensions */
106
- resolveExtensions?: string[];
107
- /** Documentation: https://esbuild.github.io/api/#main-fields */
108
- mainFields?: string[];
109
- /** Documentation: https://esbuild.github.io/api/#conditions */
110
- conditions?: string[];
111
- /** Documentation: https://esbuild.github.io/api/#write */
112
- write?: boolean;
113
- /** Documentation: https://esbuild.github.io/api/#allow-overwrite */
114
- allowOverwrite?: boolean;
115
- /** Documentation: https://esbuild.github.io/api/#tsconfig */
116
- tsconfig?: string;
117
- /** Documentation: https://esbuild.github.io/api/#out-extension */
118
- outExtension?: { [ext: string]: string };
119
- /** Documentation: https://esbuild.github.io/api/#public-path */
120
- publicPath?: string;
121
- /** Documentation: https://esbuild.github.io/api/#entry-names */
122
- entryNames?: string;
123
- /** Documentation: https://esbuild.github.io/api/#chunk-names */
124
- chunkNames?: string;
125
- /** Documentation: https://esbuild.github.io/api/#asset-names */
126
- assetNames?: string;
127
- /** Documentation: https://esbuild.github.io/api/#inject */
128
- inject?: string[];
129
- /** Documentation: https://esbuild.github.io/api/#banner */
130
- banner?: { [type: string]: string };
131
- /** Documentation: https://esbuild.github.io/api/#footer */
132
- footer?: { [type: string]: string };
133
- /** Documentation: https://esbuild.github.io/api/#incremental */
134
- incremental?: boolean;
135
- /** Documentation: https://esbuild.github.io/api/#entry-points */
136
- entryPoints?: string[] | Record<string, string>;
137
- /** Documentation: https://esbuild.github.io/api/#stdin */
138
- stdin?: StdinOptions;
139
- /** Documentation: https://esbuild.github.io/plugins/ */
140
- plugins?: Plugin[];
141
- /** Documentation: https://esbuild.github.io/api/#working-directory */
142
- absWorkingDir?: string;
143
- /** Documentation: https://esbuild.github.io/api/#node-paths */
144
- nodePaths?: string[]; // The "NODE_PATH" variable from Node.js
145
- /** Documentation: https://esbuild.github.io/api/#watch */
146
- watch?: boolean | WatchMode;
147
- }
148
-
149
- export interface WatchMode {
150
- onRebuild?: (error: BuildFailure | null, result: BuildResult | null) => void;
151
- }
152
-
153
- export interface StdinOptions {
154
- contents: string | Uint8Array;
155
- resolveDir?: string;
156
- sourcefile?: string;
157
- loader?: Loader;
158
- }
159
-
160
- export interface Message {
161
- id: string;
162
- pluginName: string;
163
- text: string;
164
- location: Location | null;
165
- notes: Note[];
166
-
167
- /**
168
- * Optional user-specified data that is passed through unmodified. You can
169
- * use this to stash the original error, for example.
170
- */
171
- detail: any;
172
- }
173
-
174
- export interface Note {
175
- text: string;
176
- location: Location | null;
177
- }
178
-
179
- export interface Location {
180
- file: string;
181
- namespace: string;
182
- /** 1-based */
183
- line: number;
184
- /** 0-based, in bytes */
185
- column: number;
186
- /** in bytes */
187
- length: number;
188
- lineText: string;
189
- suggestion: string;
190
- }
191
-
192
- export interface OutputFile {
193
- path: string;
194
- /** "text" as bytes */
195
- contents: Uint8Array;
196
- /** "contents" as text (changes automatically with "contents") */
197
- get text(): string;
198
- }
199
-
200
- export interface BuildInvalidate {
201
- (): Promise<BuildIncremental>;
202
- dispose(): void;
203
- }
204
-
205
- export interface BuildIncremental extends BuildResult {
206
- rebuild: BuildInvalidate;
207
- }
208
-
209
- export interface BuildResult {
210
- errors: Message[];
211
- warnings: Message[];
212
- /** Only when "write: false" */
213
- outputFiles?: OutputFile[];
214
- /** Only when "incremental: true" */
215
- rebuild?: BuildInvalidate;
216
- /** Only when "watch: true" */
217
- stop?: () => void;
218
- /** Only when "metafile: true" */
219
- metafile?: Metafile;
220
- /** Only when "mangleCache" is present */
221
- mangleCache?: Record<string, string | false>;
222
- }
223
-
224
- export interface BuildFailure extends Error {
225
- errors: Message[];
226
- warnings: Message[];
227
- }
228
-
229
- /** Documentation: https://esbuild.github.io/api/#serve-arguments */
230
- export interface ServeOptions {
231
- port?: number;
232
- host?: string;
233
- servedir?: string;
234
- onRequest?: (args: ServeOnRequestArgs) => void;
235
- }
236
-
237
- export interface ServeOnRequestArgs {
238
- remoteAddress: string;
239
- method: string;
240
- path: string;
241
- status: number;
242
- /** The time to generate the response, not to send it */
243
- timeInMS: number;
244
- }
245
-
246
- /** Documentation: https://esbuild.github.io/api/#serve-return-values */
247
- export interface ServeResult {
248
- port: number;
249
- host: string;
250
- wait: Promise<void>;
251
- stop: () => void;
252
- }
253
-
254
- export interface TransformOptions extends CommonOptions {
255
- tsconfigRaw?: string | {
256
- compilerOptions?: {
257
- alwaysStrict?: boolean,
258
- importsNotUsedAsValues?: 'remove' | 'preserve' | 'error',
259
- jsx?: 'react' | 'react-jsx' | 'react-jsxdev' | 'preserve',
260
- jsxFactory?: string,
261
- jsxFragmentFactory?: string,
262
- jsxImportSource?: string,
263
- preserveValueImports?: boolean,
264
- target?: string,
265
- useDefineForClassFields?: boolean,
266
- },
267
- };
268
-
269
- sourcefile?: string;
270
- loader?: Loader;
271
- banner?: string;
272
- footer?: string;
273
- }
274
-
275
- export interface TransformResult {
276
- code: string;
277
- map: string;
278
- warnings: Message[];
279
- /** Only when "mangleCache" is present */
280
- mangleCache?: Record<string, string | false>;
281
- }
282
-
283
- export interface TransformFailure extends Error {
284
- errors: Message[];
285
- warnings: Message[];
286
- }
287
-
288
- export interface Plugin {
289
- name: string;
290
- setup: (build: PluginBuild) => (void | Promise<void>);
291
- }
292
-
293
- export interface PluginBuild {
294
- initialOptions: BuildOptions;
295
- resolve(path: string, options?: ResolveOptions): Promise<ResolveResult>;
296
-
297
- onStart(callback: () =>
298
- (OnStartResult | null | void | Promise<OnStartResult | null | void>)): void;
299
- onEnd(callback: (result: BuildResult) =>
300
- (void | Promise<void>)): void;
301
- onResolve(options: OnResolveOptions, callback: (args: OnResolveArgs) =>
302
- (OnResolveResult | null | undefined | Promise<OnResolveResult | null | undefined>)): void;
303
- onLoad(options: OnLoadOptions, callback: (args: OnLoadArgs) =>
304
- (OnLoadResult | null | undefined | Promise<OnLoadResult | null | undefined>)): void;
305
-
306
- // This is a full copy of the esbuild library in case you need it
307
- esbuild: {
308
- serve: typeof serve,
309
- build: typeof build,
310
- buildSync: typeof buildSync,
311
- transform: typeof transform,
312
- transformSync: typeof transformSync,
313
- formatMessages: typeof formatMessages,
314
- formatMessagesSync: typeof formatMessagesSync,
315
- analyzeMetafile: typeof analyzeMetafile,
316
- analyzeMetafileSync: typeof analyzeMetafileSync,
317
- initialize: typeof initialize,
318
- version: typeof version,
319
- };
320
- }
321
-
322
- export interface ResolveOptions {
323
- pluginName?: string;
324
- importer?: string;
325
- namespace?: string;
326
- resolveDir?: string;
327
- kind?: ImportKind;
328
- pluginData?: any;
329
- }
330
-
331
- export interface ResolveResult {
332
- errors: Message[];
333
- warnings: Message[];
334
-
335
- path: string;
336
- external: boolean;
337
- sideEffects: boolean;
338
- namespace: string;
339
- suffix: string;
340
- pluginData: any;
341
- }
342
-
343
- export interface OnStartResult {
344
- errors?: PartialMessage[];
345
- warnings?: PartialMessage[];
346
- }
347
-
348
- export interface OnResolveOptions {
349
- filter: RegExp;
350
- namespace?: string;
351
- }
352
-
353
- export interface OnResolveArgs {
354
- path: string;
355
- importer: string;
356
- namespace: string;
357
- resolveDir: string;
358
- kind: ImportKind;
359
- pluginData: any;
360
- }
361
-
362
- export type ImportKind =
363
- | 'entry-point'
364
-
365
- // JS
366
- | 'import-statement'
367
- | 'require-call'
368
- | 'dynamic-import'
369
- | 'require-resolve'
370
-
371
- // CSS
372
- | 'import-rule'
373
- | 'url-token'
374
-
375
- export interface OnResolveResult {
376
- pluginName?: string;
377
-
378
- errors?: PartialMessage[];
379
- warnings?: PartialMessage[];
380
-
381
- path?: string;
382
- external?: boolean;
383
- sideEffects?: boolean;
384
- namespace?: string;
385
- suffix?: string;
386
- pluginData?: any;
387
-
388
- watchFiles?: string[];
389
- watchDirs?: string[];
390
- }
391
-
392
- export interface OnLoadOptions {
393
- filter: RegExp;
394
- namespace?: string;
395
- }
396
-
397
- export interface OnLoadArgs {
398
- path: string;
399
- namespace: string;
400
- suffix: string;
401
- pluginData: any;
402
- }
403
-
404
- export interface OnLoadResult {
405
- pluginName?: string;
406
-
407
- errors?: PartialMessage[];
408
- warnings?: PartialMessage[];
409
-
410
- contents?: string | Uint8Array;
411
- resolveDir?: string;
412
- loader?: Loader;
413
- pluginData?: any;
414
-
415
- watchFiles?: string[];
416
- watchDirs?: string[];
417
- }
418
-
419
- export interface PartialMessage {
420
- id?: string;
421
- pluginName?: string;
422
- text?: string;
423
- location?: Partial<Location> | null;
424
- notes?: PartialNote[];
425
- detail?: any;
426
- }
427
-
428
- export interface PartialNote {
429
- text?: string;
430
- location?: Partial<Location> | null;
431
- }
432
-
433
- export interface Metafile {
434
- inputs: {
435
- [path: string]: {
436
- bytes: number
437
- imports: {
438
- path: string
439
- kind: ImportKind
440
- }[]
441
- }
442
- }
443
- outputs: {
444
- [path: string]: {
445
- bytes: number
446
- inputs: {
447
- [path: string]: {
448
- bytesInOutput: number
449
- }
450
- }
451
- imports: {
452
- path: string
453
- kind: ImportKind
454
- }[]
455
- exports: string[]
456
- entryPoint?: string
457
- cssBundle?: string
458
- }
459
- }
460
- }
461
-
462
- export interface FormatMessagesOptions {
463
- kind: 'error' | 'warning';
464
- color?: boolean;
465
- terminalWidth?: number;
466
- }
467
-
468
- export interface AnalyzeMetafileOptions {
469
- color?: boolean;
470
- verbose?: boolean;
471
- }
472
-
473
- /**
474
- * This function invokes the "esbuild" command-line tool for you. It returns a
475
- * promise that either resolves with a "BuildResult" object or rejects with a
476
- * "BuildFailure" object.
477
- *
478
- * - Works in node: yes
479
- * - Works in browser: yes
480
- *
481
- * Documentation: https://esbuild.github.io/api/#build-api
482
- */
483
- export declare function build(options: BuildOptions & { write: false }): Promise<BuildResult & { outputFiles: OutputFile[] }>;
484
- export declare function build(options: BuildOptions & { incremental: true, metafile: true }): Promise<BuildIncremental & { metafile: Metafile }>;
485
- export declare function build(options: BuildOptions & { incremental: true }): Promise<BuildIncremental>;
486
- export declare function build(options: BuildOptions & { metafile: true }): Promise<BuildResult & { metafile: Metafile }>;
487
- export declare function build(options: BuildOptions): Promise<BuildResult>;
488
-
489
- /**
490
- * This function is similar to "build" but it serves the resulting files over
491
- * HTTP on a localhost address with the specified port.
492
- *
493
- * - Works in node: yes
494
- * - Works in browser: no
495
- *
496
- * Documentation: https://esbuild.github.io/api/#serve
497
- */
498
- export declare function serve(serveOptions: ServeOptions, buildOptions: BuildOptions): Promise<ServeResult>;
499
-
500
- /**
501
- * This function transforms a single JavaScript file. It can be used to minify
502
- * JavaScript, convert TypeScript/JSX to JavaScript, or convert newer JavaScript
503
- * to older JavaScript. It returns a promise that is either resolved with a
504
- * "TransformResult" object or rejected with a "TransformFailure" object.
505
- *
506
- * - Works in node: yes
507
- * - Works in browser: yes
508
- *
509
- * Documentation: https://esbuild.github.io/api/#transform-api
510
- */
511
- export declare function transform(input: string | Uint8Array, options?: TransformOptions): Promise<TransformResult>;
512
-
513
- /**
514
- * Converts log messages to formatted message strings suitable for printing in
515
- * the terminal. This allows you to reuse the built-in behavior of esbuild's
516
- * log message formatter. This is a batch-oriented API for efficiency.
517
- *
518
- * - Works in node: yes
519
- * - Works in browser: yes
520
- */
521
- export declare function formatMessages(messages: PartialMessage[], options: FormatMessagesOptions): Promise<string[]>;
522
-
523
- /**
524
- * Pretty-prints an analysis of the metafile JSON to a string. This is just for
525
- * convenience to be able to match esbuild's pretty-printing exactly. If you want
526
- * to customize it, you can just inspect the data in the metafile yourself.
527
- *
528
- * - Works in node: yes
529
- * - Works in browser: yes
530
- *
531
- * Documentation: https://esbuild.github.io/api/#analyze
532
- */
533
- export declare function analyzeMetafile(metafile: Metafile | string, options?: AnalyzeMetafileOptions): Promise<string>;
534
-
535
- /**
536
- * A synchronous version of "build".
537
- *
538
- * - Works in node: yes
539
- * - Works in browser: no
540
- *
541
- * Documentation: https://esbuild.github.io/api/#build-api
542
- */
543
- export declare function buildSync(options: BuildOptions & { write: false }): BuildResult & { outputFiles: OutputFile[] };
544
- export declare function buildSync(options: BuildOptions): BuildResult;
545
-
546
- /**
547
- * A synchronous version of "transform".
548
- *
549
- * - Works in node: yes
550
- * - Works in browser: no
551
- *
552
- * Documentation: https://esbuild.github.io/api/#transform-api
553
- */
554
- export declare function transformSync(input: string, options?: TransformOptions): TransformResult;
555
-
556
- /**
557
- * A synchronous version of "formatMessages".
558
- *
559
- * - Works in node: yes
560
- * - Works in browser: no
561
- */
562
- export declare function formatMessagesSync(messages: PartialMessage[], options: FormatMessagesOptions): string[];
563
-
564
- /**
565
- * A synchronous version of "analyzeMetafile".
566
- *
567
- * - Works in node: yes
568
- * - Works in browser: no
569
- *
570
- * Documentation: https://esbuild.github.io/api/#analyze
571
- */
572
- export declare function analyzeMetafileSync(metafile: Metafile | string, options?: AnalyzeMetafileOptions): string;
573
-
574
- /**
575
- * This configures the browser-based version of esbuild. It is necessary to
576
- * call this first and wait for the returned promise to be resolved before
577
- * making other API calls when using esbuild in the browser.
578
- *
579
- * - Works in node: yes
580
- * - Works in browser: yes ("options" is required)
581
- *
582
- * Documentation: https://esbuild.github.io/api/#running-in-the-browser
583
- */
584
- export declare function initialize(options: InitializeOptions): Promise<void>;
585
-
586
- export interface InitializeOptions {
587
- /**
588
- * The URL of the "esbuild.wasm" file. This must be provided when running
589
- * esbuild in the browser.
590
- */
591
- wasmURL?: string | URL
592
-
593
- /**
594
- * The result of calling "new WebAssembly.Module(buffer)" where "buffer"
595
- * is a typed array or ArrayBuffer containing the binary code of the
596
- * "esbuild.wasm" file.
597
- *
598
- * You can use this as an alternative to "wasmURL" for environments where it's
599
- * not possible to download the WebAssembly module.
600
- */
601
- wasmModule?: WebAssembly.Module
602
-
603
- /**
604
- * By default esbuild runs the WebAssembly-based browser API in a web worker
605
- * to avoid blocking the UI thread. This can be disabled by setting "worker"
606
- * to false.
607
- */
608
- worker?: boolean
609
- }
610
-
611
- export let version: string;