yukey

yukey: the gallery stays out of the published package

commit 8aeaa903f048ae21281fe91a5637e513db32586e · parent 30239003e0 · browse this tree
Ximianth, 2026-10-11 23:23:20 UTC

The gallery (src/gallery/, the *.gallery.ts entries, static/) is the kit's
own dev surface and the e2e subject.  It isn't something consumers need
from us, so the build emit no longer includes it: tsconfig.build.json
excludes it the same way it excludes tests.  The entries keep living
beside their components; that convention is for iterating on the kit.

Consequences handled here:

- sideEffects names only the four self-registering component modules in
  dist/.  The src/ paths it listed were never shipped, and the gallery
  paths are gone with the gallery.
- esbuild's gallery bundle now runs with --ignore-annotations, since the
  gallery modules it bundles are no longer in the sideEffects list and
  would otherwise be dropped as dead imports.  Bundle size is unchanged.
- prepack cleans before building, matching the testkit.
diff --git a/packages/yukey/package.json b/packages/yukey/package.json
index 3f297da..1f317c0 100644
--- a/packages/yukey/package.json
+++ b/packages/yukey/package.json
@@ -4,30 +4,10 @@
 	"description": "a ui framework for the keyboard lover: Lit web components where the keyboard is on par with the mouse",
 	"license": "Apache-2.0 OR MIT",
 	"sideEffects": [
-		"./src/yk-button.ts",
-		"./src/yk-infopop.ts",
-		"./src/yk-list.ts",
-		"./src/yk-live-list.ts",
-		"./src/gallery/yk-gallery.ts",
-		"./src/gallery/main.ts",
-		"./src/megacolumn.gallery.ts",
-		"./src/yk-button.gallery.ts",
-		"./src/yk-infopop.gallery.ts",
-		"./src/yk-list.gallery.ts",
-		"./src/yk-live-list.gallery.ts",
-		"./src/tokens.gallery.ts",
 		"./dist/yk-button.js",
 		"./dist/yk-infopop.js",
 		"./dist/yk-list.js",
-		"./dist/yk-live-list.js",
-		"./dist/gallery/yk-gallery.js",
-		"./dist/gallery/main.js",
-		"./dist/megacolumn.gallery.js",
-		"./dist/yk-button.gallery.js",
-		"./dist/yk-infopop.gallery.js",
-		"./dist/yk-list.gallery.js",
-		"./dist/yk-live-list.gallery.js",
-		"./dist/tokens.gallery.js"
+		"./dist/yk-live-list.js"
 	],
 	"type": "module",
 	"exports": {
@@ -44,12 +24,12 @@
 		"LICENSE-MIT"
 	],
 	"scripts": {
-		"build": "tsc -p tsconfig.build.json && esbuild gallery=src/gallery/main.ts --bundle --format=esm --outdir=static --sourcemap=inline",
+		"build": "tsc -p tsconfig.build.json && esbuild gallery=src/gallery/main.ts --bundle --ignore-annotations --format=esm --outdir=static --sourcemap=inline",
 		"check": "tsc --noEmit && vitest run",
 		"test": "vitest run",
 		"test:watch": "vitest",
 		"clean": "rm -rf dist static/gallery.js",
-		"prepack": "npm run build"
+		"prepack": "npm run clean && npm run build"
 	},
 	"devDependencies": {
 		"esbuild": "0.28.2",
diff --git a/packages/yukey/tsconfig.build.json b/packages/yukey/tsconfig.build.json
index 98ded3f..1efdb73 100644
--- a/packages/yukey/tsconfig.build.json
+++ b/packages/yukey/tsconfig.build.json
@@ -9,5 +9,5 @@
 		"sourceMap": true
 	},
 	"include": ["src"],
-	"exclude": ["src/**/*.test.ts"]
+	"exclude": ["src/**/*.test.ts", "src/**/*.gallery.ts", "src/gallery"]
 }