Skip to content

Commit 648362b

Browse files
committed
fixing build, updating scripts
1 parent f4ba987 commit 648362b

File tree

11 files changed

+325
-207
lines changed

11 files changed

+325
-207
lines changed

dist/index.d.ts

Lines changed: 57 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
import z from "zod";
2-
import { EleventyConfig, EleventyScope, EleventySuppliedData } from "11ty.ts";
2+
import { EleventyScope, EleventySuppliedData } from "11ty.ts";
33

4+
//#region rolldown:runtime
5+
//#endregion
6+
//#region src/core/const.d.ts
7+
declare const THEMES: readonly ["Traditional", "Modernist", "Midnight", "Chocolate", "Oldstyle", "Steely", "Swiss", "Ultramarine"];
8+
//#endregion
49
//#region src/core/options.d.ts
510
declare const PluginOptionsSchema: z.ZodObject<{
6-
launchPath: z.ZodPipe<z.ZodPrefault<z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"nightly">, z.ZodString]>>>>, z.ZodTransform<string, string | null>>;
11+
launchPath: z.ZodPipe<z.ZodTransform<{} | null | undefined, unknown>, z.ZodOptional<z.ZodString>>;
712
layout: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8-
theme: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
13+
theme: z.ZodDefault<z.ZodPrefault<z.ZodOptional<z.ZodEnum<{
914
Traditional: "Traditional";
1015
Modernist: "Modernist";
1116
Midnight: "Midnight";
@@ -14,18 +19,47 @@ declare const PluginOptionsSchema: z.ZodObject<{
1419
Steely: "Steely";
1520
Swiss: "Swiss";
1621
Ultramarine: "Ultramarine";
17-
}>>>;
18-
collectionPage: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
19-
verbose: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
20-
silent: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
21-
noSTL: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
22-
checkLaunchPath: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodPrefault<z.ZodCodec<z.ZodString, z.ZodBoolean>>]>>;
22+
}>>>>;
23+
collectionPage: z.ZodDefault<z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>>>;
24+
verbose: z.ZodDefault<z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>>>;
25+
silent: z.ZodDefault<z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>>>;
26+
noSTL: z.ZodDefault<z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>>>;
27+
checkLaunchPath: z.ZodDefault<z.ZodPipe<z.ZodTransform<{} | undefined, unknown>, z.ZodUnion<readonly [z.ZodBoolean, z.ZodCodec<z.ZodString, z.ZodBoolean>]>>>;
2328
}, z.core.$strip>;
2429
//#endregion
25-
//#region src/lib/types.d.ts
26-
type MaybePluginOptions = z.input<typeof PluginOptionsSchema>;
30+
//#region src/core/scad-bin.d.ts
31+
/**
32+
* Alias mappings to use when installing the plugin into an eleventy project.
33+
*
34+
* @example ```
35+
* import Eleventy from "@11ty/eleventy";
36+
* import { EleventyPluginOpenSCAD, SCAD_BINS } from "eleventy-plugin-scad";
37+
*
38+
* const launchPath = SCAD_BINS.MACOS;
39+
*```
40+
*/
41+
declare const SCAD_BINS: {
42+
readonly LINUX: string;
43+
readonly LINUX_NIGHTLY: string;
44+
readonly MACOS: string;
45+
readonly MACOS_NIGHTLY: string;
46+
readonly WINDOWS: string;
47+
readonly WINDOWS_NIGHTLY: string;
48+
};
49+
/**
50+
* Returns the OpenSCAD binary path for the current platform.
51+
*/
52+
declare namespace types_d_exports {
53+
export { EleventyDirs, FullPageData, MainPlatforms, ModelViewerTheme, ParsedPluginOptions, PlatformMap, PluginOptions, PluginOptionsInput, ScadTemplateData };
54+
}
55+
import * as import__11ty_ts from "11ty.ts";
56+
__reExport(types_d_exports, import__11ty_ts);
57+
type ModelViewerTheme = (typeof THEMES)[number];
2758
type PluginOptions = z.infer<typeof PluginOptionsSchema>;
28-
type StlViewerThemes = PluginOptions["theme"];
59+
type ParsedPluginOptions = z.output<typeof PluginOptionsSchema>;
60+
type PluginOptionsInput = Omit<z.input<typeof PluginOptionsSchema>, "launchPath"> & {
61+
launchPath: "auto" | "nightly" | (string & {});
62+
};
2963
type ScadTemplateData = {
3064
layout: string;
3165
title: string;
@@ -50,41 +84,24 @@ type EleventyDirs = {
5084
layouts?: string;
5185
output: string;
5286
};
87+
type MainPlatforms = Extract<"linux" | "darwin" | "win32", NodeJS.Platform>;
88+
type PlatformMap = Record<MainPlatforms, string>;
5389
//#endregion
5490
//#region src/plugin.d.ts
5591
/**
5692
* Eleventy Plugin for OpenSCAD
5793
*
5894
* @param {EleventyConfig} eleventyConfig
59-
* @param {MaybePluginOptions} options
60-
*/
61-
declare function export_default(eleventyConfig: EleventyConfig, options: MaybePluginOptions): void;
62-
//#endregion
63-
//#region src/core/scad-bin.d.ts
64-
/**
65-
* Alias mappings to use when installing the plugin into an eleventy project.
66-
*
67-
* @example ```
68-
* import Eleventy from "@11ty/eleventy";
69-
* import { EleventyPluginOpenSCAD, SCAD_BINS } from "eleventy-plugin-scad";
70-
*
71-
* const launchPath = SCAD_BINS.MACOS;
72-
*```
73-
*/
74-
declare const SCAD_BINS: {
75-
readonly LINUX: string;
76-
readonly LINUX_NIGHTLY: string;
77-
readonly MACOS: string;
78-
readonly MACOS_NIGHTLY: string;
79-
readonly WINDOWS: string;
80-
readonly WINDOWS_NIGHTLY: string;
81-
};
82-
/**
83-
* Helper: Returns the OpenSCAD binary path for the current platform.
84-
* @param nightly - Whether to use the nightly build
95+
* @param {PluginOptionsInput} options
8596
*/
97+
declare function EleventyPluginOpenSCAD(eleventyConfig: types_d_exports.EleventyConfig, options: PluginOptionsInput): void;
8698
//#endregion
8799
//#region src/lib/register.d.ts
88-
declare function addOpenSCADPlugin(eleventyConfig: EleventyConfig, options: MaybePluginOptions): void;
100+
declare function addOpenSCADPlugin(eleventyConfig: types_d_exports.EleventyConfig, options: PluginOptionsInput): void;
101+
declare namespace index_d_exports {
102+
export { EleventyDirs, EleventyPluginOpenSCAD, FullPageData, MainPlatforms, ModelViewerTheme, ParsedPluginOptions, PlatformMap, PluginOptions, PluginOptionsInput, SCAD_BINS, ScadTemplateData, addOpenSCADPlugin, EleventyPluginOpenSCAD as default };
103+
}
104+
__reExport(index_d_exports, types_d_exports);
105+
89106
//#endregion
90-
export { type EleventyConfig, EleventyDirs, export_default as EleventyPluginOpenSCAD, FullPageData, MaybePluginOptions, PluginOptions, SCAD_BINS, ScadTemplateData, StlViewerThemes, addOpenSCADPlugin, export_default as default };
107+
export { EleventyDirs, EleventyPluginOpenSCAD, FullPageData, MainPlatforms, ModelViewerTheme, ParsedPluginOptions, PlatformMap, PluginOptions, PluginOptionsInput, SCAD_BINS, ScadTemplateData, addOpenSCADPlugin, EleventyPluginOpenSCAD as default };

dist/index.js

Lines changed: 117 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@
3232
"build": "tsdown",
3333
"clean": "rm -rvf ./dist/*",
3434
"clean-test": "rm -rvf ./test/_11ty/output/*",
35-
"dev": "npm run start",
35+
"dev": "pnpm build --watch ./src",
3636
"release": "bumpp && npm publish",
37-
"serve-test": "cd ./test/_11ty && DEBUG=eleventy:scad* eleventy --serve",
38-
"start": "tsdown --watch ./src",
37+
"start": "cd ./test/_11ty && DEBUG=eleventy:scad* pnpx @11ty/eleventy --serve",
3938
"test": "vitest",
4039
"typecheck": "tsc --noEmit"
4140
},
@@ -51,14 +50,15 @@
5150
"devDependencies": {
5251
"11ty.ts": "0.0.6",
5352
"@11ty/eleventy": "^3.1.2",
54-
"@biomejs/biome": "2.2.5",
53+
"@biomejs/biome": "2.3.4",
5554
"@rollup/plugin-replace": "6.0.2",
5655
"@types/debug": "^4.1.12",
5756
"@types/he": "^1.2.3",
5857
"@types/node": "^24.7.1",
59-
"@types/which": "3.0.4",
58+
"@types/which": "^3.0.4",
6059
"bumpp": "10.3.1",
61-
"np": "^10.2.0",
60+
"concurrently": "9.2.1",
61+
"np": "10.2.0",
6262
"rimraf": "6.0.1",
6363
"rollup-plugin-copy": "3.5.0",
6464
"tsdown": "0.11.13",

0 commit comments

Comments
 (0)