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

npm package is published in typescript #1436

Closed
eltonio450 opened this issue Aug 11, 2020 · 4 comments
Closed

npm package is published in typescript #1436

eltonio450 opened this issue Aug 11, 2020 · 4 comments

Comments

@eltonio450
Copy link

Describe the bug
npm package is published in typescript (at least s3 client)

SDK version number

1.0.0.gamma-5

Is the issue in the browser/Node.js/ReactNative?
npm

Expected behavior
npm published package should be in javascript + types

Additional context
client-S3 imported from node_modules must be transpiled with a loader such as ts-loader. It's ok from es6 to es5, but it's very uncommon from typescript to es5

I don't know if it is a bug or not, but I feel that publishing directly in typescript is not suitable for a lot of people

@justingrant
Copy link
Contributor

The entry points for AWS SDK client packages are in each client package's ./dist folder, which has no TS code, only JS. For example, here's the entry points from the S3 client package:

"main": "./dist/cjs/index.js",
"types": "./types/index.d.ts",
"module": "./dist/es/index.js",

The TS code that you're seeing is the original TS source, which is important for sourcemap-enabled debugging because the sourcemap files point to the original source files so that IDE debuggers (and browser devtools) can allow developers to view, step into, and set breakpoints in the original source. But when you bundle this package into your app, only the JS files will be included.

Yes, this is definitely confusing. IMHO, the AWS SDK should put its source files into a /src folder, not in the root folder where they are mixed with config files. But this weirdness shouldn't break your app's compilation.

@justingrant
Copy link
Contributor

BTW, you're not the only one confused by this. See #1306. I'd suggest that you close this issue in favor of #1306.

@eltonio450
Copy link
Author

sure!

thanks for the answer, I missed the dist folder!

for the record, I was confused because after installing the sdk, my es5 check did not pass anymore, and when digging, I fall on the typescript files. I think I won't be the only one to have this problem 🤗

have a good week

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants