Skip to content

Commit

Permalink
Fix types and tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyFeliz committed Jun 11, 2024
1 parent 9d22d35 commit 3b1fb34
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"build-only": "vite build",
"generate-types": "vue-tsc --declaration --emitDeclarationOnly src/vue-tweet.vue --outDir dist",
"generate-types": "vue-tsc --declaration --emitDeclarationOnly src/vue-tweet.vue --declarationDir dist",
"type-check": "vue-tsc --build --force",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"generate-tag": "np --no-2fa --no-tests --no-publish",
"publish-package": "npm run build && npm run generate-types && npm run generate-tag && npm publish --access public",
"publish-package": "npm run type-check && npm run build && npm run generate-types && npm run generate-tag && npm publish --access public",
"prepare": "husky install"
},
"dependencies": {
Expand Down
7 changes: 7 additions & 0 deletions src/vue-tweet.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ function renderTweet(): void {
// Clear previously rendered tweet before rendering the updated tweet id
if (tweetContainerRef.value) {
tweetContainerRef.value.innerHTML = "";
} else {
console.error("tweetContainerRef is null");
return;
}
const { tweetId, tweetOptions } = getTweetParams();
Expand All @@ -235,6 +238,10 @@ function renderTweet(): void {
.finally(() => {
isLoading.value = false;
});
}).catch((error: Error) => {
console.error("Error loading Twitter widget:", error);
hasError.value = true;
isLoading.value = false;
});
}
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
"exclude": ["src/**/__tests__/*"],
"compilerOptions": {
"composite": true,
"declaration": true,
"emitDeclarationOnly": true,
"declarationDir": "./dist",
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"noImplicitAny": false,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
}

0 comments on commit 3b1fb34

Please sign in to comment.