Skip to content

Commit

Permalink
fix: add ts to dep from dev dep
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewgallo committed Nov 18, 2024
1 parent 1ed8aa8 commit 2e98116
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 4 additions & 6 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ const runPrompt = async () => {
}
};

// Compiles ts so that the parse-imports package can parse the example pattern
// and know which packages will need to be installed later on
// Collects all js/ts files and checks all of their imports
// and gets only the external packages
const readExampleImports = async () => {
const fileList = await readdir(finalDestination, { recursive: true });
const allJSAndTSFiles = [];
Expand All @@ -138,10 +138,12 @@ const runPrompt = async () => {

if (allJSAndTSFiles.length > 0) {
const foundExternalPackages = [];
// Gets imports for each js/ts file
allJSAndTSFiles.forEach((filePath) => {
const fileImports = getImports(filePath);
if (fileImports.length > 0) {
fileImports.map((i) => {
// Checks if import is from an external package
if (isExternalImport(filePath, i)) {
foundExternalPackages.push(i);
}
Expand Down Expand Up @@ -210,10 +212,6 @@ const runPrompt = async () => {
}
};

const removeDuplicatesFromArr = (data, key) => [
...new Map(data.map((x) => [key(x), x])).values(),
];

const buildInlinePattern = () => {
// inline pattern generation step chosen
console.log('Building inline pattern 🛠️');
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"dependencies": {
"@inquirer/prompts": "^7.1.0",
"cli-table": "^0.3.11",
"tiged": "^2.12.7"
"tiged": "^2.12.7",
"typescript": "^5.6.3"
},
"devDependencies": {
"@commitlint/cli": "^18.0.0",
Expand All @@ -36,8 +37,7 @@
"lint-staged": "^15.0.0",
"prettier": "^3.3.3",
"rimraf": "^6.0.1",
"semantic-release": "^24.2.0",
"typescript": "^5.6.3"
"semantic-release": "^24.2.0"
},
"bin": {
"generate-pattern": "dist/index.js"
Expand Down

0 comments on commit 2e98116

Please sign in to comment.