Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions .config/.cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"barhandles",
"bluwy",
"catppuccin",
"cleye",
"commitlint",
"dotenvx",
"esbuild",
Expand Down
15 changes: 15 additions & 0 deletions .config/lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
prepare-commit-msg:
jobs:
- run: ai-commit-msg -o {1}
commit-msg:
jobs:
- run: pnpm dlx commitlint --config .config/.commitlintrc.ts --edit {1}
pre-commit:
parallel: true
jobs:
- run: auto-readme -vg
name: Update README
- run: lint-staged -v
name: Lint staged
- run: pnpm --workspace-root run scripts:lint-examples
name: Lint examples
Comment on lines +7 to +15

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 | 🟠 Major

🧩 Analysis chain

🌐 Web query:

lefthook parallel jobs stage_fixed file mutation ordering

💡 Result:

In Lefthook, particularly for pre-commit hooks using parallel jobs (via parallel: true at the hook level or within group: parallel: true in the jobs feature added in v1.10.0), combined with stage_fixed: true on multiple jobs/commands that mutate the same files (e.g., linters/formatters like ESLint and Prettier with --fix), there is a risk of file mutation ordering issues. Key behaviors: - Jobs/commands with stage_fixed: true run git add on the relevant files (filtered by glob, exclude, etc., using {staged_files} or custom files) automatically after their execution. This only applies to pre-commit hooks. - When parallel: true, multiple such jobs execute concurrently. Lefthook performs git add concurrently for each job after its command completes. - For overlapping files mutated by multiple jobs: The final file content is determined by whichever job finishes last (the "winner"), as tools typically overwrite files. Lefthook then stages the final versions concurrently, so the last mutation persists in the index. This can lead to unpredictable results or race conditions if jobs interfere (e.g., one formatter overriding another). Official docs show examples with multiple parallel stage_fixed: true jobs on different root/ glob paths (e.g., backend vs. frontend), implying safety when paths don't overlap. For overlapping files, run sequentially (parallel: false or piped: true groups) or use non-overlapping filters to avoid mutations on the same files. To enforce ordering: - Use jobs with named groups: Sequential top-level jobs run in definition order; parallel within groups. - Unnamed jobs append in definition order. Example safe config (non-overlapping): pre-commit: parallel: true jobs: - name: migrate root: backend/ glob: db/migrations/* group: piped: true jobs: - run: bundle install - run: rails db:migrate - run: yarn lint --fix {staged_files} root: frontend/ stage_fixed: true # Safe if no overlap For overlapping mutations, prefer sequential execution or tools that don't conflict.

Citations:


Parallel pre-commit jobs with overlapping file mutations create race conditions.

Both auto-readme -vg and lint-staged -v modify README and source files. When run in parallel with parallel: true, whichever job finishes last determines the final file state, and concurrent git add operations become unpredictable. Additionally, your current config does not use stage_fixed: true, so Lefthook won't automatically re-stage file changes—mutations are made to disk but remain unstaged.

Either run these jobs sequentially (remove parallel: true or move them to separate sequential groups), or add stage_fixed: true to each file-mutating job to ensure Lefthook re-stages their output. The read-only lint-examples job can remain parallel.

🛠️ Suggested structure
 pre-commit:
-  parallel: true
   jobs:
     - run: auto-readme -vg
       name: Update README
+      stage_fixed: true
     - run: lint-staged -v
       name: Lint staged
+      stage_fixed: true
     - run: pnpm --workspace-root run scripts:lint-examples
       name: Lint examples

Alternatively, keep parallel: true at hook level and use sequential grouping for file-mutating jobs only:

