@batijs/core 0.0.628 → 0.0.630

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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { BatiSet, CategoryLabels, Flags } from "@batijs/features";
2
2
  import * as _$attributes_parser0 from "attributes-parser";
3
3
  import * as _$yaml from "yaml";
4
- import { Document as YAMLDocument, DocumentOptions, ParseOptions, SchemaOptions } from "yaml";
4
+ import { Document as YAMLDocument, DocumentOptions, ParseOptions, SchemaOptions, YAMLMap, YAMLSeq } from "yaml";
5
5
  import { ProxifiedModule, builders, generateCode, loadFile, parseModule } from "magicast";
6
6
  import { addVitePlugin, deepMergeObject } from "magicast/helpers";
7
7
  import { Color } from "colorette";
@@ -11,6 +11,59 @@ export * from "colorette";
11
11
 
12
12
  //#region \0rolldown/runtime.js
13
13
  //#endregion
14
+ //#region src/dockerfile.d.ts
15
+ /**
16
+ * Chainable builder for the multi-stage Dockerfiles emitted by Bati boilerplates.
17
+ *
18
+ * `.from(img, { as })` widens the `Stages` type parameter, so `.copy(..., { from })`
19
+ * only autocompletes — and accepts — stage names that were actually declared.
20
+ */
21
+ interface BaseOptions {
22
+ /** Rendered as `# <comment>` line(s) immediately before the instruction. */
23
+ comment?: string;
24
+ }
25
+ interface FromOptions extends BaseOptions {
26
+ /** Stage alias: `AS <name>`. */
27
+ as: string;
28
+ }
29
+ interface CopyOptions<Stages extends string = string> extends BaseOptions {
30
+ /** Copy from a named build stage: `--from=<stage>`. */
31
+ from?: Stages;
32
+ }
33
+ type EnvRecord = Record<string, string>;
34
+ declare class DockerfileBuilder<Stages extends string = never> {
35
+ private readonly instructions;
36
+ from<S extends string>(image: string, options: FromOptions & {
37
+ as: S;
38
+ }): DockerfileBuilder<Stages | S>;
39
+ workdir(path: string, options?: BaseOptions): this;
40
+ run(command: string, options?: BaseOptions): this;
41
+ copy(sources: string[], dest: string, options?: CopyOptions<Stages | (string & {})>): this;
42
+ env(vars: EnvRecord, options?: BaseOptions): this;
43
+ expose(port: number, options?: BaseOptions): this;
44
+ cmd(command: string[], options?: BaseOptions): this;
45
+ /** Run `cb` against the builder only when `condition` holds. */
46
+ when(condition: boolean, cb: (builder: this) => void): this;
47
+ /** Apply a reusable group of steps. */
48
+ pipe(cb: (builder: this) => void): this;
49
+ build(): string;
50
+ }
51
+ declare function dockerfile(): DockerfileBuilder;
52
+ interface DockerPackageManager {
53
+ image: string;
54
+ /** pnpm and yarn ship through corepack; bun and npm don't. */
55
+ corepack: boolean;
56
+ install: string;
57
+ installProd: string;
58
+ /** Glob(s) to COPY so the install layer re-caches only on lockfile changes. */
59
+ lockfiles: string[];
60
+ }
61
+ declare function dockerPackageManager(name: string, {
62
+ frozenLockfile
63
+ }: {
64
+ frozenLockfile: boolean;
65
+ }): DockerPackageManager;
66
+ //#endregion
14
67
  //#region src/format.d.ts
15
68
  declare function formatCode(code: string, options: {
16
69
  filepath: string;
@@ -1270,7 +1323,7 @@ declare function getVersion(): {
1270
1323
  //#region src/utils/env.d.ts
1271
1324
  declare function appendToEnv(envContent: string | undefined | null, key: string, value: unknown, comment?: string): string;
1272
1325
  declare namespace index_d_exports {
1273
- export { ContentGetter, FileContext, MarkdownV2, PackageJson, PackageManagerInfo, StringTransformer, Transformer, TransformerProps, VikeMeta, YAMLDocument, addVitePlugin, appendToEnv, builders, deepMergeObject, formatCode, generateCode, getArgs, getVersion, loadAsJson, loadAsMagicast, loadFile, loadMarkdown, loadPackageJson, loadRelativeFileAsMagicast, loadYaml, packageManager, parseMarkdown, parseModule, randomBytes, transformAndFormat, which, withIcon };
1326
+ export { BaseOptions, ContentGetter, CopyOptions, DockerPackageManager, DockerfileBuilder, EnvRecord, FileContext, FromOptions, MarkdownV2, PackageJson, PackageManagerInfo, StringTransformer, Transformer, TransformerProps, VikeMeta, YAMLDocument, YAMLMap, YAMLSeq, addVitePlugin, appendToEnv, builders, deepMergeObject, dockerPackageManager, dockerfile, formatCode, generateCode, getArgs, getVersion, loadAsJson, loadAsMagicast, loadFile, loadMarkdown, loadPackageJson, loadRelativeFileAsMagicast, loadYaml, packageManager, parseMarkdown, parseModule, randomBytes, transformAndFormat, which, withIcon };
1274
1327
  }
1275
1328
  //#endregion
1276
- export { ContentGetter, type FileContext, MarkdownV2, PackageJson, PackageManagerInfo, StringTransformer, Transformer, TransformerProps, VikeMeta, type YAMLDocument, addVitePlugin, appendToEnv, builders, deepMergeObject, formatCode, generateCode, getArgs, getVersion, loadAsJson, loadAsMagicast, loadFile, loadMarkdown, loadPackageJson, loadRelativeFileAsMagicast, loadYaml, packageManager, parseMarkdown, parseModule, randomBytes, transformAndFormat, which, withIcon };
1329
+ export { BaseOptions, ContentGetter, CopyOptions, DockerPackageManager, DockerfileBuilder, EnvRecord, type FileContext, FromOptions, MarkdownV2, PackageJson, PackageManagerInfo, StringTransformer, Transformer, TransformerProps, VikeMeta, type YAMLDocument, YAMLMap, YAMLSeq, addVitePlugin, appendToEnv, builders, deepMergeObject, dockerPackageManager, dockerfile, formatCode, generateCode, getArgs, getVersion, loadAsJson, loadAsMagicast, loadFile, loadMarkdown, loadPackageJson, loadRelativeFileAsMagicast, loadYaml, packageManager, parseMarkdown, parseModule, randomBytes, transformAndFormat, which, withIcon };