Skip to content

Commit ad77e40

Browse files
author
Matt Gallo
committed
fix: update unresolvable list
1 parent 3eef37a commit ad77e40

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

src/utils/isExternalImport.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
import ts from 'typescript';
22

3-
// TS compiler is not able to resolve the `motion` package
3+
// TS compiler is not able to resolve some packages
44
// so this is a work-around so that we can be sure to flag
55
// it as an external package that we need to install
6-
const unresolvableList = ['motion'];
6+
const unresolvableList = [
7+
'motion',
8+
'@dnd-kit/core',
9+
'@dnd-kit/sortable',
10+
'@dnd-kit/modifiers',
11+
'@dnd-kit/utilities',
12+
];
713

814
// Returns true if a given import is external
915
export const isExternalImport = (

src/utils/runPackageManagerInstall.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ export const runPackageManagerInstall = (
1212
if (typeof inlineDepList === 'string' && inlineDepList.length) {
1313
console.log('Installing dependencies from inline pattern 🪄');
1414
// Use NPM if we find a package-lock.json file, otherwise we'll default to yarn
15-
execSync(foundPackageLock ? npmInstallScript : yarnAddScript, {
16-
encoding: 'utf-8',
17-
});
18-
console.log('Inline example created, with all necessary dependencies ✅');
19-
successMessage(type);
15+
try {
16+
execSync(foundPackageLock ? npmInstallScript : yarnAddScript, {
17+
encoding: 'utf-8',
18+
});
19+
console.log('Inline example created, with all necessary dependencies ✅');
20+
successMessage(type);
21+
} catch (error) {
22+
console.log('Error installing dependencies', error);
23+
}
2024
}
2125
};

0 commit comments

Comments
 (0)