@reliverse/dler 1.7.15 → 1.7.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +164 -191
- package/bin/app/agg/run.js +2 -8
- package/bin/app/build/cmd.js +4 -4
- package/bin/app/build/impl.d.ts +2 -6
- package/bin/app/build/impl.js +2 -46
- package/bin/app/conv/cmd.d.ts +8 -33
- package/bin/app/conv/cmd.js +185 -163
- package/bin/app/copy/cmd.js +1 -1
- package/bin/app/init/init-impl.js +3 -3
- package/bin/app/init/init-types.d.ts +8 -8
- package/bin/app/merge/cmd.d.ts +17 -17
- package/bin/app/merge/cmd.js +70 -310
- package/bin/app/migrate/codemods/anything-bun.js +1 -1
- package/bin/app/migrate/codemods/fs-relifso.d.ts +2 -2
- package/bin/app/migrate/codemods/fs-relifso.js +1 -1
- package/bin/app/migrate/codemods/nodenext-bundler.d.ts +2 -2
- package/bin/app/migrate/codemods/nodenext-bundler.js +1 -1
- package/bin/app/migrate/codemods/path-pathkit.d.ts +2 -2
- package/bin/app/migrate/codemods/path-pathkit.js +1 -1
- package/bin/app/migrate/codemods/readdir-glob.d.ts +2 -2
- package/bin/app/migrate/codemods/readdir-glob.js +1 -1
- package/bin/app/mkdist/cmd.js +4 -2
- package/bin/app/pack/cmd.d.ts +44 -0
- package/bin/app/pack/cmd.js +313 -0
- package/bin/app/pub/cmd.js +4 -4
- package/bin/app/pub/impl.d.ts +7 -0
- package/bin/app/pub/impl.js +97 -0
- package/bin/app/rename/cmd.js +1 -1
- package/bin/app/spell/cmd.d.ts +14 -5
- package/bin/app/spell/cmd.js +33 -33
- package/bin/app/spell/old.js +0 -0
- package/bin/app/{mock → unpack}/cmd.d.ts +10 -14
- package/bin/app/unpack/cmd.js +200 -0
- package/bin/cli.js +2 -2
- package/bin/libs/cfg/cfg-mod.d.ts +69 -0
- package/bin/libs/cfg/cfg-mod.js +61 -0
- package/bin/libs/cfg/rse/rse-impl/rse-biome.d.ts +2 -0
- package/bin/libs/cfg/rse/rse-impl/rse-biome.js +34 -0
- package/bin/libs/cfg/rse/rse-impl/rse-consts.d.ts +35 -0
- package/bin/libs/cfg/rse/rse-impl/rse-consts.js +37 -0
- package/bin/libs/cfg/rse/rse-impl/rse-content.d.ts +14 -0
- package/bin/libs/cfg/rse/rse-impl/rse-content.js +15 -0
- package/bin/libs/cfg/rse/rse-impl/rse-core.d.ts +14 -0
- package/bin/libs/cfg/rse/rse-impl/rse-core.js +63 -0
- package/bin/libs/cfg/rse/rse-impl/rse-create.d.ts +36 -0
- package/bin/libs/cfg/rse/rse-impl/rse-create.js +254 -0
- package/bin/libs/cfg/rse/rse-impl/rse-def-utils.d.ts +6 -0
- package/bin/libs/cfg/rse/rse-impl/rse-def-utils.js +225 -0
- package/bin/libs/cfg/rse/rse-impl/rse-default.d.ts +3 -0
- package/bin/libs/cfg/rse/rse-impl/rse-default.js +155 -0
- package/bin/libs/cfg/rse/rse-impl/rse-define.d.ts +125 -0
- package/bin/libs/cfg/rse/rse-impl/rse-define.js +4 -0
- package/bin/libs/cfg/rse/rse-impl/rse-detect.d.ts +23 -0
- package/bin/libs/cfg/rse/rse-impl/rse-detect.js +347 -0
- package/bin/libs/cfg/rse/rse-impl/rse-gen-cfg.d.ts +3 -0
- package/bin/libs/cfg/rse/rse-impl/rse-gen-cfg.js +186 -0
- package/bin/libs/cfg/rse/rse-impl/rse-inject.d.ts +1 -0
- package/bin/libs/cfg/rse/rse-impl/rse-inject.js +57 -0
- package/bin/libs/cfg/rse/rse-impl/rse-migrate.d.ts +5 -0
- package/bin/libs/cfg/rse/rse-impl/rse-migrate.js +56 -0
- package/bin/libs/cfg/rse/rse-impl/rse-path.d.ts +11 -0
- package/bin/libs/cfg/rse/rse-impl/rse-path.js +33 -0
- package/bin/libs/cfg/rse/rse-impl/rse-prompts.d.ts +5 -0
- package/bin/libs/cfg/rse/rse-impl/rse-prompts.js +12 -0
- package/bin/libs/cfg/rse/rse-impl/rse-read.d.ts +11 -0
- package/bin/libs/cfg/rse/rse-impl/rse-read.js +84 -0
- package/bin/libs/cfg/rse/rse-impl/rse-repair.d.ts +16 -0
- package/bin/libs/cfg/rse/rse-impl/rse-repair.js +137 -0
- package/bin/libs/cfg/rse/rse-impl/rse-schema.d.ts +130 -0
- package/bin/libs/cfg/rse/rse-impl/rse-schema.js +444 -0
- package/bin/libs/cfg/rse/rse-impl/rse-types.d.ts +75 -0
- package/bin/libs/cfg/rse/rse-impl/rse-types.js +0 -0
- package/bin/libs/cfg/rse/rse-impl/rse-unstable.d.ts +11 -0
- package/bin/libs/cfg/rse/rse-impl/rse-unstable.js +41 -0
- package/bin/libs/cfg/rse/rse-impl/rse-update.d.ts +10 -0
- package/bin/libs/cfg/rse/rse-impl/rse-update.js +152 -0
- package/bin/libs/cfg/rse/rse-impl/rse-utils.d.ts +17 -0
- package/bin/libs/cfg/rse/rse-impl/rse-utils.js +86 -0
- package/bin/libs/cfg/rse/rse-mod.d.ts +20 -0
- package/bin/libs/cfg/rse/rse-mod.js +20 -0
- package/bin/libs/cfg/types.d.ts +533 -0
- package/bin/libs/cfg/types.js +0 -0
- package/bin/libs/sdk/sdk-impl/build/build-library.d.ts +5 -5
- package/bin/libs/sdk/sdk-impl/build/build-library.js +1 -174
- package/bin/libs/sdk/sdk-impl/build/build-regular.d.ts +2 -1
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/build.js +287 -240
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/loaders/vue.d.ts +4 -4
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/make.d.ts +8 -5
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/make.js +199 -119
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/spinner.d.ts +99 -0
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-impl/utils/spinner.js +206 -0
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/mkdist/mkdist-mod.js +92 -46
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/rollup/plugins/raw.d.ts +2 -2
- package/bin/libs/sdk/sdk-impl/build/bundlers/unified/utils.d.ts +2 -2
- package/bin/libs/sdk/sdk-impl/config/default.d.ts +6 -0
- package/bin/libs/sdk/sdk-impl/{cfg → config}/default.js +8 -18
- package/bin/libs/sdk/sdk-impl/{cfg → config}/info.js +1 -1
- package/bin/libs/sdk/sdk-impl/{cfg → config}/init.js +53 -43
- package/bin/libs/sdk/sdk-impl/{cfg → config}/load.d.ts +2 -2
- package/bin/libs/sdk/sdk-impl/{cfg → config}/load.js +6 -6
- package/bin/libs/sdk/sdk-impl/config/types.d.ts +533 -0
- package/bin/libs/sdk/sdk-impl/config/types.js +0 -0
- package/bin/libs/sdk/sdk-impl/library-flow.d.ts +2 -1
- package/bin/libs/sdk/sdk-impl/pub/pub-library.js +7 -0
- package/bin/libs/sdk/sdk-impl/pub/pub-regular.js +4 -8
- package/bin/libs/sdk/sdk-impl/regular-flow.d.ts +2 -1
- package/bin/libs/sdk/sdk-impl/rules/reliverse/dler-config-health/dler-config-health.js +2 -2
- package/bin/libs/sdk/sdk-impl/rules/reliverse/missing-deps/deps-types.d.ts +6 -6
- package/bin/libs/sdk/sdk-impl/rules/reliverse/missing-deps/filesystem.js +1 -1
- package/bin/libs/sdk/sdk-impl/rules/reliverse/no-index-files/no-index-files.js +1 -1
- package/bin/libs/sdk/sdk-impl/rules/reliverse/self-include/self-include.js +2 -2
- package/bin/libs/sdk/sdk-impl/spell/applyMagicSpells.d.ts +38 -0
- package/bin/libs/sdk/sdk-impl/spell/applyMagicSpells.js +474 -0
- package/bin/libs/sdk/sdk-impl/spell/spells.d.ts +31 -0
- package/bin/libs/sdk/sdk-impl/spell/spells.js +85 -0
- package/bin/libs/sdk/sdk-impl/utils/binary.js +1 -1
- package/bin/libs/sdk/sdk-impl/utils/comments.d.ts +6 -0
- package/bin/libs/sdk/sdk-impl/utils/comments.js +41 -0
- package/bin/libs/sdk/sdk-impl/utils/finalize.d.ts +2 -1
- package/bin/libs/sdk/sdk-impl/utils/finalize.js +1 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-constants.d.ts +6 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-constants.js +7 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-file-utils.d.ts +5 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-file-utils.js +40 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-types.d.ts +24 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pu-types.js +0 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pub-json-utils.d.ts +17 -0
- package/bin/libs/sdk/sdk-impl/utils/pack-unpack/pub-json-utils.js +46 -0
- package/bin/libs/sdk/sdk-impl/utils/replacements.d.ts +0 -0
- package/bin/libs/sdk/sdk-impl/utils/replacements.js +0 -0
- package/bin/libs/sdk/sdk-impl/utils/resolve-cross-libs.d.ts +3 -0
- package/bin/libs/sdk/sdk-impl/utils/resolve-cross-libs.js +194 -0
- package/bin/libs/sdk/sdk-impl/utils/utils-build.d.ts +1 -2
- package/bin/libs/sdk/sdk-impl/utils/utils-clean.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-deps.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-determine.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-error-cwd.d.ts +4 -0
- package/bin/libs/sdk/sdk-impl/utils/utils-error-cwd.js +1 -0
- package/bin/libs/sdk/sdk-impl/utils/utils-jsr-json.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-package-json-libraries.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-package-json-regular.d.ts +1 -1
- package/bin/libs/sdk/sdk-impl/utils/utils-security.d.ts +1 -3
- package/bin/libs/sdk/sdk-impl/utils/utils-security.js +11 -10
- package/bin/libs/sdk/sdk-mod.d.ts +1 -6
- package/bin/libs/sdk/sdk-mod.js +0 -31
- package/bin/libs/sdk/sdk-types.d.ts +39 -582
- package/bin/mod.d.ts +1 -1
- package/bin/mod.js +1 -1
- package/package.json +11 -4
- package/bin/app/mock/cmd.js +0 -284
- package/bin/app/mock/mock.d.ts +0 -11
- package/bin/app/mock/mock.js +0 -97
- package/bin/libs/sdk/sdk-impl/cfg/default.d.ts +0 -5
- package/bin/libs/sdk/sdk-impl/cfg/define.d.ts +0 -2
- package/bin/libs/sdk/sdk-impl/cfg/define.js +0 -4
- package/bin/libs/sdk/sdk-impl/spell/spell-executors.d.ts +0 -10
- package/bin/libs/sdk/sdk-impl/spell/spell-executors.js +0 -307
- package/bin/libs/sdk/sdk-impl/spell/spell-filesystem.d.ts +0 -7
- package/bin/libs/sdk/sdk-impl/spell/spell-filesystem.js +0 -74
- package/bin/libs/sdk/sdk-impl/spell/spell-mod.d.ts +0 -4
- package/bin/libs/sdk/sdk-impl/spell/spell-mod.js +0 -87
- package/bin/libs/sdk/sdk-impl/spell/spell-parser.d.ts +0 -4
- package/bin/libs/sdk/sdk-impl/spell/spell-parser.js +0 -58
- package/bin/libs/sdk/sdk-impl/spell/spell-types.d.ts +0 -60
- /package/bin/{libs/sdk/sdk-impl/spell/spell-types.js → app/spell/old.d.ts} +0 -0
- /package/bin/libs/sdk/sdk-impl/{cfg → config}/info.d.ts +0 -0
- /package/bin/libs/sdk/sdk-impl/{cfg → config}/init.d.ts +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { BumpMode } from "@reliverse/bleump";
|
|
2
1
|
import type { RollupAliasOptions } from "@rollup/plugin-alias";
|
|
3
2
|
import type { RollupCommonJSOptions } from "@rollup/plugin-commonjs";
|
|
4
3
|
import type { RollupJsonOptions } from "@rollup/plugin-json";
|
|
@@ -19,556 +18,29 @@ import type { Options as RollupDtsOptions } from "rollup-plugin-dts";
|
|
|
19
18
|
import type { GlobOptions } from "tinyglobby";
|
|
20
19
|
import type { Schema } from "untyped";
|
|
21
20
|
/**
|
|
22
|
-
*
|
|
23
|
-
* build settings, publishing options, libraries-dler-plugin built-in plugin, and more.
|
|
24
|
-
* It customizes the build and publish pipeline for both NPM and JSR registries.
|
|
21
|
+
* Supported distribution directories.
|
|
25
22
|
*/
|
|
26
|
-
export type
|
|
27
|
-
|
|
28
|
-
* When `true`, disables version bumping.
|
|
29
|
-
* Useful when retrying a failed publish with an already bumped version.
|
|
30
|
-
*
|
|
31
|
-
* @default false
|
|
32
|
-
*/
|
|
33
|
-
bumpDisable: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Controls which files will have their version numbers updated during version bumping.
|
|
36
|
-
*
|
|
37
|
-
* Accepts:
|
|
38
|
-
* - Standard file types like "package.json"
|
|
39
|
-
* - Relative paths like "src/constants.ts"
|
|
40
|
-
* - [Globbing patterns](https://github.com/mrmlnc/fast-glob#pattern-syntax)
|
|
41
|
-
*
|
|
42
|
-
* When empty, falls back to only updating "package.json".
|
|
43
|
-
* Respects: .gitignore patterns, hidden files, .git & node_modules.
|
|
44
|
-
*
|
|
45
|
-
* @default ["package.json", ".config/rse.ts"]
|
|
46
|
-
*/
|
|
47
|
-
bumpFilter: string[];
|
|
48
|
-
/**
|
|
49
|
-
* Specifies how the version number should be incremented:
|
|
50
|
-
* - `patch`: Increments the patch version for backwards-compatible bug fixes (1.2.3 → 1.2.4)
|
|
51
|
-
* - `minor`: Increments the minor version for new backwards-compatible features (1.2.3 → 1.3.0)
|
|
52
|
-
* - `major`: Increments the major version for breaking changes (1.2.3 → 2.0.0)
|
|
53
|
-
* - `auto`: Automatically determine the appropriate bump type
|
|
54
|
-
* - `manual`: Set a specific version (requires bumpSet to be set)
|
|
55
|
-
*
|
|
56
|
-
* Please note: `dler` infers the version from the `package.json` file.
|
|
57
|
-
*
|
|
58
|
-
* @default "patch"
|
|
59
|
-
*/
|
|
60
|
-
bumpMode: BumpMode;
|
|
61
|
-
/**
|
|
62
|
-
* Custom version to set when bumpMode is "manual".
|
|
63
|
-
* Must be a valid semver version (e.g., "1.2.3").
|
|
64
|
-
*
|
|
65
|
-
* @default ""
|
|
66
|
-
*/
|
|
67
|
-
bumpSet: string;
|
|
68
|
-
/**
|
|
69
|
-
* When `true`, stops after building and retains distribution folders.
|
|
70
|
-
* Useful for development or inspecting the build output.
|
|
71
|
-
*
|
|
72
|
-
* @default true
|
|
73
|
-
*/
|
|
74
|
-
commonPubPause: boolean;
|
|
75
|
-
/**
|
|
76
|
-
* Specifies which package registries to publish to:
|
|
77
|
-
* - `npm`: Publish only to the NPM commonPubRegistry.
|
|
78
|
-
* - `jsr`: Publish only to the JSR commonPubRegistry.
|
|
79
|
-
* - `npm-jsr`: Publish to both NPM and JSR registries.
|
|
80
|
-
*
|
|
81
|
-
* @default "npm"
|
|
82
|
-
*/
|
|
83
|
-
commonPubRegistry: "jsr" | "npm" | "npm-jsr";
|
|
84
|
-
/**
|
|
85
|
-
* When `true`, enables detailed logs during the build and publish process.
|
|
86
|
-
* Useful for debugging or understanding the build flow.
|
|
87
|
-
*
|
|
88
|
-
* @default false
|
|
89
|
-
*/
|
|
90
|
-
commonVerbose: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* When `true`, generates TypeScript declaration files (.d.ts) for NPM packages.
|
|
93
|
-
* Essential for providing type intranspileFormation to TypeScript users.
|
|
94
|
-
*
|
|
95
|
-
* To reduce bundle size you can set this to `false` if your main project
|
|
96
|
-
* is planned to be used only as a global CLI tool (e.g. `bunx dler`).
|
|
97
|
-
*
|
|
98
|
-
* @default true
|
|
99
|
-
*/
|
|
100
|
-
coreDeclarations: boolean;
|
|
101
|
-
/**
|
|
102
|
-
* Path to the project's main entry file.
|
|
103
|
-
* Used as the entry point for the NPM package.
|
|
104
|
-
*
|
|
105
|
-
* @default "mod.ts"
|
|
106
|
-
*/
|
|
107
|
-
coreEntryFile: string;
|
|
108
|
-
/**
|
|
109
|
-
* Base directory containing the source entry files.
|
|
110
|
-
* All paths are resolved relative to this directory.
|
|
111
|
-
* Set to `"."` if entry files are in the project root.
|
|
112
|
-
*
|
|
113
|
-
* @default "src"
|
|
114
|
-
*/
|
|
115
|
-
coreEntrySrcDir: string;
|
|
116
|
-
/**
|
|
117
|
-
* Directory where built files will be placed within the distribution directory.
|
|
118
|
-
* For example, if set to "bin", CLI scripts will be placed in "dist-npm/bin" or "dist-jsr/bin".
|
|
119
|
-
*
|
|
120
|
-
* @default "bin"
|
|
121
|
-
*/
|
|
122
|
-
coreBuildOutDir: string;
|
|
123
|
-
/**
|
|
124
|
-
* Configuration for CLI functionality:
|
|
125
|
-
* - enabled: When `true`, indicates that the package has CLI capabilities
|
|
126
|
-
* - scripts: Map of CLI script names to their entry file paths
|
|
127
|
-
* The key will be used as the command name in package.json's bin field
|
|
128
|
-
* The value should be the path to the executable script (e.g. "cli.ts")
|
|
129
|
-
*
|
|
130
|
-
* **The source scripts should be in your "coreEntrySrcDir" directory (by default "src")**
|
|
131
|
-
*
|
|
132
|
-
* @example
|
|
133
|
-
* {
|
|
134
|
-
* enabled: true,
|
|
135
|
-
* scripts: {
|
|
136
|
-
* "mycli": "cli.ts",
|
|
137
|
-
* "othercmd": "other-cmd.ts"
|
|
138
|
-
* }
|
|
139
|
-
* }
|
|
140
|
-
*
|
|
141
|
-
* @default { enabled: false, scripts: {} }
|
|
142
|
-
*/
|
|
143
|
-
coreIsCLI: {
|
|
144
|
-
enabled: boolean;
|
|
145
|
-
scripts: Record<string, string>;
|
|
146
|
-
};
|
|
147
|
-
/**
|
|
148
|
-
* Optional description that overrides the description from package.json.
|
|
149
|
-
* When provided, this description will be used in the dist's package.json.
|
|
150
|
-
* If not provided, the description from the original package.json will be used.
|
|
151
|
-
*
|
|
152
|
-
* @default `package.json`'s "description"
|
|
153
|
-
*/
|
|
154
|
-
coreDescription: string;
|
|
155
|
-
/**
|
|
156
|
-
* When `true`, allows JSR publishing even with uncommitted changes.
|
|
157
|
-
* Use with caution, as it may lead to inconsistent published versions.
|
|
158
|
-
*
|
|
159
|
-
* It is `true` by default to make it easier for new `dler` users to publish their projects.
|
|
160
|
-
*
|
|
161
|
-
* @default true
|
|
162
|
-
*/
|
|
163
|
-
distJsrAllowDirty: boolean;
|
|
164
|
-
/**
|
|
165
|
-
* The bundler to use for creating JSR-compatible packages.
|
|
166
|
-
* JSR's native bundler is recommended for best compatibility.
|
|
167
|
-
*
|
|
168
|
-
* @default "jsr"
|
|
169
|
-
*/
|
|
170
|
-
distJsrBuilder: BundlerName;
|
|
171
|
-
/**
|
|
172
|
-
* Directory where JSR build artifacts are generated.
|
|
173
|
-
* This directory will contain the package ready for JSR publishing.
|
|
174
|
-
*
|
|
175
|
-
* @default "dist-jsr"
|
|
176
|
-
*/
|
|
177
|
-
distJsrDirName: string;
|
|
178
|
-
/**
|
|
179
|
-
* When `true`, simulates the publishing process without actually publishing.
|
|
180
|
-
* Useful for testing the build and publish pipeline without side effects.
|
|
181
|
-
*
|
|
182
|
-
* @default false
|
|
183
|
-
*/
|
|
184
|
-
distJsrDryRun: boolean;
|
|
185
|
-
/**
|
|
186
|
-
* When `true`, fails the build if warnings are detected.
|
|
187
|
-
* Use with caution, as it may lead to inconsistent published versions.
|
|
188
|
-
*
|
|
189
|
-
* @default false
|
|
190
|
-
*/
|
|
191
|
-
distJsrFailOnWarn: boolean;
|
|
192
|
-
/**
|
|
193
|
-
* When `true`, generates a `jsconfig.json` file for JSR's dist.
|
|
194
|
-
*
|
|
195
|
-
* @default false
|
|
196
|
-
*/
|
|
197
|
-
distJsrGenTsconfig: boolean;
|
|
198
|
-
/**
|
|
199
|
-
* The file extension for output files in JSR packages.
|
|
200
|
-
*
|
|
201
|
-
* @default "ts"
|
|
202
|
-
*/
|
|
203
|
-
distJsrOutFilesExt: NpmOutExt;
|
|
204
|
-
/**
|
|
205
|
-
* When `true`, enables JSR to process complex types, which may impact performance.
|
|
206
|
-
* Enable this only if you cannot simplify or explicitly define exported types.
|
|
207
|
-
*
|
|
208
|
-
* JSR requires exported functions, classes, variables, and type aliases to have
|
|
209
|
-
* explicitly written or easily inferred types. Otherwise, it may be unable to
|
|
210
|
-
* generate documentation, type declarations for npm compatibility, or efficient
|
|
211
|
-
* type checking for consumers.
|
|
212
|
-
*
|
|
213
|
-
* If "slow types" are present, type checking performance may degrade, and some
|
|
214
|
-
* features may not work as expected.
|
|
215
|
-
*
|
|
216
|
-
* It is `true` by default to make it easier for new `dler` users to publish their projects.
|
|
217
|
-
*
|
|
218
|
-
* @see https://jsr.io/docs/about-slow-types
|
|
219
|
-
* @default true
|
|
220
|
-
*/
|
|
221
|
-
distJsrSlowTypes: boolean;
|
|
222
|
-
/**
|
|
223
|
-
* The bundler to use for creating NPM-compatible packages.
|
|
224
|
-
*
|
|
225
|
-
* @default "mkdist"
|
|
226
|
-
*/
|
|
227
|
-
distNpmBuilder: BundlerName;
|
|
228
|
-
/**
|
|
229
|
-
* Directory where NPM build artifacts are generated.
|
|
230
|
-
* This directory will contain the package ready for NPM publishing.
|
|
231
|
-
*
|
|
232
|
-
* @default "dist-npm"
|
|
233
|
-
*/
|
|
234
|
-
distNpmDirName: string;
|
|
235
|
-
/**
|
|
236
|
-
* Specifies the file extension for output files in NPM packages.
|
|
237
|
-
* Determines the extension of compiled files in the NPM distribution.
|
|
238
|
-
* We strongly recommend using `"js"` with the `"esm"` transpileFormat.
|
|
239
|
-
*
|
|
240
|
-
* @default "js"
|
|
241
|
-
*/
|
|
242
|
-
distNpmOutFilesExt: NpmOutExt;
|
|
243
|
-
/**
|
|
244
|
-
* !! EXPERIMENTAL !!
|
|
245
|
-
* Controls which parts of the project are built and published:
|
|
246
|
-
* - `main-project-only`: Builds/publishes only the main package.
|
|
247
|
-
* - `main-and-libs`: Builds/publishes both the main package and libraries.
|
|
248
|
-
* - `libs-only`: Builds/publishes only the libraries.
|
|
249
|
-
*
|
|
250
|
-
* @default "main-project-only"
|
|
251
|
-
*/
|
|
252
|
-
libsActMode: "libs-only" | "main-and-libs" | "main-project-only";
|
|
253
|
-
/**
|
|
254
|
-
* The directory where built libraries are stored before publishing.
|
|
255
|
-
*
|
|
256
|
-
* @default "dist-libs"
|
|
257
|
-
*/
|
|
258
|
-
libsDirDist: string;
|
|
259
|
-
/**
|
|
260
|
-
* The directory containing library source files.
|
|
261
|
-
*
|
|
262
|
-
* @default "src/libs"
|
|
263
|
-
*/
|
|
264
|
-
libsDirSrc: string;
|
|
265
|
-
/**
|
|
266
|
-
* !! EXPERIMENTAL !!
|
|
267
|
-
* Configuration for building and publishing multiple libraries.
|
|
268
|
-
* Each key represents a package name, and its value contains the configuration.
|
|
269
|
-
*
|
|
270
|
-
* @example
|
|
271
|
-
* {
|
|
272
|
-
* "@myorg/ml1": { main: "my-lib-1/mod.ts" },
|
|
273
|
-
* "@myorg/ml2": { main: "my-lib-2/ml2-mod.ts" },
|
|
274
|
-
* "@myorg/ml3": { main: "src/libs/my-lib-3/index.js" }
|
|
275
|
-
* }
|
|
276
|
-
*/
|
|
277
|
-
libsList: Record<string, LibConfig>;
|
|
278
|
-
/**
|
|
279
|
-
* The name of the log file. dler uses `@reliverse/relinka` for logging.
|
|
280
|
-
*
|
|
281
|
-
* @default ".logs/relinka.log"
|
|
282
|
-
*/
|
|
283
|
-
logsFileName: string;
|
|
284
|
-
/**
|
|
285
|
-
* When `true`, cleans up the log file from previous runs.
|
|
286
|
-
*
|
|
287
|
-
* @default false
|
|
288
|
-
*/
|
|
289
|
-
logsFreshFile: boolean;
|
|
290
|
-
/**
|
|
291
|
-
* Configuration for dependency removal/injection patterns.
|
|
292
|
-
* Controls which dependencies are excluded from (or injected into) the final package.
|
|
293
|
-
*
|
|
294
|
-
* Pattern types:
|
|
295
|
-
* - Regular patterns: Exclude deps that match the pattern
|
|
296
|
-
* - Negation patterns (starting with !): Don't exclude deps that match the pattern
|
|
297
|
-
* - Add patterns (starting with +): Inject deps into specific dists even if original package.json doesn't have them
|
|
298
|
-
*
|
|
299
|
-
* Structure (dist-specific patterns are merged with global):
|
|
300
|
-
* - `global`: Patterns that are always applied to all builds
|
|
301
|
-
* - `dist-npm`: NPM-specific patterns
|
|
302
|
-
* - `dist-jsr`: JSR-specific patterns
|
|
303
|
-
* - `dist-libs`: Library-specific patterns
|
|
304
|
-
* Each library can have separate NPM and JSR patterns
|
|
305
|
-
*
|
|
306
|
-
* @example
|
|
307
|
-
* {
|
|
308
|
-
* global: ["@types", "eslint"],
|
|
309
|
-
* "dist-npm": ["npm-specific"],
|
|
310
|
-
* "dist-jsr": ["+bun"], // Explicitly include 'bun' in JSR builds
|
|
311
|
-
* "dist-libs": {
|
|
312
|
-
* "@myorg/lib1": {
|
|
313
|
-
* npm: ["lib1-npm-specific"],
|
|
314
|
-
* jsr: ["+bun"] // Explicitly include 'bun' in this lib's JSR build
|
|
315
|
-
* }
|
|
316
|
-
* }
|
|
317
|
-
* }
|
|
318
|
-
*/
|
|
319
|
-
filterDepsPatterns: {
|
|
320
|
-
global: string[];
|
|
321
|
-
"dist-npm": string[];
|
|
322
|
-
"dist-jsr": string[];
|
|
323
|
-
"dist-libs": Record<string, {
|
|
324
|
-
npm: string[];
|
|
325
|
-
jsr: string[];
|
|
326
|
-
}>;
|
|
327
|
-
};
|
|
328
|
-
/**
|
|
329
|
-
* When `true`, fails the build if warnings are detected.
|
|
330
|
-
* Use with caution, as it may lead to inconsistent published versions.
|
|
331
|
-
*
|
|
332
|
-
* @default false
|
|
333
|
-
*/
|
|
334
|
-
transpileFailOnWarn: boolean;
|
|
335
|
-
/**
|
|
336
|
-
* The transpileTarget runtime environment for the built package.
|
|
337
|
-
*
|
|
338
|
-
* @default "es2023"
|
|
339
|
-
*/
|
|
340
|
-
transpileEsbuild: Esbuild;
|
|
341
|
-
/**
|
|
342
|
-
* Output module transpileFormat for built files:
|
|
343
|
-
* - `esm`: ECMAScript modules (import/export)
|
|
344
|
-
* - `cjs`: CommonJS modules (require/exports)
|
|
345
|
-
* - `iife`: Immediately Invoked Function Expression (for browsers)
|
|
346
|
-
*
|
|
347
|
-
* @default "esm"
|
|
348
|
-
*/
|
|
349
|
-
transpileFormat: transpileFormat;
|
|
350
|
-
/**
|
|
351
|
-
* When `true`, minifies the output to reduce bundle size.
|
|
352
|
-
* Recommended for production builds but may increase build time.
|
|
353
|
-
*
|
|
354
|
-
* @default true
|
|
355
|
-
*/
|
|
356
|
-
transpileMinify: boolean;
|
|
357
|
-
/**
|
|
358
|
-
* The base URL for loading assets in the built package.
|
|
359
|
-
* Important for packages that include assets like images or fonts.
|
|
360
|
-
*
|
|
361
|
-
* @default "/"
|
|
362
|
-
*/
|
|
363
|
-
transpilePublicPath: string;
|
|
364
|
-
/**
|
|
365
|
-
* Controls source map generation for debugging (experimental):
|
|
366
|
-
* - `true/false`: Enable/disable source maps.
|
|
367
|
-
* - `"inline"`: Include source maps within output files.
|
|
368
|
-
* - `"none"`: Do not generate source maps.
|
|
369
|
-
* - `"linked"`: Generate separate source map files with links.
|
|
370
|
-
* - `"external"`: Generate separate source map files.
|
|
371
|
-
*
|
|
372
|
-
* @default false
|
|
373
|
-
*/
|
|
374
|
-
transpileSourcemap: Sourcemap;
|
|
375
|
-
/**
|
|
376
|
-
* When `true`, enables code transpileSplitting for improved load-time performance.
|
|
377
|
-
* Useful for large applications but may not be needed for small projects.
|
|
378
|
-
*
|
|
379
|
-
* @default false
|
|
380
|
-
*/
|
|
381
|
-
transpileSplitting: boolean;
|
|
382
|
-
/**
|
|
383
|
-
* Stub the package for JIT compilation.
|
|
384
|
-
*
|
|
385
|
-
* @default false
|
|
386
|
-
*/
|
|
387
|
-
transpileStub: boolean;
|
|
388
|
-
/**
|
|
389
|
-
* Defines the transpileTarget runtime environment:
|
|
390
|
-
* - `node`: Optimized for Node.js.
|
|
391
|
-
* - `bun`: Optimized for Bun.
|
|
392
|
-
* - `browser`: Optimized for web browsers.
|
|
393
|
-
*
|
|
394
|
-
* @default "node"
|
|
395
|
-
*/
|
|
396
|
-
transpileTarget: transpileTarget;
|
|
397
|
-
/**
|
|
398
|
-
* Watch the src dir and rebuild on change (experimental).
|
|
399
|
-
*
|
|
400
|
-
* @default false
|
|
401
|
-
*/
|
|
402
|
-
transpileWatch: boolean;
|
|
403
|
-
/**
|
|
404
|
-
* Specifies what resources to send to npm and jsr registries.
|
|
405
|
-
* coreBuildOutDir (e.g. "bin") dir is automatically included.
|
|
406
|
-
* The following is also included if publishArtifacts is {}:
|
|
407
|
-
* - global: ["package.json", "README.md", "LICENSE"]
|
|
408
|
-
* - dist-jsr,dist-libs/jsr: ["jsr.json"]
|
|
409
|
-
*
|
|
410
|
-
* Structure:
|
|
411
|
-
* - `global`: Files to include in all distributions
|
|
412
|
-
* - `dist-jsr`: Files specific to JSR distribution
|
|
413
|
-
* - `dist-npm`: Files specific to NPM distribution
|
|
414
|
-
* - `dist-libs`: Library-specific files for each distribution type
|
|
415
|
-
*
|
|
416
|
-
* Useful for including additional files like configuration or documentation.
|
|
417
|
-
* Pro tip: set jsr.jsonc to generate jsr.jsonc instead of jsr.json config.
|
|
418
|
-
*
|
|
419
|
-
* @default
|
|
420
|
-
* {
|
|
421
|
-
* global: ["bin", "package.json", "README.md", "LICENSE"],
|
|
422
|
-
* "dist-jsr": ["jsr.json"],
|
|
423
|
-
* "dist-npm": [],
|
|
424
|
-
* "dist-libs": {
|
|
425
|
-
* "@myorg/lib1": {
|
|
426
|
-
* jsr: ["jsr.json"],
|
|
427
|
-
* npm: []
|
|
428
|
-
* }
|
|
429
|
-
* }
|
|
430
|
-
* }
|
|
431
|
-
*/
|
|
432
|
-
publishArtifacts?: {
|
|
433
|
-
global: string[];
|
|
434
|
-
"dist-jsr": string[];
|
|
435
|
-
"dist-npm": string[];
|
|
436
|
-
"dist-libs": Record<string, {
|
|
437
|
-
jsr: string[];
|
|
438
|
-
npm: string[];
|
|
439
|
-
}>;
|
|
440
|
-
};
|
|
441
|
-
};
|
|
442
|
-
/**
|
|
443
|
-
* Supported bundler names for building packages:
|
|
444
|
-
* - bun: Bun's built-in bundler for fast builds
|
|
445
|
-
* - copy: A simple file copy without bundling
|
|
446
|
-
* - jsr: Similar to copy but optimized for the JSR commonPubRegistry
|
|
447
|
-
* - mkdist: A lightweight bundler focused on TypeScript/ESM
|
|
448
|
-
* - rollup: A traditional bundler with an extensive plugin ecosystem
|
|
449
|
-
* - untyped: Types and markdown generation from a config object
|
|
450
|
-
*/
|
|
451
|
-
export type BundlerName = "bun" | "copy" | "jsr" | "mkdist" | "rollup" | "untyped";
|
|
452
|
-
export type Esbuild = "es2019" | "es2020" | "es2021" | "es2022" | "es2023";
|
|
453
|
-
/**
|
|
454
|
-
* Configuration for a library to be built and published as a separate package.
|
|
455
|
-
* Used when publishing multiple packages from a single repository.
|
|
456
|
-
*/
|
|
457
|
-
export type LibConfig = {
|
|
458
|
-
/**
|
|
459
|
-
* When `true`, generates TypeScript declaration files (.d.ts) for NPM packages.
|
|
460
|
-
*/
|
|
461
|
-
libDeclarations: boolean;
|
|
462
|
-
/**
|
|
463
|
-
* An optional description of the library, included in the dist's package.json.
|
|
464
|
-
* Provides users with an overview of the library's purpose.
|
|
465
|
-
*
|
|
466
|
-
* @example "Utility functions for data manipulation"
|
|
467
|
-
* @example "Core configuration module for the framework"
|
|
468
|
-
*
|
|
469
|
-
* @default `package.json`'s "description"
|
|
470
|
-
*/
|
|
471
|
-
libDescription: string;
|
|
472
|
-
/**
|
|
473
|
-
* The directory where the library's dist files are stored.
|
|
474
|
-
*
|
|
475
|
-
* @default name is derived from the library's name after slash
|
|
476
|
-
*/
|
|
477
|
-
libDirName: string;
|
|
478
|
-
/**
|
|
479
|
-
* The path to the library's main entry file.
|
|
480
|
-
* This file serves as the primary entry point for imports.
|
|
481
|
-
* The path should be relative to the project root.
|
|
482
|
-
* The full path to the library's main file is derived by joining `libsDirDist` with `main`.
|
|
483
|
-
*
|
|
484
|
-
* @example "my-lib-1/mod.ts"
|
|
485
|
-
* @example "my-lib-2/ml2-mod.ts"
|
|
486
|
-
* @example "src/libs/my-lib-3/index.js"
|
|
487
|
-
*/
|
|
488
|
-
libMainFile: string;
|
|
489
|
-
/**
|
|
490
|
-
* Dependencies to include in the dist's package.json.
|
|
491
|
-
* The final output may vary based on `filterDepsPatterns`.
|
|
492
|
-
* Defines how dependencies are handled during publishing:
|
|
493
|
-
* - `string[]`: Includes only the specified dependencies.
|
|
494
|
-
* - `true`: Includes all dependencies from the main package.json.
|
|
495
|
-
* - `false` or `undefined`: Automatically determines dependencies based on imports.
|
|
496
|
-
*
|
|
497
|
-
* @example ["@reliverse/pathkit", "@reliverse/relifso"] - Only will include these specific dependencies.
|
|
498
|
-
* @example true - Include all `dependencies` from the main package.json.
|
|
499
|
-
*/
|
|
500
|
-
libPkgKeepDeps: boolean | string[];
|
|
501
|
-
/**
|
|
502
|
-
* When `true`, minifies the output to reduce bundle size.
|
|
503
|
-
* Recommended for production builds but may increase build time.
|
|
504
|
-
*
|
|
505
|
-
* @default true
|
|
506
|
-
*/
|
|
507
|
-
libTranspileMinify: boolean;
|
|
508
|
-
/**
|
|
509
|
-
* When true, pauses publishing for this specific library (overridden by commonPubPause).
|
|
510
|
-
* If true, this library will be built but not published, even if other libs are published.
|
|
511
|
-
*
|
|
512
|
-
* @default false
|
|
513
|
-
*/
|
|
514
|
-
libPubPause?: boolean;
|
|
515
|
-
/**
|
|
516
|
-
* The registry to publish the library to.
|
|
517
|
-
*
|
|
518
|
-
* @default "npm"
|
|
519
|
-
*/
|
|
520
|
-
libPubRegistry?: "jsr" | "npm" | "npm-jsr";
|
|
521
|
-
/**
|
|
522
|
-
* Optional version override for the library.
|
|
523
|
-
* If not provided, falls back to the version from the main package.json.
|
|
524
|
-
*
|
|
525
|
-
* @default `package.json`'s "version"
|
|
526
|
-
*/
|
|
527
|
-
version?: string;
|
|
528
|
-
};
|
|
529
|
-
export type NpmOutExt = "cjs" | "cts" | "js" | "mjs" | "mts" | "ts";
|
|
530
|
-
/**
|
|
531
|
-
* Supported source map options for built packages.
|
|
532
|
-
* - boolean: Enable/disable source maps.
|
|
533
|
-
* - "inline": Include source maps within output files.
|
|
534
|
-
* - "none": Do not generate source maps.
|
|
535
|
-
* - "linked": Generate separate source map files with links.
|
|
536
|
-
* - "external": Generate separate source map files.
|
|
537
|
-
*/
|
|
538
|
-
export type Sourcemap = "external" | "inline" | "linked" | "none" | boolean;
|
|
539
|
-
/**
|
|
540
|
-
* Supported output module transpileFormats for built packages.
|
|
541
|
-
* - esm: ECMAScript modules (import/export)
|
|
542
|
-
* - cjs: CommonJS modules (require/exports)
|
|
543
|
-
* - iife: Immediately Invoked Function Expression (for browsers)
|
|
544
|
-
*/
|
|
545
|
-
export type transpileFormat = "cjs" | "esm" | "iife";
|
|
546
|
-
/**
|
|
547
|
-
* Supported transpileTarget runtime environments for built packages.
|
|
548
|
-
* - node: Optimized for Node.js.
|
|
549
|
-
* - bun: Optimized for Bun.
|
|
550
|
-
* - browser: Optimized for web browsers.
|
|
551
|
-
*/
|
|
552
|
-
export type transpileTarget = "browser" | "bun" | "node";
|
|
23
|
+
export type DistDirs = "dist-libs" | "dist-jsr" | "dist-npm";
|
|
24
|
+
export type DistDirsAll = DistDirs | "all";
|
|
553
25
|
export type CopyBuildEntry = BaseBuildEntry & {
|
|
554
26
|
builder: "copy";
|
|
555
27
|
pattern?: string | string[];
|
|
556
28
|
};
|
|
557
|
-
export
|
|
29
|
+
export interface CopyHooks {
|
|
558
30
|
"copy:done": (ctx: BuildContext) => Promise<void> | void;
|
|
559
31
|
"copy:entries": (ctx: BuildContext, entries: CopyBuildEntry[]) => Promise<void> | void;
|
|
560
|
-
}
|
|
32
|
+
}
|
|
561
33
|
export type MkdistBuildEntry = _BaseAndMkdist & {
|
|
562
34
|
builder: "mkdist";
|
|
563
35
|
};
|
|
564
|
-
export
|
|
36
|
+
export interface MkdistHooks {
|
|
565
37
|
"mkdist:done": (ctx: BuildContext) => Promise<void> | void;
|
|
566
38
|
"mkdist:entries": (ctx: BuildContext, entries: MkdistBuildEntry[]) => Promise<void> | void;
|
|
567
39
|
"mkdist:entry:build": (ctx: BuildContext, entry: MkdistBuildEntry, output: {
|
|
568
40
|
writtenFiles: string[];
|
|
569
41
|
}) => Promise<void> | void;
|
|
570
42
|
"mkdist:entry:options": (ctx: BuildContext, entry: MkdistBuildEntry, options: MkdistOptions) => Promise<void> | void;
|
|
571
|
-
}
|
|
43
|
+
}
|
|
572
44
|
type _BaseAndMkdist = BaseBuildEntry & MkdistOptions;
|
|
573
45
|
export type RollupBuildEntry = BaseBuildEntry & {
|
|
574
46
|
builder: "rollup";
|
|
@@ -582,7 +54,7 @@ export type EsbuildOptions = CommonOptions & {
|
|
|
582
54
|
*/
|
|
583
55
|
loaders?: Record<string, false | EsbuildLoader>;
|
|
584
56
|
};
|
|
585
|
-
export
|
|
57
|
+
export interface RollupBuildOptions {
|
|
586
58
|
/**
|
|
587
59
|
* Alias plugin options
|
|
588
60
|
* Set to `false` to disable the plugin.
|
|
@@ -654,14 +126,14 @@ export type RollupBuildOptions = {
|
|
|
654
126
|
* @experimental
|
|
655
127
|
*/
|
|
656
128
|
watch?: boolean;
|
|
657
|
-
}
|
|
658
|
-
export
|
|
129
|
+
}
|
|
130
|
+
export interface RollupHooks {
|
|
659
131
|
"rollup:build": (ctx: BuildContext, build: RollupBuild) => Promise<void> | void;
|
|
660
132
|
"rollup:done": (ctx: BuildContext) => Promise<void> | void;
|
|
661
133
|
"rollup:dts:build": (ctx: BuildContext, build: RollupBuild) => Promise<void> | void;
|
|
662
134
|
"rollup:dts:options": (ctx: BuildContext, options: RollupOptions) => Promise<void> | void;
|
|
663
135
|
"rollup:options": (ctx: BuildContext, options: RollupOptions) => Promise<void> | void;
|
|
664
|
-
}
|
|
136
|
+
}
|
|
665
137
|
export type RollupOptions = _RollupOptions & {
|
|
666
138
|
plugins: Plugin[];
|
|
667
139
|
};
|
|
@@ -669,32 +141,32 @@ export type UntypedBuildEntry = BaseBuildEntry & {
|
|
|
669
141
|
builder: "untyped";
|
|
670
142
|
defaults?: Record<string, any>;
|
|
671
143
|
};
|
|
672
|
-
export
|
|
144
|
+
export interface UntypedHooks {
|
|
673
145
|
"untyped:done": (ctx: BuildContext) => Promise<void> | void;
|
|
674
146
|
"untyped:entries": (ctx: BuildContext, entries: UntypedBuildEntry[]) => Promise<void> | void;
|
|
675
147
|
"untyped:entry:options": (ctx: BuildContext, entry: UntypedBuildEntry, options: any) => Promise<void> | void;
|
|
676
148
|
"untyped:entry:outputs": (ctx: BuildContext, entry: UntypedBuildEntry, outputs: UntypedOutputs) => Promise<void> | void;
|
|
677
149
|
"untyped:entry:schema": (ctx: BuildContext, entry: UntypedBuildEntry, schema: Schema) => Promise<void> | void;
|
|
678
|
-
}
|
|
679
|
-
export
|
|
150
|
+
}
|
|
151
|
+
export interface UntypedOutput {
|
|
680
152
|
contents: string;
|
|
681
153
|
fileName: string;
|
|
682
|
-
}
|
|
683
|
-
export
|
|
154
|
+
}
|
|
155
|
+
export interface UntypedOutputs {
|
|
684
156
|
declaration?: UntypedOutput;
|
|
685
157
|
defaults: UntypedOutput;
|
|
686
158
|
markdown: UntypedOutput;
|
|
687
159
|
schema: UntypedOutput;
|
|
688
|
-
}
|
|
689
|
-
export
|
|
160
|
+
}
|
|
161
|
+
export interface BaseBuildEntry {
|
|
690
162
|
builder?: "copy" | "mkdist" | "rollup" | "untyped";
|
|
691
163
|
declaration?: "compatible" | "node16" | boolean;
|
|
692
164
|
input: string;
|
|
693
165
|
name?: string;
|
|
694
166
|
outDir?: string;
|
|
695
167
|
isLib: boolean;
|
|
696
|
-
}
|
|
697
|
-
export
|
|
168
|
+
}
|
|
169
|
+
export interface BuildContext {
|
|
698
170
|
buildEntries: {
|
|
699
171
|
bytes?: number;
|
|
700
172
|
chunk?: boolean;
|
|
@@ -714,14 +186,14 @@ export type BuildContext = {
|
|
|
714
186
|
usedImports: Set<string>;
|
|
715
187
|
warnings: Set<string>;
|
|
716
188
|
isLib: boolean;
|
|
717
|
-
}
|
|
189
|
+
}
|
|
718
190
|
export type BuildEntry = BaseBuildEntry | CopyBuildEntry | MkdistBuildEntry | RollupBuildEntry | UntypedBuildEntry;
|
|
719
191
|
export type BuildHooks = CopyHooks & MkdistHooks & RollupHooks & UntypedHooks & {
|
|
720
192
|
"build:before": (ctx: BuildContext) => Promise<void> | void;
|
|
721
193
|
"build:done": (ctx: BuildContext) => Promise<void> | void;
|
|
722
194
|
"build:prepare": (ctx: BuildContext) => Promise<void> | void;
|
|
723
195
|
};
|
|
724
|
-
export
|
|
196
|
+
export interface BuildOptions {
|
|
725
197
|
/**
|
|
726
198
|
* Create aliases for module imports to reference modules in code using more concise paths.
|
|
727
199
|
* Allow you to specify an alias for the module path.
|
|
@@ -816,7 +288,7 @@ export type BuildOptions = {
|
|
|
816
288
|
* Watch mode options.
|
|
817
289
|
*/
|
|
818
290
|
transpileWatchOptions: undefined | WatcherOptions;
|
|
819
|
-
}
|
|
291
|
+
}
|
|
820
292
|
export type BuildPreset = (() => UnifiedBuildConfig) | UnifiedBuildConfig;
|
|
821
293
|
/**
|
|
822
294
|
* In addition to basic `entries`, `presets`, and `hooks`,
|
|
@@ -847,15 +319,15 @@ export type UnifiedBuildConfig = DeepPartial<Omit<BuildOptions, "entries">> & {
|
|
|
847
319
|
type DeepPartial<T> = {
|
|
848
320
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
849
321
|
};
|
|
850
|
-
export
|
|
322
|
+
export interface PerfTimer {
|
|
851
323
|
pausedAt: null | number;
|
|
852
324
|
pausedDuration: number;
|
|
853
325
|
startTime: number;
|
|
854
|
-
}
|
|
326
|
+
}
|
|
855
327
|
/** Options common to both NPM and JSR build targets */
|
|
856
328
|
/** Options specific to the transpilation/bundling process */
|
|
857
329
|
type DirectoryType = "src" | "dist-npm" | "dist-jsr" | "dist-libs/npm" | "dist-libs/jsr";
|
|
858
|
-
export
|
|
330
|
+
export interface RulesCheckOptions {
|
|
859
331
|
directory: DirectoryType;
|
|
860
332
|
strict: boolean;
|
|
861
333
|
moduleResolution: "bundler" | "nodenext";
|
|
@@ -867,15 +339,15 @@ export type RulesCheckOptions = {
|
|
|
867
339
|
optional?: boolean;
|
|
868
340
|
fix?: boolean;
|
|
869
341
|
depth?: number;
|
|
870
|
-
}
|
|
871
|
-
export
|
|
342
|
+
}
|
|
343
|
+
export interface CheckIssue {
|
|
872
344
|
type: "file-extension" | "path-extension" | "missing-dependency" | "builtin-module" | "dler-config-health" | "self-include" | "tsconfig-health" | "no-index-files";
|
|
873
345
|
message: string;
|
|
874
346
|
file: string;
|
|
875
347
|
line?: number;
|
|
876
348
|
column?: number;
|
|
877
|
-
}
|
|
878
|
-
export
|
|
349
|
+
}
|
|
350
|
+
export interface CheckResult {
|
|
879
351
|
success: boolean;
|
|
880
352
|
issues: CheckIssue[];
|
|
881
353
|
stats: {
|
|
@@ -883,14 +355,14 @@ export type CheckResult = {
|
|
|
883
355
|
importsChecked: number;
|
|
884
356
|
timeElapsed: number;
|
|
885
357
|
};
|
|
886
|
-
}
|
|
887
|
-
export
|
|
358
|
+
}
|
|
359
|
+
export interface InputFile {
|
|
888
360
|
path: string;
|
|
889
361
|
extension: string;
|
|
890
362
|
srcPath?: string;
|
|
891
363
|
getContents: () => Promise<string> | string;
|
|
892
|
-
}
|
|
893
|
-
export
|
|
364
|
+
}
|
|
365
|
+
export interface OutputFile {
|
|
894
366
|
/**
|
|
895
367
|
* relative to distDir
|
|
896
368
|
*/
|
|
@@ -902,10 +374,10 @@ export type OutputFile = {
|
|
|
902
374
|
errors?: Error[];
|
|
903
375
|
raw?: boolean;
|
|
904
376
|
skip?: boolean;
|
|
905
|
-
}
|
|
377
|
+
}
|
|
906
378
|
export type LoaderResult = OutputFile[] | undefined;
|
|
907
379
|
export type LoadFile = (input: InputFile) => LoaderResult | Promise<LoaderResult>;
|
|
908
|
-
|
|
380
|
+
interface LoaderOptions {
|
|
909
381
|
ext?: "js" | "mjs" | "cjs" | "ts" | "mts" | "cts";
|
|
910
382
|
format?: "cjs" | "esm";
|
|
911
383
|
declaration?: boolean;
|
|
@@ -917,11 +389,11 @@ type LoaderOptions = {
|
|
|
917
389
|
plugins?: PostcssPlugin[];
|
|
918
390
|
processOptions?: Omit<PostcssProcessOptions, "from">;
|
|
919
391
|
};
|
|
920
|
-
}
|
|
921
|
-
export
|
|
392
|
+
}
|
|
393
|
+
export interface LoaderContext {
|
|
922
394
|
loadFile: LoadFile;
|
|
923
395
|
options: LoaderOptions;
|
|
924
|
-
}
|
|
396
|
+
}
|
|
925
397
|
export type Loader = (input: InputFile, context: LoaderContext) => LoaderResult | Promise<LoaderResult>;
|
|
926
398
|
type LoaderName = "js" | "vue" | "sass" | "postcss";
|
|
927
399
|
export type CreateLoaderOptions = {
|
|
@@ -940,19 +412,4 @@ export type MkdistOptions = {
|
|
|
940
412
|
compilerOptions?: TSConfig["compilerOptions"];
|
|
941
413
|
};
|
|
942
414
|
} & LoaderOptions;
|
|
943
|
-
export type FileContent = string | Record<string, unknown>;
|
|
944
|
-
export type FileType = "text" | "json" | "binary";
|
|
945
|
-
export type TemplateFileContent = {
|
|
946
|
-
content: FileContent;
|
|
947
|
-
type: FileType;
|
|
948
|
-
};
|
|
949
|
-
export type TemplateConfig = {
|
|
950
|
-
files: Record<string, TemplateFileContent>;
|
|
951
|
-
};
|
|
952
|
-
export type Template = {
|
|
953
|
-
name: string;
|
|
954
|
-
description: string;
|
|
955
|
-
config: TemplateConfig;
|
|
956
|
-
};
|
|
957
|
-
export type Templates = Record<string, Template>;
|
|
958
415
|
export {};
|