@reliverse/dler 1.7.113 → 1.7.115

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 (154) hide show
  1. package/bin/app/add/add-local/core/templates.d.ts +3 -3
  2. package/bin/app/add/add-local/core/templates.js +8 -8
  3. package/bin/app/add/cmd.js +2 -2
  4. package/bin/app/ai/ai-impl/ai-chat.d.ts +2 -2
  5. package/bin/app/ai/ai-impl/ai-types.d.ts +2 -2
  6. package/bin/app/ai/ai-impl/relinter/relinter.d.ts +2 -2
  7. package/bin/app/ai/ai-menu.d.ts +2 -2
  8. package/bin/app/ai/cmd.js +4 -4
  9. package/bin/app/better/auth/cmd.js +1 -6
  10. package/bin/app/build/build-library.d.ts +5 -4
  11. package/bin/app/build/build-regular.d.ts +4 -3
  12. package/bin/app/build/cmd.d.ts +10 -0
  13. package/bin/app/build/cmd.js +29 -12
  14. package/bin/app/build/impl.d.ts +3 -2
  15. package/bin/app/build/library-flow.d.ts +5 -4
  16. package/bin/app/build/postbuild.d.ts +2 -2
  17. package/bin/app/build/postbuild.js +0 -6
  18. package/bin/app/build/prebuild.d.ts +2 -2
  19. package/bin/app/build/prebuild.js +0 -6
  20. package/bin/app/build/regular-flow.d.ts +4 -3
  21. package/bin/app/check/cmd.js +2 -2
  22. package/bin/app/config/constants.d.ts +1 -1
  23. package/bin/app/config/constants.js +1 -1
  24. package/bin/app/config/content.d.ts +1 -1
  25. package/bin/app/config/content.js +2 -2
  26. package/bin/app/config/core-cfg.d.ts +5 -5
  27. package/bin/app/config/core-cfg.js +27 -16
  28. package/bin/app/config/create.d.ts +6 -5
  29. package/bin/app/config/create.js +13 -22
  30. package/bin/app/config/def-utils.d.ts +3 -3
  31. package/bin/app/config/def-utils.js +10 -8
  32. package/bin/app/config/detect.d.ts +4 -2
  33. package/bin/app/config/detect.js +36 -6
  34. package/bin/app/config/gen-cfg.js +4 -4
  35. package/bin/app/config/load.d.ts +2 -2
  36. package/bin/app/config/load.js +1 -1
  37. package/bin/app/config/migrate.d.ts +1 -1
  38. package/bin/app/config/migrate.js +7 -3
  39. package/bin/app/config/path.d.ts +1 -1
  40. package/bin/app/config/path.js +3 -3
  41. package/bin/app/config/prepare.d.ts +1 -1
  42. package/bin/app/config/prepare.js +83 -81
  43. package/bin/app/config/prompts.d.ts +1 -1
  44. package/bin/app/config/prompts.js +1 -1
  45. package/bin/app/config/read.d.ts +3 -3
  46. package/bin/app/config/read.js +13 -35
  47. package/bin/app/config/repair.d.ts +2 -2
  48. package/bin/app/config/repair.js +12 -12
  49. package/bin/app/config/unstable.d.ts +3 -3
  50. package/bin/app/config/unstable.js +2 -14
  51. package/bin/app/config/update.d.ts +3 -3
  52. package/bin/app/config/update.js +41 -48
  53. package/bin/app/env/env-impl.js +2 -2
  54. package/bin/app/init/cmd-2.js +2 -2
  55. package/bin/app/init/init-utils/init-utils.js +7 -7
  56. package/bin/app/init/init-utils/mm-deprecated/editor-menu.d.ts +3 -2
  57. package/bin/app/init/init-utils/mm-deprecated/editor-menu.js +1 -6
  58. package/bin/app/init/use-template/cp-impl.d.ts +5 -4
  59. package/bin/app/init/use-template/cp-mod.d.ts +3 -3
  60. package/bin/app/init/use-template/cp-mod.js +5 -5
  61. package/bin/app/init/use-template/cp-modules/cli-main-modules/cli-menu-items/showCloneProjectMenu.d.ts +2 -2
  62. package/bin/app/init/use-template/cp-modules/compose-env-file/cef-impl.d.ts +2 -2
  63. package/bin/app/init/use-template/cp-modules/compose-env-file/cef-mod.d.ts +2 -2
  64. package/bin/app/init/use-template/cp-modules/git-deploy-prompts/deploy.d.ts +4 -3
  65. package/bin/app/init/use-template/cp-modules/git-deploy-prompts/gdp-mod.d.ts +5 -4
  66. package/bin/app/init/use-template/cp-modules/git-deploy-prompts/git.d.ts +6 -5
  67. package/bin/app/init/use-template/cp-modules/git-deploy-prompts/github.d.ts +2 -2
  68. package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-private-repo.d.ts +2 -2
  69. package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-private-repo.js +6 -3
  70. package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-repo-exists.d.ts +3 -2
  71. package/bin/app/init/use-template/cp-modules/git-deploy-prompts/utils-repo-exists.js +4 -4
  72. package/bin/app/invoke/cmd.js +2 -2
  73. package/bin/app/mrse/cmd.js +2 -2
  74. package/bin/app/mrse/mrse-impl.js +2 -2
  75. package/bin/app/providers/better-t-stack/types.d.ts +9 -9
  76. package/bin/app/providers/package.json +3 -0
  77. package/bin/app/providers/reliverse-stack/reliverse-stack-mod.js +2 -2
  78. package/bin/app/providers/reliverse-stack/rs-impl.d.ts +4 -4
  79. package/bin/app/pub/cmd.d.ts +10 -0
  80. package/bin/app/pub/cmd.js +27 -12
  81. package/bin/app/pub/impl.d.ts +3 -2
  82. package/bin/app/rempts/cmd.js +2 -2
  83. package/bin/app/rules/reliverse/dler-config-health/dler-config-health.d.ts +1 -1
  84. package/bin/app/rules/reliverse/dler-config-health/dler-config-health.js +1 -1
  85. package/bin/app/schema/cmd.js +3 -3
  86. package/bin/app/{config/reltypes-content.js → schema/gen.js} +474 -228
  87. package/bin/app/schema/mod.d.ts +1224 -0
  88. package/bin/app/schema/mod.js +329 -0
  89. package/bin/app/{config/reltypes-utils.js → schema/utils.js} +6 -3
  90. package/bin/app/toolbox/cmd.js +2 -2
  91. package/bin/app/toolbox/toolbox-impl.d.ts +3 -2
  92. package/bin/app/types/mod.d.ts +10 -1518
  93. package/bin/app/types/mod.js +0 -161
  94. package/bin/app/update/impl.d.ts +1 -0
  95. package/bin/app/update/impl.js +102 -1
  96. package/bin/app/utils/common.d.ts +3 -0
  97. package/bin/app/utils/common.js +28 -0
  98. package/bin/app/utils/decideHelper.d.ts +2 -2
  99. package/bin/app/utils/downloading/downloadRepo.d.ts +2 -2
  100. package/bin/app/utils/downloading/downloadRepo.js +3 -3
  101. package/bin/app/utils/downloading/handleDownload.d.ts +2 -2
  102. package/bin/app/utils/finalize.d.ts +2 -1
  103. package/bin/app/utils/handlers/handleCleanup.js +2 -2
  104. package/bin/app/utils/handlers/handleCodemods.d.ts +2 -2
  105. package/bin/app/utils/projectRepository.d.ts +3 -4
  106. package/bin/app/utils/prompts/askUsernameFrontend.d.ts +2 -2
  107. package/bin/app/utils/prompts/askUsernameFrontend.js +3 -3
  108. package/bin/app/utils/resolve-cross-libs.js +2 -2
  109. package/bin/app/utils/startEndPrompts.d.ts +8 -2
  110. package/bin/app/utils/startEndPrompts.js +43 -12
  111. package/bin/app/utils/utils-build.d.ts +2 -2
  112. package/bin/app/utils/utils-clean.d.ts +1 -1
  113. package/bin/app/utils/utils-deps.d.ts +2 -2
  114. package/bin/app/utils/utils-determine.d.ts +1 -1
  115. package/bin/app/utils/utils-jsr-json.d.ts +2 -2
  116. package/bin/app/utils/utils-package-json-libraries.d.ts +3 -3
  117. package/bin/app/utils/utils-package-json-regular.d.ts +2 -2
  118. package/bin/dler.js +2 -92
  119. package/bin/mod.d.ts +431 -438
  120. package/bin/mod.js +36 -27
  121. package/package.json +12 -10
  122. package/bin/app/agg/cmd.d.ts +0 -72
  123. package/bin/app/agg/cmd.js +0 -128
  124. package/bin/app/cli/cmd.d.ts +0 -12
  125. package/bin/app/cli/cmd.js +0 -56
  126. package/bin/app/cli/impl.d.ts +0 -3
  127. package/bin/app/cli/impl.js +0 -88
  128. package/bin/app/config/default-cfg.d.ts +0 -3
  129. package/bin/app/config/default-cfg.js +0 -155
  130. package/bin/app/config/default.d.ts +0 -6
  131. package/bin/app/config/default.js +0 -159
  132. package/bin/app/config/schema.d.ts +0 -130
  133. package/bin/app/config/schema.js +0 -443
  134. package/bin/app/init/use-template/cp-modules/cli-main-modules/cli-menu-items/getMainMenuOptions.d.ts +0 -12
  135. package/bin/app/init/use-template/cp-modules/cli-main-modules/cli-menu-items/getMainMenuOptions.js +0 -69
  136. package/bin/app/init/use-template/cp-modules/cli-main-modules/modules/showStartEndPrompt.d.ts +0 -2
  137. package/bin/app/init/use-template/cp-modules/cli-main-modules/modules/showStartEndPrompt.js +0 -26
  138. package/bin/app/schema/schema-impl.d.ts +0 -2
  139. package/bin/app/schema/schema-impl.js +0 -24
  140. package/bin/app/update/cmd.d.ts +0 -103
  141. package/bin/app/update/cmd.js +0 -299
  142. package/bin/app/utils/native-cli/nc-impl.d.ts +0 -15
  143. package/bin/app/utils/native-cli/nc-impl.js +0 -154
  144. package/bin/app/utils/native-cli/nc-mod.d.ts +0 -3
  145. package/bin/app/utils/native-cli/nc-mod.js +0 -44
  146. package/bin/app/web/README.md +0 -149
  147. package/bin/app/web/cmd.d.ts +0 -2
  148. package/bin/app/web/cmd.js +0 -11
  149. package/bin/dler-go +0 -4
  150. package/bin/dler-rust +0 -4
  151. /package/bin/app/{config/reltypes-content.d.ts → schema/gen.d.ts} +0 -0
  152. /package/bin/app/{config/reltypes-utils.d.ts → schema/utils.d.ts} +0 -0
  153. /package/bin/app/utils/{hasOnlyRseConfig.d.ts → hasOnlyReliverseConfig.d.ts} +0 -0
  154. /package/bin/app/utils/{hasOnlyRseConfig.js → hasOnlyReliverseConfig.js} +0 -0
