@@ -4,7 +4,6 @@ import { APPLIED_STRATEGY, Package } from '../../../utils/package';
4
4
import path from 'path' ;
5
5
import fs from 'fs' ;
6
6
import { Glob } from 'bun' ;
7
- import { getFile } from '../../../utils/json-file' ;
8
7
9
8
const PROJECT_ROOT = process . cwd ( ) ;
10
9
const TARBALL_DIR = path . join ( PROJECT_ROOT , 'tmp/tarballs' ) ;
@@ -176,9 +175,13 @@ async function convertFileToModule(fileData: string, relativePath: string, pkgNa
176
175
lines [ i ] = lines [ i ] . replace ( / ^ d e c l a r e / , '' ) . replaceAll ( ' declare ' , ' ' ) ;
177
176
const line = lines [ i ] ;
178
177
178
+ if ( line . includes ( `import(".` ) || line . includes ( `import('.` ) ) {
179
+ throw new Error ( `Unhandled Dynamic Relative Import in ${ relativePath } ` ) ;
180
+ }
181
+
179
182
if ( line . startsWith ( 'import ' ) ) {
180
183
if ( ! line . includes ( `'` ) ) {
181
- throw new Error ( `Unhandled import in ${ relativePath } ` ) ;
184
+ throw new Error ( `Unhandled Import in ${ relativePath } ` ) ;
182
185
}
183
186
if ( line . includes ( `'.` ) ) {
184
187
const importPath = line . match ( / ' ( [ ^ ' ] + ) ' / ) ! [ 1 ] ;
@@ -190,7 +193,7 @@ async function convertFileToModule(fileData: string, relativePath: string, pkgNa
190
193
// fix re-exports
191
194
else if ( line . startsWith ( 'export {' ) ) {
192
195
if ( ! line . includes ( '}' ) ) {
193
- throw new Error ( `Unhandled re -export in ${ relativePath } ` ) ;
196
+ throw new Error ( `Unhandled Re -export in ${ relativePath } ` ) ;
194
197
}
195
198
if ( line . includes ( `'.` ) ) {
196
199
const importPath = line . match ( / ' ( [ ^ ' ] + ) ' / ) ! [ 1 ] ;
@@ -202,7 +205,7 @@ async function convertFileToModule(fileData: string, relativePath: string, pkgNa
202
205
// fix * re-exports
203
206
else if ( line . startsWith ( 'export * from' ) ) {
204
207
if ( ! line . includes ( `'` ) ) {
205
- throw new Error ( `Unhandled re -export in ${ relativePath } ` ) ;
208
+ throw new Error ( `Unhandled Re -export in ${ relativePath } ` ) ;
206
209
}
207
210
if ( line . includes ( `'.` ) ) {
208
211
const importPath = line . match ( / ' ( [ ^ ' ] + ) ' / ) ! [ 1 ] ;
0 commit comments