From c8ec6f12f1df7189bb367c75f290adf45da4735c Mon Sep 17 00:00:00 2001 From: stephansama Date: Tue, 10 Mar 2026 06:39:38 -0400 Subject: [PATCH 1/6] feat(core): update svelte-social-share-links to export storybook for testing --- .changeset/red-carpets-wave.md | 5 ++++ .config/www/package.json | 1 - .config/www/setup.sh | 10 +++++--- .config/www/turbo.json | 3 ++- core/svelte-social-share-links/package.json | 21 +++++++++++----- package.json | 1 + pnpm-workspace.yaml | 2 ++ scripts/storybook.js | 27 +++++++++++++++++++++ turbo.json | 2 +- 9 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 .changeset/red-carpets-wave.md create mode 100644 scripts/storybook.js diff --git a/.changeset/red-carpets-wave.md b/.changeset/red-carpets-wave.md new file mode 100644 index 00000000..addb67bc --- /dev/null +++ b/.changeset/red-carpets-wave.md @@ -0,0 +1,5 @@ +--- +"@stephansama/svelte-social-share-links": patch +--- + +updated the svelte-social-share-links to export storybook website for user testing diff --git a/.config/www/package.json b/.config/www/package.json index 709bec5e..4d5c4fdb 100644 --- a/.config/www/package.json +++ b/.config/www/package.json @@ -3,7 +3,6 @@ "private": true, "type": "module", "scripts": { - "prebuild": "pnpm run setup", "build": "vitepress build", "predev": "pnpm run setup", "dev": "vitepress dev", diff --git a/.config/www/setup.sh b/.config/www/setup.sh index c0ce2424..bd7b7ad7 100644 --- a/.config/www/setup.sh +++ b/.config/www/setup.sh @@ -2,12 +2,14 @@ pnpm --workspace-root run scripts:generate-examples -./node_modules/.bin/typedoc +pnpm exec typedoc -./node_modules/.bin/eslint-config-inspector build --base /eslint --outDir public/eslint +pnpm exec eslint-config-inspector build --base /eslint --outDir public/eslint -./node_modules/.bin/node-modules-inspector build --base /node_modules --outDir public/node_modules +pnpm exec node-modules-inspector build --base /node_modules --outDir public/node_modules node -e "console.log(JSON.stringify({message: Date.now()}))" >public/healthcheck.json -pnpm --workspace-root run --silent scripts:meta >public/meta.json +pnpm --workspace-root run scripts:meta >public/meta.json + +pnpm --workspace-root run scripts:storybook diff --git a/.config/www/turbo.json b/.config/www/turbo.json index 280e236b..0b11284c 100644 --- a/.config/www/turbo.json +++ b/.config/www/turbo.json @@ -6,7 +6,8 @@ "./api/", "./public/healthcheck.json", "./public/node_modules", - "./public/eslint" + "./public/eslint", + "./public/api" ] }, "build": { diff --git a/core/svelte-social-share-links/package.json b/core/svelte-social-share-links/package.json index a9c5ef5f..f0bc109c 100644 --- a/core/svelte-social-share-links/package.json +++ b/core/svelte-social-share-links/package.json @@ -1,13 +1,18 @@ { "name": "@stephansama/svelte-social-share-links", "version": "1.1.1", - "private": false, "description": "Svelte/Web component to share the current url with various social media providers", + "homepage": "https://packages.stephansama.info/api/@stephansama/svelte-social-share-links", "repository": { "type": "git", "url": "git+https://github.com/stephansama/packages.git", "directory": "core/svelte-social-share-links" }, + "author": { + "name": "Stephan Randle", + "email": "stephanrandle.dev@gmail.com", + "url": "https://stephansama.info" + }, "type": "module", "exports": { ".": { @@ -30,13 +35,14 @@ "!dist/**/*.spec.*" ], "scripts": { - "prebuild": "svelte-package", - "build": "vite -c ./vite.webcomponent.config.ts build", + "build": "pnpm run --sequential \"/^build:.*/\"", "postbuild": "publint", + "build:storybook": "storybook build", + "build:svelte": "svelte-package", + "build:vite": "vite -c ./vite.webcomponent.config.ts build", "check": "svelte-check --tsconfig ./tsconfig.json", "dev": "svelte-package --watch", - "storybook": "storybook dev -p 6006", - "storybook:build": "storybook build" + "dev:storybook": "storybook dev -p 6006" }, "devDependencies": { "@chromatic-com/storybook": "catalog:storybook", @@ -60,5 +66,8 @@ "access": "public", "provenance": true }, - "readme": "./README.md" + "readme": "./README.md", + "storybook": { + "url": "https://packages.stephansama.info/api/@stephansama/svelte-social-share-links/storybook" + } } diff --git a/package.json b/package.json index 2542ae58..31d4288c 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "scripts:lint-examples": "node ./scripts/lint-examples.js", "scripts:meta": "node ./scripts/meta.js", "scripts:pkg-pr-new": "node ./scripts/pkg-pr-new.js", + "scripts:storybook": "node ./scripts/storybook.js", "test": "turbo test", "pretest:ci": "pnpm run scripts:generate-examples", "test:ci": "vitest --run --coverage", diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index f74a9fe3..abc94fde 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -23,6 +23,7 @@ catalog: '@types/react': ^19.2.14 '@types/vfile': ^4.0.0 '@types/yargs': ^17.0.35 + actions-up: ^1.11.0 astro: 5.9.3 deepmerge: ^4.3.1 es-toolkit: 1.43.0 @@ -40,6 +41,7 @@ catalog: remark: ^15.0.1 tailwind-scrollbar: ^4.0.2 tailwindcss: ^4.1.18 + taze: ^19.9.2 tsdown: 0.15.12 tsx: 4.21.0 typescript: 5.9.3 diff --git a/scripts/storybook.js b/scripts/storybook.js new file mode 100644 index 00000000..47491428 --- /dev/null +++ b/scripts/storybook.js @@ -0,0 +1,27 @@ +#!/usr/bin/env node + +import { getPackages } from "@manypkg/get-packages"; +import * as fs from "node:fs"; +import * as path from "node:path"; + +const { packages } = await getPackages(process.cwd()); + +const www = packages.find((pkg) => pkg.packageJson.name === "www"); +if (!www) throw new Error("unable to find www package"); + +for (const pkg of packages) { + if (!("storybook" in pkg.packageJson)) continue; + if (!("url" in pkg.packageJson.storybook)) continue; + if (typeof pkg.packageJson.storybook.url !== "string") continue; + + const storybookDir = path.resolve(path.join(pkg.dir, "storybook-static")); + const outputDir = path.resolve( + path.join(www.dir, "public", "api", pkg.packageJson.name, "storybook"), + ); + + await fs.promises.cp(storybookDir, outputDir, { recursive: true }); + + console.info( + `successfully copied ${pkg.packageJson.name} storybook configuration to documentation site`, + ); +} diff --git a/turbo.json b/turbo.json index 04e8bff5..a60bf17b 100644 --- a/turbo.json +++ b/turbo.json @@ -9,7 +9,7 @@ }, "build": { "dependsOn": ["^build"], - "outputs": ["dist*/**", "config", "!.next/cache/**"] + "outputs": ["dist*/**", "config", "storybook-static", "!.next/cache/**"] }, "lint:fix": { "cache": false }, "lint": { From 939eb6b96a5f734f98e05f9dc839d8ea90b209bb Mon Sep 17 00:00:00 2001 From: stephansama Date: Tue, 10 Mar 2026 06:43:45 -0400 Subject: [PATCH 2/6] perf(turbo): add storybook build dependency --- .config/www/turbo.json | 6 +++++- turbo.json | 12 ++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.config/www/turbo.json b/.config/www/turbo.json index 0b11284c..c5dcd2cc 100644 --- a/.config/www/turbo.json +++ b/.config/www/turbo.json @@ -11,7 +11,11 @@ ] }, "build": { - "dependsOn": ["create-stephansama-example#build", "www#setup"], + "dependsOn": [ + "create-stephansama-example#build", + "@stephansama/svelte-social-share-links#build:storybook", + "www#setup" + ], "outputs": ["$TURBO_ROOT$/dist"] } } diff --git a/turbo.json b/turbo.json index a60bf17b..500363c7 100644 --- a/turbo.json +++ b/turbo.json @@ -11,13 +11,13 @@ "dependsOn": ["^build"], "outputs": ["dist*/**", "config", "storybook-static", "!.next/cache/**"] }, - "lint:fix": { "cache": false }, - "lint": { - "dependsOn": ["^lint"] - }, - "check-types": { - "dependsOn": ["^check-types"] + "build:storybook": { + "dependsOn": ["^build"], + "outputs": ["storybook-static"] }, + "lint": { "dependsOn": ["^lint"] }, + "lint:fix": { "cache": false }, + "check-types": { "dependsOn": ["^check-types"] }, "publish": { "persistent": true, "cache": false, From 0c90093e08f22cb6613c0dee2cc47e4916e74f6a Mon Sep 17 00:00:00 2001 From: stephansama Date: Tue, 10 Mar 2026 06:51:49 -0400 Subject: [PATCH 3/6] docs(svelte-social-share-links): add storybook link and vercel config --- core/svelte-social-share-links/README.md | 1 + vercel.json | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/core/svelte-social-share-links/README.md b/core/svelte-social-share-links/README.md index 24cfba2d..654f73ad 100644 --- a/core/svelte-social-share-links/README.md +++ b/core/svelte-social-share-links/README.md @@ -3,6 +3,7 @@ [![Source code](https://img.shields.io/badge/Source%20code-211F1F?style=flat&logo=github&labelColor=211F1F)](https://github.com/stephansama/packages/tree/main/core/svelte-social-share-links) [![Documentation](https://img.shields.io/badge/Documentation-211F1F?style=flat&logo=Wikibooks&labelColor=211F1F)](https://packages.stephansama.info/api/@stephansama/svelte-social-share-links) [![NPM Version](https://img.shields.io/npm/v/%40stephansama%2Fsvelte-social-share-links?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F)](https://www.npmx.dev/package/@stephansama/svelte-social-share-links) +[![storybook](https://img.shields.io/badge/storybook-211F1F?logo=storybook)](https://packages.stephansama.info/api/@stephansama/svelte-social-share-links/storybook) [![npm downloads](https://img.shields.io/npm/dw/@stephansama/svelte-social-share-links?labelColor=211F1F)](https://www.npmx.dev/package/@stephansama/svelte-social-share-links) Simple social sharing for the web diff --git a/vercel.json b/vercel.json index f2614801..0c3397e0 100644 --- a/vercel.json +++ b/vercel.json @@ -4,6 +4,10 @@ { "source": "/node_modules/:path*", "destination": "/node_modules/index.html" + }, + { + "source": "/api/@stephansama/svelte-social-share-links/:path*", + "destination": "/api/@stephansama/svelte-social-share-links/index.html" } ] } From fef1f174c3de9f4b046dda9c8479e7c5cb908fb3 Mon Sep 17 00:00:00 2001 From: stephansama Date: Tue, 10 Mar 2026 07:03:49 -0400 Subject: [PATCH 4/6] perf(turbo): update dependsOn and route patterns --- .config/www/turbo.json | 9 +++------ vercel.json | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.config/www/turbo.json b/.config/www/turbo.json index c5dcd2cc..d75f1941 100644 --- a/.config/www/turbo.json +++ b/.config/www/turbo.json @@ -8,14 +8,11 @@ "./public/node_modules", "./public/eslint", "./public/api" - ] + ], + "dependsOn": ["@stephansama/svelte-social-share-links#build:storybook"] }, "build": { - "dependsOn": [ - "create-stephansama-example#build", - "@stephansama/svelte-social-share-links#build:storybook", - "www#setup" - ], + "dependsOn": ["create-stephansama-example#build", "www#setup"], "outputs": ["$TURBO_ROOT$/dist"] } } diff --git a/vercel.json b/vercel.json index 0c3397e0..311c4218 100644 --- a/vercel.json +++ b/vercel.json @@ -6,8 +6,8 @@ "destination": "/node_modules/index.html" }, { - "source": "/api/@stephansama/svelte-social-share-links/:path*", - "destination": "/api/@stephansama/svelte-social-share-links/index.html" + "source": "/api/@stephansama/svelte-social-share-links/storybook/:path((?!.*\\.).*)", + "destination": "/api/@stephansama/svelte-social-share-links/storybook/index.html" } ] } From bd0117815d4992479faaab2dbe4e572d36f92bf8 Mon Sep 17 00:00:00 2001 From: stephansama Date: Tue, 10 Mar 2026 07:09:15 -0400 Subject: [PATCH 5/6] feat(vercel): add redirect for storybook endpoint --- vercel.json | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vercel.json b/vercel.json index 311c4218..cee7ace1 100644 --- a/vercel.json +++ b/vercel.json @@ -9,5 +9,12 @@ "source": "/api/@stephansama/svelte-social-share-links/storybook/:path((?!.*\\.).*)", "destination": "/api/@stephansama/svelte-social-share-links/storybook/index.html" } + ], + "redirects": [ + { + "source": "/api/@stephansama/svelte-social-share-links/storybook", + "destination": "/api/@stephansama/svelte-social-share-links/storybook/", + "permanent": true + } ] } From 94d5411043661ae584054dd0034f0be5a01190df Mon Sep 17 00:00:00 2001 From: stephansama Date: Tue, 10 Mar 2026 07:13:34 -0400 Subject: [PATCH 6/6] perf(core): update build script to use svelte and vite --- core/svelte-social-share-links/package.json | 2 +- turbo.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/svelte-social-share-links/package.json b/core/svelte-social-share-links/package.json index f0bc109c..5f320688 100644 --- a/core/svelte-social-share-links/package.json +++ b/core/svelte-social-share-links/package.json @@ -35,7 +35,7 @@ "!dist/**/*.spec.*" ], "scripts": { - "build": "pnpm run --sequential \"/^build:.*/\"", + "build": "pnpm run build:svelte && pnpm run build:vite", "postbuild": "publint", "build:storybook": "storybook build", "build:svelte": "svelte-package", diff --git a/turbo.json b/turbo.json index 500363c7..5ffd34c3 100644 --- a/turbo.json +++ b/turbo.json @@ -9,7 +9,7 @@ }, "build": { "dependsOn": ["^build"], - "outputs": ["dist*/**", "config", "storybook-static", "!.next/cache/**"] + "outputs": ["dist*/**", "config", "!.next/cache/**"] }, "build:storybook": { "dependsOn": ["^build"],