Skip to content

Commit 8c86ba4

Browse files
committed
chore: replace aws-sdk with @types/aws-sdk2-types
This is a second attempt at fixing aws#417. The first attempt was aws#425, which simply moved `aws-sdk` from `dependencies` to `devDependencies`. That change was reverted by aws#535. The reason for the revert was this claim from @suprajaven: > The package is currently not declaring a dependency but it is actually > using aws-sdk. The overall impact is not noted because when used in > conjunction with language servers package ( which has this dependency > present) the overall build is not broken. I believe this is a misunderstanding: The reason the dependency could be safely moved to `devDependencies` is that all of the references to that package were actually just importing types, which means they weren't used at runtime. Here I've gone a step further and replaced the `aws-sdk` dependency with `@types/aws-sdk2-types`. These types were pulled directly from `aws-sdk@2`, so they should match: DefinitelyTyped/DefinitelyTyped#64111 This change ensures that `aws-sdk` won't be used at runtime. As a bonus, it makes this repo's `node_modules` nearly 100MB lighter, which should speed up builds and other development processes.
1 parent 6570d12 commit 8c86ba4

File tree

8 files changed

+44
-108
lines changed

8 files changed

+44
-108
lines changed

package-lock.json

Lines changed: 33 additions & 97 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runtimes/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
"@opentelemetry/sdk-metrics": "^2.0.1",
4242
"@smithy/node-http-handler": "^4.0.4",
4343
"ajv": "^8.17.1",
44-
"aws-sdk": "^2.1692.0",
4544
"hpagent": "^1.2.0",
4645
"jose": "^5.9.6",
4746
"mac-ca": "^3.1.1",
@@ -53,6 +52,7 @@
5352
"registry-js": "^1.16.1"
5453
},
5554
"devDependencies": {
55+
"@types/aws-sdk2-types": "^0.0.5",
5656
"@types/mocha": "^10.0.9",
5757
"@types/mock-fs": "^4.13.4",
5858
"@types/node": "^22.15.17",

runtimes/runtimes/base-runtime.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ import {
9898
import { IdentityManagement } from '../server-interface/identity-management'
9999
import { WebBase64Encoding } from './encoding'
100100
import { LoggingServer } from './lsp/router/loggingServer'
101-
import { Service } from 'aws-sdk'
102-
import { ServiceConfigurationOptions } from 'aws-sdk/lib/service'
101+
import { Service } from 'aws-sdk2-types'
102+
import { ServiceConfigurationOptions } from 'aws-sdk2-types/lib/service'
103103
import { getClientInitializeParamsHandlerFactory } from './util/lspCacheUtil'
104104
import { newAgent } from './agent'
105105
import { ShowSaveFileDialogRequestType, CheckDiagnosticsRequestType } from '../protocol/window'

runtimes/runtimes/standalone.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ import { getServerDataDirPath } from './util/serverDataDirPath'
8787
import { ProxyConfigManager } from './util/standalone/experimentalProxyUtil'
8888
import { Encoding } from './encoding'
8989
import { LoggingServer } from './lsp/router/loggingServer'
90-
import { Service } from 'aws-sdk'
91-
import { ServiceConfigurationOptions } from 'aws-sdk/lib/service'
90+
import { Service } from 'aws-sdk2-types'
91+
import { ServiceConfigurationOptions } from 'aws-sdk2-types/lib/service'
9292
import { getTelemetryLspServer } from './util/telemetryLspServer'
9393
import { getClientInitializeParamsHandlerFactory } from './util/lspCacheUtil'
9494
import { makeProxyConfigv2Standalone, makeProxyConfigv3Standalone } from './util/standalone/proxyUtil'

0 commit comments

Comments
 (0)