herumi / mcl-wasm

59 stars 18 forks source link

index.d.ts isn't published with npm module #21

Closed davidmurdoch closed 3 years ago

davidmurdoch commented 3 years ago

Also, looking at the packaged npm module, I think many files are included that shouldn't be (tests, demos, others).

herumi commented 3 years ago

Thank you for the advice.

Is this okay?

"files": [
  "package-lock.json",
  "package.json",
  "src/index.js",
  "src/mcl.js",
  "src/mcl_c.js",
  "src/index.d.ts",
  "browser/mcl.js",
  "browser/package-lock.json",
  "browser/package.json",
  "browser/src/index-browser.js",
],
davidmurdoch commented 3 years ago

@herumi package-lock.json is ignored by npm*, and the browser/package.json doesn't seem necessary unless index-browser.js reads that file for some reason.

One key detail about package-lock.json is that it cannot be published, and it will be ignored if found in any place other than the toplevel package.

from https://docs.npmjs.com/cli/v6/configuring-npm/package-lock-json

You probably need to add "types": "src/index.d.ts" to your root package.json as well.

herumi commented 3 years ago

Thank you. browser/package.json is for React on browser because src/index.js does not go on it.

herumi commented 3 years ago

I've updated package.json.