File tree Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Expand file tree Collapse file tree 3 files changed +20
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @smithy/core " : patch
3
+ ---
4
+
5
+ avoid self referencing submodule import
Original file line number Diff line number Diff line change @@ -110,6 +110,19 @@ const walk = require("../../../scripts/utils/walk");
110
110
) ;
111
111
}
112
112
}
113
+
114
+ const subModuleImports = [
115
+ ...new Set (
116
+ ( sourceCode . toString ( ) . match ( / ( f r o m | i m p o r t \( ) " \@ s m i t h y \/ c o r e \/ ( .* ?) " ; / g) || [ ] ) . map (
117
+ ( _ ) => _ . match ( / @ s m i t h y \/ c o r e \/ ( .* ?) " / ) [ 1 ]
118
+ )
119
+ ) ,
120
+ ] ;
121
+ const ownModule = item . match ( / s r c \/ s u b m o d u l e s \/ ( .* ?) \/ / ) ?. [ 1 ] ;
122
+
123
+ if ( subModuleImports . includes ( ownModule ) ) {
124
+ errors . push ( `self-referencing submodule import found in ${ item } ` ) ;
125
+ }
113
126
}
114
127
} ) ( ) . then ( ( ) => {
115
128
if ( errors . length ) {
Original file line number Diff line number Diff line change 1
- import { resolvedPath } from "@smithy/core/protocols" ;
2
1
import { HttpRequest } from "@smithy/protocol-http" ;
3
2
import type { SerdeContext } from "@smithy/types" ;
4
3
4
+ import { resolvedPath } from "./resolve-path" ;
5
+
5
6
/**
6
7
* @internal
7
8
* used in code-generated serde.
You can’t perform that action at this time.
0 commit comments