Skip to content

Commit f274899

Browse files
authored
chore: use isolatedModules for types (#8164)
1 parent e5f383c commit f274899

99 files changed

Lines changed: 572 additions & 323 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
// Uses the recommended rules from the @typescript-eslint/eslint-plugin
99
"plugin:@typescript-eslint/recommended",
1010
],
11-
plugins: ["@typescript-eslint", "simple-import-sort", "eslint-plugin-sort-export-all", "eslint-plugin-tsdoc", "n"],
11+
plugins: ["@typescript-eslint", "simple-import-sort", "eslint-plugin-tsdoc", "n"],
1212
rules: {
1313
/** Turn off strict enforcement */
1414
"@typescript-eslint/ban-types": "off",
@@ -27,7 +27,6 @@ module.exports = {
2727

2828
/** Errors */
2929
"simple-import-sort/imports": "error",
30-
"sort-export-all/sort-export-all": "error",
3130
"@typescript-eslint/consistent-type-imports": "error",
3231
"n/prefer-node-protocol": "error",
3332
},
@@ -50,6 +49,13 @@ module.exports = {
5049
"private/*/src/**/*.ts",
5150
],
5251
rules: {
52+
"no-restricted-syntax": [
53+
"error",
54+
{
55+
selector: "ExportAllDeclaration",
56+
message: "Use explicit named exports (export { X } or export type { X }) instead of 'export *'.",
57+
},
58+
],
5359
"no-restricted-imports": [
5460
"error",
5561
{
@@ -191,5 +197,15 @@ module.exports = {
191197
"n/prefer-node-protocol": "error",
192198
},
193199
},
200+
{
201+
files: [
202+
"packages-internal/nested-clients/src/submodules/**/index.ts",
203+
"packages-internal/nested-clients/src/submodules/**/commands/index.ts",
204+
"clients/*/src/**/*.ts",
205+
],
206+
rules: {
207+
"no-restricted-syntax": "off",
208+
},
209+
},
194210
],
195211
};

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This is the public Makefile containing some build commands.
22
# You can implement some additional personal commands such as login and sync in Makefile.private.mk (unversioned).
33

4-
.PHONY: login sync bundles test-unit test-types test-indices test-protocols test-schema test-integration test-endpoints test-e2e build-s3-browser-bundle build-signature-v4-multi-region-browser-bundle clean-nested link-smithy unlink-smithy copy-smithy gen-auth b-auth tpk unbuilt turbo-clean server-protocols nested-clients clients static-analysis
4+
.PHONY: login sync bundles test-unit test-types test-indices test-protocols test-schema test-integration test-endpoints test-e2e build build-s3-browser-bundle build-signature-v4-multi-region-browser-bundle clean-nested link-smithy unlink-smithy copy-smithy gen-auth b-auth tpk unbuilt turbo-clean server-protocols nested-clients clients static-analysis
55

66
# fetch AWS testing credentials
77
login:
@@ -103,6 +103,9 @@ test-bundlers:
103103
node ./tests/bundlers/bundler-canary.mjs
104104
(cd ./tests/bundler-compat && npm install && node ./run.mjs)
105105

106+
build:
107+
yarn build;
108+
106109
build-s3-browser-bundle:
107110
node ./clients/client-s3/test/browser-build/esbuild
108111

lib/lib-dynamodb/tsconfig.types.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"rootDir": "src",
66
"paths": {
77
"@smithy/core/*": ["../../node_modules/@smithy/core/dist-types/submodules/*/index.d.ts"]
8-
}
8+
},
9+
"isolatedModules": false
910
},
1011
"extends": "../../tsconfig.types.json",
1112
"include": ["src/"]

lib/lib-storage/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
export * from "./Upload";
2-
export * from "./types";
1+
export { Upload } from "./Upload";
2+
export type { RawDataPart } from "./Upload";
3+
export type { Progress, BodyDataTypes, ServiceClients, Configuration, Options } from "./types";

packages-internal/core/src/api-extractor-type-index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-restricted-syntax */
12
export * from "./submodules/account-id-endpoint/index";
23
export * from "./submodules/client/index";
34
export * from "./submodules/httpAuthSchemes/index";
Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1-
export * from "./AccountIdEndpointModeConfigResolver";
2-
export * from "./AccountIdEndpointModeConstants";
3-
export * from "./NodeAccountIdEndpointModeConfigOptions";
1+
export { resolveAccountIdEndpointModeConfig } from "./AccountIdEndpointModeConfigResolver";
2+
export type {
3+
AccountIdEndpointModeInputConfig,
4+
AccountIdEndpointModeResolvedConfig,
5+
} from "./AccountIdEndpointModeConfigResolver";
6+
export {
7+
DEFAULT_ACCOUNT_ID_ENDPOINT_MODE,
8+
ACCOUNT_ID_ENDPOINT_MODE_VALUES,
9+
validateAccountIdEndpointMode,
10+
} from "./AccountIdEndpointModeConstants";
11+
export type { AccountIdEndpointMode } from "./AccountIdEndpointModeConstants";
12+
export {
13+
ENV_ACCOUNT_ID_ENDPOINT_MODE,
14+
CONFIG_ACCOUNT_ID_ENDPOINT_MODE,
15+
NODE_ACCOUNT_ID_ENDPOINT_MODE_CONFIG_OPTIONS,
16+
} from "./NodeAccountIdEndpointModeConfigOptions";

