Skip to content

chore: sourcemaps in dist/ point to missing src/ — include src/ in npm publish or use inlineSources #94

Description

@stackbilt-admin

Problem

The published `@stackbilt/llm-providers` package (v1.17.2) includes `.js.map` files in `dist/` that reference `../src/*.ts` as their source paths, but `src/` is not included in the published package. This causes vitest (and any other tool that consumes sourcemaps) to emit warnings on every test run:

```
Sourcemap for ".../node_modules/@stackbilt/llm-providers/dist/index.js" points to missing source files
Sourcemap for ".../node_modules/@stackbilt/llm-providers/dist/canonical.js" points to missing source files
Sourcemap for ".../node_modules/@stackbilt/llm-providers/dist/gateway-routing.js" points to missing source files
```
(28 warnings total — one per dist file)

Verified via:

$ cat dist/index.js.map | python3 -c "import json,sys; d=json.load(sys.stdin); print(d['sources'])"
['../src/index.ts']
$ ls node_modules/@stackbilt/llm-providers/src
ls: cannot access '...src': No such file or directory

Fix (pick one)

Option A — include src/ in the package (enables step-through debugging):
Add "src" to the files array in package.json:

"files": ["dist", "src"]

Option B — strip sourcemaps from the published dist (smaller package, no warnings):
In tsconfig.json or the build command, set "sourceMap": false or add --no-source-maps to the build step.

Option C — inline sources into the map (single file, no missing reference):
Set "inlineSources": true in tsconfig.json. The .map files will embed the source content directly, so no separate src/ needed.

Option A is preferred if downstream consumers step through llm-providers code during debugging. Option B is fine if sourcemaps aren't needed in consumers.

Context

Observed in aegis-daemon v2.25.2 test suite. Not a test failure — all 1863 tests pass — but 28 warnings pollute every vitest run output and make real failures harder to spot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions