@barefootjs/mojolicious 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.
package/src/build.ts ADDED
@@ -0,0 +1,37 @@
1
+ // Mojolicious build config factory for barefoot.config.ts
2
+
3
+ import type { BuildOptions } from '@barefootjs/jsx'
4
+ import { MojoAdapter } from './adapter'
5
+ import type { MojoAdapterOptions } from './adapter'
6
+
7
+ export interface MojoBuildOptions extends BuildOptions {
8
+ /** Adapter-specific options passed to MojoAdapter */
9
+ adapterOptions?: MojoAdapterOptions
10
+ }
11
+
12
+ /**
13
+ * Create a BarefootBuildConfig for Mojolicious EP template projects.
14
+ *
15
+ * Uses structural typing — does not import BarefootBuildConfig to avoid a
16
+ * circular dependency between @barefootjs/mojolicious and @barefootjs/cli.
17
+ */
18
+ export function createConfig(options: MojoBuildOptions = {}) {
19
+ return {
20
+ adapter: new MojoAdapter(options.adapterOptions),
21
+ paths: options.paths,
22
+ components: options.components,
23
+ outDir: options.outDir,
24
+ minify: options.minify,
25
+ contentHash: options.contentHash,
26
+ externals: options.externals,
27
+ externalsBasePath: options.externalsBasePath,
28
+ bundleEntries: options.bundleEntries,
29
+ localImportPrefixes: options.localImportPrefixes,
30
+ outputLayout: options.outputLayout ?? {
31
+ templates: 'templates',
32
+ clientJs: 'client',
33
+ runtime: 'client',
34
+ },
35
+ postBuild: options.postBuild,
36
+ }
37
+ }
package/src/index.ts ADDED
@@ -0,0 +1,8 @@
1
+ /**
2
+ * BarefootJS Mojolicious EP Template Adapter
3
+ *
4
+ * Generates Mojolicious EP template files from BarefootJS IR.
5
+ */
6
+
7
+ export { MojoAdapter, mojoAdapter } from './adapter'
8
+ export type { MojoAdapterOptions } from './adapter'