Skip to content

Commit

Permalink
Showcase: support text search (#2447)
Browse files Browse the repository at this point in the history
* fix eslint not working properly with IDE

* showcase: support text-search in showcase registry server

* bump dependencies

* showcase: make search async server operation

* showcase: support text-search

* bump dependencies

* showcase: allow going to line from code search
  • Loading branch information
akphi authored Jul 23, 2023
1 parent 0e9e916 commit 6668fef
Show file tree
Hide file tree
Showing 42 changed files with 1,153 additions and 174 deletions.
27 changes: 27 additions & 0 deletions .changeset/quick-cobras-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
'@finos/legend-extension-store-service-store': patch
'@finos/legend-application-studio-bootstrap': patch
'@finos/legend-application-query-bootstrap': patch
'@finos/legend-extension-store-relational': patch
'@finos/legend-server-showcase-deployment': patch
'@finos/legend-extension-dsl-persistence': patch
'@finos/legend-extension-store-flat-data': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-extension-dsl-mastery': patch
'@finos/legend-extension-dsl-service': patch
'@finos/legend-application-pure-ide': patch
'@finos/legend-extension-assortment': patch
'@finos/legend-application-studio': patch
'@finos/legend-extension-dsl-text': patch
'@finos/legend-application-query': patch
'@finos/legend-server-showcase': patch
'@finos/legend-query-builder': patch
'@finos/legend-application': patch
'@finos/legend-dev-utils': patch
'@finos/stylelint-config-legend-studio': patch
'@finos/eslint-plugin-legend-studio': patch
'@finos/legend-shared': patch
'@finos/legend-lego': patch
'@finos/legend-art': patch
---
24 changes: 24 additions & 0 deletions .changeset/quick-turkeys-join.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
'@finos/legend-extension-store-service-store': patch
'@finos/legend-application-studio-bootstrap': patch
'@finos/legend-application-query-bootstrap': patch
'@finos/legend-extension-store-relational': patch
'@finos/legend-extension-dsl-persistence': patch
'@finos/legend-extension-store-flat-data': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-extension-dsl-mastery': patch
'@finos/legend-extension-dsl-service': patch
'@finos/legend-application-pure-ide': patch
'@finos/legend-extension-assortment': patch
'@finos/legend-application-studio': patch
'@finos/legend-extension-dsl-text': patch
'@finos/legend-application-query': patch
'@finos/legend-query-builder': patch
'@finos/legend-application': patch
'@finos/legend-dev-utils': patch
'@finos/stylelint-config-legend-studio': patch
'@finos/eslint-plugin-legend-studio': patch
'@finos/legend-lego': patch
'@finos/legend-art': patch
---
26 changes: 26 additions & 0 deletions .changeset/twenty-kiwis-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
'@finos/legend-extension-store-service-store': patch
'@finos/legend-application-studio-bootstrap': patch
'@finos/legend-application-query-bootstrap': patch
'@finos/legend-extension-store-relational': patch
'@finos/legend-server-showcase-deployment': patch
'@finos/legend-extension-dsl-persistence': patch
'@finos/legend-extension-store-flat-data': patch
'@finos/legend-extension-dsl-data-space': patch
'@finos/legend-extension-dsl-diagram': patch
'@finos/legend-extension-dsl-mastery': patch
'@finos/legend-extension-dsl-service': patch
'@finos/legend-application-pure-ide': patch
'@finos/legend-extension-assortment': patch
'@finos/legend-application-studio': patch
'@finos/legend-extension-dsl-text': patch
'@finos/legend-application-query': patch
'@finos/legend-query-builder': patch
'@finos/legend-application': patch
'@finos/legend-dev-utils': patch
'@finos/stylelint-config-legend-studio': patch
'@finos/eslint-plugin-legend-studio': patch
'@finos/legend-shared': patch
'@finos/legend-lego': patch
'@finos/legend-art': patch
---
21 changes: 10 additions & 11 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,11 @@ const ERROR = 2;
* - For `production` mode (to produce bundled code): ENABLE
* - For `linting` process (to check code quality in CI): ENABLE
*/
const enableFastMode =
process.env.NODE_ENV === undefined || // IDE ESLint process runs without setting a NODE environment
process.env.NODE_ENV === 'development';
const isSingleRun = process.env.NODE_ENV !== undefined;
const isIDE = process.env.NODE_ENV === undefined;

// For debugging
// console.log(`Environment: ${process.env.NODE_ENV}`);
// console.log(`Single Run Mode: ${isSingleRun}`);
// console.log(`IDE (mode): ${isIDE}`);

/**
* NOTE: this config is supposed to be used for both the IDE ESLint process
Expand All @@ -45,14 +42,16 @@ const isSingleRun = process.env.NODE_ENV !== undefined;
*
* See https://github.com/typescript-eslint/typescript-eslint/issues/1192
*/

module.exports = {
root: true, // tell ESLint to stop looking further up in directory tree to resolve for parent configs
parserOptions: {
sourceType: 'module',
// `parserOptions.project` is required for generating parser service to run specific rules like
// `prefer-nullish-coalescing`, and `prefer-optional-chain`
project: ['./packages/*/tsconfig.json', './fixtures/*/tsconfig.json'],
project: !isIDE
? ['./packages/*/tsconfig.json', './fixtures/*/tsconfig.json']
: // this is required for VSCode ESLint extension to work properly
true,
tsconfigRootDir: !isIDE ? undefined : __dirname,
/**
* ESLint (and therefore typescript-eslint) is used in both "single run"/one-time contexts,
* such as an ESLint CLI invocation, and long-running sessions (such as continuous feedback
Expand All @@ -65,7 +64,7 @@ module.exports = {
* When allowAutomaticSingleRunInference is enabled, we will use common heuristics to infer
* whether or not ESLint is being used as part of a single run.
*/
allowAutomaticSingleRunInference: isSingleRun,
allowAutomaticSingleRunInference: !isIDE,
// Use this experimental flag to improve memory usage while using Typescript project reference
// NOTE: Causes TS to use the source files for referenced projects instead of the compiled .d.ts files.
// This feature is not yet optimized, and is likely to cause OOMs for medium to large projects.
Expand All @@ -75,11 +74,11 @@ module.exports = {
plugins: ['@finos/legend-studio'],
extends: [
'plugin:@finos/legend-studio/recommended',
!enableFastMode && 'plugin:@finos/legend-studio/computationally-expensive',
!isIDE && 'plugin:@finos/legend-studio/computationally-expensive',
'plugin:@finos/legend-studio/scripts-override', // must be called last to turn off rules which are not applicable for scripts
].filter(Boolean),
rules: {
// turn off the prettier format check when running this in CI (i.e. production environment) to speed up pipeline
'prettier/prettier': process.env.NODE_ENV === 'production' ? OFF : ERROR,
'prettier/prettier': !isIDE ? OFF : ERROR,
},
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"@finos/eslint-plugin-legend-studio": "workspace:*",
"@finos/legend-dev-utils": "workspace:*",
"@finos/stylelint-config-legend-studio": "workspace:*",
"@types/node": "20.4.2",
"@types/node": "20.4.4",
"chalk": "5.3.0",
"cross-env": "7.0.3",
"envinfo": "7.10.0",
Expand All @@ -109,7 +109,7 @@
"npm-run-all": "4.1.5",
"prettier": "3.0.0",
"rimraf": "5.0.1",
"sass": "1.63.6",
"sass": "1.64.1",
"semver": "7.5.4",
"sort-package-json": "2.5.1",
"stylelint": "15.10.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"eslint-config-prettier": "8.8.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-prettier": "5.0.0",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-react": "7.33.0",
"eslint-plugin-react-hooks": "4.6.0",
"micromatch": "4.0.5",
"prettier": "3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/legend-application-pure-ide/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"jest": "29.6.1",
"npm-run-all": "4.1.5",
"rimraf": "5.0.1",
"sass": "1.63.6",
"sass": "1.64.1",
"typescript": "5.1.6"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ export const TextSearchPanel = observer(() => {
debouncedSearch();
}
};
const onSearch: React.KeyboardEventHandler<HTMLInputElement> = (event) => {
const onSearchKeyDown: React.KeyboardEventHandler<HTMLInputElement> = (
event,
) => {
if (event.code === 'Enter') {
debouncedSearch.cancel();
if (searchState.text) {
Expand Down Expand Up @@ -322,7 +324,7 @@ export const TextSearchPanel = observer(() => {
autoFocus={true}
className="text-search-panel__searcher__input input--dark"
onChange={onSearchTextChange}
onKeyDown={onSearch}
onKeyDown={onSearchKeyDown}
value={searchState.text}
placeholder="Search"
/>
Expand Down
2 changes: 1 addition & 1 deletion packages/legend-application-query-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"eslint": "8.45.0",
"npm-run-all": "4.1.5",
"rimraf": "5.0.1",
"sass": "1.63.6",
"sass": "1.64.1",
"typescript": "5.1.6"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/legend-application-query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"jest": "29.6.1",
"npm-run-all": "4.1.5",
"rimraf": "5.0.1",
"sass": "1.63.6",
"sass": "1.64.1",
"typescript": "5.1.6"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/legend-application-studio-bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"eslint": "8.45.0",
"npm-run-all": "4.1.5",
"rimraf": "5.0.1",
"sass": "1.63.6",
"sass": "1.64.1",
"typescript": "5.1.6"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/legend-application-studio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"jest": "29.6.1",
"npm-run-all": "4.1.5",
"rimraf": "5.0.1",
"sass": "1.63.6",
"sass": "1.64.1",
"typescript": "5.1.6"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit 6668fef

Please sign in to comment.