chore(deps): upgrade import-from-esm
This commit is contained in:
parent
bc85211009
commit
8f7f9a71d0
3 changed files with 9 additions and 17 deletions
|
|
@ -43,7 +43,7 @@
|
|||
"@emigrate/tsconfig": "workspace:*"
|
||||
},
|
||||
"dependencies": {
|
||||
"import-from-esm": "1.2.1"
|
||||
"import-from-esm": "1.3.3"
|
||||
},
|
||||
"volta": {
|
||||
"extends": "../../package.json"
|
||||
|
|
|
|||
|
|
@ -167,17 +167,6 @@ const getOrLoad = async <T>(
|
|||
return undefined;
|
||||
};
|
||||
|
||||
const getImportFromEsm = async () => {
|
||||
const importFromEsm = await import('import-from-esm');
|
||||
|
||||
// Because of "allowSyntheticDefaultImports" we need to do this ugly hack
|
||||
if ((importFromEsm as any).default) {
|
||||
return (importFromEsm as any).default as unknown as typeof importFromEsm;
|
||||
}
|
||||
|
||||
return importFromEsm;
|
||||
};
|
||||
|
||||
const loadPlugin = async <T extends PluginType>(type: T, plugin: string): Promise<PluginFromType<T> | undefined> => {
|
||||
return load(
|
||||
plugin,
|
||||
|
|
@ -193,7 +182,7 @@ const load = async <T>(
|
|||
prefixes: string[],
|
||||
check: (value: unknown) => value is T,
|
||||
): Promise<T | undefined> => {
|
||||
const importFromEsm = await getImportFromEsm();
|
||||
const { default: importFromEsm } = await import('import-from-esm');
|
||||
|
||||
const importsToTry = name.startsWith('.') ? [name] : [...prefixes.map((prefix) => `${prefix}${name}`), name];
|
||||
|
||||
|
|
|
|||
11
pnpm-lock.yaml
generated
11
pnpm-lock.yaml
generated
|
|
@ -108,8 +108,8 @@ importers:
|
|||
packages/plugin-tools:
|
||||
dependencies:
|
||||
import-from-esm:
|
||||
specifier: 1.2.1
|
||||
version: 1.2.1
|
||||
specifier: 1.3.3
|
||||
version: 1.3.3
|
||||
devDependencies:
|
||||
'@emigrate/tsconfig':
|
||||
specifier: workspace:*
|
||||
|
|
@ -3215,11 +3215,14 @@ packages:
|
|||
resolve-from: 4.0.0
|
||||
dev: false
|
||||
|
||||
/import-from-esm@1.2.1:
|
||||
resolution: {integrity: sha512-Nly5Ab75rWZmOwtMa0B0NQNnHGcHOQ2zkU/bVENwK2lbPq+kamPDqNKNJ0hF7w7lR/ETD5nGgJq0XbofsZpYCA==}
|
||||
/import-from-esm@1.3.3:
|
||||
resolution: {integrity: sha512-U3Qt/CyfFpTUv6LOP2jRTLYjphH6zg3okMfHbyqRa/W2w6hr8OsJWVggNlR4jxuojQy81TgTJTxgSkyoteRGMQ==}
|
||||
engines: {node: '>=16.20'}
|
||||
dependencies:
|
||||
debug: 4.3.4
|
||||
import-meta-resolve: 4.0.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/import-meta-resolve@4.0.0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue