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
17 changes: 17 additions & 0 deletions .changeset/fix-cjs-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@ciscode/cache-kit": patch
---

fix: switch build output to CommonJS and add exports field to package.json

The published package was shipping ESM-only output (`module: ESNext`) without
`"type": "module"` in package.json and without `.js` extensions on internal
imports — making the package unloadable in Node.js ESM or CJS environments.

Changes:
- `tsconfig.build.json`: switched `module` to `CommonJS` and `moduleResolution`
to `Node10` so `dist/` emits standard CJS that Node.js loads without any
configuration on the consumer side
- `package.json`: added `exports` field with `require` and `default` conditions
pointing to `./dist/index.js`, ensuring both `require()` and `import` work
correctly when consumers use the package
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ciscode/cache-kit",
"version": "0.0.1",
"version": "0.0.2",
"description": "CacheKit backend module for reusable caching utilities and integrations.",
"author": "CisCode",
"publishConfig": {
Expand All @@ -18,6 +18,12 @@
],
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"default": "./dist/index.js"
}
},
"engines": {
"node": ">=20"
},
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"compilerOptions": {
"noEmit": false,
"emitDeclarationOnly": false,
"outDir": "dist"
"outDir": "dist",
"module": "CommonJS",
"moduleResolution": "Node10"
},
"include": ["src/**/*.ts"],
"exclude": ["test", "**/*.spec.ts", "**/*.test.ts", "dist", "node_modules"]
Expand Down
Loading