-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* chore: add gitignore and package jsons for website (4) * feat: set up minimal website (#4) * chore: remove unnecessary commitlint dependency (#4) * chore: add commit message checks (#4) * chore: add pre-commit checks (#4) * chore: add github action to run checks on pull request (#4) * feat: set up minimal catalog (#4) * chore: update precommit hook to check both apps (#4) * chore: update github action to check both apps (#4) * fix: add blank favicons (#4) * chore: use latest version of findable ui (#4) * Fix PUBLIC_DIR creation when run in a new repo -- public won't exist and we need to create /public/ as well as /public/favicons/ --------- Co-authored-by: Dannon Baker <[email protected]>
- Loading branch information
Showing
74 changed files
with
33,812 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Run checks | ||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: "20.10.0" | ||
- run: | | ||
cd ./website | ||
npm ci | ||
npm run check-format | ||
npm run lint | ||
npx tsc --noEmit | ||
cd ../data-catalog | ||
npm ci | ||
npm run check-format | ||
npm run lint | ||
npx tsc --noEmit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# dependencies | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
echo "Checking commit message" | ||
|
||
# Check for issue number | ||
|
||
commit_regex='#[0-9]' | ||
error_msg="Aborting commit. Your commit message is missing a '#xxx' reference to a corresponding GitHub issue. Add '--no-verify' to your git commit command if you wish to skip this check." | ||
|
||
if ! grep -iqE "$commit_regex" "$1"; then | ||
echo "$error_msg" >&2 | ||
exit 1 | ||
fi | ||
|
||
# Check for Conventional Commits format | ||
|
||
npx commitlint --config ./commitlint.config.js --edit $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
echo '🏗️👷 Checking your project before committing' | ||
|
||
for app in "website" "data-catalog" | ||
do | ||
echo "\nChecking $app" | ||
|
||
cd "./$app" | ||
|
||
# Check Prettier | ||
npm run check-format || | ||
( | ||
echo '🤔 Prettier Check Failed. Run npx prettier --write . try commit again.'; | ||
false; | ||
) | ||
|
||
# Check ESLint | ||
npm run lint || | ||
( | ||
echo '🤔 ESLint Check Failed. Make the required changes listed above, add changes and try to commit again.' | ||
false; | ||
) | ||
|
||
# Check TypeScript | ||
npx tsc --noEmit || | ||
( | ||
echo 'TypeScript compile failed'; | ||
false; | ||
) | ||
echo 'TypeScript compile succeeded!' | ||
|
||
cd .. | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { extends: ["@commitlint/config-conventional"] }; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
**/node_modules/* | ||
**/.next/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"sonarjs", | ||
"jsdoc", | ||
"sort-destructure-keys", | ||
"typescript-sort-keys", | ||
"react-hooks" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier", | ||
"plugin:prettier/recommended", | ||
"next", | ||
"plugin:sonarjs/recommended", | ||
"plugin:eslint-comments/recommended" | ||
], | ||
"rules": { | ||
"sort-keys": [ | ||
"error", | ||
"asc", | ||
{ | ||
"caseSensitive": true, | ||
"minKeys": 2, | ||
"natural": false | ||
} | ||
], | ||
"sort-destructure-keys/sort-destructure-keys": [ | ||
"error", | ||
{ | ||
"caseSensitive": false | ||
} | ||
], | ||
"typescript-sort-keys/interface": [ | ||
"error", | ||
"asc", | ||
{ | ||
"caseSensitive": false | ||
} | ||
], | ||
"typescript-sort-keys/string-enum": [ | ||
"error", | ||
"asc", | ||
{ | ||
"caseSensitive": false | ||
} | ||
], | ||
"eslint-comments/require-description": "error", | ||
"jsdoc/require-description": "error", | ||
"jsdoc/require-param": "error", | ||
"jsdoc/require-param-name": "error", | ||
"jsdoc/require-param-description": "error", | ||
"jsdoc/require-hyphen-before-param-description": "error", | ||
"jsdoc/require-returns": "error", | ||
"jsdoc/require-returns-description": "error", | ||
"jsdoc/check-alignment": "error", | ||
"jsdoc/check-param-names": "error", | ||
"react-hooks/exhaustive-deps": "error" | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": "**", | ||
"excludedFiles": "*.styles.ts?(x)", | ||
"rules": { | ||
"@typescript-eslint/explicit-function-return-type": "error" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# dependencies | ||
/node_modules | ||
|
||
# next.js | ||
/.next/ | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
|
||
# env files | ||
/.env*.local | ||
/.env.development | ||
/.env.production | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
|
||
# editors | ||
/.vscode | ||
.idea | ||
|
||
# nvm | ||
.nvmrc | ||
|
||
# favicons | ||
/public/favicons/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# next.js | ||
.next | ||
|
||
# dependencies | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
3 changes: 3 additions & 0 deletions
3
data-catalog/app/apis/catalog/brc-analytics-catalog/common/entities.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export interface BRCDataCatalogGenome { | ||
species: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { BasicCell } from "@databiosphere/findable-ui/lib/components/Table/components/TableCell/components/BasicCell/basicCell"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { setConfig } from "@databiosphere/findable-ui/lib/config/config"; | ||
import { SiteConfig } from "@databiosphere/findable-ui/lib/config/entities"; | ||
import brcAnalyticsCatalogLocal from "../../site-config/brc-analytics-catalog/local/config"; | ||
const CONFIGS: { [k: string]: SiteConfig } = { | ||
"brc-analytics-catalog-local": brcAnalyticsCatalogLocal, | ||
}; | ||
|
||
let appConfig: SiteConfig | null = null; | ||
|
||
export const config = (): SiteConfig => { | ||
if (appConfig) { | ||
return appConfig; | ||
} | ||
|
||
const config = process.env.NEXT_PUBLIC_SITE_CONFIG; | ||
|
||
if (!config) { | ||
console.error(`Config not found. config: ${config}`); | ||
} | ||
|
||
appConfig = CONFIGS[config as string]; | ||
|
||
if (!appConfig) { | ||
console.error(`No app config was found for the config: ${config}`); | ||
} else { | ||
console.log(`Using app config ${config}`); | ||
} | ||
|
||
setConfig(appConfig); // Sets app config. | ||
return appConfig; | ||
}; |
15 changes: 15 additions & 0 deletions
15
data-catalog/app/viewModelBuilders/catalog/brc-analytics-catalog/common/viewModelBuilders.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { BRCDataCatalogGenome } from "../../../../apis/catalog/brc-analytics-catalog/common/entities"; | ||
import * as C from "../../../../components/index"; | ||
|
||
/** | ||
* Build props for the species cell. | ||
* @param genome - Genome entity. | ||
* @returns Props to be used for the cell. | ||
*/ | ||
export const buildSpecies = ( | ||
genome: BRCDataCatalogGenome | ||
): React.ComponentProps<typeof C.BasicCell> => { | ||
return { | ||
value: genome.species, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[{ "species": "Foo bar" }] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
/// <reference types="next/navigation-types/compat/navigation" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
import nextMDX from "@next/mdx"; | ||
import withPlugins from "next-compose-plugins"; | ||
import path from "path"; | ||
|
||
const ESM_PACKAGES = [ | ||
"axios", | ||
"@databiosphere/findable-ui", | ||
"@tanstack/react-table", | ||
]; | ||
|
||
const withMDX = nextMDX({ | ||
extension: /\.mdx?$/, | ||
}); | ||
export default withPlugins( | ||
[[withMDX, { pageExtensions: ["md", "mdx", "ts", "tsx"] }]], | ||
{ | ||
basePath: "", | ||
experimental: { | ||
instrumentationHook: true, | ||
}, | ||
images: { | ||
unoptimized: true, | ||
}, | ||
reactStrictMode: true, | ||
transpilePackages: [...ESM_PACKAGES], | ||
webpack: (config) => { | ||
// Add the alias for the peer dependency | ||
config.resolve.alias["@emotion/react"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/@emotion/react" | ||
); | ||
config.resolve.alias["@emotion/styled"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/@emotion/styled" | ||
); | ||
config.resolve.alias["@mui/icons-material"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/@mui/icons-material" | ||
); | ||
config.resolve.alias["@mui/material"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/@mui/material" | ||
); | ||
config.resolve.alias["react-dropzone"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/react-dropzone" | ||
); | ||
config.resolve.alias["isomorphic-dompurify"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/isomorphic-dompurify" | ||
); | ||
config.resolve.alias["next"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/next" | ||
); | ||
config.resolve.alias["react"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/react" | ||
); | ||
config.resolve.alias["react-dom"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/react-dom" | ||
); | ||
config.resolve.alias["react-gtm-module"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/react-gtm-module" | ||
); | ||
config.resolve.alias["react-window"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/react-window" | ||
); | ||
config.resolve.alias["uuid"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/uuid" | ||
); | ||
config.resolve.alias["validate.js"] = path.resolve( | ||
process.cwd(), | ||
"node_modules/validate.js" | ||
); | ||
return config; | ||
}, | ||
} | ||
); |
Oops, something went wrong.