@vttforge/cli 0.7.1 → 0.8.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/CHANGELOG.md +22 -0
- package/dist/bin.mjs +1 -1
- package/dist/index.d.mts +1 -328
- package/dist/index.mjs +2 -2
- package/dist/{src-C2VIeKmf.mjs → src-uGulrZd5.mjs} +3 -37
- package/dist/{src-C2VIeKmf.mjs.map → src-uGulrZd5.mjs.map} +1 -1
- package/package.json +1 -1
- package/templates/module-js/package.json +1 -1
- package/templates/module-ts/package.json +1 -1
- package/templates/system-js/package.json +1 -1
- package/templates/system-ts/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @vttforge/cli
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 89b7ffa: **Breaking.** Removes 23 internal exports from the package index.
|
|
8
|
+
|
|
9
|
+
Every package here is below `1.0.0`, where a minor may break you. This one does.
|
|
10
|
+
|
|
11
|
+
The product here is the `vttforge` binary. Its index had grown to re-export the pieces the commands are built from, and 33 of 60 exports were reachable only by importing them by name. The previous release tagged them `@internal`; this one removes them.
|
|
12
|
+
|
|
13
|
+
Gone: `scaffold`, `substitute`, `templatesRoot`, `createLink`, `readLinkTarget`, `removeLink`, `setupDevSymlink`, `cleanupDevSymlink`, `resolveViteInvocation`, `runViteBuildOnce`, `spawnViteWatch`, `ViteNotInstalledError`, `detectPackageManager`, `detectProjectPackageManager`, `execInvocation`, `installCommand`, `autoDetectFoundryDataDir`, `configPath`, `foundryPackagesDir`, `looksLikeFoundryDataDir`, `resolveFoundryDataDir`, `loadConfig`, `saveConfig`, and the types that existed only for them (`ScaffoldOptions`, `ScaffoldVars`, `CreateLinkOptions`, `PackageManager`, `ResolveDataDirOptions`, `VTTForgeConfig`).
|
|
14
|
+
|
|
15
|
+
What remains is what the package is for:
|
|
16
|
+
|
|
17
|
+
- `runInit` and `ScaffoldError`, which is what `create-vttforge` calls.
|
|
18
|
+
- The audit surface: `runAudit`, `runManifestRules`, `runSourceRules`, `formatReport`, `SEVERITY_RANK`, and the `RuleFn` / `RuleResult` / `Severity` / `AuditReport` types. Write your own rule and hand it to the same reporter the CLI uses.
|
|
19
|
+
- `runDev`, `runBuild`, `emitReleaseZip`, `emitZip` and `readManifest`, still `@experimental`.
|
|
20
|
+
|
|
21
|
+
Every removed export was checked: nothing outside this package imported any of them. If one of these was your only way to do something, open an issue and it comes back as a supported export rather than a leak.
|
|
22
|
+
|
|
23
|
+
Use the `vttforge` command for everything else.
|
|
24
|
+
|
|
3
25
|
## 0.7.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
package/dist/bin.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { i as runDev, l as runAuditCommand, n as ScaffoldError, o as runBuild, r as runInit, t as VTTFORGE_CLI_VERSION } from "./src-uGulrZd5.mjs";
|
|
3
3
|
import { defineCommand, runMain } from "citty";
|
|
4
4
|
//#region src/cli.ts
|
|
5
5
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ChildProcess } from "node:child_process";
|
|
2
1
|
//#region src/audit/types.d.ts
|
|
3
2
|
/**
|
|
4
3
|
* Shared types for the `vttforge audit` rule engine.
|
|
@@ -165,37 +164,6 @@ interface DevOptions {
|
|
|
165
164
|
* change in a minor.
|
|
166
165
|
*/
|
|
167
166
|
declare function runDev(options?: DevOptions): Promise<void>;
|
|
168
|
-
/**
|
|
169
|
-
* Internal building block exposed for tests: given an already-built `dist/`
|
|
170
|
-
* (vite has run, manifest is present) and a resolved Foundry data dir,
|
|
171
|
-
* create the symlink and return the target path + manifest. Skips the
|
|
172
|
-
* vite spawn and the signal-loop, so tests can drive the orchestration
|
|
173
|
-
* deterministically.
|
|
174
|
-
*
|
|
175
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
176
|
-
* for outside use, and going away in the next major.
|
|
177
|
-
*/
|
|
178
|
-
declare function setupDevSymlink(opts: {
|
|
179
|
-
cwd: string;
|
|
180
|
-
dataRoot: string;
|
|
181
|
-
}): Promise<{
|
|
182
|
-
target: string;
|
|
183
|
-
manifest: Awaited<ReturnType<typeof readManifest>>;
|
|
184
|
-
childProcess?: ChildProcess;
|
|
185
|
-
}>;
|
|
186
|
-
/**
|
|
187
|
-
* Tear down a dev symlink iff it still points at the expected source.
|
|
188
|
-
* Refuses to remove a symlink that another `vttforge dev` session (or a
|
|
189
|
-
* manual `ln -s`) has since redirected. That link doesn't belong to us
|
|
190
|
-
* and removing it would silently disconnect their setup.
|
|
191
|
-
*
|
|
192
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
193
|
-
* for outside use, and going away in the next major.
|
|
194
|
-
*/
|
|
195
|
-
declare function cleanupDevSymlink(opts: {
|
|
196
|
-
target: string;
|
|
197
|
-
expectedSource: string;
|
|
198
|
-
}): Promise<void>;
|
|
199
167
|
//#endregion
|
|
200
168
|
//#region src/commands/init.d.ts
|
|
201
169
|
/**
|
|
@@ -256,301 +224,6 @@ declare class ScaffoldError extends Error {
|
|
|
256
224
|
}
|
|
257
225
|
declare function runInit(options?: InitOptions): Promise<void>;
|
|
258
226
|
//#endregion
|
|
259
|
-
//#region src/foundry-data-dir.d.ts
|
|
260
|
-
/**
|
|
261
|
-
* Foundry user-data directory discovery + persistence.
|
|
262
|
-
*
|
|
263
|
-
* Foundry stores worlds, systems, and modules under a single user-data
|
|
264
|
-
* directory (`Data/` lives at its root). `vttforge dev` needs to know where
|
|
265
|
-
* that is so it can symlink the built `dist/` into `Data/systems/<id>/` or
|
|
266
|
-
* `Data/modules/<id>/` and let Foundry pick it up.
|
|
267
|
-
*
|
|
268
|
-
* Precedence (top wins):
|
|
269
|
-
* 1. Explicit `--data-dir` flag passed to the command
|
|
270
|
-
* 2. `FOUNDRY_DATA_DIR` env var (useful in Docker/CI)
|
|
271
|
-
* 3. `<project>/.vttforge/config.json :: foundryDataDir`
|
|
272
|
-
* 4. OS default + interactive prompt that saves to (3) for next time
|
|
273
|
-
*
|
|
274
|
-
* The OS-default detection treats `XDG_DATA_HOME` (Linux) and `%LOCALAPPDATA%`
|
|
275
|
-
* (Windows) as part of the OS convention, not as Foundry-specific overrides.
|
|
276
|
-
*
|
|
277
|
-
* Everything here is pure: `platform`, `env`, and `home` flow through
|
|
278
|
-
* options so tests can drive every branch without monkey-patching globals.
|
|
279
|
-
*/
|
|
280
|
-
/** Shape persisted to `<project>/.vttforge/config.json`. */
|
|
281
|
-
interface VTTForgeConfig {
|
|
282
|
-
foundryDataDir?: string;
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Return the OS-default Foundry user-data directory, or `null` on unknown
|
|
286
|
-
* platforms / missing platform-specific env vars. Does NOT check existence;
|
|
287
|
-
* callers prompt the user when the suggested path doesn't resolve.
|
|
288
|
-
*
|
|
289
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
290
|
-
* for outside use, and going away in the next major.
|
|
291
|
-
*/
|
|
292
|
-
declare function autoDetectFoundryDataDir(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv, home?: string): string | null;
|
|
293
|
-
/**
|
|
294
|
-
* Heuristic: a path looks like a Foundry user-data root if it contains a
|
|
295
|
-
* `Data/` subdirectory (canonical Foundry layout) OR if it already contains
|
|
296
|
-
* `systems/` or `modules/` (the path is already the Data folder itself).
|
|
297
|
-
*
|
|
298
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
299
|
-
* for outside use, and going away in the next major.
|
|
300
|
-
*/
|
|
301
|
-
declare function looksLikeFoundryDataDir(path: string): boolean;
|
|
302
|
-
/** Absolute path to the project-local config file (whether or not it exists).
|
|
303
|
-
*
|
|
304
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
305
|
-
* for outside use, and going away in the next major.
|
|
306
|
-
*/
|
|
307
|
-
declare function configPath(cwd: string): string;
|
|
308
|
-
/** Load `<cwd>/.vttforge/config.json` if it exists and is valid JSON.
|
|
309
|
-
*
|
|
310
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
311
|
-
* for outside use, and going away in the next major.
|
|
312
|
-
*/
|
|
313
|
-
declare function loadConfig(cwd: string): Promise<VTTForgeConfig | null>;
|
|
314
|
-
/** Persist `<cwd>/.vttforge/config.json`. Creates the `.vttforge/` dir as needed.
|
|
315
|
-
*
|
|
316
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
317
|
-
* for outside use, and going away in the next major.
|
|
318
|
-
*/
|
|
319
|
-
declare function saveConfig(cwd: string, config: VTTForgeConfig): Promise<void>;
|
|
320
|
-
/**
|
|
321
|
-
* Resolve the packages directory (`Data/systems/` or `Data/modules/`) under
|
|
322
|
-
* the given Foundry user-data root. Accepts the path Foundry itself runs
|
|
323
|
-
* with (the user-data folder, which contains `Data/`) OR the `Data/` folder
|
|
324
|
-
* directly; both are common in muscle memory.
|
|
325
|
-
*
|
|
326
|
-
* The returned path is not guaranteed to exist yet; callers `mkdir -p` it
|
|
327
|
-
* before creating the symlink.
|
|
328
|
-
*
|
|
329
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
330
|
-
* for outside use, and going away in the next major.
|
|
331
|
-
*/
|
|
332
|
-
declare function foundryPackagesDir(dataRoot: string, type: 'system' | 'module'): string;
|
|
333
|
-
interface ResolveDataDirOptions {
|
|
334
|
-
/** Project root: also where `.vttforge/config.json` is read/written. */
|
|
335
|
-
cwd: string;
|
|
336
|
-
/** `--data-dir` flag value. Skips persistence and prompting when present. */
|
|
337
|
-
override?: string;
|
|
338
|
-
/**
|
|
339
|
-
* Interactive prompt for the first run. Receives the OS-default path
|
|
340
|
-
* (may be `null` on unknown platforms) and resolves with the chosen path,
|
|
341
|
-
* or `null` if the user cancelled. When undefined, the function refuses
|
|
342
|
-
* to ask and throws, appropriate for non-TTY contexts (CI, scripts).
|
|
343
|
-
*/
|
|
344
|
-
prompt?: (autoDetected: string | null) => Promise<string | null>;
|
|
345
|
-
/** Override `process.platform` (tests). */
|
|
346
|
-
platform?: NodeJS.Platform;
|
|
347
|
-
/** Override `process.env` (tests). */
|
|
348
|
-
env?: NodeJS.ProcessEnv;
|
|
349
|
-
/** Override `os.homedir()` (tests). */
|
|
350
|
-
home?: string;
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* Walk the precedence chain and return the chosen Foundry user-data path.
|
|
354
|
-
* Saves the user's choice to the project config on first interactive run so
|
|
355
|
-
* subsequent invocations skip the prompt.
|
|
356
|
-
*
|
|
357
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
358
|
-
* for outside use, and going away in the next major.
|
|
359
|
-
*/
|
|
360
|
-
declare function resolveFoundryDataDir(opts: ResolveDataDirOptions): Promise<string>;
|
|
361
|
-
//#endregion
|
|
362
|
-
//#region src/package-manager.d.ts
|
|
363
|
-
/**
|
|
364
|
-
* Detect which package manager invoked the CLI so we can run the right
|
|
365
|
-
* `install` command after scaffolding.
|
|
366
|
-
*
|
|
367
|
-
* Strategy: read `npm_config_user_agent`, which pnpm/npm/bun/yarn all set when
|
|
368
|
-
* they spawn a child process (including `pnpm dlx`, `pnpm create`, etc.).
|
|
369
|
-
* Falls back to `pnpm` because that's the VTTForge house default and the
|
|
370
|
-
* most common Foundry-developer choice, but any concrete signal in the
|
|
371
|
-
* environment wins over the default.
|
|
372
|
-
*/
|
|
373
|
-
type PackageManager = 'pnpm' | 'npm' | 'bun' | 'yarn';
|
|
374
|
-
/**
|
|
375
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported for
|
|
376
|
-
* outside use, and going away in the next major.
|
|
377
|
-
*/
|
|
378
|
-
declare function detectPackageManager(env?: NodeJS.ProcessEnv): PackageManager;
|
|
379
|
-
/**
|
|
380
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported for
|
|
381
|
-
* outside use, and going away in the next major.
|
|
382
|
-
*/
|
|
383
|
-
declare function installCommand(pm: PackageManager): string;
|
|
384
|
-
/**
|
|
385
|
-
* Detect a project's package manager by looking at which lockfile it
|
|
386
|
-
* ships. `dev` and `build` need this: by the time the user runs
|
|
387
|
-
* `vttforge dev`, npm_config_user_agent reflects whatever shell launched
|
|
388
|
-
* the binary (often nothing in a global install), not how the project
|
|
389
|
-
* was bootstrapped. The lockfile is the project's own contract.
|
|
390
|
-
*
|
|
391
|
-
* Falls back to {@link detectPackageManager} for fresh checkouts that
|
|
392
|
-
* haven't been installed yet.
|
|
393
|
-
*
|
|
394
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
395
|
-
* for outside use, and going away in the next major.
|
|
396
|
-
*/
|
|
397
|
-
declare function detectProjectPackageManager(cwd: string, env?: NodeJS.ProcessEnv): PackageManager;
|
|
398
|
-
/**
|
|
399
|
-
* Argument vector to invoke `vite` (or any other locally-installed CLI)
|
|
400
|
-
* via the project's package manager. We always shell out through `<pm>
|
|
401
|
-
* exec` so the call works regardless of the linker's choices. Yarn 4
|
|
402
|
-
* Plug'n'Play, pnpm's symlinked layout, npm's flattened node_modules,
|
|
403
|
-
* Bun's symlinked node_modules. Each manager exposes a uniform "run a
|
|
404
|
-
* locally-resolved binary in the project's dependency graph" command.
|
|
405
|
-
*
|
|
406
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
407
|
-
* for outside use, and going away in the next major.
|
|
408
|
-
*/
|
|
409
|
-
declare function execInvocation(pm: PackageManager, bin: string): [string, string[]];
|
|
410
|
-
//#endregion
|
|
411
|
-
//#region src/scaffold.d.ts
|
|
412
|
-
/**
|
|
413
|
-
* Template copy with `{{var}}` placeholder substitution.
|
|
414
|
-
*
|
|
415
|
-
* Templates live under `packages/cli/templates/<variant>/` and are shipped
|
|
416
|
-
* inside the published tarball (see the `files` array in package.json).
|
|
417
|
-
* Each file is read, substituted, and written to the destination directory
|
|
418
|
-
* preserving the relative path. Directories are created lazily on first
|
|
419
|
-
* write.
|
|
420
|
-
*
|
|
421
|
-
* We intentionally avoid Handlebars or any other template engine. The
|
|
422
|
-
* substitution surface is small (a flat string-to-string map), and bundling
|
|
423
|
-
* a dependency for ten lines of regex would be wasteful in a tool whose
|
|
424
|
-
* value is being fast to invoke.
|
|
425
|
-
*/
|
|
426
|
-
interface ScaffoldVars {
|
|
427
|
-
ID: string;
|
|
428
|
-
TITLE: string;
|
|
429
|
-
DESCRIPTION: string;
|
|
430
|
-
AUTHOR: string;
|
|
431
|
-
LICENSE: string;
|
|
432
|
-
FOUNDRY_MIN_VERSION: string;
|
|
433
|
-
FOUNDRY_VERIFIED_VERSION: string;
|
|
434
|
-
LOCALE_PREFIX: string;
|
|
435
|
-
YEAR: string;
|
|
436
|
-
}
|
|
437
|
-
interface ScaffoldOptions {
|
|
438
|
-
/** Absolute path to the template root (e.g. `<cli-pkg>/templates/system-ts`). */
|
|
439
|
-
templateDir: string;
|
|
440
|
-
/** Absolute path to the destination directory. Created if it doesn't exist. */
|
|
441
|
-
destDir: string;
|
|
442
|
-
/** Variables to substitute into `{{NAME}}` placeholders inside template files. */
|
|
443
|
-
vars: ScaffoldVars;
|
|
444
|
-
}
|
|
445
|
-
/**
|
|
446
|
-
* Replace `{{NAME}}` placeholders in `content` using the `vars` map.
|
|
447
|
-
* Unknown placeholders are passed through unchanged so partially-templated
|
|
448
|
-
* files (e.g. a snippet that contains `{{handlebarsLikeSyntax}}` as literal
|
|
449
|
-
* content) still scaffold without surprises.
|
|
450
|
-
*
|
|
451
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
452
|
-
* for outside use, and going away in the next major.
|
|
453
|
-
*/
|
|
454
|
-
declare function substitute(content: string, vars: ScaffoldVars): string;
|
|
455
|
-
/**
|
|
456
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported for
|
|
457
|
-
* outside use, and going away in the next major.
|
|
458
|
-
*/
|
|
459
|
-
declare function scaffold({ templateDir, destDir, vars }: ScaffoldOptions): Promise<void>;
|
|
460
|
-
/**
|
|
461
|
-
* Resolve the templates directory relative to this module's file URL. tsdown
|
|
462
|
-
* emits `dist/scaffold.mjs`, so `import.meta.url` points there at runtime;
|
|
463
|
-
* we walk up two segments to land at the package root, then descend into
|
|
464
|
-
* `templates/`.
|
|
465
|
-
*
|
|
466
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
467
|
-
* for outside use, and going away in the next major.
|
|
468
|
-
*/
|
|
469
|
-
declare function templatesRoot(): string;
|
|
470
|
-
//#endregion
|
|
471
|
-
//#region src/symlink.d.ts
|
|
472
|
-
/**
|
|
473
|
-
* Cross-platform symlink helpers for `vttforge dev`.
|
|
474
|
-
*
|
|
475
|
-
* The dev loop drops a symlink from Foundry's `Data/<systems|modules>/<id>/`
|
|
476
|
-
* back to the project's `dist/` so Foundry serves freshly-built files as
|
|
477
|
-
* vite writes them. The win32 path matters: with `type: 'junction'` the
|
|
478
|
-
* operation works on standard Windows shells without Developer Mode, while
|
|
479
|
-
* `type: 'dir'` requires admin. We never silently fall back to copying;
|
|
480
|
-
* Foundry's HMR relies on live file mutation, and a copy snapshot defeats
|
|
481
|
-
* the loop. If the symlink fails, we surface the platform-specific fix.
|
|
482
|
-
*/
|
|
483
|
-
interface CreateLinkOptions {
|
|
484
|
-
/**
|
|
485
|
-
* Overwrite an existing symlink that points elsewhere. Real files and
|
|
486
|
-
* directories are never overwritten; that path needs explicit user
|
|
487
|
-
* action outside the tool.
|
|
488
|
-
*/
|
|
489
|
-
overwrite?: boolean;
|
|
490
|
-
}
|
|
491
|
-
/**
|
|
492
|
-
* Read a symlink target. Returns the absolute path the link points at, or
|
|
493
|
-
* `null` if `path` doesn't exist or isn't a symlink. Relative symlink
|
|
494
|
-
* targets are resolved against the link's own directory (matches the
|
|
495
|
-
* semantics callers expect when comparing to a known absolute source).
|
|
496
|
-
*
|
|
497
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
498
|
-
* for outside use, and going away in the next major.
|
|
499
|
-
*/
|
|
500
|
-
declare function readLinkTarget(path: string): Promise<string | null>;
|
|
501
|
-
/**
|
|
502
|
-
* Create a symlink at `target` pointing to `source`. Win32 uses `'junction'`
|
|
503
|
-
* so the call succeeds without elevation; everywhere else uses `'dir'`.
|
|
504
|
-
*
|
|
505
|
-
* Idempotency:
|
|
506
|
-
* - target already points to source → no-op
|
|
507
|
-
* - target points elsewhere → throws unless `options.overwrite`
|
|
508
|
-
* - target is a real file/dir → throws unconditionally
|
|
509
|
-
*
|
|
510
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
511
|
-
* for outside use, and going away in the next major.
|
|
512
|
-
*/
|
|
513
|
-
declare function createLink(target: string, source: string, options?: CreateLinkOptions): Promise<void>;
|
|
514
|
-
/**
|
|
515
|
-
* Remove a symlink at `path`. No-ops when the path doesn't exist. Throws
|
|
516
|
-
* when the path exists but isn't a symlink; we never unlink real files
|
|
517
|
-
* or directories.
|
|
518
|
-
*
|
|
519
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
520
|
-
* for outside use, and going away in the next major.
|
|
521
|
-
*/
|
|
522
|
-
declare function removeLink(path: string): Promise<void>;
|
|
523
|
-
//#endregion
|
|
524
|
-
//#region src/vite-runner.d.ts
|
|
525
|
-
/**
|
|
526
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported for
|
|
527
|
-
* outside use, and going away in the next major.
|
|
528
|
-
*/
|
|
529
|
-
declare class ViteNotInstalledError extends Error {
|
|
530
|
-
constructor(message: string);
|
|
531
|
-
}
|
|
532
|
-
/** Spawn args for invoking the user's vite (e.g. `["pnpm", ["exec", "vite"]]`).
|
|
533
|
-
*
|
|
534
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
535
|
-
* for outside use, and going away in the next major.
|
|
536
|
-
*/
|
|
537
|
-
declare function resolveViteInvocation(cwd: string): [string, string[]];
|
|
538
|
-
/** Run `vite build` once and wait for it to exit. Throws on non-zero exit.
|
|
539
|
-
*
|
|
540
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
541
|
-
* for outside use, and going away in the next major.
|
|
542
|
-
*/
|
|
543
|
-
declare function runViteBuildOnce(cwd: string): Promise<void>;
|
|
544
|
-
/**
|
|
545
|
-
* Spawn `vite build --watch` and return the child process. The caller is
|
|
546
|
-
* responsible for waiting on it and tearing it down (the dev command kills
|
|
547
|
-
* it on SIGINT).
|
|
548
|
-
*
|
|
549
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
550
|
-
* for outside use, and going away in the next major.
|
|
551
|
-
*/
|
|
552
|
-
declare function spawnViteWatch(cwd: string): ChildProcess;
|
|
553
|
-
//#endregion
|
|
554
227
|
//#region src/zip.d.ts
|
|
555
228
|
/**
|
|
556
229
|
* Emit a foundryvtt.com-compatible release zip.
|
|
@@ -587,5 +260,5 @@ declare function emitZip(opts: EmitZipOptions): Promise<EmitZipResult>;
|
|
|
587
260
|
//#region src/index.d.ts
|
|
588
261
|
declare const VTTFORGE_CLI_VERSION: string;
|
|
589
262
|
//#endregion
|
|
590
|
-
export { type AuditOptions, type AuditReport, type AuditResult, type BuildOptions, type
|
|
263
|
+
export { type AuditOptions, type AuditReport, type AuditResult, type BuildOptions, type DevOptions, type EmitZipOptions, type EmitZipResult, type FoundryManifest, type InitOptions, type PackageType, type ReportFormat, type ResolvedInitOptions, type RuleFn, type RuleResult, type RunAuditOptions, SEVERITY_RANK, ScaffoldError, type Severity, type TemplateVariant, VTTFORGE_CLI_VERSION, emitReleaseZip, emitZip, formatReport, readManifest, runAudit, runAuditCommand, runBuild, runDev, runInit, runManifestRules, runSourceRules };
|
|
591
264
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { SEVERITY_RANK, ScaffoldError, VTTFORGE_CLI_VERSION,
|
|
1
|
+
import { a as emitReleaseZip, c as readManifest, d as runAudit, f as SEVERITY_RANK, i as runDev, l as runAuditCommand, m as runManifestRules, n as ScaffoldError, o as runBuild, p as runSourceRules, r as runInit, s as emitZip, t as VTTFORGE_CLI_VERSION, u as formatReport } from "./src-uGulrZd5.mjs";
|
|
2
|
+
export { SEVERITY_RANK, ScaffoldError, VTTFORGE_CLI_VERSION, emitReleaseZip, emitZip, formatReport, readManifest, runAudit, runAuditCommand, runBuild, runDev, runInit, runManifestRules, runSourceRules };
|
|
@@ -10,7 +10,7 @@ import { createServer } from "node:http";
|
|
|
10
10
|
import { homedir } from "node:os";
|
|
11
11
|
import { promisify } from "node:util";
|
|
12
12
|
//#region package.json
|
|
13
|
-
var version = "0.
|
|
13
|
+
var version = "0.8.0";
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/audit/manifest-rules.ts
|
|
16
16
|
/**
|
|
@@ -2147,18 +2147,6 @@ function autoDetectFoundryDataDir(platform = process.platform, env = process.env
|
|
|
2147
2147
|
default: return null;
|
|
2148
2148
|
}
|
|
2149
2149
|
}
|
|
2150
|
-
/**
|
|
2151
|
-
* Heuristic: a path looks like a Foundry user-data root if it contains a
|
|
2152
|
-
* `Data/` subdirectory (canonical Foundry layout) OR if it already contains
|
|
2153
|
-
* `systems/` or `modules/` (the path is already the Data folder itself).
|
|
2154
|
-
*
|
|
2155
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
2156
|
-
* for outside use, and going away in the next major.
|
|
2157
|
-
*/
|
|
2158
|
-
function looksLikeFoundryDataDir(path) {
|
|
2159
|
-
if (!existsSync(path)) return false;
|
|
2160
|
-
return existsSync(join(path, "Data")) || existsSync(join(path, "systems")) || existsSync(join(path, "modules"));
|
|
2161
|
-
}
|
|
2162
2150
|
const CONFIG_DIR = ".vttforge";
|
|
2163
2151
|
const CONFIG_FILE = "config.json";
|
|
2164
2152
|
/** Absolute path to the project-local config file (whether or not it exists).
|
|
@@ -2430,28 +2418,6 @@ async function runDev(options = {}) {
|
|
|
2430
2418
|
p.outro("Stopped. Symlink cleaned up.");
|
|
2431
2419
|
}
|
|
2432
2420
|
/**
|
|
2433
|
-
* Internal building block exposed for tests: given an already-built `dist/`
|
|
2434
|
-
* (vite has run, manifest is present) and a resolved Foundry data dir,
|
|
2435
|
-
* create the symlink and return the target path + manifest. Skips the
|
|
2436
|
-
* vite spawn and the signal-loop, so tests can drive the orchestration
|
|
2437
|
-
* deterministically.
|
|
2438
|
-
*
|
|
2439
|
-
* @internal Implementation detail of the `vttforge` binary. Not supported
|
|
2440
|
-
* for outside use, and going away in the next major.
|
|
2441
|
-
*/
|
|
2442
|
-
async function setupDevSymlink(opts) {
|
|
2443
|
-
const cwd = resolve(opts.cwd);
|
|
2444
|
-
const distDir = join(cwd, "dist");
|
|
2445
|
-
const manifest = await readManifest(distDir);
|
|
2446
|
-
const packagesDir = foundryPackagesDir(opts.dataRoot, manifest.type);
|
|
2447
|
-
const target = join(packagesDir, manifest.id);
|
|
2448
|
-
await createLink(target, distDir, { overwrite: true });
|
|
2449
|
-
return {
|
|
2450
|
-
target,
|
|
2451
|
-
manifest
|
|
2452
|
-
};
|
|
2453
|
-
}
|
|
2454
|
-
/**
|
|
2455
2421
|
* Tear down a dev symlink iff it still points at the expected source.
|
|
2456
2422
|
* Refuses to remove a symlink that another `vttforge dev` session (or a
|
|
2457
2423
|
* manual `ln -s`) has since redirected. That link doesn't belong to us
|
|
@@ -2913,6 +2879,6 @@ function runInstall(pm, cwd) {
|
|
|
2913
2879
|
*/
|
|
2914
2880
|
const VTTFORGE_CLI_VERSION = version;
|
|
2915
2881
|
//#endregion
|
|
2916
|
-
export {
|
|
2882
|
+
export { emitReleaseZip as a, readManifest as c, runAudit as d, SEVERITY_RANK as f, runDev as i, runAuditCommand as l, runManifestRules as m, ScaffoldError as n, runBuild as o, runSourceRules as p, runInit as r, emitZip as s, VTTFORGE_CLI_VERSION as t, formatReport as u };
|
|
2917
2883
|
|
|
2918
|
-
//# sourceMappingURL=src-
|
|
2884
|
+
//# sourceMappingURL=src-uGulrZd5.mjs.map
|