@powerlines/plugin-tsup 0.12.308 → 0.12.310

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 (142) hide show
  1. package/dist/build-C-zKo4UO.d.cts +8 -0
  2. package/dist/build-C-zKo4UO.d.cts.map +1 -0
  3. package/dist/build-D6oFtT4i.d.mts +8 -0
  4. package/dist/build-D6oFtT4i.d.mts.map +1 -0
  5. package/dist/build-DJTI0ZMx.cjs +0 -0
  6. package/dist/build-XTM4L3VY.mjs +1 -0
  7. package/dist/helpers/index.cjs +7 -6
  8. package/dist/helpers/index.d.cts +6 -2
  9. package/dist/helpers/index.d.mts +6 -2
  10. package/dist/helpers/index.mjs +3 -2
  11. package/dist/helpers/resolve-options.cjs +4 -84
  12. package/dist/helpers/resolve-options.d.cts +5 -26
  13. package/dist/helpers/resolve-options.d.mts +5 -28
  14. package/dist/helpers/resolve-options.mjs +2 -81
  15. package/dist/helpers/unplugin.cjs +2 -11
  16. package/dist/helpers/unplugin.d.cts +4 -8
  17. package/dist/helpers/unplugin.d.mts +4 -8
  18. package/dist/helpers/unplugin.mjs +2 -11
  19. package/dist/helpers-C9XSjwSZ.mjs +1 -0
  20. package/dist/helpers-yB1XkvQI.cjs +0 -0
  21. package/dist/index-2Ag-54t8.d.mts +1 -0
  22. package/dist/index-B_e8BwCm.d.cts +1 -0
  23. package/dist/index-Cc7fCJU9.d.mts +1 -0
  24. package/dist/index-D4ELpJXS.d.cts +1 -0
  25. package/dist/index.cjs +12 -10
  26. package/dist/index.d.cts +7 -5
  27. package/dist/index.d.cts.map +1 -1
  28. package/dist/index.d.mts +7 -8
  29. package/dist/index.d.mts.map +1 -1
  30. package/dist/index.mjs +6 -3
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/plugin-BUuY_bKp.d.cts +19 -0
  33. package/dist/plugin-BUuY_bKp.d.cts.map +1 -0
  34. package/dist/plugin-D0kb_w4D.d.mts +19 -0
  35. package/dist/plugin-D0kb_w4D.d.mts.map +1 -0
  36. package/dist/plugin-D3B5E_Hg.mjs +1 -0
  37. package/dist/plugin-D5qyQPqC.cjs +0 -0
  38. package/dist/resolve-options-A50LA11B.d.mts +25 -0
  39. package/dist/resolve-options-A50LA11B.d.mts.map +1 -0
  40. package/dist/resolve-options-CaiF-bem.d.cts +25 -0
  41. package/dist/resolve-options-CaiF-bem.d.cts.map +1 -0
  42. package/dist/resolve-options-DPfS2t2w.cjs +132 -0
  43. package/dist/resolve-options-DvCBX8Wl.mjs +82 -0
  44. package/dist/resolve-options-DvCBX8Wl.mjs.map +1 -0
  45. package/dist/types/build.cjs +1 -0
  46. package/dist/types/build.d.cts +2 -8
  47. package/dist/types/build.d.mts +2 -8
  48. package/dist/types/build.mjs +2 -0
  49. package/dist/types/index.cjs +3 -0
  50. package/dist/types/index.d.cts +3 -2
  51. package/dist/types/index.d.mts +3 -2
  52. package/dist/types/index.mjs +4 -0
  53. package/dist/types/plugin.cjs +1 -0
  54. package/dist/types/plugin.d.cts +3 -20
  55. package/dist/types/plugin.d.mts +3 -21
  56. package/dist/types/plugin.mjs +2 -0
  57. package/dist/types-D208vOSb.cjs +0 -0
  58. package/dist/types-Dv2cgIDx.mjs +1 -0
  59. package/dist/unplugin-BNAHDEmx.d.cts +8 -0
  60. package/dist/unplugin-BNAHDEmx.d.cts.map +1 -0
  61. package/dist/unplugin-C0RKBWXe.cjs +16 -0
  62. package/dist/unplugin-D-dKnxUW.mjs +11 -0
  63. package/dist/unplugin-D-dKnxUW.mjs.map +1 -0
  64. package/dist/unplugin-DHNZtPIJ.d.mts +8 -0
  65. package/dist/unplugin-DHNZtPIJ.d.mts.map +1 -0
  66. package/package.json +4 -4
  67. package/dist/_virtual/rolldown_runtime.cjs +0 -29
  68. package/dist/core/src/lib/entry.cjs +0 -22
  69. package/dist/core/src/lib/entry.mjs +0 -22
  70. package/dist/core/src/lib/entry.mjs.map +0 -1
  71. package/dist/core/src/lib/logger.cjs +0 -41
  72. package/dist/core/src/lib/logger.mjs +0 -40
  73. package/dist/core/src/lib/logger.mjs.map +0 -1
  74. package/dist/core/src/lib/unplugin/helpers.cjs +0 -19
  75. package/dist/core/src/lib/unplugin/helpers.mjs +0 -19
  76. package/dist/core/src/lib/unplugin/helpers.mjs.map +0 -1
  77. package/dist/core/src/lib/unplugin/index.cjs +0 -3
  78. package/dist/core/src/lib/unplugin/index.mjs +0 -5
  79. package/dist/core/src/lib/unplugin/module-resolution.cjs +0 -66
  80. package/dist/core/src/lib/unplugin/module-resolution.mjs +0 -66
  81. package/dist/core/src/lib/unplugin/module-resolution.mjs.map +0 -1
  82. package/dist/core/src/lib/unplugin/plugin.cjs +0 -71
  83. package/dist/core/src/lib/unplugin/plugin.mjs +0 -71
  84. package/dist/core/src/lib/unplugin/plugin.mjs.map +0 -1
  85. package/dist/core/src/lib/utilities/source-file.cjs +0 -22
  86. package/dist/core/src/lib/utilities/source-file.mjs +0 -22
  87. package/dist/core/src/lib/utilities/source-file.mjs.map +0 -1
  88. package/dist/core/src/plugin-utils/paths.cjs +0 -2
  89. package/dist/core/src/plugin-utils/paths.mjs +0 -4
  90. package/dist/core/src/types/api.d.cts +0 -103
  91. package/dist/core/src/types/api.d.cts.map +0 -1
  92. package/dist/core/src/types/api.d.mts +0 -103
  93. package/dist/core/src/types/api.d.mts.map +0 -1
  94. package/dist/core/src/types/commands.d.cts +0 -9
  95. package/dist/core/src/types/commands.d.cts.map +0 -1
  96. package/dist/core/src/types/commands.d.mts +0 -10
  97. package/dist/core/src/types/commands.d.mts.map +0 -1
  98. package/dist/core/src/types/config.d.cts +0 -551
  99. package/dist/core/src/types/config.d.cts.map +0 -1
  100. package/dist/core/src/types/config.d.mts +0 -551
  101. package/dist/core/src/types/config.d.mts.map +0 -1
  102. package/dist/core/src/types/context.d.cts +0 -511
  103. package/dist/core/src/types/context.d.cts.map +0 -1
  104. package/dist/core/src/types/context.d.mts +0 -511
  105. package/dist/core/src/types/context.d.mts.map +0 -1
  106. package/dist/core/src/types/fs.d.cts +0 -487
  107. package/dist/core/src/types/fs.d.cts.map +0 -1
  108. package/dist/core/src/types/fs.d.mts +0 -487
  109. package/dist/core/src/types/fs.d.mts.map +0 -1
  110. package/dist/core/src/types/hooks.d.cts +0 -99
  111. package/dist/core/src/types/hooks.d.cts.map +0 -1
  112. package/dist/core/src/types/hooks.d.mts +0 -99
  113. package/dist/core/src/types/hooks.d.mts.map +0 -1
  114. package/dist/core/src/types/index.d.mts +0 -9
  115. package/dist/core/src/types/plugin.d.cts +0 -204
  116. package/dist/core/src/types/plugin.d.cts.map +0 -1
  117. package/dist/core/src/types/plugin.d.mts +0 -204
  118. package/dist/core/src/types/plugin.d.mts.map +0 -1
  119. package/dist/core/src/types/tsconfig.d.cts +0 -70
  120. package/dist/core/src/types/tsconfig.d.cts.map +0 -1
  121. package/dist/core/src/types/tsconfig.d.mts +0 -70
  122. package/dist/core/src/types/tsconfig.d.mts.map +0 -1
  123. package/dist/core/src/types/unplugin.cjs +0 -21
  124. package/dist/core/src/types/unplugin.d.cts +0 -24
  125. package/dist/core/src/types/unplugin.d.cts.map +0 -1
  126. package/dist/core/src/types/unplugin.d.mts +0 -25
  127. package/dist/core/src/types/unplugin.d.mts.map +0 -1
  128. package/dist/core/src/types/unplugin.mjs +0 -22
  129. package/dist/core/src/types/unplugin.mjs.map +0 -1
  130. package/dist/helpers/resolve-options.d.cts.map +0 -1
  131. package/dist/helpers/resolve-options.d.mts.map +0 -1
  132. package/dist/helpers/resolve-options.mjs.map +0 -1
  133. package/dist/helpers/unplugin.d.cts.map +0 -1
  134. package/dist/helpers/unplugin.d.mts.map +0 -1
  135. package/dist/helpers/unplugin.mjs.map +0 -1
  136. package/dist/plugin-esbuild/src/helpers/resolve-options.cjs +0 -27
  137. package/dist/plugin-esbuild/src/helpers/resolve-options.mjs +0 -26
  138. package/dist/plugin-esbuild/src/helpers/resolve-options.mjs.map +0 -1
  139. package/dist/types/build.d.cts.map +0 -1
  140. package/dist/types/build.d.mts.map +0 -1
  141. package/dist/types/plugin.d.cts.map +0 -1
  142. package/dist/types/plugin.d.mts.map +0 -1
