Skip to content

Commit

Permalink
frontend: housekeeping - Updating tsconfigs for intellisense (#3045)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdslaugh authored Jul 16, 2024
1 parent 9b86dc5 commit e16326b
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 10 deletions.
1 change: 0 additions & 1 deletion frontend/api/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./src",
"rootDir": "./src"
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/core/src/AppProvider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ interface ClutchAppProps {
[key: string]: () => WorkflowConfiguration;
};
configuration: UserConfiguration;
appConfiguration: AppConfiguration;
appConfiguration?: AppConfiguration;
children?: ClutchAppChild | ClutchAppChild[];
}

Expand Down
3 changes: 2 additions & 1 deletion frontend/packages/tools/devBuild.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const tscAliasPlugin = {
name: "tscAlias",
setup(build) {
build.onEnd(() => {
replaceTscAliasPaths({ configFile: `${process.argv[2]}/tsconfig.json` });
fs.existsSync(`${process.argv[2]}/tsconfig.paths.json`) &&
replaceTscAliasPaths({ configFile: `${process.argv[2]}/tsconfig.paths.json` });
});
},
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/packages/tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"node_modules:find": "find $PROJECT_CWD -name 'node_modules' -type d -prune -print",
"node_modules:nuke": "echo \"Deleting below 'node_modules' folders...\" && npm run --silent node_modules:find | xargs du -chs && echo '' && npm run --silent node_modules:find -- -exec rm -rf '{}' \\;",
"package:clean": "cd $INIT_CWD && rm -rf dist tsconfig.tsbuildinfo",
"package:compile": "cd $INIT_CWD && run -T tsc -b && run -T tsc-alias",
"package:compile": "cd $INIT_CWD && run -T tsc -b && find $INIT_CWD -name \"tsconfig.paths.json\" -exec yarn run -T tsc-alias -p \"tsconfig.paths.json\" \\;",
"package:compile:dev": "yarn node devBuild.js $INIT_CWD",
"package:compile:watch": "yarn node devBuild.js $INIT_CWD -w",
"package:lint": "eslint --ext .js,.jsx,.ts,.tsx $INIT_CWD",
Expand Down
7 changes: 7 additions & 0 deletions frontend/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"composite": true,
"declaration": true,
"declarationMap": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"importsNotUsedAsValues": "error",
"incremental": true,
"isolatedModules": true,
"jsx": "react",
"lib": ["DOM", "ESNext"],
"module": "esnext",
"moduleResolution": "node",
"noImplicitAny": false,
"noImplicitReturns": true,
"paths": {
"@clutch-sh/*": ["api/*", "packages/*/src", "workflows/*/src"]
},
"preserveConstEnums": true,
"preserveSymlinks": true,
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": false,
"target": "ES2018",
Expand Down
6 changes: 2 additions & 4 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"outDir": "dist",
"paths": {
"@clutch-sh/*": ["api/*", "packages/*/src", "workflows/*/src"]
}
"composite": false,
"outDir": "dist"
}
}
6 changes: 4 additions & 2 deletions tools/setup-git-hooks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@ fi
GITHUB_ROOT="${SCRIPT_ROOT}/.github"
GIT_REPO_ROOT="${REPO_ROOT}/.git"

echo "Setting up git pre-commit hooks for ${REPO_ROOT}"
ln -s -f "${GITHUB_ROOT}/hooks/pre-commit" "${GIT_REPO_ROOT}/hooks/pre-commit"
if [[ -f "${GITHUB_ROOT}/hooks/pre-commit" && -f "${GIT_REPO_ROOT}/hooks/pre-commit" ]]; then
echo "Setting up git pre-commit hooks for ${REPO_ROOT}"
ln -s -f "${GITHUB_ROOT}/hooks/pre-commit" "${GIT_REPO_ROOT}/hooks/pre-commit"
fi

0 comments on commit e16326b

Please sign in to comment.