@@ -17,12 +17,12 @@ import type { Options as RollupDtsOptions } from "rollup-plugin-dts";
17
17
  import type { GlobOptions } from "tinyglobby";
18
18
  import type { Schema } from "untyped";
19
19
  import type { ReliverseMemory } from "../utils/schemaMemory.js";
20
+ import type { ReliverseConfig } from "../schema/mod";
20
21
  export type { TemplateUpdateInfo } from "../add/add-local/core/templates.js";
21
22
  export type { ShowMenuResult } from "../add/add-local/core/types.js";
22
23
  export type { RuleRepo, UnghRepoResponse, } from "../add/add-rule/add-rule-types.js";
23
24
  export type { AIAgentOptions, AiSdkAgent, CircularTrigger, } from "../ai/ai-impl/ai-types.js";
24
25
  export type { LintSuggestion } from "../ai/ai-impl/relinter/relinter.js";
25
- export type { MainMenuChoice } from "../init/use-template/cp-modules/cli-main-modules/cli-menu-items/getMainMenuOptions.js";
26
26
  export type { KeyType, KnownService, } from "../init/use-template/cp-modules/compose-env-file/cef-keys.js";
27
27
  export type { ConfigurationOptions } from "../init/use-template/cp-modules/git-deploy-prompts/vercel/vercel-config.js";
28
28
  export type { VercelTeam } from "../init/use-template/cp-modules/git-deploy-prompts/vercel/vercel-team.js";
@@ -42,14 +42,12 @@ export type { Hardcoded, UrlPatterns } from "../utils/replacements/reps-keys.js"
42
42
  export { handleReplacements } from "../utils/replacements/reps-mod.js";
43
43
  export type { EncryptedDataMemory, ReliverseMemory, UserDataMemory, } from "../utils/schemaMemory.js";
44
44
  export type { RepoInfo, ReposConfig } from "../utils/schemaTemplate.js";