@@ -1,99 +0,0 @@
1
- import { UnpluginBuilderVariant } from "./unplugin.mjs";
2
- import { Plugin, PluginHookFields, PluginHookFunctions } from "./plugin.mjs";
3
- import { PluginContext, SelectHooksOptions, WithUnpluginBuildContext } from "./context.mjs";
4
- import { UnpluginOptions } from "unplugin";
5
- import { MaybePromise } from "@stryke/types/base";
6
-
7
- //#region ../core/src/types/hooks.d.ts
8
- type HookListOrders = "preOrdered" | "preEnforced" | "normal" | "postEnforced" | "postOrdered";
9
- type UnpluginHookFunctions<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant$1 extends UnpluginBuilderVariant = UnpluginBuilderVariant, TField$1 extends keyof Required<UnpluginOptions>[TUnpluginBuilderVariant$1] = keyof Required<UnpluginOptions>[TUnpluginBuilderVariant$1]> = Required<UnpluginOptions>[TUnpluginBuilderVariant$1][TField$1] extends infer THandler | {
10
- handler: infer THandler;
11
- } ? THandler extends ((this: infer THandlerOriginalContext, ...args: infer THandlerArgs) => infer THandlerReturn) ? (this: THandlerOriginalContext & WithUnpluginBuildContext<TContext>, ...args: THandlerArgs) => THandlerReturn : THandler extends {
12
- handler: infer THandlerFunction;
13
- } ? THandlerFunction extends ((this: infer THandlerFunctionOriginalContext, ...args: infer THandlerFunctionArgs) => infer THandlerFunctionReturn) ? (this: THandlerFunctionOriginalContext & WithUnpluginBuildContext<TContext>, ...args: THandlerFunctionArgs) => THandlerFunctionReturn : never : never : never;
14
- interface PluginHooksListItem<TContext extends PluginContext = PluginContext, TFields extends PluginHookFields<TContext> = PluginHookFields<TContext>> {
15
- plugin: Plugin<TContext>;
16
- handler: PluginHookFunctions<TContext>[TFields];
17
- }
18
- type PluginHooksList<TContext extends PluginContext = PluginContext, TFields extends PluginHookFields<TContext> = PluginHookFields<TContext>> = { [TKey in HookListOrders]?: PluginHooksListItem<TContext, TFields>[] | undefined };
19
- interface UnpluginHooksListItem<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant$1 extends UnpluginBuilderVariant = UnpluginBuilderVariant, TField$1 extends keyof Required<UnpluginOptions>[TUnpluginBuilderVariant$1] = keyof Required<UnpluginOptions>[TUnpluginBuilderVariant$1]> {
20
- plugin: Plugin<TContext>;
21
- handler: UnpluginHookFunctions<TContext, TUnpluginBuilderVariant$1, TField$1>;
22
- }
23
- type UnpluginHookList<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant$1 extends UnpluginBuilderVariant = UnpluginBuilderVariant, TField$1 extends keyof UnpluginOptions[TUnpluginBuilderVariant$1] = keyof UnpluginOptions[TUnpluginBuilderVariant$1]> = { [TKey in HookListOrders]?: UnpluginHooksListItem<TContext, TUnpluginBuilderVariant$1, TField$1>[] | undefined };
24
- type UnpluginHookVariantField<TContext extends PluginContext = PluginContext, TUnpluginBuilderVariant$1 extends UnpluginBuilderVariant = UnpluginBuilderVariant> = { [TKey in keyof UnpluginOptions[TUnpluginBuilderVariant$1]]?: UnpluginHookList<TContext, TUnpluginBuilderVariant$1, TKey> };
25
- type UnpluginHookVariant<TContext extends PluginContext = PluginContext> = { [TKey in UnpluginBuilderVariant]?: UnpluginHookVariantField<TContext, TKey> };
26
- type HookFields<TContext extends PluginContext = PluginContext> = PluginHookFields<TContext> | UnpluginBuilderVariant;
27
- type HooksList<TContext extends PluginContext = PluginContext> = { [TField in HookFields<TContext>]?: TField extends PluginHookFields<TContext> ? PluginHooksList<TContext, TField> : TField extends UnpluginBuilderVariant ? UnpluginHookVariant<TContext>[TField] : never };
28
- type InferHooksListItem<TContext extends PluginContext, TKey$1 extends string> = TKey$1 extends `${infer TUnpluginBuilderVariant}:${infer TUnpluginField}` ? TUnpluginBuilderVariant extends UnpluginBuilderVariant ? TUnpluginField extends keyof Required<UnpluginOptions>[TUnpluginBuilderVariant] ? UnpluginHooksListItem<TContext, TUnpluginBuilderVariant, TUnpluginField> : never : never : TKey$1 extends keyof PluginHookFunctions<TContext> ? PluginHooksListItem<TContext, TKey$1> : never;
29
- type InferHookFunction<TContext extends PluginContext, TKey$1 extends string> = TKey$1 extends `${infer TUnpluginBuilderVariant}:${infer TUnpluginField}` ? TUnpluginBuilderVariant extends UnpluginBuilderVariant ? TUnpluginField extends keyof Required<UnpluginOptions>[TUnpluginBuilderVariant] ? UnpluginHookFunctions<TContext, TUnpluginBuilderVariant, TUnpluginField> : never : never : TKey$1 extends keyof PluginHookFunctions<TContext> ? PluginHookFunctions<TContext>[TKey$1] : never;
30
- type InferHookReturnType<TContext extends PluginContext, TKey$1 extends string> = ReturnType<InferHookFunction<TContext, TKey$1>>;
31
- type InferHookParameters<TContext extends PluginContext, TKey$1 extends string> = Parameters<InferHookFunction<TContext, TKey$1>>;
32
- type CallHookOptions = SelectHooksOptions & (({
33
- /**
34
- * Whether to call the hooks sequentially or in parallel.
35
- *
36
- * @defaultValue true
37
- */
38
- sequential?: true;
39
- } & ({
40
- /**
41
- * How to handle multiple return values from hooks.
42
- * - "merge": Merge all non-undefined return values (if they are objects).
43
- * - "first": Return the first non-undefined value.
44
- *
45
- * @remarks
46
- * Merging only works if the return values are objects.
47
- *
48
- * @defaultValue "merge"
49
- */
50
- result: "first";
51
- } | ({
52
- /**
53
- * An indicator specifying if the results of the previous hook should be provided as the **first** parameter of the next hook function, or a function to process the result of the previous hook function and pass the returned value as the next hook's **first** parameter
54
- */
55
- asNextParam?: false | ((previousResult: any) => MaybePromise<any>);
56
- } & ({
57
- /**
58
- * How to handle multiple return values from hooks.
59
- * - "merge": Merge all non-undefined return values (if they are objects).
60
- * - "first": Return the first non-undefined value.
61
- *
62
- * @remarks
63
- * Merging only works if the return values are objects.
64
- *
65
- * @defaultValue "merge"
66
- */
67
- result?: "merge";
68
- /**
69
- * A custom function to merge multiple return values from hooks.
70
- *
71
- * @remarks
72
- * If not provided, the {@link mergeResults} function will be used by default, which merges string results by concatenation and object results by deep merging.
73
- *
74
- * @param currentResult - The current hook result to merge with the previous results.
75
- * @param previousResults - The previous hook results to merge with the current result.
76
- * @returns The merged result.
77
- */
78
- merge?: <T>(currentResult: T, previousResults: T[]) => T[];
79
- } | {
80
- /**
81
- * How to handle multiple return values from hooks.
82
- * - "merge": Merge all non-undefined return values (if they are objects).
83
- * - "first": Return the first non-undefined value.
84
- *
85
- * @remarks
86
- * Merging only works if the return values are objects.
87
- *
88
- * @defaultValue "merge"
89
- */
90
- result?: "last";
91
- })))) | {
92
- /**
93
- * Whether to call the hooks sequentially or in parallel.
94
- */
95
- sequential: false;
96
- });
97
- //#endregion
98
- export { CallHookOptions, HookFields, HookListOrders, HooksList, InferHookFunction, InferHookParameters, InferHookReturnType, InferHooksListItem, PluginHooksList, PluginHooksListItem, UnpluginHookFunctions, UnpluginHookList, UnpluginHookVariant, UnpluginHookVariantField, UnpluginHooksListItem };
99
- //# sourceMappingURL=hooks.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hooks.d.mts","names":[],"sources":["../../../../../core/src/types/hooks.ts"],"sourcesContent":[],"mappings":";;;;;;;KA4BY,cAAA;AAAA,KAeA,qBAfc,CAAA,iBAgBP,aAhBO,GAgBS,aAhBT,EAAA,kCAiBQ,sBAjBR,GAkBtB,sBAlBsB,EAAA,iBAAA,MAmBH,QAnBG,CAmBM,eAnBN,CAAA,CAmBuB,yBAnBvB,CAAA,GAAA,MAoBhB,QApBgB,CAoBP,eApBO,CAAA,CAoBU,yBApBV,CAAA,CAAA,GAqBtB,QArBsB,CAqBb,eArBa,CAAA,CAqBI,yBArBJ,CAAA,CAqB6B,QArB7B,CAAA,SAAA,KAAA,SAAA,GAAA;EAed,OAAA,EAAA,KAAA,SAAA;CACO,GAAA,QAAA,UAAA,CAAA,IAAA,EAAA,KAAA,wBAAA,EAAA,GAAA,IAAA,EAAA,KAAA,aAAA,EAAA,GAAA,KAAA,eAAA,IAAA,CAAA,IAAA,EAeL,uBAfK,GAeqB,wBAfrB,CAe8C,QAf9C,CAAA,EAAA,GAAA,IAAA,EAgBF,YAhBE,E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A,CAAA;EAAP;;;;;EAIE,UAAA,CAAA,EAAA,IAAA;CACO,GAAA,CAAA;EAAgB;;;;;;;;;;EAQlB,MAAA,EAAA,OAAA;CACE,GAAA,CAAA;EAAgB;;;EAGH,WAAA,CAAA,EAAA,KAAA,GAAA,CAAA,CAAA,cAAA,EAAA,GAAA,EAAA,GAqH4B,YArH5B,CAAA,GAAA,CAAA,CAAA;CAAT,GAAA,CAAA;EAA0B;;;;;;;;;;EAIjB,MAAA,CAAA,EAAA,OAAA;EAGpB;;;;;;;;;;EAQgB,KAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,aAAA,EA+He,CA/Hf,EAAA,eAAA,EA+HmC,CA/HnC,EAAA,EAAA,GA+H2C,CA/H3C,EAAA;CAAU,GAAA;EAAyB;;;AAI/D;;;;;;;EAMI,MAAA,CAAA,EAAA,MAAA;CACA,CAAA,CAAA,CAAA,CAAA,GAAA;EACA;;;EAIQ,UAAA,EAAA,KAAA;CACO,CAAA"}
@@ -1,9 +0,0 @@
1
- import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileMetadata, VirtualFileSystemInterface, WriteOptions } from "./fs.mjs";
2
- import { CommandType, SUPPORTED_COMMANDS } from "./commands.mjs";
3
- import { BuilderVariant, InferUnpluginOptions, InferUnpluginVariant, UnpluginBuilderVariant, UnpluginOptions } from "./unplugin.mjs";
4
- import { Plugin, PluginHook, PluginHookFields, PluginHookFunctions, PluginHookObject, PluginHooks, TypesResult } from "./plugin.mjs";
5
- import { CallHookOptions, HookFields, HookListOrders, HooksList, InferHookFunction, InferHookParameters, InferHookReturnType, InferHooksListItem, PluginHooksList, PluginHooksListItem, UnpluginHookFunctions, UnpluginHookList, UnpluginHookVariant, UnpluginHookVariantField, UnpluginHooksListItem } from "./hooks.mjs";
6
- import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig } from "./tsconfig.mjs";
7
- import { APIContext, BuildPluginContext, Context, EmitEntryOptions, EmitOptions, EnvironmentContext, EnvironmentContextPlugin, FetchOptions, InitContextOptions, MetaInfo, ParseOptions, PluginContext, Resolver, SelectHookResult, SelectHookResultItem, SelectHooksOptions, TransformResult, UnresolvedContext, WithUnpluginBuildContext } from "./context.mjs";
8
- import { BaseConfig, BuildInlineConfig, CleanInlineConfig, DeployInlineConfig, DocsInlineConfig, EnvironmentConfig, EnvironmentResolvedConfig, InlineConfig, LintInlineConfig, LogFn, LogLevel, NewInlineConfig, OutputConfig, OutputResolvedConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, PrepareInlineConfig, ProjectType, ResolveConfig, ResolveResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition, UserConfig, WorkspaceConfig } from "./config.mjs";
9
- import { API } from "./api.mjs";
@@ -1,204 +0,0 @@
1
- import { CommandType } from "./commands.cjs";
2
- import { BuilderVariant, InferUnpluginOptions } from "./unplugin.cjs";
3
- import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.cjs";
4
- import { EnvironmentConfig, EnvironmentResolvedConfig, PluginConfig, ResolvedConfig } from "./config.cjs";
5
- import { AnyFunction, MaybePromise } from "@stryke/types/base";
6
- import { ExternalIdResult, HookFilter, TransformResult } from "unplugin";
7
- import { ArrayValues } from "@stryke/types/array";
8
- import { LoadResult } from "rollup";
9
-
10
- //#region ../core/src/types/plugin.d.ts
11
- interface PluginHookObject<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> {
12
- /**
13
- * The order in which the plugin should be applied.
14
- */
15
- order?: "pre" | "post" | null | undefined;
16
- /**
17
- * A filter to determine when the hook should be called.
18
- */
19
- filter?: Pick<HookFilter, TFilter>;
20
- /**
21
- * The hook function to be called.
22
- */
23
- handler: THookFunction;
24
- }
25
- type PluginHook<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> = THookFunction | PluginHookObject<THookFunction, TFilter>;
26
- /**
27
- * A result returned by the plugin from the `types` hook that describes the declaration types output file.
28
- */
29
- interface TypesResult {
30
- directives?: string[];
31
- code: string;
32
- }
33
- type PluginHookFunctions<TContext extends PluginContext> = { [TCommandType in CommandType]: (this: TContext) => MaybePromise<void> } & {
34
- /**
35
- * A function that returns configuration options to be merged with the build context's options.
36
- *
37
- * @remarks
38
- * Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
39
- *
40
- * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect.
41
- *
42
- * @see https://vitejs.dev/guide/api-plugin#config
43
- *
44
- * @param this - The build context.
45
- * @param config - The partial configuration object to be modified.
46
- * @returns A promise that resolves to a partial configuration object.
47
- */
48
- config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial<TContext["config"]> & Record<string, any>>;
49
- /**
50
- * Modify environment configs before it's resolved. The hook can either mutate the passed-in environment config directly, or return a partial config object that will be deeply merged into existing config.
51
- *
52
- * @remarks
53
- * This hook is called for each environment with a partially resolved environment config that already accounts for the default environment config values set at the root level. If plugins need to modify the config of a given environment, they should do it in this hook instead of the config hook. Leaving the config hook only for modifying the root default environment config.
54
- *
55
- * @see https://vitejs.dev/guide/api-plugin#configenvironment
56
- *
57
- * @param this - The build context.
58
- * @param name - The name of the environment being configured.
59
- * @param environment - The Vite-like environment object containing information about the current build environment.
60
- * @returns A promise that resolves when the hook is complete.
61
- */
62
- configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>;
63
- /**
64
- * A hook that is called when the plugin is resolved.
65
- *
66
- * @see https://vitejs.dev/guide/api-plugin#configresolved
67
- *
68
- * @param this - The build context.
69
- * @returns A promise that resolves when the hook is complete.
70
- */
71
- configResolved: (this: TContext) => MaybePromise<void>;
72
- /**
73
- * A hook that is called to overwrite the generated declaration types file (.d.ts). The generated type definitions should describe the built-in modules/logic added during the `prepare` task.
74
- *
75
- * @param this - The build context.
76
- * @param code - The source code to generate types for.
77
- * @returns A promise that resolves when the hook is complete.
78
- */
79
- types: (this: TContext, code: string) => MaybePromise<TypesResult | string | undefined | null>;
80
- /**
81
- * A hook that is called at the start of the build process.
82
- *
83
- * @param this - The build context and unplugin build context.
84
- * @returns A promise that resolves when the hook is complete.
85
- */
86
- buildStart: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
87
- /**
88
- * A hook that is called at the end of the build process.
89
- *
90
- * @param this - The build context and unplugin build context.
91
- * @returns A promise that resolves when the hook is complete.
92
- */
93
- buildEnd: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
94
- /**
95
- * A hook that is called to transform the source code.
96
- *
97
- * @param this - The build context, unplugin build context, and unplugin context.
98
- * @param code - The source code to transform.
99
- * @param id - The identifier of the source code.
100
- * @returns A promise that resolves when the hook is complete.
101
- */
102
- transform: (this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult>;
103
- /**
104
- * A hook that is called to load the source code.
105
- *
106
- * @param this - The build context, unplugin build context, and unplugin context.
107
- * @param id - The identifier of the source code.
108
- * @returns A promise that resolves when the hook is complete.
109
- */
110
- load: (this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<LoadResult>;
111
- /**
112
- * A hook that is called to resolve the identifier of the source code.
113
- *
114
- * @param this - The build context, unplugin build context, and unplugin context.
115
- * @param id - The identifier of the source code.
116
- * @param importer - The importer of the source code.
117
- * @param options - The options for resolving the identifier.
118
- * @returns A promise that resolves when the hook is complete.
119
- */
120
- resolveId: (this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
121
- isEntry: boolean;
122
- }) => MaybePromise<string | ExternalIdResult | null | undefined>;
123
- /**
124
- * A hook that is called to write the bundle to disk.
125
- *
126
- * @param this - The build context.
127
- * @returns A promise that resolves when the hook is complete.
128
- */
129
- writeBundle: (this: TContext) => MaybePromise<void>;
130
- };
131
- type PluginHooks<TContext extends PluginContext> = { [TPluginHook in keyof PluginHookFunctions<TContext>]?: PluginHook<PluginHookFunctions<TContext>[TPluginHook]> } & {
132
- transform: PluginHook<PluginHookFunctions<TContext>["transform"], "code" | "id">;
133
- load: PluginHook<PluginHookFunctions<TContext>["load"], "id">;
134
- resolveId: PluginHook<PluginHookFunctions<TContext>["resolveId"], "id">;
135
- };
136
- type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]> };
137
- type Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> = Partial<PluginHooks<TContext>> & {
138
- /**
139
- * The name of the plugin, for use in deduplication, error messages and logs.
140
- */
141
- name: string;
142
- /**
143
- * An API object that can be used for inter-plugin communication.
144
- *
145
- * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
146
- */
147
- api?: Record<string, any>;
148
- /**
149
- * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.
150
- *
151
- * @remarks
152
- * The Plugin invocation order is as follows:
153
- * - `enforce: 'pre'` plugins
154
- * - `order: 'pre'` plugin hooks
155
- * - any other plugins (normal)
156
- * - `order: 'post'` plugin hooks
157
- * - `enforce: 'post'` plugins
158
- *
159
- * @see https://vitejs.dev/guide/api-plugin.html#plugin-ordering
160
- * @see https://rollupjs.org/plugin-development/#build-hooks
161
- * @see https://webpack.js.org/concepts/loaders/#enforce---pre-and-post
162
- * @see https://esbuild.github.io/plugins/#concepts
163
- */
164
- enforce?: "pre" | "post";
165
- /**
166
- * A function to determine if two plugins are the same and can be de-duplicated.
167
- *
168
- * @remarks
169
- * If this is not provided, plugins are de-duplicated by comparing their names.
170
- *
171
- * @param other - The other plugin to compare against.
172
- * @returns `true` if the two plugins are the same, `false` otherwise.
173
- */
174
- dedupe?: false | ((other: Plugin<any>) => boolean);
175
- /**
176
- * A list of pre-requisite plugins that must be loaded before this plugin can be used.
177
- */
178
- /**
179
- * Define environments where this plugin should be active. By default, the plugin is active in all environments.
180
- *
181
- * @param environment - The environment to check.
182
- * @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
183
- */
184
- applyToEnvironment?: (environment: EnvironmentResolvedConfig) => boolean | PluginConfig<TContext>;
185
- /**
186
- * A function that returns configuration options to be merged with the build context's options.
187
- *
188
- * @remarks
189
- * Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
190
- *
191
- * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect. If you want to add plugins, consider doing so in the {@link Plugin.dependsOn} property instead.
192
- *
193
- * @see https://vitejs.dev/guide/api-plugin#config
194
- *
195
- * @param this - The build context.
196
- * @param config - The partial configuration object to be modified.
197
- * @returns A promise that resolves to a partial configuration object.
198
- */
199
- config?: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial<TContext["config"]> & Record<string, any>>> | (DeepPartial<TContext["config"]> & Record<string, any>);
200
- } & { [TBuilderVariant in BuilderVariant]?: InferUnpluginOptions<TContext, TBuilderVariant> };
201
- type PluginHookFields<TContext extends PluginContext = PluginContext> = keyof PluginHookFunctions<TContext>;
202
- //#endregion
203
- export { Plugin, PluginHook, PluginHookFields, PluginHookFunctions };
204
- //# sourceMappingURL=plugin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../../../../core/src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;UAsCiB,uCACO,mCACA;EAFP;;;EAYD,KAAA,CAAA,EAAA,KAAA,GAAA,MAAA,GAAA,IAAA,GAAA,SAAA;EAAY;;;EAKJ,MAAA,CAAA,EALb,IAKa,CALR,UAKQ,EALI,OAKJ,CAAA;EAGZ;;;EAGR,OAAA,EANO,aAMP;;AAAgD,KAHxC,UAGwC,CAAA,sBAF5B,WAE4B,EAAA,gBAAA,MAD5B,UAC4B,GAAA,KAAA,CAAA,GAAhD,aAAgD,GAAhC,gBAAgC,CAAf,aAAe,EAAA,OA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B,kBAEU,kBAAkB,wBACrB,aAAa,YAAY,sBAAsB,yBAErD,YAAY,sBAAsB;0BAEnB,kBAAkB,qBACpC,UACA;KA8BQ,kCAAkC,gBAAgB,uBACtD,oBAAoB"}
@@ -1,204 +0,0 @@
1
- import { CommandType } from "./commands.mjs";
2
- import { BuilderVariant, InferUnpluginOptions } from "./unplugin.mjs";
3
- import { BuildPluginContext, PluginContext, UnresolvedContext } from "./context.mjs";
4
- import { EnvironmentConfig, EnvironmentResolvedConfig, PluginConfig, ResolvedConfig } from "./config.mjs";
5
- import { ExternalIdResult, HookFilter, TransformResult } from "unplugin";
6
- import { AnyFunction, MaybePromise } from "@stryke/types/base";
7
- import { ArrayValues } from "@stryke/types/array";
8
- import { LoadResult } from "rollup";
9
-
10
- //#region ../core/src/types/plugin.d.ts
11
- interface PluginHookObject<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> {
12
- /**
13
- * The order in which the plugin should be applied.
14
- */
15
- order?: "pre" | "post" | null | undefined;
16
- /**
17
- * A filter to determine when the hook should be called.
18
- */
19
- filter?: Pick<HookFilter, TFilter>;
20
- /**
21
- * The hook function to be called.
22
- */
23
- handler: THookFunction;
24
- }
25
- type PluginHook<THookFunction extends AnyFunction, TFilter extends keyof HookFilter = never> = THookFunction | PluginHookObject<THookFunction, TFilter>;
26
- /**
27
- * A result returned by the plugin from the `types` hook that describes the declaration types output file.
28
- */
29
- interface TypesResult {
30
- directives?: string[];
31
- code: string;
32
- }
33
- type PluginHookFunctions<TContext extends PluginContext> = { [TCommandType in CommandType]: (this: TContext) => MaybePromise<void> } & {
34
- /**
35
- * A function that returns configuration options to be merged with the build context's options.
36
- *
37
- * @remarks
38
- * Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
39
- *
40
- * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect.
41
- *
42
- * @see https://vitejs.dev/guide/api-plugin#config
43
- *
44
- * @param this - The build context.
45
- * @param config - The partial configuration object to be modified.
46
- * @returns A promise that resolves to a partial configuration object.
47
- */
48
- config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial<TContext["config"]> & Record<string, any>>;
49
- /**
50
- * Modify environment configs before it's resolved. The hook can either mutate the passed-in environment config directly, or return a partial config object that will be deeply merged into existing config.
51
- *
52
- * @remarks
53
- * This hook is called for each environment with a partially resolved environment config that already accounts for the default environment config values set at the root level. If plugins need to modify the config of a given environment, they should do it in this hook instead of the config hook. Leaving the config hook only for modifying the root default environment config.
54
- *
55
- * @see https://vitejs.dev/guide/api-plugin#configenvironment
56
- *
57
- * @param this - The build context.
58
- * @param name - The name of the environment being configured.
59
- * @param environment - The Vite-like environment object containing information about the current build environment.
60
- * @returns A promise that resolves when the hook is complete.
61
- */
62
- configEnvironment: (this: TContext, name: string, environment: EnvironmentConfig) => MaybePromise<Partial<EnvironmentResolvedConfig> | undefined | null>;
63
- /**
64
- * A hook that is called when the plugin is resolved.
65
- *
66
- * @see https://vitejs.dev/guide/api-plugin#configresolved
67
- *
68
- * @param this - The build context.
69
- * @returns A promise that resolves when the hook is complete.
70
- */
71
- configResolved: (this: TContext) => MaybePromise<void>;
72
- /**
73
- * A hook that is called to overwrite the generated declaration types file (.d.ts). The generated type definitions should describe the built-in modules/logic added during the `prepare` task.
74
- *
75
- * @param this - The build context.
76
- * @param code - The source code to generate types for.
77
- * @returns A promise that resolves when the hook is complete.
78
- */
79
- types: (this: TContext, code: string) => MaybePromise<TypesResult | string | undefined | null>;
80
- /**
81
- * A hook that is called at the start of the build process.
82
- *
83
- * @param this - The build context and unplugin build context.
84
- * @returns A promise that resolves when the hook is complete.
85
- */
86
- buildStart: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
87
- /**
88
- * A hook that is called at the end of the build process.
89
- *
90
- * @param this - The build context and unplugin build context.
91
- * @returns A promise that resolves when the hook is complete.
92
- */
93
- buildEnd: (this: BuildPluginContext<TContext["config"]> & TContext) => MaybePromise<void>;
94
- /**
95
- * A hook that is called to transform the source code.
96
- *
97
- * @param this - The build context, unplugin build context, and unplugin context.
98
- * @param code - The source code to transform.
99
- * @param id - The identifier of the source code.
100
- * @returns A promise that resolves when the hook is complete.
101
- */
102
- transform: (this: BuildPluginContext<TContext["config"]> & TContext, code: string, id: string) => MaybePromise<TransformResult>;
103
- /**
104
- * A hook that is called to load the source code.
105
- *
106
- * @param this - The build context, unplugin build context, and unplugin context.
107
- * @param id - The identifier of the source code.
108
- * @returns A promise that resolves when the hook is complete.
109
- */
110
- load: (this: BuildPluginContext<TContext["config"]> & TContext, id: string) => MaybePromise<LoadResult>;
111
- /**
112
- * A hook that is called to resolve the identifier of the source code.
113
- *
114
- * @param this - The build context, unplugin build context, and unplugin context.
115
- * @param id - The identifier of the source code.
116
- * @param importer - The importer of the source code.
117
- * @param options - The options for resolving the identifier.
118
- * @returns A promise that resolves when the hook is complete.
119
- */
120
- resolveId: (this: BuildPluginContext<TContext["config"]> & TContext, id: string, importer: string | undefined, options: {
121
- isEntry: boolean;
122
- }) => MaybePromise<string | ExternalIdResult | null | undefined>;
123
- /**
124
- * A hook that is called to write the bundle to disk.
125
- *
126
- * @param this - The build context.
127
- * @returns A promise that resolves when the hook is complete.
128
- */
129
- writeBundle: (this: TContext) => MaybePromise<void>;
130
- };
131
- type PluginHooks<TContext extends PluginContext> = { [TPluginHook in keyof PluginHookFunctions<TContext>]?: PluginHook<PluginHookFunctions<TContext>[TPluginHook]> } & {
132
- transform: PluginHook<PluginHookFunctions<TContext>["transform"], "code" | "id">;
133
- load: PluginHook<PluginHookFunctions<TContext>["load"], "id">;
134
- resolveId: PluginHook<PluginHookFunctions<TContext>["resolveId"], "id">;
135
- };
136
- type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]> };
137
- type Plugin<TContext extends PluginContext<ResolvedConfig> = PluginContext<ResolvedConfig>> = Partial<PluginHooks<TContext>> & {
138
- /**
139
- * The name of the plugin, for use in deduplication, error messages and logs.
140
- */
141
- name: string;
142
- /**
143
- * An API object that can be used for inter-plugin communication.
144
- *
145
- * @see https://rollupjs.org/plugin-development/#direct-plugin-communication
146
- */
147
- api?: Record<string, any>;
148
- /**
149
- * Enforce plugin invocation tier similar to webpack loaders. Hooks ordering is still subject to the `order` property in the hook object.
150
- *
151
- * @remarks
152
- * The Plugin invocation order is as follows:
153
- * - `enforce: 'pre'` plugins
154
- * - `order: 'pre'` plugin hooks
155
- * - any other plugins (normal)
156
- * - `order: 'post'` plugin hooks
157
- * - `enforce: 'post'` plugins
158
- *
159
- * @see https://vitejs.dev/guide/api-plugin.html#plugin-ordering
160
- * @see https://rollupjs.org/plugin-development/#build-hooks
161
- * @see https://webpack.js.org/concepts/loaders/#enforce---pre-and-post
162
- * @see https://esbuild.github.io/plugins/#concepts
163
- */
164
- enforce?: "pre" | "post";
165
- /**
166
- * A function to determine if two plugins are the same and can be de-duplicated.
167
- *
168
- * @remarks
169
- * If this is not provided, plugins are de-duplicated by comparing their names.
170
- *
171
- * @param other - The other plugin to compare against.
172
- * @returns `true` if the two plugins are the same, `false` otherwise.
173
- */
174
- dedupe?: false | ((other: Plugin<any>) => boolean);
175
- /**
176
- * A list of pre-requisite plugins that must be loaded before this plugin can be used.
177
- */
178
- /**
179
- * Define environments where this plugin should be active. By default, the plugin is active in all environments.
180
- *
181
- * @param environment - The environment to check.
182
- * @returns `true` if the plugin should be active in the specified environment, `false` otherwise.
183
- */
184
- applyToEnvironment?: (environment: EnvironmentResolvedConfig) => boolean | PluginConfig<TContext>;
185
- /**
186
- * A function that returns configuration options to be merged with the build context's options.
187
- *
188
- * @remarks
189
- * Modify config before it's resolved. The hook can either mutate {@link Context.config} on the passed-in context directly, or return a partial config object that will be deeply merged into existing config.
190
- *
191
- * @warning User plugins are resolved before running this hook so injecting other plugins inside the config hook will have no effect. If you want to add plugins, consider doing so in the {@link Plugin.dependsOn} property instead.
192
- *
193
- * @see https://vitejs.dev/guide/api-plugin#config
194
- *
195
- * @param this - The build context.
196
- * @param config - The partial configuration object to be modified.
197
- * @returns A promise that resolves to a partial configuration object.
198
- */
199
- config?: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<DeepPartial<TContext["config"]> & Record<string, any>>> | (DeepPartial<TContext["config"]> & Record<string, any>);
200
- } & { [TBuilderVariant in BuilderVariant]?: InferUnpluginOptions<TContext, TBuilderVariant> };
201
- type PluginHookFields<TContext extends PluginContext = PluginContext> = keyof PluginHookFunctions<TContext>;
202
- //#endregion
203
- export { Plugin, PluginHook, PluginHookFields, PluginHookFunctions, PluginHookObject, PluginHooks, TypesResult };
204
- //# sourceMappingURL=plugin.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../../../../core/src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;UAsCiB,uCACO,mCACA;EAFP;;;EAYD,KAAA,CAAA,EAAA,KAAA,GAAA,MAAA,GAAA,IAAA,GAAA,SAAA;EAAY;;;EAKJ,MAAA,CAAA,EALb,IAKa,CALR,UAKQ,EALI,OAKJ,CAAA;EAGZ;;;EAGR,OAAA,EANO,aAMP;;AAAgD,KAHxC,UAGwC,CAAA,sBAF5B,WAE4B,EAAA,gBAAA,MAD5B,UAC4B,GAAA,KAAA,CAAA,GAAhD,aAAgD,GAAhC,gBAAgC,CAAf,aAAe,EAAA,OAAA,CAAA;;;AAKpD;AAKY,UALK,WAAA,CAKc;EAAkB,UAAA,CAAA,EAAA,MAAA,EAAA;EAC9B,IAAA,EAAA,MAAA;;AAAkC,KADzC,mBACyC,CAAA,iBADJ,aACI,CAAA,GAAA,mBAAlC,WAiBS,GAAA,CAAA,IAAA,EAjBY,QAiBZ,EAAA,GAjByB,YAiBzB,CAAA,IAAA,CAAA,EAAlB,GAAA;EACsB;;;;;;;;;;;;;;EAkDH,MAAA,EAAA,CAAA,IAAA,EAnDnB,iBAmDmB,CAnDD,QAmDC,CAAA,QAAA,CAAA,CAAA,EAAA,GAlDtB,YA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AAA,EAAA,EAAA,MAAA,EAAA,GArGV,YAqGU,CArGG,UAqGH,CAAA;EAmBiB;;;;;;;;;EAGO,SAAA,EAAA,CAAA,IAAA,EA/G/B,kBA+G+B,CA/GZ,QA+GY,CAAA,QAAA,CAAA,CAAA,GA/GU,QA+GV,EAAA,EAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,GAAA,SAAA,EAAA,OAAA,EAAA;IAEnB,OAAA,EAAA,OAAA;EAClB,CAAA,EAAA,GA9GG,YA8GH,CAAA,MAAA,GA9GyB,gBA8GzB,GAAA,IAAA,GAAA,SAAA,CAAA;EACA;;;AA8BJ;;;EAC4B,WAAA,EAAA,CAAA,IAAA,EAtIN,QAsIM,EAAA,GAtIO,YAsIP,CAAA,IAAA,CAAA;CAApB;AAAmB,KAnIf,WAmIe,CAAA,iBAnIc,aAmId,CAAA,GAAA,wBAlIH,oBAAoB,aAAa,WACrD,oBAAoB,UAAU;aAGrB,WACT,oBAAoB;QAGhB,WAAW,oBAAoB;aAC1B,WAAW,oBAAoB;;KAGvC,+BACS,KAAK,YAAY,EAAE;KAGrB,wBACO,cAAc,kBAAkB,cAAc,mBAC7D,QAAQ,YAAY;;;;;;;;;;QAWhB;;;;;;;;;;;;;;;;;;;;;;;;;;;4BA6BoB;;;;;;;;;;qCAcX,wCACA,aAAa;;;;;;;;;;;;;;;WAiBxB,kBAEU,kBAAkB,wBACrB,aAAa,YAAY,sBAAsB,yBAErD,YAAY,sBAAsB;0BAEnB,kBAAkB,qBACpC,UACA;KA8BQ,kCAAkC,gBAAgB,uBACtD,oBAAoB"}
@@ -1,70 +0,0 @@
1
- import { CompilerOptions, TsConfigJson } from "@stryke/types/tsconfig";
2
- import ts from "typescript";
3
-
4
- //#region ../core/src/types/tsconfig.d.ts
5
- type ReflectionMode = "default" | "explicit" | "never";
6
- type RawReflectionMode = ReflectionMode | "" | boolean | string | string[] | undefined;
7
- /**
8
- * Defines the level of reflection to be used during the transpilation process.
9
- *
10
- * @remarks
11
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
12
- * - `minimal` - Only the essential type information is captured.
13
- * - `normal` - Additional type information is captured, including some contextual data.
14
- * - `verbose` - All available type information is captured, including detailed contextual data.
15
- */
16
- type ReflectionLevel = "minimal" | "normal" | "verbose";
17
- interface DeepkitOptions {
18
- /**
19
- * Either true to activate reflection for all files compiled using this tsconfig,
20
- * or a list of globs/file paths relative to this tsconfig.json.
21
- * Globs/file paths can be prefixed with a ! to exclude them.
22
- */
23
- reflection?: RawReflectionMode;
24
- /**
25
- * Defines the level of reflection to be used during the transpilation process.
26
- *
27
- * @remarks
28
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
29
- * - `minimal` - Only the essential type information is captured.
30
- * - `normal` - Additional type information is captured, including some contextual data.
31
- * - `verbose` - All available type information is captured, including detailed contextual data.
32
- */
33
- reflectionLevel?: ReflectionLevel;
34
- }
35
- type TSCompilerOptions = CompilerOptions & DeepkitOptions;
36
- /**
37
- * The TypeScript compiler configuration.
38
- *
39
- * @see https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
40
- */
41
- interface TSConfig extends Omit<TsConfigJson, "reflection"> {
42
- /**
43
- * Either true to activate reflection for all files compiled using this tsconfig,
44
- * or a list of globs/file paths relative to this tsconfig.json.
45
- * Globs/file paths can be prefixed with a ! to exclude them.
46
- */
47
- reflection?: RawReflectionMode;
48
- /**
49
- * Defines the level of reflection to be used during the transpilation process.
50
- *
51
- * @remarks
52
- * The level determines how much extra data is captured in the byte code for each type. This can be one of the following values:
53
- * - `minimal` - Only the essential type information is captured.
54
- * - `normal` - Additional type information is captured, including some contextual data.
55
- * - `verbose` - All available type information is captured, including detailed contextual data.
56
- */
57
- reflectionLevel?: ReflectionLevel;
58
- /**
59
- * Instructs the TypeScript compiler how to compile `.ts` files.
60
- */
61
- compilerOptions?: TSCompilerOptions;
62
- }
63
- type ParsedTypeScriptConfig = ts.ParsedCommandLine & {
64
- originalTsconfigJson: TsConfigJson;
65
- tsconfigJson: TSConfig;
66
- tsconfigFilePath: string;
67
- };
68
- //#endregion
69
- export { ParsedTypeScriptConfig, TSConfig };
70
- //# sourceMappingURL=tsconfig.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tsconfig.d.cts","names":[],"sources":["../../../../../core/src/types/tsconfig.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,cAAA;KACA,iBAAA,GACR;AAFJ;AACA;AAiBA;AAEA;AAoBA;AAOA;;;;AAsBoB,KAnDR,eAAA,GAmDQ,SAAA,GAAA,QAAA,GAAA,SAAA;AAtBc,UA3BjB,cAAA,CA2BiB;EAAI;AAyBtC;;;;EAEwB,UAAA,CAAA,EAhDT,iBAgDS;;;;;;;;;;oBArCJ;;KAGR,iBAAA,GAAoB,kBAAkB;;;;;;UAOjC,QAAA,SAAiB,KAAK;;;;;;eAMxB;;;;;;;;;;oBAWK;;;;oBAKA;;KAGR,sBAAA,GAAyB,EAAA,CAAG;wBAChB;gBACR"}