@lupinum/ginko-content 0.1.2 → 0.1.4
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/README.md +18 -4
- package/compatibility.json +1 -1
- package/dist/cli.mjs +317 -294
- package/dist/cms-import/index.js +5 -1
- package/dist/config.d.mts +1 -1
- package/dist/config.mjs +1 -1
- package/dist/core/cache-hints.d.ts +9 -1
- package/dist/core/content/collection.js +1 -1
- package/dist/core/content/path.js +1 -1
- package/dist/core/errors.js +5 -1
- package/dist/core/provider-errors +1 -0
- package/dist/core/provider-errors.d.ts +10 -0
- package/dist/core/provider-errors.js +27 -0
- package/dist/core/query/execute.js +12 -3
- package/dist/core/query/filter.js +2 -2
- package/dist/core/query/lower.js +5 -4
- package/dist/features/navigation/build.js +14 -6
- package/dist/features/navigation/canonical.js +1 -1
- package/dist/features/sitemap/query.js +2 -2
- package/dist/integrations/nitro/ingest.d.ts +3 -3
- package/dist/integrations/nitro/ingest.js +3 -3
- package/dist/integrations/nitro/storage.js +3 -1
- package/dist/module.d.mts +151 -526
- package/dist/module.json +1 -1
- package/dist/module.mjs +1083 -730
- package/dist/parsers/csv.js +4 -3
- package/dist/parsers/index.d.ts +2 -5
- package/dist/parsers/index.js +2 -2
- package/dist/parsers/markdown-plugins.d.ts +1 -0
- package/dist/parsers/markdown-plugins.js +83 -1
- package/dist/parsers/markdown.js +1 -1
- package/dist/public/client.d.ts +3 -2
- package/dist/public/client.js +2 -2
- package/dist/public/provider-errors.d.ts +2 -1
- package/dist/public/provider-errors.js +1 -18
- package/dist/public/provider.d.ts +3 -10
- package/dist/public/server.d.ts +6 -1
- package/dist/public/server.js +33 -0
- package/dist/runtime/agent-paths +1 -0
- package/dist/runtime/agent-paths.d.ts +6 -0
- package/dist/runtime/agent-paths.js +41 -0
- package/dist/runtime/app/components/internal/MarkdownRenderer.d.ts +1 -1
- package/dist/runtime/app/composables/head.d.ts +3 -0
- package/dist/runtime/app/composables/head.js +2 -1
- package/dist/runtime/app/composables/hot-reload +1 -0
- package/dist/runtime/app/composables/hot-reload.d.ts +5 -0
- package/dist/runtime/app/composables/hot-reload.js +15 -0
- package/dist/runtime/app/composables/locale-context.d.ts +1 -1
- package/dist/runtime/app/composables/locale-context.js +2 -1
- package/dist/runtime/app/composables/locale.js +2 -2
- package/dist/runtime/app/composables/search.js +10 -6
- package/dist/runtime/app/composables/use-content-document +1 -0
- package/dist/runtime/app/composables/use-content-document.d.ts +29 -0
- package/dist/runtime/app/composables/use-content-document.js +44 -0
- package/dist/runtime/app/composables/use-content-list +1 -0
- package/dist/runtime/app/composables/use-content-list.d.ts +43 -0
- package/dist/runtime/app/composables/use-content-list.js +98 -0
- package/dist/runtime/app/composables/use-content-navigation +1 -0
- package/dist/runtime/app/composables/use-content-navigation.d.ts +40 -0
- package/dist/runtime/app/composables/use-content-navigation.js +102 -0
- package/dist/runtime/app/composables/use-content-page +1 -0
- package/dist/runtime/app/composables/use-content-page.d.ts +47 -0
- package/dist/runtime/app/composables/use-content-page.js +142 -0
- package/dist/runtime/app/composables/use-content-shared +1 -0
- package/dist/runtime/app/composables/use-content-shared.d.ts +13 -0
- package/dist/runtime/app/composables/use-content-shared.js +29 -0
- package/dist/runtime/app/composables/use-content.d.ts +11 -206
- package/dist/runtime/app/composables/use-content.js +4 -377
- package/dist/runtime/app/plugins/hot-reload +1 -0
- package/dist/runtime/app/plugins/hot-reload.js +6 -0
- package/dist/runtime/query/backlinks +1 -0
- package/dist/runtime/query/backlinks.d.ts +8 -0
- package/dist/runtime/query/backlinks.js +90 -0
- package/dist/runtime/query/context +1 -0
- package/dist/runtime/query/context.d.ts +20 -0
- package/dist/runtime/query/context.js +0 -0
- package/dist/runtime/query/documents +1 -0
- package/dist/runtime/query/documents.d.ts +6 -0
- package/dist/runtime/query/documents.js +98 -0
- package/dist/runtime/query/errors +1 -0
- package/dist/runtime/query/errors.d.ts +1 -0
- package/dist/runtime/query/errors.js +4 -0
- package/dist/runtime/query/handles +1 -0
- package/dist/runtime/query/handles.d.ts +2 -0
- package/dist/runtime/query/handles.js +7 -0
- package/dist/runtime/query/locale-options +1 -0
- package/dist/runtime/query/locale-options.d.ts +5 -0
- package/dist/runtime/query/locale-options.js +14 -0
- package/dist/runtime/query/localized-docs +1 -0
- package/dist/runtime/query/localized-docs.d.ts +17 -0
- package/dist/runtime/query/localized-docs.js +44 -0
- package/dist/runtime/query/navigation +1 -0
- package/dist/runtime/query/navigation.d.ts +22 -0
- package/dist/runtime/query/navigation.js +73 -0
- package/dist/runtime/query/pagination +1 -0
- package/dist/runtime/query/pagination.d.ts +7 -0
- package/dist/runtime/query/pagination.js +78 -0
- package/dist/runtime/query/populate +1 -0
- package/dist/runtime/query/populate.d.ts +9 -0
- package/dist/runtime/query/populate.js +106 -0
- package/dist/runtime/query/responses +1 -0
- package/dist/runtime/query/responses.d.ts +10 -0
- package/dist/runtime/query/responses.js +47 -0
- package/dist/runtime/query/unified.d.ts +4 -20
- package/dist/runtime/query/unified.js +14 -544
- package/dist/runtime/query/variants +1 -0
- package/dist/runtime/query/variants.d.ts +11 -0
- package/dist/runtime/query/variants.js +36 -0
- package/dist/runtime/server/agent-http +1 -0
- package/dist/runtime/server/agent-http.d.ts +7 -0
- package/dist/runtime/server/agent-http.js +36 -0
- package/dist/runtime/server/agent-markdown +1 -0
- package/dist/runtime/server/agent-markdown.d.ts +83 -0
- package/dist/runtime/server/agent-markdown.js +449 -0
- package/dist/runtime/server/agent-site +1 -0
- package/dist/runtime/server/agent-site.d.ts +38 -0
- package/dist/runtime/server/agent-site.js +272 -0
- package/dist/runtime/server/api/agent-llms +1 -0
- package/dist/runtime/server/api/agent-llms-full +1 -0
- package/dist/runtime/server/api/agent-llms-full.d.ts +2 -0
- package/dist/runtime/server/api/agent-llms-full.js +13 -0
- package/dist/runtime/server/api/agent-llms.d.ts +2 -0
- package/dist/runtime/server/api/agent-llms.js +14 -0
- package/dist/runtime/server/api/agent-raw +1 -0
- package/dist/runtime/server/api/agent-raw.d.ts +2 -0
- package/dist/runtime/server/api/agent-raw.js +17 -0
- package/dist/runtime/server/api/locales.d.ts +2 -2
- package/dist/runtime/server/api/locales.js +4 -2
- package/dist/runtime/server/api/navigation.d.ts +1 -1
- package/dist/runtime/server/api/query.d.ts +1 -1
- package/dist/runtime/server/api/query.js +4 -1
- package/dist/runtime/server/api/revalidate.js +2 -2
- package/dist/runtime/server/api/site-data.d.ts +1 -1
- package/dist/runtime/server/collection-helpers.js +2 -1
- package/dist/runtime/server/middleware/agent-link-headers +1 -0
- package/dist/runtime/server/middleware/agent-link-headers.d.ts +2 -0
- package/dist/runtime/server/middleware/agent-link-headers.js +41 -0
- package/dist/runtime/server/middleware/agent-markdown +1 -0
- package/dist/runtime/server/middleware/agent-markdown.d.ts +2 -0
- package/dist/runtime/server/middleware/agent-markdown.js +43 -0
- package/dist/runtime/server/plugins/sitemap.js +1 -0
- package/dist/runtime/server/provider-query.d.ts +8 -5
- package/dist/runtime/server/provider-query.js +50 -8
- package/dist/runtime/server/provider-result.d.ts +19 -2
- package/dist/runtime/server/providers/filesystem.js +4 -1
- package/dist/runtime/server/providers/index.d.ts +3 -1
- package/dist/runtime/server/providers/index.js +2 -2
- package/dist/runtime/server/query-api.js +2 -1
- package/dist/runtime/server/query-executor.d.ts +3 -2
- package/dist/runtime/server/query-executor.js +13 -5
- package/dist/runtime/server/search.js +1 -1
- package/dist/runtime/server/sitemap-provider.js +40 -1
- package/dist/runtime/server/sitemap.js +3 -2
- package/dist/runtime/transformers/component-resolver.js +2 -1
- package/dist/runtime/utils/content-components.d.ts +0 -5
- package/dist/storage/content.d.ts +2 -9
- package/dist/storage/references.d.ts +1 -8
- package/dist/storage/references.js +9 -4
- package/dist/testing/provider-contract.js +3 -4
- package/dist/testing/provider-fixture.d.ts +3 -1
- package/dist/testing/provider-fixture.js +27 -14
- package/dist/types/config.d.ts +77 -0
- package/dist/types/config.js +23 -0
- package/dist/types/module.d.ts +15 -5
- package/dist/types/query-parts/collections +1 -0
- package/dist/types/query-parts/collections.d.ts +15 -0
- package/dist/types/query-parts/collections.js +0 -0
- package/dist/types/query-parts/public +1 -0
- package/dist/types/query-parts/public.d.ts +202 -0
- package/dist/types/query-parts/public.js +0 -0
- package/dist/types/query-parts/results +1 -0
- package/dist/types/query-parts/results.d.ts +95 -0
- package/dist/types/query-parts/results.js +0 -0
- package/dist/types/query-parts/transport +1 -0
- package/dist/types/query-parts/transport.d.ts +103 -0
- package/dist/types/query-parts/transport.js +0 -0
- package/dist/types/query.d.ts +4 -870
- package/dist/types/query.js +4 -0
- package/dist/types/runtime.d.ts +2 -2
- package/dist/types/virtual.d.ts +54 -0
- package/dist/types.d.mts +2 -2
- package/dist/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/runtime/app/composables/web-socket +0 -1
- package/dist/runtime/app/composables/web-socket.d.ts +0 -3
- package/dist/runtime/app/composables/web-socket.js +0 -65
- package/dist/runtime/app/plugins/ws +0 -1
- package/dist/runtime/app/plugins/ws.js +0 -7
- /package/dist/runtime/app/plugins/{ws.d.ts → hot-reload.d.ts} +0 -0
package/dist/types/query.js
CHANGED
package/dist/types/runtime.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { StorageValue } from 'unstorage';
|
|
2
|
-
import type { ParsedContent, ContentTransformer } from './content';
|
|
2
|
+
import type { ParsedContent, ContentTransformer, MarkdownOptions } from './content';
|
|
3
3
|
import type { ContentCollectionConfig } from './config';
|
|
4
4
|
import type { ContentContext, ModuleOptions } from './module';
|
|
5
5
|
export interface ContentCacheArtifact<T = ParsedContent> {
|
|
@@ -29,7 +29,7 @@ export interface ParseContentOptions {
|
|
|
29
29
|
validate?: boolean;
|
|
30
30
|
csv?: ModuleOptions['csv'];
|
|
31
31
|
yaml?: ModuleOptions['yaml'];
|
|
32
|
-
markdown?: ModuleOptions['markdown'];
|
|
32
|
+
markdown?: ModuleOptions['markdown'] | MarkdownOptions;
|
|
33
33
|
transformers?: ContentTransformer[];
|
|
34
34
|
pathMeta?: {
|
|
35
35
|
locales?: ContentContext['locales'];
|
package/dist/types/virtual.d.ts
CHANGED
|
@@ -17,3 +17,57 @@ declare module '#content/virtual/cache-adapter' {
|
|
|
17
17
|
|
|
18
18
|
export const loadContentCacheAdapter: () => Promise<ContentCacheAdapter | undefined> | ContentCacheAdapter | undefined
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
declare module '*.vue' {
|
|
22
|
+
import type { DefineComponent } from 'vue'
|
|
23
|
+
|
|
24
|
+
const component: DefineComponent<Record<string, unknown>, Record<string, unknown>, any>
|
|
25
|
+
export default component
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare module '#imports' {
|
|
29
|
+
export type MaybeRefOrGetter<T = unknown> = import('vue').MaybeRefOrGetter<T>
|
|
30
|
+
|
|
31
|
+
export const computed: typeof import('vue').computed
|
|
32
|
+
export const nextTick: typeof import('vue').nextTick
|
|
33
|
+
export const onScopeDispose: typeof import('vue').onScopeDispose
|
|
34
|
+
export const ref: typeof import('vue').ref
|
|
35
|
+
export const shallowRef: typeof import('vue').shallowRef
|
|
36
|
+
export const toValue: typeof import('vue').toValue
|
|
37
|
+
export const unref: typeof import('vue').unref
|
|
38
|
+
export const watch: typeof import('vue').watch
|
|
39
|
+
export const watchEffect: typeof import('vue').watchEffect
|
|
40
|
+
|
|
41
|
+
export const defineNuxtPlugin: typeof import('#app').defineNuxtPlugin
|
|
42
|
+
export const createError: typeof import('#app').createError
|
|
43
|
+
export const refreshNuxtData: typeof import('#app').refreshNuxtData
|
|
44
|
+
export const useAsyncData: typeof import('#app').useAsyncData
|
|
45
|
+
export const useFetch: typeof import('#app').useFetch
|
|
46
|
+
export const useHead: typeof import('#app').useHead
|
|
47
|
+
export const useNuxtApp: typeof import('#app').useNuxtApp
|
|
48
|
+
export const useRequestEvent: typeof import('#app').useRequestEvent
|
|
49
|
+
export const useRequestFetch: typeof import('#app').useRequestFetch
|
|
50
|
+
export const useRoute: typeof import('#app').useRoute
|
|
51
|
+
export const useRouter: typeof import('#app').useRouter
|
|
52
|
+
export const useRuntimeConfig: typeof import('#app').useRuntimeConfig
|
|
53
|
+
export const useState: typeof import('#app').useState
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
interface ImportMeta {
|
|
57
|
+
readonly hot?: {
|
|
58
|
+
on: (event: string, callback: (data: unknown) => void) => void
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare module '#build/content-components' {
|
|
63
|
+
import type { AsyncComponentLoader } from 'vue'
|
|
64
|
+
|
|
65
|
+
export const globalComponents: string[]
|
|
66
|
+
export const localComponents: string[]
|
|
67
|
+
export const localComponentLoaders: Record<string, AsyncComponentLoader>
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
declare module 'js-yaml' {
|
|
71
|
+
export function load(input: string, options?: Record<string, unknown>): unknown
|
|
72
|
+
export function dump(input: unknown, options?: Record<string, unknown>): string
|
|
73
|
+
}
|
package/dist/types.d.mts
CHANGED
|
@@ -4,8 +4,8 @@ declare module '@nuxt/schema' {
|
|
|
4
4
|
interface NuxtHooks extends ModuleHooks {}
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
export { type defineCollection, type defineContentConfig, type reference } from '../dist/types/config'
|
|
7
|
+
export { type agentMetadataFields, type defineAgentAppPage, type defineAgentMarkdownPolicy, type defineAgentMetadataFields, type defineAgentSection, type defineCollection, type defineContentConfig, type reference } from '../dist/types/config'
|
|
8
8
|
|
|
9
9
|
export { default, type normalizeContentConfigCollectionNames } from './module.mjs'
|
|
10
10
|
|
|
11
|
-
export { type BacklinkFields, type BacklinkSource, type BacklinksOptions, type BacklinksResult, type CollectionQueryBuilder, type CollectionQueryOperator, type CollectionQueryValue, type CollectionSchema, type ContentCacheArtifact, type ContentCmsCollectionConfig, type ContentCmsFieldConfig, type ContentCmsFieldType, type ContentCmsRelationConfig, type ContentCollectionConfig, type ContentCollectionHandle, type ContentCollectionI18nConfig, type ContentCollectionI18nMap, type ContentCollectionItem, type ContentCollectionItemSurroundingsOptions, type ContentCollectionKind, type ContentCollectionMap, type ContentCollectionName, type ContentCollectionNavigationOptions, type ContentCollectionPageOptions, type ContentCollectionRouteConfig, type ContentCollectionRouteMetaOptions, type ContentCollectionSearchSectionsOptions, type ContentCollectionSource, type ContentCollectionSourceObject, type ContentCollectionStringName, type ContentCollectionTarget, type ContentConfig, type ContentContext, type ContentI18nOptions, type ContentLocaleEntry, type ContentLocaleRoute, type ContentManifest, type ContentMiniSearchOptions, type ContentNavigationItem, type ContentPageResult, type ContentPreviewOptions, type ContentProviderName, type ContentProviderSearchRequest, type ContentQueryBuilder, type ContentQueryBuilderParams, type ContentQueryBuilderWhere, type ContentQueryFetcher, type ContentQueryRequest, type ContentQuerySortFields, type ContentQuerySortOptions, type ContentQuerySortParams, type ContentReferenceSchema, type ContentResolvedMeta, type ContentRevalidateOptions, type ContentRouteMeta, type ContentSearchEngine, type ContentSearchIndexRecord, type ContentSearchOptions, type ContentSearchPublicRuntimeConfig, type ContentSearchResult, type ContentSearchSection, type ContentSelector, type ContentSeoImage, type ContentSeoMeta, type ContentSitemapAlternative, type ContentSitemapAssertOptions, type ContentSitemapAssertSitemapOptions, type ContentSitemapEntry, type ContentSitemapImage, type ContentSitemapOptions, type ContentTransformer, type ContentTreeItem, type ContentVariant, type DefineCollectionObject, type DefineCollectionOptions, type DocumentFromHandle, type LocaleFallback, type LocalePathEntry, type LocalizedDoc, type ManifestVariant, type ManyOptions, type MarkdownNode, type MarkdownOptions, type MarkdownParsedContent, type MarkdownPluginDescriptor, type MarkdownPluginOptions, type MarkdownRoot, type ModuleHooks, type ModuleOptions, type MountOptions, type NavItem, type NeighborsOptions, type NeighborsResult, type OneOptions, type PaginationOptions, type PaginationResult, type ParseContentOptions, type ParsedContent, type ParsedContentInternalMeta, type ParsedContentMeta, type PopulateFromOptions, type PopulateSpec, type PopulatedDocument, type QueryGroupBuilder, type QueryGroupFunction, type QueryMatchOperator, type QueryOperators, type QueryOrderDirection, type QueryOrderOptions, type QueryWhere, type ResolutionEnvelope, type ResolveContentReferenceOptions, type ResolveOneOptions, type ResolveOneResult, type ResolvedContentI18nOptions, type ResolvedMarkdownPlugin, type ResolvedVariant, type SortDirection, type SortSpec, type StrictParsedContent, type StrictParsedContentMeta, type Toc, type TocLink, type TransformContentOptions, type TransformContentSource, type TreeOptions, type VariantsOptions } from './module.mjs'
|
|
11
|
+
export { type AgentMetadataField, type AgentMetadataFieldList, type BacklinkFields, type BacklinkSource, type BacklinksOptions, type BacklinksResult, type CollectionQueryBuilder, type CollectionQueryField, type CollectionQueryFieldValue, type CollectionQueryKey, type CollectionQueryOperator, type CollectionQueryValue, type CollectionSchema, type ContentAgentAppPageConfig, type ContentAgentAppPageContext, type ContentAgentCollectionConfig, type ContentAgentConfig, type ContentAgentLocalizedValue, type ContentAgentMarkdownMetadataConfig, type ContentAgentMarkdownOptions, type ContentAgentMarkdownPolicyConfig, type ContentAgentRouteOptions, type ContentAgentSectionConfig, type ContentAgentSiteConfig, type ContentCacheArtifact, type ContentCmsCollectionConfig, type ContentCmsFieldConfig, type ContentCmsFieldType, type ContentCmsRelationConfig, type ContentCollectionConfig, type ContentCollectionHandle, type ContentCollectionI18nConfig, type ContentCollectionI18nMap, type ContentCollectionItem, type ContentCollectionItemSurroundingsOptions, type ContentCollectionKind, type ContentCollectionMap, type ContentCollectionName, type ContentCollectionNavigationOptions, type ContentCollectionPageOptions, type ContentCollectionRouteConfig, type ContentCollectionRouteMetaOptions, type ContentCollectionSearchSectionsOptions, type ContentCollectionSource, type ContentCollectionSourceObject, type ContentCollectionStringName, type ContentCollectionTarget, type ContentConfig, type ContentContext, type ContentI18nOptions, type ContentLocaleEntry, type ContentLocaleRoute, type ContentManifest, type ContentMiniSearchOptions, type ContentNavigationItem, type ContentPageResult, type ContentPreviewOptions, type ContentProviderName, type ContentProviderSearchRequest, type ContentQueryBuilder, type ContentQueryBuilderParams, type ContentQueryBuilderWhere, type ContentQueryFetcher, type ContentQueryRequest, type ContentQuerySortFields, type ContentQuerySortOptions, type ContentQuerySortParams, type ContentReferenceSchema, type ContentResolvedMeta, type ContentRevalidateOptions, type ContentRouteMeta, type ContentSearchEngine, type ContentSearchIndexRecord, type ContentSearchOptions, type ContentSearchPublicRuntimeConfig, type ContentSearchResult, type ContentSearchSection, type ContentSelector, type ContentSeoImage, type ContentSeoMeta, type ContentSitemapAlternative, type ContentSitemapAssertOptions, type ContentSitemapAssertSitemapOptions, type ContentSitemapEntry, type ContentSitemapImage, type ContentSitemapOptions, type ContentTransformer, type ContentTreeItem, type ContentVariant, type DefineCollectionObject, type DefineCollectionOptions, type DocumentFromHandle, type LocaleFallback, type LocalePathEntry, type LocalizedContentDocument, type LocalizedDoc, type ManifestVariant, type ManyOptions, type MarkdownNode, type MarkdownOptions, type MarkdownParsedContent, type MarkdownPluginDescriptor, type MarkdownPluginOptions, type MarkdownRoot, type ModuleHooks, type ModuleOptions, type MountOptions, type NavItem, type NeighborsOptions, type NeighborsResult, type OneOptions, type PaginationOptions, type PaginationResult, type ParseContentOptions, type ParsedContent, type ParsedContentInternalMeta, type ParsedContentMeta, type PopulateFromOptions, type PopulateSpec, type PopulatedDocument, type QueryGroupBuilder, type QueryGroupFunction, type QueryMatchOperator, type QueryOperators, type QueryOrderDirection, type QueryOrderOptions, type QueryWhere, type ResolutionEnvelope, type ResolveContentReferenceOptions, type ResolveOneOptions, type ResolveOneResult, type ResolvedContentContext, type ResolvedContentI18nOptions, type ResolvedMarkdownPlugin, type ResolvedVariant, type SortDirection, type SortSpec, type StrictParsedContent, type StrictParsedContentMeta, type Toc, type TocLink, type TransformContentOptions, type TransformContentSource, type TreeOptions, type VariantsOptions } from './module.mjs'
|
package/dist/web-types.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lupinum/ginko-content",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Collection-first content engine for Nuxt",
|
|
5
5
|
"homepage": "https://ginko-content.nuxt.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -85,9 +85,10 @@
|
|
|
85
85
|
"LICENSE"
|
|
86
86
|
],
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"@comark/vue": "^0.
|
|
88
|
+
"@comark/vue": "^0.4.0",
|
|
89
89
|
"@nuxt/kit": "^4.4.7",
|
|
90
|
-
"
|
|
90
|
+
"@shikijs/transformers": "^4.2.0",
|
|
91
|
+
"comark": "^0.4.0",
|
|
91
92
|
"consola": "^3.4.2",
|
|
92
93
|
"defu": "^6.1.7",
|
|
93
94
|
"destr": "^2.0.5",
|
|
@@ -97,7 +98,6 @@
|
|
|
97
98
|
"js-yaml": "^4.1.1",
|
|
98
99
|
"json5": "^2.2.3",
|
|
99
100
|
"knitwork": "^1.3.0",
|
|
100
|
-
"listhen": "^1.10.0",
|
|
101
101
|
"minisearch": "^7.2.0",
|
|
102
102
|
"nitropack": "^2.13.4",
|
|
103
103
|
"ohash": "^2.0.11",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"pathe": "^2.0.3",
|
|
106
106
|
"picomatch": "^4.0.4",
|
|
107
107
|
"scule": "^1.3.0",
|
|
108
|
-
"shiki": "^4.0
|
|
108
|
+
"shiki": "^4.2.0",
|
|
109
109
|
"slugify": "^1.6.9",
|
|
110
110
|
"ufo": "^1.6.4",
|
|
111
111
|
"unstorage": "^1.17.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './web-socket.js'
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { useRuntimeConfig, refreshNuxtData } from "#imports";
|
|
2
|
-
const logger = {
|
|
3
|
-
log: (...args) => console.log("[Content]", ...args),
|
|
4
|
-
warn: (...args) => console.warn("[Content]", ...args)
|
|
5
|
-
};
|
|
6
|
-
let ws;
|
|
7
|
-
export function useContentWebSocket() {
|
|
8
|
-
if (!window.WebSocket) {
|
|
9
|
-
logger.warn("Could not enable hot reload, your browser does not support WebSocket.");
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
const onMessage = (message) => {
|
|
13
|
-
try {
|
|
14
|
-
const data = JSON.parse(message.data);
|
|
15
|
-
if (!data) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
refreshNuxtData();
|
|
19
|
-
} catch {
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const onOpen = () => logger.log("WS connected!");
|
|
23
|
-
const onError = (e) => {
|
|
24
|
-
switch (e.code) {
|
|
25
|
-
case "ECONNREFUSED":
|
|
26
|
-
connect(true);
|
|
27
|
-
break;
|
|
28
|
-
default:
|
|
29
|
-
logger.warn("WS Error:", e);
|
|
30
|
-
break;
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const onClose = (e) => {
|
|
34
|
-
if (e.code === 1e3 || e.code === 1005) {
|
|
35
|
-
logger.log("WS closed!");
|
|
36
|
-
} else {
|
|
37
|
-
connect(true);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
const connect = (retry = false) => {
|
|
41
|
-
if (retry) {
|
|
42
|
-
logger.log("WS reconnecting..");
|
|
43
|
-
setTimeout(connect, 1e3);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (ws) {
|
|
47
|
-
try {
|
|
48
|
-
ws.close();
|
|
49
|
-
} catch {
|
|
50
|
-
}
|
|
51
|
-
ws = void 0;
|
|
52
|
-
}
|
|
53
|
-
const wsURL = `${useRuntimeConfig().public.content.wsUrl}ws`;
|
|
54
|
-
logger.log(`WS connect to ${wsURL}`);
|
|
55
|
-
ws = new WebSocket(wsURL);
|
|
56
|
-
ws.onopen = onOpen;
|
|
57
|
-
ws.onmessage = onMessage;
|
|
58
|
-
ws.onerror = onError;
|
|
59
|
-
ws.onclose = onClose;
|
|
60
|
-
};
|
|
61
|
-
connect();
|
|
62
|
-
return {
|
|
63
|
-
connect
|
|
64
|
-
};
|
|
65
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ws.js'
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin, useRuntimeConfig } from "#imports";
|
|
2
|
-
export default defineNuxtPlugin(() => {
|
|
3
|
-
const publicConfig = useRuntimeConfig().public;
|
|
4
|
-
if (import.meta.client && publicConfig.content.wsUrl) {
|
|
5
|
-
import("../composables/web-socket.js").then(({ useContentWebSocket }) => useContentWebSocket());
|
|
6
|
-
}
|
|
7
|
-
});
|
|
File without changes
|