@storyblok/astro 2.0.0 → 2.0.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/StoryblokComponent.astro +1 -1
- package/dist/index.d.ts +39 -0
- package/dist/node_modules/camelcase/index.d.ts +102 -0
- package/dist/node_modules/esbuild/lib/main.d.ts +611 -0
- package/dist/node_modules/rollup/dist/rollup.d.ts +936 -0
- package/dist/node_modules/vite/client.d.ts +272 -0
- package/dist/node_modules/vite/dist/node/index.d.ts +3281 -0
- package/dist/node_modules/vite/types/customEvent.d.ts +23 -0
- package/dist/node_modules/vite/types/hmrPayload.d.ts +61 -0
- package/dist/node_modules/vite/types/hot.d.ts +32 -0
- package/dist/node_modules/vite/types/importGlob.d.ts +97 -0
- package/dist/node_modules/vite/types/importMeta.d.ts +28 -0
- package/dist/types.d.ts +12 -0
- package/dist/vite-plugin-storyblok-components.d.ts +5 -0
- package/dist/vite-plugin-storyblok-init.d.ts +5 -0
- package/package.json +7 -6
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
ErrorPayload,
|
|
3
|
+
FullReloadPayload,
|
|
4
|
+
PrunePayload,
|
|
5
|
+
UpdatePayload,
|
|
6
|
+
} from './hmrPayload'
|
|
7
|
+
|
|
8
|
+
export interface CustomEventMap {
|
|
9
|
+
'vite:beforeUpdate': UpdatePayload
|
|
10
|
+
'vite:afterUpdate': UpdatePayload
|
|
11
|
+
'vite:beforePrune': PrunePayload
|
|
12
|
+
'vite:beforeFullReload': FullReloadPayload
|
|
13
|
+
'vite:error': ErrorPayload
|
|
14
|
+
'vite:invalidate': InvalidatePayload
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface InvalidatePayload {
|
|
18
|
+
path: string
|
|
19
|
+
message: string | undefined
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type InferCustomEventPayload<T extends string> =
|
|
23
|
+
T extends keyof CustomEventMap ? CustomEventMap[T] : any
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export type HMRPayload =
|
|
2
|
+
| ConnectedPayload
|
|
3
|
+
| UpdatePayload
|
|
4
|
+
| FullReloadPayload
|
|
5
|
+
| CustomPayload
|
|
6
|
+
| ErrorPayload
|
|
7
|
+
| PrunePayload
|
|
8
|
+
|
|
9
|
+
export interface ConnectedPayload {
|
|
10
|
+
type: 'connected'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface UpdatePayload {
|
|
14
|
+
type: 'update'
|
|
15
|
+
updates: Update[]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface Update {
|
|
19
|
+
type: 'js-update' | 'css-update'
|
|
20
|
+
path: string
|
|
21
|
+
acceptedPath: string
|
|
22
|
+
timestamp: number
|
|
23
|
+
/**
|
|
24
|
+
* @experimental internal
|
|
25
|
+
*/
|
|
26
|
+
explicitImportRequired?: boolean | undefined
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface PrunePayload {
|
|
30
|
+
type: 'prune'
|
|
31
|
+
paths: string[]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface FullReloadPayload {
|
|
35
|
+
type: 'full-reload'
|
|
36
|
+
path?: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface CustomPayload {
|
|
40
|
+
type: 'custom'
|
|
41
|
+
event: string
|
|
42
|
+
data?: any
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ErrorPayload {
|
|
46
|
+
type: 'error'
|
|
47
|
+
err: {
|
|
48
|
+
[name: string]: any
|
|
49
|
+
message: string
|
|
50
|
+
stack: string
|
|
51
|
+
id?: string
|
|
52
|
+
frame?: string
|
|
53
|
+
plugin?: string
|
|
54
|
+
pluginCode?: string
|
|
55
|
+
loc?: {
|
|
56
|
+
file?: string
|
|
57
|
+
line: number
|
|
58
|
+
column: number
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { InferCustomEventPayload } from './customEvent'
|
|
2
|
+
|
|
3
|
+
export type ModuleNamespace = Record<string, any> & {
|
|
4
|
+
[Symbol.toStringTag]: 'Module'
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ViteHotContext {
|
|
8
|
+
readonly data: any
|
|
9
|
+
|
|
10
|
+
accept(): void
|
|
11
|
+
accept(cb: (mod: ModuleNamespace | undefined) => void): void
|
|
12
|
+
accept(dep: string, cb: (mod: ModuleNamespace | undefined) => void): void
|
|
13
|
+
accept(
|
|
14
|
+
deps: readonly string[],
|
|
15
|
+
cb: (mods: Array<ModuleNamespace | undefined>) => void,
|
|
16
|
+
): void
|
|
17
|
+
|
|
18
|
+
acceptExports(
|
|
19
|
+
exportNames: string | readonly string[],
|
|
20
|
+
cb?: (mod: ModuleNamespace | undefined) => void,
|
|
21
|
+
): void
|
|
22
|
+
|
|
23
|
+
dispose(cb: (data: any) => void): void
|
|
24
|
+
prune(cb: (data: any) => void): void
|
|
25
|
+
invalidate(message?: string): void
|
|
26
|
+
|
|
27
|
+
on<T extends string>(
|
|
28
|
+
event: T,
|
|
29
|
+
cb: (payload: InferCustomEventPayload<T>) => void,
|
|
30
|
+
): void
|
|
31
|
+
send<T extends string>(event: T, data?: InferCustomEventPayload<T>): void
|
|
32
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export interface ImportGlobOptions<
|
|
2
|
+
Eager extends boolean,
|
|
3
|
+
AsType extends string,
|
|
4
|
+
> {
|
|
5
|
+
/**
|
|
6
|
+
* Import type for the import url.
|
|
7
|
+
*/
|
|
8
|
+
as?: AsType
|
|
9
|
+
/**
|
|
10
|
+
* Import as static or dynamic
|
|
11
|
+
*
|
|
12
|
+
* @default false
|
|
13
|
+
*/
|
|
14
|
+
eager?: Eager
|
|
15
|
+
/**
|
|
16
|
+
* Import only the specific named export. Set to `default` to import the default export.
|
|
17
|
+
*/
|
|
18
|
+
import?: string
|
|
19
|
+
/**
|
|
20
|
+
* Custom queries
|
|
21
|
+
*/
|
|
22
|
+
query?: string | Record<string, string | number | boolean>
|
|
23
|
+
/**
|
|
24
|
+
* Search files also inside `node_modules/` and hidden directories (e.g. `.git/`). This might have impact on performance.
|
|
25
|
+
*
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
exhaustive?: boolean
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export type GeneralImportGlobOptions = ImportGlobOptions<boolean, string>
|
|
32
|
+
|
|
33
|
+
export interface KnownAsTypeMap {
|
|
34
|
+
raw: string
|
|
35
|
+
url: string
|
|
36
|
+
worker: Worker
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface ImportGlobFunction {
|
|
40
|
+
/**
|
|
41
|
+
* Import a list of files with a glob pattern.
|
|
42
|
+
*
|
|
43
|
+
* Overload 1: No generic provided, infer the type from `eager` and `as`
|
|
44
|
+
*/
|
|
45
|
+
<
|
|
46
|
+
Eager extends boolean,
|
|
47
|
+
As extends string,
|
|
48
|
+
T = As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown,
|
|
49
|
+
>(
|
|
50
|
+
glob: string | string[],
|
|
51
|
+
options?: ImportGlobOptions<Eager, As>,
|
|
52
|
+
): (Eager extends true ? true : false) extends true
|
|
53
|
+
? Record<string, T>
|
|
54
|
+
: Record<string, () => Promise<T>>
|
|
55
|
+
/**
|
|
56
|
+
* Import a list of files with a glob pattern.
|
|
57
|
+
*
|
|
58
|
+
* Overload 2: Module generic provided, infer the type from `eager: false`
|
|
59
|
+
*/
|
|
60
|
+
<M>(
|
|
61
|
+
glob: string | string[],
|
|
62
|
+
options?: ImportGlobOptions<false, string>,
|
|
63
|
+
): Record<string, () => Promise<M>>
|
|
64
|
+
/**
|
|
65
|
+
* Import a list of files with a glob pattern.
|
|
66
|
+
*
|
|
67
|
+
* Overload 3: Module generic provided, infer the type from `eager: true`
|
|
68
|
+
*/
|
|
69
|
+
<M>(
|
|
70
|
+
glob: string | string[],
|
|
71
|
+
options: ImportGlobOptions<true, string>,
|
|
72
|
+
): Record<string, M>
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ImportGlobEagerFunction {
|
|
76
|
+
/**
|
|
77
|
+
* Eagerly import a list of files with a glob pattern.
|
|
78
|
+
*
|
|
79
|
+
* Overload 1: No generic provided, infer the type from `as`
|
|
80
|
+
*/
|
|
81
|
+
<
|
|
82
|
+
As extends string,
|
|
83
|
+
T = As extends keyof KnownAsTypeMap ? KnownAsTypeMap[As] : unknown,
|
|
84
|
+
>(
|
|
85
|
+
glob: string | string[],
|
|
86
|
+
options?: Omit<ImportGlobOptions<boolean, As>, 'eager'>,
|
|
87
|
+
): Record<string, T>
|
|
88
|
+
/**
|
|
89
|
+
* Eagerly import a list of files with a glob pattern.
|
|
90
|
+
*
|
|
91
|
+
* Overload 2: Module generic provided
|
|
92
|
+
*/
|
|
93
|
+
<M>(
|
|
94
|
+
glob: string | string[],
|
|
95
|
+
options?: Omit<ImportGlobOptions<boolean, string>, 'eager'>,
|
|
96
|
+
): Record<string, M>
|
|
97
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// This file is an augmentation to the built-in ImportMeta interface
|
|
2
|
+
// Thus cannot contain any top-level imports
|
|
3
|
+
// <https://www.typescriptlang.org/docs/handbook/declaration-merging.html#module-augmentation>
|
|
4
|
+
|
|
5
|
+
/* eslint-disable @typescript-eslint/consistent-type-imports */
|
|
6
|
+
|
|
7
|
+
interface ImportMetaEnv {
|
|
8
|
+
[key: string]: any
|
|
9
|
+
BASE_URL: string
|
|
10
|
+
MODE: string
|
|
11
|
+
DEV: boolean
|
|
12
|
+
PROD: boolean
|
|
13
|
+
SSR: boolean
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface ImportMeta {
|
|
17
|
+
url: string
|
|
18
|
+
|
|
19
|
+
readonly hot?: import('./hot').ViteHotContext
|
|
20
|
+
|
|
21
|
+
readonly env: ImportMetaEnv
|
|
22
|
+
|
|
23
|
+
glob: import('./importGlob').ImportGlobFunction
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Use `import.meta.glob('*', { eager: true })` instead
|
|
26
|
+
*/
|
|
27
|
+
globEager: import('./importGlob').ImportGlobEagerFunction
|
|
28
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type { SbPluginFactory, SbBlokKeyDataTypes, SbBlokData, SbRichTextOptions, SbSDKOptions, StoryblokClient, StoryblokBridgeV2, StoryblokBridgeConfigV2, ISbConfig, // previously StoryblokConfig
|
|
2
|
+
ISbCache, // previously StoryblokCache
|
|
3
|
+
ISbResult, // previously StoryblokResult
|
|
4
|
+
ISbResponse, ISbError, ISbNode, ISbSchema, ThrottleFn, AsyncFn, ArrayFn, ISbContentMangmntAPI, ISbManagmentApiResult, // previously StoryblokManagmentApiResult
|
|
5
|
+
ISbStories, // previously Stories
|
|
6
|
+
ISbStory, // previously Story
|
|
7
|
+
ISbDimensions, StoryblokComponentType, ISbStoryData, // previously StoryData
|
|
8
|
+
ISbAlternateObject, // previously AlternateObject
|
|
9
|
+
ISbStoriesParams, // previously StoriesParams
|
|
10
|
+
ISbStoryParams, // previously StoryParams
|
|
11
|
+
ISbRichtext, // previously Richtext
|
|
12
|
+
ISbEventPayload, } from "@storyblok/js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyblok/astro",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
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",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"types": "./dist/index.d.ts",
|
|
19
19
|
"scripts": {
|
|
20
20
|
"dev": "vite build --watch",
|
|
21
|
-
"build": "vite build
|
|
21
|
+
"build": "vite build",
|
|
22
22
|
"test": "npm run test:e2e",
|
|
23
23
|
"test:e2e": "start-server-and-test cy:playground http-get://localhost:3000/ cy:run",
|
|
24
24
|
"test:e2e-watch": "start-server-and-test cy:playground http-get://localhost:3000/ cy:open",
|
|
@@ -28,19 +28,20 @@
|
|
|
28
28
|
"prepublishOnly": "npm run build && cp ../README.md ./"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@storyblok/js": "^2.0.
|
|
31
|
+
"@storyblok/js": "^2.0.5",
|
|
32
32
|
"camelcase": "^7.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@cypress/vite-dev-server": "^5.0.2",
|
|
36
36
|
"@rollup/plugin-dynamic-import-vars": "^2.0.1",
|
|
37
|
+
"@types/node": "18.11.10",
|
|
38
|
+
"astro": "1.6.15",
|
|
37
39
|
"cypress": "^12.1.0",
|
|
38
40
|
"eslint-plugin-cypress": "^2.12.1",
|
|
39
41
|
"start-server-and-test": "^1.15.2",
|
|
40
|
-
"vite": "^4.0.1",
|
|
41
42
|
"typescript": "4.9.4",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
43
|
+
"vite": "^4.0.1",
|
|
44
|
+
"vite-plugin-dts": "^1.7.1"
|
|
44
45
|
},
|
|
45
46
|
"repository": {
|
|
46
47
|
"type": "git",
|