dwyl / aws-sdk-mock

:rainbow: AWSomocks for Javascript/Node.js aws-sdk tested, documented & maintained. Contributions welcome!
Apache License 2.0
1.09k stars 107 forks source link

v6.0.0 resolved path issue #403

Closed aannoune closed 1 month ago

aannoune commented 1 month ago

Hello, thanks for the work you are doing. I'm having an issue with version 6.0.0 the main and types in you package.json is referring to the dist directory witch is dot delivered in the package: package.json:

{
  "name": "aws-sdk-mock",
  "version": "6.0.0",
  "description": "Functions to mock the JavaScript aws-sdk",
  "type": "module",
  "main": "src/index.js",
  "types": "src/index.d.ts",
  "scripts": {
    "lint": "tsc",
    "nocov": "ts-mocha test/**/*.spec.ts",
    "test": "nyc ts-mocha test/**/*.spec.ts && tsd",
    "coverage": "nyc --report html ts-mocha test/**/*.spec.ts && open coverage/index.html",
    "build": "tsup src/index.ts --format cjs, esm, --dts"
  }

package content :

aws-sdk-mock/
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── node_modules
│   ├── @sinonjs
│   └── sinon
├── package.json
├── src
│   ├── index.ts
│   └── types.ts
├── test
│   └── index.spec.ts
└── tsconfig.json

this result in a resoled path issue.

LuchoTurtle commented 1 month ago

Hey @aannounex, thanks for opening an issue 😎

I wager that fixing this problem might be as simple as just using the relative path, like index.d.ts instead of using src.

I'm travelling right now but I'll take a look at it as soon as I can. ☺️

LuchoTurtle commented 1 month ago

Following the advice from https://mikeesto.com/posts/publishing-npm-package/ and https://cameronnokes.com/blog/the-30-second-guide-to-publishing-a-typescript-package-to-npm/, I think I've found the problem. I've tested using npm pack to create a tarball to see how the files are bundled before publishing to npm and I've already committed some changes on a separate branch.

My internet here is funky and really slow, so it's hard to push branch. I'll try to get it pushed tomorrow (or whenever I have a stable internet connection NOT on my phone :P)

LuchoTurtle commented 1 month ago

@aannoune we've published 6.0.1 and it should work now. Let us know if it's working now :D

aannoune commented 1 month ago

Thanks a lot for the work done