45
- import type { Static } from "@sinclair/typebox";
46
- import type { rseSchema } from "../config/schema.js";
47
- export type RseConfig = Static<typeof rseSchema>;
48
- export type ProjectCategory = Exclude<RseConfig["projectCategory"], undefined>;
49
- export type ProjectSubcategory = Exclude<RseConfig["projectSubcategory"], undefined>;
50
- export type ProjectFramework = Exclude<RseConfig["projectFramework"], undefined>;
51
- export type ProjectArchitecture = Exclude<RseConfig["projectArchitecture"], undefined>;
52
- export type RelinterConfirm = Exclude<RseConfig["relinterConfirm"], undefined>;
45
+ export type ArgTypeShared = string | number | boolean | string[] | undefined;
46
+ export interface CommonArgs {
47
+ isCI: boolean;
48
+ isDev: boolean;
49
+ strCwd: string;
50
+ }
53
51
  export type IterableError = Iterable<{
54
52
  schema: unknown;
55
53
  path: string;
@@ -59,7 +57,7 @@ export type IterableError = Iterable<{
59
57
  export interface DetectedProject {
60
58
  name: string;
61
59
  path: string;
62
- config: RseConfig;
60
+ config: ReliverseConfig;
63
61
  gitStatus?: {
64
62
  uncommittedChanges: number;
65
63
  unpushedCommits: number;
@@ -129,8 +127,8 @@ export interface AppParams {
129
127
  cwd: string;
130
128
  isDev: boolean;
131
129
  memory: ReliverseMemory;
132
- config: RseConfig;
133
- mrse: RseConfig[];
130
+ config: ReliverseConfig;
131
+ mrse: ReliverseConfig[];
134
132
  skipPrompts: boolean;
135
133
  }
136
134
  export type ParamsOmitSkipPN = Omit<AppParams, "skipPrompts" | "projectName">;
@@ -657,1509 +655,3 @@ export type MkdistOptions = {
657
655
  compilerOptions?: TSConfig["compilerOptions"];
658
656
  };
659
657
  } & LoaderOptions;
660
- /** Configuration for directory-related settings. */
661
- export interface RelinkaDirsConfig {
662
- maxLogFiles?: number;
663
- }
664
- /** Log level types used by the logger. */
665
- export type LogLevel = "error" | "fatal" | "info" | "success" | "verbose" | "warn" | "log" | "internal" | "null" | "step" | "box" | "message";
666
- /** Configuration for a single log level. */
667
- export interface LogLevelConfig {
668
- /**
669
- * Symbol to display for this log level.
670
- * @see https://symbl.cc
671
- */
672
- symbol: string;
673
- /**
674
- * Fallback symbol to use if Unicode is not supported.
675
- */
676
- fallbackSymbol: string;
677
- /**
678
- * Color to use for this log level.
679
- */
680
- color: string;
681
- /**
682
- * Number of spaces after the symbol/fallback
683
- */
684
- spacing?: number;
685
- }
686
- /** Configuration for all log levels. */
687
- export type LogLevelsConfig = Partial<Record<LogLevel, LogLevelConfig>>;
688
- /**
689
- * Configuration options for the Relinka logger.
690
- * All properties are optional to allow for partial configuration.
691
- * Defaults will be applied during initialization.
692
- */
693
- export interface RelinkaConfig {
694
- /**
695
- * Enables verbose (aka debug) mode for detailed logging.
696
- *
697
- * `true` here works only for end-users of CLIs/libs when theirs developers
698
- * has been awaited for user's config via `@reliverse/relinka`'s `await relinkaConfig;`
699
- */
700
- verbose?: boolean;
701
- /**
702
- * Configuration for directory-related settings.
703
- * - `maxLogFiles`: The maximum number of log files to keep before cleanup.
704
- */
705
- dirs?: RelinkaDirsConfig;
706
- /**
707
- * Disables color output in the console.
708
- */
709
- disableColors?: boolean;
710
- /**
711
- * Configuration for log file output.
712
- */
713
- logFile?: {
714
- /**
715
- * Path to the log file.
716
- */
717
- outputPath?: string;
718
- /**
719
- * How to handle date in the filename.
720
- * - `disable`: No date prefix/suffix
721
- * - `append-before`: Add date before the filename (e.g., "2024-01-15-log.txt")
722
- * - `append-after`: Add date after the filename (e.g., "log-2024-01-15.txt")
723
- */
724
- nameWithDate?: "disable" | "append-before" | "append-after";
725
- /**
726
- * If true, clears the log file when relinkaConfig is executed with supportFreshLogFile: true.
727
- * This is useful for starting with a clean log file on each run.
728
- */
729
- freshLogFile?: boolean;
730
- };
731
- /**
732
- * If true, logs will be saved to a file.
733
- */
734
- saveLogsToFile?: boolean;
735
- /**
736
- * Configuration for timestamp in log messages.
737
- */
738
- timestamp?: {
739
- /**
740
- * If true, timestamps will be added to log messages.
741
- */
742
- enabled: boolean;
743
- /**
744
- * The format for timestamps. Default is YYYY-MM-DD HH:mm:ss.SSS
745
- */
746
- format?: string;
747
- };
748
- /**
749
- * Allows to customize the log levels.
750
- */
751
- levels?: LogLevelsConfig;
752
- /**
753
- * Controls how often the log cleanup runs (in milliseconds)
754
- * Default: 10000 (10 seconds)
755
- */
756
- cleanupInterval?: number;
757
- /**
758
- * Maximum size of the log write buffer before flushing to disk (in bytes)
759
- * Default: 4096 (4KB)
760
- */
761
- bufferSize?: number;
762
- /**
763
- * Maximum time to hold logs in buffer before flushing to disk (in milliseconds)
764
- * Default: 5000 (5 seconds)
765
- */
766
- maxBufferAge?: number;
767
- }
768
- /**
769
- * Defines the configuration for building and publishing packages. This includes: versioning,
770
- * build settings, publishing options, libraries-dler-plugin built-in plugin, and more.
771
- * It customizes the build and publish pipeline for both NPM and JSR registries.
772
- */
773
- export interface DlerConfig {
774
- /**
775
- * When `true`, disables version bumping.
776
- * Useful when retrying a failed publish with an already bumped version.
777
- *
778
- * @default false
779
- */
780
- bumpDisable: boolean;
781
- /**
782
- * Controls which files will have their version numbers updated during version bumping.
783
- *
784
- * Accepts:
785
- * - Standard file types like "package.json"
786
- * - Relative paths like "src/constants.ts"
787
- * - [Globbing patterns](https://github.com/mrmlnc/fast-glob#pattern-syntax)
788
- *
789
- * When empty, falls back to only updating "package.json".
790
- * Respects: .gitignore patterns, hidden files, .git & node_modules.
791
- *
792
- * @default ["package.json", "reliverse.ts"]
793
- */
794
- bumpFilter: string[];
795
- /**
796
- * Specifies how the version number should be incremented:
797
- * - `patch`: Increments the patch version for backwards-compatible bug fixes (1.2.3 → 1.2.4)
798
- * - `minor`: Increments the minor version for new backwards-compatible features (1.2.3 → 1.3.0)
799
- * - `major`: Increments the major version for breaking changes (1.2.3 → 2.0.0)
800
- * - `auto`: Automatically determine the appropriate bump type
801
- * - `manual`: Set a specific version (requires bumpSet to be set)
802
- *
803
- * Please note: `dler` infers the version from the `package.json` file.
804
- *
805
- * @default "patch"
806
- */
807
- bumpMode: BumpMode;
808
- /**
809
- * Custom version to set when bumpMode is "manual".
810
- * Must be a valid semver version (e.g., "1.2.3").
811
- *
812
- * @default ""
813
- */
814
- bumpSet: string;
815
- /**
816
- * When `true`, stops after building and retains distribution folders.
817
- * Useful for development or inspecting the build output.
818
- *
819
- * @default true
820
- */
821
- commonPubPause: boolean;
822
- /**
823
- * Specifies which package registries to publish to:
824
- * - `npm`: Publish only to the NPM commonPubRegistry.
825
- * - `jsr`: Publish only to the JSR commonPubRegistry.
826
- * - `npm-jsr`: Publish to both NPM and JSR registries.
827
- *
828
- * @default "npm"
829
- */
830
- commonPubRegistry: "jsr" | "npm" | "npm-jsr";
831
- /**
832
- * When `true`, enables detailed logs during the build and publish process.
833
- * Useful for debugging or understanding the build flow.
834
- *
835
- * @default false
836
- */
837
- commonVerbose: boolean;
838
- /**
839
- * When `true`, displays detailed build and publish logs.
840
- * When `false`, only shows spinner with status messages during build and publish.
841
- *
842
- * @default true
843
- */
844
- displayBuildPubLogs: boolean;
845
- /**
846
- * When `true`, generates TypeScript declaration files (.d.ts) for NPM packages.
847
- * Essential for providing type intranspileFormation to TypeScript users.
848
- *
849
- * To reduce bundle size you can set this to `false` if your main project
850
- * is planned to be used only as a global CLI tool (e.g. `bunx dler`).
851
- *
852
- * @default true
853
- */
854
- coreDeclarations: boolean;
855
- /**
856
- * Path to the project's main entry file.
857
- * Used as the entry point for the NPM package.
858
- *
859
- * @default "mod.ts"
860
- */
861
- coreEntryFile: string;
862
- /**
863
- * Base directory containing the source entry files.
864
- * All paths are resolved relative to this directory.
865
- * Set to `"."` if entry files are in the project root.
866
- *
867
- * @default "src"
868
- */
869
- coreEntrySrcDir: string;
870
- /**
871
- * Directory where built files will be placed within the distribution directory.
872
- * For example, if set to "bin", CLI scripts will be placed in "dist-npm/bin" or "dist-jsr/bin".
873
- *
874
- * @default "bin"
875
- */
876
- coreBuildOutDir: string;
877
- /**
878
- * Configuration for CLI functionality:
879
- * - enabled: When `true`, indicates that the package has CLI capabilities
880
- * - scripts: Map of CLI script names to their entry file paths
881
- * The key will be used as the command name in package.json's bin field
882
- * The value should be the path to the executable script (e.g. "cli.ts")
883
- *
884
- * **The source scripts should be in your "coreEntrySrcDir" directory (by default "src")**
885
- *
886
- * @example
887
- * {
888
- * enabled: true,
889
- * scripts: {
890
- * "mycli": "cli.ts",
891
- * "othercmd": "other-cmd.ts"
892
- * }
893
- * }
894
- *
895
- * @default { enabled: false, scripts: {} }
896
- */
897
- coreIsCLI: {
898
- enabled: boolean;
899
- scripts: Record<string, string>;
900
- };
901
- /**
902
- * Optional description that overrides the description from package.json.
903
- * When provided, this description will be used in the dist's package.json.
904
- * If not provided, the description from the original package.json will be used.
905
- *
906
- * @default `package.json`'s "description"
907
- */
908
- coreDescription: string;
909
- /**
910
- * When `true`, allows JSR publishing even with uncommitted changes.
911
- * Use with caution, as it may lead to inconsistent published versions.
912
- *
913
- * It is `true` by default to make it easier for new `dler` users to publish their projects.
914
- *
915
- * @default true
916
- */
917
- distJsrAllowDirty: boolean;
918
- /**
919
- * The bundler to use for creating JSR-compatible packages.
920
- * JSR's native bundler is recommended for best compatibility.
921
- *
922
- * @default "jsr"
923
- */
924
- distJsrBuilder: BundlerName;
925
- /**
926
- * Directory where JSR build artifacts are generated.
927
- * This directory will contain the package ready for JSR publishing.
928
- *
929
- * @default "dist-jsr"
930
- */
931
- distJsrDirName: string;
932
- /**
933
- * When `true`, simulates the publishing process without actually publishing.
934
- * Useful for testing the build and publish pipeline without side effects.
935
- *
936
- * @default false
937
- */
938
- distJsrDryRun: boolean;
939
- /**
940
- * When `true`, fails the build if warnings are detected.
941
- * Use with caution, as it may lead to inconsistent published versions.
942
- *
943
- * @default false
944
- */
945
- distJsrFailOnWarn: boolean;
946
- /**
947
- * When `true`, generates a `jsconfig.json` file for JSR's dist.
948
- *
949
- * @default false
950
- */
951
- distJsrGenTsconfig: boolean;
952
- /**
953
- * The file extension for output files in JSR packages.
954
- *
955
- * @default "ts"
956
- */
957
- distJsrOutFilesExt: NpmOutExt;
958
- /**
959
- * When `true`, enables JSR to process complex types, which may impact performance.
960
- * Enable this only if you cannot simplify or explicitly define exported types.
961
- *
962
- * JSR requires exported functions, classes, variables, and type aliases to have
963
- * explicitly written or easily inferred types. Otherwise, it may be unable to
964
- * generate documentation, type declarations for npm compatibility, or efficient
965
- * type checking for consumers.
966
- *
967
- * If "slow types" are present, type checking performance may degrade, and some
968
- * features may not work as expected.
969
- *
970
- * It is `true` by default to make it easier for new `dler` users to publish their projects.
971
- *
972
- * @see https://jsr.io/docs/about-slow-types
973
- * @default true
974
- */
975
- distJsrSlowTypes: boolean;
976
- /**
977
- * The bundler to use for creating NPM-compatible packages.
978
- *
979
- * @default "mkdist"
980
- */
981
- distNpmBuilder: BundlerName;
982
- /**
983
- * Directory where NPM build artifacts are generated.
984
- * This directory will contain the package ready for NPM publishing.
985
- *
986
- * @default "dist-npm"
987
- */
988
- distNpmDirName: string;
989
- /**
990
- * Specifies the file extension for output files in NPM packages.
991
- * Determines the extension of compiled files in the NPM distribution.
992
- * We strongly recommend using `"js"` with the `"esm"` transpileFormat.
993
- *
994
- * @default "js"
995
- */
996
- distNpmOutFilesExt: NpmOutExt;
997
- /**
998
- * !! EXPERIMENTAL !!
999
- * Controls which parts of the project are built and published:
1000
- * - `main-project-only`: Builds/publishes only the main package.
1001
- * - `main-and-libs`: Builds/publishes both the main package and libraries.
1002
- * - `libs-only`: Builds/publishes only the libraries.
1003
- *
1004
- * @default "main-project-only"
1005
- */
1006
- libsActMode: "libs-only" | "main-and-libs" | "main-project-only";
1007
- /**
1008
- * The directory where built libraries are stored before publishing.
1009
- *
1010
- * @default "dist-libs"
1011
- */
1012
- libsDirDist: string;
1013
- /**
1014
- * The directory containing library source files.
1015
- *
1016
- * @default "src/libs"
1017
- */
1018
- libsDirSrc: string;
1019
- /**
1020
- * !! EXPERIMENTAL !!
1021
- * Configuration for building and publishing multiple libraries.
1022
- * Each key represents a package name, and its value contains the configuration.
1023
- *
1024
- * @example
1025
- * {
1026
- * "@myorg/ml1": { main: "my-lib-1/mod.ts" },
1027
- * "@myorg/ml2": { main: "my-lib-2/ml2-mod.ts" },
1028
- * "@myorg/ml3": { main: "src/libs/my-lib-3/index.js" }
1029
- * }
1030
- */
1031
- libsList: Record<string, LibConfig>;
1032
- /**
1033
- * The name of the log file. dler uses `@reliverse/relinka` for logging.
1034
- *
1035
- * @default ".logs/relinka.log"
1036
- */
1037
- logsFileName: string;
1038
- /**
1039
- * When `true`, cleans up the log file from previous runs.
1040
- *
1041
- * @default false
1042
- */
1043
- logsFreshFile: boolean;
1044
- /**
1045
- * Configuration for dependency removal/injection patterns.
1046
- * Controls which dependencies are excluded from (or injected into) the final package.
1047
- *
1048
- * Pattern types:
1049
- * - Regular patterns: Exclude deps that match the pattern
1050
- * - Negation patterns (starting with !): Don't exclude deps that match the pattern
1051
- * - Add patterns (starting with +): Inject deps into specific dists even if original package.json doesn't have them
1052
- *
1053
- * Structure (dist-specific patterns are merged with global):
1054
- * - `global`: Patterns that are always applied to all builds
1055
- * - `dist-npm`: NPM-specific patterns
1056
- * - `dist-jsr`: JSR-specific patterns
1057
- * - `dist-libs`: Library-specific patterns
1058
- * Each library can have separate NPM and JSR patterns
1059
- *
1060
- * @example
1061
- * {
1062
- * global: ["@types", "eslint"],
1063
- * "dist-npm": ["npm-specific"],
1064
- * "dist-jsr": ["+bun"], // Explicitly include 'bun' in JSR builds
1065
- * "dist-libs": {
1066
- * "@myorg/lib1": {
1067
- * npm: ["lib1-npm-specific"],
1068
- * jsr: ["+bun"] // Explicitly include 'bun' in this lib's JSR build
1069
- * }
1070
- * }
1071
- * }
1072
- */
1073
- filterDepsPatterns: {
1074
- global: string[];
1075
- "dist-npm": string[];
1076
- "dist-jsr": string[];
1077
- "dist-libs": Record<string, {
1078
- npm: string[];
1079
- jsr: string[];
1080
- }>;
1081
- };
1082
- /**
1083
- * List of tools to run before the build process starts.
1084
- * Available options: "tsc", "eslint", "biome", "knip", "dler-check"
1085
- * Each tool will only run if it's installed in the system.
1086
- *
1087
- * @default []
1088
- */
1089
- runBeforeBuild: ("tsc" | "eslint" | "biome" | "knip" | "dler-check")[];
1090
- /**
1091
- * List of tools to run after the build process completes.
1092
- * Available options: "dler-check"
1093
- * Each tool will only run if it's installed in the system.
1094
- *
1095
- * @default []
1096
- */
1097
- runAfterBuild: "dler-check"[];
1098
- /**
1099
- * Array of functions to be executed before the build process starts.
1100
- * These hooks will be called in sequence before any build steps.
1101
- *
1102
- * If you are a dler plugin developer, tell your users to
1103
- * call your plugin's `beforeBuild`-related function here.
1104
- *
1105
- * @example
1106
- * hooksBeforeBuild: [
1107
- * async () => {
1108
- * // Custom pre-build logic
1109
- * await someAsyncOperation();
1110
- *
1111
- * // dler-plugin-my-plugin-name
1112
- * await myPluginName_beforeBuild();
1113
- * }
1114
- * ]
1115
- *
1116
- * @default []
1117
- */
1118
- hooksBeforeBuild: (() => Promise<void>)[];
1119
- /**
1120
- * Array of functions to be executed after the build process completes.
1121
- * These hooks will be called in sequence after all build steps.
1122
- *
1123
- * If you are a dler plugin developer, tell your users to
1124
- * call your plugin's `afterBuild`-related function here.
1125
- *
1126
- * @example
1127
- * hooksAfterBuild: [
1128
- * async () => {
1129
- * // Custom post-build logic
1130
- * await someAsyncOperation();
1131
- *
1132
- * // dler-plugin-my-plugin-name
1133
- * await myPluginName_afterBuild();
1134
- * }
1135
- * ]
1136
- *
1137
- * @default []
1138
- */
1139
- hooksAfterBuild: (() => Promise<void>)[];
1140
- /**
1141
- * When `true`, cleans up the temporary directories after the build process completes.
1142
- *
1143
- * @default true
1144
- */
1145
- postBuildSettings: {
1146
- deleteDistTmpAfterBuild: boolean;
1147
- };
1148
- /**
1149
- * When `true`, fails the build if warnings are detected.
1150
- * Use with caution, as it may lead to inconsistent published versions.
1151
- *
1152
- * @default false
1153
- */
1154
- transpileFailOnWarn: boolean;
1155
- /**
1156
- * The transpileTarget runtime environment for the built package.
1157
- *
1158
- * @default "es2023"
1159
- */
1160
- transpileEsbuild: Esbuild;
1161
- /**
1162
- * Output module transpileFormat for built files:
1163
- * - `esm`: ECMAScript modules (import/export)
1164
- * - `cjs`: CommonJS modules (require/exports)
1165
- * - `iife`: Immediately Invoked Function Expression (for browsers)
1166
- *
1167
- * @default "esm"
1168
- */
1169
- transpileFormat: transpileFormat;
1170
- /**
1171
- * When `true`, minifies the output to reduce bundle size.
1172
- * Recommended for production builds but may increase build time.
1173
- *
1174
- * @default true
1175
- */
1176
- transpileMinify: boolean;
1177
- /**
1178
- * The base URL for loading assets in the built package.
1179
- * Important for packages that include assets like images or fonts.
1180
- *
1181
- * @default "/"
1182
- */
1183
- transpilePublicPath: string;
1184
- /**
1185
- * Controls source map generation for debugging (experimental):
1186
- * - `true/false`: Enable/disable source maps.
1187
- * - `"inline"`: Include source maps within output files.
1188
- * - `"none"`: Do not generate source maps.
1189
- * - `"linked"`: Generate separate source map files with links.
1190
- * - `"external"`: Generate separate source map files.
1191
- *
1192
- * @default false
1193
- */
1194
- transpileSourcemap: Sourcemap;
1195
- /**
1196
- * When `true`, enables code transpileSplitting for improved load-time performance.
1197
- * Useful for large applications but may not be needed for small projects.
1198
- *
1199
- * @default false
1200
- */
1201
- transpileSplitting: boolean;
1202
- /**
1203
- * Stub the package for JIT compilation.
1204
- *
1205
- * @default false
1206
- */
1207
- transpileStub: boolean;
1208
- /**
1209
- * Defines the transpileTarget runtime environment:
1210
- * - `node`: Optimized for Node.js.
1211
- * - `bun`: Optimized for Bun.
1212
- * - `browser`: Optimized for web browsers.
1213
- *
1214
- * @default "node"
1215
- */
1216
- transpileTarget: transpileTarget;
1217
- /**
1218
- * Watch the src dir and rebuild on change (experimental).
1219
- *
1220
- * @default false
1221
- */
1222
- transpileWatch: boolean;
1223
- /**
1224
- * Specifies what resources to send to npm and jsr registries.
1225
- * coreBuildOutDir (e.g. "bin") dir is automatically included.
1226
- * The following is also included if publishArtifacts is {}:
1227
- * - global: ["package.json", "README.md", "LICENSE"]
1228
- * - dist-jsr,dist-libs/jsr: ["jsr.json"]
1229
- *
1230
- * Structure:
1231
- * - `global`: Files to include in all distributions
1232
- * - `dist-jsr`: Files specific to JSR distribution
1233
- * - `dist-npm`: Files specific to NPM distribution
1234
- * - `dist-libs`: Library-specific files for each distribution type
1235
- *
1236
- * Useful for including additional files like configuration or documentation.
1237
- * Pro tip: set jsr.jsonc to generate jsr.jsonc instead of jsr.json config.
1238
- *
1239
- * @default
1240
- * {
1241
- * global: ["bin", "package.json", "README.md", "LICENSE"],
1242
- * "dist-jsr": ["jsr.json"],
1243
- * "dist-npm": [],
1244
- * "dist-libs": {
1245
- * "@myorg/lib1": {
1246
- * jsr: ["jsr.json"],
1247
- * npm: []
1248
- * }
1249
- * }
1250
- * }
1251
- */
1252
- publishArtifacts?: {
1253
- global: string[];
1254
- "dist-jsr": string[];
1255
- "dist-npm": string[];
1256
- "dist-libs": Record<string, {
1257
- jsr: string[];
1258
- npm: string[];
1259
- }>;
1260
- };
1261
- /**
1262
- * File extensions that should be copied to temporary build directories during pre-build.
1263
- * These files will be processed by the bundlers.
1264
- * All other files will be copied as-is to final dist directories during post-build.
1265
- * @default ["ts", "js"]
1266
- */
1267
- buildPreExtensions: string[];
1268
- /**
1269
- * Directory name for templates that should be excluded from pre-build processing.
1270
- * Files in this directory will be copied as-is during post-build.
1271
- * @default "templates"
1272
- */
1273
- buildTemplatesDir: string;
1274
- /**
1275
- * Integrated relinka logger configuration.
1276
- * @see https://github.com/reliverse/relinka
1277
- *
1278
- * @default See DEFAULT_RELINKA_CONFIG in defaults
1279
- */
1280
- relinka: RelinkaConfig;
1281
- }
1282
- export type BumpMode = "patch" | "minor" | "major" | "auto" | "manual";
1283
- /**
1284
- * Supported bundler names for building packages:
1285
- * - bun: Bun's built-in bundler for fast builds
1286
- * - copy: A simple file copy without bundling
1287
- * - jsr: Similar to copy but optimized for the JSR commonPubRegistry
1288
- * - mkdist: A lightweight bundler focused on TypeScript/ESM
1289
- * - rollup: A traditional bundler with an extensive plugin ecosystem
1290
- * - untyped: Types and markdown generation from a config object
1291
- */
1292
- export type BundlerName = "bun" | "copy" | "jsr" | "mkdist" | "rollup" | "untyped";
1293
- export type NpmOutExt = "cjs" | "cts" | "js" | "mjs" | "mts" | "ts";
1294
- /**
1295
- * Configuration for a library to be built and published as a separate package.
1296
- * Used when publishing multiple packages from a single repository.
1297
- */
1298
- export interface LibConfig {
1299
- /**
1300
- * When `true`, generates TypeScript declaration files (.d.ts) for NPM packages.
1301
- */
1302
- libDeclarations: boolean;
1303
- /**
1304
- * An optional description of the library, included in the dist's package.json.
1305
- * Provides users with an overview of the library's purpose.
1306
- *
1307
- * @example "Utility functions for data manipulation"
1308
- * @example "Core configuration module for the framework"
1309
- *
1310
- * @default `package.json`'s "description"
1311
- */
1312
- libDescription: string;
1313
- /**
1314
- * The directory where the library's dist files are stored.
1315
- *
1316
- * @default name is derived from the library's name after slash
1317
- */
1318
- libDirName: string;
1319
- /**
1320
- * The path to the library's main entry file.
1321
- * This file serves as the primary entry point for imports.
1322
- * The path should be relative to the project root.
1323
- * The full path to the library's main file is derived by joining `libsDirDist` with `main`.
1324
- *
1325
- * @example "my-lib-1/mod.ts"
1326
- * @example "my-lib-2/ml2-mod.ts"
1327
- * @example "src/libs/my-lib-3/index.js"
1328
- */
1329
- libMainFile: string;
1330
- /**
1331
- * Dependencies to include in the dist's package.json.
1332
- * The final output may vary based on `filterDepsPatterns`.
1333
- * Defines how dependencies are handled during publishing:
1334
- * - `string[]`: Includes only the specified dependencies.
1335
- * - `true`: Includes all dependencies from the main package.json.
1336
- * - `false` or `undefined`: Automatically determines dependencies based on imports.
1337
- *
1338
- * @example ["@reliverse/pathkit", "@reliverse/relifso"] - Only will include these specific dependencies.
1339
- * @example true - Include all `dependencies` from the main package.json.
1340
- */
1341
- libPkgKeepDeps: boolean | string[];
1342
- /**
1343
- * When `true`, minifies the output to reduce bundle size.
1344
- * Recommended for production builds but may increase build time.
1345
- *
1346
- * @default true
1347
- */
1348
- libTranspileMinify: boolean;
1349
- /**
1350
- * When true, pauses publishing for this specific library (overridden by commonPubPause).
1351
- * If true, this library will be built but not published, even if other libs are published.
1352
- *
1353
- * @default false
1354
- */
1355
- libPubPause?: boolean;
1356
- /**
1357
- * The registry to publish the library to.
1358
- *
1359
- * @default "npm"
1360
- */
1361
- libPubRegistry?: "jsr" | "npm" | "npm-jsr";
1362
- /**
1363
- * Optional version override for the library.
1364
- * If not provided, falls back to the version from the main package.json.
1365
- *
1366
- * @default `package.json`'s "version"
1367
- */
1368
- version?: string;
1369
- }
1370
- export type Esbuild = "es2019" | "es2020" | "es2021" | "es2022" | "es2023";
1371
- /**
1372
- * Supported output module transpileFormats for built packages.
1373
- * - esm: ECMAScript modules (import/export)
1374
- * - cjs: CommonJS modules (require/exports)
1375
- * - iife: Immediately Invoked Function Expression (for browsers)
1376
- */
1377
- export type transpileFormat = "cjs" | "esm" | "iife";
1378
- /**
1379
- * Supported source map options for built packages.
1380
- * - boolean: Enable/disable source maps.
1381
- * - "inline": Include source maps within output files.
1382
- * - "none": Do not generate source maps.
1383
- * - "linked": Generate separate source map files with links.
1384
- * - "external": Generate separate source map files.
1385
- */
1386
- export type Sourcemap = "external" | "inline" | "linked" | "none" | boolean;
1387
- /**
1388
- * Supported transpileTarget runtime environments for built packages.
1389
- * - node: Optimized for Node.js.
1390
- * - bun: Optimized for Bun.
1391
- * - browser: Optimized for web browsers.
1392
- */
1393
- export type transpileTarget = "browser" | "bun" | "node";
1394
- /** Configuration for directory-related settings. */
1395
- export interface RelinkaDirsConfig {
1396
- maxLogFiles?: number;
1397
- }
1398
- /** Configuration for a single log level. */
1399
- export interface LogLevelConfig {
1400
- /**
1401
- * Symbol to display for this log level.
1402
- * @see https://symbl.cc
1403
- */
1404
- symbol: string;
1405
- /**
1406
- * Fallback symbol to use if Unicode is not supported.
1407
- */
1408
- fallbackSymbol: string;
1409
- /**
1410
- * Color to use for this log level.
1411
- */
1412
- color: string;
1413
- /**
1414
- * Number of spaces after the symbol/fallback
1415
- */
1416
- spacing?: number;
1417
- }
1418
- /**
1419
- * Configuration options for the Relinka logger.
1420
- * All properties are optional to allow for partial configuration.
1421
- * Defaults will be applied during initialization.
1422
- */
1423
- export interface RelinkaConfig {
1424
- /**
1425
- * Enables verbose (aka debug) mode for detailed logging.
1426
- *
1427
- * `true` here works only for end-users of CLIs/libs when theirs developers
1428
- * has been awaited for user's config via `@reliverse/relinka`'s `await relinkaConfig;`
1429
- */
1430
- verbose?: boolean;
1431
- /**
1432
- * Configuration for directory-related settings.
1433
- * - `maxLogFiles`: The maximum number of log files to keep before cleanup.
1434
- */
1435
- dirs?: RelinkaDirsConfig;
1436
- /**
1437
- * Disables color output in the console.
1438
- */
1439
- disableColors?: boolean;
1440
- /**
1441
- * Configuration for log file output.
1442
- */
1443
- logFile?: {
1444
- /**
1445
- * Path to the log file.
1446
- */
1447
- outputPath?: string;
1448
- /**
1449
- * How to handle date in the filename.
1450
- * - `disable`: No date prefix/suffix
1451
- * - `append-before`: Add date before the filename (e.g., "2024-01-15-log.txt")
1452
- * - `append-after`: Add date after the filename (e.g., "log-2024-01-15.txt")
1453
- */
1454
- nameWithDate?: "disable" | "append-before" | "append-after";
1455
- /**
1456
- * If true, clears the log file when relinkaConfig is executed with supportFreshLogFile: true.
1457
- * This is useful for starting with a clean log file on each run.
1458
- */
1459
- freshLogFile?: boolean;
1460
- };
1461
- /**
1462
- * If true, logs will be saved to a file.
1463
- */
1464
- saveLogsToFile?: boolean;
1465
- /**
1466
- * Configuration for timestamp in log messages.
1467
- */
1468
- timestamp?: {
1469
- /**
1470
- * If true, timestamps will be added to log messages.
1471
- */
1472
- enabled: boolean;
1473
- /**
1474
- * The format for timestamps. Default is YYYY-MM-DD HH:mm:ss.SSS
1475
- */
1476
- format?: string;
1477
- };
1478
- /**
1479
- * Allows to customize the log levels.
1480
- */
1481
- levels?: LogLevelsConfig;
1482
- /**
1483
- * Controls how often the log cleanup runs (in milliseconds)
1484
- * Default: 10000 (10 seconds)
1485
- */
1486
- cleanupInterval?: number;
1487
- /**
1488
- * Maximum size of the log write buffer before flushing to disk (in bytes)
1489
- * Default: 4096 (4KB)
1490
- */
1491
- bufferSize?: number;
1492
- /**
1493
- * Maximum time to hold logs in buffer before flushing to disk (in milliseconds)
1494
- * Default: 5000 (5 seconds)
1495
- */
1496
- maxBufferAge?: number;
1497
- }
1498
- /**
1499
- * Defines the configuration for building and publishing packages. This includes: versioning,
1500
- * build settings, publishing options, libraries-dler-plugin built-in plugin, and more.
1501
- * It customizes the build and publish pipeline for both NPM and JSR registries.
1502
- */
1503
- export interface DlerConfig {
1504
- /**
1505
- * When `true`, disables version bumping.
1506
- * Useful when retrying a failed publish with an already bumped version.
1507
- *
1508
- * @default false
1509
- */
1510
- bumpDisable: boolean;
1511
- /**
1512
- * Controls which files will have their version numbers updated during version bumping.
1513
- *
1514
- * Accepts:
1515
- * - Standard file types like "package.json"
1516
- * - Relative paths like "src/constants.ts"
1517
- * - [Globbing patterns](https://github.com/mrmlnc/fast-glob#pattern-syntax)
1518
- *
1519
- * When empty, falls back to only updating "package.json".
1520
- * Respects: .gitignore patterns, hidden files, .git & node_modules.
1521
- *
1522
- * @default ["package.json", "reliverse.ts"]
1523
- */
1524
- bumpFilter: string[];
1525
- /**
1526
- * Specifies how the version number should be incremented:
1527
- * - `patch`: Increments the patch version for backwards-compatible bug fixes (1.2.3 → 1.2.4)
1528
- * - `minor`: Increments the minor version for new backwards-compatible features (1.2.3 → 1.3.0)
1529
- * - `major`: Increments the major version for breaking changes (1.2.3 → 2.0.0)
1530
- * - `auto`: Automatically determine the appropriate bump type
1531
- * - `manual`: Set a specific version (requires bumpSet to be set)
1532
- *
1533
- * Please note: `dler` infers the version from the `package.json` file.
1534
- *
1535
- * @default "patch"
1536
- */
1537
- bumpMode: BumpMode;
1538
- /**
1539
- * Custom version to set when bumpMode is "manual".
1540
- * Must be a valid semver version (e.g., "1.2.3").
1541
- *
1542
- * @default ""
1543
- */
1544
- bumpSet: string;
1545
- /**
1546
- * When `true`, stops after building and retains distribution folders.
1547
- * Useful for development or inspecting the build output.
1548
- *
1549
- * @default true
1550
- */
1551
- commonPubPause: boolean;
1552
- /**
1553
- * Specifies which package registries to publish to:
1554
- * - `npm`: Publish only to the NPM commonPubRegistry.
1555
- * - `jsr`: Publish only to the JSR commonPubRegistry.
1556
- * - `npm-jsr`: Publish to both NPM and JSR registries.
1557
- *
1558
- * @default "npm"
1559
- */
1560
- commonPubRegistry: "jsr" | "npm" | "npm-jsr";
1561
- /**
1562
- * When `true`, enables detailed logs during the build and publish process.
1563
- * Useful for debugging or understanding the build flow.
1564
- *
1565
- * @default false
1566
- */
1567
- commonVerbose: boolean;
1568
- /**
1569
- * When `true`, displays detailed build and publish logs.
1570
- * When `false`, only shows spinner with status messages during build and publish.
1571
- *
1572
- * @default true
1573
- */
1574
- displayBuildPubLogs: boolean;
1575
- /**
1576
- * When `true`, generates TypeScript declaration files (.d.ts) for NPM packages.
1577
- * Essential for providing type intranspileFormation to TypeScript users.
1578
- *
1579
- * To reduce bundle size you can set this to `false` if your main project
1580
- * is planned to be used only as a global CLI tool (e.g. `bunx dler`).
1581
- *
1582
- * @default true
1583
- */
1584
- coreDeclarations: boolean;
1585
- /**
1586
- * Path to the project's main entry file.
1587
- * Used as the entry point for the NPM package.
1588
- *
1589
- * @default "mod.ts"
1590
- */
1591
- coreEntryFile: string;
1592
- /**
1593
- * Base directory containing the source entry files.
1594
- * All paths are resolved relative to this directory.
1595
- * Set to `"."` if entry files are in the project root.
1596
- *
1597
- * @default "src"
1598
- */
1599
- coreEntrySrcDir: string;
1600
- /**
1601
- * Directory where built files will be placed within the distribution directory.
1602
- * For example, if set to "bin", CLI scripts will be placed in "dist-npm/bin" or "dist-jsr/bin".
1603
- *
1604
- * @default "bin"
1605
- */
1606
- coreBuildOutDir: string;
1607
- /**
1608
- * Configuration for CLI functionality:
1609
- * - enabled: When `true`, indicates that the package has CLI capabilities
1610
- * - scripts: Map of CLI script names to their entry file paths
1611
- * The key will be used as the command name in package.json's bin field
1612
- * The value should be the path to the executable script (e.g. "cli.ts")
1613
- *
1614
- * **The source scripts should be in your "coreEntrySrcDir" directory (by default "src")**
1615
- *
1616
- * @example
1617
- * {
1618
- * enabled: true,
1619
- * scripts: {
1620
- * "mycli": "cli.ts",
1621
- * "othercmd": "other-cmd.ts"
1622
- * }
1623
- * }
1624
- *
1625
- * @default { enabled: false, scripts: {} }
1626
- */
1627
- coreIsCLI: {
1628
- enabled: boolean;
1629
- scripts: Record<string, string>;
1630
- };
1631
- /**
1632
- * Optional description that overrides the description from package.json.
1633
- * When provided, this description will be used in the dist's package.json.
1634
- * If not provided, the description from the original package.json will be used.
1635
- *
1636
- * @default `package.json`'s "description"
1637
- */
1638
- coreDescription: string;
1639
- /**
1640
- * When `true`, allows JSR publishing even with uncommitted changes.
1641
- * Use with caution, as it may lead to inconsistent published versions.
1642
- *
1643
- * It is `true` by default to make it easier for new `dler` users to publish their projects.
1644
- *
1645
- * @default true
1646
- */
1647
- distJsrAllowDirty: boolean;
1648
- /**
1649
- * The bundler to use for creating JSR-compatible packages.
1650
- * JSR's native bundler is recommended for best compatibility.
1651
- *
1652
- * @default "jsr"
1653
- */
1654
- distJsrBuilder: BundlerName;
1655
- /**
1656
- * Directory where JSR build artifacts are generated.
1657
- * This directory will contain the package ready for JSR publishing.
1658
- *
1659
- * @default "dist-jsr"
1660
- */
1661
- distJsrDirName: string;
1662
- /**
1663
- * When `true`, simulates the publishing process without actually publishing.
1664
- * Useful for testing the build and publish pipeline without side effects.
1665
- *
1666
- * @default false
1667
- */
1668
- distJsrDryRun: boolean;
1669
- /**
1670
- * When `true`, fails the build if warnings are detected.
1671
- * Use with caution, as it may lead to inconsistent published versions.
1672
- *
1673
- * @default false
1674
- */
1675
- distJsrFailOnWarn: boolean;
1676
- /**
1677
- * When `true`, generates a `jsconfig.json` file for JSR's dist.
1678
- *
1679
- * @default false
1680
- */
1681
- distJsrGenTsconfig: boolean;
1682
- /**
1683
- * The file extension for output files in JSR packages.
1684
- *
1685
- * @default "ts"
1686
- */
1687
- distJsrOutFilesExt: NpmOutExt;
1688
- /**
1689
- * When `true`, enables JSR to process complex types, which may impact performance.
1690
- * Enable this only if you cannot simplify or explicitly define exported types.
1691
- *
1692
- * JSR requires exported functions, classes, variables, and type aliases to have
1693
- * explicitly written or easily inferred types. Otherwise, it may be unable to
1694
- * generate documentation, type declarations for npm compatibility, or efficient
1695
- * type checking for consumers.
1696
- *
1697
- * If "slow types" are present, type checking performance may degrade, and some
1698
- * features may not work as expected.
1699
- *
1700
- * It is `true` by default to make it easier for new `dler` users to publish their projects.
1701
- *
1702
- * @see https://jsr.io/docs/about-slow-types
1703
- * @default true
1704
- */
1705
- distJsrSlowTypes: boolean;
1706
- /**
1707
- * The bundler to use for creating NPM-compatible packages.
1708
- *
1709
- * @default "mkdist"
1710
- */
1711
- distNpmBuilder: BundlerName;
1712
- /**
1713
- * Directory where NPM build artifacts are generated.
1714
- * This directory will contain the package ready for NPM publishing.
1715
- *
1716
- * @default "dist-npm"
1717
- */
1718
- distNpmDirName: string;
1719
- /**
1720
- * Specifies the file extension for output files in NPM packages.
1721
- * Determines the extension of compiled files in the NPM distribution.
1722
- * We strongly recommend using `"js"` with the `"esm"` transpileFormat.
1723
- *
1724
- * @default "js"
1725
- */
1726
- distNpmOutFilesExt: NpmOutExt;
1727
- /**
1728
- * !! EXPERIMENTAL !!
1729
- * Controls which parts of the project are built and published:
1730
- * - `main-project-only`: Builds/publishes only the main package.
1731
- * - `main-and-libs`: Builds/publishes both the main package and libraries.
1732
- * - `libs-only`: Builds/publishes only the libraries.
1733
- *
1734
- * @default "main-project-only"
1735
- */
1736
- libsActMode: "libs-only" | "main-and-libs" | "main-project-only";
1737
- /**
1738
- * The directory where built libraries are stored before publishing.
1739
- *
1740
- * @default "dist-libs"
1741
- */
1742
- libsDirDist: string;
1743
- /**
1744
- * The directory containing library source files.
1745
- *
1746
- * @default "src/libs"
1747
- */
1748
- libsDirSrc: string;
1749
- /**
1750
- * !! EXPERIMENTAL !!
1751
- * Configuration for building and publishing multiple libraries.
1752
- * Each key represents a package name, and its value contains the configuration.
1753
- *
1754
- * @example
1755
- * {
1756
- * "@myorg/ml1": { main: "my-lib-1/mod.ts" },
1757
- * "@myorg/ml2": { main: "my-lib-2/ml2-mod.ts" },
1758
- * "@myorg/ml3": { main: "src/libs/my-lib-3/index.js" }
1759
- * }
1760
- */
1761
- libsList: Record<string, LibConfig>;
1762
- /**
1763
- * The name of the log file. dler uses `@reliverse/relinka` for logging.
1764
- *
1765
- * @default ".logs/relinka.log"
1766
- */
1767
- logsFileName: string;
1768
- /**
1769
- * When `true`, cleans up the log file from previous runs.
1770
- *
1771
- * @default false
1772
- */
1773
- logsFreshFile: boolean;
1774
- /**
1775
- * Configuration for dependency removal/injection patterns.
1776
- * Controls which dependencies are excluded from (or injected into) the final package.
1777
- *
1778
- * Pattern types:
1779
- * - Regular patterns: Exclude deps that match the pattern
1780
- * - Negation patterns (starting with !): Don't exclude deps that match the pattern
1781
- * - Add patterns (starting with +): Inject deps into specific dists even if original package.json doesn't have them
1782
- *
1783
- * Structure (dist-specific patterns are merged with global):
1784
- * - `global`: Patterns that are always applied to all builds
1785
- * - `dist-npm`: NPM-specific patterns
1786
- * - `dist-jsr`: JSR-specific patterns
1787
- * - `dist-libs`: Library-specific patterns
1788
- * Each library can have separate NPM and JSR patterns
1789
- *
1790
- * @example
1791
- * {
1792
- * global: ["@types", "eslint"],
1793
- * "dist-npm": ["npm-specific"],
1794
- * "dist-jsr": ["+bun"], // Explicitly include 'bun' in JSR builds
1795
- * "dist-libs": {
1796
- * "@myorg/lib1": {
1797
- * npm: ["lib1-npm-specific"],
1798
- * jsr: ["+bun"] // Explicitly include 'bun' in this lib's JSR build
1799
- * }
1800
- * }
1801
- * }
1802
- */
1803
- filterDepsPatterns: {
1804
- global: string[];
1805
- "dist-npm": string[];
1806
- "dist-jsr": string[];
1807
- "dist-libs": Record<string, {
1808
- npm: string[];
1809
- jsr: string[];
1810
- }>;
1811
- };
1812
- /**
1813
- * List of tools to run before the build process starts.
1814
- * Available options: "tsc", "eslint", "biome", "knip", "dler-check"
1815
- * Each tool will only run if it's installed in the system.
1816
- *
1817
- * @default []
1818
- */
1819
- runBeforeBuild: ("tsc" | "eslint" | "biome" | "knip" | "dler-check")[];
1820
- /**
1821
- * List of tools to run after the build process completes.
1822
- * Available options: "dler-check"
1823
- * Each tool will only run if it's installed in the system.
1824
- *
1825
- * @default []
1826
- */
1827
- runAfterBuild: "dler-check"[];
1828
- /**
1829
- * Array of functions to be executed before the build process starts.
1830
- * These hooks will be called in sequence before any build steps.
1831
- *
1832
- * If you are a dler plugin developer, tell your users to
1833
- * call your plugin's `beforeBuild`-related function here.
1834
- *
1835
- * @example
1836
- * hooksBeforeBuild: [
1837
- * async () => {
1838
- * // Custom pre-build logic
1839
- * await someAsyncOperation();
1840
- *
1841
- * // dler-plugin-my-plugin-name
1842
- * await myPluginName_beforeBuild();
1843
- * }
1844
- * ]
1845
- *
1846
- * @default []
1847
- */
1848
- hooksBeforeBuild: (() => Promise<void>)[];
1849
- /**
1850
- * Array of functions to be executed after the build process completes.
1851
- * These hooks will be called in sequence after all build steps.
1852
- *
1853
- * If you are a dler plugin developer, tell your users to
1854
- * call your plugin's `afterBuild`-related function here.
1855
- *
1856
- * @example
1857
- * hooksAfterBuild: [
1858
- * async () => {
1859
- * // Custom post-build logic
1860
- * await someAsyncOperation();
1861
- *
1862
- * // dler-plugin-my-plugin-name
1863
- * await myPluginName_afterBuild();
1864
- * }
1865
- * ]
1866
- *
1867
- * @default []
1868
- */
1869
- hooksAfterBuild: (() => Promise<void>)[];
1870
- /**
1871
- * When `true`, cleans up the temporary directories after the build process completes.
1872
- *
1873
- * @default true
1874
- */
1875
- postBuildSettings: {
1876
- deleteDistTmpAfterBuild: boolean;
1877
- };
1878
- /**
1879
- * When `true`, fails the build if warnings are detected.
1880
- * Use with caution, as it may lead to inconsistent published versions.
1881
- *
1882
- * @default false
1883
- */
1884
- transpileFailOnWarn: boolean;
1885
- /**
1886
- * The transpileTarget runtime environment for the built package.
1887
- *
1888
- * @default "es2023"
1889
- */
1890
- transpileEsbuild: Esbuild;
1891
- /**
1892
- * Output module transpileFormat for built files:
1893
- * - `esm`: ECMAScript modules (import/export)
1894
- * - `cjs`: CommonJS modules (require/exports)
1895
- * - `iife`: Immediately Invoked Function Expression (for browsers)
1896
- *
1897
- * @default "esm"
1898
- */
1899
- transpileFormat: transpileFormat;
1900
- /**
1901
- * When `true`, minifies the output to reduce bundle size.
1902
- * Recommended for production builds but may increase build time.
1903
- *
1904
- * @default true
1905
- */
1906
- transpileMinify: boolean;
1907
- /**
1908
- * The base URL for loading assets in the built package.
1909
- * Important for packages that include assets like images or fonts.
1910
- *
1911
- * @default "/"
1912
- */
1913
- transpilePublicPath: string;
1914
- /**
1915
- * Controls source map generation for debugging (experimental):
1916
- * - `true/false`: Enable/disable source maps.
1917
- * - `"inline"`: Include source maps within output files.
1918
- * - `"none"`: Do not generate source maps.
1919
- * - `"linked"`: Generate separate source map files with links.
1920
- * - `"external"`: Generate separate source map files.
1921
- *
1922
- * @default false
1923
- */
1924
- transpileSourcemap: Sourcemap;
1925
- /**
1926
- * When `true`, enables code transpileSplitting for improved load-time performance.
1927
- * Useful for large applications but may not be needed for small projects.
1928
- *
1929
- * @default false
1930
- */
1931
- transpileSplitting: boolean;
1932
- /**
1933
- * Stub the package for JIT compilation.
1934
- *
1935
- * @default false
1936
- */
1937
- transpileStub: boolean;
1938
- /**
1939
- * Defines the transpileTarget runtime environment:
1940
- * - `node`: Optimized for Node.js.
1941
- * - `bun`: Optimized for Bun.
1942
- * - `browser`: Optimized for web browsers.
1943
- *
1944
- * @default "node"
1945
- */
1946
- transpileTarget: transpileTarget;
1947
- /**
1948
- * Watch the src dir and rebuild on change (experimental).
1949
- *
1950
- * @default false
1951
- */
1952
- transpileWatch: boolean;
1953
- /**
1954
- * Specifies what resources to send to npm and jsr registries.
1955
- * coreBuildOutDir (e.g. "bin") dir is automatically included.
1956
- * The following is also included if publishArtifacts is {}:
1957
- * - global: ["package.json", "README.md", "LICENSE"]
1958
- * - dist-jsr,dist-libs/jsr: ["jsr.json"]
1959
- *
1960
- * Structure:
1961
- * - `global`: Files to include in all distributions
1962
- * - `dist-jsr`: Files specific to JSR distribution
1963
- * - `dist-npm`: Files specific to NPM distribution
1964
- * - `dist-libs`: Library-specific files for each distribution type
1965
- *
1966
- * Useful for including additional files like configuration or documentation.
1967
- * Pro tip: set jsr.jsonc to generate jsr.jsonc instead of jsr.json config.
1968
- *
1969
- * @default
1970
- * {
1971
- * global: ["bin", "package.json", "README.md", "LICENSE"],
1972
- * "dist-jsr": ["jsr.json"],
1973
- * "dist-npm": [],
1974
- * "dist-libs": {
1975
- * "@myorg/lib1": {
1976
- * jsr: ["jsr.json"],
1977
- * npm: []
1978
- * }
1979
- * }
1980
- * }
1981
- */
1982
- publishArtifacts?: {
1983
- global: string[];
1984
- "dist-jsr": string[];
1985
- "dist-npm": string[];
1986
- "dist-libs": Record<string, {
1987
- jsr: string[];
1988
- npm: string[];
1989
- }>;
1990
- };
1991
- /**
1992
- * File extensions that should be copied to temporary build directories during pre-build.
1993
- * These files will be processed by the bundlers.
1994
- * All other files will be copied as-is to final dist directories during post-build.
1995
- * @default ["ts", "js"]
1996
- */
1997
- buildPreExtensions: string[];
1998
- /**
1999
- * Directory name for templates that should be excluded from pre-build processing.
2000
- * Files in this directory will be copied as-is during post-build.
2001
- * @default "templates"
2002
- */
2003
- buildTemplatesDir: string;
2004
- /**
2005
- * Integrated relinka logger configuration.
2006
- * @see https://github.com/reliverse/relinka
2007
- *
2008
- * @default See DEFAULT_RELINKA_CONFIG in defaults
2009
- */
2010
- relinka: RelinkaConfig;
2011
- }
2012
- /**
2013
- * Configuration for a library to be built and published as a separate package.
2014
- * Used when publishing multiple packages from a single repository.
2015
- */
2016
- export interface LibConfig {
2017
- /**
2018
- * When `true`, generates TypeScript declaration files (.d.ts) for NPM packages.
2019
- */
2020
- libDeclarations: boolean;
2021
- /**
2022
- * An optional description of the library, included in the dist's package.json.
2023
- * Provides users with an overview of the library's purpose.
2024
- *
2025
- * @example "Utility functions for data manipulation"
2026
- * @example "Core configuration module for the framework"
2027
- *
2028
- * @default `package.json`'s "description"
2029
- */
2030
- libDescription: string;
2031
- /**
2032
- * The directory where the library's dist files are stored.
2033
- *
2034
- * @default name is derived from the library's name after slash
2035
- */
2036
- libDirName: string;
2037
- /**
2038
- * The path to the library's main entry file.
2039
- * This file serves as the primary entry point for imports.
2040
- * The path should be relative to the project root.
2041
- * The full path to the library's main file is derived by joining `libsDirDist` with `main`.
2042
- *
2043
- * @example "my-lib-1/mod.ts"
2044
- * @example "my-lib-2/ml2-mod.ts"
2045
- * @example "src/libs/my-lib-3/index.js"
2046
- */
2047
- libMainFile: string;
2048
- /**
2049
- * Dependencies to include in the dist's package.json.
2050
- * The final output may vary based on `filterDepsPatterns`.
2051
- * Defines how dependencies are handled during publishing:
2052
- * - `string[]`: Includes only the specified dependencies.
2053
- * - `true`: Includes all dependencies from the main package.json.
2054
- * - `false` or `undefined`: Automatically determines dependencies based on imports.
2055
- *
2056
- * @example ["@reliverse/pathkit", "@reliverse/relifso"] - Only will include these specific dependencies.
2057
- * @example true - Include all `dependencies` from the main package.json.
2058
- */
2059
- libPkgKeepDeps: boolean | string[];
2060
- /**
2061
- * When `true`, minifies the output to reduce bundle size.
2062
- * Recommended for production builds but may increase build time.
2063
- *
2064
- * @default true
2065
- */
2066
- libTranspileMinify: boolean;
2067
- /**
2068
- * When true, pauses publishing for this specific library (overridden by commonPubPause).
2069
- * If true, this library will be built but not published, even if other libs are published.
2070
- *
2071
- * @default false
2072
- */
2073
- libPubPause?: boolean;
2074
- /**
2075
- * The registry to publish the library to.
2076
- *
2077
- * @default "npm"
2078
- */
2079
- libPubRegistry?: "jsr" | "npm" | "npm-jsr";
2080
- /**
2081
- * Optional version override for the library.
2082
- * If not provided, falls back to the version from the main package.json.
2083
- *
2084
- * @default `package.json`'s "version"
2085
- */
2086
- version?: string;
2087
- }
2088
- /**
2089
- * Default configuration for the build and publish logic.
2090
- */
2091
- export declare const DEFAULT_CONFIG_DLER: DlerConfig;
2092
- export declare const defineConfig: (userConfig?: Partial<DlerConfig>) => {
2093
- bumpDisable: boolean;
2094
- bumpFilter: string[];
2095
- bumpMode: BumpMode;
2096
- bumpSet: string;
2097
- commonPubPause: boolean;
2098
- commonPubRegistry: "jsr" | "npm" | "npm-jsr";
2099
- commonVerbose: boolean;
2100
- displayBuildPubLogs: boolean;
2101
- coreDeclarations: boolean;
2102
- coreEntryFile: string;
2103
- coreEntrySrcDir: string;
2104
- coreBuildOutDir: string;
2105
- coreIsCLI: {
2106
- enabled: boolean;
2107
- scripts: Record<string, string>;
2108
- };
2109
- coreDescription: string;
2110
- distJsrAllowDirty: boolean;
2111
- distJsrBuilder: BundlerName;
2112
- distJsrDirName: string;
2113
- distJsrDryRun: boolean;
2114
- distJsrFailOnWarn: boolean;
2115
- distJsrGenTsconfig: boolean;
2116
- distJsrOutFilesExt: NpmOutExt;
2117
- distJsrSlowTypes: boolean;
2118
- distNpmBuilder: BundlerName;
2119
- distNpmDirName: string;
2120
- distNpmOutFilesExt: NpmOutExt;
2121
- libsActMode: "libs-only" | "main-and-libs" | "main-project-only";
2122
- libsDirDist: string;
2123
- libsDirSrc: string;
2124
- libsList: Record<string, LibConfig>;
2125
- logsFileName: string;
2126
- logsFreshFile: boolean;
2127
- filterDepsPatterns: {
2128
- global: string[];
2129
- "dist-npm": string[];
2130
- "dist-jsr": string[];
2131
- "dist-libs": Record<string, {
2132
- npm: string[];
2133
- jsr: string[];
2134
- }>;
2135
- };
2136
- runBeforeBuild: ("tsc" | "eslint" | "biome" | "knip" | "dler-check")[];
2137
- runAfterBuild: "dler-check"[];
2138
- hooksBeforeBuild: (() => Promise<void>)[];
2139
- hooksAfterBuild: (() => Promise<void>)[];
2140
- postBuildSettings: {
2141
- deleteDistTmpAfterBuild: boolean;
2142
- };
2143
- transpileFailOnWarn: boolean;
2144
- transpileEsbuild: Esbuild;
2145
- transpileFormat: transpileFormat;
2146
- transpileMinify: boolean;
2147
- transpilePublicPath: string;
2148
- transpileSourcemap: Sourcemap;
2149
- transpileSplitting: boolean;
2150
- transpileStub: boolean;
2151
- transpileTarget: transpileTarget;
2152
- transpileWatch: boolean;
2153
- publishArtifacts?: {
2154
- global: string[];
2155
- "dist-jsr": string[];
2156
- "dist-npm": string[];
2157
- "dist-libs": Record<string, {
2158
- jsr: string[];
2159
- npm: string[];
2160
- }>;
2161
- };
2162
- buildPreExtensions: string[];
2163
- buildTemplatesDir: string;
2164
- relinka: RelinkaConfig;
2165
- };