boltdocs 2.9.0 → 2.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/adapters-HVuXENAe.mjs +6 -0
  2. package/dist/adapters-uGz-UKQa.cjs +6 -0
  3. package/dist/{cache-C2PiGyg8.cjs → cache-B19MLTpN.cjs} +1 -1
  4. package/dist/{cache-DFW4R3S0.mjs → cache-CfhOTR3Q.mjs} +1 -1
  5. package/dist/client/index.cjs +2 -2
  6. package/dist/client/index.js +2 -2
  7. package/dist/client/mdx.cjs +1 -1
  8. package/dist/client/mdx.js +1 -1
  9. package/dist/client/primitives.cjs +1 -1
  10. package/dist/client/primitives.js +1 -1
  11. package/dist/config-BCqkPkjC.mjs +7 -0
  12. package/dist/config-BPWGa2W3.mjs +6 -0
  13. package/dist/config-CnmfjOE4.cjs +6 -0
  14. package/dist/config-D7ERJhqe.cjs +7 -0
  15. package/dist/csp-CUAEgrxR.mjs +6 -0
  16. package/dist/csp-DbbF3R9Q.cjs +6 -0
  17. package/dist/doctor-A17UhTRn.cjs +7 -0
  18. package/dist/{parser-DJoEF96Y.cjs → doctor-BL6c8x2Q.cjs} +1 -1
  19. package/dist/doctor-hKOBLhBF.mjs +7 -0
  20. package/dist/errors-C0Hx15Ag.mjs +6 -0
  21. package/dist/errors-Dx6JHoKE.cjs +6 -0
  22. package/dist/{doctor-wsPTzt8Y.mjs → handler-eNNcucnf.mjs} +1 -1
  23. package/dist/headers-DBzZ9yC6.mjs +6 -0
  24. package/dist/headers-DuCAOgYX.cjs +6 -0
  25. package/dist/{image-CjYu9Eml.js → image-BCDyLHyD.js} +1 -4
  26. package/dist/{image-B9YA_oQ_.cjs → image-DWdmichO.cjs} +1 -4
  27. package/dist/index-ZqgZUvwp.d.mts +274 -0
  28. package/dist/index-aWC0KjDF.d.cts +274 -0
  29. package/dist/{mdx-WXjAMS8Y.cjs → mdx-9QJoSITt.cjs} +1 -1
  30. package/dist/{mdx-Cy_c2zio.js → mdx-DFbspTP9.js} +1 -1
  31. package/dist/{meta-loader-By22EnYa.mjs → meta-loader-CD3Yptr5.mjs} +1 -1
  32. package/dist/{meta-loader-D0V6oOQt.cjs → meta-loader-CjphwtS7.cjs} +1 -1
  33. package/dist/node/cli-entry.cjs +9 -3
  34. package/dist/node/cli-entry.mjs +9 -3
  35. package/dist/node/index.cjs +1 -1
  36. package/dist/node/index.d.cts +8 -278
  37. package/dist/node/index.d.mts +9 -280
  38. package/dist/node/index.mjs +1 -1
  39. package/dist/node/routes/worker.cjs +1 -1
  40. package/dist/node/routes/worker.mjs +1 -1
  41. package/dist/node-B-I15rGR.cjs +105 -0
  42. package/dist/node-FkxzriO7.mjs +105 -0
  43. package/dist/package-CVw_u5VT.cjs +6 -0
  44. package/dist/{package-BK_82QLX.mjs → package-D6O7a8qA.mjs} +1 -1
  45. package/dist/parser-8u0xHVc7.mjs +6 -0
  46. package/dist/{doctor-Bknon8f5.cjs → parser-CHsNUEhU.cjs} +1 -1
  47. package/dist/parser-CLtGv_XH.cjs +6 -0
  48. package/dist/plugin-CHa0IT49.mjs +61 -0
  49. package/dist/plugin-Dqj9plKB.cjs +61 -0
  50. package/dist/routes-B2joDAlC.cjs +6 -0
  51. package/dist/routes-BTx0ngdX.mjs +6 -0
  52. package/dist/{routes-CKgGAy8P.mjs → routes-Bm0CQvyL.mjs} +1 -1
  53. package/dist/{routes-C6Kr2HFN.cjs → routes-CyKj3dzf.cjs} +1 -1
  54. package/dist/server/index.cjs +6 -0
  55. package/dist/server/index.d.cts +3 -0
  56. package/dist/server/index.d.mts +3 -0
  57. package/dist/server/index.mjs +6 -0
  58. package/dist/{shiki-adapter-CUtj-xKv.cjs → shiki-adapter-BB71nVsG.cjs} +1 -1
  59. package/dist/{handler-B31cxNw0.mjs → shiki-adapter-CL-IQwKI.cjs} +1 -1
  60. package/dist/shiki-adapter-CxTLkjew.mjs +6 -0
  61. package/dist/{shiki-adapter-F-P-lDon.mjs → shiki-adapter-rQ087Lx3.mjs} +1 -1
  62. package/dist/types-generator-BRyf4o9F.mjs +26 -0
  63. package/dist/types-generator-BqNKCbrx.cjs +26 -0
  64. package/dist/types-generator-Cu2jQP-V.mjs +6 -0
  65. package/dist/utils-BWy_8ASj.cjs +7 -0
  66. package/dist/utils-DexBrwiP.mjs +7 -0
  67. package/dist/{worker-pool-DRv8ef4z.mjs → worker-pool-v6tW2MDQ.mjs} +1 -1
  68. package/package.json +6 -1
  69. package/dist/doctor-BY1tSmQd.mjs +0 -34
  70. package/dist/doctor-DcFLi4t1.cjs +0 -34
  71. package/dist/node-DV-EPtMU.mjs +0 -160
  72. package/dist/node-vOVNRABe.cjs +0 -160
  73. package/dist/package-OxKE0p6j.cjs +0 -6
  74. package/dist/parser-C2Pw18LY.cjs +0 -6
  75. package/dist/parser-DScG_PTs.mjs +0 -6
  76. package/dist/routes--LYHSHT7.cjs +0 -6
  77. package/dist/routes-BAsfsn_e.mjs +0 -6
  78. package/dist/shiki-adapter-EZptJAmW.mjs +0 -6
  79. package/dist/shiki-adapter-PQBl32AN.cjs +0 -6
  80. package/dist/utils-DC4Wq-S2.mjs +0 -7
  81. package/dist/utils-wHud9ny5.cjs +0 -7
  82. /package/dist/{generator-DILs0EFN.mjs → generator-BaSvGlxR.mjs} +0 -0
  83. /package/dist/{generator-BEIF6MOx.cjs → generator-DsajVrDx.cjs} +0 -0
  84. /package/dist/{handler-Djy0HfsI.cjs → handler-1LRMYeI4.cjs} +0 -0
  85. /package/dist/{handler-DfhH9D1b.mjs → handler-CyIBbZdb.mjs} +0 -0
  86. /package/dist/{worker-pool-BS1LX67P.cjs → worker-pool-CgOMozUz.cjs} +0 -0
@@ -1,11 +1,8 @@
1
1
 
2
- import { InlineConfig, Plugin } from "vite";
2
+ import { i as handleVercelFeedback, n as handleWebFeedback, r as handleNetlifyFeedback, t as handleAwsFeedback } from "../index-ZqgZUvwp.mjs";
3
3
  import { z } from "zod";
4
4
  import { EXIT, SKIP } from "unist-util-visit";
5
- import { VercelRequest, VercelResponse } from "@vercel/node";
6
- import { HandlerEvent, HandlerResponse } from "@netlify/functions";
7
- import { Writable } from "node:stream";
8
-
5
+ import { InlineConfig, Plugin } from "vite";
9
6
  //#region src/shared/types.d.ts
10
7
  /**
11
8
  * Represents a single social link in the configuration.
@@ -238,7 +235,7 @@ interface BoltdocsIntegrationsConfig {
238
235
  /**
239
236
  * The root configuration object for Boltdocs.
240
237
  */
