@barefootjs/go-template 0.1.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.
@@ -0,0 +1,53 @@
1
+ import type { BuildOptions, PostBuildContext } from '@barefootjs/jsx';
2
+ import { GoTemplateAdapter } from './adapter';
3
+ import type { GoTemplateAdapterOptions } from './adapter';
4
+ export interface GoTemplateBuildOptions extends BuildOptions {
5
+ /** Adapter-specific options passed to GoTemplateAdapter */
6
+ adapterOptions?: GoTemplateAdapterOptions;
7
+ /** Output path for combined Go types file (relative to projectDir, default: 'components.go') */
8
+ typesOutputFile?: string;
9
+ /** Transform the combined types string before writing (for app-specific type fixes) */
10
+ transformTypes?: (types: string) => string;
11
+ /** Manual type definitions to append (app-specific types not generated from components) */
12
+ manualTypes?: string;
13
+ }
14
+ /**
15
+ * Strip Go package header and import block, returning only type definitions.
16
+ */
17
+ export declare function stripGoPackageHeader(types: string): string;
18
+ /**
19
+ * Deduplicate Go type definitions and NewXxxProps constructor functions.
20
+ * When duplicates exist, prefer the version that contains ScopeID (the complete Props struct
21
+ * from generatePropsStruct) over the simplified version from typeDefinitions.
22
+ */
23
+ export declare function deduplicateGoTypes(combined: string): string;
24
+ /**
25
+ * Combine Go types from multiple components into a single .go file.
26
+ */
27
+ export declare function combineGoTypes(options: {
28
+ types: Map<string, string>;
29
+ packageName: string;
30
+ manualTypes?: string;
31
+ transformTypes?: (types: string) => string;
32
+ }): string;
33
+ /**
34
+ * Create a BarefootBuildConfig for Go html/template projects.
35
+ *
36
+ * Uses structural typing — does not import BarefootBuildConfig to avoid
37
+ * circular dependency between @barefootjs/go-template and @barefootjs/cli.
38
+ */
39
+ export declare function createConfig(options?: GoTemplateBuildOptions): {
40
+ adapter: GoTemplateAdapter;
41
+ paths: import("@barefootjs/jsx").BarefootPaths | undefined;
42
+ components: string[] | undefined;
43
+ outDir: string | undefined;
44
+ minify: boolean | undefined;
45
+ contentHash: boolean | undefined;
46
+ externals: Record<string, import("@barefootjs/jsx").ExternalSpec> | undefined;
47
+ externalsBasePath: string | undefined;
48
+ bundleEntries: import("@barefootjs/jsx").BundleEntry[] | undefined;
49
+ localImportPrefixes: string[] | undefined;
50
+ outputLayout: import("@barefootjs/jsx").OutputLayout;
51
+ postBuild: (ctx: PostBuildContext) => Promise<void>;
52
+ };
53
+ //# sourceMappingURL=build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../src/build.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAA;AAEzD,MAAM,WAAW,sBAAuB,SAAQ,YAAY;IAC1D,2DAA2D;IAC3D,cAAc,CAAC,EAAE,wBAAwB,CAAA;IACzC,gGAAgG;IAChG,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,uFAAuF;IACvF,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IAC1C,2FAA2F;IAC3F,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB;AAID;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CA0C1D;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAmD3D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE;IACtC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;CAC3C,GAAG,MAAM,CAyDT;AAID;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,OAAO,GAAE,sBAA2B;IAyC7D,OAAO;IACP,KAAK;IACL,UAAU;IACV,MAAM;IACN,MAAM;IACN,WAAW;IACX,SAAS;IACT,iBAAiB;IACjB,aAAa;IACb,mBAAmB;IACnB,YAAY;IAKZ,SAAS,QApDmB,gBAAgB;EAsD/C"}