@wolfstar/schema 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/config-Ctpk84fx.d.ts +750 -0
- package/dist/esm/config-Ctpk84fx.d.ts.map +1 -0
- package/dist/esm/config.d.ts +2 -398
- package/dist/esm/index.d.ts +28 -184
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +250 -98
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/esm/config.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-Ctpk84fx.d.ts","names":[],"sources":["../../src/config/validator.ts","../../src/config/compatibility.ts","../../src/config/env.ts","../../src/config/hooks.ts","../../src/config/resolve.ts","../../src/types/builder.ts","../../src/types/hooks.ts","../../src/types/config.ts","../../src/config.ts"],"mappings":";;;;cAIa;mBACwB;EAApC,YAAoC;cAExB;EAIL,MAAM,gBAAgB,gBAAgB,YAAY,QAAQ,QAAQ,QAAQ,WAAW,aAAa;EAIlG,UAAU,eAAe,cAAc;EAQvC,OAAO,gBAAgB;EAMvB,QAAQ,gBAAgB;;EAOxB,YAAY,gBAAgB,eAAe;EAM3C,YAAY,gBAAgB;EAM5B,kBAAkB,gBAAgB;EAMlC,aAAa,gBAAgB,eAAe;;EAS5C,UAAU,cAAc,kBAAkB,gBAAgB,eAAe;;;;UC1DhE;WACP,sBAAsB;;cAGnB;cACA;;cAEA;;cAEA,4BAA4B;;cAE5B;;cAEA;;;UCZI;;WAEP;;WAEA,SAAS,SAAS;;;;;;;;iBAYZ,WACf,QAAQ,oBACR,aAAa,wBACb,QAAQ,sBACR,cAAc,4BACd,WAAW,YACT;;;KCxBE,UAAU,WAAW;;KAGd,sBAAsB,SAAS,QAAQ,OAAO,wBAAwB;cAErE;;;;;;iBAqBG,aAAa,QAAQ,8BAA8B,WAAW,YAAY;;;UCXzE;EAChB;;EAEA;EACA;EACA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;;EAKhB;;;;;EAKA;;UAGgB;;;;;EAKhB,OAAO;;UAGS;;;;;;EAMhB;;;;;;EAMA;;;;;EAKA;;;;;EAKA;;;;;;EAMA;;;;;;;UAQgB;;;;;GAKf;;;;;;EAMD;;;;;;;;;;;;KAaW;EACP;EAAoB;EAA4B;;;;;;;EAOlD;;;;;;;;;;;EAWA;EACA;;EAGA;EACA;;;;;;;;;;;;;EAaA;;EAEA,QAAQ;;;;;;;UAQM;;;;;;EAMhB;;EAEA;;EAEA;;;;;EAKA;;EAEA;;;;;EAKA;;;;;;;UAQgB,uBAAuB;;EAEvC;;UAGgB;;;;;EAKhB;;;;;EAKA;EACA,QAAQ;EACR,MAAM;EACN,UAAU;;;;;;EAMV,UAAU;;;;;EAKV,MAAM;;;;;EAKN,QAAQ;;EAER,eAAe;;EAEf,SAAS;;;;;EAKT,OAAO;;;;;EAKP,SAAS;;;;;;;;;;;;;;;;;iBC7aM,aAAa,QAAQ,cAAc"}
|
package/dist/esm/config.d.ts
CHANGED
|
@@ -1,398 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* The build tool used to turn the project sources into runnable JavaScript.
|
|
4
|
-
*
|
|
5
|
-
* - `tsdown`: run the project's own `tsdown` programmatically, configured from {@link StarsConfig.tsdown} (and, with
|
|
6
|
-
* {@link StarsFutureConfig.compatibilityVersion} `3`, from the project's `tsdown.config.*` too).
|
|
7
|
-
* - `tsc`: run the project's `tsc -b` on the configured `tsconfig`.
|
|
8
|
-
* - `vite`: run the project's own `vite` (configuration file included), requires `experimental.enableVite`.
|
|
9
|
-
* - `none`: the entry is runnable as-is (JavaScript projects), no build step.
|
|
10
|
-
* - `auto`: detect from the project (default).
|
|
11
|
-
*/
|
|
12
|
-
type StarsBuildTool = 'tsdown' | 'tsc' | 'none' | 'vite';
|
|
13
|
-
interface StarsBuildConfig {
|
|
14
|
-
/**
|
|
15
|
-
* The build tool to use.
|
|
16
|
-
* @default 'auto'
|
|
17
|
-
*/
|
|
18
|
-
tool?: StarsBuildTool | 'auto';
|
|
19
|
-
/**
|
|
20
|
-
* The directory, relative to {@link StarsConfig.root}, the build writes into.
|
|
21
|
-
* @default 'dist', or '.output' when `experimental.enableNitro` is on (Nitro's own convention)
|
|
22
|
-
*/
|
|
23
|
-
outDir?: string;
|
|
24
|
-
/**
|
|
25
|
-
* The `tsconfig.json` the `tsc` and `tsdown` build tools use, relative to {@link StarsConfig.root}.
|
|
26
|
-
* @default 'src/tsconfig.json' when it exists, 'tsconfig.json' otherwise
|
|
27
|
-
*/
|
|
28
|
-
tsconfig?: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Raw options merged into the project's own `vite.config.*`, the way `vite: {}` in a Nuxt config is merged into
|
|
32
|
-
* Nuxt's own Vite config. Kept as `unknown` here (the CLI, not the framework, depends on `vite`'s types) and passed
|
|
33
|
-
* to Vite's `mergeConfig` as-is.
|
|
34
|
-
*/
|
|
35
|
-
type StarsViteConfig = Record<string, unknown>;
|
|
36
|
-
/**
|
|
37
|
-
* Options for `tsdown`, the bundler `stars build` uses by default.
|
|
38
|
-
*
|
|
39
|
-
* With {@link StarsFutureConfig.compatibilityVersion} `4` these replace `tsdown.config.*` outright: the build is
|
|
40
|
-
* derived from `stars.config` (the entry's directory, `build.outDir`, `build.tsconfig`) and these options are layered
|
|
41
|
-
* on top, so a project keeps one configuration file instead of two. With `3` the project's own `tsdown.config.*` is
|
|
42
|
-
* still loaded and these are merged over it, the way `vite: {}` in a Nuxt config is merged into the project's own
|
|
43
|
-
* Vite config: values here win, and `plugins` are appended rather than replaced.
|
|
44
|
-
*
|
|
45
|
-
* The options named below are the ones a bot usually reaches for. Every other `tsdown` option is accepted as-is —
|
|
46
|
-
* the framework does not depend on `tsdown`, so they stay loosely typed here and `tsdown`'s own `UserConfig` is the
|
|
47
|
-
* reference.
|
|
48
|
-
*/
|
|
49
|
-
interface StarsTsdownConfig {
|
|
50
|
-
/** Entry files or glob patterns, relative to the project root. Defaults to every source file next to `entry`. */
|
|
51
|
-
entry?: string | readonly string[] | Record<string, string>;
|
|
52
|
-
/** @default 'esm' */
|
|
53
|
-
format?: 'esm' | 'cjs' | 'iife' | 'umd' | readonly string[] | Record<string, unknown>;
|
|
54
|
-
/** @default 'node' */
|
|
55
|
-
platform?: 'node' | 'neutral' | 'browser';
|
|
56
|
-
target?: string | readonly string[] | false;
|
|
57
|
-
/**
|
|
58
|
-
* Emits one output file per source file instead of a single bundle, so pieces stay loadable from `dist/commands`
|
|
59
|
-
* and friends at runtime.
|
|
60
|
-
* @default true
|
|
61
|
-
*/
|
|
62
|
-
unbundle?: boolean;
|
|
63
|
-
/** Rolldown plugins. Appended to the ones `stars` adds (auto imports) and to those of a `tsdown.config.*`. */
|
|
64
|
-
plugins?: readonly unknown[];
|
|
65
|
-
alias?: Record<string, string>;
|
|
66
|
-
define?: Record<string, string>;
|
|
67
|
-
external?: unknown;
|
|
68
|
-
noExternal?: unknown;
|
|
69
|
-
deps?: Record<string, unknown>;
|
|
70
|
-
/** @default () => ({ js: extname(build.output) }) */
|
|
71
|
-
outExtensions?: unknown;
|
|
72
|
-
/** @default true */
|
|
73
|
-
sourcemap?: boolean | 'inline' | 'hidden';
|
|
74
|
-
minify?: unknown;
|
|
75
|
-
/** @default false — a bot is not a library, so no declaration files are emitted. */
|
|
76
|
-
dts?: boolean | Record<string, unknown>;
|
|
77
|
-
/** @default true */
|
|
78
|
-
clean?: boolean | readonly string[];
|
|
79
|
-
treeshake?: boolean;
|
|
80
|
-
copy?: unknown;
|
|
81
|
-
hooks?: Record<string, unknown>;
|
|
82
|
-
[option: string]: unknown;
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* The build-default generation the project runs on. Version 4 is current; version 3 remains available for projects
|
|
86
|
-
* that still load a standalone `tsdown.config.*`.
|
|
87
|
-
*/
|
|
88
|
-
type StarsCompatibilityVersion = 3 | 4;
|
|
89
|
-
/**
|
|
90
|
-
* Nuxt-style compatibility block. New projects need not set it; version 3 is retained as an explicit migration
|
|
91
|
-
* escape hatch for projects that still use a standalone `tsdown.config.*`.
|
|
92
|
-
*/
|
|
93
|
-
interface StarsFutureConfig {
|
|
94
|
-
/**
|
|
95
|
-
* The major whose defaults apply.
|
|
96
|
-
*
|
|
97
|
-
* `4` is the default build pipeline:
|
|
98
|
-
* - auto imports are on by default with the `tsdown` build tool ({@link StarsImportsConfig}), and the
|
|
99
|
-
* `autoImports()` plugin is wired into the build by `stars` itself.
|
|
100
|
-
* - `tsdown` is configured from {@link StarsConfig.tsdown} only. A `tsdown.config.*` in the project root is
|
|
101
|
-
* rejected rather than silently ignored, so a build never loses the plugins it declares.
|
|
102
|
-
* - `build.tool: 'auto'` resolves to `tsdown` for any TypeScript entry, without looking for a `tsdown.config.*`
|
|
103
|
-
* or a `tsdown` dependency first.
|
|
104
|
-
*
|
|
105
|
-
* `3` keeps the legacy behaviour: auto imports off unless asked for, and a `tsdown.config.*` loaded and merged with
|
|
106
|
-
* {@link StarsConfig.tsdown}.
|
|
107
|
-
* @default 4
|
|
108
|
-
*/
|
|
109
|
-
compatibilityVersion?: StarsCompatibilityVersion;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* The type checker `stars dev` runs next to the bot.
|
|
113
|
-
*
|
|
114
|
-
* - `tsc`: the project's own TypeScript, in watch mode.
|
|
115
|
-
* - `golar`: the project's `golar`, forwarding to TypeScript (`golar tsc`), in watch mode.
|
|
116
|
-
* - `tsz`: the project's `tsz` (or `try-tsz`). It has no watch mode, so it is re-run after every build instead.
|
|
117
|
-
* - `auto`: `golar` when the project depends on it, `tsc` otherwise (default).
|
|
118
|
-
*/
|
|
119
|
-
type StarsTypechecker = 'tsc' | 'golar' | 'tsz';
|
|
120
|
-
interface StarsTypecheckConfig {
|
|
121
|
-
/**
|
|
122
|
-
* The `tsconfig.json` the type checker runs against, relative to {@link StarsConfig.root}.
|
|
123
|
-
* @default the build tool's tsconfig, 'src/tsconfig.json' or 'tsconfig.json'
|
|
124
|
-
*/
|
|
125
|
-
tsconfig?: string;
|
|
126
|
-
/**
|
|
127
|
-
* Which type checker to run.
|
|
128
|
-
* @default 'auto'
|
|
129
|
-
*/
|
|
130
|
-
checker?: StarsTypechecker | 'auto';
|
|
131
|
-
}
|
|
132
|
-
interface StarsTunnelConfig {
|
|
133
|
-
/**
|
|
134
|
-
* An https URL you already serve; when unset a `cloudflared` quick tunnel is opened instead.
|
|
135
|
-
*/
|
|
136
|
-
url?: string;
|
|
137
|
-
/**
|
|
138
|
-
* Writes the tunnel's URL to the Discord application's `interactions_endpoint_url` when it changes.
|
|
139
|
-
*
|
|
140
|
-
* This edits a live Discord application, so it is opt-in: it needs `DISCORD_TOKEN` and `DISCORD_APPLICATION_ID`
|
|
141
|
-
* (or `APPLICATION_ID`) in the environment or the project's `.env`.
|
|
142
|
-
* @default false
|
|
143
|
-
*/
|
|
144
|
-
updateEndpoint?: boolean;
|
|
145
|
-
/**
|
|
146
|
-
* The path the interactions endpoint is served on, appended to the tunnel URL.
|
|
147
|
-
* @default '/'
|
|
148
|
-
*/
|
|
149
|
-
path?: string;
|
|
150
|
-
}
|
|
151
|
-
interface StarsDevConfig {
|
|
152
|
-
/** Custom terminal wordmark (one or more lines), or `false` to hide it. Defaults to the Stars wordmark. */
|
|
153
|
-
banner?: string | readonly string[] | false;
|
|
154
|
-
/**
|
|
155
|
-
* Extra paths to watch, relative to {@link StarsConfig.root}. Only used when
|
|
156
|
-
* the build tool is `none`; `tsdown` and `tsc` watch through their own build.
|
|
157
|
-
* @default [dirname(entry)]
|
|
158
|
-
*/
|
|
159
|
-
watch?: string[];
|
|
160
|
-
/**
|
|
161
|
-
* Glob patterns or paths to ignore while watching, relative to {@link StarsConfig.root}.
|
|
162
|
-
* @default ['**\/node_modules/**', '**\/dist/**', '**\/.git/**']
|
|
163
|
-
*/
|
|
164
|
-
ignore?: string[];
|
|
165
|
-
/**
|
|
166
|
-
* Milliseconds to wait after a change before restarting the bot.
|
|
167
|
-
* @default 150
|
|
168
|
-
*/
|
|
169
|
-
debounce?: number;
|
|
170
|
-
/**
|
|
171
|
-
* Environment variables added to the bot process.
|
|
172
|
-
*/
|
|
173
|
-
env?: Record<string, string>;
|
|
174
|
-
/**
|
|
175
|
-
* Arguments passed to `node` before the entry file.
|
|
176
|
-
* @default ['--enable-source-maps']
|
|
177
|
-
*/
|
|
178
|
-
nodeArgs?: string[];
|
|
179
|
-
/**
|
|
180
|
-
* Arguments passed to the bot after the entry file.
|
|
181
|
-
* @default []
|
|
182
|
-
*/
|
|
183
|
-
args?: string[];
|
|
184
|
-
/**
|
|
185
|
-
* The URL the bot listens on, shown in the dev UI's status line and used for {@link StarsDevConfig.health}.
|
|
186
|
-
*
|
|
187
|
-
* Resolved automatically, the way Vite's and Nuxt's dev servers do, from (in order) `dev.env.HTTP_PORT`, the
|
|
188
|
-
* process's `HTTP_PORT`, the project's `src/.env*`/`.env*` (`HTTP_PORT` or `PORT`), or `3000`. `stars dev` also
|
|
189
|
-
* resolves whether `localhost` should be shown as `127.0.0.1` instead, the same DNS-order check Vite does, so the
|
|
190
|
-
* printed URL is always the one that is actually reachable.
|
|
191
|
-
* @default `http://localhost:3000` (or whichever port is found)
|
|
192
|
-
*/
|
|
193
|
-
url?: string;
|
|
194
|
-
/**
|
|
195
|
-
* A path, relative to {@link StarsDevConfig.url}, polled to report the bot's health in the dev UI.
|
|
196
|
-
* When unset the dev UI only reports process state.
|
|
197
|
-
*/
|
|
198
|
-
health?: string;
|
|
199
|
-
/**
|
|
200
|
-
* Milliseconds to wait for the bot to exit after `SIGTERM` before killing it.
|
|
201
|
-
* @default 5000
|
|
202
|
-
*/
|
|
203
|
-
killTimeout?: number;
|
|
204
|
-
/**
|
|
205
|
-
* Runs a type checker next to the bot and reports type errors on the dev UI's `tsc` channel, without blocking
|
|
206
|
-
* builds or restarts. `true` uses the project's own tsconfig and type checker, an object picks either
|
|
207
|
-
* ({@link StarsTypecheckConfig.checker}).
|
|
208
|
-
* @default false
|
|
209
|
-
*/
|
|
210
|
-
typecheck?: boolean | StarsTypecheckConfig;
|
|
211
|
-
/**
|
|
212
|
-
* Exposes the bot's HTTP interactions endpoint publicly while `stars dev` runs, so Discord can reach it.
|
|
213
|
-
*
|
|
214
|
-
* `true` opens a `cloudflared` quick tunnel (its hostname changes on every run), a string is an https URL you
|
|
215
|
-
* already serve yourself (named tunnel, reverse proxy, …) that the CLI only checks for reachability.
|
|
216
|
-
* @default false
|
|
217
|
-
*/
|
|
218
|
-
tunnel?: boolean | string | StarsTunnelConfig;
|
|
219
|
-
/**
|
|
220
|
-
* The file `stars dev` mirrors its logs into, relative to {@link StarsConfig.root}, so a session can be read back
|
|
221
|
-
* after the terminal UI is gone. `false` disables it.
|
|
222
|
-
* @default '.stars/dev.log'
|
|
223
|
-
*/
|
|
224
|
-
logFile?: string | false;
|
|
225
|
-
}
|
|
226
|
-
interface StarsI18nCodegenConfig {
|
|
227
|
-
/**
|
|
228
|
-
* The base locale directory, relative to {@link StarsConfig.root}.
|
|
229
|
-
* @default 'src/locales/en-US'
|
|
230
|
-
*/
|
|
231
|
-
locales?: string;
|
|
232
|
-
/**
|
|
233
|
-
* The generated declaration file, relative to {@link StarsConfig.root}.
|
|
234
|
-
* @default 'src/@types/i18next.d.ts'
|
|
235
|
-
*/
|
|
236
|
-
output?: string;
|
|
237
|
-
}
|
|
238
|
-
interface StarsCodegenConfig {
|
|
239
|
-
/**
|
|
240
|
-
* i18next type generation through `@wolfstar/i18next-type-generator`.
|
|
241
|
-
* `false` disables it, an object enables it, unset auto-detects from the presence of the locales directory.
|
|
242
|
-
*/
|
|
243
|
-
i18n?: StarsI18nCodegenConfig | false;
|
|
244
|
-
}
|
|
245
|
-
interface StarsImportsConfig {
|
|
246
|
-
/**
|
|
247
|
-
* Whether auto imports are enabled. Requires the `tsdown` build tool: the imports are injected at build time by
|
|
248
|
-
* the `autoImports()` plugin from `@wolfstar/http-framework/auto-imports`, which the other tools cannot run.
|
|
249
|
-
* @default true when the build tool is 'tsdown', false otherwise
|
|
250
|
-
*/
|
|
251
|
-
enabled?: boolean;
|
|
252
|
-
/**
|
|
253
|
-
* Directories, relative to {@link StarsConfig.root}, whose exported values are auto-importable. Entries are glob
|
|
254
|
-
* path patterns: `'src/lib'` scans only the files directly inside it, `'src/lib/**'` scans recursively.
|
|
255
|
-
* @default ['src/lib/**', 'src/utils/**']
|
|
256
|
-
*/
|
|
257
|
-
dirs?: string[];
|
|
258
|
-
/**
|
|
259
|
-
* Packages whose exports are auto-importable. Packages that are not installed are skipped.
|
|
260
|
-
* @default ['@wolfstar/http-framework', '@wolfstar/decorators', '@wolfstar/env-utilities']
|
|
261
|
-
*/
|
|
262
|
-
presets?: string[];
|
|
263
|
-
/**
|
|
264
|
-
* Export names excluded from auto imports, e.g. to avoid clashes with project-local names.
|
|
265
|
-
* @default []
|
|
266
|
-
*/
|
|
267
|
-
exclude?: string[];
|
|
268
|
-
/**
|
|
269
|
-
* The generated declaration file that types the auto imports, relative to {@link StarsConfig.root}.
|
|
270
|
-
* Include it in the project's tsconfig and add its directory to .gitignore.
|
|
271
|
-
* @default '.stars/imports.d.ts'
|
|
272
|
-
*/
|
|
273
|
-
dts?: string;
|
|
274
|
-
}
|
|
275
|
-
/**
|
|
276
|
-
* The [Nitro preset](https://nitro.build/deploy) `stars build` targets, only reachable once
|
|
277
|
-
* {@link StarsExperimentalConfig.enableNitro} (itself gated on {@link StarsExperimentalConfig.enableVite}) is `true`
|
|
278
|
-
* — see {@link StarsExperimentalConfig}.
|
|
279
|
-
*/
|
|
280
|
-
interface StarsNitroConfig {
|
|
281
|
-
/** Additional Nitro options (routeRules, runtimeConfig, storage, publicAssets, hooks, etc.).
|
|
282
|
-
* Use `defineNitroConfig` from `@wolfstar/nitro-server` for upstream option completion.
|
|
283
|
-
* Stars owns rootDir, serverEntry, output.dir and the reserved virtual entry.
|
|
284
|
-
*/
|
|
285
|
-
[option: string]: unknown;
|
|
286
|
-
/**
|
|
287
|
-
* `'node-server'` (the default, runs locally with plain `node`), `'cloudflare-module'`, `'aws-lambda'`,
|
|
288
|
-
* `'vercel'`, `'netlify'`, `'bun'`, `'deno-deploy'`, and more — see Nitro's own preset list.
|
|
289
|
-
* @default 'node-server'
|
|
290
|
-
*/
|
|
291
|
-
preset?: string;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Opt-in flags for work that is still landing, in the shape Nuxt's own `experimental` block has: every flag is a
|
|
295
|
-
* boolean, defaults to `false`, and is documented with what it changes and what it still needs. A flag stays here
|
|
296
|
-
* until the behaviour it guards is the default (or is dropped), so enabling one is a statement that breakage is
|
|
297
|
-
* acceptable in exchange for the feature.
|
|
298
|
-
*
|
|
299
|
-
* `enableExternalVite`, `enableNitro` and `nitro` build on `enableVite` (and `nitro` on `enableNitro` too): the type
|
|
300
|
-
* only accepts them once their prerequisite is `true`, so turning one on without the other is a type error here
|
|
301
|
-
* instead of a diagnostic at load time.
|
|
302
|
-
*/
|
|
303
|
-
type StarsExperimentalConfig = {
|
|
304
|
-
enableVite?: false;
|
|
305
|
-
enableExternalVite?: false;
|
|
306
|
-
enableNitro?: false;
|
|
307
|
-
} | {
|
|
308
|
-
/**
|
|
309
|
-
* Uses Vite as the project's build tool, in place of `tsdown`. `build.tool` may then be set to `'vite'`
|
|
310
|
-
* (and `'auto'` detects a `vite.config.*`); the bot keeps calling `client.listen()` and running as a
|
|
311
|
-
* plain `node:http` process, restarted on every change — this only swaps the bundler.
|
|
312
|
-
*/
|
|
313
|
-
enableVite: true;
|
|
314
|
-
/**
|
|
315
|
-
* Runs the bot through Vite itself, the way `nuxt dev` runs on Vite's own dev server: instead of
|
|
316
|
-
* building then restarting a child `node` process on every change, `stars dev` loads the entry through
|
|
317
|
-
* Vite's SSR module graph and serves it — through `Client#fetch` — from one long-lived process,
|
|
318
|
-
* invalidating and re-evaluating just the entry's module graph on a change instead of restarting.
|
|
319
|
-
*
|
|
320
|
-
* With this on, the entry's default export must be the `Client` instance (already `load()`ed, not
|
|
321
|
-
* `listen()`ed) rather than a script that calls `client.listen()` itself — `stars dev` owns the socket.
|
|
322
|
-
* @default false
|
|
323
|
-
*/
|
|
324
|
-
enableExternalVite?: boolean;
|
|
325
|
-
enableNitro?: false;
|
|
326
|
-
} | {
|
|
327
|
-
enableVite: true;
|
|
328
|
-
enableExternalVite?: boolean;
|
|
329
|
-
/**
|
|
330
|
-
* Builds the bot through [Nitro](https://nitro.build) instead of a `node:http` server, so `stars build`
|
|
331
|
-
* produces a server deployable to any of Nitro's presets (`node-server` locally, `cloudflare-module`,
|
|
332
|
-
* `aws-lambda`, `vercel`, `netlify`, `bun`, `deno-deploy`, and more). Nitro v3 is itself a Vite plugin, so
|
|
333
|
-
* this builds through the project's own `vite.config.*`/{@link StarsConfig.vite} the same way `build.tool:
|
|
334
|
-
* 'vite'` does, with a generated server entry that wraps the entry's default export (the `Client`
|
|
335
|
-
* instance, already `load()`ed rather than `listen()`ed — `stars build`/`stars dev` own the socket) in a
|
|
336
|
-
* call to `Client#fetch` — no per-preset adapter to maintain.
|
|
337
|
-
*
|
|
338
|
-
* Output goes to `.output/` (Nitro's own convention) instead of `build.outDir`. `stars dev` rebuilds and
|
|
339
|
-
* restarts on every change, the same as the other build tools.
|
|
340
|
-
*/
|
|
341
|
-
enableNitro: true;
|
|
342
|
-
/** Nitro-specific options, reachable only with `enableNitro: true`. */
|
|
343
|
-
nitro?: StarsNitroConfig;
|
|
344
|
-
};
|
|
345
|
-
interface StarsConfig {
|
|
346
|
-
/**
|
|
347
|
-
* The project root. Relative paths are resolved from the configuration file.
|
|
348
|
-
* @default dirname(configFile)
|
|
349
|
-
*/
|
|
350
|
-
root?: string;
|
|
351
|
-
/**
|
|
352
|
-
* The source entry point of the bot, relative to {@link StarsConfig.root}.
|
|
353
|
-
* @default the first of 'src/main.ts', 'src/main.js', 'src/index.ts', 'src/index.js' that exists
|
|
354
|
-
*/
|
|
355
|
-
entry?: string;
|
|
356
|
-
build?: StarsBuildConfig;
|
|
357
|
-
dev?: StarsDevConfig;
|
|
358
|
-
codegen?: StarsCodegenConfig;
|
|
359
|
-
/**
|
|
360
|
-
* Nuxt-style auto imports of the framework's exports and the project's own modules.
|
|
361
|
-
* `false` disables them, `true` forces them on (requires the `tsdown` build tool). On by default with
|
|
362
|
-
* `future.compatibilityVersion: 4`.
|
|
363
|
-
*/
|
|
364
|
-
imports?: StarsImportsConfig | boolean;
|
|
365
|
-
/** Opt-in flags for behaviour that is still landing. */
|
|
366
|
-
experimental?: StarsExperimentalConfig;
|
|
367
|
-
/** Build-default compatibility. Omit for version 4; set version 3 only while migrating a standalone tsdown config. */
|
|
368
|
-
future?: StarsFutureConfig;
|
|
369
|
-
/**
|
|
370
|
-
* Raw options merged into `vite.config.*`, the way `vite: {}` in a Nuxt config is merged into Nuxt's own Vite
|
|
371
|
-
* config. Only used with `build.tool: 'vite'` (see `experimental.enableVite`).
|
|
372
|
-
*/
|
|
373
|
-
vite?: StarsViteConfig;
|
|
374
|
-
/**
|
|
375
|
-
* The project's `tsdown` build. Replaces `tsdown.config.*` with `future.compatibilityVersion: 4`, and is merged
|
|
376
|
-
* over it with `3`. Only used with `build.tool: 'tsdown'`.
|
|
377
|
-
*/
|
|
378
|
-
tsdown?: StarsTsdownConfig;
|
|
379
|
-
}
|
|
380
|
-
//#endregion
|
|
381
|
-
//#region src/config.d.ts
|
|
382
|
-
/**
|
|
383
|
-
* Typed helper for `stars.config.{ts,mts,cts,js,mjs,cjs}` files.
|
|
384
|
-
*
|
|
385
|
-
* @example
|
|
386
|
-
* ```ts
|
|
387
|
-
* import { defineConfig } from '@wolfstar/http-framework/config';
|
|
388
|
-
*
|
|
389
|
-
* export default defineConfig({
|
|
390
|
-
* entry: 'src/main.ts',
|
|
391
|
-
* build: { tool: 'tsdown' }
|
|
392
|
-
* });
|
|
393
|
-
* ```
|
|
394
|
-
*/
|
|
395
|
-
export declare function defineConfig(config: StarsConfig): StarsConfig;
|
|
396
|
-
//#endregion
|
|
397
|
-
export type { StarsBuildConfig, StarsBuildTool, StarsCodegenConfig, StarsCompatibilityVersion, StarsConfig, StarsDevConfig, StarsExperimentalConfig, StarsFutureConfig, StarsI18nCodegenConfig, StarsImportsConfig, StarsNitroConfig, StarsTsdownConfig, StarsTunnelConfig, StarsTypecheckConfig, StarsTypechecker, StarsViteConfig };
|
|
398
|
-
//# sourceMappingURL=config.d.ts.map
|
|
1
|
+
import { _ as StarsTypecheckConfig, a as StarsCompatibilityVersion, c as StarsEnvConfig, d as StarsFutureConfig, f as StarsI18nCodegenConfig, g as StarsTunnelConfig, h as StarsTsdownConfig, i as StarsCodegenConfig, l as StarsEnvSetupOptions, m as StarsNitroConfig, n as StarsBuildConfig, o as StarsConfig, p as StarsImportsConfig, r as StarsBuildTool, s as StarsDevConfig, t as defineConfig, u as StarsExperimentalConfig, v as StarsTypechecker, y as StarsViteConfig } from "./config-Ctpk84fx.js";
|
|
2
|
+
export { type StarsBuildConfig, type StarsBuildTool, type StarsCodegenConfig, type StarsCompatibilityVersion, type StarsConfig, type StarsDevConfig, type StarsEnvConfig, type StarsEnvSetupOptions, type StarsExperimentalConfig, type StarsFutureConfig, type StarsI18nCodegenConfig, type StarsImportsConfig, type StarsNitroConfig, type StarsTsdownConfig, type StarsTunnelConfig, type StarsTypecheckConfig, type StarsTypechecker, type StarsViteConfig, defineConfig };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,147 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EventEmitter } from "node:events";
|
|
3
|
-
//#region src/config/resolve.d.ts
|
|
4
|
-
interface PackageJsonLike {
|
|
5
|
-
name?: string;
|
|
6
|
-
/** `tsdown` reads its options from here as well as from a `tsdown.config.*`. */
|
|
7
|
-
tsdown?: unknown;
|
|
8
|
-
version?: string;
|
|
9
|
-
main?: string;
|
|
10
|
-
type?: string;
|
|
11
|
-
scripts?: Record<string, string>;
|
|
12
|
-
dependencies?: Record<string, string>;
|
|
13
|
-
devDependencies?: Record<string, string>;
|
|
14
|
-
}
|
|
15
|
-
interface ResolvedBuildConfig {
|
|
16
|
-
readonly tool: StarsBuildTool;
|
|
17
|
-
/** Absolute output directory. */
|
|
18
|
-
readonly outDir: string;
|
|
19
|
-
/** Absolute `tsconfig.json` used by `tsc`, `null` for the other tools. */
|
|
20
|
-
readonly tsconfig: string | null;
|
|
21
|
-
/** Absolute path of the file `node` runs, i.e. the built entry (or the entry itself when `tool` is `none`). */
|
|
22
|
-
readonly output: string;
|
|
23
|
-
/**
|
|
24
|
-
* Absolute path of the build tool's own configuration file (`tsdown.config.*`, `vite.config.*`), `null` when the
|
|
25
|
-
* tool has none — which is always the case for `tsdown` with `future.compatibilityVersion` 4, where the build is
|
|
26
|
-
* configured from `stars.config` alone.
|
|
27
|
-
*/
|
|
28
|
-
readonly configFile: string | null;
|
|
29
|
-
}
|
|
30
|
-
interface ResolvedTypecheckConfig {
|
|
31
|
-
readonly enabled: boolean;
|
|
32
|
-
/** Absolute `tsconfig.json` the type checker runs against, `null` when it could not be found. */
|
|
33
|
-
readonly tsconfig: string | null;
|
|
34
|
-
/** The type checker to run, with `'auto'` already resolved. */
|
|
35
|
-
readonly checker: StarsTypechecker;
|
|
36
|
-
}
|
|
37
|
-
type ResolvedTunnelConfig = {
|
|
38
|
-
readonly mode: 'off';
|
|
39
|
-
} |
|
|
40
|
-
/** A `cloudflared` quick tunnel, whose hostname is only known once it is up. */
|
|
41
|
-
{
|
|
42
|
-
readonly mode: 'quick';
|
|
43
|
-
readonly path: string;
|
|
44
|
-
readonly updateEndpoint: boolean;
|
|
45
|
-
} |
|
|
46
|
-
/** An https URL the user already serves. */
|
|
47
|
-
{
|
|
48
|
-
readonly mode: 'url';
|
|
49
|
-
readonly url: string;
|
|
50
|
-
readonly path: string;
|
|
51
|
-
readonly updateEndpoint: boolean;
|
|
52
|
-
};
|
|
53
|
-
interface ResolvedDevConfig {
|
|
54
|
-
readonly banner: readonly string[] | false | null;
|
|
55
|
-
readonly watch: readonly string[];
|
|
56
|
-
readonly ignore: readonly string[];
|
|
57
|
-
readonly debounce: number;
|
|
58
|
-
readonly env: Readonly<Record<string, string>>;
|
|
59
|
-
readonly nodeArgs: readonly string[];
|
|
60
|
-
readonly args: readonly string[];
|
|
61
|
-
readonly url: string | null;
|
|
62
|
-
readonly health: string | null;
|
|
63
|
-
readonly killTimeout: number;
|
|
64
|
-
readonly typecheck: ResolvedTypecheckConfig;
|
|
65
|
-
readonly tunnel: ResolvedTunnelConfig;
|
|
66
|
-
/** Absolute path of the file the dev session's logs are mirrored into, `null` when disabled. */
|
|
67
|
-
readonly logFile: string | null;
|
|
68
|
-
}
|
|
69
|
-
interface ResolvedNitroConfig {
|
|
70
|
-
readonly [option: string]: unknown;
|
|
71
|
-
readonly preset: string;
|
|
72
|
-
}
|
|
73
|
-
interface ResolvedExperimentalConfig {
|
|
74
|
-
readonly enableVite: boolean;
|
|
75
|
-
readonly enableExternalVite: boolean;
|
|
76
|
-
readonly enableNitro: boolean;
|
|
77
|
-
readonly nitro: ResolvedNitroConfig;
|
|
78
|
-
}
|
|
79
|
-
interface ResolvedFutureConfig {
|
|
80
|
-
readonly compatibilityVersion: StarsCompatibilityVersion;
|
|
81
|
-
}
|
|
82
|
-
interface ResolvedImportsConfig {
|
|
83
|
-
readonly enabled: boolean;
|
|
84
|
-
/** Directory glob patterns, relative to the project root (the way `unimport` scans them). */
|
|
85
|
-
readonly dirs: readonly string[];
|
|
86
|
-
readonly presets: readonly string[];
|
|
87
|
-
readonly exclude: readonly string[];
|
|
88
|
-
/** Absolute path of the generated declaration file. */
|
|
89
|
-
readonly dts: string;
|
|
90
|
-
}
|
|
91
|
-
interface ResolvedI18nCodegenConfig {
|
|
92
|
-
readonly locales: string;
|
|
93
|
-
readonly output: string;
|
|
94
|
-
}
|
|
95
|
-
interface ResolvedCodegenConfig {
|
|
96
|
-
readonly i18n: ResolvedI18nCodegenConfig | null;
|
|
97
|
-
}
|
|
98
|
-
interface ResolvedStarsConfig {
|
|
99
|
-
/** Absolute path of the configuration file, `null` when running on defaults. */
|
|
100
|
-
readonly configFile: string | null;
|
|
101
|
-
/** The directory the CLI was invoked from. */
|
|
102
|
-
readonly cwd: string;
|
|
103
|
-
/** Absolute project root. */
|
|
104
|
-
readonly root: string;
|
|
105
|
-
readonly packageJson: PackageJsonLike | null;
|
|
106
|
-
/** Absolute source entry. */
|
|
107
|
-
readonly entry: string;
|
|
108
|
-
readonly build: ResolvedBuildConfig;
|
|
109
|
-
readonly dev: ResolvedDevConfig;
|
|
110
|
-
readonly codegen: ResolvedCodegenConfig;
|
|
111
|
-
readonly imports: ResolvedImportsConfig;
|
|
112
|
-
readonly experimental: ResolvedExperimentalConfig;
|
|
113
|
-
readonly future: ResolvedFutureConfig;
|
|
114
|
-
/** Raw options merged into `vite.config.*`. */
|
|
115
|
-
readonly vite: Readonly<Record<string, unknown>>;
|
|
116
|
-
/** The `tsdown` build's options: merged over `tsdown.config.*` at compatibility version 3, the whole build at 4. */
|
|
117
|
-
readonly tsdown: Readonly<Record<string, unknown>>;
|
|
118
|
-
}
|
|
119
|
-
interface ResolveConfigOptions {
|
|
120
|
-
cwd: string;
|
|
121
|
-
configFile: string | null;
|
|
122
|
-
config: StarsConfig;
|
|
123
|
-
env?: NodeJS.ProcessEnv;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Applies defaults, validates every option and resolves all paths to absolute ones.
|
|
127
|
-
*
|
|
128
|
-
* @throws {Diagnostic} (from `nostics`, via {@link configDiagnostics}) with an actionable `fix` on the first invalid option.
|
|
129
|
-
*/
|
|
130
|
-
export declare function resolveStarsConfig(options: ResolveConfigOptions): ResolvedStarsConfig;
|
|
131
|
-
/**
|
|
132
|
-
* Presents an absolute path relative to `root` when possible, for display purposes.
|
|
133
|
-
*/
|
|
134
|
-
export declare function displayPath(root: string, path: string): string;
|
|
135
|
-
/**
|
|
136
|
-
* Reads the project's environment layers from `src/.env*` and `.env*` into a plain object, the way `stars dev` and
|
|
137
|
-
* `stars commands` need it:
|
|
138
|
-
* these files are only loaded into `process.env` by the bot itself once it starts (see `@wolfstar/env-utilities`),
|
|
139
|
-
* so by the time the CLI runs they are not there yet. This is a minimal line reader, not a full dotenv
|
|
140
|
-
* implementation — quoting is stripped, but expansion (`dotenv-expand`) is not. Earlier files win, matching
|
|
141
|
-
* dotenv's own precedence.
|
|
142
|
-
*/
|
|
143
|
-
export declare function readProjectEnvFiles(root: string, environment?: string): Record<string, string>;
|
|
144
|
-
//#endregion
|
|
1
|
+
import { $ as EOL_COMPATIBILITY_VERSIONS, A as BuilderLogLevel, B as ResolvedStarsConfig, C as StarsHooks, D as Builder, E as BuildOutcome, F as ResolvedDevConfig, G as resolveStarsConfig, H as ResolvedTypecheckConfig, I as ResolvedExperimentalConfig, J as resolveHooks, K as ResolvedHooksConfig, L as ResolvedI18nCodegenConfig, M as ResolveConfigOptions, N as ResolvedBuildConfig, O as BuilderContext, P as ResolvedCodegenConfig, Q as DEFAULT_COMPATIBILITY_VERSION, R as ResolvedImportsConfig, S as StarsHookNamespace, T as StarsRestartReason, U as displayPath, V as ResolvedTunnelConfig, W as readProjectEnvFiles, X as resolveEnv, Y as ResolvedEnvConfig, Z as AUTO_ENV_VERSION, _ as StarsTypecheckConfig, a as StarsCompatibilityVersion, b as PrepareProjectResult, c as StarsEnvConfig, d as StarsFutureConfig, et as LATEST_COMPATIBILITY_VERSION, f as StarsI18nCodegenConfig, g as StarsTunnelConfig, h as StarsTsdownConfig, i as StarsCodegenConfig, j as PackageJsonLike, k as BuilderEvents, l as StarsEnvSetupOptions, m as StarsNitroConfig, n as StarsBuildConfig, nt as ResolvedFutureConfig, o as StarsConfig, p as StarsImportsConfig, q as STARS_HOOK_NAMES, r as StarsBuildTool, rt as STARS_CONFIG_TSDOWN_VERSION, s as StarsDevConfig, t as defineConfig, tt as LEGACY_COMPATIBILITY_VERSION, u as StarsExperimentalConfig, v as StarsTypechecker, w as StarsHooksConfig, x as StarsHookName, y as StarsViteConfig, z as ResolvedNitroConfig } from "./config-Ctpk84fx.js";
|
|
145
2
|
//#region src/config/load.d.ts
|
|
146
3
|
export declare const CONFIG_EXTENSIONS: readonly ['ts', 'mts', 'cts', 'js', 'mjs', 'cjs'];
|
|
147
4
|
export declare const CONFIG_FILE_NAMES: string[];
|
|
@@ -311,12 +168,22 @@ export declare const configDiagnostics: import("nostics").Diagnostics<{
|
|
|
311
168
|
readonly INVALID_COMPATIBILITY_VERSION: {
|
|
312
169
|
why: (p: {
|
|
313
170
|
value: unknown;
|
|
314
|
-
|
|
171
|
+
supported: string;
|
|
315
172
|
latestVersion: number;
|
|
316
173
|
}) => string;
|
|
317
174
|
fix: (p: {
|
|
318
175
|
value: unknown;
|
|
319
|
-
|
|
176
|
+
supported: string;
|
|
177
|
+
latestVersion: number;
|
|
178
|
+
}) => string;
|
|
179
|
+
};
|
|
180
|
+
readonly COMPATIBILITY_VERSION_EOL: {
|
|
181
|
+
why: (p: {
|
|
182
|
+
version: number;
|
|
183
|
+
latestVersion: number;
|
|
184
|
+
}) => string;
|
|
185
|
+
fix: (p: {
|
|
186
|
+
version: number;
|
|
320
187
|
latestVersion: number;
|
|
321
188
|
}) => string;
|
|
322
189
|
};
|
|
@@ -332,6 +199,16 @@ export declare const configDiagnostics: import("nostics").Diagnostics<{
|
|
|
332
199
|
known: string;
|
|
333
200
|
}) => string;
|
|
334
201
|
};
|
|
202
|
+
readonly UNKNOWN_HOOK: {
|
|
203
|
+
why: (p: {
|
|
204
|
+
name: string;
|
|
205
|
+
known: string;
|
|
206
|
+
}) => string;
|
|
207
|
+
fix: (p: {
|
|
208
|
+
name: string;
|
|
209
|
+
known: string;
|
|
210
|
+
}) => string;
|
|
211
|
+
};
|
|
335
212
|
readonly EXPERIMENT_REQUIRED: {
|
|
336
213
|
why: (p: {
|
|
337
214
|
path: string;
|
|
@@ -348,6 +225,10 @@ export declare const configDiagnostics: import("nostics").Diagnostics<{
|
|
|
348
225
|
why: (_p: {}) => string;
|
|
349
226
|
fix: (_p: {}) => string;
|
|
350
227
|
};
|
|
228
|
+
readonly ENV_REQUIRES_ENV_UTILITIES: {
|
|
229
|
+
why: (_p: {}) => string;
|
|
230
|
+
fix: (_p: {}) => string;
|
|
231
|
+
};
|
|
351
232
|
readonly LOCALES_NOT_FOUND: {
|
|
352
233
|
why: (p: {
|
|
353
234
|
locales: string;
|
|
@@ -431,42 +312,5 @@ export interface LoadStarsConfigOptions {
|
|
|
431
312
|
*/
|
|
432
313
|
export declare function loadStarsConfig(options?: LoadStarsConfigOptions): Promise<ResolvedStarsConfig>;
|
|
433
314
|
//#endregion
|
|
434
|
-
|
|
435
|
-
type BuilderLogLevel = 'debug' | 'info' | 'success' | 'warn' | 'error';
|
|
436
|
-
interface BuildOutcome {
|
|
437
|
-
ok: boolean;
|
|
438
|
-
durationMs: number;
|
|
439
|
-
/** A one-line summary, e.g. the first error. */
|
|
440
|
-
message: string | null;
|
|
441
|
-
}
|
|
442
|
-
interface BuilderEvents {
|
|
443
|
-
start: [];
|
|
444
|
-
/** Coarse, real lifecycle milestones, not an estimate of compiler work remaining. */
|
|
445
|
-
progress: [fraction: number, message: string];
|
|
446
|
-
success: [outcome: BuildOutcome];
|
|
447
|
-
failure: [outcome: BuildOutcome];
|
|
448
|
-
log: [level: BuilderLogLevel, text: string];
|
|
449
|
-
}
|
|
450
|
-
/**
|
|
451
|
-
* Turns project sources into the runnable output, once or continuously.
|
|
452
|
-
* Implementations report progress through {@link BuilderEvents}.
|
|
453
|
-
*/
|
|
454
|
-
interface Builder extends EventEmitter<BuilderEvents> {
|
|
455
|
-
readonly tool: StarsBuildTool;
|
|
456
|
-
/** Runs a single build. Compilation failures are reported in the outcome; dependency loading may throw. */
|
|
457
|
-
build(): Promise<BuildOutcome>;
|
|
458
|
-
/** Starts watching. Resolves once the watcher is set up; builds are reported through events. */
|
|
459
|
-
watch(): Promise<void>;
|
|
460
|
-
/** Stops watching. */
|
|
461
|
-
close(): Promise<void>;
|
|
462
|
-
}
|
|
463
|
-
/** Services supplied by the host; server integrations never import the CLI. */
|
|
464
|
-
interface BuilderContext {
|
|
465
|
-
/** Resolve build dependencies from the consuming project and report missing dependencies. */
|
|
466
|
-
importFromProject<T>(root: string, id: string, hint: string): Promise<T>;
|
|
467
|
-
/** Create the host's entry transformation for installed plugin registrations. */
|
|
468
|
-
pluginRegistrations(config: ResolvedStarsConfig): object;
|
|
469
|
-
}
|
|
470
|
-
//#endregion
|
|
471
|
-
export { type BuildOutcome, type Builder, type BuilderContext, type BuilderEvents, type BuilderLogLevel, type ConfigDiagnosticCode, type LoadConfigFileOptions, type LoadedConfigFile, type PackageJsonLike, type ResolveConfigOptions, type ResolvedBuildConfig, type ResolvedCodegenConfig, type ResolvedDevConfig, type ResolvedExperimentalConfig, type ResolvedFutureConfig, type ResolvedI18nCodegenConfig, type ResolvedImportsConfig, type ResolvedNitroConfig, type ResolvedStarsConfig, type ResolvedTunnelConfig, type ResolvedTypecheckConfig, type StarsBuildConfig, type StarsBuildTool, type StarsCodegenConfig, type StarsCompatibilityVersion, type StarsConfig, type StarsDevConfig, type StarsExperimentalConfig, type StarsFutureConfig, type StarsI18nCodegenConfig, type StarsImportsConfig, type StarsNitroConfig, type StarsTsdownConfig, type StarsTunnelConfig, type StarsTypecheckConfig, type StarsTypechecker, type StarsViteConfig, defineConfig };
|
|
315
|
+
export { AUTO_ENV_VERSION, type BuildOutcome, type Builder, type BuilderContext, type BuilderEvents, type BuilderLogLevel, type ConfigDiagnosticCode, DEFAULT_COMPATIBILITY_VERSION, EOL_COMPATIBILITY_VERSIONS, LATEST_COMPATIBILITY_VERSION, LEGACY_COMPATIBILITY_VERSION, type LoadConfigFileOptions, type LoadedConfigFile, type PackageJsonLike, type PrepareProjectResult, type ResolveConfigOptions, type ResolvedBuildConfig, type ResolvedCodegenConfig, type ResolvedDevConfig, type ResolvedEnvConfig, type ResolvedExperimentalConfig, type ResolvedFutureConfig, type ResolvedHooksConfig, type ResolvedI18nCodegenConfig, type ResolvedImportsConfig, type ResolvedNitroConfig, type ResolvedStarsConfig, type ResolvedTunnelConfig, type ResolvedTypecheckConfig, STARS_CONFIG_TSDOWN_VERSION, STARS_HOOK_NAMES, type StarsBuildConfig, type StarsBuildTool, type StarsCodegenConfig, type StarsCompatibilityVersion, type StarsConfig, type StarsDevConfig, type StarsEnvConfig, type StarsEnvSetupOptions, type StarsExperimentalConfig, type StarsFutureConfig, type StarsHookName, type StarsHookNamespace, type StarsHooks, type StarsHooksConfig, type StarsI18nCodegenConfig, type StarsImportsConfig, type StarsNitroConfig, type StarsRestartReason, type StarsTsdownConfig, type StarsTunnelConfig, type StarsTypecheckConfig, type StarsTypechecker, type StarsViteConfig, defineConfig, displayPath, readProjectEnvFiles, resolveEnv, resolveHooks, resolveStarsConfig };
|
|
472
316
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/config/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/config/load.ts","../../src/config/errors.ts","../../src/config/index.ts"],"mappings":";;qBAKa;qBACA;UAEI;;EAEhB;;EAEA;;UAGgB;;EAEhB;EACA,QAAQ;;;;;wBAMO,mBAAmB;;;;;wBAab,eAAe,SAAS,wBAAwB,QAAQ;;;;;;;;;;;;;;;;;;;qBCnBjE,qCAAiB;;IAK3B,MAAG;MAAQ;;IACX,MAAG;MAAS;;;;IAGZ,MAAG;MAAQ;MAAc;;IACzB,MAAG;MAAS;MAAc;;;;IAG1B,MAAG;MAAQ;;IACX,MAAG;MAAS;;;;IAGZ,MAAG;MAAQ;MAAc;;IACzB,MAAG;MAAQ;MAAc;;;;IAGzB,MAAG;MAAQ;;IACX,MAAG;MAAS;;;;IAGZ,MAAG;MAAQ;MAAc;;IACzB,MAAG;MAAQ;MAAc;;;;IAGzB,MAAG;MAAQ;;IACX,MAAG;MAAS;;;;IAGZ,MAAG;MAAQ;MAAkB;;IAC7B,MAAG;MAAQ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