@publier/native 1.1.3 → 2.1.0
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/dist/index.d.mts +6 -21
- package/dist/index.mjs +1 -1
- package/index.d.ts +1 -8
- package/index.js +208 -91
- package/package.json +3 -3
- package/publier-native.linux-x64-gnu.node +0 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
|
-
//#region \0rolldown/runtime.js
|
|
3
2
|
//#endregion
|
|
4
3
|
//#region ts/core/analytics.d.ts
|
|
5
4
|
interface Ga4Config {
|
|
@@ -146,10 +145,10 @@ declare function clamp(value: string, max: number): string;
|
|
|
146
145
|
declare function generateOgImage(options: OgImageOptions): Promise<Uint8Array>;
|
|
147
146
|
//#endregion
|
|
148
147
|
//#region ts/core/publier-config.d.ts
|
|
149
|
-
declare const TOGGLEABLE_PAGES: readonly [
|
|
148
|
+
declare const TOGGLEABLE_PAGES: readonly ['docs', 'blog', 'landing', 'press', 'about', 'team', 'contact', 'careers', 'changelog', 'status', 'knowledge-base', '404'];
|
|
150
149
|
type ToggleablePage = (typeof TOGGLEABLE_PAGES)[number];
|
|
151
150
|
type PagesToggleMap = Partial<Record<ToggleablePage, boolean>>;
|
|
152
|
-
declare const APPEARANCE_DEFAULTS: readonly [
|
|
151
|
+
declare const APPEARANCE_DEFAULTS: readonly ['system', 'light', 'dark'];
|
|
153
152
|
type AppearanceDefault = (typeof APPEARANCE_DEFAULTS)[number];
|
|
154
153
|
interface AppearanceConfig {
|
|
155
154
|
default: AppearanceDefault;
|
|
@@ -289,7 +288,7 @@ declare function generateSkillMd(options: SkillMdOptions): string;
|
|
|
289
288
|
//#region ts/core/slug.d.ts
|
|
290
289
|
declare function getSlug(filePath: string, baseDir: string): string;
|
|
291
290
|
declare namespace index_d_exports {
|
|
292
|
-
export { NativeHeadStats, NativePreloadStats, NativeTailwindResolvedTheme, NativeTailwindThemeError, analyticsGenerateBodyScripts$1 as analyticsGenerateBodyScripts, analyticsGenerateScripts$1 as analyticsGenerateScripts, asyncapiSourceBuild$1 as asyncapiSourceBuild, blogFilterByTag$1 as blogFilterByTag, blogFilterPublished$1 as blogFilterPublished, blogReadingTime$1 as blogReadingTime, blogSortByDate$1 as blogSortByDate, blogTagCounts$1 as blogTagCounts, buildHook$1 as buildHook, configResolvePublierConfig$1 as configResolvePublierConfig, configShouldRenderPage$1 as configShouldRenderPage, contentGenerateLlmsTxt$1 as contentGenerateLlmsTxt, contentGenerateOgImageMarkup$1 as contentGenerateOgImageMarkup, contentGenerateRobotsTxt$1 as contentGenerateRobotsTxt, contentGenerateSkillMd$1 as contentGenerateSkillMd, contentGenerateTwitterMeta$1 as contentGenerateTwitterMeta, contentGetSlug$1 as contentGetSlug, navigationActiveIndex$1 as navigationActiveIndex, navigationBuildSidebar$1 as navigationBuildSidebar, navigationMatchNavPath$1 as navigationMatchNavPath, openapiBuildCustomSampleMap$1 as openapiBuildCustomSampleMap, openapiBuildInstanceId$1 as openapiBuildInstanceId, openapiDecodePlaceholders$1 as openapiDecodePlaceholders, openapiExtractEndpoints$1 as openapiExtractEndpoints, openapiGenerateFiles$1 as openapiGenerateFiles, openapiGetMediaTypeExample$1 as openapiGetMediaTypeExample, openapiGetSnippetClient$1 as openapiGetSnippetClient, openapiHarFromOperation$1 as openapiHarFromOperation, openapiMergeSpecs$1 as openapiMergeSpecs, openapiNavigationBuild$1 as openapiNavigationBuild, openapiParseAsyncApiSpec$1 as openapiParseAsyncApiSpec, openapiParseOpenapiSpec$1 as openapiParseOpenapiSpec, openapiRenderApiPage$1 as openapiRenderApiPage, openapiRenderApiPlayground$1 as openapiRenderApiPlayground, openapiRenderApiReference$1 as openapiRenderApiReference, openapiRenderApiReferenceShell$1 as openapiRenderApiReferenceShell, openapiRenderAsyncChannel$1 as openapiRenderAsyncChannel, openapiRenderAsyncMessage$1 as openapiRenderAsyncMessage, openapiRenderCodeSamples$1 as openapiRenderCodeSamples, openapiRenderCollapsibleSection$1 as openapiRenderCollapsibleSection, openapiRenderMethodBadge$1 as openapiRenderMethodBadge, openapiRenderParamField$1 as openapiRenderParamField, openapiRenderRequestExample$1 as openapiRenderRequestExample, openapiRenderResponseExample$1 as openapiRenderResponseExample, openapiRenderResponseField$1 as openapiRenderResponseField, openapiRenderSchemaRow$1 as openapiRenderSchemaRow, openapiRenderSchemaView$1 as openapiRenderSchemaView, openapiResolveBaseUrl$1 as openapiResolveBaseUrl, openapiResolveRefs$1 as openapiResolveRefs, openapiSourceBuild$1 as openapiSourceBuild, pluginHook$1 as pluginHook, primitivesColorSwatchScript$1 as primitivesColorSwatchScript, primitivesColorSwatchStyle$1 as primitivesColorSwatchStyle, primitivesCopyButtonScript$1 as primitivesCopyButtonScript, primitivesCopyButtonStyle$1 as primitivesCopyButtonStyle, primitivesRenderAccordion$1 as primitivesRenderAccordion, primitivesRenderAccordionItem$1 as primitivesRenderAccordionItem, primitivesRenderColorSwatch$1 as primitivesRenderColorSwatch, primitivesRenderCopyButton$1 as primitivesRenderCopyButton, primitivesRenderImageZoom$1 as primitivesRenderImageZoom, primitivesRenderTabPanel$1 as primitivesRenderTabPanel, primitivesRenderTabs$1 as primitivesRenderTabs, primitivesRenderTooltip$1 as primitivesRenderTooltip, primitivesRenderViewAnimation$1 as primitivesRenderViewAnimation, primitivesTabsScript$1 as primitivesTabsScript, primitivesViewAnimationScript$1 as primitivesViewAnimationScript, primitivesViewAnimationStyle$1 as primitivesViewAnimationStyle, remarkCollectSections$1 as remarkCollectSections, remarkResolveSnippet$1 as remarkResolveSnippet, remarkTransformAsides$1 as remarkTransformAsides, remarkVarsSubstitute$1 as remarkVarsSubstitute, rssGenerateFeed$1 as rssGenerateFeed, searchEntryToPage$1 as searchEntryToPage, searchExtractStructuredData$1 as searchExtractStructuredData, searchReadMetaYaml$1 as searchReadMetaYaml, shellAnnouncementBannerScript$1 as shellAnnouncementBannerScript, shellBuildBannerInitScript$1 as shellBuildBannerInitScript, shellBuildGlobPattern$1 as shellBuildGlobPattern, shellBuildHeaders$1 as shellBuildHeaders, shellBuildLicenseErrorMessage$1 as shellBuildLicenseErrorMessage, shellBuildThemeInitScript$1 as shellBuildThemeInitScript, shellCacheControl$1 as shellCacheControl, shellCollectTailwindClassTokens$1 as shellCollectTailwindClassTokens, shellComposeTailwindEntry$1 as shellComposeTailwindEntry,
|
|
291
|
+
export { NativeHeadStats, NativePreloadStats, NativeTailwindResolvedTheme, NativeTailwindThemeError, analyticsGenerateBodyScripts$1 as analyticsGenerateBodyScripts, analyticsGenerateScripts$1 as analyticsGenerateScripts, asyncapiSourceBuild$1 as asyncapiSourceBuild, blogFilterByTag$1 as blogFilterByTag, blogFilterPublished$1 as blogFilterPublished, blogReadingTime$1 as blogReadingTime, blogSortByDate$1 as blogSortByDate, blogTagCounts$1 as blogTagCounts, buildHook$1 as buildHook, configResolvePublierConfig$1 as configResolvePublierConfig, configResolveShellConfig$1 as configResolveShellConfig, configShouldRenderPage$1 as configShouldRenderPage, contentGenerateLlmsTxt$1 as contentGenerateLlmsTxt, contentGenerateOgImageMarkup$1 as contentGenerateOgImageMarkup, contentGenerateRobotsTxt$1 as contentGenerateRobotsTxt, contentGenerateSkillMd$1 as contentGenerateSkillMd, contentGenerateTwitterMeta$1 as contentGenerateTwitterMeta, contentGetSlug$1 as contentGetSlug, navigationActiveIndex$1 as navigationActiveIndex, navigationBuildSidebar$1 as navigationBuildSidebar, navigationMatchNavPath$1 as navigationMatchNavPath, openapiBuildCustomSampleMap$1 as openapiBuildCustomSampleMap, openapiBuildInstanceId$1 as openapiBuildInstanceId, openapiDecodePlaceholders$1 as openapiDecodePlaceholders, openapiExtractEndpoints$1 as openapiExtractEndpoints, openapiGenerateFiles$1 as openapiGenerateFiles, openapiGetMediaTypeExample$1 as openapiGetMediaTypeExample, openapiGetSnippetClient$1 as openapiGetSnippetClient, openapiHarFromOperation$1 as openapiHarFromOperation, openapiMergeSpecs$1 as openapiMergeSpecs, openapiNavigationBuild$1 as openapiNavigationBuild, openapiParseAsyncApiSpec$1 as openapiParseAsyncApiSpec, openapiParseOpenapiSpec$1 as openapiParseOpenapiSpec, openapiRenderApiPage$1 as openapiRenderApiPage, openapiRenderApiPlayground$1 as openapiRenderApiPlayground, openapiRenderApiReference$1 as openapiRenderApiReference, openapiRenderApiReferenceShell$1 as openapiRenderApiReferenceShell, openapiRenderAsyncChannel$1 as openapiRenderAsyncChannel, openapiRenderAsyncMessage$1 as openapiRenderAsyncMessage, openapiRenderCodeSamples$1 as openapiRenderCodeSamples, openapiRenderCollapsibleSection$1 as openapiRenderCollapsibleSection, openapiRenderMethodBadge$1 as openapiRenderMethodBadge, openapiRenderParamField$1 as openapiRenderParamField, openapiRenderRequestExample$1 as openapiRenderRequestExample, openapiRenderResponseExample$1 as openapiRenderResponseExample, openapiRenderResponseField$1 as openapiRenderResponseField, openapiRenderSchemaRow$1 as openapiRenderSchemaRow, openapiRenderSchemaView$1 as openapiRenderSchemaView, openapiResolveBaseUrl$1 as openapiResolveBaseUrl, openapiResolveRefs$1 as openapiResolveRefs, openapiSourceBuild$1 as openapiSourceBuild, pluginHook$1 as pluginHook, primitivesColorSwatchScript$1 as primitivesColorSwatchScript, primitivesColorSwatchStyle$1 as primitivesColorSwatchStyle, primitivesCopyButtonScript$1 as primitivesCopyButtonScript, primitivesCopyButtonStyle$1 as primitivesCopyButtonStyle, primitivesRenderAccordion$1 as primitivesRenderAccordion, primitivesRenderAccordionItem$1 as primitivesRenderAccordionItem, primitivesRenderColorSwatch$1 as primitivesRenderColorSwatch, primitivesRenderCopyButton$1 as primitivesRenderCopyButton, primitivesRenderImageZoom$1 as primitivesRenderImageZoom, primitivesRenderTabPanel$1 as primitivesRenderTabPanel, primitivesRenderTabs$1 as primitivesRenderTabs, primitivesRenderTooltip$1 as primitivesRenderTooltip, primitivesRenderViewAnimation$1 as primitivesRenderViewAnimation, primitivesTabsScript$1 as primitivesTabsScript, primitivesViewAnimationScript$1 as primitivesViewAnimationScript, primitivesViewAnimationStyle$1 as primitivesViewAnimationStyle, remarkCollectSections$1 as remarkCollectSections, remarkResolveSnippet$1 as remarkResolveSnippet, remarkTransformAsides$1 as remarkTransformAsides, remarkVarsSubstitute$1 as remarkVarsSubstitute, rssGenerateFeed$1 as rssGenerateFeed, searchEntryToPage$1 as searchEntryToPage, searchExtractStructuredData$1 as searchExtractStructuredData, searchReadMetaYaml$1 as searchReadMetaYaml, shellAnnouncementBannerScript$1 as shellAnnouncementBannerScript, shellBuildBannerInitScript$1 as shellBuildBannerInitScript, shellBuildGlobPattern$1 as shellBuildGlobPattern, shellBuildHeaders$1 as shellBuildHeaders, shellBuildLicenseErrorMessage$1 as shellBuildLicenseErrorMessage, shellBuildThemeInitScript$1 as shellBuildThemeInitScript, shellCacheControl$1 as shellCacheControl, shellCollectTailwindClassTokens$1 as shellCollectTailwindClassTokens, shellComposeTailwindEntry$1 as shellComposeTailwindEntry, shellGenerateId$1 as shellGenerateId, shellLazyUpgradeScript$1 as shellLazyUpgradeScript, shellListThemes$1 as shellListThemes, shellNavActiveUpdateScript$1 as shellNavActiveUpdateScript, shellOpenInAiScript$1 as shellOpenInAiScript, shellPlanDefaultRoutes$1 as shellPlanDefaultRoutes, shellPlanDocsSlug$1 as shellPlanDocsSlug, shellPlanRehypePlugins$1 as shellPlanRehypePlugins, shellPlanRemarkPlugins$1 as shellPlanRemarkPlugins, shellRenderAnnouncementBanner$1 as shellRenderAnnouncementBanner, shellRenderAside$1 as shellRenderAside, shellRenderBadge$1 as shellRenderBadge, shellRenderBaseLayout$1 as shellRenderBaseLayout, shellRenderBlogIndex$1 as shellRenderBlogIndex, shellRenderBlogSlug$1 as shellRenderBlogSlug, shellRenderBreadcrumbs$1 as shellRenderBreadcrumbs, shellRenderCard$1 as shellRenderCard, shellRenderCardGrid$1 as shellRenderCardGrid, shellRenderChangelogEntry$1 as shellRenderChangelogEntry, shellRenderChangelogFooter$1 as shellRenderChangelogFooter, shellRenderChangelogHeader$1 as shellRenderChangelogHeader, shellRenderCodeGroup$1 as shellRenderCodeGroup, shellRenderColumns$1 as shellRenderColumns, shellRenderDocsLayout$1 as shellRenderDocsLayout, shellRenderDocsSlug$1 as shellRenderDocsSlug, shellRenderFileTree$1 as shellRenderFileTree, shellRenderFileTreeNode$1 as shellRenderFileTreeNode, shellRenderIcon$1 as shellRenderIcon, shellRenderLastModified$1 as shellRenderLastModified, shellRenderLinkButton$1 as shellRenderLinkButton, shellRenderLinkCard$1 as shellRenderLinkCard, shellRenderNotFound$1 as shellRenderNotFound, shellRenderOpenInAi$1 as shellRenderOpenInAi, shellRenderPackageInstall$1 as shellRenderPackageInstall, shellRenderPanels$1 as shellRenderPanels, shellRenderSearchButton$1 as shellRenderSearchButton, shellRenderSidebar$1 as shellRenderSidebar, shellRenderSkipLink$1 as shellRenderSkipLink, shellRenderSteps$1 as shellRenderSteps, shellRenderTableOfContents$1 as shellRenderTableOfContents, shellRenderTabs$1 as shellRenderTabs, shellRenderThemeToggle$1 as shellRenderThemeToggle, shellRenderTile$1 as shellRenderTile, shellRenderTileGrid$1 as shellRenderTileGrid, shellRenderTopNav$1 as shellRenderTopNav, shellRenderTopNavMobile$1 as shellRenderTopNavMobile, shellRenderUpdateBadge$1 as shellRenderUpdateBadge, shellRenderVersionSwitcher$1 as shellRenderVersionSwitcher, shellResolvePrefetch$1 as shellResolvePrefetch, shellResolveSnippetsConfig$1 as shellResolveSnippetsConfig, shellRewriteHead$1 as shellRewriteHead, shellRewriteModulepreload$1 as shellRewriteModulepreload, shellSearchButtonScript$1 as shellSearchButtonScript, shellSearchDialogCss$1 as shellSearchDialogCss, shellSearchDialogInnerHtml$1 as shellSearchDialogInnerHtml, shellSearchDialogScript$1 as shellSearchDialogScript, shellSidebarHeightInitScript$1 as shellSidebarHeightInitScript, shellSidebarScrollInitScript$1 as shellSidebarScrollInitScript, shellTableOfContentsScript$1 as shellTableOfContentsScript, tailwindComposeThemeCss$1 as tailwindComposeThemeCss, tailwindReadPresetCss$1 as tailwindReadPresetCss, tailwindResolveTheme$1 as tailwindResolveTheme, verifyLicense$1 as verifyLicense };
|
|
293
292
|
}
|
|
294
293
|
declare function analyticsGenerateBodyScripts$1(analyticsJson: string): string;
|
|
295
294
|
declare function analyticsGenerateScripts$1(analyticsJson: string): string;
|
|
@@ -301,6 +300,7 @@ declare function blogSortByDate$1(pagesJson: string): string;
|
|
|
301
300
|
declare function blogTagCounts$1(pagesJson: string): string;
|
|
302
301
|
declare function buildHook$1(event: string, argsJson: string): string | null;
|
|
303
302
|
declare function configResolvePublierConfig$1(inputJson: string): string;
|
|
303
|
+
declare function configResolveShellConfig$1(yaml: string): string;
|
|
304
304
|
declare function configShouldRenderPage$1(page: string, pagesJson: string, defaultForTemplate: boolean): boolean;
|
|
305
305
|
declare function contentGenerateLlmsTxt$1(optionsJson: string): string;
|
|
306
306
|
declare function contentGenerateOgImageMarkup$1(optionsJson: string): string;
|
|
@@ -398,14 +398,6 @@ declare function shellBuildThemeInitScript$1(defaultScheme: string, strict: bool
|
|
|
398
398
|
declare function shellCacheControl$1(path: string): string;
|
|
399
399
|
declare function shellCollectTailwindClassTokens$1(): string;
|
|
400
400
|
declare function shellComposeTailwindEntry$1(sourceDirsJson: string, katexCssPath?: string | undefined | null): string;
|
|
401
|
-
declare function shellExtractAnalyticsFromYaml$1(yaml: string): string | null;
|
|
402
|
-
declare function shellExtractAnnouncementFromYaml$1(yaml: string): string | null;
|
|
403
|
-
declare function shellExtractDocsConfigFromYaml$1(yaml: string): string;
|
|
404
|
-
declare function shellExtractFontsFromYaml$1(yaml: string): string | null;
|
|
405
|
-
declare function shellExtractNavFromYaml$1(yaml: string): string;
|
|
406
|
-
declare function shellExtractSiteFromYaml$1(yaml: string): string;
|
|
407
|
-
declare function shellExtractSnippetsFromYaml$1(yaml: string): string | null;
|
|
408
|
-
declare function shellExtractVarsFromYaml$1(yaml: string): string | null;
|
|
409
401
|
declare function shellGenerateId$1(entry: string): string;
|
|
410
402
|
declare function shellLazyUpgradeScript$1(): string;
|
|
411
403
|
declare function shellListThemes$1(): string;
|
|
@@ -484,6 +476,7 @@ declare const blogSortByDate: typeof blogSortByDate$1;
|
|
|
484
476
|
declare const blogTagCounts: typeof blogTagCounts$1;
|
|
485
477
|
declare const buildHook: typeof buildHook$1;
|
|
486
478
|
declare const configResolvePublierConfig: typeof configResolvePublierConfig$1;
|
|
479
|
+
declare const configResolveShellConfig: typeof configResolveShellConfig$1;
|
|
487
480
|
declare const configShouldRenderPage: typeof configShouldRenderPage$1;
|
|
488
481
|
declare const contentGenerateLlmsTxt: typeof contentGenerateLlmsTxt$1;
|
|
489
482
|
declare const contentGenerateOgImageMarkup: typeof contentGenerateOgImageMarkup$1;
|
|
@@ -558,14 +551,6 @@ declare const shellBuildThemeInitScript: typeof shellBuildThemeInitScript$1;
|
|
|
558
551
|
declare const shellCacheControl: typeof shellCacheControl$1;
|
|
559
552
|
declare const shellCollectTailwindClassTokens: typeof shellCollectTailwindClassTokens$1;
|
|
560
553
|
declare const shellComposeTailwindEntry: typeof shellComposeTailwindEntry$1;
|
|
561
|
-
declare const shellExtractAnalyticsFromYaml: typeof shellExtractAnalyticsFromYaml$1;
|
|
562
|
-
declare const shellExtractAnnouncementFromYaml: typeof shellExtractAnnouncementFromYaml$1;
|
|
563
|
-
declare const shellExtractDocsConfigFromYaml: typeof shellExtractDocsConfigFromYaml$1;
|
|
564
|
-
declare const shellExtractFontsFromYaml: typeof shellExtractFontsFromYaml$1;
|
|
565
|
-
declare const shellExtractNavFromYaml: typeof shellExtractNavFromYaml$1;
|
|
566
|
-
declare const shellExtractSiteFromYaml: typeof shellExtractSiteFromYaml$1;
|
|
567
|
-
declare const shellExtractSnippetsFromYaml: typeof shellExtractSnippetsFromYaml$1;
|
|
568
|
-
declare const shellExtractVarsFromYaml: typeof shellExtractVarsFromYaml$1;
|
|
569
554
|
declare const shellGenerateId: typeof shellGenerateId$1;
|
|
570
555
|
declare const shellLazyUpgradeScript: typeof shellLazyUpgradeScript$1;
|
|
571
556
|
declare const shellListThemes: typeof shellListThemes$1;
|
|
@@ -630,4 +615,4 @@ declare const tailwindReadPresetCss: typeof tailwindReadPresetCss$1;
|
|
|
630
615
|
declare const tailwindResolveTheme: typeof tailwindResolveTheme$1;
|
|
631
616
|
declare const verifyLicense: typeof verifyLicense$1;
|
|
632
617
|
//#endregion
|
|
633
|
-
export { APPEARANCE_DEFAULTS, type AnalyticsProvider, type AppearanceConfig, type AppearanceDefault, type ConfigErrorCode, type ConfigValidationError, type ContentSource, type CustomScript, type FathomConfig, type FolderTreeNode, type FontConfig, type FontsConfig, type Ga4Config, type IntegrationsConfig, type LlmsConfig, type LlmsOptions, type LlmsPage, type LogoConfig, MAX_DESCRIPTION_LEN, MAX_SITENAME_LEN, MAX_TITLE_LEN, type NavConfig, type NavLink, type OgImageOptions, type Page, type PageTree, type PageTreeNode, type PagesToggleMap, type PlausibleConfig, type PosthogConfig, type PressConfig, type PublierConfig, type RobotsConfig, type RobotsOptions, type RssConfig, type SearchConfig, type SidebarConfig, type SkillMdOptions, type SkillPage, type StructuredSection, TOGGLEABLE_PAGES, type TocEntry, type ToggleablePage, type TreeNode, type TwitterMetaOptions, type TwitterMetaTag, type UmamiConfig, analyticsGenerateBodyScripts, analyticsGenerateScripts, asyncapiSourceBuild, blogFilterByTag, blogFilterPublished, blogReadingTime, blogSortByDate, blogTagCounts, buildHook, clamp, configResolvePublierConfig, configShouldRenderPage, contentGenerateLlmsTxt, contentGenerateOgImageMarkup, contentGenerateRobotsTxt, contentGenerateSkillMd, contentGenerateTwitterMeta, contentGetSlug, native as default, filterByTag, filterPublishedPages, generateAnalyticsBodyScripts, generateAnalyticsScripts, generateLlmsTxt, generateOgImage, generateRobotsTxt, generateRssFeed, generateSkillMd, generateTwitterMeta, getReadingTime, getSlug, getTagCounts, navigationActiveIndex, navigationBuildSidebar, navigationMatchNavPath, openapiBuildCustomSampleMap, openapiBuildInstanceId, openapiDecodePlaceholders, openapiExtractEndpoints, openapiGenerateFiles, openapiGetMediaTypeExample, openapiGetSnippetClient, openapiHarFromOperation, openapiMergeSpecs, openapiNavigationBuild, openapiParseAsyncApiSpec, openapiParseOpenapiSpec, openapiRenderApiPage, openapiRenderApiPlayground, openapiRenderApiReference, openapiRenderApiReferenceShell, openapiRenderAsyncChannel, openapiRenderAsyncMessage, openapiRenderCodeSamples, openapiRenderCollapsibleSection, openapiRenderMethodBadge, openapiRenderParamField, openapiRenderRequestExample, openapiRenderResponseExample, openapiRenderResponseField, openapiRenderSchemaRow, openapiRenderSchemaView, openapiResolveBaseUrl, openapiResolveRefs, openapiSourceBuild, pluginHook, primitivesColorSwatchScript, primitivesColorSwatchStyle, primitivesCopyButtonScript, primitivesCopyButtonStyle, primitivesRenderAccordion, primitivesRenderAccordionItem, primitivesRenderColorSwatch, primitivesRenderCopyButton, primitivesRenderImageZoom, primitivesRenderTabPanel, primitivesRenderTabs, primitivesRenderTooltip, primitivesRenderViewAnimation, primitivesTabsScript, primitivesViewAnimationScript, primitivesViewAnimationStyle, remarkCollectSections, remarkResolveSnippet, remarkTransformAsides, remarkVarsSubstitute, resolvePublierConfig, rssGenerateFeed, searchEntryToPage, searchExtractStructuredData, searchReadMetaYaml, shellAnnouncementBannerScript, shellBuildBannerInitScript, shellBuildGlobPattern, shellBuildHeaders, shellBuildLicenseErrorMessage, shellBuildThemeInitScript, shellCacheControl, shellCollectTailwindClassTokens, shellComposeTailwindEntry,
|
|
618
|
+
export { APPEARANCE_DEFAULTS, type AnalyticsProvider, type AppearanceConfig, type AppearanceDefault, type ConfigErrorCode, type ConfigValidationError, type ContentSource, type CustomScript, type FathomConfig, type FolderTreeNode, type FontConfig, type FontsConfig, type Ga4Config, type IntegrationsConfig, type LlmsConfig, type LlmsOptions, type LlmsPage, type LogoConfig, MAX_DESCRIPTION_LEN, MAX_SITENAME_LEN, MAX_TITLE_LEN, type NavConfig, type NavLink, type OgImageOptions, type Page, type PageTree, type PageTreeNode, type PagesToggleMap, type PlausibleConfig, type PosthogConfig, type PressConfig, type PublierConfig, type RobotsConfig, type RobotsOptions, type RssConfig, type SearchConfig, type SidebarConfig, type SkillMdOptions, type SkillPage, type StructuredSection, TOGGLEABLE_PAGES, type TocEntry, type ToggleablePage, type TreeNode, type TwitterMetaOptions, type TwitterMetaTag, type UmamiConfig, analyticsGenerateBodyScripts, analyticsGenerateScripts, asyncapiSourceBuild, blogFilterByTag, blogFilterPublished, blogReadingTime, blogSortByDate, blogTagCounts, buildHook, clamp, configResolvePublierConfig, configResolveShellConfig, configShouldRenderPage, contentGenerateLlmsTxt, contentGenerateOgImageMarkup, contentGenerateRobotsTxt, contentGenerateSkillMd, contentGenerateTwitterMeta, contentGetSlug, native as default, filterByTag, filterPublishedPages, generateAnalyticsBodyScripts, generateAnalyticsScripts, generateLlmsTxt, generateOgImage, generateRobotsTxt, generateRssFeed, generateSkillMd, generateTwitterMeta, getReadingTime, getSlug, getTagCounts, navigationActiveIndex, navigationBuildSidebar, navigationMatchNavPath, openapiBuildCustomSampleMap, openapiBuildInstanceId, openapiDecodePlaceholders, openapiExtractEndpoints, openapiGenerateFiles, openapiGetMediaTypeExample, openapiGetSnippetClient, openapiHarFromOperation, openapiMergeSpecs, openapiNavigationBuild, openapiParseAsyncApiSpec, openapiParseOpenapiSpec, openapiRenderApiPage, openapiRenderApiPlayground, openapiRenderApiReference, openapiRenderApiReferenceShell, openapiRenderAsyncChannel, openapiRenderAsyncMessage, openapiRenderCodeSamples, openapiRenderCollapsibleSection, openapiRenderMethodBadge, openapiRenderParamField, openapiRenderRequestExample, openapiRenderResponseExample, openapiRenderResponseField, openapiRenderSchemaRow, openapiRenderSchemaView, openapiResolveBaseUrl, openapiResolveRefs, openapiSourceBuild, pluginHook, primitivesColorSwatchScript, primitivesColorSwatchStyle, primitivesCopyButtonScript, primitivesCopyButtonStyle, primitivesRenderAccordion, primitivesRenderAccordionItem, primitivesRenderColorSwatch, primitivesRenderCopyButton, primitivesRenderImageZoom, primitivesRenderTabPanel, primitivesRenderTabs, primitivesRenderTooltip, primitivesRenderViewAnimation, primitivesTabsScript, primitivesViewAnimationScript, primitivesViewAnimationStyle, remarkCollectSections, remarkResolveSnippet, remarkTransformAsides, remarkVarsSubstitute, resolvePublierConfig, rssGenerateFeed, searchEntryToPage, searchExtractStructuredData, searchReadMetaYaml, shellAnnouncementBannerScript, shellBuildBannerInitScript, shellBuildGlobPattern, shellBuildHeaders, shellBuildLicenseErrorMessage, shellBuildThemeInitScript, shellCacheControl, shellCollectTailwindClassTokens, shellComposeTailwindEntry, shellGenerateId, shellLazyUpgradeScript, shellListThemes, shellNavActiveUpdateScript, shellOpenInAiScript, shellPlanDefaultRoutes, shellPlanDocsSlug, shellPlanRehypePlugins, shellPlanRemarkPlugins, shellRenderAnnouncementBanner, shellRenderAside, shellRenderBadge, shellRenderBaseLayout, shellRenderBlogIndex, shellRenderBlogSlug, shellRenderBreadcrumbs, shellRenderCard, shellRenderCardGrid, shellRenderChangelogEntry, shellRenderChangelogFooter, shellRenderChangelogHeader, shellRenderCodeGroup, shellRenderColumns, shellRenderDocsLayout, shellRenderDocsSlug, shellRenderFileTree, shellRenderFileTreeNode, shellRenderIcon, shellRenderLastModified, shellRenderLinkButton, shellRenderLinkCard, shellRenderNotFound, shellRenderOpenInAi, shellRenderPackageInstall, shellRenderPanels, shellRenderSearchButton, shellRenderSidebar, shellRenderSkipLink, shellRenderSteps, shellRenderTableOfContents, shellRenderTabs, shellRenderThemeToggle, shellRenderTile, shellRenderTileGrid, shellRenderTopNav, shellRenderTopNavMobile, shellRenderUpdateBadge, shellRenderVersionSwitcher, shellResolvePrefetch, shellResolveSnippetsConfig, shellRewriteHead, shellRewriteModulepreload, shellSearchButtonScript, shellSearchDialogCss, shellSearchDialogInnerHtml, shellSearchDialogScript, shellSidebarHeightInitScript, shellSidebarScrollInitScript, shellTableOfContentsScript, shouldRenderPage, sortByDate, tailwindComposeThemeCss, tailwindReadPresetCss, tailwindResolveTheme, verifyLicense };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as e}from"node:module";const t=e(import.meta.url)(`../index.js`);function n(e){return t.analyticsGenerateScripts(JSON.stringify(e))}function r(e){return t.analyticsGenerateBodyScripts(JSON.stringify(e))}function i(e){return JSON.parse(t.blogSortByDate(JSON.stringify(e)))}function a(e){let n=JSON.parse(t.blogTagCounts(JSON.stringify(e)));return new Map(Object.entries(n))}function o(e,n){return JSON.parse(t.blogFilterByTag(JSON.stringify(e),n))}function s(e){return t.blogReadingTime(JSON.stringify(e))}function ee(e){return t.contentGenerateLlmsTxt(JSON.stringify(e))}function te(e){return JSON.parse(t.contentGenerateTwitterMeta(JSON.stringify(e)))}const c=200,l=400,u=80;function d(e,t){return e.length<=t?e:e.slice(0,t)}async function f(e){let{width:n=1200,height:r=630}=e,i,a;try{i=(await import(`satori`)).default}catch{throw Error(`@publier/native (og-image) requires "satori" as a peer dependency. Install it: pnpm add satori`)}try{a=(await import(`@resvg/resvg-js`)).Resvg}catch{throw Error(`@publier/native (og-image) requires "@resvg/resvg-js" as a peer dependency. Install it: pnpm add @resvg/resvg-js`)}let o=JSON.parse(t.contentGenerateOgImageMarkup(JSON.stringify(e))),s=await i(o,{width:n,height:r,fonts:e.fonts??[]});return new a(s,{fitTo:{mode:`width`,value:n}}).render().asPng()}const p=[`docs`,`blog`,`landing`,`press`,`about`,`team`,`contact`,`careers`,`changelog`,`status`,`knowledge-base`,`404`],m=[`system`,`light`,`dark`];function h(e){return JSON.parse(t.configResolvePublierConfig(JSON.stringify(e)??`null`))}function g(e,n,r){return t.configShouldRenderPage(e,JSON.stringify(n),r)}function _(e={}){return t.contentGenerateRobotsTxt(JSON.stringify(e))}function v(e){return JSON.parse(t.blogFilterPublished(JSON.stringify(e)))}function y(e,n){let r={title:n.title,description:n.description,siteUrl:n.siteUrl,feedUrl:n.feedUrl,language:n.language,buildDate:(n.buildDate??new Date).toUTCString()};return t.rssGenerateFeed(JSON.stringify(e),JSON.stringify(r))}function b(e){return t.contentGenerateSkillMd(JSON.stringify(e))}function x(e,n){return t.contentGetSlug(e,n)}var S=t;const C=t.analyticsGenerateBodyScripts,w=t.analyticsGenerateScripts,T=t.asyncapiSourceBuild,E=t.blogFilterByTag,D=t.blogFilterPublished,O=t.blogReadingTime,k=t.blogSortByDate,A=t.blogTagCounts,j=t.buildHook,M=t.configResolvePublierConfig,N=t.configShouldRenderPage,P=t.contentGenerateLlmsTxt,F=t.contentGenerateOgImageMarkup,I=t.contentGenerateRobotsTxt,L=t.contentGenerateSkillMd,R=t.contentGenerateTwitterMeta,z=t.contentGetSlug,B=t.navigationActiveIndex,V=t.navigationBuildSidebar,H=t.navigationMatchNavPath,U=t.openapiBuildCustomSampleMap,W=t.openapiBuildInstanceId,G=t.openapiDecodePlaceholders,K=t.openapiExtractEndpoints,q=t.openapiGenerateFiles,J=t.openapiGetMediaTypeExample,Y=t.openapiGetSnippetClient,X=t.openapiHarFromOperation,Z=t.openapiMergeSpecs,Q=t.openapiNavigationBuild,ne=t.openapiParseAsyncApiSpec,re=t.openapiParseOpenapiSpec,ie=t.openapiRenderApiPage,ae=t.openapiRenderApiPlayground,oe=t.openapiRenderApiReference,se=t.openapiRenderApiReferenceShell,ce=t.openapiRenderAsyncChannel,le=t.openapiRenderAsyncMessage,ue=t.openapiRenderCodeSamples,de=t.openapiRenderCollapsibleSection,fe=t.openapiRenderMethodBadge,pe=t.openapiRenderParamField,me=t.openapiRenderRequestExample,he=t.openapiRenderResponseExample,ge=t.openapiRenderResponseField,_e=t.openapiRenderSchemaRow,ve=t.openapiRenderSchemaView,ye=t.openapiResolveBaseUrl,be=t.openapiResolveRefs,xe=t.openapiSourceBuild,Se=t.pluginHook,Ce=t.primitivesColorSwatchScript,we=t.primitivesColorSwatchStyle,Te=t.primitivesCopyButtonScript,Ee=t.primitivesCopyButtonStyle,De=t.primitivesRenderAccordion,Oe=t.primitivesRenderAccordionItem,ke=t.primitivesRenderColorSwatch,Ae=t.primitivesRenderCopyButton,je=t.primitivesRenderImageZoom,Me=t.primitivesRenderTabPanel,Ne=t.primitivesRenderTabs,Pe=t.primitivesRenderTooltip,Fe=t.primitivesRenderViewAnimation,Ie=t.primitivesTabsScript,Le=t.primitivesViewAnimationScript,Re=t.primitivesViewAnimationStyle,ze=t.remarkCollectSections,Be=t.remarkResolveSnippet,Ve=t.remarkTransformAsides,He=t.remarkVarsSubstitute,$=t.rssGenerateFeed,Ue=t.searchEntryToPage,We=t.searchExtractStructuredData,Ge=t.searchReadMetaYaml,Ke=t.shellAnnouncementBannerScript,qe=t.shellBuildBannerInitScript,Je=t.shellBuildGlobPattern,Ye=t.shellBuildHeaders,Xe=t.shellBuildLicenseErrorMessage,Ze=t.shellBuildThemeInitScript,Qe=t.shellCacheControl,$e=t.shellCollectTailwindClassTokens,et=t.shellComposeTailwindEntry,tt=t.shellExtractAnalyticsFromYaml,nt=t.shellExtractAnnouncementFromYaml,rt=t.shellExtractDocsConfigFromYaml,it=t.shellExtractFontsFromYaml,at=t.shellExtractNavFromYaml,ot=t.shellExtractSiteFromYaml,st=t.shellExtractSnippetsFromYaml,ct=t.shellExtractVarsFromYaml,lt=t.shellGenerateId,ut=t.shellLazyUpgradeScript,dt=t.shellListThemes,ft=t.shellNavActiveUpdateScript,pt=t.shellOpenInAiScript,mt=t.shellPlanDefaultRoutes,ht=t.shellPlanDocsSlug,gt=t.shellPlanRehypePlugins,_t=t.shellPlanRemarkPlugins,vt=t.shellRenderAnnouncementBanner,yt=t.shellRenderAside,bt=t.shellRenderBadge,xt=t.shellRenderBaseLayout,St=t.shellRenderBlogIndex,Ct=t.shellRenderBlogSlug,wt=t.shellRenderBreadcrumbs,Tt=t.shellRenderCard,Et=t.shellRenderCardGrid,Dt=t.shellRenderChangelogEntry,Ot=t.shellRenderChangelogFooter,kt=t.shellRenderChangelogHeader,At=t.shellRenderCodeGroup,jt=t.shellRenderColumns,Mt=t.shellRenderDocsLayout,Nt=t.shellRenderDocsSlug,Pt=t.shellRenderFileTree,Ft=t.shellRenderFileTreeNode,It=t.shellRenderIcon,Lt=t.shellRenderLastModified,Rt=t.shellRenderLinkButton,zt=t.shellRenderLinkCard,Bt=t.shellRenderNotFound,Vt=t.shellRenderOpenInAi,Ht=t.shellRenderPackageInstall,Ut=t.shellRenderPanels,Wt=t.shellRenderSearchButton,Gt=t.shellRenderSidebar,Kt=t.shellRenderSkipLink,qt=t.shellRenderSteps,Jt=t.shellRenderTableOfContents,Yt=t.shellRenderTabs,Xt=t.shellRenderThemeToggle,Zt=t.shellRenderTile,Qt=t.shellRenderTileGrid,$t=t.shellRenderTopNav,en=t.shellRenderTopNavMobile,tn=t.shellRenderUpdateBadge,nn=t.shellRenderVersionSwitcher,rn=t.shellResolvePrefetch,an=t.shellResolveSnippetsConfig,on=t.shellRewriteHead,sn=t.shellRewriteModulepreload,cn=t.shellSearchButtonScript,ln=t.shellSearchDialogCss,un=t.shellSearchDialogInnerHtml,dn=t.shellSearchDialogScript,fn=t.shellSidebarHeightInitScript,pn=t.shellSidebarScrollInitScript,mn=t.shellTableOfContentsScript,hn=t.tailwindComposeThemeCss,gn=t.tailwindReadPresetCss,_n=t.tailwindResolveTheme,vn=t.verifyLicense;export{m as APPEARANCE_DEFAULTS,l as MAX_DESCRIPTION_LEN,u as MAX_SITENAME_LEN,c as MAX_TITLE_LEN,p as TOGGLEABLE_PAGES,C as analyticsGenerateBodyScripts,w as analyticsGenerateScripts,T as asyncapiSourceBuild,E as blogFilterByTag,D as blogFilterPublished,O as blogReadingTime,k as blogSortByDate,A as blogTagCounts,j as buildHook,d as clamp,M as configResolvePublierConfig,N as configShouldRenderPage,P as contentGenerateLlmsTxt,F as contentGenerateOgImageMarkup,I as contentGenerateRobotsTxt,L as contentGenerateSkillMd,R as contentGenerateTwitterMeta,z as contentGetSlug,S as default,o as filterByTag,v as filterPublishedPages,r as generateAnalyticsBodyScripts,n as generateAnalyticsScripts,ee as generateLlmsTxt,f as generateOgImage,_ as generateRobotsTxt,y as generateRssFeed,b as generateSkillMd,te as generateTwitterMeta,s as getReadingTime,x as getSlug,a as getTagCounts,B as navigationActiveIndex,V as navigationBuildSidebar,H as navigationMatchNavPath,U as openapiBuildCustomSampleMap,W as openapiBuildInstanceId,G as openapiDecodePlaceholders,K as openapiExtractEndpoints,q as openapiGenerateFiles,J as openapiGetMediaTypeExample,Y as openapiGetSnippetClient,X as openapiHarFromOperation,Z as openapiMergeSpecs,Q as openapiNavigationBuild,ne as openapiParseAsyncApiSpec,re as openapiParseOpenapiSpec,ie as openapiRenderApiPage,ae as openapiRenderApiPlayground,oe as openapiRenderApiReference,se as openapiRenderApiReferenceShell,ce as openapiRenderAsyncChannel,le as openapiRenderAsyncMessage,ue as openapiRenderCodeSamples,de as openapiRenderCollapsibleSection,fe as openapiRenderMethodBadge,pe as openapiRenderParamField,me as openapiRenderRequestExample,he as openapiRenderResponseExample,ge as openapiRenderResponseField,_e as openapiRenderSchemaRow,ve as openapiRenderSchemaView,ye as openapiResolveBaseUrl,be as openapiResolveRefs,xe as openapiSourceBuild,Se as pluginHook,Ce as primitivesColorSwatchScript,we as primitivesColorSwatchStyle,Te as primitivesCopyButtonScript,Ee as primitivesCopyButtonStyle,De as primitivesRenderAccordion,Oe as primitivesRenderAccordionItem,ke as primitivesRenderColorSwatch,Ae as primitivesRenderCopyButton,je as primitivesRenderImageZoom,Me as primitivesRenderTabPanel,Ne as primitivesRenderTabs,Pe as primitivesRenderTooltip,Fe as primitivesRenderViewAnimation,Ie as primitivesTabsScript,Le as primitivesViewAnimationScript,Re as primitivesViewAnimationStyle,ze as remarkCollectSections,Be as remarkResolveSnippet,Ve as remarkTransformAsides,He as remarkVarsSubstitute,h as resolvePublierConfig,$ as rssGenerateFeed,Ue as searchEntryToPage,We as searchExtractStructuredData,Ge as searchReadMetaYaml,Ke as shellAnnouncementBannerScript,qe as shellBuildBannerInitScript,Je as shellBuildGlobPattern,Ye as shellBuildHeaders,Xe as shellBuildLicenseErrorMessage,Ze as shellBuildThemeInitScript,Qe as shellCacheControl,$e as shellCollectTailwindClassTokens,et as shellComposeTailwindEntry,tt as shellExtractAnalyticsFromYaml,nt as shellExtractAnnouncementFromYaml,rt as shellExtractDocsConfigFromYaml,it as shellExtractFontsFromYaml,at as shellExtractNavFromYaml,ot as shellExtractSiteFromYaml,st as shellExtractSnippetsFromYaml,ct as shellExtractVarsFromYaml,lt as shellGenerateId,ut as shellLazyUpgradeScript,dt as shellListThemes,ft as shellNavActiveUpdateScript,pt as shellOpenInAiScript,mt as shellPlanDefaultRoutes,ht as shellPlanDocsSlug,gt as shellPlanRehypePlugins,_t as shellPlanRemarkPlugins,vt as shellRenderAnnouncementBanner,yt as shellRenderAside,bt as shellRenderBadge,xt as shellRenderBaseLayout,St as shellRenderBlogIndex,Ct as shellRenderBlogSlug,wt as shellRenderBreadcrumbs,Tt as shellRenderCard,Et as shellRenderCardGrid,Dt as shellRenderChangelogEntry,Ot as shellRenderChangelogFooter,kt as shellRenderChangelogHeader,At as shellRenderCodeGroup,jt as shellRenderColumns,Mt as shellRenderDocsLayout,Nt as shellRenderDocsSlug,Pt as shellRenderFileTree,Ft as shellRenderFileTreeNode,It as shellRenderIcon,Lt as shellRenderLastModified,Rt as shellRenderLinkButton,zt as shellRenderLinkCard,Bt as shellRenderNotFound,Vt as shellRenderOpenInAi,Ht as shellRenderPackageInstall,Ut as shellRenderPanels,Wt as shellRenderSearchButton,Gt as shellRenderSidebar,Kt as shellRenderSkipLink,qt as shellRenderSteps,Jt as shellRenderTableOfContents,Yt as shellRenderTabs,Xt as shellRenderThemeToggle,Zt as shellRenderTile,Qt as shellRenderTileGrid,$t as shellRenderTopNav,en as shellRenderTopNavMobile,tn as shellRenderUpdateBadge,nn as shellRenderVersionSwitcher,rn as shellResolvePrefetch,an as shellResolveSnippetsConfig,on as shellRewriteHead,sn as shellRewriteModulepreload,cn as shellSearchButtonScript,ln as shellSearchDialogCss,un as shellSearchDialogInnerHtml,dn as shellSearchDialogScript,fn as shellSidebarHeightInitScript,pn as shellSidebarScrollInitScript,mn as shellTableOfContentsScript,g as shouldRenderPage,i as sortByDate,hn as tailwindComposeThemeCss,gn as tailwindReadPresetCss,_n as tailwindResolveTheme,vn as verifyLicense};
|
|
1
|
+
import{createRequire as e}from"node:module";const t=e(import.meta.url)(`../index.js`);function n(e){return t.analyticsGenerateScripts(JSON.stringify(e))}function r(e){return t.analyticsGenerateBodyScripts(JSON.stringify(e))}function i(e){return JSON.parse(t.blogSortByDate(JSON.stringify(e)))}function a(e){let n=JSON.parse(t.blogTagCounts(JSON.stringify(e)));return new Map(Object.entries(n))}function o(e,n){return JSON.parse(t.blogFilterByTag(JSON.stringify(e),n))}function s(e){return t.blogReadingTime(JSON.stringify(e))}function ee(e){return t.contentGenerateLlmsTxt(JSON.stringify(e))}function te(e){return JSON.parse(t.contentGenerateTwitterMeta(JSON.stringify(e)))}const c=200,l=400,u=80;function d(e,t){return e.length<=t?e:e.slice(0,t)}async function f(e){let{width:n=1200,height:r=630}=e,i,a;try{i=(await import(`satori`)).default}catch{throw Error(`@publier/native (og-image) requires "satori" as a peer dependency. Install it: pnpm add satori`)}try{a=(await import(`@resvg/resvg-js`)).Resvg}catch{throw Error(`@publier/native (og-image) requires "@resvg/resvg-js" as a peer dependency. Install it: pnpm add @resvg/resvg-js`)}let o=JSON.parse(t.contentGenerateOgImageMarkup(JSON.stringify(e))),s=await i(o,{width:n,height:r,fonts:e.fonts??[]});return new a(s,{fitTo:{mode:`width`,value:n}}).render().asPng()}const p=[`docs`,`blog`,`landing`,`press`,`about`,`team`,`contact`,`careers`,`changelog`,`status`,`knowledge-base`,`404`],m=[`system`,`light`,`dark`];function h(e){return JSON.parse(t.configResolvePublierConfig(JSON.stringify(e)??`null`))}function g(e,n,r){return t.configShouldRenderPage(e,JSON.stringify(n),r)}function _(e={}){return t.contentGenerateRobotsTxt(JSON.stringify(e))}function v(e){return JSON.parse(t.blogFilterPublished(JSON.stringify(e)))}function y(e,n){let r={title:n.title,description:n.description,siteUrl:n.siteUrl,feedUrl:n.feedUrl,language:n.language,buildDate:(n.buildDate??new Date).toUTCString()};return t.rssGenerateFeed(JSON.stringify(e),JSON.stringify(r))}function b(e){return t.contentGenerateSkillMd(JSON.stringify(e))}function x(e,n){return t.contentGetSlug(e,n)}var S=t;const C=t.analyticsGenerateBodyScripts,w=t.analyticsGenerateScripts,T=t.asyncapiSourceBuild,E=t.blogFilterByTag,D=t.blogFilterPublished,O=t.blogReadingTime,k=t.blogSortByDate,A=t.blogTagCounts,j=t.buildHook,M=t.configResolvePublierConfig,N=t.configResolveShellConfig,P=t.configShouldRenderPage,F=t.contentGenerateLlmsTxt,I=t.contentGenerateOgImageMarkup,L=t.contentGenerateRobotsTxt,R=t.contentGenerateSkillMd,z=t.contentGenerateTwitterMeta,B=t.contentGetSlug,V=t.navigationActiveIndex,H=t.navigationBuildSidebar,U=t.navigationMatchNavPath,W=t.openapiBuildCustomSampleMap,G=t.openapiBuildInstanceId,K=t.openapiDecodePlaceholders,q=t.openapiExtractEndpoints,J=t.openapiGenerateFiles,Y=t.openapiGetMediaTypeExample,X=t.openapiGetSnippetClient,Z=t.openapiHarFromOperation,Q=t.openapiMergeSpecs,ne=t.openapiNavigationBuild,re=t.openapiParseAsyncApiSpec,ie=t.openapiParseOpenapiSpec,ae=t.openapiRenderApiPage,oe=t.openapiRenderApiPlayground,se=t.openapiRenderApiReference,ce=t.openapiRenderApiReferenceShell,le=t.openapiRenderAsyncChannel,ue=t.openapiRenderAsyncMessage,de=t.openapiRenderCodeSamples,fe=t.openapiRenderCollapsibleSection,pe=t.openapiRenderMethodBadge,me=t.openapiRenderParamField,he=t.openapiRenderRequestExample,ge=t.openapiRenderResponseExample,_e=t.openapiRenderResponseField,ve=t.openapiRenderSchemaRow,ye=t.openapiRenderSchemaView,be=t.openapiResolveBaseUrl,xe=t.openapiResolveRefs,Se=t.openapiSourceBuild,Ce=t.pluginHook,we=t.primitivesColorSwatchScript,Te=t.primitivesColorSwatchStyle,Ee=t.primitivesCopyButtonScript,De=t.primitivesCopyButtonStyle,Oe=t.primitivesRenderAccordion,ke=t.primitivesRenderAccordionItem,Ae=t.primitivesRenderColorSwatch,je=t.primitivesRenderCopyButton,Me=t.primitivesRenderImageZoom,Ne=t.primitivesRenderTabPanel,Pe=t.primitivesRenderTabs,Fe=t.primitivesRenderTooltip,Ie=t.primitivesRenderViewAnimation,Le=t.primitivesTabsScript,Re=t.primitivesViewAnimationScript,$=t.primitivesViewAnimationStyle,ze=t.remarkCollectSections,Be=t.remarkResolveSnippet,Ve=t.remarkTransformAsides,He=t.remarkVarsSubstitute,Ue=t.rssGenerateFeed,We=t.searchEntryToPage,Ge=t.searchExtractStructuredData,Ke=t.searchReadMetaYaml,qe=t.shellAnnouncementBannerScript,Je=t.shellBuildBannerInitScript,Ye=t.shellBuildGlobPattern,Xe=t.shellBuildHeaders,Ze=t.shellBuildLicenseErrorMessage,Qe=t.shellBuildThemeInitScript,$e=t.shellCacheControl,et=t.shellCollectTailwindClassTokens,tt=t.shellComposeTailwindEntry,nt=t.shellGenerateId,rt=t.shellLazyUpgradeScript,it=t.shellListThemes,at=t.shellNavActiveUpdateScript,ot=t.shellOpenInAiScript,st=t.shellPlanDefaultRoutes,ct=t.shellPlanDocsSlug,lt=t.shellPlanRehypePlugins,ut=t.shellPlanRemarkPlugins,dt=t.shellRenderAnnouncementBanner,ft=t.shellRenderAside,pt=t.shellRenderBadge,mt=t.shellRenderBaseLayout,ht=t.shellRenderBlogIndex,gt=t.shellRenderBlogSlug,_t=t.shellRenderBreadcrumbs,vt=t.shellRenderCard,yt=t.shellRenderCardGrid,bt=t.shellRenderChangelogEntry,xt=t.shellRenderChangelogFooter,St=t.shellRenderChangelogHeader,Ct=t.shellRenderCodeGroup,wt=t.shellRenderColumns,Tt=t.shellRenderDocsLayout,Et=t.shellRenderDocsSlug,Dt=t.shellRenderFileTree,Ot=t.shellRenderFileTreeNode,kt=t.shellRenderIcon,At=t.shellRenderLastModified,jt=t.shellRenderLinkButton,Mt=t.shellRenderLinkCard,Nt=t.shellRenderNotFound,Pt=t.shellRenderOpenInAi,Ft=t.shellRenderPackageInstall,It=t.shellRenderPanels,Lt=t.shellRenderSearchButton,Rt=t.shellRenderSidebar,zt=t.shellRenderSkipLink,Bt=t.shellRenderSteps,Vt=t.shellRenderTableOfContents,Ht=t.shellRenderTabs,Ut=t.shellRenderThemeToggle,Wt=t.shellRenderTile,Gt=t.shellRenderTileGrid,Kt=t.shellRenderTopNav,qt=t.shellRenderTopNavMobile,Jt=t.shellRenderUpdateBadge,Yt=t.shellRenderVersionSwitcher,Xt=t.shellResolvePrefetch,Zt=t.shellResolveSnippetsConfig,Qt=t.shellRewriteHead,$t=t.shellRewriteModulepreload,en=t.shellSearchButtonScript,tn=t.shellSearchDialogCss,nn=t.shellSearchDialogInnerHtml,rn=t.shellSearchDialogScript,an=t.shellSidebarHeightInitScript,on=t.shellSidebarScrollInitScript,sn=t.shellTableOfContentsScript,cn=t.tailwindComposeThemeCss,ln=t.tailwindReadPresetCss,un=t.tailwindResolveTheme,dn=t.verifyLicense;export{m as APPEARANCE_DEFAULTS,l as MAX_DESCRIPTION_LEN,u as MAX_SITENAME_LEN,c as MAX_TITLE_LEN,p as TOGGLEABLE_PAGES,C as analyticsGenerateBodyScripts,w as analyticsGenerateScripts,T as asyncapiSourceBuild,E as blogFilterByTag,D as blogFilterPublished,O as blogReadingTime,k as blogSortByDate,A as blogTagCounts,j as buildHook,d as clamp,M as configResolvePublierConfig,N as configResolveShellConfig,P as configShouldRenderPage,F as contentGenerateLlmsTxt,I as contentGenerateOgImageMarkup,L as contentGenerateRobotsTxt,R as contentGenerateSkillMd,z as contentGenerateTwitterMeta,B as contentGetSlug,S as default,o as filterByTag,v as filterPublishedPages,r as generateAnalyticsBodyScripts,n as generateAnalyticsScripts,ee as generateLlmsTxt,f as generateOgImage,_ as generateRobotsTxt,y as generateRssFeed,b as generateSkillMd,te as generateTwitterMeta,s as getReadingTime,x as getSlug,a as getTagCounts,V as navigationActiveIndex,H as navigationBuildSidebar,U as navigationMatchNavPath,W as openapiBuildCustomSampleMap,G as openapiBuildInstanceId,K as openapiDecodePlaceholders,q as openapiExtractEndpoints,J as openapiGenerateFiles,Y as openapiGetMediaTypeExample,X as openapiGetSnippetClient,Z as openapiHarFromOperation,Q as openapiMergeSpecs,ne as openapiNavigationBuild,re as openapiParseAsyncApiSpec,ie as openapiParseOpenapiSpec,ae as openapiRenderApiPage,oe as openapiRenderApiPlayground,se as openapiRenderApiReference,ce as openapiRenderApiReferenceShell,le as openapiRenderAsyncChannel,ue as openapiRenderAsyncMessage,de as openapiRenderCodeSamples,fe as openapiRenderCollapsibleSection,pe as openapiRenderMethodBadge,me as openapiRenderParamField,he as openapiRenderRequestExample,ge as openapiRenderResponseExample,_e as openapiRenderResponseField,ve as openapiRenderSchemaRow,ye as openapiRenderSchemaView,be as openapiResolveBaseUrl,xe as openapiResolveRefs,Se as openapiSourceBuild,Ce as pluginHook,we as primitivesColorSwatchScript,Te as primitivesColorSwatchStyle,Ee as primitivesCopyButtonScript,De as primitivesCopyButtonStyle,Oe as primitivesRenderAccordion,ke as primitivesRenderAccordionItem,Ae as primitivesRenderColorSwatch,je as primitivesRenderCopyButton,Me as primitivesRenderImageZoom,Ne as primitivesRenderTabPanel,Pe as primitivesRenderTabs,Fe as primitivesRenderTooltip,Ie as primitivesRenderViewAnimation,Le as primitivesTabsScript,Re as primitivesViewAnimationScript,$ as primitivesViewAnimationStyle,ze as remarkCollectSections,Be as remarkResolveSnippet,Ve as remarkTransformAsides,He as remarkVarsSubstitute,h as resolvePublierConfig,Ue as rssGenerateFeed,We as searchEntryToPage,Ge as searchExtractStructuredData,Ke as searchReadMetaYaml,qe as shellAnnouncementBannerScript,Je as shellBuildBannerInitScript,Ye as shellBuildGlobPattern,Xe as shellBuildHeaders,Ze as shellBuildLicenseErrorMessage,Qe as shellBuildThemeInitScript,$e as shellCacheControl,et as shellCollectTailwindClassTokens,tt as shellComposeTailwindEntry,nt as shellGenerateId,rt as shellLazyUpgradeScript,it as shellListThemes,at as shellNavActiveUpdateScript,ot as shellOpenInAiScript,st as shellPlanDefaultRoutes,ct as shellPlanDocsSlug,lt as shellPlanRehypePlugins,ut as shellPlanRemarkPlugins,dt as shellRenderAnnouncementBanner,ft as shellRenderAside,pt as shellRenderBadge,mt as shellRenderBaseLayout,ht as shellRenderBlogIndex,gt as shellRenderBlogSlug,_t as shellRenderBreadcrumbs,vt as shellRenderCard,yt as shellRenderCardGrid,bt as shellRenderChangelogEntry,xt as shellRenderChangelogFooter,St as shellRenderChangelogHeader,Ct as shellRenderCodeGroup,wt as shellRenderColumns,Tt as shellRenderDocsLayout,Et as shellRenderDocsSlug,Dt as shellRenderFileTree,Ot as shellRenderFileTreeNode,kt as shellRenderIcon,At as shellRenderLastModified,jt as shellRenderLinkButton,Mt as shellRenderLinkCard,Nt as shellRenderNotFound,Pt as shellRenderOpenInAi,Ft as shellRenderPackageInstall,It as shellRenderPanels,Lt as shellRenderSearchButton,Rt as shellRenderSidebar,zt as shellRenderSkipLink,Bt as shellRenderSteps,Vt as shellRenderTableOfContents,Ht as shellRenderTabs,Ut as shellRenderThemeToggle,Wt as shellRenderTile,Gt as shellRenderTileGrid,Kt as shellRenderTopNav,qt as shellRenderTopNavMobile,Jt as shellRenderUpdateBadge,Yt as shellRenderVersionSwitcher,Xt as shellResolvePrefetch,Zt as shellResolveSnippetsConfig,Qt as shellRewriteHead,$t as shellRewriteModulepreload,en as shellSearchButtonScript,tn as shellSearchDialogCss,nn as shellSearchDialogInnerHtml,rn as shellSearchDialogScript,an as shellSidebarHeightInitScript,on as shellSidebarScrollInitScript,sn as shellTableOfContentsScript,g as shouldRenderPage,i as sortByDate,cn as tailwindComposeThemeCss,ln as tailwindReadPresetCss,un as tailwindResolveTheme,dn as verifyLicense};
|
package/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare function blogSortByDate(pagesJson: string): string
|
|
|
8
8
|
export declare function blogTagCounts(pagesJson: string): string
|
|
9
9
|
export declare function buildHook(event: string, argsJson: string): string | null
|
|
10
10
|
export declare function configResolvePublierConfig(inputJson: string): string
|
|
11
|
+
export declare function configResolveShellConfig(yaml: string): string
|
|
11
12
|
export declare function configShouldRenderPage(page: string, pagesJson: string, defaultForTemplate: boolean): boolean
|
|
12
13
|
export declare function contentGenerateLlmsTxt(optionsJson: string): string
|
|
13
14
|
export declare function contentGenerateOgImageMarkup(optionsJson: string): string
|
|
@@ -105,14 +106,6 @@ export declare function shellBuildThemeInitScript(defaultScheme: string, strict:
|
|
|
105
106
|
export declare function shellCacheControl(path: string): string
|
|
106
107
|
export declare function shellCollectTailwindClassTokens(): string
|
|
107
108
|
export declare function shellComposeTailwindEntry(sourceDirsJson: string, katexCssPath?: string | undefined | null): string
|
|
108
|
-
export declare function shellExtractAnalyticsFromYaml(yaml: string): string | null
|
|
109
|
-
export declare function shellExtractAnnouncementFromYaml(yaml: string): string | null
|
|
110
|
-
export declare function shellExtractDocsConfigFromYaml(yaml: string): string
|
|
111
|
-
export declare function shellExtractFontsFromYaml(yaml: string): string | null
|
|
112
|
-
export declare function shellExtractNavFromYaml(yaml: string): string
|
|
113
|
-
export declare function shellExtractSiteFromYaml(yaml: string): string
|
|
114
|
-
export declare function shellExtractSnippetsFromYaml(yaml: string): string | null
|
|
115
|
-
export declare function shellExtractVarsFromYaml(yaml: string): string | null
|
|
116
109
|
export declare function shellGenerateId(entry: string): string
|
|
117
110
|
export declare function shellLazyUpgradeScript(): string
|
|
118
111
|
export declare function shellListThemes(): string
|
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
// @ts-nocheck
|
|
4
4
|
|
|
5
|
-
const { readFileSync } = require('
|
|
5
|
+
const { readFileSync } = require('fs')
|
|
6
6
|
let nativeBinding = null
|
|
7
7
|
const loadErrors = []
|
|
8
8
|
|
|
@@ -32,7 +32,7 @@ const isMuslFromFilesystem = () => {
|
|
|
32
32
|
|
|
33
33
|
const isMuslFromReport = () => {
|
|
34
34
|
let report = null
|
|
35
|
-
if (typeof process.report
|
|
35
|
+
if (process.report && typeof process.report.getReport === 'function') {
|
|
36
36
|
process.report.excludeNetwork = true
|
|
37
37
|
report = process.report.getReport()
|
|
38
38
|
}
|
|
@@ -76,8 +76,8 @@ function requireNative() {
|
|
|
76
76
|
try {
|
|
77
77
|
const binding = require('@publier/native-android-arm64')
|
|
78
78
|
const bindingPackageVersion = require('@publier/native-android-arm64/package.json').version
|
|
79
|
-
if (bindingPackageVersion !== '
|
|
80
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
79
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
80
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
81
81
|
}
|
|
82
82
|
return binding
|
|
83
83
|
} catch (e) {
|
|
@@ -92,8 +92,8 @@ function requireNative() {
|
|
|
92
92
|
try {
|
|
93
93
|
const binding = require('@publier/native-android-arm-eabi')
|
|
94
94
|
const bindingPackageVersion = require('@publier/native-android-arm-eabi/package.json').version
|
|
95
|
-
if (bindingPackageVersion !== '
|
|
96
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
95
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
96
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
97
97
|
}
|
|
98
98
|
return binding
|
|
99
99
|
} catch (e) {
|
|
@@ -104,7 +104,7 @@ function requireNative() {
|
|
|
104
104
|
}
|
|
105
105
|
} else if (process.platform === 'win32') {
|
|
106
106
|
if (process.arch === 'x64') {
|
|
107
|
-
if (process.config
|
|
107
|
+
if ((process.config && process.config.variables && process.config.variables.shlib_suffix === 'dll.a') || (process.config && process.config.variables && process.config.variables.node_target_type === 'shared_library')) {
|
|
108
108
|
try {
|
|
109
109
|
return require('./publier-native.win32-x64-gnu.node')
|
|
110
110
|
} catch (e) {
|
|
@@ -113,8 +113,8 @@ function requireNative() {
|
|
|
113
113
|
try {
|
|
114
114
|
const binding = require('@publier/native-win32-x64-gnu')
|
|
115
115
|
const bindingPackageVersion = require('@publier/native-win32-x64-gnu/package.json').version
|
|
116
|
-
if (bindingPackageVersion !== '
|
|
117
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
116
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
117
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
118
118
|
}
|
|
119
119
|
return binding
|
|
120
120
|
} catch (e) {
|
|
@@ -129,8 +129,8 @@ function requireNative() {
|
|
|
129
129
|
try {
|
|
130
130
|
const binding = require('@publier/native-win32-x64-msvc')
|
|
131
131
|
const bindingPackageVersion = require('@publier/native-win32-x64-msvc/package.json').version
|
|
132
|
-
if (bindingPackageVersion !== '
|
|
133
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
132
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
133
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
134
134
|
}
|
|
135
135
|
return binding
|
|
136
136
|
} catch (e) {
|
|
@@ -146,8 +146,8 @@ function requireNative() {
|
|
|
146
146
|
try {
|
|
147
147
|
const binding = require('@publier/native-win32-ia32-msvc')
|
|
148
148
|
const bindingPackageVersion = require('@publier/native-win32-ia32-msvc/package.json').version
|
|
149
|
-
if (bindingPackageVersion !== '
|
|
150
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
149
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
150
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
151
151
|
}
|
|
152
152
|
return binding
|
|
153
153
|
} catch (e) {
|
|
@@ -162,8 +162,8 @@ function requireNative() {
|
|
|
162
162
|
try {
|
|
163
163
|
const binding = require('@publier/native-win32-arm64-msvc')
|
|
164
164
|
const bindingPackageVersion = require('@publier/native-win32-arm64-msvc/package.json').version
|
|
165
|
-
if (bindingPackageVersion !== '
|
|
166
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
165
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
166
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
167
167
|
}
|
|
168
168
|
return binding
|
|
169
169
|
} catch (e) {
|
|
@@ -181,8 +181,8 @@ function requireNative() {
|
|
|
181
181
|
try {
|
|
182
182
|
const binding = require('@publier/native-darwin-universal')
|
|
183
183
|
const bindingPackageVersion = require('@publier/native-darwin-universal/package.json').version
|
|
184
|
-
if (bindingPackageVersion !== '
|
|
185
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
184
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
185
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
186
186
|
}
|
|
187
187
|
return binding
|
|
188
188
|
} catch (e) {
|
|
@@ -197,8 +197,8 @@ function requireNative() {
|
|
|
197
197
|
try {
|
|
198
198
|
const binding = require('@publier/native-darwin-x64')
|
|
199
199
|
const bindingPackageVersion = require('@publier/native-darwin-x64/package.json').version
|
|
200
|
-
if (bindingPackageVersion !== '
|
|
201
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
200
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
201
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
202
202
|
}
|
|
203
203
|
return binding
|
|
204
204
|
} catch (e) {
|
|
@@ -213,8 +213,8 @@ function requireNative() {
|
|
|
213
213
|
try {
|
|
214
214
|
const binding = require('@publier/native-darwin-arm64')
|
|
215
215
|
const bindingPackageVersion = require('@publier/native-darwin-arm64/package.json').version
|
|
216
|
-
if (bindingPackageVersion !== '
|
|
217
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
216
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
217
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
218
218
|
}
|
|
219
219
|
return binding
|
|
220
220
|
} catch (e) {
|
|
@@ -233,8 +233,8 @@ function requireNative() {
|
|
|
233
233
|
try {
|
|
234
234
|
const binding = require('@publier/native-freebsd-x64')
|
|
235
235
|
const bindingPackageVersion = require('@publier/native-freebsd-x64/package.json').version
|
|
236
|
-
if (bindingPackageVersion !== '
|
|
237
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
236
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
237
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
238
238
|
}
|
|
239
239
|
return binding
|
|
240
240
|
} catch (e) {
|
|
@@ -249,8 +249,8 @@ function requireNative() {
|
|
|
249
249
|
try {
|
|
250
250
|
const binding = require('@publier/native-freebsd-arm64')
|
|
251
251
|
const bindingPackageVersion = require('@publier/native-freebsd-arm64/package.json').version
|
|
252
|
-
if (bindingPackageVersion !== '
|
|
253
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
252
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
253
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
254
254
|
}
|
|
255
255
|
return binding
|
|
256
256
|
} catch (e) {
|
|
@@ -270,8 +270,8 @@ function requireNative() {
|
|
|
270
270
|
try {
|
|
271
271
|
const binding = require('@publier/native-linux-x64-musl')
|
|
272
272
|
const bindingPackageVersion = require('@publier/native-linux-x64-musl/package.json').version
|
|
273
|
-
if (bindingPackageVersion !== '
|
|
274
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
273
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
274
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
275
275
|
}
|
|
276
276
|
return binding
|
|
277
277
|
} catch (e) {
|
|
@@ -286,8 +286,8 @@ function requireNative() {
|
|
|
286
286
|
try {
|
|
287
287
|
const binding = require('@publier/native-linux-x64-gnu')
|
|
288
288
|
const bindingPackageVersion = require('@publier/native-linux-x64-gnu/package.json').version
|
|
289
|
-
if (bindingPackageVersion !== '
|
|
290
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
289
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
290
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
291
291
|
}
|
|
292
292
|
return binding
|
|
293
293
|
} catch (e) {
|
|
@@ -304,8 +304,8 @@ function requireNative() {
|
|
|
304
304
|
try {
|
|
305
305
|
const binding = require('@publier/native-linux-arm64-musl')
|
|
306
306
|
const bindingPackageVersion = require('@publier/native-linux-arm64-musl/package.json').version
|
|
307
|
-
if (bindingPackageVersion !== '
|
|
308
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
307
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
308
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
309
309
|
}
|
|
310
310
|
return binding
|
|
311
311
|
} catch (e) {
|
|
@@ -320,8 +320,8 @@ function requireNative() {
|
|
|
320
320
|
try {
|
|
321
321
|
const binding = require('@publier/native-linux-arm64-gnu')
|
|
322
322
|
const bindingPackageVersion = require('@publier/native-linux-arm64-gnu/package.json').version
|
|
323
|
-
if (bindingPackageVersion !== '
|
|
324
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
323
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
324
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
325
325
|
}
|
|
326
326
|
return binding
|
|
327
327
|
} catch (e) {
|
|
@@ -338,8 +338,8 @@ function requireNative() {
|
|
|
338
338
|
try {
|
|
339
339
|
const binding = require('@publier/native-linux-arm-musleabihf')
|
|
340
340
|
const bindingPackageVersion = require('@publier/native-linux-arm-musleabihf/package.json').version
|
|
341
|
-
if (bindingPackageVersion !== '
|
|
342
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
341
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
342
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
343
343
|
}
|
|
344
344
|
return binding
|
|
345
345
|
} catch (e) {
|
|
@@ -354,8 +354,8 @@ function requireNative() {
|
|
|
354
354
|
try {
|
|
355
355
|
const binding = require('@publier/native-linux-arm-gnueabihf')
|
|
356
356
|
const bindingPackageVersion = require('@publier/native-linux-arm-gnueabihf/package.json').version
|
|
357
|
-
if (bindingPackageVersion !== '
|
|
358
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
357
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
358
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
359
359
|
}
|
|
360
360
|
return binding
|
|
361
361
|
} catch (e) {
|
|
@@ -372,8 +372,8 @@ function requireNative() {
|
|
|
372
372
|
try {
|
|
373
373
|
const binding = require('@publier/native-linux-loong64-musl')
|
|
374
374
|
const bindingPackageVersion = require('@publier/native-linux-loong64-musl/package.json').version
|
|
375
|
-
if (bindingPackageVersion !== '
|
|
376
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
375
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
376
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
377
377
|
}
|
|
378
378
|
return binding
|
|
379
379
|
} catch (e) {
|
|
@@ -388,8 +388,8 @@ function requireNative() {
|
|
|
388
388
|
try {
|
|
389
389
|
const binding = require('@publier/native-linux-loong64-gnu')
|
|
390
390
|
const bindingPackageVersion = require('@publier/native-linux-loong64-gnu/package.json').version
|
|
391
|
-
if (bindingPackageVersion !== '
|
|
392
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
391
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
392
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
393
393
|
}
|
|
394
394
|
return binding
|
|
395
395
|
} catch (e) {
|
|
@@ -406,8 +406,8 @@ function requireNative() {
|
|
|
406
406
|
try {
|
|
407
407
|
const binding = require('@publier/native-linux-riscv64-musl')
|
|
408
408
|
const bindingPackageVersion = require('@publier/native-linux-riscv64-musl/package.json').version
|
|
409
|
-
if (bindingPackageVersion !== '
|
|
410
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
409
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
410
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
411
411
|
}
|
|
412
412
|
return binding
|
|
413
413
|
} catch (e) {
|
|
@@ -422,8 +422,8 @@ function requireNative() {
|
|
|
422
422
|
try {
|
|
423
423
|
const binding = require('@publier/native-linux-riscv64-gnu')
|
|
424
424
|
const bindingPackageVersion = require('@publier/native-linux-riscv64-gnu/package.json').version
|
|
425
|
-
if (bindingPackageVersion !== '
|
|
426
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
425
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
426
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
427
427
|
}
|
|
428
428
|
return binding
|
|
429
429
|
} catch (e) {
|
|
@@ -439,8 +439,8 @@ function requireNative() {
|
|
|
439
439
|
try {
|
|
440
440
|
const binding = require('@publier/native-linux-ppc64-gnu')
|
|
441
441
|
const bindingPackageVersion = require('@publier/native-linux-ppc64-gnu/package.json').version
|
|
442
|
-
if (bindingPackageVersion !== '
|
|
443
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
442
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
443
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
444
444
|
}
|
|
445
445
|
return binding
|
|
446
446
|
} catch (e) {
|
|
@@ -455,8 +455,8 @@ function requireNative() {
|
|
|
455
455
|
try {
|
|
456
456
|
const binding = require('@publier/native-linux-s390x-gnu')
|
|
457
457
|
const bindingPackageVersion = require('@publier/native-linux-s390x-gnu/package.json').version
|
|
458
|
-
if (bindingPackageVersion !== '
|
|
459
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
458
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
459
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
460
460
|
}
|
|
461
461
|
return binding
|
|
462
462
|
} catch (e) {
|
|
@@ -475,8 +475,8 @@ function requireNative() {
|
|
|
475
475
|
try {
|
|
476
476
|
const binding = require('@publier/native-openharmony-arm64')
|
|
477
477
|
const bindingPackageVersion = require('@publier/native-openharmony-arm64/package.json').version
|
|
478
|
-
if (bindingPackageVersion !== '
|
|
479
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
478
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
479
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
480
480
|
}
|
|
481
481
|
return binding
|
|
482
482
|
} catch (e) {
|
|
@@ -491,8 +491,8 @@ function requireNative() {
|
|
|
491
491
|
try {
|
|
492
492
|
const binding = require('@publier/native-openharmony-x64')
|
|
493
493
|
const bindingPackageVersion = require('@publier/native-openharmony-x64/package.json').version
|
|
494
|
-
if (bindingPackageVersion !== '
|
|
495
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
494
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
495
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
496
496
|
}
|
|
497
497
|
return binding
|
|
498
498
|
} catch (e) {
|
|
@@ -507,8 +507,8 @@ function requireNative() {
|
|
|
507
507
|
try {
|
|
508
508
|
const binding = require('@publier/native-openharmony-arm')
|
|
509
509
|
const bindingPackageVersion = require('@publier/native-openharmony-arm/package.json').version
|
|
510
|
-
if (bindingPackageVersion !== '
|
|
511
|
-
throw new Error(`Native binding package version mismatch, expected
|
|
510
|
+
if (bindingPackageVersion !== '2.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
511
|
+
throw new Error(`Native binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
512
512
|
}
|
|
513
513
|
return binding
|
|
514
514
|
} catch (e) {
|
|
@@ -522,54 +522,178 @@ function requireNative() {
|
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
524
|
|
|
525
|
-
|
|
525
|
+
function createLoadErrorChain(errors) {
|
|
526
|
+
return errors.reduce((previous, current) => {
|
|
527
|
+
let message
|
|
528
|
+
try {
|
|
529
|
+
message =
|
|
530
|
+
current && typeof current.message === 'string'
|
|
531
|
+
? current.message
|
|
532
|
+
: String(current)
|
|
533
|
+
} catch {
|
|
534
|
+
message = 'Unknown error'
|
|
535
|
+
}
|
|
536
|
+
const error = new Error(message)
|
|
537
|
+
error.cause = previous
|
|
538
|
+
return error
|
|
539
|
+
}, null)
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
// NAPI_RS_FORCE_WASI is a tri-state flag:
|
|
543
|
+
// unset / any other value → native binding preferred, WASI is only a fallback
|
|
544
|
+
// 'true' → prefer WASI, but retain native as a lazy fallback
|
|
545
|
+
// 'error' → require WASI without initializing a native fallback
|
|
546
|
+
// Treating any non-empty string as truthy (the historical behavior) meant
|
|
547
|
+
// NAPI_RS_FORCE_WASI=false, NAPI_RS_FORCE_WASI=0, etc. inadvertently triggered
|
|
548
|
+
// the WASI path, causing ENOENT for packages shipped without a .wasi.cjs file.
|
|
549
|
+
//
|
|
550
|
+
// NAPI_RS_WASI_FLAVOR selects one exact generated flavor and implies strict
|
|
551
|
+
// WASI loading. It never crosses into another flavor or falls back to native.
|
|
552
|
+
const __napiWasiFlavors = ["wasm32-wasi"]
|
|
553
|
+
const __napiWasiFlavor = process.env.NAPI_RS_WASI_FLAVOR
|
|
554
|
+
const __napiWasiFlavorRequested =
|
|
555
|
+
typeof __napiWasiFlavor === 'string' && __napiWasiFlavor.length > 0
|
|
556
|
+
if (
|
|
557
|
+
__napiWasiFlavorRequested &&
|
|
558
|
+
__napiWasiFlavors.indexOf(__napiWasiFlavor) === -1
|
|
559
|
+
) {
|
|
560
|
+
throw new Error(
|
|
561
|
+
'Unsupported WASI flavor "' +
|
|
562
|
+
__napiWasiFlavor +
|
|
563
|
+
'". Available flavors: ' +
|
|
564
|
+
__napiWasiFlavors.join(', '),
|
|
565
|
+
)
|
|
566
|
+
}
|
|
567
|
+
const forceWasiError = process.env.NAPI_RS_FORCE_WASI === 'error'
|
|
568
|
+
const forceWasi =
|
|
569
|
+
process.env.NAPI_RS_FORCE_WASI === 'true' ||
|
|
570
|
+
forceWasiError ||
|
|
571
|
+
__napiWasiFlavorRequested
|
|
572
|
+
|
|
573
|
+
if (!forceWasi) {
|
|
574
|
+
nativeBinding = requireNative()
|
|
575
|
+
}
|
|
526
576
|
|
|
527
|
-
if (!nativeBinding ||
|
|
577
|
+
if (!nativeBinding || forceWasi) {
|
|
528
578
|
let wasiBinding = null
|
|
529
|
-
let
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
579
|
+
let wasiBindingLoaded = false
|
|
580
|
+
const wasiBindingErrors = []
|
|
581
|
+
const __napiWasiResolveCandidate = (specifier, isPackage, localArtifacts) => {
|
|
582
|
+
try {
|
|
583
|
+
require.resolve(specifier)
|
|
584
|
+
} catch (resolveError) {
|
|
585
|
+
if (!resolveError || resolveError.code !== 'MODULE_NOT_FOUND') {
|
|
586
|
+
throw resolveError
|
|
587
|
+
}
|
|
588
|
+
if (isPackage) {
|
|
589
|
+
try {
|
|
590
|
+
require.resolve(specifier + '/package.json')
|
|
591
|
+
} catch (packageError) {
|
|
592
|
+
if (packageError && packageError.code === 'MODULE_NOT_FOUND') {
|
|
593
|
+
return resolveError
|
|
594
|
+
}
|
|
595
|
+
// An exports restriction proves the package exists even when its
|
|
596
|
+
// package.json is not public. Preserve the root resolution failure.
|
|
597
|
+
throw resolveError
|
|
598
|
+
}
|
|
599
|
+
// The package exists but its main/export target is broken.
|
|
600
|
+
throw resolveError
|
|
601
|
+
}
|
|
602
|
+
return resolveError
|
|
536
603
|
}
|
|
604
|
+
if (localArtifacts) {
|
|
605
|
+
let artifactError = null
|
|
606
|
+
for (let i = 0; i < localArtifacts.length; i++) {
|
|
607
|
+
try {
|
|
608
|
+
require.resolve(localArtifacts[i])
|
|
609
|
+
return null
|
|
610
|
+
} catch (resolveError) {
|
|
611
|
+
if (!resolveError || resolveError.code !== 'MODULE_NOT_FOUND') {
|
|
612
|
+
throw resolveError
|
|
613
|
+
}
|
|
614
|
+
artifactError = resolveError
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return artifactError
|
|
618
|
+
}
|
|
619
|
+
return null
|
|
537
620
|
}
|
|
538
|
-
if (!
|
|
621
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
|
|
622
|
+
let candidateError = null
|
|
623
|
+
let candidateFailed = false
|
|
539
624
|
try {
|
|
540
|
-
|
|
541
|
-
|
|
625
|
+
candidateError = __napiWasiResolveCandidate('./publier-native.wasi.cjs', false, ["./publier-native.wasm32-wasi.debug.wasm","./publier-native.wasm32-wasi.wasm"])
|
|
626
|
+
candidateFailed = candidateError !== null
|
|
627
|
+
if (!candidateFailed) {
|
|
628
|
+
wasiBinding = require('./publier-native.wasi.cjs')
|
|
629
|
+
nativeBinding = wasiBinding
|
|
630
|
+
wasiBindingLoaded = true
|
|
631
|
+
}
|
|
542
632
|
} catch (err) {
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
633
|
+
candidateError = err
|
|
634
|
+
candidateFailed = true
|
|
635
|
+
}
|
|
636
|
+
if (candidateFailed) {
|
|
637
|
+
wasiBindingErrors.push(candidateError)
|
|
638
|
+
loadErrors.push(candidateError)
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
if (!wasiBindingLoaded && (!__napiWasiFlavorRequested || __napiWasiFlavor === "wasm32-wasi")) {
|
|
642
|
+
let candidateError = null
|
|
643
|
+
let candidateFailed = false
|
|
644
|
+
try {
|
|
645
|
+
candidateError = __napiWasiResolveCandidate('@publier/native-wasm32-wasi', true, undefined)
|
|
646
|
+
candidateFailed = candidateError !== null
|
|
647
|
+
if (!candidateFailed) {
|
|
648
|
+
if (process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
|
649
|
+
const bindingPackageVersion = require('@publier/native-wasm32-wasi/package.json').version
|
|
650
|
+
if (bindingPackageVersion !== '2.1.0') {
|
|
651
|
+
throw new Error(`WASI binding package version mismatch, expected 2.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
|
652
|
+
}
|
|
548
653
|
}
|
|
549
|
-
|
|
654
|
+
wasiBinding = require('@publier/native-wasm32-wasi')
|
|
655
|
+
nativeBinding = wasiBinding
|
|
656
|
+
wasiBindingLoaded = true
|
|
550
657
|
}
|
|
658
|
+
} catch (err) {
|
|
659
|
+
candidateError = err
|
|
660
|
+
candidateFailed = true
|
|
661
|
+
}
|
|
662
|
+
if (candidateFailed) {
|
|
663
|
+
wasiBindingErrors.push(candidateError)
|
|
664
|
+
loadErrors.push(candidateError)
|
|
551
665
|
}
|
|
552
666
|
}
|
|
553
|
-
if (
|
|
554
|
-
|
|
555
|
-
|
|
667
|
+
if (
|
|
668
|
+
!wasiBindingLoaded &&
|
|
669
|
+
forceWasi &&
|
|
670
|
+
!forceWasiError &&
|
|
671
|
+
!__napiWasiFlavorRequested
|
|
672
|
+
) {
|
|
673
|
+
nativeBinding = requireNative()
|
|
674
|
+
}
|
|
675
|
+
if ((forceWasiError || __napiWasiFlavorRequested) && !wasiBindingLoaded) {
|
|
676
|
+
const error = new Error(
|
|
677
|
+
__napiWasiFlavorRequested
|
|
678
|
+
? 'WASI binding for flavor "' + __napiWasiFlavor + '" not found'
|
|
679
|
+
: 'WASI binding not found and NAPI_RS_FORCE_WASI is set to error',
|
|
680
|
+
)
|
|
681
|
+
error.cause = createLoadErrorChain(wasiBindingErrors)
|
|
556
682
|
throw error
|
|
557
683
|
}
|
|
558
684
|
}
|
|
559
685
|
|
|
560
686
|
if (!nativeBinding) {
|
|
561
687
|
if (loadErrors.length > 0) {
|
|
562
|
-
|
|
688
|
+
const error = new Error(
|
|
563
689
|
`Cannot find native binding. ` +
|
|
564
690
|
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
|
|
565
691
|
'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
|
|
566
|
-
{
|
|
567
|
-
cause: loadErrors.reduce((err, cur) => {
|
|
568
|
-
cur.cause = err
|
|
569
|
-
return cur
|
|
570
|
-
}),
|
|
571
|
-
},
|
|
572
692
|
)
|
|
693
|
+
// assign instead of the `new Error(message, { cause })` options form,
|
|
694
|
+
// which Node < 16.9 silently ignores
|
|
695
|
+
error.cause = createLoadErrorChain(loadErrors)
|
|
696
|
+
throw error
|
|
573
697
|
}
|
|
574
698
|
throw new Error(`Failed to load native binding`)
|
|
575
699
|
}
|
|
@@ -585,6 +709,7 @@ module.exports.blogSortByDate = nativeBinding.blogSortByDate
|
|
|
585
709
|
module.exports.blogTagCounts = nativeBinding.blogTagCounts
|
|
586
710
|
module.exports.buildHook = nativeBinding.buildHook
|
|
587
711
|
module.exports.configResolvePublierConfig = nativeBinding.configResolvePublierConfig
|
|
712
|
+
module.exports.configResolveShellConfig = nativeBinding.configResolveShellConfig
|
|
588
713
|
module.exports.configShouldRenderPage = nativeBinding.configShouldRenderPage
|
|
589
714
|
module.exports.contentGenerateLlmsTxt = nativeBinding.contentGenerateLlmsTxt
|
|
590
715
|
module.exports.contentGenerateOgImageMarkup = nativeBinding.contentGenerateOgImageMarkup
|
|
@@ -659,14 +784,6 @@ module.exports.shellBuildThemeInitScript = nativeBinding.shellBuildThemeInitScri
|
|
|
659
784
|
module.exports.shellCacheControl = nativeBinding.shellCacheControl
|
|
660
785
|
module.exports.shellCollectTailwindClassTokens = nativeBinding.shellCollectTailwindClassTokens
|
|
661
786
|
module.exports.shellComposeTailwindEntry = nativeBinding.shellComposeTailwindEntry
|
|
662
|
-
module.exports.shellExtractAnalyticsFromYaml = nativeBinding.shellExtractAnalyticsFromYaml
|
|
663
|
-
module.exports.shellExtractAnnouncementFromYaml = nativeBinding.shellExtractAnnouncementFromYaml
|
|
664
|
-
module.exports.shellExtractDocsConfigFromYaml = nativeBinding.shellExtractDocsConfigFromYaml
|
|
665
|
-
module.exports.shellExtractFontsFromYaml = nativeBinding.shellExtractFontsFromYaml
|
|
666
|
-
module.exports.shellExtractNavFromYaml = nativeBinding.shellExtractNavFromYaml
|
|
667
|
-
module.exports.shellExtractSiteFromYaml = nativeBinding.shellExtractSiteFromYaml
|
|
668
|
-
module.exports.shellExtractSnippetsFromYaml = nativeBinding.shellExtractSnippetsFromYaml
|
|
669
|
-
module.exports.shellExtractVarsFromYaml = nativeBinding.shellExtractVarsFromYaml
|
|
670
787
|
module.exports.shellGenerateId = nativeBinding.shellGenerateId
|
|
671
788
|
module.exports.shellLazyUpgradeScript = nativeBinding.shellLazyUpgradeScript
|
|
672
789
|
module.exports.shellListThemes = nativeBinding.shellListThemes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@publier/native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Publier native bindings — build, content, and OpenAPI utilities.",
|
|
6
6
|
"_filesRationale": "explicit napi/binary list: index.js + index.d.ts + .node binary names are exact public contract",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@napi-rs/cli": "^3.6.2",
|
|
43
43
|
"@types/node": "^22",
|
|
44
|
-
"tsdown": "^0.22.
|
|
45
|
-
"typescript": "^
|
|
44
|
+
"tsdown": "^0.22.14",
|
|
45
|
+
"typescript": "^7.0.2"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
Binary file
|