241
- interface BoltdocsConfig$1 {
238
+ interface BoltdocsConfig {
242
239
  siteUrl?: string;
243
240
  docsDir?: string;
244
241
  base?: string;
@@ -284,7 +281,7 @@ type BoltdocsRoutePathWithFallback = BoltdocsRoutePath extends never ? string :
284
281
  *
285
282
  * @param config - The Boltdocs configuration object
286
283
  */
287
- declare function defineConfig(config: BoltdocsConfig$1): BoltdocsConfig$1;
284
+ declare function defineConfig(config: BoltdocsConfig): BoltdocsConfig;
288
285
  //#endregion
289
286
  //#region src/node/config.d.ts
290
287
  /**
@@ -295,7 +292,7 @@ declare function defineConfig(config: BoltdocsConfig$1): BoltdocsConfig$1;
295
292
  * @param root - The project root directory (defaults to process.cwd())
296
293
  * @returns The merged configuration object
297
294
  */
298
- declare function resolveConfig(docsDir: string, root?: string): Promise<BoltdocsConfig$1>;
295
+ declare function resolveConfig(docsDir: string, root?: string): Promise<BoltdocsConfig>;
299
296
  //#endregion
300
297
  //#region src/node/plugin/types.d.ts
301
298
  /**
@@ -315,7 +312,7 @@ interface BoltdocsPluginOptions {
315
312
  * @param config - The resolved Boltdocs configuration containing custom plugins and components
316
313
  * @returns A string of JavaScript code to be evaluated by the browser
317
314
  */
318
- declare function generateEntryCode(options: BoltdocsPluginOptions, config?: BoltdocsConfig$1): string;
315
+ declare function generateEntryCode(options: BoltdocsPluginOptions, config?: BoltdocsConfig): string;
319
316
  //#endregion
320
317
  //#region src/node/routes/types.d.ts
321
318
  /**
@@ -421,7 +418,7 @@ declare function flushCache(): Promise<void>;
421
418
  //#endregion
422
419
  //#region src/node/plugins/plugin-types.d.ts
423
420
  interface PluginContext {
424
- readonly config: BoltdocsConfig$1;
421
+ readonly config: BoltdocsConfig;
425
422
  readonly logger: PluginLogger;
426
423
  readonly store: PluginStore;
427
424
  readonly meta: PluginMeta;
@@ -539,7 +536,7 @@ declare class PluginLifecycleManager {
539
536
  private store;
540
537
  private docsDir;
541
538
  private rootDir;
542
- constructor(plugins: SecureBoltdocsPlugin[], config: BoltdocsConfig$1, docsDir?: string, rootDir?: string);
539
+ constructor(plugins: SecureBoltdocsPlugin[], config: BoltdocsConfig, docsDir?: string, rootDir?: string);
543
540
  runHook(hookName: keyof PluginLifecycleHooks, ...args: unknown[]): Promise<void>;
544
541
  runChain<TParams>(hookName: keyof PluginLifecycleHooks, initialParams: TParams): Promise<TParams>;
545
542
  private getSortedPlugins;
@@ -731,274 +728,6 @@ declare const MDX_NODES: {
731
728
  //#region src/node/plugins/index.d.ts
732
729
  declare function createPlugin(plugin: SecureBoltdocsPlugin): SecureBoltdocsPlugin;
733
730
  //#endregion
734
- //#region src/node/feedback/adapters/vercel.d.ts
735
- declare function handleVercelFeedback(req: VercelRequest, res: VercelResponse): Promise<VercelResponse | undefined>;
736
- //#endregion
737
- //#region src/node/feedback/adapters/netlify.d.ts
738
- declare function handleNetlifyFeedback(event: HandlerEvent, env?: Record<string, string | undefined>): Promise<HandlerResponse>;
739
- //#endregion
740
- //#region src/node/feedback/adapters/web.d.ts
741
- declare function handleWebFeedback(request: Request, env?: Record<string, string | undefined>): Promise<Response>;
742
- //#endregion
743
- //#region ../../node_modules/.pnpm/@types+aws-lambda@8.10.161/node_modules/@types/aws-lambda/common/api-gateway.d.ts
744
- // Default authorizer type, prefer using a specific type with the "...WithAuthorizer..." variant types.
745
- // Note that this doesn't have to be a context from a custom lambda outhorizer, AWS also has a cognito
746
- // authorizer type and could add more, so the property won't always be a string.
747
- type APIGatewayEventDefaultAuthorizerContext = undefined | null | {
748
- [name: string]: any;
749
- };
750
- // The requestContext property of both request authorizer and proxy integration events.
751
- interface APIGatewayEventRequestContextWithAuthorizer<TAuthorizerContext> {
752
- accountId: string;
753
- apiId: string; // This one is a bit confusing: it is not actually present in authorizer calls
754
- // and proxy calls without an authorizer. We model this by allowing undefined in the type,
755
- // since it ends up the same and avoids breaking users that are testing the property.
756
- // This lets us allow parameterizing the authorizer for proxy events that know what authorizer
757
- // context values they have.
758
- authorizer: TAuthorizerContext;
759
- connectedAt?: number | undefined;
760
- connectionId?: string | undefined;
761
- domainName?: string | undefined;
762
- domainPrefix?: string | undefined;
763
- eventType?: string | undefined;
764
- extendedRequestId?: string | undefined;
765
- protocol: string;
766
- httpMethod: string;
767
- identity: APIGatewayEventIdentity;
768
- messageDirection?: string | undefined;
769
- messageId?: string | null | undefined;
770
- path: string;
771
- stage: string;
772
- requestId: string;
773
- requestTime?: string | undefined;
774
- requestTimeEpoch: number;
775
- resourceId: string;
776
- resourcePath: string;
777
- routeKey?: string | undefined;
778
- }
779
- interface APIGatewayEventClientCertificate {
780
- clientCertPem: string;
781
- serialNumber: string;
782
- subjectDN: string;
783
- issuerDN: string;
784
- validity: {
785
- notAfter: string;
786
- notBefore: string;
787
- };
788
- }
789
- interface APIGatewayEventIdentity {
790
- accessKey: string | null;
791
- accountId: string | null;
792
- apiKey: string | null;
793
- apiKeyId: string | null;
794
- caller: string | null;
795
- clientCert: APIGatewayEventClientCertificate | null;
796
- cognitoAuthenticationProvider: string | null;
797
- cognitoAuthenticationType: string | null;
798
- cognitoIdentityId: string | null;
799
- cognitoIdentityPoolId: string | null;
800
- principalOrgId: string | null;
801
- sourceIp: string;
802
- user: string | null;
803
- userAgent: string | null;
804
- userArn: string | null;
805
- vpcId?: string | undefined;
806
- vpceId?: string | undefined;
807
- }
808
- //#endregion
809
- //#region ../../node_modules/.pnpm/@types+aws-lambda@8.10.161/node_modules/@types/aws-lambda/handler.d.ts
810
- /**
811
- * {@link Handler} context parameter.
812
- * See {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html AWS documentation}.
813
- */
814
- interface Context {
815
- callbackWaitsForEmptyEventLoop: boolean;
816
- functionName: string;
817
- functionVersion: string;
818
- invokedFunctionArn: string;
819
- memoryLimitInMB: string;
820
- awsRequestId: string;
821
- logGroupName: string;
822
- logStreamName: string;
823
- identity?: CognitoIdentity | undefined;
824
- clientContext?: ClientContext | undefined;
825
- tenantId?: string | undefined;
826
- getRemainingTimeInMillis(): number; // Functions for compatibility with earlier Node.js Runtime v0.10.42
827
- // No longer documented, so they are deprecated, but they still work
828
- // as of the 12.x runtime, so they are not removed from the types.
829
- /** @deprecated Use handler callback or promise result */
830
- done(error?: Error, result?: any): void;
831
- /** @deprecated Use handler callback with first argument or reject a promise result */
832
- fail(error: Error | string): void;
833
- /** @deprecated Use handler callback with second argument or resolve a promise result */
834
- succeed(messageOrObject: any): void; // Unclear what behavior this is supposed to have, I couldn't find any still extant reference,
835
- // and it behaves like the above, ignoring the object parameter.
836
- /** @deprecated Use handler callback or promise result */
837
- succeed(message: string, object: any): void;
838
- }
839
- interface CognitoIdentity {
840
- cognitoIdentityId: string;
841
- cognitoIdentityPoolId: string;
842
- }
843
- interface ClientContext {
844
- client: ClientContextClient;
845
- custom?: any;
846
- env: ClientContextEnv;
847
- }
848
- interface ClientContextClient {
849
- installationId: string;
850
- appTitle: string;
851
- appVersionName: string;
852
- appVersionCode: string;
853
- appPackageName: string;
854
- }
855
- interface ClientContextEnv {
856
- platformVersion: string;
857
- platform: string;
858
- make: string;
859
- model: string;
860
- locale: string;
861
- }
862
- /**
863
- * Interface for using response streaming from AWS Lambda.
864
- * To indicate to the runtime that Lambda should stream your function’s responses, you must wrap your function handler with the `awslambda.streamifyResponse()` decorator.
865
- *
866
- * The `streamifyResponse` decorator accepts the following additional parameter, `responseStream`, besides the default node handler parameters, `event`, and `context`.
867
- * The new `responseStream` object provides a stream object that your function can write data to. Data written to this stream is sent immediately to the client. You can optionally set the Content-Type header of the response to pass additional metadata to your client about the contents of the stream.
868
- *
869
- * {@link https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/ AWS blog post}
870
- * {@link https://docs.aws.amazon.com/lambda/latest/dg/config-rs-write-functions.html AWS documentation}
871
- *
872
- * @example <caption>Writing to the response stream</caption>
873
- * import 'aws-lambda';
874
- *
875
- * export const handler = awslambda.streamifyResponse(
876
- * async (event, responseStream, context) => {
877
- * responseStream.setContentType("text/plain");
878
- * responseStream.write("Hello, world!");
879
- * responseStream.end();
880
- * }
881
- * );
882
- *
883
- * @example <caption>Using pipeline</caption>
884
- * import 'aws-lambda';
885
- * import { Readable } from 'stream';
886
- * import { pipeline } from 'stream/promises';
887
- * import zlib from 'zlib';
888
- *
889
- * export const handler = awslambda.streamifyResponse(
890
- * async (event, responseStream, context) => {
891
- * // As an example, convert event to a readable stream.
892
- * const requestStream = Readable.from(Buffer.from(JSON.stringify(event)));
893
- *
894
- * await pipeline(requestStream, zlib.createGzip(), responseStream);
895
- * }
896
- * );
897
- */
898
- type StreamifyHandler<TEvent = any, TResult = any> = (event: TEvent, responseStream: awslambda.HttpResponseStream, context: Context) => TResult | Promise<TResult>;
899
- declare global {
900
- namespace awslambda {
901
- class HttpResponseStream extends Writable {
902
- static from(writable: Writable, metadata: Record<string, unknown>): HttpResponseStream;
903
- setContentType: (contentType: string) => void;
904
- }
905
- /**
906
- * Decorator for using response streaming from AWS Lambda.
907
- * To indicate to the runtime that Lambda should stream your function’s responses, you must wrap your function handler with the `awslambda.streamifyResponse()` decorator.
908
- *
909
- * The `streamifyResponse` decorator accepts the following additional parameter, `responseStream`, besides the default node handler parameters, `event`, and `context`.
910
- * The new `responseStream` object provides a stream object that your function can write data to. Data written to this stream is sent immediately to the client. You can optionally set the Content-Type header of the response to pass additional metadata to your client about the contents of the stream.
911
- *
912
- * {@link https://aws.amazon.com/blogs/compute/introducing-aws-lambda-response-streaming/ AWS blog post}
913
- * {@link https://docs.aws.amazon.com/lambda/latest/dg/config-rs-write-functions.html AWS documentation}
914
- *
915
- * @example <caption>Writing to the response stream</caption>
916
- * import 'aws-lambda';
917
- *
918
- * export const handler = awslambda.streamifyResponse(
919
- * async (event, responseStream, context) => {
920
- * responseStream.setContentType("text/plain");
921
- * responseStream.write("Hello, world!");
922
- * responseStream.end();
923
- * }
924
- * );
925
- *
926
- * @example <caption>Using pipeline</caption>
927
- * import 'aws-lambda';
928
- * import { Readable } from 'stream';
929
- * import { pipeline } from 'stream/promises';
930
- * import zlib from 'zlib';
931
- *
932
- * export const handler = awslambda.streamifyResponse(
933
- * async (event, responseStream, context) => {
934
- * // As an example, convert event to a readable stream.
935
- * const requestStream = Readable.from(Buffer.from(JSON.stringify(event)));
936
- *
937
- * await pipeline(requestStream, zlib.createGzip(), responseStream);
938
- * }
939
- * );
940
- */
941
- function streamifyResponse<TEvent = any, TResult = void>(handler: StreamifyHandler<TEvent, TResult>): StreamifyHandler<TEvent, TResult>;
942
- }
943
- }
944
- //#endregion
945
- //#region ../../node_modules/.pnpm/@types+aws-lambda@8.10.161/node_modules/@types/aws-lambda/trigger/api-gateway-proxy.d.ts
946
- /**
947
- * Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
948
- * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
949
- */
950
- type APIGatewayProxyEvent = APIGatewayProxyEventBase<APIGatewayEventDefaultAuthorizerContext>;
951
- interface APIGatewayProxyEventHeaders {
952
- [name: string]: string | undefined;
953
- }
954
- interface APIGatewayProxyEventMultiValueHeaders {
955
- [name: string]: string[] | undefined;
956
- }
957
- interface APIGatewayProxyEventPathParameters {
958
- [name: string]: string | undefined;
959
- }
960
- interface APIGatewayProxyEventQueryStringParameters {
961
- [name: string]: string | undefined;
962
- }
963
- interface APIGatewayProxyEventMultiValueQueryStringParameters {
964
- [name: string]: string[] | undefined;
965
- }
966
- interface APIGatewayProxyEventStageVariables {
967
- [name: string]: string | undefined;
968
- }
969
- interface APIGatewayProxyEventBase<TAuthorizerContext> {
970
- body: string | null;
971
- headers: APIGatewayProxyEventHeaders;
972
- multiValueHeaders: APIGatewayProxyEventMultiValueHeaders;
973
- httpMethod: string;
974
- isBase64Encoded: boolean;
975
- path: string;
976
- pathParameters: APIGatewayProxyEventPathParameters | null;
977
- queryStringParameters: APIGatewayProxyEventQueryStringParameters | null;
978
- multiValueQueryStringParameters: APIGatewayProxyEventMultiValueQueryStringParameters | null;
979
- stageVariables: APIGatewayProxyEventStageVariables | null;
980
- requestContext: APIGatewayEventRequestContextWithAuthorizer<TAuthorizerContext>;
981
- resource: string;
982
- }
983
- /**
984
- * Works with Lambda Proxy Integration for Rest API or HTTP API integration Payload Format version 1.0
985
- * @see - https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html
986
- */
987
- interface APIGatewayProxyResult {
988
- statusCode: number;
989
- headers?: {
990
- [header: string]: boolean | number | string;
991
- } | undefined;
992
- multiValueHeaders?: {
993
- [header: string]: Array<boolean | number | string>;
994
- } | undefined;
995
- body: string;
996
- isBase64Encoded?: boolean | undefined;
997
- }
998
- //#endregion
999
- //#region src/node/feedback/adapters/aws.d.ts
1000
- declare function handleAwsFeedback(event: APIGatewayProxyEvent, env?: Record<string, string | undefined>): Promise<APIGatewayProxyResult>;
1001
- //#endregion
1002
731
  //#region src/node/feedback/handler.d.ts
1003
732
  interface FeedbackHandlerOptions {
1004
733
  owner?: string;
@@ -1039,4 +768,4 @@ declare function boltdocs(options?: BoltdocsPluginOptions): Promise<Plugin[]>;
1039
768
  */
1040
769
  declare function createViteConfig(root: string, mode?: 'development' | 'production', preResolvedConfig?: BoltdocsConfig): Promise<InlineConfig>;
1041
770
  //#endregion
1042
- export { AssetCache, type BoltdocsConfig$1 as BoltdocsConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, EXIT, MDX_NODES, NodeWithHProperties, PluginCompatibilityError, PluginContext, PluginError, PluginHookError, PluginLifecycleHooks, PluginLifecycleManager, PluginLogger, PluginMeta, PluginStore, PluginValidationError, type RouteMeta, SKIP, SecureBoltdocsPlugin, addNodeClass, createMdxAttribute, createMdxElement, createPlugin, createRehypeElement, createViteConfig, boltdocs as default, defineConfig, flushCache, generateEntryCode, getNodeProperty, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, hasNodeClass, normalizePath, parseMetaString, removeNodeClass, resolveConfig, sanitizeFilename, setNodeProperty, validatePlugins, visitMdxElements, visitNodes, visitRehypeElements, visitRemarkHeadings, visitRemarkLinks };
771
+ export { AssetCache, type BoltdocsConfig, type BoltdocsPlugin, type BoltdocsPluginOptions, BoltdocsPluginStore, type BoltdocsThemeConfig, EXIT, MDX_NODES, NodeWithHProperties, PluginCompatibilityError, PluginContext, PluginError, PluginHookError, PluginLifecycleHooks, PluginLifecycleManager, PluginLogger, PluginMeta, PluginStore, PluginValidationError, type RouteMeta, SKIP, SecureBoltdocsPlugin, addNodeClass, createMdxAttribute, createMdxElement, createPlugin, createRehypeElement, createViteConfig, boltdocs as default, defineConfig, flushCache, generateEntryCode, getNodeProperty, handleAwsFeedback, handleFeedback, handleNetlifyFeedback, handleVercelFeedback, handleWebFeedback, hasNodeClass, normalizePath, parseMetaString, removeNodeClass, resolveConfig, sanitizeFilename, setNodeProperty, validatePlugins, visitMdxElements, visitNodes, visitRehypeElements, visitRemarkHeadings, visitRemarkLinks };
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- import{A as e,C as t,D as n,M as r,O as i,S as a,_ as o,a as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,j as h,k as g,l as _,m as v,n as y,o as b,p as x,r as S,s as C,t as w,u as T,v as E,w as D,x as O,y as k}from"../node-DV-EPtMU.mjs";import{f as A,u as j}from"../utils-DC4Wq-S2.mjs";import{a as M,n as N}from"../cache-DFW4R3S0.mjs";import{g as P,h as F}from"../doctor-BY1tSmQd.mjs";import{o as I,r as L}from"../shiki-adapter-F-P-lDon.mjs";import{t as R}from"../handler-DfhH9D1b.mjs";export{N as AssetCache,i as BoltdocsPluginStore,_ as EXIT,I as MDX_NODES,g as PluginCompatibilityError,e as PluginError,h as PluginHookError,D as PluginLifecycleManager,r as PluginValidationError,T as SKIP,u as addNodeClass,d as createMdxAttribute,x as createMdxElement,l as createPlugin,v as createRehypeElement,y as createViteConfig,w as default,P as defineConfig,M as flushCache,C as generateEntryCode,p as getNodeProperty,S as handleAwsFeedback,R as handleFeedback,s as handleNetlifyFeedback,b as handleVercelFeedback,m as handleWebFeedback,f as hasNodeClass,j as normalizePath,L as parseMetaString,o as removeNodeClass,F as resolveConfig,A as sanitizeFilename,E as setNodeProperty,n as validatePlugins,k as visitMdxElements,c as visitNodes,O as visitRehypeElements,a as visitRemarkHeadings,t as visitRemarkLinks};
6
+ import{C as e,D as t,E as n,O as r,T as i,_ as a,a as o,c as s,d as c,f as l,g as u,h as d,i as f,k as p,l as m,m as h,n as g,o as _,p as v,r as y,s as b,t as x,u as S,v as C,w,y as T}from"../node-FkxzriO7.mjs";import{f as E,u as D}from"../utils-DexBrwiP.mjs";import{a as O,n as k}from"../config-BCqkPkjC.mjs";import{a as A,n as j}from"../cache-CfhOTR3Q.mjs";import{o as M,r as N}from"../shiki-adapter-rQ087Lx3.mjs";import{t as P}from"../handler-CyIBbZdb.mjs";import{i as F,n as I,r as L,t as R}from"../adapters-HVuXENAe.mjs";export{j as AssetCache,w as BoltdocsPluginStore,f as EXIT,M as MDX_NODES,i as PluginCompatibilityError,n as PluginError,t as PluginHookError,T as PluginLifecycleManager,r as PluginValidationError,o as SKIP,_ as addNodeClass,b as createMdxAttribute,s as createMdxElement,y as createPlugin,m as createRehypeElement,g as createViteConfig,x as default,O as defineConfig,A as flushCache,p as generateEntryCode,S as getNodeProperty,R as handleAwsFeedback,P as handleFeedback,L as handleNetlifyFeedback,F as handleVercelFeedback,I as handleWebFeedback,c as hasNodeClass,D as normalizePath,N as parseMetaString,l as removeNodeClass,k as resolveConfig,E as sanitizeFilename,v as setNodeProperty,e as validatePlugins,h as visitMdxElements,d as visitNodes,u as visitRehypeElements,a as visitRemarkHeadings,C as visitRemarkLinks};
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- require(`../../chunk-Ds5LZdWN.cjs`);const e=require(`../../parser-C2Pw18LY.cjs`);let t=require(`node:worker_threads`);if(!t.parentPort)throw Error(`This file must be run as a worker thread.`);t.parentPort.on(`message`,async n=>{if(n.type===`PARSE_FILE`)try{let r=await e.t(n.file,n.docsDir,n.basePath,n.config);t.parentPort?.postMessage({type:`SUCCESS`,file:n.file,result:r})}catch(e){t.parentPort?.postMessage({type:`ERROR`,file:n.file,error:e.message||`Unknown parsing error`})}});
6
+ require(`../../chunk-Ds5LZdWN.cjs`);const e=require(`../../parser-CLtGv_XH.cjs`);let t=require(`node:worker_threads`);if(!t.parentPort)throw Error(`This file must be run as a worker thread.`);t.parentPort.on(`message`,async n=>{if(n.type===`PARSE_FILE`)try{let r=await e.t(n.file,n.docsDir,n.basePath,n.config);t.parentPort?.postMessage({type:`SUCCESS`,file:n.file,result:r})}catch(e){t.parentPort?.postMessage({type:`ERROR`,file:n.file,error:e.message||`Unknown parsing error`})}});
@@ -3,4 +3,4 @@
3
3
  * Copyright (c) 2026 Jesus Alcala
4
4
  * Licensed under the MIT License.
5
5
  */
6
- import{n as e}from"../../parser-DScG_PTs.mjs";import{parentPort as t}from"node:worker_threads";if(!t)throw Error(`This file must be run as a worker thread.`);t.on(`message`,async n=>{if(n.type===`PARSE_FILE`)try{let r=await e(n.file,n.docsDir,n.basePath,n.config);t?.postMessage({type:`SUCCESS`,file:n.file,result:r})}catch(e){t?.postMessage({type:`ERROR`,file:n.file,error:e.message||`Unknown parsing error`})}});export{};
6
+ import{n as e}from"../../parser-8u0xHVc7.mjs";import{parentPort as t}from"node:worker_threads";if(!t)throw Error(`This file must be run as a worker thread.`);t.on(`message`,async n=>{if(n.type===`PARSE_FILE`)try{let r=await e(n.file,n.docsDir,n.basePath,n.config);t?.postMessage({type:`SUCCESS`,file:n.file,result:r})}catch(e){t?.postMessage({type:`ERROR`,file:n.file,error:e.message||`Unknown parsing error`})}});export{};
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ const e=require(`./chunk-Ds5LZdWN.cjs`),t=require(`./utils-BWy_8ASj.cjs`),n=require(`./config-D7ERJhqe.cjs`),r=require(`./types-generator-BqNKCbrx.cjs`),i=require(`./routes-CyKj3dzf.cjs`),a=require(`./shiki-adapter-BB71nVsG.cjs`);let o=require(`node:path`);o=e.n(o);let s=require(`node:fs`);s=e.n(s);let c=require(`zod`),l=require(`@bdocs/dui`);l=e.n(l);let u=require(`semver`);u=e.n(u);let d=require(`@bdocs/ssg/node`),f=require(`unist-util-visit`);function p(e,n){let r=o.default.resolve(process.cwd(),`index.css`),i=s.default.existsSync(r)?`import './index.css';`:``,a=n?.plugins?.flatMap(e=>Object.entries(e.components||{}))||[],c=a.map(([e,n])=>`import * as _comp_${e} from '${t.u(n)}';
7
+ const ${e} = _comp_${e}.default || _comp_${e}['${e}'] || _comp_${e};`).join(`
8
+ `),l=a.map(([e])=>e).join(`, `),u=o.default.basename(e.docsDir||`docs`),d=o.default.resolve(process.cwd(),e.docsDir||`docs`),f=[`tsx`,`ts`,`jsx`,`js`].map(e=>o.default.resolve(d,`pages-external/index.${e}`)).find(e=>s.default.existsSync(e)),p=f?`import * as _external_module from '${t.u(f)}';`:``,m=f?`externalPages: _external_module.pages, externalLayout: _external_module.layout,`:``,h=process.env.VITE_SSG===`true`,g=h?`{ eager: true }`:`{}`,_=h?``:`
9
+ if (typeof window !== 'undefined') {
10
+ const prefetchAll = () => {
11
+ const getters = Object.values(mdxModules)
12
+ if (getters.length === 0) return
13
+ let i = 0
14
+ const nextBatch = () => {
15
+ if (i >= getters.length) return
16
+ const batch = getters.slice(i, i + 6)
17
+ i += batch.length
18
+ Promise.allSettled(batch.map(fn => fn())).then(() => {
19
+ setTimeout(nextBatch, 0)
20
+ })
21
+ }
22
+ ;(typeof requestIdleCallback === 'function' ? requestIdleCallback : function(cb) { setTimeout(cb, 500) })(nextBatch)
23
+ }
24
+ prefetchAll()
25
+ }
26
+ `;return`
27
+ import { ViteReactSSG, createRoutes } from 'boltdocs/client'
28
+ import _routes from 'virtual:boltdocs-routes.ts'
29
+ import _collections from 'virtual:boltdocs-collections.ts'
30
+ import _config from 'virtual:boltdocs-config.ts'
31
+ import _user_mdx_components from 'virtual:boltdocs-mdx-components.tsx'
32
+ ${i}
33
+ ${c}
34
+ ${p}
35
+
36
+ const mdxModules = import.meta.glob('/${u}/**/*.{md,mdx}', ${g});
37
+
38
+ const _collLayoutMods = import.meta.glob('${`/${u}/**/layout.tsx`}', { eager: true });
39
+ const _collListMods = import.meta.glob('${`/${u}/**/list.tsx`}', { eager: true });
40
+ const _collPostMods = import.meta.glob('${`/${u}/**/post.tsx`}', { eager: true });
41
+
42
+ const _collectionLayouts = {};
43
+ for (const [p, mod] of Object.entries(_collLayoutMods)) {
44
+ const dir = p.split('/').slice(-2, -1)[0];
45
+ if (dir.startsWith('[') && dir.endsWith(']')) {
46
+ _collectionLayouts[dir.slice(1, -1)] = mod.default || mod;
47
+ }
48
+ }
49
+
50
+ const _collectionLists = {};
51
+ for (const [p, mod] of Object.entries(_collListMods)) {
52
+ const dir = p.split('/').slice(-2, -1)[0];
53
+ if (dir.startsWith('[') && dir.endsWith(']')) {
54
+ _collectionLists[dir.slice(1, -1)] = mod.default || mod;
55
+ }
56
+ }
57
+
58
+ const _collectionPosts = {};
59
+ for (const [p, mod] of Object.entries(_collPostMods)) {
60
+ const dir = p.split('/').slice(-2, -1)[0];
61
+ if (dir.startsWith('[') && dir.endsWith(']')) {
62
+ _collectionPosts[dir.slice(1, -1)] = mod.default || mod;
63
+ }
64
+ }
65
+
66
+ export const createRoot = ViteReactSSG(
67
+ {
68
+ routes: createRoutes({
69
+ routesData: _routes,
70
+ collectionsData: _collections,
71
+ collectionLayouts: _collectionLayouts,
72
+ collectionLists: _collectionLists,
73
+ collectionPosts: _collectionPosts,
74
+ config: _config,
75
+ mdxModules,
76
+ ${m}
77
+ components: { ${l}${l?`, `:``} ...(_user_mdx_components || {}) },
78
+ }),
79
+ },
80
+ ({ isClient }) => {
81
+ // Boltdocs initialization hook
82
+ if (isClient) {
83
+ // Client-side initialization
84
+ }
85
+ },
86
+ );
87
+ ${_}
88
+ `}var m=class extends Error{name=this.constructor.name;constructor(e,t,n){super(`[plugin:${e}] ${t}`,n),this.pluginName=e}},h=class extends m{constructor(e,t){super(e,`Validation failed: ${t}`)}},g=class extends m{constructor(e,t){super(e,`Compatibility error: ${t}`)}},_=class extends m{constructor(e,t,n){super(e,`Error in hook '${t}': ${n.message}`,{cause:n}),this.hookName=t}},v=class{data=new Map;getNamespaceKey(e,t){return`${e}:${t}`}get(e,t){let n=this.getNamespaceKey(e,t),r=this.data.get(n);if(r!==void 0)return typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r}set(e,t,n){let r=this.getNamespaceKey(e,t),i=typeof n==`object`&&n?JSON.parse(JSON.stringify(n)):n;this.data.set(r,i)}has(e,t){let n=this.getNamespaceKey(e,t);return this.data.has(n)}};const y=n.i.extend({version:c.z.string().optional(),boltdocsVersion:c.z.string().optional(),hooks:c.z.object({beforeBuild:c.z.function().optional(),afterBuild:c.z.function().optional(),beforeDev:c.z.function().optional(),afterDev:c.z.function().optional(),buildEnd:c.z.function().optional(),transformSource:c.z.function().optional(),transformMdx:c.z.function().optional(),transformHtml:c.z.function().optional()}).optional()});function b(e,t){let n=[],r=new Set;for(let i of e){let e=y.safeParse(i);if(!e.success)throw new h(i.name||`unknown`,e.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `));let a=e.data;if(r.has(a.name))throw new h(a.name,`Duplicate plugin name detected`);if(r.add(a.name),a.boltdocsVersion&&!u.default.satisfies(t,a.boltdocsVersion))throw new g(a.name,`Plugin expects Boltdocs version ${a.boltdocsVersion}, but current is ${t}`);if(a.components){for(let[e,t]of Object.entries(a.components))if((t.includes(`..`)||o.default.isAbsolute(t))&&t.includes(`..`))throw new h(a.name,`Component '${e}' has an invalid path: traversal sequences are not allowed.`)}n.push(a)}return n}function x(e,t=process.cwd()){let n=e.plugins||[];for(let e of n)if(e.name)try{let n=null;try{let{createRequire:r}=require(`node:module`);n=r(o.default.resolve(t,`package.json`)).resolve(`${e.name}/package.json`)}catch{let r=o.default.resolve(t,`node_modules`,e.name,`package.json`);s.default.existsSync(r)&&(n=r)}if(n&&s.default.existsSync(n)){let t=JSON.parse(s.default.readFileSync(n,`utf-8`)).scripts||{};(t.preinstall||t.postinstall||t.install)&&(0,l.warn)(`💡 ${l.colors.yellow(l.colors.bold(`Nota de seguridad:`))} El plugin ${l.colors.cyan(e.name)} ejecuta scripts nativos al instalarse. Corre ${l.colors.bold(`boltdocs audit`)} para un análisis detallado.`)}}catch{}}var S=class{name=`ConfigResolve`;async execute(e){e.config=await n.n(`docs`,e.root),x(e.config,e.root),e.viteConfig=await X(e.root,`production`)}};function C(e){return e.map(e=>({path:e.path,filePath:e.filePath,title:e.title,description:e.description||``,sidebarPosition:e.sidebarPosition,badge:e.badge,icon:e.icon,headings:e.headings||[],_content:e._content||``,_rawContent:e._rawContent||``,locale:e.locale,version:e.version,tab:e.tab,collection:e.collection,tags:e.tags,author:e.author,draft:e.draft,excerpt:e.excerpt,coverImage:e.coverImage,group:e.group,groupTitle:e.groupTitle,groupPosition:e.groupPosition,groupIcon:e.groupIcon,subRouteGroup:e.subRouteGroup,seo:e.seo,date:e.date,lastUpdated:e.lastUpdated,category:e.category,order:e.order,sidebarLabel:e.sidebarLabel,sidebarHidden:e.sidebarHidden,frontmatter:e.frontmatter,slugParts:e.slugParts}))}var w=class{name=`RouteGenerate`;async execute(e){if(!e.config)throw Error(`Config not resolved. Run ConfigResolve first.`);let t=o.default.resolve(e.root,`docs`),n=e.viteConfig?.base||e.config.base||`/docs`;e.routes=[...await i.t(t,e.config,n)],e.ssgRoutes=C(e.routes)}};const T=c.z.object({title:c.z.string().optional(),description:c.z.string().optional(),canonical:c.z.string().url().optional(),robots:c.z.string().optional(),noindex:c.z.boolean().optional(),"og:title":c.z.string().optional(),"og:description":c.z.string().optional(),"og:image":c.z.string().optional(),"og:type":c.z.string().optional(),"og:url":c.z.string().url().optional()});var E=class{name=`SEOValidate`;async execute(e){if(!e.routes||!e.config)throw Error(`Routes or Config not initialized.`);let t=e.config.siteUrl;e.routes=e.routes.map(e=>{let n=e.seo||{},r=n.canonical||(t?`${t.replace(/\/$/,``)}${e.path}`:void 0),i=n[`og:url`]||r||void 0,a={...n};r&&(a.canonical=r),i&&(a[`og:url`]=i),!a[`og:title`]&&e.title&&(a[`og:title`]=e.title),!a[`og:description`]&&e.description&&(a[`og:description`]=e.description);let o=T.safeParse(a);return o.success||(0,l.warn)(`[SEOValidate] Validation issues on route "${e.path}":`,o.error.message),e.title||(0,l.warn)(`[SEOValidate] Route "${e.path}" is missing a title.`),{...e,seo:a}}),e.ssgRoutes=C(e.routes)}},D=class{name=`TypeGenerate`;async execute(e){if(!e.config||!e.routes)throw Error(`Config or Routes not initialized.`);let t=o.default.resolve(e.root,`docs`),n=e.routes.map(e=>e.path),i=(e.config.base||`/docs`).replace(/\/$/,``);n.includes(i)||n.push(i),r.t(e.config,t,e.root,n),r.r(n)}},O=class{name=`SSGBuild`;async execute(e){if(!e.routes||!e.viteConfig)throw Error(`Routes or ViteConfig not initialized.`);let t={};for(let n of e.routes)if(n.path&&n.componentPath){t[n.path]=n.componentPath;let e=n.path.replace(/\/$/,``);t[e]=n.componentPath}await(0,d.build)({entry:`boltdocs/entry`,routeToSourceFileMap:t,cacheDir:o.default.resolve(e.root,`.boltdocs/build`)},e.viteConfig),e.outDir=e.viteConfig.build?.outDir||`dist`}};function k(e,n){let r=(n.siteUrl||``).replace(/\/$/,``);if(!r)return``;let i=n.seo?.indexing!==`all`&&n.seo?.indexing!==`public`;return`<?xml version="1.0" encoding="UTF-8"?>
89
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
90
+ ${e.filter(e=>e.seo?.noindex||typeof e.seo?.robots==`string`&&e.seo.robots.includes(`noindex`)?!1:(i&&e.seo?.index,!0)).map(e=>` <url>
91
+ <loc>${t.r(`${r}${e.path.startsWith(`/`)?e.path:`/${e.path}`}`)}</loc>
92
+ <changefreq>weekly</changefreq>
93
+ <priority>0.7</priority>
94
+ </url>`).join(`
95
+ `)}
96
+ </urlset>`}function A(e){let t=e.siteUrl||``,n=t?`${t.replace(/\/$/,``)}/sitemap.xml`:``;if(e.seo?.indexing!==`all`&&e.seo?.indexing!==`public`&&e.seo?.indexing)return[`User-agent: *`,`Disallow: /`].filter(Boolean).join(`
97
+ `);if(typeof e.robots==`string`)return e.robots;if(e.robots&&typeof e.robots==`object`){let t=e.robots.rules||[],r=e.robots.sitemaps||[],i=t.map(e=>{let t=`User-agent: ${e.userAgent}\n`;return e.allow&&(Array.isArray(e.allow)?t+=e.allow.map(e=>`Allow: ${e}`).join(`
98
+ `)+`
99
+ `:t+=`Allow: ${e.allow}\n`),e.disallow&&(Array.isArray(e.disallow)?t+=e.disallow.map(e=>`Disallow: ${e}`).join(`
100
+ `)+`
101
+ `:t+=`Disallow: ${e.disallow}\n`),t.trim()}).join(`
102
+
103
+ `),a=[...n?[n]:[],...r].map(e=>`Sitemap: ${e}`).join(`
104
+ `);return`${i}${a?`\n\n${a}`:``}`}return[`User-agent: *`,`Allow: /`,``,n?`Sitemap: ${n}`:``].filter(Boolean).join(`
105
+ `)}var j=class{name=`SEOWrite`;async execute(e){if(!e.ssgRoutes||!e.config||!e.outDir)throw Error(`SSG Routes, Config, or OutDir not initialized.`);let t=k(e.ssgRoutes,e.config),n=o.default.resolve(e.root,e.outDir);t&&s.default.writeFileSync(o.default.join(n,`sitemap.xml`),t,`utf-8`);let r=A(e.config);s.default.writeFileSync(o.default.join(n,`robots.txt`),r,`utf-8`)}};function M(){return new N().addStep(new S).addStep(new w).addStep(new E).addStep(new D).addStep(new O).addStep(new j)}var N=class{steps=[];addStep(e){return this.steps.push(e),this}async run(e){let t=[],n=performance.now(),r={...e,timing:{}};for(let e of this.steps){let i=performance.now();try{await e.execute(r);let n=performance.now()-i;t.push({name:e.name,duration:n,success:!0}),r.timing[e.name]=n}catch(a){let o=performance.now()-i;t.push({name:e.name,duration:o,success:!1,error:a instanceof Error?a:Error(String(a))});for(let e of t.filter(e=>e.success).reverse()){let t=this.steps.find(t=>t.name===e.name);if(t?.rollback)try{await t.rollback(r)}catch(t){console.error(`[pipeline] rollback failed for step "${e.name}":`,t)}}let s=performance.now()-n;return{success:!1,failedStep:e.name,error:a instanceof Error?a:Error(String(a)),timing:{total:s,steps:r.timing},stepResults:t}}}return{success:!0,timing:{total:performance.now()-n,steps:r.timing},stepResults:t}}},P=class{plugins;config;store;docsDir;rootDir;constructor(e,t,n,r){this.plugins=e,this.config=t,this.store=new v,this.docsDir=n||process.cwd(),this.rootDir=r||process.cwd()}async runHook(e,...t){let n=this.getSortedPlugins(),r=new N;for(let i of n)i.hooks?.[e]&&r.addStep(this.createStep(i,e,t));await r.run({})}async runChain(e,t){let n=this.getSortedPlugins(),r=t;for(let t of n){if(!t.hooks?.[e])continue;let n=this.createContext(t);try{let i=t.hooks[e],a=await i(n,r);a!==void 0&&(r=a)}catch(r){let i=new _(t.name,e,r instanceof Error?r:Error(String(r)));n.logger.error(i)}}return r}getSortedPlugins(){let e=this.plugins.filter(e=>e.enforce===`pre`),t=this.plugins.filter(e=>!e.enforce),n=this.plugins.filter(e=>e.enforce===`post`);return[...e,...t,...n]}createStep(e,t,n){return{name:`${e.name}:${String(t)}`,execute:async()=>{let r=this.createContext(e);try{let i=e.hooks[t];await i(r,...n)}catch(n){let i=new _(e.name,t,n instanceof Error?n:Error(String(n)));r.logger.error(i)}},rollback:async()=>{let t=e.hooks?.buildEnd;if(t){let n=this.createContext(e);try{await t(n)}catch{}}}}}createContext(e){return{config:Object.freeze({...this.config}),docsDir:this.docsDir,rootDir:this.rootDir,meta:{name:e.name,version:e.version,boltdocsVersion:e.boltdocsVersion},store:{get:(e,t)=>this.store.get(e,t),set:(e,t,n)=>this.store.set(e,t,n),has:(e,t)=>this.store.has(e,t)},logger:this.createLogger(e.name)}}createLogger(e){let t=`[plugin:${e}]`;return{info:e=>l.info(`${t} ${e}`),warn:e=>l.warn(`${t} ${e}`),error:e=>{l.error(`${t} ${e instanceof Error?e.message:e}`)},debug:e=>l.debug(`${t} ${e}`)}}};function F(e,t,n){e&&(0,f.visit)(e,typeof t==`function`?t:e=>Array.isArray(t)?t.includes(e.type):e.type===t,(e,t,r)=>{if(t!==void 0&&r!==void 0)return n(e,t,r)})}function I(e,t,n){F(e,a.o.ELEMENT,(e,r,i)=>{if(e.tagName===t)return n(e,r,i)})}function L(e,t,n){let r=Array.isArray(t)?t:[t],i=[a.o.JSX_FLOW_ELEMENT,a.o.JSX_TEXT_ELEMENT];F(e,e=>i.includes(e.type),(e,t,i)=>{if(e.name&&r.includes(e.name))return n(e,t,i)})}function R(e,t,n){e&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties[t]=n)}function z(e,t){return e?.data?.hProperties?.[t]}function B(e,t){return typeof t==`object`&&t?{type:a.o.JSX_ATTRIBUTE,name:e,value:t}:{type:a.o.JSX_ATTRIBUTE,name:e,value:String(t)}}function V(e,t={},n=[]){return{type:a.o.ELEMENT,tagName:e,properties:t,children:n}}function H(e,t={},n=[],r=!0){let i=Object.entries(t).map(([e,t])=>B(e,t));return{type:r?a.o.JSX_FLOW_ELEMENT:a.o.JSX_TEXT_ELEMENT,name:e,attributes:i,children:n}}function U(e,t){e&&(0,f.visit)(e,a.o.HEADING,(e,n,r)=>{if(n!==void 0&&r!==void 0)return t(e,n,r)})}function W(e,t){e&&(0,f.visit)(e,a.o.LINK,(e,n,r)=>{if(n!==void 0&&r!==void 0)return t(e,n,r)})}function G(e,t){if(!e)return;e.properties=e.properties||{};let n=e.properties.className;Array.isArray(n)?n.includes(t)||n.push(t):typeof n==`string`?n!==t&&(e.properties.className=[n,t]):e.properties.className=[t]}function K(e,t){if(!e||!e.properties||!e.properties.className)return;let n=e.properties.className;Array.isArray(n)?e.properties.className=n.filter(e=>e!==t):typeof n==`string`&&n===t&&delete e.properties.className}function q(e,t){if(!e||!e.properties||!e.properties.className)return!1;let n=e.properties.className;return Array.isArray(n)?n.includes(t):typeof n==`string`?n===t:!1}function J(e){return e}async function Y(e){let{resolveConfig:t}=await Promise.resolve().then(()=>require(`./config-CnmfjOE4.cjs`)),{generateRoutes:n}=await Promise.resolve().then(()=>require(`./routes-B2joDAlC.cjs`)),{generateProjectTypes:r,writeLinkTree:i}=await Promise.resolve().then(()=>require(`./types-generator-BqNKCbrx.cjs`)).then(e=>e.n),{boltdocsPlugin:a}=await Promise.resolve().then(()=>require(`./plugin-Dqj9plKB.cjs`)),o=e?.docsDir||`docs`,s=await t(o),c=(await n(o,s)).map(e=>e.path),l=(s.base||`/docs`).replace(/\/$/,``);return c.includes(l)||c.push(l),r(s,o,void 0,c),i(c),a({...e},s)}async function X(e,t=`development`,n){let[r,i,{boltdocsPlugin:a,getExternalAbsolutePaths:s},{SECURITY_HEADERS:c},{getCSPHeader:l},{resolveConfig:u},{generateRoutes:d},{generateProjectTypes:f,writeLinkTree:p},{normalizePath:m}]=await Promise.all([import(`@vitejs/plugin-react`),import(`@tailwindcss/vite`),Promise.resolve().then(()=>require(`./plugin-Dqj9plKB.cjs`)),Promise.resolve().then(()=>require(`./headers-DuCAOgYX.cjs`)).then(e=>e.n),Promise.resolve().then(()=>require(`./csp-DbbF3R9Q.cjs`)).then(e=>e.t),Promise.resolve().then(()=>require(`./config-CnmfjOE4.cjs`)),Promise.resolve().then(()=>require(`./routes-B2joDAlC.cjs`)),Promise.resolve().then(()=>require(`./types-generator-BqNKCbrx.cjs`)).then(e=>e.n),import(`vite`).then(e=>({normalizePath:e.normalizePath}))]),h=r.default,g=i.default,_=n||await u(`docs`,e),v=(await d(`docs`,_)).map(e=>e.path),y=(_.base||`/docs`).replace(/\/$/,``);v.includes(y)||v.push(y),f(_,`docs`,e,v),p(v);let b=t===`production`,x=b?{...c}:{};return _.security?.enableCSP&&(x[`Content-Security-Policy`]=l(_)),{root:e,mode:t,oxc:{jsx:{development:!b,runtime:`automatic`,importSource:`react`}},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-helmet-async`,`react-router-dom`,`react-fast-compare`,`invariant`,`use-sync-external-store/shim`]},build:{},plugins:[h(),g(),...a({docsDir:`docs`,root:e},_)],resolve:{alias:[{find:`boltdocs/entry`,replacement:m(o.default.resolve(e,`boltdocs-entry.tsx`))},{find:`boltdocs/client`,replacement:m(o.default.resolve(e,`boltdocs-client.mjs`))},{find:`use-sync-external-store/shim/index.js`,replacement:`react`},{find:`use-sync-external-store/shim`,replacement:`react`},{find:`use-sync-external-store`,replacement:`react`},{find:`@`,replacement:m(o.default.resolve(e,`../packages/core/src`))}],dedupe:[`react`,`react-dom`]},ssr:{external:[`react`,`react-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...s()],optimizeDeps:{include:[`react`,`react-dom`,`react-fast-compare`,`invariant`,..._.vite?.ssr?.optimizeDeps?.include||[]]},noExternal:[`boltdocs`,/@bdocs\/(?!ssg).*/,`react-aria-components`,`@react-aria/collections`,`@react-aria/utils`,`react-router-dom`]},server:{headers:{...x,..._.vite?.server?.headers},..._.vite?.server},preview:{headers:{...x,..._.vite?.preview?.headers},..._.vite?.preview},..._.vite}}Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`D`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`E`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return C}});
@@ -0,0 +1,105 @@
1
+ /**
2
+ * Boltdocs - https://boltdocs.vercel.app
3
+ * Copyright (c) 2026 Jesus Alcala
4
+ * Licensed under the MIT License.
5
+ */
6
+ import{r as e,u as t}from"./utils-DexBrwiP.mjs";import{i as n,n as r}from"./config-BCqkPkjC.mjs";import{n as i,t as a}from"./types-generator-BRyf4o9F.mjs";import{t as o}from"./routes-Bm0CQvyL.mjs";import{o as s}from"./shiki-adapter-rQ087Lx3.mjs";import{createRequire as c}from"node:module";import l from"node:path";import u from"node:fs";import{z as d}from"zod";import*as f from"@bdocs/dui";import{colors as p,warn as m}from"@bdocs/dui";import h from"semver";import{build as g}from"@bdocs/ssg/node";import{EXIT as _,SKIP as v,visit as y}from"unist-util-visit";var b=Object.defineProperty,x=(e,t)=>{let n={};for(var r in e)b(n,r,{get:e[r],enumerable:!0});return t||b(n,Symbol.toStringTag,{value:`Module`}),n},S=c(import.meta.url);function C(e,n){let r=l.resolve(process.cwd(),`index.css`),i=u.existsSync(r)?`import './index.css';`:``,a=n?.plugins?.flatMap(e=>Object.entries(e.components||{}))||[],o=a.map(([e,n])=>`import * as _comp_${e} from '${t(n)}';
7
+ const ${e} = _comp_${e}.default || _comp_${e}['${e}'] || _comp_${e};`).join(`
8
+ `),s=a.map(([e])=>e).join(`, `),c=l.basename(e.docsDir||`docs`),d=l.resolve(process.cwd(),e.docsDir||`docs`),f=[`tsx`,`ts`,`jsx`,`js`].map(e=>l.resolve(d,`pages-external/index.${e}`)).find(e=>u.existsSync(e)),p=f?`import * as _external_module from '${t(f)}';`:``,m=f?`externalPages: _external_module.pages, externalLayout: _external_module.layout,`:``,h=process.env.VITE_SSG===`true`,g=h?`{ eager: true }`:`{}`,_=h?``:`
9
+ if (typeof window !== 'undefined') {
10
+ const prefetchAll = () => {
11
+ const getters = Object.values(mdxModules)
12
+ if (getters.length === 0) return
13
+ let i = 0
14
+ const nextBatch = () => {
15
+ if (i >= getters.length) return
16
+ const batch = getters.slice(i, i + 6)
17
+ i += batch.length
18
+ Promise.allSettled(batch.map(fn => fn())).then(() => {
19
+ setTimeout(nextBatch, 0)
20
+ })
21
+ }
22
+ ;(typeof requestIdleCallback === 'function' ? requestIdleCallback : function(cb) { setTimeout(cb, 500) })(nextBatch)
23
+ }
24
+ prefetchAll()
25
+ }
26
+ `;return`
27
+ import { ViteReactSSG, createRoutes } from 'boltdocs/client'
28
+ import _routes from 'virtual:boltdocs-routes.ts'
29
+ import _collections from 'virtual:boltdocs-collections.ts'
30
+ import _config from 'virtual:boltdocs-config.ts'
31
+ import _user_mdx_components from 'virtual:boltdocs-mdx-components.tsx'
32
+ ${i}
33
+ ${o}
34
+ ${p}
35
+
36
+ const mdxModules = import.meta.glob('/${c}/**/*.{md,mdx}', ${g});
37
+
38
+ const _collLayoutMods = import.meta.glob('${`/${c}/**/layout.tsx`}', { eager: true });
39
+ const _collListMods = import.meta.glob('${`/${c}/**/list.tsx`}', { eager: true });
40
+ const _collPostMods = import.meta.glob('${`/${c}/**/post.tsx`}', { eager: true });
41
+
42
+ const _collectionLayouts = {};
43
+ for (const [p, mod] of Object.entries(_collLayoutMods)) {
44
+ const dir = p.split('/').slice(-2, -1)[0];
45
+ if (dir.startsWith('[') && dir.endsWith(']')) {
46
+ _collectionLayouts[dir.slice(1, -1)] = mod.default || mod;
47
+ }
48
+ }
49
+
50
+ const _collectionLists = {};
51
+ for (const [p, mod] of Object.entries(_collListMods)) {
52
+ const dir = p.split('/').slice(-2, -1)[0];
53
+ if (dir.startsWith('[') && dir.endsWith(']')) {
54
+ _collectionLists[dir.slice(1, -1)] = mod.default || mod;
55
+ }
56
+ }
57
+
58
+ const _collectionPosts = {};
59
+ for (const [p, mod] of Object.entries(_collPostMods)) {
60
+ const dir = p.split('/').slice(-2, -1)[0];
61
+ if (dir.startsWith('[') && dir.endsWith(']')) {
62
+ _collectionPosts[dir.slice(1, -1)] = mod.default || mod;
63
+ }
64
+ }
65
+
66
+ export const createRoot = ViteReactSSG(
67
+ {
68
+ routes: createRoutes({
69
+ routesData: _routes,
70
+ collectionsData: _collections,
71
+ collectionLayouts: _collectionLayouts,
72
+ collectionLists: _collectionLists,
73
+ collectionPosts: _collectionPosts,
74
+ config: _config,
75
+ mdxModules,
76
+ ${m}
77
+ components: { ${s}${s?`, `:``} ...(_user_mdx_components || {}) },
78
+ }),
79
+ },
80
+ ({ isClient }) => {
81
+ // Boltdocs initialization hook
82
+ if (isClient) {
83
+ // Client-side initialization
84
+ }
85
+ },
86
+ );
87
+ ${_}
88
+ `}var w=class extends Error{name=this.constructor.name;constructor(e,t,n){super(`[plugin:${e}] ${t}`,n),this.pluginName=e}},T=class extends w{constructor(e,t){super(e,`Validation failed: ${t}`)}},E=class extends w{constructor(e,t){super(e,`Compatibility error: ${t}`)}},D=class extends w{constructor(e,t,n){super(e,`Error in hook '${t}': ${n.message}`,{cause:n}),this.hookName=t}},O=class{data=new Map;getNamespaceKey(e,t){return`${e}:${t}`}get(e,t){let n=this.getNamespaceKey(e,t),r=this.data.get(n);if(r!==void 0)return typeof r==`object`&&r?JSON.parse(JSON.stringify(r)):r}set(e,t,n){let r=this.getNamespaceKey(e,t),i=typeof n==`object`&&n?JSON.parse(JSON.stringify(n)):n;this.data.set(r,i)}has(e,t){let n=this.getNamespaceKey(e,t);return this.data.has(n)}};const k=n.extend({version:d.string().optional(),boltdocsVersion:d.string().optional(),hooks:d.object({beforeBuild:d.function().optional(),afterBuild:d.function().optional(),beforeDev:d.function().optional(),afterDev:d.function().optional(),buildEnd:d.function().optional(),transformSource:d.function().optional(),transformMdx:d.function().optional(),transformHtml:d.function().optional()}).optional()});function A(e,t){let n=[],r=new Set;for(let i of e){let e=k.safeParse(i);if(!e.success)throw new T(i.name||`unknown`,e.error.issues.map(e=>`${e.path.join(`.`)}: ${e.message}`).join(`, `));let a=e.data;if(r.has(a.name))throw new T(a.name,`Duplicate plugin name detected`);if(r.add(a.name),a.boltdocsVersion&&!h.satisfies(t,a.boltdocsVersion))throw new E(a.name,`Plugin expects Boltdocs version ${a.boltdocsVersion}, but current is ${t}`);if(a.components){for(let[e,t]of Object.entries(a.components))if((t.includes(`..`)||l.isAbsolute(t))&&t.includes(`..`))throw new T(a.name,`Component '${e}' has an invalid path: traversal sequences are not allowed.`)}n.push(a)}return n}function j(e,t=process.cwd()){let n=e.plugins||[];for(let e of n)if(e.name)try{let n=null;try{let{createRequire:r}=S(`node:module`);n=r(l.resolve(t,`package.json`)).resolve(`${e.name}/package.json`)}catch{let r=l.resolve(t,`node_modules`,e.name,`package.json`);u.existsSync(r)&&(n=r)}if(n&&u.existsSync(n)){let t=JSON.parse(u.readFileSync(n,`utf-8`)).scripts||{};(t.preinstall||t.postinstall||t.install)&&m(`💡 ${p.yellow(p.bold(`Nota de seguridad:`))} El plugin ${p.cyan(e.name)} ejecuta scripts nativos al instalarse. Corre ${p.bold(`boltdocs audit`)} para un análisis detallado.`)}}catch{}}var M=class{name=`ConfigResolve`;async execute(e){e.config=await r(`docs`,e.root),j(e.config,e.root),e.viteConfig=await $(e.root,`production`)}};function N(e){return e.map(e=>({path:e.path,filePath:e.filePath,title:e.title,description:e.description||``,sidebarPosition:e.sidebarPosition,badge:e.badge,icon:e.icon,headings:e.headings||[],_content:e._content||``,_rawContent:e._rawContent||``,locale:e.locale,version:e.version,tab:e.tab,collection:e.collection,tags:e.tags,author:e.author,draft:e.draft,excerpt:e.excerpt,coverImage:e.coverImage,group:e.group,groupTitle:e.groupTitle,groupPosition:e.groupPosition,groupIcon:e.groupIcon,subRouteGroup:e.subRouteGroup,seo:e.seo,date:e.date,lastUpdated:e.lastUpdated,category:e.category,order:e.order,sidebarLabel:e.sidebarLabel,sidebarHidden:e.sidebarHidden,frontmatter:e.frontmatter,slugParts:e.slugParts}))}var ee=class{name=`RouteGenerate`;async execute(e){if(!e.config)throw Error(`Config not resolved. Run ConfigResolve first.`);let t=l.resolve(e.root,`docs`),n=e.viteConfig?.base||e.config.base||`/docs`;e.routes=[...await o(t,e.config,n)],e.ssgRoutes=N(e.routes)}};const P=d.object({title:d.string().optional(),description:d.string().optional(),canonical:d.string().url().optional(),robots:d.string().optional(),noindex:d.boolean().optional(),"og:title":d.string().optional(),"og:description":d.string().optional(),"og:image":d.string().optional(),"og:type":d.string().optional(),"og:url":d.string().url().optional()});var F=class{name=`SEOValidate`;async execute(e){if(!e.routes||!e.config)throw Error(`Routes or Config not initialized.`);let t=e.config.siteUrl;e.routes=e.routes.map(e=>{let n=e.seo||{},r=n.canonical||(t?`${t.replace(/\/$/,``)}${e.path}`:void 0),i=n[`og:url`]||r||void 0,a={...n};r&&(a.canonical=r),i&&(a[`og:url`]=i),!a[`og:title`]&&e.title&&(a[`og:title`]=e.title),!a[`og:description`]&&e.description&&(a[`og:description`]=e.description);let o=P.safeParse(a);return o.success||m(`[SEOValidate] Validation issues on route "${e.path}":`,o.error.message),e.title||m(`[SEOValidate] Route "${e.path}" is missing a title.`),{...e,seo:a}}),e.ssgRoutes=N(e.routes)}},I=class{name=`TypeGenerate`;async execute(e){if(!e.config||!e.routes)throw Error(`Config or Routes not initialized.`);let t=l.resolve(e.root,`docs`),n=e.routes.map(e=>e.path),r=(e.config.base||`/docs`).replace(/\/$/,``);n.includes(r)||n.push(r),a(e.config,t,e.root,n),i(n)}},L=class{name=`SSGBuild`;async execute(e){if(!e.routes||!e.viteConfig)throw Error(`Routes or ViteConfig not initialized.`);let t={};for(let n of e.routes)if(n.path&&n.componentPath){t[n.path]=n.componentPath;let e=n.path.replace(/\/$/,``);t[e]=n.componentPath}await g({entry:`boltdocs/entry`,routeToSourceFileMap:t,cacheDir:l.resolve(e.root,`.boltdocs/build`)},e.viteConfig),e.outDir=e.viteConfig.build?.outDir||`dist`}};function R(t,n){let r=(n.siteUrl||``).replace(/\/$/,``);if(!r)return``;let i=n.seo?.indexing!==`all`&&n.seo?.indexing!==`public`;return`<?xml version="1.0" encoding="UTF-8"?>
89
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
90
+ ${t.filter(e=>e.seo?.noindex||typeof e.seo?.robots==`string`&&e.seo.robots.includes(`noindex`)?!1:(i&&e.seo?.index,!0)).map(t=>` <url>
91
+ <loc>${e(`${r}${t.path.startsWith(`/`)?t.path:`/${t.path}`}`)}</loc>
92
+ <changefreq>weekly</changefreq>
93
+ <priority>0.7</priority>
94
+ </url>`).join(`
95
+ `)}
96
+ </urlset>`}function z(e){let t=e.siteUrl||``,n=t?`${t.replace(/\/$/,``)}/sitemap.xml`:``;if(e.seo?.indexing!==`all`&&e.seo?.indexing!==`public`&&e.seo?.indexing)return[`User-agent: *`,`Disallow: /`].filter(Boolean).join(`
97
+ `);if(typeof e.robots==`string`)return e.robots;if(e.robots&&typeof e.robots==`object`){let t=e.robots.rules||[],r=e.robots.sitemaps||[],i=t.map(e=>{let t=`User-agent: ${e.userAgent}\n`;return e.allow&&(Array.isArray(e.allow)?t+=e.allow.map(e=>`Allow: ${e}`).join(`
98
+ `)+`
99
+ `:t+=`Allow: ${e.allow}\n`),e.disallow&&(Array.isArray(e.disallow)?t+=e.disallow.map(e=>`Disallow: ${e}`).join(`
100
+ `)+`
101
+ `:t+=`Disallow: ${e.disallow}\n`),t.trim()}).join(`
102
+
103
+ `),a=[...n?[n]:[],...r].map(e=>`Sitemap: ${e}`).join(`
104
+ `);return`${i}${a?`\n\n${a}`:``}`}return[`User-agent: *`,`Allow: /`,``,n?`Sitemap: ${n}`:``].filter(Boolean).join(`
105
+ `)}var B=class{name=`SEOWrite`;async execute(e){if(!e.ssgRoutes||!e.config||!e.outDir)throw Error(`SSG Routes, Config, or OutDir not initialized.`);let t=R(e.ssgRoutes,e.config),n=l.resolve(e.root,e.outDir);t&&u.writeFileSync(l.join(n,`sitemap.xml`),t,`utf-8`);let r=z(e.config);u.writeFileSync(l.join(n,`robots.txt`),r,`utf-8`)}};function V(){return new H().addStep(new M).addStep(new ee).addStep(new F).addStep(new I).addStep(new L).addStep(new B)}var H=class{steps=[];addStep(e){return this.steps.push(e),this}async run(e){let t=[],n=performance.now(),r={...e,timing:{}};for(let e of this.steps){let i=performance.now();try{await e.execute(r);let n=performance.now()-i;t.push({name:e.name,duration:n,success:!0}),r.timing[e.name]=n}catch(a){let o=performance.now()-i;t.push({name:e.name,duration:o,success:!1,error:a instanceof Error?a:Error(String(a))});for(let e of t.filter(e=>e.success).reverse()){let t=this.steps.find(t=>t.name===e.name);if(t?.rollback)try{await t.rollback(r)}catch(t){console.error(`[pipeline] rollback failed for step "${e.name}":`,t)}}let s=performance.now()-n;return{success:!1,failedStep:e.name,error:a instanceof Error?a:Error(String(a)),timing:{total:s,steps:r.timing},stepResults:t}}}return{success:!0,timing:{total:performance.now()-n,steps:r.timing},stepResults:t}}},U=class{plugins;config;store;docsDir;rootDir;constructor(e,t,n,r){this.plugins=e,this.config=t,this.store=new O,this.docsDir=n||process.cwd(),this.rootDir=r||process.cwd()}async runHook(e,...t){let n=this.getSortedPlugins(),r=new H;for(let i of n)i.hooks?.[e]&&r.addStep(this.createStep(i,e,t));await r.run({})}async runChain(e,t){let n=this.getSortedPlugins(),r=t;for(let t of n){if(!t.hooks?.[e])continue;let n=this.createContext(t);try{let i=t.hooks[e],a=await i(n,r);a!==void 0&&(r=a)}catch(r){let i=new D(t.name,e,r instanceof Error?r:Error(String(r)));n.logger.error(i)}}return r}getSortedPlugins(){let e=this.plugins.filter(e=>e.enforce===`pre`),t=this.plugins.filter(e=>!e.enforce),n=this.plugins.filter(e=>e.enforce===`post`);return[...e,...t,...n]}createStep(e,t,n){return{name:`${e.name}:${String(t)}`,execute:async()=>{let r=this.createContext(e);try{let i=e.hooks[t];await i(r,...n)}catch(n){let i=new D(e.name,t,n instanceof Error?n:Error(String(n)));r.logger.error(i)}},rollback:async()=>{let t=e.hooks?.buildEnd;if(t){let n=this.createContext(e);try{await t(n)}catch{}}}}}createContext(e){return{config:Object.freeze({...this.config}),docsDir:this.docsDir,rootDir:this.rootDir,meta:{name:e.name,version:e.version,boltdocsVersion:e.boltdocsVersion},store:{get:(e,t)=>this.store.get(e,t),set:(e,t,n)=>this.store.set(e,t,n),has:(e,t)=>this.store.has(e,t)},logger:this.createLogger(e.name)}}createLogger(e){let t=`[plugin:${e}]`;return{info:e=>f.info(`${t} ${e}`),warn:e=>f.warn(`${t} ${e}`),error:e=>{f.error(`${t} ${e instanceof Error?e.message:e}`)},debug:e=>f.debug(`${t} ${e}`)}}};function W(e,t,n){e&&y(e,typeof t==`function`?t:e=>Array.isArray(t)?t.includes(e.type):e.type===t,(e,t,r)=>{if(t!==void 0&&r!==void 0)return n(e,t,r)})}function G(e,t,n){W(e,s.ELEMENT,(e,r,i)=>{if(e.tagName===t)return n(e,r,i)})}function K(e,t,n){let r=Array.isArray(t)?t:[t],i=[s.JSX_FLOW_ELEMENT,s.JSX_TEXT_ELEMENT];W(e,e=>i.includes(e.type),(e,t,i)=>{if(e.name&&r.includes(e.name))return n(e,t,i)})}function q(e,t,n){e&&(e.data=e.data||{},e.data.hProperties=e.data.hProperties||{},e.data.hProperties[t]=n)}function J(e,t){return e?.data?.hProperties?.[t]}function Y(e,t){return typeof t==`object`&&t?{type:s.JSX_ATTRIBUTE,name:e,value:t}:{type:s.JSX_ATTRIBUTE,name:e,value:String(t)}}function X(e,t={},n=[]){return{type:s.ELEMENT,tagName:e,properties:t,children:n}}function Z(e,t={},n=[],r=!0){let i=Object.entries(t).map(([e,t])=>Y(e,t));return{type:r?s.JSX_FLOW_ELEMENT:s.JSX_TEXT_ELEMENT,name:e,attributes:i,children:n}}function Q(e,t){e&&y(e,s.HEADING,(e,n,r)=>{if(n!==void 0&&r!==void 0)return t(e,n,r)})}function te(e,t){e&&y(e,s.LINK,(e,n,r)=>{if(n!==void 0&&r!==void 0)return t(e,n,r)})}function ne(e,t){if(!e)return;e.properties=e.properties||{};let n=e.properties.className;Array.isArray(n)?n.includes(t)||n.push(t):typeof n==`string`?n!==t&&(e.properties.className=[n,t]):e.properties.className=[t]}function re(e,t){if(!e||!e.properties||!e.properties.className)return;let n=e.properties.className;Array.isArray(n)?e.properties.className=n.filter(e=>e!==t):typeof n==`string`&&n===t&&delete e.properties.className}function ie(e,t){if(!e||!e.properties||!e.properties.className)return!1;let n=e.properties.className;return Array.isArray(n)?n.includes(t):typeof n==`string`?n===t:!1}function ae(e){return e}async function oe(e){let{resolveConfig:t}=await import(`./config-BPWGa2W3.mjs`),{generateRoutes:n}=await import(`./routes-BTx0ngdX.mjs`),{generateProjectTypes:r,writeLinkTree:i}=await import(`./types-generator-Cu2jQP-V.mjs`),{boltdocsPlugin:a}=await import(`./plugin-CHa0IT49.mjs`),o=e?.docsDir||`docs`,s=await t(o),c=(await n(o,s)).map(e=>e.path),l=(s.base||`/docs`).replace(/\/$/,``);return c.includes(l)||c.push(l),r(s,o,void 0,c),i(c),a({...e},s)}async function $(e,t=`development`,n){let[r,i,{boltdocsPlugin:a,getExternalAbsolutePaths:o},{SECURITY_HEADERS:s},{getCSPHeader:c},{resolveConfig:u},{generateRoutes:d},{generateProjectTypes:f,writeLinkTree:p},{normalizePath:m}]=await Promise.all([import(`@vitejs/plugin-react`),import(`@tailwindcss/vite`),import(`./plugin-CHa0IT49.mjs`),import(`./headers-DBzZ9yC6.mjs`).then(e=>e.n),import(`./csp-CUAEgrxR.mjs`).then(e=>e.t),import(`./config-BPWGa2W3.mjs`),import(`./routes-BTx0ngdX.mjs`),import(`./types-generator-Cu2jQP-V.mjs`),import(`vite`).then(e=>({normalizePath:e.normalizePath}))]),h=r.default,g=i.default,_=n||await u(`docs`,e),v=(await d(`docs`,_)).map(e=>e.path),y=(_.base||`/docs`).replace(/\/$/,``);v.includes(y)||v.push(y),f(_,`docs`,e,v),p(v);let b=t===`production`,x=b?{...s}:{};return _.security?.enableCSP&&(x[`Content-Security-Policy`]=c(_)),{root:e,mode:t,oxc:{jsx:{development:!b,runtime:`automatic`,importSource:`react`}},optimizeDeps:{include:[`react`,`react-dom`,`react-dom/client`,`react-helmet-async`,`react-router-dom`,`react-fast-compare`,`invariant`,`use-sync-external-store/shim`]},build:{},plugins:[h(),g(),...a({docsDir:`docs`,root:e},_)],resolve:{alias:[{find:`boltdocs/entry`,replacement:m(l.resolve(e,`boltdocs-entry.tsx`))},{find:`boltdocs/client`,replacement:m(l.resolve(e,`boltdocs-client.mjs`))},{find:`use-sync-external-store/shim/index.js`,replacement:`react`},{find:`use-sync-external-store/shim`,replacement:`react`},{find:`use-sync-external-store`,replacement:`react`},{find:`@`,replacement:m(l.resolve(e,`../packages/core/src`))}],dedupe:[`react`,`react-dom`]},ssr:{external:[`react`,`react-dom`,`react-helmet-async`,`@bdocs/ssg`,`react-fast-compare`,`invariant`,...o()],optimizeDeps:{include:[`react`,`react-dom`,`react-fast-compare`,`invariant`,..._.vite?.ssr?.optimizeDeps?.include||[]]},noExternal:[`boltdocs`,/@bdocs\/(?!ssg).*/,`react-aria-components`,`@react-aria/collections`,`@react-aria/utils`,`react-router-dom`]},server:{headers:{...x,..._.vite?.server?.headers},..._.vite?.server},preview:{headers:{...x,..._.vite?.preview?.headers},..._.vite?.preview},..._.vite}}export{x as A,A as C,D,w as E,T as O,j as S,E as T,Q as _,v as a,V as b,Z as c,ie as d,re as f,G as g,W as h,_ as i,C as k,X as l,K as m,$ as n,ne as o,q as p,ae as r,Y as s,oe as t,J as u,te as v,O as w,N as x,U as y};