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");
110110 ) ;
111111 }
112112 }
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+ }
113126 }
114127} ) ( ) . then ( ( ) => {
115128 if ( errors . length ) {
Original file line number Diff line number Diff line change 1- import { resolvedPath } from "@smithy/core/protocols" ;
21import { HttpRequest } from "@smithy/protocol-http" ;
32import type { SerdeContext } from "@smithy/types" ;
43
4+ import { resolvedPath } from "./resolve-path" ;
5+
56/**
67 * @internal
78 * used in code-generated serde.
You can’t perform that action at this time.
0 commit comments