pre-commit:
  parallel: true
  jobs:
    - group: piped
      jobs:
        - run: auto-readme -vg
          name: Update README
          stage_fixed: true
        - run: lint-staged -v
          name: Lint staged
          stage_fixed: true
    - run: pnpm --workspace-root run scripts:lint-examples
      name: Lint examples
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.config/lefthook.yml around lines 7 - 15, The pre-commit Lefthook config
runs file-mutating jobs in parallel causing race conditions; update the
pre-commit hook so that the mutating commands (auto-readme -vg and lint-staged
-v) are either run sequentially or explicitly re-stage their changes by adding
stage_fixed: true to those job entries, while leaving the read-only pnpm
--workspace-root run scripts:lint-examples run as a parallel job; locate the
entries named "Update README" and "Lint staged" referencing auto-readme and
lint-staged and apply either removal of parallelism or add stage_fixed: true to
each to ensure mutated files are re-staged deterministically.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
.config/www/public/*
.env**
.next
.react-router
.publish
.react-router
.svelte-kit
.turbo
.wrangler
Expand All @@ -22,4 +22,5 @@ core/types-lhci/config
dist*/
examples/catppuccin-xsl/vanilla/public/**/*
node_modules
single-file.html
storybook-static
3 changes: 0 additions & 3 deletions .husky/commit-msg

This file was deleted.

5 changes: 0 additions & 5 deletions .husky/pre-commit

This file was deleted.

3 changes: 0 additions & 3 deletions .husky/prepare-commit-msg

This file was deleted.

86 changes: 0 additions & 86 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,86 +0,0 @@
<div align="center">

# [`@stephansama`](https://github.com/stephansama/packages) packages

