Skip to content

feat(commonjs): js-upload-api, node-api targets dist/cjs#119

Merged
lmeyerov merged 6 commits into
masterfrom
dev/upload-cjs
Mar 31, 2023
Merged

feat(commonjs): js-upload-api, node-api targets dist/cjs#119
lmeyerov merged 6 commits into
masterfrom
dev/upload-cjs

Conversation

@lmeyerov
Copy link
Copy Markdown
Contributor

@lmeyerov lmeyerov commented Mar 26, 2023

Additons

Support both cjs + esm in js-upload-api, node-api using pattern from https://www.sensedeep.com/blog/posts/2021/how-to-create-single-source-npm-module.html:

  • Stubs dist/package.json, dist/cjs/package.json as {"type": <"module" | "commonjs">}
  • package.json:
    • no "type": ..
    • instead, "exports": { ".": { "import": ..., "require": ...}}
  • tsconfig.json + tsconfig.cjs.json populate the above accordingly
  • Only use cjs deps (for now) innode-api

Also adds:

  • node-api-test-cjs to mirror node-api-test

Initially published as 4.6.0-alpha.1: https://www.npmjs.com/package/@graphistry/node-api?activeTab=versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant