pluggable-codegen 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +2 -2
  2. package/dist/_virtual/_rolldown/runtime.cjs +2 -4
  3. package/dist/_virtual/_rolldown/runtime.mjs +2 -3
  4. package/dist/cache.cjs +10 -7
  5. package/dist/cache.mjs +9 -5
  6. package/dist/cli.d.mts +1 -1
  7. package/dist/cli.mjs +6 -5
  8. package/dist/codegen.cjs +30 -54
  9. package/dist/codegen.d.cts +10 -0
  10. package/dist/codegen.d.mts +4 -8
  11. package/dist/codegen.mjs +25 -49
  12. package/dist/file.cjs +1 -3
  13. package/dist/file.d.cts +9 -0
  14. package/dist/file.d.mts +2 -5
  15. package/dist/file.mjs +1 -2
  16. package/dist/index.cjs +7 -5
  17. package/dist/index.d.cts +7 -0
  18. package/dist/index.d.mts +4 -2
  19. package/dist/index.mjs +2 -1
  20. package/dist/options.cjs +8 -8
  21. package/dist/options.mjs +7 -6
  22. package/dist/plugin.cjs +2 -3
  23. package/dist/plugin.d.cts +9 -0
  24. package/dist/plugin.d.mts +4 -8
  25. package/dist/plugin.mjs +1 -2
  26. package/dist/postprocessors/eslint.cjs +20 -0
  27. package/dist/postprocessors/eslint.d.cts +8 -0
  28. package/dist/postprocessors/eslint.d.mts +8 -0
  29. package/dist/postprocessors/eslint.mjs +20 -0
  30. package/dist/postprocessors/index.cjs +12 -0
  31. package/dist/postprocessors/index.d.cts +7 -0
  32. package/dist/postprocessors/index.d.mts +7 -0
  33. package/dist/postprocessors/index.mjs +12 -0
  34. package/dist/postprocessors/oxfmt.cjs +34 -0
  35. package/dist/postprocessors/oxfmt.d.cts +9 -0
  36. package/dist/postprocessors/oxfmt.d.mts +9 -0
  37. package/dist/postprocessors/oxfmt.mjs +34 -0
  38. package/dist/postprocessors/prettier.cjs +15 -0
  39. package/dist/postprocessors/prettier.d.cts +7 -0
  40. package/dist/postprocessors/prettier.d.mts +7 -0
  41. package/dist/postprocessors/prettier.mjs +15 -0
  42. package/dist/postprocessors/types.d.cts +9 -0
  43. package/dist/postprocessors/types.d.mts +9 -0
  44. package/dist/presets/graphql-codegen.cjs +2 -4
  45. package/dist/presets/graphql-codegen.d.cts +6 -0
  46. package/dist/presets/graphql-codegen.d.mts +2 -6
  47. package/dist/presets/graphql-codegen.mjs +2 -3
  48. package/dist/types.cjs +1 -3
  49. package/dist/types.d.cts +24 -0
  50. package/dist/types.d.mts +11 -23
  51. package/dist/types.mjs +1 -2
  52. package/dist/utils.cjs +1 -3
  53. package/dist/utils.mjs +1 -2
  54. package/package.json +53 -42
  55. package/dist/oxfmt.cjs +0 -24
  56. package/dist/oxfmt.mjs +0 -23
package/dist/plugin.cjs CHANGED
@@ -1,6 +1,6 @@
1
- const require_codegen = require('./codegen.cjs');
1
+ const require_codegen = require("./codegen.cjs");
2
2
 