[![PNPM](https://img.shields.io/badge/PNPM-10.9-F69220.svg?logo=pnpm&logoColor=white&labelColor=F69220)](https://github.com/search?q=repo%3Astephansama%2Fnvim%20language%3Alua&type=code)
[![TypeScript](https://img.shields.io/badge/TypeScript-5.8.3-3178C6.svg?logo=typescript&logoColor=white&labelColor=3178C6)](https://github.com/search?q=repo%3Astephansama%2Fnvim%20language%3ATypeScript&type=code)
[![Turborepo](https://img.shields.io/badge/Turborepo-2.5.4-FF1E56.svg?logo=turborepo&logoColor=white&labelColor=FF1E56)](https://turborepo.com/)

[![codecov](https://codecov.io/github/stephansama/packages/graph/badge.svg)](https://codecov.io/github/stephansama/packages)
[![🦋 Changesets Release](https://github.com/stephansama/packages/actions/workflows/release.yml/badge.svg)](https://github.com/stephansama/packages/actions/workflows/release.yml)
[![CodeQL](https://github.com/stephansama/packages/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/stephansama/packages/actions/workflows/github-code-scanning/codeql)

Collection of open-source [npm](https://www.npmx.dev/) packages

</div>

##### Table of contents

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

- [Introduction](#introduction)
- [📦 Packages](#-packages)
- [☂️ Codecov coverage graph](#️-codecov-coverage-graph)
- [⭐ Stargazers](#-stargazers)
- [Related repositories](#related-repositories)

</details>

## Introduction

view examples here 👉 [![packages](https://pkg.pr.new/badge/stephansama/packages?style=flat&color=000&logoSize=auto)](https://pkg.pr.new/~/stephansama/packages)

or install an example with [`create-stephansama-example`](https://github.com/stephansama/packages/tree/main/core/example)
via `pnpm create stephansama-example`

## 📦 Packages

All packages are packaged underneath the `@stephansama` scope (for example: `@stephansama/remark-asciinema`)

<!-- WORKSPACE start -->

### 🏭 workspace

| 🏷️ Name | Version | 📥 Downloads | 📝 Description |
| ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [ai-commit-msg](core/ai-commit-msg/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fai-commit-msg?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/ai-commit-msg?labelColor=211F1F) | generate commit messages using ai |
| [alfred-kaomoji](core/alfred-kaomoji/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Falfred-kaomoji?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/alfred-kaomoji?labelColor=211F1F) | Alfred Kaomoji Picker |
| [astro-iconify-svgmap](core/astro-iconify-svgmap/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fastro-iconify-svgmap?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/astro-iconify-svgmap?labelColor=211F1F) | Astro integration for generating iconify svgmaps for ssg sites |
| [auto-readme](core/auto-readme/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fauto-readme?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/auto-readme?labelColor=211F1F) | Generate lists and tables for your README automagically based on your repository and comments |
| [catppuccin-jsonresume-theme](core/catppuccin-jsonresume-theme/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fcatppuccin-jsonresume-theme?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/catppuccin-jsonresume-theme?labelColor=211F1F) | theme for resume cli website |
| [catppuccin-opml](core/catppuccin-opml/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fcatppuccin-opml?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/catppuccin-opml?labelColor=211F1F) | Catppuccin styled opml stylesheet |
| [catppuccin-rss](core/catppuccin-rss/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fcatppuccin-rss?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/catppuccin-rss?labelColor=211F1F) | Catppuccin x Pretty-feed-v3 |
| [catppuccin-typedoc](core/catppuccin-typedoc/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fcatppuccin-typedoc?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/catppuccin-typedoc?labelColor=211F1F) | Catppuccin css variable theme for typedoc |
| [catppuccin-xsl](core/catppuccin-xsl/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fcatppuccin-xsl?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/catppuccin-xsl?labelColor=211F1F) | Catppuccin styles for various xsl formats |
| [create-stephansama-example](core/example/README.md) | ![npm version image](https://img.shields.io/npm/v/create-stephansama-example?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/create-stephansama-example?labelColor=211F1F) | Download an example from the @stephansama/packages examples |
| [find-makefile-targets](core/find-makefile-targets/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Ffind-makefile-targets?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/find-makefile-targets?labelColor=211F1F) | Find makefile targets used to pipe into fzf |
| [github-env](core/github-env/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fgithub-env?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/github-env?labelColor=211F1F) | \[Deprecated] Additional environment variable types for GitHub CI |
| [multipublish](core/multipublish/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fmultipublish?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/multipublish?labelColor=211F1F) | Publish packages to multiple providers easily |
| [prettier-plugin-handlebars](core/prettier-plugin-handlebars/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fprettier-plugin-handlebars?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/prettier-plugin-handlebars?labelColor=211F1F) | Prettier plugin that automatically assigns the default parser for various handlebars files |
| [remark-asciinema](core/remark-asciinema/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fremark-asciinema?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/remark-asciinema?labelColor=211F1F) | A remark plugin that transforms Asciinema links into embedded players or screenshots. |
| [svelte-social-share-links](core/svelte-social-share-links/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Fsvelte-social-share-links?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/svelte-social-share-links?labelColor=211F1F) | Svelte/Web component to share the current url with various social media providers |
| [typed-env](core/typed-env/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Ftyped-env?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/typed-env?labelColor=211F1F) | standard schema compatible environment validator |
| [typed-events](core/typed-events/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Ftyped-events?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/typed-events?labelColor=211F1F) | Typed events store using standard schema |
| [typed-nocodb-api](core/typed-nocodb-api/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Ftyped-nocodb-api?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/typed-nocodb-api?labelColor=211F1F) | Typed API client for NocoDB using Zod |
| [typed-templates](core/typed-templates/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Ftyped-templates?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/typed-templates?labelColor=211F1F) | Use standard schema to validate and use handlebar template directories |
| [types-github-action-env](core/types-github-action-env/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Ftypes-github-action-env?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/types-github-action-env?labelColor=211F1F) | environment variable types for GitHub Action environment |
| [types-lhci](core/types-lhci/README.md) | ![npm version image](https://img.shields.io/npm/v/%40stephansama%2Ftypes-lhci?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F) | ![npm downloads](https://img.shields.io/npm/dw/@stephansama/types-lhci?labelColor=211F1F) | types for lhci configuration |

<!-- WORKSPACE end -->

<div align="center">

### ☂️ Codecov coverage graph

![graph](https://codecov.io/github/stephansama/packages/graphs/tree.svg)

### ⭐ Stargazers

[![Stargazers repo roster for @stephansama/packages](https://reporoster.com/stars/stephansama/packages)](https://github.com/stephansama/packages/stargazers)

</div>

## Related repositories

- [stow.nvim](https://github.com/stephansama/stow.nvim)
- [@stephansama/actions](https://github.com/stephansama/actions)
27 changes: 27 additions & 0 deletions core/single-file/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# @stephansama/single-file

[![Source code](https://img.shields.io/badge/Source-666666?style=flat&logo=github&label=Github&labelColor=211F1F)](https://github.com/stephansama/packages/tree/main/core/single-file)
[![Documentation](https://img.shields.io/badge/Documentation-211F1F?style=flat&logo=Wikibooks&labelColor=211F1F)](https://packages.stephansama.info/api/@stephansama/single-file)
[![NPM Version](https://img.shields.io/npm/v/%40stephansama%2Fsingle-file?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F)](https://www.npmx.dev/package/@stephansama/single-file)
[![JSR](https://jsr.io/badges/@stephansama/single-file)](https://jsr.io/@stephansama/single-file)
[![socket.dev](https://badge.socket.dev/npm/package/@stephansama/single-file)](https://socket.dev/npm/package/@stephansama/single-file/overview)
[![npm downloads](https://img.shields.io/npm/dw/@stephansama/single-file?labelColor=211F1F)](https://www.npmx.dev/package/@stephansama/single-file)

create a single html file from a website url

##### 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
pnpm install @stephansama/single-file
```

## Usage
Comment thread
coderabbitai[bot] marked this conversation as resolved.
10 changes: 10 additions & 0 deletions core/single-file/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);
});
61 changes: 61 additions & 0 deletions core/single-file/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"name": "@stephansama/single-file",
"version": "0.0.0",
"description": "create a single html file from a website url",
"keywords": [
"single-file"
],
"homepage": "https://packages.stephansama.info/api/@stephansama/single-file",
"repository": {
"type": "git",
"url": "git+https://github.com/stephansama/packages.git",
"directory": "core/single-file"
},
"license": "MIT",
"author": {
"name": "Stephan Randle",
"email": "stephanrandle.dev@gmail.com",
"url": "https://stephansama.info"
},
"type": "module",
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.cjs"
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.cts",
Comment on lines +21 to +30

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick | 🔵 Trivial

🧩 Analysis chain

🌐 Web query:

package.json exports types condition moduleResolution nodenext best practice

💡 Result:

Best practices for package.json exports with "types" conditions and moduleResolution: "nodenext": Use conditional exports in package.json to specify different entry points for JS runtimes and TypeScript. For NodeNext (modern Node.js + TypeScript alignment), set "moduleResolution": "nodenext" (or "node16") in tsconfig.json. This respects package.json "exports", "type": "module", and requires explicit .js extensions in ESM imports. Key pattern for exports (order matters - most specific first): json { "name": "my-package", "type": "module", "exports": { ".": { "types": "./dist/index.d.ts", // TypeScript entry - MUST precede "default" "default": "./dist/index.js" // Runtime fallback (Node.js uses this) }, "./subpath": { "types": "./dist/subpath.d.ts", "default": "./dist/subpath.js" } } } - "types" condition: TypeScript (with nodenext) checks this first for .d.ts/.d.ts files. Use .d.ts for ESM types, .d.cts for CJS. - "default": Universal fallback for Node.js and other runtimes. - For dual CJS/ESM support: Add "import": "./esm/index.js", "require": "./cjs/index.cjs" before "default". - Node.js conditions (in priority order): import/require > node > default. TypeScript overlays "types" early. - Always include "types" before "default" - if after, TypeScript ignores it. - For subpaths: Use "./subpath": {...} to expose specific files; unlisted paths are blocked (encapsulation). - Fallback: Keep top-level "types": "./dist/index.d.ts" and "main": "./dist/index.js" for older tools/Node. Consumers: Use "module": "nodenext", "moduleResolution": "nodenext" for full Node.js compatibility. Explicit extensions in ESM: import {x} from "./file.js". This ensures type safety, runtime consistency, and works across Node.js, TypeScript, bundlers (with caveats on conditions). Validate with publint or arethetypeswrong.com.

Citations:


🏁 Script executed:

# Check for tsdown config and build output structure
find . -name "tsdown.config.*" -o -name "dist" -type d | head -20

Repository: stephansama/packages

Length of output: 1359


🏁 Script executed:

# Check current build/types configuration files
fd -t f "(tsconfig|build|vite|rollup)" . --max-depth 3

Repository: stephansama/packages

Length of output: 1482


🏁 Script executed:

# Look at the actual dist directory if it exists and check what type files are there
if [ -d "core/single-file/dist" ]; then 
  ls -la core/single-file/dist/ | grep -E "\.(d\.ts|d\.cts|js|cjs|mjs)$"
fi

Repository: stephansama/packages

Length of output: 46


🏁 Script executed:

# Check the full package.json structure for context
cat core/single-file/package.json | head -40

Repository: stephansama/packages

Length of output: 1108


🏁 Script executed:

# Check tsdown.config.ts to understand type emission setup
cat core/single-file/tsdown.config.ts

Repository: stephansama/packages

Length of output: 264


🏁 Script executed:

# Also check if there's a src/index.ts or similar
ls -la core/single-file/src/ 2>/dev/null || ls -la core/single-file/ | grep -E "\.(ts|js|mjs)$" | head -20

Repository: stephansama/packages

Length of output: 232


exports block is missing types conditions — breaks type resolution under modern moduleResolution modes.

With moduleResolution: "node16" | "nodenext" | "bundler", TypeScript resolves types from conditional exports and ignores the top-level "types" field when "exports" is present. The current block has only import/require, preventing type resolution. Additionally, pointing to a single .d.cts file serves CJS-flavored declarations to ESM consumers, which is incorrect.

Since tsdown.config.ts has exports: true and dts: true configured, tsdown should auto-generate proper dual .d.ts/.d.cts exports. Verify that the generated dist/ files match your build output, then update package.json to include types conditions in each export variant:

Expected structure
   "exports": {
     ".": {
-      "import": "./dist/index.js",
-      "require": "./dist/index.cjs"
+      "import": {
+        "types": "./dist/index.d.ts",
+        "default": "./dist/index.js"
+      },
+      "require": {
+        "types": "./dist/index.d.cts",
+        "default": "./dist/index.cjs"
+      }
     },

Keep top-level "types": "./dist/index.d.ts" for fallback compatibility.

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

In `@core/single-file/package.json` around lines 21 - 30, Update the package.json
exports to include types conditions and correct type entrypoints: ensure each
export record under "exports" (the "." entry with "import"/"require") also has a
corresponding "types" condition pointing to the appropriate declaration file
(e.g., "./dist/index.d.ts" for ESM import and "./dist/index.d.cts" or
CJS-specific dts for require if generated), keep the top-level "types":
"./dist/index.d.ts" as a fallback, and verify tsdown.config.ts (exports: true,
dts: true) produced matching dist/index.d.ts and dist/index.d.cts files before
committing the change.

"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"
},
"dependencies": {
"cheerio": "catalog:",
"dedent": "catalog:",
"he": "catalog:",
"ky": "catalog:",
"obug": "catalog:cli",
"oxc-parser": "catalog:",
"svg-sprite-loader": "catalog:"
},
"devDependencies": {
"@types/he": "catalog:",
"cleye": "catalog:cli",
"tsdown": "catalog:"
},
Comment on lines +42 to +54

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 | 🔴 Critical

cleye is under devDependencies but imported at runtime by src/index.ts.

core/single-file/src/index.ts does import { cli } from "cleye" which ends up in the published dist/index.js. Consumers installing @stephansama/single-file won't have cleye hoisted and the CLI will fail at runtime with Cannot find module 'cleye'.

Move cleye to dependencies (keep the catalog:cli reference).

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

In `@core/single-file/package.json` around lines 42 - 54, The package.json
currently lists "cleye": "catalog:cli" under devDependencies but src/index.ts
imports { cli } from "cleye" at runtime; move the "cleye": "catalog:cli" entry
from devDependencies into dependencies in package.json (remove the
devDependencies entry and add the same "catalog:cli" spec under dependencies) so
the published package includes cleye for consumers, then update the
lockfile/install artifacts accordingly.

"publishConfig": {
"access": "public",
"provenance": true
},
"readme": "./README.md"
}
Loading
Loading