Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixed CJS types under modern modernResolution options #388

Merged
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
14 changes: 14 additions & 0 deletions packages/csv/dist/cjs/index.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

// Alias to the modules exposing the stream and callback APIs

import { generate } from 'csv-generate';
import { parse } from 'csv-parse';
import { transform } from 'stream-transform';
import { stringify } from 'csv-stringify';

export { generate, parse, transform, stringify };

export * as generator from 'csv-generate';
export * as parser from 'csv-parse';
export * as transformer from 'stream-transform';
export * as stringifier from 'csv-stringify';
14 changes: 14 additions & 0 deletions packages/csv/dist/cjs/sync.d.cts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

// Alias to the modules exposing the sync APIs

import { generate } from 'csv-generate/sync'
import { parse } from 'csv-parse/sync';
import { transform } from 'stream-transform/sync';
import { stringify } from 'csv-stringify/sync';

export { generate, parse, transform, stringify }

export * as generator from 'csv-generate/sync';
export * as parser from 'csv-parse/sync';
export * as transformer from 'stream-transform/sync';
export * as stringifier from 'csv-stringify/sync';
24 changes: 17 additions & 7 deletions packages/csv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,24 @@
},
"exports": {
".": {
"import": "./lib/index.js",
"require": "./dist/cjs/index.cjs",
"types": "./lib/index.d.ts"
"import": {
"types": "./lib/index.d.ts",
"default": "./lib/index.js"
},
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
}
},
"./sync": {
"import": "./lib/sync.js",
"require": "./dist/cjs/sync.cjs",
"types": "./lib/sync.d.ts"
"import": {
"types": "./lib/sync.d.ts",
"default": "./lib/sync.js"
},
"require": {
"types": "./dist/cjs/sync.d.cts",
"default": "./dist/cjs/sync.cjs"
}
},
"./browser/esm": {
"types": "./lib/index.d.ts",
Expand Down Expand Up @@ -92,7 +102,7 @@
"scripts": {
"build": "npm run build:rollup && npm run build:ts",
"build:rollup": "npx rollup -c",
"build:ts": "cp lib/*.ts dist/cjs && cp lib/*.ts dist/esm",
"build:ts": "cp lib/index.d.ts dist/cjs/index.d.cts && cp lib/sync.d.ts dist/cjs/sync.d.cts && cp lib/*.ts dist/cjs && cp lib/*.ts dist/esm",
"lint": "npm run lint:lib && npm run lint:samples && npm run lint:test",
"lint:lib": "eslint --fix lib/*.js",
"lint:samples": "eslint --fix samples/*.js",
Expand Down