Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
"jsxSingleQuote": false,
"overrides": [
{ "files": ["*.md"], "options": { "tabWidth": 2, "useTabs": false } },
{ "files": "*.astro", "options": { "parser": "astro" } }
{ "files": "*.astro", "options": { "parser": "astro" } },
{
"files": ["pnpm-workspace.yaml"],
"options": {
"useTabs": true,
"singleQuote": true
}
}
],
"plugins": [
"@stephansama/prettier-plugin-handlebars",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
},
"devDependencies": {
"actions-up": "^1.11.0",
"node-plop": "catalog:",
"taze": "^19.9.2"
},
"packageManager": "pnpm@10.29.3"
Expand Down
250 changes: 236 additions & 14 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

117 changes: 60 additions & 57 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,37 @@
autoInstallPeers: true
catalogMode: strict
cleanupUnusedCatalogs: true
engineStrict: true
shellEmulator: true

packages:
- ./.config/*
- core/**
- examples/**

catalogs:
cli:
cosmiconfig: 9.0.0
obug: 2.1.1
yargs: 18.0.0
schema:
"@standard-schema/spec": ^1.1.0
arktype: 2.1.29
valibot: 1.2.0
zod: 4.2.1
storybook:
"@chromatic-com/storybook": ^4.1.3
"@storybook/addon-a11y": ^10.2.8
"@storybook/addon-docs": ^10.2.8
"@storybook/addon-svelte-csf": ^5.0.11
"@storybook/svelte-vite": ^10.2.8
storybook: ^10.2.8
svelte:
"@sveltejs/package": ^2.5.7
"@sveltejs/vite-plugin-svelte": ^6.2.4
"@tsconfig/svelte": ^5.0.7
svelte: ^5.51.2
svelte-check: ^4.4.0
vitest:
"@vitest/coverage-v8": "^4.0.18"
"@vitest/ui": "^4.0.18"
vitest: "^4.0.18"
autoInstallPeers: true

catalog:
"@catppuccin/palette": 1.7.1
"@dotenvx/dotenvx": ^1.52.0
"@iconify/types": ^2.0.0
"@iconify/utils": ^2.3.0
"@manypkg/find-root": "^3.1.0"
"@manypkg/get-packages": ^3.1.0
"@testing-library/react": ^16.3.2
"@testing-library/jest-dom": ^6.9.1
"@types/debug": ^4.1.12
"@types/mdast": ^4.0.4
"@types/minify": 9.1.4
"@types/react": ^19.2.14
"@types/vfile": ^4.0.0
"@types/yargs": ^17.0.35
actions-up: ^1.11.0
deepmerge: "^4.3.1"
es-toolkit: 1.43.0
'@catppuccin/palette': 1.7.1
'@dotenvx/dotenvx': ^1.52.0
'@iconify/types': ^2.0.0
'@iconify/utils': ^2.3.0
'@manypkg/find-root': ^3.1.0
'@manypkg/get-packages': ^3.1.0
'@testing-library/jest-dom': ^6.9.1
'@testing-library/react': ^16.3.2
'@types/debug': ^4.1.12
'@types/mdast': ^4.0.4
'@types/minify': 9.1.4
'@types/react': ^19.2.14
'@types/vfile': ^4.0.0
'@types/yargs': ^17.0.35
astro: 5.9.3
deepmerge: ^4.3.1
es-toolkit: 1.43.0
handlebars: 4.7.8
happy-dom: ^20.6.1
jsr: ^0.13.5
mdast: ^3.0.0
minify: 14.0.0
node-plop: ^0.32.3
prettier: ^3.8.1
react: 19.2.0
remark: ^15.0.1
taze: ^19.9.2
tsdown: 0.15.12
tsx: 4.21.0
typescript: 5.9.3
Expand All @@ -74,8 +41,42 @@ catalog:
vite: 6.3.5
vite-tsconfig-paths: ^5.1.4

catalogMode: strict

catalogs:
cli:
cosmiconfig: 9.0.0
obug: 2.1.1
yargs: 18.0.0
schema:
'@standard-schema/spec': ^1.1.0
arktype: 2.1.29
valibot: 1.2.0
zod: 4.2.1
storybook:
'@chromatic-com/storybook': ^4.1.3
'@storybook/addon-a11y': ^10.2.8
'@storybook/addon-docs': ^10.2.8
'@storybook/addon-svelte-csf': ^5.0.11
'@storybook/svelte-vite': ^10.2.8
storybook: ^10.2.8
svelte:
'@sveltejs/package': ^2.5.7
'@sveltejs/vite-plugin-svelte': ^6.2.4
'@tsconfig/svelte': ^5.0.7
svelte: ^5.51.2
svelte-check: ^4.4.0
vitest:
'@vitest/coverage-v8': ^4.0.18
'@vitest/ui': ^4.0.18
vitest: ^4.0.18

cleanupUnusedCatalogs: true

engineStrict: true

ignoredBuiltDependencies:
- "@swc/core"
- '@swc/core'
- core-js-pure
- sharp
- workerd
Expand All @@ -84,9 +85,11 @@ onlyBuiltDependencies:
- esbuild

overrides:
"@stephansama/astro-iconify-svgmap": workspace:*
"@stephansama/catppuccin-xsl": workspace:*
"@stephansama/remark-asciinema": workspace:*
"@stephansama/svelte-social-share-links": workspace:*
"@stephansama/typed-events": workspace:*
'@stephansama/astro-iconify-svgmap': workspace:*
'@stephansama/catppuccin-xsl': workspace:*
'@stephansama/remark-asciinema': workspace:*
'@stephansama/svelte-social-share-links': workspace:*
'@stephansama/typed-events': workspace:*
create-stephansama-example: workspace:*

shellEmulator: true
77 changes: 20 additions & 57 deletions turbo/generators/config.ts
Original file line number Diff line number Diff line change
@@ -1,64 +1,27 @@
import type { PlopTypes } from "@turbo/gen";

import { actions, prompts } from "./utils";

/* eslint-disable perfectionist/sort-objects */
export default function generator(plop: PlopTypes.NodePlopAPI) {
plop.setGenerator("package", {
description: "Generate a new package",
prompts: [
{
message: "What is the name of the new package?",
name: "name",
type: "input",
validate(input: string) {
if (input.includes(".")) {
return "library name cannot include an extension";
}
if (input.includes(" ")) {
return "library name cannot include spaces";
}
if (!input) {
return "library name is required";
}
return true;
},
},
{
message: "What is the description of the new package?",
name: "description",
type: "input",
},
],
// eslint-disable-next-line
plop.setGenerator("cli", {
description: "Generate a new cli package",
prompts: [prompts.name, prompts.description],
actions: [actions.addTemplate({ type: "cli" }), actions.addAllCommon],
});

plop.setGenerator("env", {
description: "Generate a new env package",
prompts: [prompts.name, prompts.description],
actions: [
{
path: "{{ turbo.paths.root }}/core/{{ dashCase name }}/package.json",
templateFile: "templates/lib/package.json.hbs",
type: "add",
},
{
path: "{{ turbo.paths.root }}/core/{{ dashCase name }}/README.md",
templateFile: "templates/lib/README.md.hbs",
type: "add",
},
{
path: "{{ turbo.paths.root }}/core/{{ dashCase name }}/tsdown.config.ts",
templateFile: "templates/lib/tsdown.config.ts.hbs",
type: "add",
},
{
path: "{{ turbo.paths.root }}/core/{{ dashCase name }}/tsconfig.json",
templateFile: "templates/lib/tsconfig.json.hbs",
type: "add",
},
{
path: "{{ turbo.paths.root }}/core/{{ dashCase name }}/typedoc.json",
templateFile: "templates/lib/typedoc.json",
type: "add",
},
{
path: "{{ turbo.paths.root }}/core/{{ dashCase name }}/src/index.ts",
templateFile: "templates/lib/BLANK",
type: "add",
},
actions.addTemplate({ type: "env" }),
actions.addCommonFile("tsconfig.json"),
],
});

plop.setGenerator("lib", {
description: "Generate a new lib package",
prompts: [prompts.name, prompts.description],
actions: [actions.addTemplate({ type: "lib" }), actions.addAllCommon],
});
}
10 changes: 10 additions & 0 deletions turbo/generators/templates/cli/cli.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env node

"use strict";

import("./dist/index.js")
.then((mod) => mod.run())
.catch((error) => {
console.error(error);
process.exit(1);
});
37 changes: 37 additions & 0 deletions turbo/generators/templates/cli/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "@stephansama/{{name}}",
"version": "0.0.0",
"description": "{{description}}",
"keywords": [
"{{name}}"
],
"homepage": "https://packages.stephansama.info/api/@stephansama/{{name}}",
"repository": {
"type": "git",
"url": "git+https://github.com/stephansama/packages.git",
"directory": "core/{{name}}"
},
"license": "MIT",
"author": {
"name": "Stephan Randle",
"email": "stephanrandle.dev@gmail.com",
"url": "https://stephansama.info"
},
"type": "module",
"bin": "./cli.mjs",
"files": [
"cli.mjs",
"dist"
],
"scripts": {
"build": "tsdown",
"dev": "tsdown --watch",
"lint": "eslint ./ --pass-on-no-patterns --no-error-on-unmatched-pattern",
"lint:fix": "eslint ./ --fix"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"readme": "./README.md"
}
3 changes: 3 additions & 0 deletions turbo/generators/templates/cli/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export async function run() {
console.info("running cli {{name}}");
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ import { defineConfig } from "tsdown";
export default defineConfig({
attw: true,
dts: true,
publint: true,
entry: ["src/index.ts"],
exports: true,
format: ["esm", "cjs"],
publint: true,
target: "esnext",
});
29 changes: 29 additions & 0 deletions turbo/generators/templates/env/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@stephansama/{{name}}",
"version": "0.0.0",
"description": "{{description}}",
"homepage": "https://packages.stephansama.info/api/@stephansama/{{name}}",
"repository": {
"type": "git",
"url": "git+https://github.com/stephansama/packages.git",
"directory": "core/{{name}}"
},
"license": "MIT",
"author": {
"name": "Stephan Randle",
"email": "stephanrandle.dev@gmail.com",
"url": "https://stephansama.info"
},
"type": "module",
"files": [
"src"
],
"scripts": {
"lint": "eslint ./src",
"lint:fix": "eslint ./src --fix"
},
"publishConfig": {
"access": "public",
"provenance": true
}
}
9 changes: 9 additions & 0 deletions turbo/generators/templates/env/src/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
declare global {
namespace NodeJS {
interface ProcessEnv extends ExtendEnvironment {}
}
}

interface ExtendEnvironment {}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Search for Biome configuration files
echo "=== Searching for Biome config files ==="
fd -type f \( -name "biome.json" -o -name "biome.jsonc" -o -name ".biomerc*" \)

echo ""
echo "=== Checking for Biome in package.json ==="
fd -type f -name "package.json" | head -5 | xargs -I {} sh -c 'echo "File: {}"; grep -i "biome" "{}" || echo "No biome reference found"'

echo ""
echo "=== Checking for Biome in pnpm-workspace.yaml or similar ==="
fd -type f \( -name "pnpm-workspace.yaml" -o -name "pnpm-workspace.yml" \) | xargs -I {} sh -c 'echo "File: {}"; cat "{}"'

Repository: stephansama/packages

Length of output: 740


🏁 Script executed:

#!/bin/bash

echo "=== Searching for Biome config files ==="
find . -maxdepth 2 -name "biome.json*" -o -name ".biomerc*"

echo ""
echo "=== Checking root and workspace structure ==="
ls -la | head -20

echo ""
echo "=== Searching for biome in package.json files ==="
find . -maxdepth 3 -name "package.json" -exec grep -l "biome" {} \;

echo ""
echo "=== Checking if Biome is referenced anywhere in config files ==="
rg -l "biome" --max-count 10 2>/dev/null || echo "No biome references found"

echo ""
echo "=== Check the specific file to understand context ==="
cat -n turbo/generators/templates/env/src/env.d.ts

Repository: stephansama/packages

Length of output: 1751


🏁 Script executed:

cat -n biome.json

Repository: stephansama/packages

Length of output: 2357


Add Biome suppression comment for empty interface extension point.

The noEmptyInterface rule is enabled in this repository's Biome configuration and will flag the empty interface on Line 7. While the empty interface is an intentional template extension point, it requires a suppression comment to comply with linting.

Proposed fix
-interface ExtendEnvironment {}
+// biome-ignore lint/suspicious/noEmptyInterface: Template extension point for project-specific env keys.
+interface ExtendEnvironment {}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
interface ExtendEnvironment {}
// biome-ignore lint/suspicious/noEmptyInterface: Template extension point for project-specific env keys.
interface ExtendEnvironment {}
🧰 Tools
🪛 Biome (2.4.4)

[error] 7-7: An empty interface is equivalent to {}.

(lint/suspicious/noEmptyInterface)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@turbo/generators/templates/env/src/env.d.ts` at line 7, Add a Biome
suppression comment immediately above the intentional empty extension interface
to silence the noEmptyInterface rule: place a single-line or block Biome ignore
for noEmptyInterface directly before the declaration of interface
ExtendEnvironment so the empty interface remains but linter noEmptyInterface is
suppressed.


export {};
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@

##### Table of contents
Comment thread
stephansama marked this conversation as resolved.

<details><summary>Open Table of contents</summary>

- [Installation](#installation)
- [Usage](#usage)

</details>

## Installation

```sh
Expand Down
Loading
Loading