Skip to content

Commit bb3e636

Browse files
committed
chore: move aws-sdk to devDependencies (again)
This is a second attempt at aws#425, which fixes aws#417 and was reverted by 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 can be safely moved to `devDependencies` is that all of the references to that package are actually just importing types, which means they aren't used at runtime. Here I've made that explicit by changing the `import` statements to `import type`. As long as the typechecker doesn't complain about those `import type` statements, you can feel confident that `aws-sdk` is not needed as a dependency.
1 parent 6570d12 commit bb3e636

File tree

8 files changed

+42
-8
lines changed

8 files changed

+42
-8
lines changed

package-lock.json

Lines changed: 35 additions & 1 deletion
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",
@@ -58,6 +57,7 @@
5857
"@types/node": "^22.15.17",
5958
"@types/node-forge": "^1.3.11",
6059
"assert": "^2.0.0",
60+
"aws-sdk": "^2.1692.0",
6161
"copyfiles": "^2.4.1",
6262
"husky": "^9.1.7",
6363
"json-schema-to-typescript": "^15.0.4",

runtimes/runtimes/base-runtime.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ 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'
101+
import type { Service } from 'aws-sdk'
102102
import { ServiceConfigurationOptions } from 'aws-sdk/lib/service'
103103
import { getClientInitializeParamsHandlerFactory } from './util/lspCacheUtil'
104104
import { newAgent } from './agent'

runtimes/runtimes/standalone.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ 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'
90+
import type { Service } from 'aws-sdk'
9191
import { ServiceConfigurationOptions } from 'aws-sdk/lib/service'
9292
import { getTelemetryLspServer } from './util/telemetryLspServer'
9393
import { getClientInitializeParamsHandlerFactory } from './util/lspCacheUtil'

runtimes/runtimes/util/standalone/experimentalProxyUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { readFileSync } from 'node:fs'
77
import * as tls from 'node:tls'
88
import { Agent as HttpsAgent } from 'node:https'
99
import { X509Certificate } from 'node:crypto'
10-
import { ConfigurationOptions } from 'aws-sdk'
10+
import type { ConfigurationOptions } from 'aws-sdk'
1111
import { HttpsProxyAgent } from 'hpagent'
1212
import { NodeHttpHandler } from '@smithy/node-http-handler'
1313
import { readMacosCertificates, readLinuxCertificates, readWindowsCertificates } from './certificatesReaders'

runtimes/runtimes/util/standalone/proxyUtil.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Workspace } from '../../../server-interface'
22

3-
import { ConfigurationOptions } from 'aws-sdk'
3+
import type { ConfigurationOptions } from 'aws-sdk'
44
import { HttpsProxyAgent } from 'hpagent'
55
import { NodeHttpHandler } from '@smithy/node-http-handler'
66

runtimes/server-interface/sdk-initializator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Service } from 'aws-sdk'
1+
import type { Service } from 'aws-sdk'
22
import { ServiceConfigurationOptions } from 'aws-sdk/lib/service'
33

44
// aws sdk v2 clients constructor type

runtimes/testing/TestFeatures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {
3030
InitializeParams,
3131
} from '../protocol'
3232
import { IdentityManagement } from '../server-interface/identity-management'
33-
import { Service } from 'aws-sdk'
33+
import type { Service } from 'aws-sdk'
3434
import { ServiceConfigurationOptions } from 'aws-sdk/lib/service'
3535

3636
/**

0 commit comments

Comments
 (0)