packages-internal/core/src/submodules/client/index.browser.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ export {
6565
} from "./util-endpoints/lib/aws/partition";
6666
export type { PartitionsInfo } from "./util-endpoints/lib/aws/partition";
6767
export { EndpointError } from "./util-endpoints/types/EndpointError";
68-
export {
68+
export type {
6969
EndpointObjectProperties,
7070
EndpointObjectHeaders,
7171
EndpointObject,
7272
EndpointRuleObject,
7373
} from "./util-endpoints/types/EndpointRuleObject";
74-
export { ErrorRuleObject } from "./util-endpoints/types/ErrorRuleObject";
75-
export { RuleSetRules, TreeRuleObject } from "./util-endpoints/types/TreeRuleObject";
76-
export { DeprecatedObject, ParameterObject, RuleSetObject } from "./util-endpoints/types/RuleSetObject";
77-
export {
74+
export type { ErrorRuleObject } from "./util-endpoints/types/ErrorRuleObject";
75+
export type { RuleSetRules, TreeRuleObject } from "./util-endpoints/types/TreeRuleObject";
76+
export type { DeprecatedObject, ParameterObject, RuleSetObject } from "./util-endpoints/types/RuleSetObject";
77+
export type {
7878
ReferenceObject,
7979
FunctionObject,
8080
FunctionArgv,

packages-internal/core/src/submodules/client/index.native.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,16 @@ export {
6666
} from "./util-endpoints/lib/aws/partition";
6767
export type { PartitionsInfo } from "./util-endpoints/lib/aws/partition";
6868
export { EndpointError } from "./util-endpoints/types/EndpointError";
69-
export {
69+
export type {
7070
EndpointObjectProperties,
7171
EndpointObjectHeaders,
7272
EndpointObject,
7373
EndpointRuleObject,
7474
} from "./util-endpoints/types/EndpointRuleObject";
75-
export { ErrorRuleObject } from "./util-endpoints/types/ErrorRuleObject";
76-
export { RuleSetRules, TreeRuleObject } from "./util-endpoints/types/TreeRuleObject";
77-
export { DeprecatedObject, ParameterObject, RuleSetObject } from "./util-endpoints/types/RuleSetObject";
78-
export {
75+
export type { ErrorRuleObject } from "./util-endpoints/types/ErrorRuleObject";
76+
export type { RuleSetRules, TreeRuleObject } from "./util-endpoints/types/TreeRuleObject";
77+
export type { DeprecatedObject, ParameterObject, RuleSetObject } from "./util-endpoints/types/RuleSetObject";
78+
export type {
7979
ReferenceObject,
8080
FunctionObject,
8181
FunctionArgv,

packages-internal/core/src/submodules/client/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,16 @@ export {
6969
export type { PartitionsInfo } from "./util-endpoints/lib/aws/partition";
7070
// util-endpoints types (re-exports from @smithy/core/endpoints)
7171
export { EndpointError } from "./util-endpoints/types/EndpointError";
72-
export {
72+
export type {
7373
EndpointObjectProperties,
7474
EndpointObjectHeaders,
7575
EndpointObject,
7676
EndpointRuleObject,
7777
} from "./util-endpoints/types/EndpointRuleObject";
78-
export { ErrorRuleObject } from "./util-endpoints/types/ErrorRuleObject";
79-
export { RuleSetRules, TreeRuleObject } from "./util-endpoints/types/TreeRuleObject";
80-
export { DeprecatedObject, ParameterObject, RuleSetObject } from "./util-endpoints/types/RuleSetObject";
81-
export {
78+
export type { ErrorRuleObject } from "./util-endpoints/types/ErrorRuleObject";
79+
export type { RuleSetRules, TreeRuleObject } from "./util-endpoints/types/TreeRuleObject";
80+
export type { DeprecatedObject, ParameterObject, RuleSetObject } from "./util-endpoints/types/RuleSetObject";
81+
export type {
8282
ReferenceObject,
8383
FunctionObject,
8484
FunctionArgv,

packages-internal/core/src/submodules/client/util-endpoints/types/EndpointRuleObject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export {
1+
export type {
22
EndpointObjectProperties,
33
EndpointObjectHeaders,
44
EndpointObject,

0 commit comments

Comments
 (0)