3
- //#region src/plugin.ts
3
+ // src/plugin.ts
4
4
  function codegen(jobOrOptions, ...moreJobs) {
5
5
  const init = require_codegen.Codegen.init(jobOrOptions, ...moreJobs);
6
6
  return {
@@ -14,5 +14,4 @@ function codegen(jobOrOptions, ...moreJobs) {
14
14
  };
15
15
  }
16
16
 
17
- //#endregion
18
17
  exports.codegen = codegen;
@@ -0,0 +1,9 @@
1
+ import { CodegenInput, CodegenOptions } from "./types.cjs";
2
+ export type Plugin = {
3
+ name: string;
4
+ buildStart(): Promise<void>;
5
+ watchChange(id: string): Promise<void>;
6
+ };
7
+ export declare function codegen(...jobs: CodegenInput[]): Plugin;
8
+ export declare function codegen(options: CodegenOptions, ...jobs: CodegenInput[]): Plugin;
9
+ export declare function codegen(jobOrOptions: CodegenInput | CodegenOptions, ...moreJobs: CodegenInput[]): Plugin;
package/dist/plugin.d.mts CHANGED
@@ -1,13 +1,9 @@
1
1
  import { CodegenInput, CodegenOptions } from "./types.mjs";
2
-
3
- //#region src/plugin.d.ts
4
- type Plugin = {
2
+ export type Plugin = {
5
3
  name: string;
6
4
  buildStart(): Promise<void>;
7
5
  watchChange(id: string): Promise<void>;
8
6
  };
9
- declare function codegen(...jobs: CodegenInput[]): Plugin;
10
- declare function codegen(options: CodegenOptions, ...jobs: CodegenInput[]): Plugin;
11
- declare function codegen(jobOrOptions: CodegenInput | CodegenOptions, ...moreJobs: CodegenInput[]): Plugin;
12
- //#endregion
13
- export { Plugin, codegen };
7
+ export declare function codegen(...jobs: CodegenInput[]): Plugin;
8
+ export declare function codegen(options: CodegenOptions, ...jobs: CodegenInput[]): Plugin;
9
+ export declare function codegen(jobOrOptions: CodegenInput | CodegenOptions, ...moreJobs: CodegenInput[]): Plugin;
package/dist/plugin.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Codegen } from "./codegen.mjs";
2
2
 
3
- //#region src/plugin.ts
3
+ // src/plugin.ts
4
4
  function codegen(jobOrOptions, ...moreJobs) {
5
5
  const init = Codegen.init(jobOrOptions, ...moreJobs);
6
6
  return {
@@ -14,5 +14,4 @@ function codegen(jobOrOptions, ...moreJobs) {
14
14
  };
15
15
  }
16
16
 
17
- //#endregion
18
17
  export { codegen };
@@ -0,0 +1,20 @@
1
+ // src/postprocessors/eslint.ts
2
+ var ESLint = class {
3
+ id = "eslint";
4
+ packageName = "eslint";
5
+ conflicts = [];
6
+ #linter;
7
+ async apply(source, path) {
8
+ const [result] = await (await this.#getLinter()).lintText(source, { filePath: path });
9
+ return result?.output ?? source;
10
+ }
11
+ #getLinter() {
12
+ return this.#linter ??= this.#loadLinter();
13
+ }
14
+ async #loadLinter() {
15
+ const { ESLint: Linter } = await import("eslint");
16
+ return new Linter({ fix: true });
17
+ }
18
+ };
19
+
20
+ exports.ESLint = ESLint;
@@ -0,0 +1,8 @@
1
+ import { Postprocessor } from "./types.cjs";
2
+ export declare class ESLint implements Postprocessor {
3
+ #private;
4
+ readonly id = "eslint";
5
+ readonly packageName = "eslint";
6
+ readonly conflicts: never[];
7
+ apply(source: string, path: string): Promise<string>;
8
+ }
@@ -0,0 +1,8 @@
1
+ import { Postprocessor } from "./types.mjs";
2
+ export declare class ESLint implements Postprocessor {
3
+ #private;
4
+ readonly id = "eslint";
5
+ readonly packageName = "eslint";
6
+ readonly conflicts: never[];
7
+ apply(source: string, path: string): Promise<string>;
8
+ }
@@ -0,0 +1,20 @@
1
+ // src/postprocessors/eslint.ts
2
+ var ESLint = class {
3
+ id = "eslint";
4
+ packageName = "eslint";
5
+ conflicts = [];
6
+ #linter;
7
+ async apply(source, path) {
8
+ const [result] = await (await this.#getLinter()).lintText(source, { filePath: path });
9
+ return result?.output ?? source;
10
+ }
11
+ #getLinter() {
12
+ return this.#linter ??= this.#loadLinter();
13
+ }
14
+ async #loadLinter() {
15
+ const { ESLint: Linter } = await import("eslint");
16
+ return new Linter({ fix: true });
17
+ }
18
+ };
19
+
20
+ export { ESLint };
@@ -0,0 +1,12 @@
1
+ const require_eslint = require("./eslint.cjs");
2
+ const require_oxfmt = require("./oxfmt.cjs");
3
+ const require_prettier = require("./prettier.cjs");
4
+
5
+ // src/postprocessors/index.ts
6
+ const postprocessors = [
7
+ new require_oxfmt.Oxfmt(),
8
+ new require_eslint.ESLint(),
9
+ new require_prettier.Prettier()
10
+ ];
11
+
12
+ exports.postprocessors = postprocessors;
@@ -0,0 +1,7 @@
1
+ import { Postprocessor, PostprocessorId } from "./types.cjs";
2
+ import { ESLint } from "./eslint.cjs";
3
+ import { Oxfmt } from "./oxfmt.cjs";
4
+ import { Prettier } from "./prettier.cjs";
5
+ export declare const postprocessors: [Oxfmt, ESLint, Prettier];
6
+ export type PostprocessorOptions = Record<PostprocessorId<(typeof postprocessors)[number]>, boolean>;
7
+ export type { Postprocessor, PostprocessorId };
@@ -0,0 +1,7 @@
1
+ import { Postprocessor, PostprocessorId } from "./types.mjs";
2
+ import { ESLint } from "./eslint.mjs";
3
+ import { Oxfmt } from "./oxfmt.mjs";
4
+ import { Prettier } from "./prettier.mjs";
5
+ export declare const postprocessors: [Oxfmt, ESLint, Prettier];
6
+ export type PostprocessorOptions = Record<PostprocessorId<(typeof postprocessors)[number]>, boolean>;
7
+ export type { Postprocessor, PostprocessorId };
@@ -0,0 +1,12 @@
1
+ import { ESLint } from "./eslint.mjs";
2
+ import { Oxfmt } from "./oxfmt.mjs";
3
+ import { Prettier } from "./prettier.mjs";
4
+
5
+ // src/postprocessors/index.ts
6
+ const postprocessors = [
7
+ new Oxfmt(),
8
+ new ESLint(),
9
+ new Prettier()
10
+ ];
11
+
12
+ export { postprocessors };
@@ -0,0 +1,34 @@
1
+ const require_utils = require("../utils.cjs");
2
+ let node_fs_promises = require("node:fs/promises");
3
+ let node_path = require("node:path");
4
+
5
+ // src/postprocessors/oxfmt.ts
6
+ const candidates = [".oxfmtrc.json"];
7
+ var Oxfmt = class {
8
+ id = "oxfmt";
9
+ packageName = "oxfmt";
10
+ conflicts = ["eslint", "prettier"];
11
+ cache = /* @__PURE__ */ new Map();
12
+ async apply(source, path) {
13
+ const { format } = await import("oxfmt");
14
+ const { code, errors } = await format(path, source, await this.#resolveConfig(path));
15
+ const firstError = errors.filter((e) => e.severity === "Error").pop();
16
+ if (firstError) throw new Error(firstError.message);
17
+ return code;
18
+ }
19
+ async #resolveConfig(from) {
20
+ const dir = (0, node_path.dirname)(from);
21
+ const cached = this.cache.get(dir);
22
+ if (cached) return cached;
23
+ const { promise, resolve } = Promise.withResolvers();
24
+ this.cache.set(dir, promise);
25
+ resolve(await require_utils.lookupPath(dir, candidates, this.#loadConfig));
26
+ return promise;
27
+ }
28
+ #loadConfig = async (file) => {
29
+ const contents = await (0, node_fs_promises.readFile)(file, "utf-8");
30
+ return JSON.parse(contents);
31
+ };
32
+ };
33
+
34
+ exports.Oxfmt = Oxfmt;
@@ -0,0 +1,9 @@
1
+ import { Postprocessor } from "./types.cjs";
2
+ export declare class Oxfmt implements Postprocessor {
3
+ #private;
4
+ readonly id = "oxfmt";
5
+ readonly packageName = "oxfmt";
6
+ readonly conflicts: string[];
7
+ private cache;
8
+ apply(source: string, path: string): Promise<string>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { Postprocessor } from "./types.mjs";
2
+ export declare class Oxfmt implements Postprocessor {
3
+ #private;
4
+ readonly id = "oxfmt";
5
+ readonly packageName = "oxfmt";
6
+ readonly conflicts: string[];
7
+ private cache;
8
+ apply(source: string, path: string): Promise<string>;
9
+ }
@@ -0,0 +1,34 @@
1
+ import { lookupPath } from "../utils.mjs";
2
+ import { readFile } from "node:fs/promises";
3
+ import { dirname } from "node:path";
4
+
5
+ // src/postprocessors/oxfmt.ts
6
+ const candidates = [".oxfmtrc.json"];
7
+ var Oxfmt = class {
8
+ id = "oxfmt";
9
+ packageName = "oxfmt";
10
+ conflicts = ["eslint", "prettier"];
11
+ cache = /* @__PURE__ */ new Map();
12
+ async apply(source, path) {
13
+ const { format } = await import("oxfmt");
14
+ const { code, errors } = await format(path, source, await this.#resolveConfig(path));
15
+ const firstError = errors.filter((e) => e.severity === "Error").pop();
16
+ if (firstError) throw new Error(firstError.message);
17
+ return code;
18
+ }
19
+ async #resolveConfig(from) {
20
+ const dir = dirname(from);
21
+ const cached = this.cache.get(dir);
22
+ if (cached) return cached;
23
+ const { promise, resolve } = Promise.withResolvers();
24
+ this.cache.set(dir, promise);
25
+ resolve(await lookupPath(dir, candidates, this.#loadConfig));
26
+ return promise;
27
+ }
28
+ #loadConfig = async (file) => {
29
+ const contents = await readFile(file, "utf-8");
30
+ return JSON.parse(contents);
31
+ };
32
+ };
33
+
34
+ export { Oxfmt };
@@ -0,0 +1,15 @@
1
+ // src/postprocessors/prettier.ts
2
+ var Prettier = class {
3
+ id = "prettier";
4
+ packageName = "prettier";
5
+ conflicts = [];
6
+ async apply(source, path) {
7
+ const { resolveConfig, format } = await import("prettier");
8
+ return format(source, {
9
+ ...await resolveConfig(path) ?? {},
10
+ filepath: path
11
+ });
12
+ }
13
+ };
14
+
15
+ exports.Prettier = Prettier;
@@ -0,0 +1,7 @@
1
+ import { Postprocessor } from "./types.cjs";
2
+ export declare class Prettier implements Postprocessor {
3
+ readonly id = "prettier";
4
+ readonly packageName = "prettier";
5
+ readonly conflicts: never[];
6
+ apply(source: string, path: string): Promise<string>;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { Postprocessor } from "./types.mjs";
2
+ export declare class Prettier implements Postprocessor {
3
+ readonly id = "prettier";
4
+ readonly packageName = "prettier";
5
+ readonly conflicts: never[];
6
+ apply(source: string, path: string): Promise<string>;
7
+ }
@@ -0,0 +1,15 @@
1
+ // src/postprocessors/prettier.ts
2
+ var Prettier = class {
3
+ id = "prettier";
4
+ packageName = "prettier";
5
+ conflicts = [];
6
+ async apply(source, path) {
7
+ const { resolveConfig, format } = await import("prettier");
8
+ return format(source, {
9
+ ...await resolveConfig(path) ?? {},
10
+ filepath: path
11
+ });
12
+ }
13
+ };
14
+
15
+ export { Prettier };
@@ -0,0 +1,9 @@
1
+ export interface Postprocessor {
2
+ readonly id: string;
3
+ readonly packageName: string;
4
+ readonly conflicts: string[];
5
+ apply(source: string, path: string): Promise<string> | string;
6
+ }
7
+ export type PostprocessorId<P extends Postprocessor> = P extends {
8
+ id: infer Id;
9
+ } ? Id : never;
@@ -0,0 +1,9 @@
1
+ export interface Postprocessor {
2
+ readonly id: string;
3
+ readonly packageName: string;
4
+ readonly conflicts: string[];
5
+ apply(source: string, path: string): Promise<string> | string;
6
+ }
7
+ export type PostprocessorId<P extends Postprocessor> = P extends {
8
+ id: infer Id;
9
+ } ? Id : never;
@@ -1,8 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
2
  let _graphql_codegen_cli = require("@graphql-codegen/cli");
4
3
 
5
- //#region src/presets/graphql-codegen.ts
4
+ // src/presets/graphql-codegen.ts
6
5
  function graphqlCodegen(options = {}) {
7
6
  return async () => {
8
7
  const context = await (0, _graphql_codegen_cli.createContext)({
@@ -23,7 +22,7 @@ function graphqlCodegen(options = {}) {
23
22
  input: [...normalizeDocuments(config.documents), ...Array.isArray(options) ? [] : normalizeDocuments(options.documents)],
24
23
  output,
25
24
  cacheBy: "contents",
26
- extraDeps: [context.filepath],
25
+ extraDeps: context.filepath?.length ? [context.filepath] : [],
27
26
  generate: async (files) => {
28
27
  const [generatedFile] = await (0, _graphql_codegen_cli.generate)({
29
28
  ...config,
@@ -46,5 +45,4 @@ function normalizeDocuments(documents) {
46
45
  return documents;
47
46
  }
48
47
 
49
- //#endregion
50
48
  exports.graphqlCodegen = graphqlCodegen;
@@ -0,0 +1,6 @@
1
+ import { CodegenJob } from "../types.cjs";
2
+ export type GraphqlCodegenOptions = {
3
+ config?: string;
4
+ project?: string;
5
+ };
6
+ export declare function graphqlCodegen(options?: GraphqlCodegenOptions): () => Promise<CodegenJob[]>;
@@ -1,10 +1,6 @@
1
1
  import { CodegenJob } from "../types.mjs";
2
-
3
- //#region src/presets/graphql-codegen.d.ts
4
- type GraphqlCodegenOptions = {
2
+ export type GraphqlCodegenOptions = {
5
3
  config?: string;
6
4
  project?: string;
7
5
  };
8
- declare function graphqlCodegen(options?: GraphqlCodegenOptions): () => Promise<CodegenJob[]>;
9
- //#endregion
10
- export { GraphqlCodegenOptions, graphqlCodegen };
6
+ export declare function graphqlCodegen(options?: GraphqlCodegenOptions): () => Promise<CodegenJob[]>;
@@ -1,6 +1,6 @@
1
1
  import { createContext, generate } from "@graphql-codegen/cli";
2
2
 
3
- //#region src/presets/graphql-codegen.ts
3
+ // src/presets/graphql-codegen.ts
4
4
  function graphqlCodegen(options = {}) {
5
5
  return async () => {
6
6
  const context = await createContext({
@@ -21,7 +21,7 @@ function graphqlCodegen(options = {}) {
21
21
  input: [...normalizeDocuments(config.documents), ...Array.isArray(options) ? [] : normalizeDocuments(options.documents)],
22
22
  output,
23
23
  cacheBy: "contents",
24
- extraDeps: [context.filepath],
24
+ extraDeps: context.filepath?.length ? [context.filepath] : [],
25
25
  generate: async (files) => {
26
26
  const [generatedFile] = await generate({
27
27
  ...config,
@@ -44,5 +44,4 @@ function normalizeDocuments(documents) {
44
44
  return documents;
45
45
  }
46
46
 
47
- //#endregion
48
47
  export { graphqlCodegen };
package/dist/types.cjs CHANGED
@@ -1,8 +1,6 @@
1
-
2
- //#region src/types.ts
1
+ // src/types.ts
3
2
  function defineCodegen(optionsOrJob, ...jobs) {
4
3
  return [optionsOrJob, ...jobs];
5
4
  }
6
5
 
7
- //#endregion
8
6
  exports.defineCodegen = defineCodegen;
@@ -0,0 +1,24 @@
1
+ import { File } from "./file.cjs";
2
+ import { PostprocessorOptions } from "./postprocessors/index.cjs";
3
+ export type MaybePromise<T> = Promise<T> | T;
4
+ export type CodegenOptions = Partial<PostprocessorOptions> & {
5
+ rootDir?: string;
6
+ cacheFile?: string | false;
7
+ };
8
+ export type NormalizedCodegenOptions = PostprocessorOptions & {
9
+ rootDir: string;
10
+ cacheFile?: string;
11
+ };
12
+ export type CodegenJob = Partial<PostprocessorOptions> & {
13
+ input: string | string[];
14
+ output: string;
15
+ generate: (files: File[], signal: AbortSignal) => MaybePromise<Buffer | string | null>;
16
+ cacheBy?: 'files' | 'contents';
17
+ extraDeps?: string[];
18
+ };
19
+ export type CodegenJobGenerator = (rootDir: string) => MaybePromise<CodegenJob[] | CodegenJob>;
20
+ export type CodegenInput = CodegenJobGenerator | CodegenJob;
21
+ export type CodegenPresetOptions = Omit<CodegenJob, 'input' | 'output' | 'generate'>;
22
+ export declare function defineCodegen(job: CodegenInput, ...jobs: CodegenInput[]): [CodegenInput, ...CodegenInput[]];
23
+ export declare function defineCodegen(options: CodegenOptions, ...jobs: CodegenInput[]): [CodegenOptions, ...CodegenInput[]];
24
+ export declare function defineCodegen(optionsOrJob: CodegenOptions | CodegenInput, ...jobs: CodegenInput[]): [CodegenOptions | CodegenInput, ...CodegenInput[]];
package/dist/types.d.mts CHANGED
@@ -1,36 +1,24 @@
1
1
  import { File } from "./file.mjs";
2
-
3
- //#region src/types.d.ts
4
- type MaybePromise<T> = Promise<T> | T;
5
- type CodegenOptions = {
2
+ import { PostprocessorOptions } from "./postprocessors/index.mjs";
3
+ export type MaybePromise<T> = Promise<T> | T;
4
+ export type CodegenOptions = Partial<PostprocessorOptions> & {
6
5
  rootDir?: string;
7
6
  cacheFile?: string | false;
8
- oxfmt?: boolean;
9
- prettier?: boolean;
10
- eslint?: boolean;
11
7
  };
12
- type NormalizedCodegenOptions = {
8
+ export type NormalizedCodegenOptions = PostprocessorOptions & {
13
9
  rootDir: string;
14
10
  cacheFile?: string;
15
- oxfmt: boolean;
16
- prettier: boolean;
17
- eslint: boolean;
18
11
  };
19
- type CodegenJob = {
12
+ export type CodegenJob = Partial<PostprocessorOptions> & {
20
13
  input: string | string[];
21
14
  output: string;
22
15
  generate: (files: File[], signal: AbortSignal) => MaybePromise<Buffer | string | null>;
23
16
  cacheBy?: 'files' | 'contents';
24
17
  extraDeps?: string[];
25
- oxfmt?: boolean;
26
- prettier?: boolean;
27
- eslint?: boolean;
28
18
  };
29
- type CodegenJobGenerator = (rootDir: string) => MaybePromise<CodegenJob[] | CodegenJob>;
30
- type CodegenInput = CodegenJobGenerator | CodegenJob;
31
- type CodegenPresetOptions = Omit<CodegenJob, 'input' | 'output' | 'generate'>;
32
- declare function defineCodegen(job: CodegenInput, ...jobs: CodegenInput[]): [CodegenInput, ...CodegenInput[]];
33
- declare function defineCodegen(options: CodegenOptions, ...jobs: CodegenInput[]): [CodegenOptions, ...CodegenInput[]];
34
- declare function defineCodegen(optionsOrJob: CodegenOptions | CodegenInput, ...jobs: CodegenInput[]): [CodegenOptions | CodegenInput, ...CodegenInput[]];
35
- //#endregion
36
- export { CodegenInput, CodegenJob, CodegenJobGenerator, CodegenOptions, CodegenPresetOptions, NormalizedCodegenOptions, defineCodegen };
19
+ export type CodegenJobGenerator = (rootDir: string) => MaybePromise<CodegenJob[] | CodegenJob>;
20
+ export type CodegenInput = CodegenJobGenerator | CodegenJob;
21
+ export type CodegenPresetOptions = Omit<CodegenJob, 'input' | 'output' | 'generate'>;
22
+ export declare function defineCodegen(job: CodegenInput, ...jobs: CodegenInput[]): [CodegenInput, ...CodegenInput[]];
23
+ export declare function defineCodegen(options: CodegenOptions, ...jobs: CodegenInput[]): [CodegenOptions, ...CodegenInput[]];
24
+ export declare function defineCodegen(optionsOrJob: CodegenOptions | CodegenInput, ...jobs: CodegenInput[]): [CodegenOptions | CodegenInput, ...CodegenInput[]];
package/dist/types.mjs CHANGED
@@ -1,7 +1,6 @@
1
- //#region src/types.ts
1
+ // src/types.ts
2
2
  function defineCodegen(optionsOrJob, ...jobs) {
3
3
  return [optionsOrJob, ...jobs];
4
4
  }
5
5
 
6
- //#endregion
7
6
  export { defineCodegen };
package/dist/utils.cjs CHANGED
@@ -1,8 +1,7 @@
1
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
2
1
  let node_path = require("node:path");
3
2
  let node_crypto = require("node:crypto");
4
3
 
5
- //#region src/utils.ts
4
+ // src/utils.ts
6
5
  async function lookupPath(dir, candidates, check) {
7
6
  if (!Array.isArray(candidates)) candidates = [candidates];
8
7
  do
@@ -26,6 +25,5 @@ function hash(data) {
26
25
  return hash.digest("hex");
27
26
  }
28
27
 
29
- //#endregion
30
28
  exports.hash = hash;
31
29
  exports.lookupPath = lookupPath;
package/dist/utils.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { dirname, resolve } from "node:path";
2
2
  import { createHash } from "node:crypto";
3
3
 
4
- //#region src/utils.ts
4
+ // src/utils.ts
5
5
  async function lookupPath(dir, candidates, check) {
6
6
  if (!Array.isArray(candidates)) candidates = [candidates];
7
7
  do
@@ -25,5 +25,4 @@ function hash(data) {
25
25
  return hash.digest("hex");
26
26
  }
27
27
 
28
- //#endregion
29
28
  export { hash, lookupPath };