diff --git a/.changeset/config.json b/.changeset/config.json index 07a1f271e6..0c53308ae1 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -5,7 +5,7 @@ { "repo": "finos/legend-studio" } ], "commit": false, - "linked": [["@finos/legend-*-app", "@finos/legend-*-deployment"]], + "fixed": [["@finos/legend-*-app", "@finos/legend-*-deployment"]], "access": "public", "baseBranch": "master", "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { diff --git a/.changeset/four-bags-lay.md b/.changeset/four-bags-lay.md new file mode 100644 index 0000000000..54ba705b29 --- /dev/null +++ b/.changeset/four-bags-lay.md @@ -0,0 +1,22 @@ +--- +'@finos/eslint-plugin-legend-studio': patch +'@finos/legend-application': patch +'@finos/legend-art': patch +'@finos/legend-dev-utils': patch +'@finos/legend-extension-dsl-data-space': patch +'@finos/legend-extension-dsl-diagram': patch +'@finos/legend-extension-dsl-serializer': patch +'@finos/legend-extension-dsl-text': patch +'@finos/legend-extension-external-language-morphir': patch +'@finos/legend-extension-external-store-service': patch +'@finos/legend-graph': patch +'@finos/legend-query': patch +'@finos/legend-query-app': patch +'@finos/legend-studio': patch +'@finos/legend-studio-app': patch +'@finos/legend-studio-extension-management-toolkit': patch +'@finos/legend-studio-extension-query-builder': patch +'@finos/legend-taxonomy': patch +'@finos/legend-taxonomy-app': patch +'@finos/stylelint-config-legend-studio': patch +--- diff --git a/.changeset/sixty-wasps-pull.md b/.changeset/sixty-wasps-pull.md new file mode 100644 index 0000000000..dd99f0c42e --- /dev/null +++ b/.changeset/sixty-wasps-pull.md @@ -0,0 +1,10 @@ +--- +'@finos/eslint-plugin-legend-studio': patch +'@finos/legend-application': patch +'@finos/legend-extension-dsl-data-space': patch +'@finos/legend-extension-dsl-diagram': patch +'@finos/legend-graph': patch +'@finos/legend-query': patch +'@finos/legend-studio': patch +'@finos/legend-taxonomy': patch +--- diff --git a/.changeset/twenty-sheep-tap.md b/.changeset/twenty-sheep-tap.md new file mode 100644 index 0000000000..61bbee6543 --- /dev/null +++ b/.changeset/twenty-sheep-tap.md @@ -0,0 +1,5 @@ +--- +'@finos/legend-graph': patch +--- + +Add a temporary workaround to not fail graph building when there are unresolved class mapping IDs (see [#880](https://github.com/finos/legend-studio/issues/880) for more details). diff --git a/.changeset/wet-deers-flow.md b/.changeset/wet-deers-flow.md new file mode 100644 index 0000000000..94951f286e --- /dev/null +++ b/.changeset/wet-deers-flow.md @@ -0,0 +1,3 @@ +--- +'@finos/legend-dev-utils': patch +--- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8413dda4a6..5bf483830b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -101,7 +101,7 @@ yarn changeset:cli Make sure to install [Node.js](https://nodejs.org/en/) and [Yarn](https://yarnpkg.com/). For IDE, we highly recommend [Visual Studio Code](https://code.visualstudio.com/). Also, to assist development, don't forget to install [ESLint](https://eslint.org/) and [Stylelint](https://stylelint.io/) plugins to help you catch problems while writing code; and install [Prettier](https://prettier.io/) plugin to help you auto-format code. Last but not least, run the `setup` script. -Studio relies on SDLC and Engine servers as its backend. If you don't have these servers [setup to run locally](https://legend.finos.org/docs/installation/maven-install-guide#installation-steps), you can make use of [this Docker compose project](https://github.com/finos/legend/tree/master/installers/docker-compose/legend-studio-dev) to quickly set them up. +Studio relies _minimumly_ on SDLC and Engine servers as its backend. To quickly set these up, use our development [Docker compose](https://github.com/finos/legend/tree/master/installers/docker-compose/legend-studio-dev). If you need to debug and code on the backend at the same time, follow [this guide](./fixtures/legend-docker-setup/studio-dev-setup/README.md) to set them up using `maven`. ```sh # Install dependencies, link and set up the workspaces, and build the workspaces to make sure your project is in good shape. diff --git a/README.md b/README.md index 0187187a41..ce51eb5e0b 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ The codebase and home of Legend applications: `Legend Studio`, `Legend Query`, e ## Getting started -Make sure you have SDLC and Engine servers running. If you don't have these servers [setup to run locally](https://legend.finos.org/docs/installation/maven-install-guide#installation-steps), you can make use of [this Docker compose project](https://github.com/finos/legend/tree/master/installers/docker-compose/legend-studio-dev) to quickly set them up. +Make sure you have _at least_ SDLC and Engine servers running. To quickly set these up, use our development [Docker compose](https://github.com/finos/legend/tree/master/installers/docker-compose/legend-studio-dev). If you need to debug and code on the backend at the same time, follow [this guide](./fixtures/legend-docker-setup/studio-dev-setup/README.md) to set them up using `maven`. -Make sure you have `Yarn` installed. Run the following commands in order. +Last but not least, make sure you have `Yarn` installed. Run the following commands in order. ```bash yarn install diff --git a/fixtures/legend-docker-setup/end-to-end-setup/config/engine-config.json b/fixtures/legend-docker-setup/end-to-end-setup/config/engine-config.json new file mode 100644 index 0000000000..022b64371f --- /dev/null +++ b/fixtures/legend-docker-setup/end-to-end-setup/config/engine-config.json @@ -0,0 +1,69 @@ +{ + "deployment": { + "mode": "TEST_IGNORE_FUNCTION_MATCH" + }, + "logging": { + "level": "INFO", + "appenders": [ + { + "type": "console", + "logFormat": "%msg\r\n" + } + ] + }, + "pac4j": { + "bypassPaths": ["/api/server/v1/info"], + "clients": [ + { + "org.pac4j.core.client.direct.AnonymousClient": {} + } + ], + "mongoSession": { + "enabled": false + } + }, + "opentracing": { + "elastic": "", + "zipkin": "", + "uri": "", + "authenticator": { + "principal": "", + "keytab": "" + } + }, + "swagger": { + "title": "Legend Engine", + "resourcePackage": "org.finos.legend", + "uriPrefix": "/api" + }, + "server": { + "type": "simple", + "applicationContextPath": "/", + "adminContextPath": "/admin", + "connector": { + "maxRequestHeaderSize": "32KiB", + "type": "http", + "port": 6060 + }, + "requestLog": { + "appenders": [] + } + }, + "metadataserver": { + "pure": { + "host": "127.0.0.1", + "port": 8090 + }, + "alloy": { + "host": "127.0.0.1", + "port": 8090, + "prefix": "/depot/api" + } + }, + "temporarytestdb": { + "port": 9092 + }, + "relationalexecution": { + "tempPath": "/tmp/" + } +} diff --git a/fixtures/legend-docker-setup/end-to-end-setup/end-to-end-setup-docker-compose.yml b/fixtures/legend-docker-setup/end-to-end-setup/end-to-end-setup-docker-compose.yml new file mode 100644 index 0000000000..062931c0ed --- /dev/null +++ b/fixtures/legend-docker-setup/end-to-end-setup/end-to-end-setup-docker-compose.yml @@ -0,0 +1,22 @@ +version: '3.8' + +services: + engine: + container_name: engine + image: finos/legend-engine-server:snapshot + ports: + - 6060:6060 + networks: + - legend + volumes: + - ./config:/config + # NOTE: the Java CLI wildcard must be wrapped by quotes + # See https://stackoverflow.com/questions/14722657/java-classpath-wildcard-behaviour/14722763 + command: > + java + -cp /app/bin/"*" + org.finos.legend.engine.server.Server + server /config/engine-config.json + +networks: + legend: {} diff --git a/fixtures/legend-docker-setup/studio-dev-setup/README.md b/fixtures/legend-docker-setup/studio-dev-setup/README.md new file mode 100644 index 0000000000..69d8d76332 --- /dev/null +++ b/fixtures/legend-docker-setup/studio-dev-setup/README.md @@ -0,0 +1,3 @@ +# Studio Docker Compose Dev Setup + +[placeholder] diff --git a/fixtures/legend-mock-server/package.json b/fixtures/legend-mock-server/package.json index 1349497ac9..4b30970f78 100644 --- a/fixtures/legend-mock-server/package.json +++ b/fixtures/legend-mock-server/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "fastify": "3.27.2", - "fastify-cors": "6.0.2" + "fastify-cors": "6.0.3" }, "devDependencies": { "@finos/legend-dev-utils": "workspace:*", diff --git a/package.json b/package.json index 45646526f3..13e3883777 100644 --- a/package.json +++ b/package.json @@ -89,13 +89,13 @@ "@finos/eslint-plugin-legend-studio": "workspace:*", "@finos/legend-dev-utils": "workspace:*", "@finos/stylelint-config-legend-studio": "workspace:*", - "@types/jest": "27.4.0", - "@types/node": "17.0.19", + "@types/jest": "27.4.1", + "@types/node": "17.0.21", "chalk": "5.0.0", "cross-env": "7.0.3", "envinfo": "7.8.1", "eslint": "8.9.0", - "fs-extra": "10.0.1", + "fs-extra": "10.0.0", "husky": "7.0.4", "inquirer": "8.2.0", "jest": "27.5.1", @@ -103,10 +103,10 @@ "micromatch": "4.0.4", "prettier": "2.5.1", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "semver": "7.3.5", "sort-package-json": "1.54.0", - "stylelint": "14.5.2", + "stylelint": "14.5.3", "typescript": "4.5.5", "yargs": "17.3.1" }, diff --git a/packages/eslint-plugin/src/configs/recommended.js b/packages/eslint-plugin/src/configs/recommended.js index 9dbcccc929..e6f9d4ef3c 100644 --- a/packages/eslint-plugin/src/configs/recommended.js +++ b/packages/eslint-plugin/src/configs/recommended.js @@ -42,7 +42,7 @@ const ES_RULES = { 'dot-notation': [ERROR, { allowKeywords: true }], 'eol-last': [WARN, 'always'], eqeqeq: ERROR, - 'func-call-spacing': ERROR, + 'func-call-spacing': OFF, 'guard-for-in': ERROR, 'jsx-quotes': ERROR, 'key-spacing': WARN, @@ -135,6 +135,7 @@ const TYPESCRIPT_RULES = { WARN, { allowTypedFunctionExpressions: true }, ], + '@typescript-eslint/func-call-spacing': ERROR, '@typescript-eslint/no-inferrable-types': [WARN, { ignoreParameters: true }], '@typescript-eslint/no-var-requires': OFF, '@typescript-eslint/no-unused-vars': [ diff --git a/packages/legend-application/package.json b/packages/legend-application/package.json index cb0b548447..a4e0fc983c 100644 --- a/packages/legend-application/package.json +++ b/packages/legend-application/package.json @@ -47,7 +47,7 @@ "@types/react": "17.0.39", "@types/react-dom": "17.0.11", "@types/react-router-dom": "5.3.2", - "history": "5.2.0", + "history": "5.3.0", "mobx": "6.4.1", "mobx-react-lite": "3.3.0", "monaco-editor": "0.32.1", @@ -65,7 +65,7 @@ "jest": "27.5.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "peerDependencies": { diff --git a/packages/legend-art/package.json b/packages/legend-art/package.json index f4fbeef2e0..dd443d862e 100644 --- a/packages/legend-art/package.json +++ b/packages/legend-art/package.json @@ -74,7 +74,7 @@ "jest": "27.5.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "peerDependencies": { diff --git a/packages/legend-dev-utils/package.json b/packages/legend-dev-utils/package.json index 2ff307c855..3df9a2acdc 100644 --- a/packages/legend-dev-utils/package.json +++ b/packages/legend-dev-utils/package.json @@ -79,11 +79,11 @@ "mini-css-extract-plugin": "2.5.3", "monaco-editor": "0.32.1", "monaco-editor-webpack-plugin": "7.0.1", - "postcss": "8.4.6", + "postcss": "8.4.7", "postcss-loader": "6.2.1", "react-refresh": "0.11.0", "resolve": "1.22.0", - "sass": "1.49.8", + "sass": "1.49.9", "sass-loader": "12.6.0", "typescript": "4.5.5", "webpack": "5.69.1" diff --git a/packages/legend-extension-dsl-data-space/package.json b/packages/legend-extension-dsl-data-space/package.json index 8a1cdea1b0..7aa45a01cb 100644 --- a/packages/legend-extension-dsl-data-space/package.json +++ b/packages/legend-extension-dsl-data-space/package.json @@ -68,7 +68,7 @@ "jest": "27.5.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "peerDependencies": { diff --git a/packages/legend-extension-dsl-data-space/src/components/DataSpaceViewer.tsx b/packages/legend-extension-dsl-data-space/src/components/DataSpaceViewer.tsx index b5e7bfa1cb..2bdfbe0066 100644 --- a/packages/legend-extension-dsl-data-space/src/components/DataSpaceViewer.tsx +++ b/packages/legend-extension-dsl-data-space/src/components/DataSpaceViewer.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useRef, useEffect } from 'react'; +import { useRef, useEffect, forwardRef } from 'react'; import { observer } from 'mobx-react-lite'; import { useResizeDetector } from 'react-resize-detector'; import { @@ -58,13 +58,13 @@ interface DataSpaceViewerActivityConfig { } const DataSpaceDiagramCanvas = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { dataSpaceViewerState: DataSpaceViewerState; diagram: Diagram; - }, - ref: React.Ref, - ) => { + } + >(function DataSpaceDiagramCanvas(props, ref) { const { dataSpaceViewerState, diagram } = props; const diagramCanvasRef = ref as React.MutableRefObject; @@ -102,8 +102,7 @@ const DataSpaceDiagramCanvas = observer( onContextMenu={(event): void => event.preventDefault()} /> ); - }, - { forwardRef: true }, + }), ); type DiagramOption = { label: string; value: Diagram }; diff --git a/packages/legend-extension-dsl-diagram/package.json b/packages/legend-extension-dsl-diagram/package.json index e9ec31ec8b..b5540e2985 100644 --- a/packages/legend-extension-dsl-diagram/package.json +++ b/packages/legend-extension-dsl-diagram/package.json @@ -64,7 +64,7 @@ "jest-canvas-mock": "2.3.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "peerDependencies": { diff --git a/packages/legend-extension-dsl-diagram/src/components/studio/DiagramEditor.tsx b/packages/legend-extension-dsl-diagram/src/components/studio/DiagramEditor.tsx index 116792d338..2e22f923cb 100644 --- a/packages/legend-extension-dsl-diagram/src/components/studio/DiagramEditor.tsx +++ b/packages/legend-extension-dsl-diagram/src/components/studio/DiagramEditor.tsx @@ -14,7 +14,14 @@ * limitations under the License. */ -import { useRef, useState, useEffect, useCallback, Fragment } from 'react'; +import { + useRef, + useState, + useEffect, + useCallback, + Fragment, + forwardRef, +} from 'react'; import { useResizeDetector } from 'react-resize-detector'; import { type DropTargetMonitor, useDrop } from 'react-dnd'; import { observer } from 'mobx-react-lite'; @@ -99,12 +106,12 @@ import { Point } from '../../models/metamodels/pure/packageableElements/diagram/ import type { DSLDiagram_LegendStudioPlugin_Extension } from './DSLDiagram_LegendStudioPlugin_Extension'; const DiagramEditorContextMenu = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { diagramEditorState: DiagramEditorState; - }, - ref: React.Ref, - ) => { + } + >(function DiagramEditorContextMenu(props, ref) { const { diagramEditorState } = props; const editorStore = useEditorStore(); const extraClassViewContextMenuItems = @@ -129,8 +136,7 @@ const DiagramEditorContextMenu = observer( )) : []; return {extraClassViewContextMenuItems}; - }, - { forwardRef: true }, + }), ); const DiagramRendererHotkeyInfosModal = observer( @@ -1142,12 +1148,12 @@ const DiagramEditorInlinePropertyEditor = observer( ); const DiagramEditorDiagramCanvas = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { diagramEditorState: DiagramEditorState; - }, - ref: React.Ref, - ) => { + } + >(function DiagramEditorDiagramCanvas(props, ref) { const { diagramEditorState } = props; const diagramCanvasRef = ref as React.MutableRefObject; @@ -1223,8 +1229,7 @@ const DiagramEditorDiagramCanvas = observer( onContextMenu={(event): void => event.preventDefault()} /> ); - }, - { forwardRef: true }, + }), ); const DiagramEditorHeader = observer( diff --git a/packages/legend-extension-dsl-serializer/package.json b/packages/legend-extension-dsl-serializer/package.json index 6f834b2159..f4005f8fb4 100644 --- a/packages/legend-extension-dsl-serializer/package.json +++ b/packages/legend-extension-dsl-serializer/package.json @@ -63,7 +63,7 @@ "jest": "27.5.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "peerDependencies": { diff --git a/packages/legend-extension-dsl-text/package.json b/packages/legend-extension-dsl-text/package.json index ba3b20e32d..c5b126668b 100644 --- a/packages/legend-extension-dsl-text/package.json +++ b/packages/legend-extension-dsl-text/package.json @@ -60,7 +60,7 @@ "jest": "27.5.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "peerDependencies": { diff --git a/packages/legend-extension-external-language-morphir/package.json b/packages/legend-extension-external-language-morphir/package.json index 2c9c3c52a8..2a58a4b700 100644 --- a/packages/legend-extension-external-language-morphir/package.json +++ b/packages/legend-extension-external-language-morphir/package.json @@ -54,7 +54,7 @@ "jest": "27.5.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "publishConfig": { diff --git a/packages/legend-extension-external-store-service/package.json b/packages/legend-extension-external-store-service/package.json index bd2a7f8bdf..b9a236e56a 100644 --- a/packages/legend-extension-external-store-service/package.json +++ b/packages/legend-extension-external-store-service/package.json @@ -59,7 +59,7 @@ "jest": "27.5.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "peerDependencies": { diff --git a/packages/legend-graph/src/__tests__/buildGraph/GraphBuildFailure.test.ts b/packages/legend-graph/src/__tests__/buildGraph/GraphBuildFailure.test.ts index be8d570b72..b36cae5e2d 100644 --- a/packages/legend-graph/src/__tests__/buildGraph/GraphBuildFailure.test.ts +++ b/packages/legend-graph/src/__tests__/buildGraph/GraphBuildFailure.test.ts @@ -126,7 +126,10 @@ test(unitTest('Missing class mapping'), async () => { ); }); -test(unitTest('Missing class mapping with ID'), async () => { +// TODO: This test is skipped because we want to temporarily relax graph building algorithm +// to ease Pure -> Legend migration push. +/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/880 */ +test.skip(unitTest('Missing class mapping with ID'), async () => { const buildGraph = flowResult( graphManagerState.graphManager.buildGraph( graphManagerState.graph, @@ -138,7 +141,7 @@ test(unitTest('Missing class mapping with ID'), async () => { ); }); -// TODO This test is skipped because we don't support include mappings. We don't fail yet +// TODO: This test is skipped because we don't support include mappings. We don't fail yet // Unskip when include mappings support is added test.skip(unitTest('Missing set implementation'), async () => { const buildGraph = flowResult( @@ -152,7 +155,7 @@ test.skip(unitTest('Missing set implementation'), async () => { ); }); -/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */ +/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */ test.skip(unitTest('Duplicate enumeration values'), async () => { const buildGraph = flowResult( graphManagerState.graphManager.buildGraph( @@ -165,7 +168,7 @@ test.skip(unitTest('Duplicate enumeration values'), async () => { ); }); -/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */ +/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */ test.skip(unitTest('Duplicate profile tags'), async () => { const buildGraph = flowResult( graphManagerState.graphManager.buildGraph( @@ -178,7 +181,7 @@ test.skip(unitTest('Duplicate profile tags'), async () => { ); }); -/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */ +/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */ test.skip(unitTest('Duplicate profile stereotypes'), async () => { const buildGraph = flowResult( graphManagerState.graphManager.buildGraph( @@ -191,7 +194,7 @@ test.skip(unitTest('Duplicate profile stereotypes'), async () => { ); }); -/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */ +/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */ test.skip(unitTest('Duplicate class properties'), async () => { const buildGraph = flowResult( graphManagerState.graphManager.buildGraph( @@ -204,8 +207,8 @@ test.skip(unitTest('Duplicate class properties'), async () => { ); }); -/* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */ -test.skip(unitTest('Duplicate aoociation properties'), async () => { +/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */ +test.skip(unitTest('Duplicate association properties'), async () => { const buildGraph = flowResult( graphManagerState.graphManager.buildGraph( graphManagerState.graph, diff --git a/packages/legend-graph/src/models/metamodels/pure/packageableElements/mapping/PropertyMapping.ts b/packages/legend-graph/src/models/metamodels/pure/packageableElements/mapping/PropertyMapping.ts index 9d15042f99..bca2aa2a06 100644 --- a/packages/legend-graph/src/models/metamodels/pure/packageableElements/mapping/PropertyMapping.ts +++ b/packages/legend-graph/src/models/metamodels/pure/packageableElements/mapping/PropertyMapping.ts @@ -67,9 +67,11 @@ export abstract class PropertyMapping implements Hashable, Stubable { owner: PropertyMappingsImplementation; // the immediate parent instance set implementation that holds the property mappings // NOTE: in case the holder of this property mapping is an embedded property mapping, that embedded property mapping is considered the source // otherwise, it is always the top/root `InstanceSetImplementation` that is considered the source implementation + // TODO: change this to use `SetImplemenetationReference` sourceSetImplementation: SetImplementation; // NOTE: in Pure, we actually only store `targetId` and `sourceId` instead of the reference // but for convenience and graph completeness validation purpose we will resolve to the actual set implementations here + // TODO: change this to use `OptionalSetImplemenetationReference` targetSetImplementation?: SetImplementation | undefined; localMappingProperty?: LocalMappingPropertyInfo | undefined; // store?: Store | undefined; diff --git a/packages/legend-graph/src/models/metamodels/pure/packageableElements/mapping/SetImplementation.ts b/packages/legend-graph/src/models/metamodels/pure/packageableElements/mapping/SetImplementation.ts index 94513091d0..dc6a0c7790 100644 --- a/packages/legend-graph/src/models/metamodels/pure/packageableElements/mapping/SetImplementation.ts +++ b/packages/legend-graph/src/models/metamodels/pure/packageableElements/mapping/SetImplementation.ts @@ -18,9 +18,12 @@ import { observable, action, computed, makeObservable } from 'mobx'; import { hashArray, type Hashable } from '@finos/legend-shared'; import { fromElementPathToMappingElementId } from '../../../../../MetaModelUtils'; import { CORE_HASH_STRUCTURE } from '../../../../../MetaModelConst'; -import type { PackageableElementReference } from '../PackageableElementReference'; +import { + PackageableElementExplicitReference, + type PackageableElementReference, +} from '../PackageableElementReference'; import type { PropertyOwnerImplementation } from './PropertyOwnerImplementation'; -import type { Class } from '../domain/Class'; +import { Class } from '../domain/Class'; import type { Mapping, MappingElementLabel } from './Mapping'; import type { Stubable } from '../../../../../helpers/Stubable'; import type { OperationSetImplementation } from './OperationSetImplementation'; @@ -29,8 +32,14 @@ import type { FlatDataInstanceSetImplementation } from '../store/flatData/mappin import type { EmbeddedFlatDataPropertyMapping } from '../store/flatData/mapping/EmbeddedFlatDataPropertyMapping'; import type { RelationalInstanceSetImplementation } from '../store/relational/mapping/RelationalInstanceSetImplementation'; import type { RootRelationalInstanceSetImplementation } from '../store/relational/mapping/RootRelationalInstanceSetImplementation'; -import type { InferableMappingElementIdValue } from './InferableMappingElementId'; -import type { InferableMappingElementRoot } from './InferableMappingElementRoot'; +import { + InferableMappingElementIdExplicitValue, + type InferableMappingElementIdValue, +} from './InferableMappingElementId'; +import { + InferableMappingElementRootExplicitValue, + type InferableMappingElementRoot, +} from './InferableMappingElementRoot'; import type { AggregationAwareSetImplementation } from './aggregationAware/AggregationAwareSetImplementation'; import type { InstanceSetImplementation } from './InstanceSetImplementation'; @@ -58,6 +67,9 @@ export interface SetImplementationVisitor { visit_AggregationAwareSetImplementation( setImplementation: AggregationAwareSetImplementation, ): T; + visit_TEMPORARY__UnresolvedSetImplementation( + setImplementation: TEMPORARY__UnresolvedSetImplementation, + ): T; } export abstract class SetImplementation @@ -143,3 +155,28 @@ export enum SET_IMPLEMENTATION_TYPE { EMBEDDED_RELATIONAL = 'embeddedRelational', AGGREGATION_AWARE = 'aggregationAware', } + +/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/880 */ +/** + * When set implementation cannot be resolved by ID, + * we try to avoid failing graph building for now + * instead, we will leave this loose end unresolved. + * + * NOTE: this is just a temporary solutions until we make this a hard-fail post migration. + * + * See https://github.com/finos/legend-studio/issues/880 + */ +export class TEMPORARY__UnresolvedSetImplementation extends SetImplementation { + constructor(id: string, parent: Mapping) { + super( + InferableMappingElementIdExplicitValue.create(id, ''), + parent, + PackageableElementExplicitReference.create(new Class('')), + InferableMappingElementRootExplicitValue.create(false), + ); + } + + accept_SetImplementationVisitor(visitor: SetImplementationVisitor): T { + return visitor.visit_TEMPORARY__UnresolvedSetImplementation(this); + } +} diff --git a/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts b/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts index a47e46ab5d..862afab4e8 100644 --- a/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts +++ b/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/from/V1_MappingTransformer.ts @@ -15,6 +15,7 @@ */ import { + IllegalStateError, isNonNullable, recursiveOmit, UnsupportedOperationError, @@ -23,6 +24,7 @@ import type { Mapping } from '../../../../../../metamodels/pure/packageableEleme import type { SetImplementationVisitor, SetImplementation, + TEMPORARY__UnresolvedSetImplementation, } from '../../../../../../metamodels/pure/packageableElements/mapping/SetImplementation'; import type { PropertyMappingVisitor, @@ -1058,7 +1060,8 @@ export class V1_SetImplementationTransformer visit_EmbeddedFlatDataSetImplementation( setImplementation: EmbeddedFlatDataPropertyMapping, ): V1_ClassMapping | undefined { - // FIXME? + // NOTE: we currently don't support this and flat-data would probably be deprecated + // in the future in favor of schema-set/binding return undefined; } @@ -1080,6 +1083,15 @@ export class V1_SetImplementationTransformer this.context, ); } + + /* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/880 */ + visit_TEMPORARY__UnresolvedSetImplementation( + setImplementation: TEMPORARY__UnresolvedSetImplementation, + ): V1_ClassMapping | undefined { + throw new IllegalStateError( + `Can't transform unresolved set implementation. This type of set implementation should only show up in references.`, + ); + } } function transformSetImplementation( diff --git a/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.ts b/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.ts index 906cd13267..2732295e71 100644 --- a/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.ts +++ b/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphSecondPassBuilder.ts @@ -97,7 +97,7 @@ export class V1_ProtocolToMetaModelGraphSecondPassBuilder const uniqueStereotypes = new Set(); profile.stereotypes = element.stereotypes.map((stereotype) => { if (uniqueStereotypes.has(stereotype)) { - /* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */ + /* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */ this.context.log.warn( LogEvent.create( `Found duplicated stereotype '${stereotype}' in profile '${element.path}'`, @@ -110,7 +110,7 @@ export class V1_ProtocolToMetaModelGraphSecondPassBuilder const uniqueTags = new Set(); profile.tags = element.tags.map((tag) => { if (uniqueTags.has(tag)) { - /* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */ + /* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */ this.context.log.warn( LogEvent.create( `Found duplicated tag '${tag}' in profile '${element.path}'`, @@ -138,7 +138,7 @@ export class V1_ProtocolToMetaModelGraphSecondPassBuilder `Enum value 'value' field is missing or empty`, ); if (uniqueEnumValues.has(enumValue.value)) { - /* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */ + /* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */ this.context.log.warn( LogEvent.create( `Found duplicated value '${enumValue.value}' in enumeration '${enumeration.path}'`, diff --git a/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.ts b/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.ts index 1ec1dc6a20..f34a51ac18 100644 --- a/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.ts +++ b/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelGraphThirdPassBuilder.ts @@ -109,7 +109,7 @@ export class V1_ProtocolToMetaModelGraphThirdPassBuilder const uniqueProperties = new Set(); element.properties.forEach((property) => { if (uniqueProperties.has(property.name)) { - /* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */ + /* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */ this.context.log.warn( LogEvent.create( `Found duplicated property '${property.name}' in class '${_class.path}'`, @@ -132,7 +132,7 @@ export class V1_ProtocolToMetaModelGraphThirdPassBuilder const first = guaranteeNonNullable(element.properties[0]); const second = guaranteeNonNullable(element.properties[1]); if (first.name === second.name) { - /* @MARKER: Temporary until we resolve https://github.com/finos/legend-studio/issues/660 */ + /* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/660 */ this.context.log.warn( LogEvent.create( `Found duplicated property '${element.properties[0]?.name}' in association '${element.name}'`, diff --git a/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelPropertyMappingBuilder.ts b/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelPropertyMappingBuilder.ts index c970f0bad2..cdb1ad96ee 100644 --- a/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelPropertyMappingBuilder.ts +++ b/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/V1_ProtocolToMetaModelPropertyMappingBuilder.ts @@ -31,7 +31,10 @@ import type { PropertyMappingsImplementation } from '../../../../../../metamodel import { EmbeddedFlatDataPropertyMapping } from '../../../../../../metamodels/pure/packageableElements/store/flatData/mapping/EmbeddedFlatDataPropertyMapping'; import { FlatDataPropertyMapping } from '../../../../../../metamodels/pure/packageableElements/store/flatData/mapping/FlatDataPropertyMapping'; import type { EnumerationMapping } from '../../../../../../metamodels/pure/packageableElements/mapping/EnumerationMapping'; -import type { SetImplementation } from '../../../../../../metamodels/pure/packageableElements/mapping/SetImplementation'; +import { + TEMPORARY__UnresolvedSetImplementation, + type SetImplementation, +} from '../../../../../../metamodels/pure/packageableElements/mapping/SetImplementation'; import { Class } from '../../../../../../metamodels/pure/packageableElements/domain/Class'; import type { Association } from '../../../../../../metamodels/pure/packageableElements/domain/Association'; import type { TableAlias } from '../../../../../../metamodels/pure/packageableElements/store/relational/model/RelationalOperationElement'; @@ -86,6 +89,15 @@ import { } from '../../../../../../../helpers/MappingHelper'; import { GraphBuilderError } from '../../../../../../../graphManager/GraphManagerUtils'; import type { AbstractProperty } from '../../../../../../metamodels/pure/packageableElements/domain/AbstractProperty'; +import type { Mapping } from '../../../../../../metamodels/pure/packageableElements/mapping/Mapping'; + +/* @MARKER: RELAXED GRAPH CHECK - See https://github.com/finos/legend-studio/issues/880 */ +const TEMPORARY__getClassMappingByIdOrReturnUnresolved = ( + mapping: Mapping, + id: string, +): SetImplementation => + returnUndefOnError(() => getClassMappingById(mapping, id)) ?? + new TEMPORARY__UnresolvedSetImplementation(id, mapping); const resolveRelationalPropertyMappingSource = ( immediateParent: PropertyMappingsImplementation, @@ -94,7 +106,10 @@ const resolveRelationalPropertyMappingSource = ( ): SetImplementation | undefined => { if (immediateParent instanceof AssociationImplementation) { if (value.source) { - return getClassMappingById(immediateParent.parent, value.source); + return TEMPORARY__getClassMappingByIdOrReturnUnresolved( + immediateParent.parent, + value.source, + ); } const property = immediateParent.association.value.getProperty( value.property.property, @@ -197,10 +212,11 @@ export class V1_ProtocolToMetaModelPropertyMappingBuilder const topParent = guaranteeNonNullable(this.topParent); if (propertyType instanceof Class) { if (protocol.target) { - targetSetImplementation = getClassMappingById( - topParent.parent, - protocol.target, - ); + targetSetImplementation = + TEMPORARY__getClassMappingByIdOrReturnUnresolved( + topParent.parent, + protocol.target, + ); } else { /* @MARKER: ACTION ANALYTICS */ // NOTE: if no there is one non-root class mapping, auto-nominate that as the target set implementation @@ -214,11 +230,12 @@ export class V1_ProtocolToMetaModelPropertyMappingBuilder ); } } - const sourceSetImplementation = returnUndefOnError(() => - protocol.source - ? getClassMappingById(topParent.parent, protocol.source) - : undefined, - ); + const sourceSetImplementation = protocol.source + ? TEMPORARY__getClassMappingByIdOrReturnUnresolved( + topParent.parent, + protocol.source, + ) + : undefined; const purePropertyMapping = new PurePropertyMapping( topParent, property, @@ -288,7 +305,10 @@ export class V1_ProtocolToMetaModelPropertyMappingBuilder const propertyType = property.genericType.value.rawType; if (propertyType instanceof Class && protocol.target) { targetSetImplementation = this.topParent - ? getClassMappingById(this.topParent.parent, protocol.target) + ? TEMPORARY__getClassMappingByIdOrReturnUnresolved( + this.topParent.parent, + protocol.target, + ) : undefined; } const flatDataPropertyMapping = new FlatDataPropertyMapping( @@ -480,7 +500,10 @@ export class V1_ProtocolToMetaModelPropertyMappingBuilder } if (protocol.target) { targetSetImplementation = parentMapping - ? getClassMappingById(parentMapping, protocol.target) + ? TEMPORARY__getClassMappingByIdOrReturnUnresolved( + parentMapping, + protocol.target, + ) : undefined; } else { targetSetImplementation = parentMapping @@ -618,10 +641,11 @@ export class V1_ProtocolToMetaModelPropertyMappingBuilder _class, InferableMappingElementIdExplicitValue.create(id, ''), ); - inline.inlineSetImplementation = getClassMappingById( - topParent.parent, - protocol.setImplementationId, - ); + inline.inlineSetImplementation = + TEMPORARY__getClassMappingByIdOrReturnUnresolved( + topParent.parent, + protocol.setImplementationId, + ); return inline; } diff --git a/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalClassMappingBuilderHelper.ts b/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalClassMappingBuilderHelper.ts index 7cbf78858e..1b32cfab95 100644 --- a/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalClassMappingBuilderHelper.ts +++ b/packages/legend-graph/src/models/protocols/pure/v1/transformation/pureGraph/to/helpers/V1_RelationalClassMappingBuilderHelper.ts @@ -42,7 +42,7 @@ import { export const V1_buildRelationalClassMapping = ( relationalClassMapping: V1_RelationalClassMapping, context: V1_GraphBuilderContext, - base: RelationalInstanceSetImplementation, + immediateParent: RelationalInstanceSetImplementation, topParent: RootRelationalInstanceSetImplementation, parentMapping: Mapping, embeddedRelationalPropertyMappings: EmbeddedRelationalInstanceSetImplementation[], @@ -51,25 +51,25 @@ export const V1_buildRelationalClassMapping = ( ): SetImplementation => { const pureClass = relationalClassMapping.class ? context.resolveClass(relationalClassMapping.class) - : base.class; + : immediateParent.class; // TODO localMappingProperties - base.primaryKey = relationalClassMapping.primaryKey.map((key) => + immediateParent.primaryKey = relationalClassMapping.primaryKey.map((key) => V1_buildRelationalOperationElement(key, context, tableAliasMap, []), ); - base.propertyMappings = relationalClassMapping.propertyMappings.map( - (propertyMapping) => + immediateParent.propertyMappings = + relationalClassMapping.propertyMappings.map((propertyMapping) => propertyMapping.accept_PropertyMappingVisitor( new V1_ProtocolToMetaModelPropertyMappingBuilder( context, - base, + immediateParent, topParent, enumerationMappings, tableAliasMap, ), ), - ) as RelationalPropertyMapping[]; - base.class = pureClass; - return base; + ) as RelationalPropertyMapping[]; + immediateParent.class = pureClass; + return immediateParent; }; export const V1_buildRelationalPrimaryKey = ( diff --git a/packages/legend-query-app/package.json b/packages/legend-query-app/package.json index 980e8632ca..c8f0ceca69 100644 --- a/packages/legend-query-app/package.json +++ b/packages/legend-query-app/package.json @@ -54,7 +54,7 @@ "eslint": "8.9.0", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "publishConfig": { diff --git a/packages/legend-query/package.json b/packages/legend-query/package.json index 05a1a90966..d93b8fc76a 100644 --- a/packages/legend-query/package.json +++ b/packages/legend-query/package.json @@ -55,7 +55,7 @@ "@types/react-dom": "17.0.11", "@types/react-router-dom": "5.3.2", "date-fns": "2.28.0", - "history": "5.2.0", + "history": "5.3.0", "mobx": "6.4.1", "mobx-react-lite": "3.3.0", "monaco-editor": "0.32.1", @@ -76,7 +76,7 @@ "jest": "27.5.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "peerDependencies": { diff --git a/packages/legend-query/src/components/QueryBuilderExplorerPanel.tsx b/packages/legend-query/src/components/QueryBuilderExplorerPanel.tsx index 2fbaccc6b9..244d04f4da 100644 --- a/packages/legend-query/src/components/QueryBuilderExplorerPanel.tsx +++ b/packages/legend-query/src/components/QueryBuilderExplorerPanel.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useEffect, useState } from 'react'; +import { forwardRef, useEffect, useState } from 'react'; import { observer } from 'mobx-react-lite'; import { type TreeNodeContainerProps, @@ -244,14 +244,14 @@ const QueryBuilderExplorerPropertyDragLayer = observer( ); const QueryBuilderExplorerContextMenu = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { queryBuilderState: QueryBuilderState; openNode: () => void; node: QueryBuilderExplorerTreeNodeData; - }, - ref: React.Ref, - ) => { + } + >(function QueryBuilderExplorerContextMenu(props, ref) { const { queryBuilderState, openNode, node } = props; const applicationStore = useApplicationStore(); const viewType = (): void => @@ -353,8 +353,7 @@ const QueryBuilderExplorerContextMenu = observer( View Type ); - }, - { forwardRef: true }, + }), ); const renderPropertyTypeIcon = (type: Type): React.ReactNode => { diff --git a/packages/legend-query/src/components/QueryBuilderFilterPanel.tsx b/packages/legend-query/src/components/QueryBuilderFilterPanel.tsx index 5cedce6e73..c7905e5211 100644 --- a/packages/legend-query/src/components/QueryBuilderFilterPanel.tsx +++ b/packages/legend-query/src/components/QueryBuilderFilterPanel.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useEffect, useRef, useState, useCallback } from 'react'; +import { useEffect, useRef, useState, useCallback, forwardRef } from 'react'; import { observer } from 'mobx-react-lite'; import { type TreeNodeContainerProps, @@ -299,13 +299,13 @@ const QueryBuilderFilterBlankConditionEditor = observer( ); const QueryBuilderFilterConditionContextMenu = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { queryBuilderState: QueryBuilderState; node: QueryBuilderFilterTreeNodeData; - }, - ref: React.Ref, - ) => { + } + >(function QueryBuilderFilterConditionContextMenu(props, ref) { const { queryBuilderState, node } = props; const filterState = queryBuilderState.filterState; const removeNode = (): void => filterState.removeNodeAndPruneBranch(node); @@ -345,8 +345,7 @@ const QueryBuilderFilterConditionContextMenu = observer( Remove ); - }, - { forwardRef: true }, + }), ); const QueryBuilderFilterTreeNodeContainer = observer( diff --git a/packages/legend-query/src/components/QueryBuilderProjectionPanel.tsx b/packages/legend-query/src/components/QueryBuilderProjectionPanel.tsx index 220fe556a9..b2462aae79 100644 --- a/packages/legend-query/src/components/QueryBuilderProjectionPanel.tsx +++ b/packages/legend-query/src/components/QueryBuilderProjectionPanel.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useEffect, useRef, useCallback, useState } from 'react'; +import { useEffect, useRef, useCallback, useState, forwardRef } from 'react'; import { observer } from 'mobx-react-lite'; import { clsx, @@ -103,12 +103,12 @@ const ProjectionColumnDragLayer: React.FC = () => { }; const QueryBuilderProjectionColumnContextMenu = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { projectionColumnState: QueryBuilderProjectionColumnState; - }, - ref: React.Ref, - ) => { + } + >(function QueryBuilderProjectionColumnContextMenu(props, ref) { const { projectionColumnState } = props; const convertToDerivation = (): void => { if ( @@ -130,8 +130,7 @@ const QueryBuilderProjectionColumnContextMenu = observer( )} ); - }, - { forwardRef: true }, + }), ); const QueryBuilderSimpleProjectionColumnEditor = observer( diff --git a/packages/legend-studio-app/package.json b/packages/legend-studio-app/package.json index fbc1d7340c..e5add9e22a 100644 --- a/packages/legend-studio-app/package.json +++ b/packages/legend-studio-app/package.json @@ -60,7 +60,7 @@ "eslint": "8.9.0", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "publishConfig": { diff --git a/packages/legend-studio-extension-management-toolkit/package.json b/packages/legend-studio-extension-management-toolkit/package.json index dc064b85b9..77d3425d3c 100644 --- a/packages/legend-studio-extension-management-toolkit/package.json +++ b/packages/legend-studio-extension-management-toolkit/package.json @@ -61,7 +61,7 @@ "jest": "27.5.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "peerDependencies": { diff --git a/packages/legend-studio-extension-query-builder/package.json b/packages/legend-studio-extension-query-builder/package.json index 278d9f431b..c05d5b7ed3 100644 --- a/packages/legend-studio-extension-query-builder/package.json +++ b/packages/legend-studio-extension-query-builder/package.json @@ -66,7 +66,7 @@ "jest": "27.5.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "peerDependencies": { diff --git a/packages/legend-studio/package.json b/packages/legend-studio/package.json index bcc281a2a2..6b0faebf5d 100644 --- a/packages/legend-studio/package.json +++ b/packages/legend-studio/package.json @@ -52,7 +52,7 @@ "@types/react-dom": "17.0.11", "@types/react-router-dom": "5.3.2", "date-fns": "2.28.0", - "history": "5.2.0", + "history": "5.3.0", "mobx": "6.4.1", "mobx-react-lite": "3.3.0", "monaco-editor": "0.32.1", @@ -76,7 +76,7 @@ "jest": "27.5.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "peerDependencies": { diff --git a/packages/legend-studio/src/components/editor/ActivityBar.tsx b/packages/legend-studio/src/components/editor/ActivityBar.tsx index 057abe6d43..fd49f2b726 100644 --- a/packages/legend-studio/src/components/editor/ActivityBar.tsx +++ b/packages/legend-studio/src/components/editor/ActivityBar.tsx @@ -36,9 +36,10 @@ import { WrenchIcon, } from '@finos/legend-art'; import { useEditorStore } from './EditorStoreProvider'; +import { forwardRef } from 'react'; const SettingsMenu = observer( - (props, ref: React.Ref) => { + forwardRef(function SettingsMenu(props, ref) { const editorStore = useEditorStore(); const toggleDevTool = (): void => { editorStore.setDevTool(!editorStore.isDevToolEnabled); @@ -54,8 +55,7 @@ const SettingsMenu = observer( ); - }, - { forwardRef: true }, + }), ); export interface ActivityDisplay { diff --git a/packages/legend-studio/src/components/editor/edit-panel/EditPanel.tsx b/packages/legend-studio/src/components/editor/edit-panel/EditPanel.tsx index a8c23a0867..d3bd70c89a 100644 --- a/packages/legend-studio/src/components/editor/edit-panel/EditPanel.tsx +++ b/packages/legend-studio/src/components/editor/edit-panel/EditPanel.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useEffect, useState } from 'react'; +import { forwardRef, useEffect, useState } from 'react'; import { observer } from 'mobx-react-lite'; import { clsx, @@ -170,12 +170,12 @@ export const EditPanelSplashScreen: React.FC = () => { }; const EditPanelHeaderTabContextMenu = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { editorState: EditorState; - }, - ref: React.Ref, - ) => { + } + >(function EditPanelHeaderTabContextMenu(props, ref) { const { editorState } = props; const editorStore = useEditorStore(); const close = (): void => editorStore.closeState(editorState); @@ -206,8 +206,7 @@ const EditPanelHeaderTabContextMenu = observer( ); - }, - { forwardRef: true }, + }), ); export const EditPanel = observer(() => { diff --git a/packages/legend-studio/src/components/editor/edit-panel/GrammarTextEditor.tsx b/packages/legend-studio/src/components/editor/edit-panel/GrammarTextEditor.tsx index 3268fd9959..8a0662b181 100644 --- a/packages/legend-studio/src/components/editor/edit-panel/GrammarTextEditor.tsx +++ b/packages/legend-studio/src/components/editor/edit-panel/GrammarTextEditor.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useEffect, useState, useRef, useCallback } from 'react'; +import { useEffect, useState, useRef, useCallback, forwardRef } from 'react'; import { observer } from 'mobx-react-lite'; import { editor as monacoEditorAPI, KeyCode } from 'monaco-editor'; import { @@ -50,25 +50,26 @@ import { useEditorStore } from '../EditorStoreProvider'; import { guaranteeNonNullable } from '@finos/legend-shared'; export const GrammarTextEditorHeaderTabContextMenu = observer( - (props, ref: React.Ref) => { - const editorStore = useEditorStore(); - const applicationStore = useApplicationStore(); - const leaveTextMode = applicationStore.guaranteeSafeAction(() => - flowResult(editorStore.toggleTextMode()), - ); + forwardRef( + function GrammarTextEditorHeaderTabContextMenu(props, ref) { + const editorStore = useEditorStore(); + const applicationStore = useApplicationStore(); + const leaveTextMode = applicationStore.guaranteeSafeAction(() => + flowResult(editorStore.toggleTextMode()), + ); - return ( -
- -
- ); - }, - { forwardRef: true }, + return ( +
+ +
+ ); + }, + ), ); export const GrammarTextEditor = observer(() => { diff --git a/packages/legend-studio/src/components/editor/edit-panel/RuntimeEditor.tsx b/packages/legend-studio/src/components/editor/edit-panel/RuntimeEditor.tsx index eacf54fc00..bfea839e4d 100644 --- a/packages/legend-studio/src/components/editor/edit-panel/RuntimeEditor.tsx +++ b/packages/legend-studio/src/components/editor/edit-panel/RuntimeEditor.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useState, useEffect, useCallback } from 'react'; +import { useState, useEffect, useCallback, forwardRef } from 'react'; import { observer } from 'mobx-react-lite'; import { type RuntimeEditorState, @@ -133,14 +133,14 @@ const getConnectionTooltipText = ( }; const IdentifiedConnectionsPerStoreExplorerContextMenu = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { identifiedConnection?: IdentifiedConnection; deleteIdentifiedConnection?: () => void; createNewIdentifiedConnection: () => void; - }, - ref: React.Ref, - ) => { + } + >(function IdentifiedConnectionsPerStoreExplorerContextMenu(props, ref) { const { identifiedConnection, deleteIdentifiedConnection, @@ -160,8 +160,7 @@ const IdentifiedConnectionsPerStoreExplorerContextMenu = observer( )} ); - }, - { forwardRef: true }, + }), ); export const IdentifiedConnectionsPerStoreExplorerItem = observer( diff --git a/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/ClassMappingEditor.tsx b/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/ClassMappingEditor.tsx index f2e872c05d..93d0a6b980 100644 --- a/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/ClassMappingEditor.tsx +++ b/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/ClassMappingEditor.tsx @@ -283,5 +283,4 @@ export const ClassMappingEditor = observer( ); }, - { forwardRef: true }, ); diff --git a/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/MappingEditor.tsx b/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/MappingEditor.tsx index 63f1d1215b..ff13a80463 100644 --- a/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/MappingEditor.tsx +++ b/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/MappingEditor.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useEffect, useState } from 'react'; +import { forwardRef, useEffect, useState } from 'react'; import { observer } from 'mobx-react-lite'; import { toSentenceCase } from '@finos/legend-shared'; import { @@ -87,12 +87,12 @@ export const MappingEditorSplashScreen: React.FC = () => { }; const MappingEditorHeaderTabContextMenu = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { tabState: MappingEditorTabState; - }, - ref: React.Ref, - ) => { + } + >(function MappingEditorHeaderTabContextMenu(props, ref) { const { tabState } = props; const editorStore = useEditorStore(); const applicationStore = useApplicationStore(); @@ -129,8 +129,7 @@ const MappingEditorHeaderTabContextMenu = observer( ); - }, - { forwardRef: true }, + }), ); const getMappingElementTargetIcon = ( diff --git a/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/MappingExplorer.tsx b/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/MappingExplorer.tsx index fc76b0741b..306d01e42f 100644 --- a/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/MappingExplorer.tsx +++ b/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/MappingExplorer.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useState, useCallback } from 'react'; +import { useState, useCallback, forwardRef } from 'react'; import { observer } from 'mobx-react-lite'; import { type MappingExplorerDropTarget, @@ -69,13 +69,13 @@ import { } from '../../../../stores/editor-state/element-editor-state/mapping/PureInstanceSetImplementationState'; export const MappingExplorerContextMenu = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { mappingElement?: MappingElement; openNewMapingModal?: () => void; - }, - ref: React.Ref, - ) => { + } + >(function MappingExplorerContextMenu(props, ref) { const { mappingElement, openNewMapingModal } = props; const editorStore = useEditorStore(); const applicationStore = useApplicationStore(); @@ -218,8 +218,7 @@ export const MappingExplorerContextMenu = observer( )} ); - }, - { forwardRef: true }, + }), ); export const MappingElementExplorer = observer( diff --git a/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.tsx b/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.tsx index 0207e28a03..2839f8cf2e 100644 --- a/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.tsx +++ b/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/MappingTestsExplorer.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useState, useCallback } from 'react'; +import { useState, useCallback, forwardRef } from 'react'; import { observer } from 'mobx-react-lite'; import { useDrop } from 'react-dnd'; import { @@ -55,14 +55,14 @@ const addTestPromps = [ ]; export const MappingTestExplorerContextMenu = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { mappingTestState?: MappingTestState; showCreateNewTestModal?: () => void; isReadOnly: boolean; - }, - ref: React.Ref, - ) => { + } + >(function MappingTestExplorerContextMenu(props, ref) { const { mappingTestState, isReadOnly, showCreateNewTestModal } = props; const applicationStore = useApplicationStore(); const runMappingTest = (): void => { @@ -149,8 +149,7 @@ export const MappingTestExplorerContextMenu = observer( )} ); - }, - { forwardRef: true }, + }), ); export const MappingTestStatusIndicator: React.FC<{ diff --git a/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/execution-plan-viewer/SQLExecutionPlanViewer.tsx b/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/execution-plan-viewer/SQLExecutionPlanViewer.tsx index 7e4c897c1a..ed270d1382 100644 --- a/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/execution-plan-viewer/SQLExecutionPlanViewer.tsx +++ b/packages/legend-studio/src/components/editor/edit-panel/mapping-editor/execution-plan-viewer/SQLExecutionPlanViewer.tsx @@ -112,11 +112,10 @@ const QueryViewer: React.FC<{ ); -interface labelprops { +const ResultColumnsDataViewer: React.FC<{ label: string; dataType: string; -} -const ResultColumnsDataViewer: React.FC = ({ label, dataType }) => ( +}> = ({ label, dataType }) => (
void; createTestContainer: () => void; - }, - ref: React.Ref, - ) => { + deleteTestContainer?: () => void; + } + >(function TestContainerContextMenu(props, ref) { const { testContainer, deleteTestContainer, createTestContainer } = props; const remove = (): void => deleteTestContainer?.(); @@ -95,8 +95,7 @@ const TestContainerContextMenu = observer( )}
); - }, - { forwardRef: true }, + }), ); export const TestContainerItem = observer( diff --git a/packages/legend-studio/src/components/editor/side-bar/Explorer.tsx b/packages/legend-studio/src/components/editor/side-bar/Explorer.tsx index 981d9a7e71..fa342090b4 100644 --- a/packages/legend-studio/src/components/editor/side-bar/Explorer.tsx +++ b/packages/legend-studio/src/components/editor/side-bar/Explorer.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import React, { Fragment, useRef, useEffect, useState } from 'react'; +import { Fragment, useRef, useEffect, useState, forwardRef } from 'react'; import { observer } from 'mobx-react-lite'; import { type TreeNodeContainerProps, @@ -173,13 +173,13 @@ const ElementRenamer = observer(() => { }); const ExplorerContextMenu = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { node?: PackageTreeNodeData | undefined; nodeIsImmutable?: boolean | undefined; - }, - ref: React.Ref, - ) => { + } + >(function ExplorerContextMenu(props, ref) { const { node, nodeIsImmutable } = props; const editorStore = useEditorStore(); const applicationStore = useApplicationStore(); @@ -286,6 +286,7 @@ const ExplorerContextMenu = observer( ); } + return ( {extraExplorerContextMenuItems} @@ -309,8 +310,7 @@ const ExplorerContextMenu = observer( )} ); - }, - { forwardRef: true }, + }), ); const ProjectConfig = observer(() => { @@ -453,41 +453,38 @@ const PackageTreeNodeContainer = observer( }, ); -const ExplorerDropdownMenu = observer( - () => { - const editorStore = useEditorStore(); - const _package = editorStore.explorerTreeState.getSelectedNodePackage(); - const createNewElement = - (type: string): (() => void) => - (): void => - editorStore.newElementState.openModal(type, _package); - - const elementTypes = ([PACKAGEABLE_ELEMENT_TYPE.PACKAGE] as string[]) - .concat(editorStore.getSupportedElementTypes()) - .filter( - // NOTE: we can only create package in root - (type) => - _package !== editorStore.graphManagerState.graph.root || - type === PACKAGEABLE_ELEMENT_TYPE.PACKAGE, - ); +const ExplorerDropdownMenu = observer(() => { + const editorStore = useEditorStore(); + const _package = editorStore.explorerTreeState.getSelectedNodePackage(); + const createNewElement = + (type: string): (() => void) => + (): void => + editorStore.newElementState.openModal(type, _package); - return ( - - {elementTypes.map((type) => ( - - - {getElementTypeIcon(editorStore, type)} - - - New {toTitleCase(getElementTypeLabel(editorStore, type))}... - - - ))} - + const elementTypes = ([PACKAGEABLE_ELEMENT_TYPE.PACKAGE] as string[]) + .concat(editorStore.getSupportedElementTypes()) + .filter( + // NOTE: we can only create package in root + (type) => + _package !== editorStore.graphManagerState.graph.root || + type === PACKAGEABLE_ELEMENT_TYPE.PACKAGE, ); - }, - { forwardRef: true }, -); + + return ( + + {elementTypes.map((type) => ( + + + {getElementTypeIcon(editorStore, type)} + + + New {toTitleCase(getElementTypeLabel(editorStore, type))}... + + + ))} + + ); +}); const ExplorerTrees = observer(() => { const editorStore = useEditorStore(); diff --git a/packages/legend-studio/src/components/editor/side-bar/ProjectOverview.tsx b/packages/legend-studio/src/components/editor/side-bar/ProjectOverview.tsx index f55e6d8012..dbf0508c87 100644 --- a/packages/legend-studio/src/components/editor/side-bar/ProjectOverview.tsx +++ b/packages/legend-studio/src/components/editor/side-bar/ProjectOverview.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useEffect, useState } from 'react'; +import { forwardRef, useEffect, useState } from 'react'; import { observer } from 'mobx-react-lite'; import { LEGEND_STUDIO_TEST_ID } from '../../LegendStudioTestID'; import { Link } from 'react-router-dom'; @@ -46,13 +46,13 @@ import { useEditorStore } from '../EditorStoreProvider'; import { useApplicationStore } from '@finos/legend-application'; import type { LegendStudioConfig } from '../../../application/LegendStudioConfig'; -const WorkspaceViewerContextMenu = observer< - { - workspace: Workspace; - }, - HTMLDivElement ->( - (props, ref) => { +const WorkspaceViewerContextMenu = observer( + forwardRef< + HTMLDivElement, + { + workspace: Workspace; + } + >(function WorkspaceViewerContextMenu(props, ref) { const { workspace } = props; const editorStore = useEditorStore(); const applicationStore = useApplicationStore(); @@ -70,8 +70,7 @@ const WorkspaceViewerContextMenu = observer<
); - }, - { forwardRef: true }, + }), ); const WorkspaceViewer = observer((props: { workspace: Workspace }) => { diff --git a/packages/legend-studio/src/components/editor/side-bar/WorkflowManager.tsx b/packages/legend-studio/src/components/editor/side-bar/WorkflowManager.tsx index b25bf7435e..262bda028d 100644 --- a/packages/legend-studio/src/components/editor/side-bar/WorkflowManager.tsx +++ b/packages/legend-studio/src/components/editor/side-bar/WorkflowManager.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useEffect } from 'react'; +import { forwardRef, useEffect } from 'react'; import { observer } from 'mobx-react-lite'; import { type TreeData, @@ -250,16 +250,17 @@ const WorkflowJobLogsViewer = observer( ); }, ); + const WorkflowExplorerContextMenu = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { workflowManagerState: WorkflowManagerState; workflowState: WorkflowState; node: WorkflowExplorerTreeNodeData; treeData: TreeData; - }, - ref: React.Ref, - ) => { + } + >(function WorkflowExplorerContextMenu(props, ref) { const { node, workflowManagerState, workflowState, treeData } = props; const retryJob = (): void => { if (node instanceof WorkflowJobTreeNodeData) { @@ -309,8 +310,7 @@ const WorkflowExplorerContextMenu = observer( )} ); - }, - { forwardRef: true }, + }), ); const WorkflowTreeNodeContainer: React.FC< @@ -339,6 +339,7 @@ const WorkflowTreeNodeContainer: React.FC< guaranteeType(node, WorkflowJobTreeNodeData).workflowJob.status, ); const selectNode: React.MouseEventHandler = (event) => onNodeSelect?.(node); + return ( (
); export const ReviewPanelHeaderTabContextMenu = observer( - ( - props: { + forwardRef< + HTMLDivElement, + { editorState: EditorState; - }, - ref: React.Ref, - ) => { + } + >(function ReviewPanelHeaderTabContextMenu(props, ref) { const { editorState } = props; const editorStore = useEditorStore(); const close = (): void => editorStore.closeState(editorState); @@ -65,8 +66,7 @@ export const ReviewPanelHeaderTabContextMenu = observer( ); - }, - { forwardRef: true }, + }), ); export const ReviewPanel = observer(() => { diff --git a/packages/legend-studio/src/components/setup/ProjectSelector.tsx b/packages/legend-studio/src/components/setup/ProjectSelector.tsx index f9c5c8ad89..00a86bdf41 100644 --- a/packages/legend-studio/src/components/setup/ProjectSelector.tsx +++ b/packages/legend-studio/src/components/setup/ProjectSelector.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useEffect } from 'react'; +import { forwardRef, useEffect } from 'react'; import { observer } from 'mobx-react-lite'; import type { ProjectOption } from '../../stores/SetupStore'; import { @@ -45,13 +45,13 @@ const formatOptionLabel = (option: ProjectOption): React.ReactNode => ( ); export const ProjectSelector = observer( - ( - props: { + forwardRef< + SelectComponent, + { onChange: (focusNext: boolean) => void; create: () => void; - }, - ref: React.Ref, - ) => { + } + >(function ProjectSelector(props, ref) { const { onChange, create } = props; const setupStore = useSetupStore(); const applicationStore = useApplicationStore(); @@ -95,13 +95,7 @@ export const ProjectSelector = observer( } onChange(false); } - }, [ - applicationStore, - setupStore.projects, - setupStore.currentProject, - currentProjectId, - onChange, - ]); + }, [applicationStore, setupStore.projects, setupStore.currentProject, currentProjectId, onChange]); const projectSelectorPlaceholder = isLoadingOptions ? 'Loading projects' @@ -144,6 +138,5 @@ export const ProjectSelector = observer( /> ); - }, - { forwardRef: true }, + }), ); diff --git a/packages/legend-studio/src/components/setup/WorkspaceSelector.tsx b/packages/legend-studio/src/components/setup/WorkspaceSelector.tsx index 51513d42d9..ccc01d9c3d 100644 --- a/packages/legend-studio/src/components/setup/WorkspaceSelector.tsx +++ b/packages/legend-studio/src/components/setup/WorkspaceSelector.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ -import { useEffect } from 'react'; +import { forwardRef, useEffect } from 'react'; import { observer } from 'mobx-react-lite'; import type { WorkspaceOption } from '../../stores/SetupStore'; import { WorkspaceType } from '@finos/legend-server-sdlc'; @@ -45,13 +45,13 @@ const formatOptionLabel = (option: WorkspaceOption): React.ReactNode => ( ); export const WorkspaceSelector = observer( - ( - props: { + forwardRef< + SelectComponent, + { onChange: (focusNext: boolean) => void; create: () => void; - }, - ref: React.Ref, - ) => { + } + >(function WorkspaceSelector(props, ref) { const { onChange, create } = props; const setupStore = useSetupStore(); const applicationStore = useApplicationStore(); @@ -90,12 +90,7 @@ export const WorkspaceSelector = observer( if (setupStore.currentProjectWorkspaces && !currentWorkspaceCompositeId) { onChange(false); } - }, [ - setupStore.currentProjectWorkspaces, - setupStore.currentProjectId, - currentWorkspaceCompositeId, - onChange, - ]); + }, [setupStore.currentProjectWorkspaces, setupStore.currentProjectId, currentWorkspaceCompositeId, onChange]); const workspaceSelectorPlacerHold = isLoadingOptions ? 'Loading workspaces' @@ -132,6 +127,5 @@ export const WorkspaceSelector = observer( /> ); - }, - { forwardRef: true }, + }), ); diff --git a/packages/legend-studio/src/stores/editor-state/element-editor-state/mapping/MappingElementDecorator.ts b/packages/legend-studio/src/stores/editor-state/element-editor-state/mapping/MappingElementDecorator.ts index be8f275afb..ddfb6dccf1 100644 --- a/packages/legend-studio/src/stores/editor-state/element-editor-state/mapping/MappingElementDecorator.ts +++ b/packages/legend-studio/src/stores/editor-state/element-editor-state/mapping/MappingElementDecorator.ts @@ -53,6 +53,7 @@ import { createStubRelationalOperationElement, EmbeddedRelationalInstanceSetImplementation, getEnumerationMappingsByEnumeration, + type TEMPORARY__UnresolvedSetImplementation, } from '@finos/legend-graph'; import type { DSLMapping_LegendStudioPlugin_Extension } from '../../../DSLMapping_LegendStudioPlugin_Extension'; import type { EditorStore } from '../../../EditorStore'; @@ -499,6 +500,12 @@ export class MappingElementDecorator implements SetImplementationVisitor { decorator(setImplementation); } } + + visit_TEMPORARY__UnresolvedSetImplementation( + setImplementation: TEMPORARY__UnresolvedSetImplementation, + ): void { + return; + } } /* @MARKER: ACTION ANALYTICS */ @@ -608,4 +615,10 @@ export class MappingElementDecorationCleaner decorationCleaner(setImplementation); } } + + visit_TEMPORARY__UnresolvedSetImplementation( + setImplementation: TEMPORARY__UnresolvedSetImplementation, + ): void { + return; + } } diff --git a/packages/legend-taxonomy-app/package.json b/packages/legend-taxonomy-app/package.json index 25f31be21f..e6b9e772b7 100644 --- a/packages/legend-taxonomy-app/package.json +++ b/packages/legend-taxonomy-app/package.json @@ -53,7 +53,7 @@ "eslint": "8.9.0", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "publishConfig": { diff --git a/packages/legend-taxonomy/package.json b/packages/legend-taxonomy/package.json index 994a543de1..f3b0fd15f9 100644 --- a/packages/legend-taxonomy/package.json +++ b/packages/legend-taxonomy/package.json @@ -49,7 +49,7 @@ "@types/react": "17.0.39", "@types/react-dom": "17.0.11", "@types/react-router-dom": "5.3.2", - "history": "5.2.0", + "history": "5.3.0", "mobx": "6.4.1", "mobx-react-lite": "3.3.0", "react": "17.0.2", @@ -67,7 +67,7 @@ "jest": "27.5.1", "npm-run-all": "4.1.5", "rimraf": "3.0.2", - "sass": "1.49.8", + "sass": "1.49.9", "typescript": "4.5.5" }, "peerDependencies": { diff --git a/packages/stylelint-config/package.json b/packages/stylelint-config/package.json index 662fd7ed08..3f7feb2783 100644 --- a/packages/stylelint-config/package.json +++ b/packages/stylelint-config/package.json @@ -30,7 +30,7 @@ "publish:snapshot": "node ../../scripts/release/publishDevSnapshot.js" }, "dependencies": { - "postcss": "8.4.6", + "postcss": "8.4.7", "postcss-scss": "4.0.3", "stylelint-config-prettier": "9.0.3", "stylelint-config-standard": "25.0.0", diff --git a/scripts/release/releaseVersionUtils.js b/scripts/release/releaseVersionUtils.js index 7b71ae2341..bdc6969c7c 100644 --- a/scripts/release/releaseVersionUtils.js +++ b/scripts/release/releaseVersionUtils.js @@ -41,9 +41,17 @@ const ITERATION_RELEASE_VERSION_BUMP_CHANGESET_PATH = resolve( `../../${ITERATION_RELEASE_VERSION_BUMP_CHANGESET_SHORT_PATH}`, ); +/** + * Changesets's `fixed` mode should guarantee that we do not miss any application packages + * when we bump version as long as they follow the right patterns. + * + * In fact, creating a simple changeset with just a single package like `@finos/legend-studio-app` + * is sufficient and listing out ALL packages in the changeset is overkill, but we do this anyway + * for completeness sake. + */ export const getPackagesToBumpVersion = () => { const changesetConfig = loadJSON(CHANGESET_CONFIG_PATH); - const patterns = changesetConfig.linked[0]; + const patterns = changesetConfig.fixed[0]; // NOTE: changeset's config structure could change so we would like to do some validation if (!Array.isArray(patterns) || patterns.length === 0) { console.log( diff --git a/yarn.lock b/yarn.lock index 7150422e4b..f86a7bcb69 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1973,7 +1973,7 @@ __metadata: "@types/react-router-dom": 5.3.2 cross-env: 7.0.3 eslint: 8.9.0 - history: 5.2.0 + history: 5.3.0 jest: 27.5.1 mobx: 6.4.1 mobx-react-lite: 3.3.0 @@ -1985,7 +1985,7 @@ __metadata: react-router: 5.2.1 react-router-dom: 5.3.0 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 serializr: 2.0.5 typescript: 4.5.5 peerDependencies: @@ -2027,7 +2027,7 @@ __metadata: react-select: 4.3.1 react-window: 1.8.6 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 typescript: 4.5.5 peerDependencies: react: ^17.0.0 @@ -2070,12 +2070,12 @@ __metadata: mini-css-extract-plugin: 2.5.3 monaco-editor: 0.32.1 monaco-editor-webpack-plugin: 7.0.1 - postcss: 8.4.6 + postcss: 8.4.7 postcss-loader: 6.2.1 react-refresh: 0.11.0 resolve: 1.22.0 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 sass-loader: 12.6.0 typescript: 4.5.5 webpack: 5.69.1 @@ -2111,7 +2111,7 @@ __metadata: react-router: 5.2.1 react-router-dom: 5.3.0 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 serializr: 2.0.5 typescript: 4.5.5 peerDependencies: @@ -2144,7 +2144,7 @@ __metadata: react-dom: 17.0.2 react-resize-detector: 7.0.0 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 serializr: 2.0.5 typescript: 4.5.5 peerDependencies: @@ -2174,7 +2174,7 @@ __metadata: react: 17.0.2 react-dnd: 15.1.1 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 serializr: 2.0.5 typescript: 4.5.5 peerDependencies: @@ -2203,7 +2203,7 @@ __metadata: npm-run-all: 4.1.5 react: 17.0.2 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 serializr: 2.0.5 typescript: 4.5.5 peerDependencies: @@ -2245,7 +2245,7 @@ __metadata: jest: 27.5.1 npm-run-all: 4.1.5 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 typescript: 4.5.5 languageName: unknown linkType: soft @@ -2271,7 +2271,7 @@ __metadata: npm-run-all: 4.1.5 react: 17.0.2 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 serializr: 2.0.5 typescript: 4.5.5 peerDependencies: @@ -2287,7 +2287,7 @@ __metadata: cross-env: 7.0.3 eslint: 8.9.0 fastify: 3.27.2 - fastify-cors: 6.0.2 + fastify-cors: 6.0.3 nodemon: 2.0.15 npm-run-all: 4.1.5 rimraf: 3.0.2 @@ -2402,7 +2402,7 @@ __metadata: npm-run-all: 4.1.5 react: 17.0.2 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 typescript: 4.5.5 languageName: unknown linkType: soft @@ -2449,7 +2449,7 @@ __metadata: cross-env: 7.0.3 date-fns: 2.28.0 eslint: 8.9.0 - history: 5.2.0 + history: 5.3.0 jest: 27.5.1 mobx: 6.4.1 mobx-react-lite: 3.3.0 @@ -2464,7 +2464,7 @@ __metadata: react-router: 5.2.1 react-router-dom: 5.3.0 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 typescript: 4.5.5 peerDependencies: react: ^17.0.0 @@ -2567,7 +2567,7 @@ __metadata: npm-run-all: 4.1.5 react: 17.0.2 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 typescript: 4.5.5 languageName: unknown linkType: soft @@ -2612,7 +2612,7 @@ __metadata: react: 17.0.2 react-router-dom: 5.3.0 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 typescript: 4.5.5 peerDependencies: react: ^17.0.0 @@ -2645,7 +2645,7 @@ __metadata: react: 17.0.2 react-dom: 17.0.2 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 typescript: 4.5.5 peerDependencies: react: ^17.0.0 @@ -2672,7 +2672,7 @@ __metadata: cross-env: 7.0.3 date-fns: 2.28.0 eslint: 8.9.0 - history: 5.2.0 + history: 5.3.0 jest: 27.5.1 mobx: 6.4.1 mobx-react-lite: 3.3.0 @@ -2688,7 +2688,7 @@ __metadata: react-router: 5.2.1 react-router-dom: 5.3.0 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 serializr: 2.0.5 sql-formatter: 4.0.2 typescript: 4.5.5 @@ -2713,7 +2713,7 @@ __metadata: npm-run-all: 4.1.5 react: 17.0.2 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 typescript: 4.5.5 languageName: unknown linkType: soft @@ -2754,7 +2754,7 @@ __metadata: "@types/react-router-dom": 5.3.2 cross-env: 7.0.3 eslint: 8.9.0 - history: 5.2.0 + history: 5.3.0 jest: 27.5.1 mobx: 6.4.1 mobx-react-lite: 3.3.0 @@ -2766,7 +2766,7 @@ __metadata: react-router: 5.2.1 react-router-dom: 5.3.0 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 serializr: 2.0.5 typescript: 4.5.5 peerDependencies: @@ -2800,7 +2800,7 @@ __metadata: dependencies: cross-env: 7.0.3 eslint: 8.9.0 - postcss: 8.4.6 + postcss: 8.4.7 postcss-scss: 4.0.3 rimraf: 3.0.2 stylelint-config-prettier: 9.0.3 @@ -3817,13 +3817,13 @@ __metadata: languageName: node linkType: hard -"@types/jest@npm:27.4.0": - version: 27.4.0 - resolution: "@types/jest@npm:27.4.0" +"@types/jest@npm:27.4.1": + version: 27.4.1 + resolution: "@types/jest@npm:27.4.1" dependencies: - jest-diff: ^27.0.0 + jest-matcher-utils: ^27.0.0 pretty-format: ^27.0.0 - checksum: d2350267f954f9a2e4a15e5f02fbf19a77abfb9fd9e57a954de1fb0e9a0d3d5f8d3646ac7d9c42aeb4b4d828d2e70624ec149c85bb50a48634a54eed8429e1f8 + checksum: 5184f3eef4832d01ee8f59bed15eec45ccc8e29c724a5e6ce37bf74396b37bdf04f557000f45ba4fc38ae6075cf9cfcce3d7a75abc981023c61ceb27230a93e4 languageName: node linkType: hard @@ -3894,13 +3894,20 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:17.0.19": +"@types/node@npm:*": version: 17.0.19 resolution: "@types/node@npm:17.0.19" checksum: 6bbd35bfc23dd50d1aefd4ae49c31f7fd632be209dba67c0322bb4fe8b555f4bb6e894018963146ad7758ae596857d5cbecc2d46ddf90a54f6a4424811cf4351 languageName: node linkType: hard +"@types/node@npm:17.0.21": + version: 17.0.21 + resolution: "@types/node@npm:17.0.21" + checksum: 89dcd2fe82f21d3634266f8384e9c865cf8af49685639fbdbd799bdd1040480fb1e8eeda2d3b9fce41edbe704d2a4be9f427118c4ae872e8d9bb7cbeb3c41a94 + languageName: node + linkType: hard + "@types/node@npm:^12.7.1": version: 12.20.46 resolution: "@types/node@npm:12.20.46" @@ -7400,13 +7407,13 @@ __metadata: languageName: node linkType: hard -"fastify-cors@npm:6.0.2": - version: 6.0.2 - resolution: "fastify-cors@npm:6.0.2" +"fastify-cors@npm:6.0.3": + version: 6.0.3 + resolution: "fastify-cors@npm:6.0.3" dependencies: fastify-plugin: ^3.0.0 vary: ^1.1.2 - checksum: f600eb30d2259bf0277c3df72c73f09f6891f3984c62e1c9a7489f0d6b2ffb1749dbe9a79a05ad74b08a660c1a707c9fb7636c20b87d07eae0e6efd9c951fd03 + checksum: 054cf4e1cf0b20778ac24d9995a99f44e9b026ca9a028db0cbb6093922bcc931dff5f5bb185d19e881014392bb5886a8b5f9da6af3d3ab5e62b7a68f4eca33c4 languageName: node linkType: hard @@ -7658,14 +7665,14 @@ __metadata: languageName: node linkType: hard -"fs-extra@npm:10.0.1": - version: 10.0.1 - resolution: "fs-extra@npm:10.0.1" +"fs-extra@npm:10.0.0": + version: 10.0.0 + resolution: "fs-extra@npm:10.0.0" dependencies: graceful-fs: ^4.2.0 jsonfile: ^6.0.1 universalify: ^2.0.0 - checksum: c1faaa5eb9e1c5c7c7ff09f966e93922ecb068ae1b04801cfc983ef05fcc1f66bfbb8d8d0b745c910014c7a2e7317fb6cf3bfe7390450c1157e3cc1a218f221d + checksum: 5285a3d8f34b917cf2b66af8c231a40c1623626e9d701a20051d3337be16c6d7cac94441c8b3732d47a92a2a027886ca93c69b6a4ae6aee3c89650d2a8880c0a languageName: node linkType: hard @@ -8126,12 +8133,12 @@ __metadata: languageName: node linkType: hard -"history@npm:5.2.0": - version: 5.2.0 - resolution: "history@npm:5.2.0" +"history@npm:5.3.0": + version: 5.3.0 + resolution: "history@npm:5.3.0" dependencies: "@babel/runtime": ^7.7.6 - checksum: 2c6a05aa86793e0a0857013457f34474c17f81a012c6bdb00bf30862389ac6a8c2df113d82176f67af2fd534ea9dc4e1218470c5526355b6fc1aefcc971f2eb2 + checksum: d73c35df49d19ac172f9547d30a21a26793e83f16a78386d99583b5bf1429cc980799fcf1827eb215d31816a6600684fba9686ce78104e23bd89ec239e7c726f languageName: node linkType: hard @@ -9198,7 +9205,7 @@ __metadata: languageName: node linkType: hard -"jest-diff@npm:^27.0.0, jest-diff@npm:^27.2.5, jest-diff@npm:^27.5.1": +"jest-diff@npm:^27.2.5, jest-diff@npm:^27.5.1": version: 27.5.1 resolution: "jest-diff@npm:27.5.1" dependencies: @@ -9339,7 +9346,7 @@ __metadata: languageName: node linkType: hard -"jest-matcher-utils@npm:^27.5.1": +"jest-matcher-utils@npm:^27.0.0, jest-matcher-utils@npm:^27.5.1": version: 27.5.1 resolution: "jest-matcher-utils@npm:27.5.1" dependencies: @@ -9866,13 +9873,13 @@ __metadata: "@finos/eslint-plugin-legend-studio": "workspace:*" "@finos/legend-dev-utils": "workspace:*" "@finos/stylelint-config-legend-studio": "workspace:*" - "@types/jest": 27.4.0 - "@types/node": 17.0.19 + "@types/jest": 27.4.1 + "@types/node": 17.0.21 chalk: 5.0.0 cross-env: 7.0.3 envinfo: 7.8.1 eslint: 8.9.0 - fs-extra: 10.0.1 + fs-extra: 10.0.0 husky: 7.0.4 inquirer: 8.2.0 jest: 27.5.1 @@ -9880,10 +9887,10 @@ __metadata: micromatch: 4.0.4 prettier: 2.5.1 rimraf: 3.0.2 - sass: 1.49.8 + sass: 1.49.9 semver: 7.3.5 sort-package-json: 1.54.0 - stylelint: 14.5.2 + stylelint: 14.5.3 typescript: 4.5.5 yargs: 17.3.1 languageName: unknown @@ -10710,7 +10717,7 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.2.0": +"nanoid@npm:^3.2.0, nanoid@npm:^3.3.1": version: 3.3.1 resolution: "nanoid@npm:3.3.1" bin: @@ -12002,7 +12009,18 @@ __metadata: languageName: node linkType: hard -"postcss@npm:8.4.6, postcss@npm:^8.4.5, postcss@npm:^8.4.6": +"postcss@npm:8.4.7": + version: 8.4.7 + resolution: "postcss@npm:8.4.7" + dependencies: + nanoid: ^3.3.1 + picocolors: ^1.0.0 + source-map-js: ^1.0.2 + checksum: a515ed36622edbee1d3ba153298d3b62ae9826dfa6de19204c2a6f975c8d3ad36808423b5119a9d82b78efd486de3ce35a1faf882a36ac8aa09492be4fbb7fe1 + languageName: node + linkType: hard + +"postcss@npm:^8.4.5, postcss@npm:^8.4.6": version: 8.4.6 resolution: "postcss@npm:8.4.6" dependencies: @@ -13021,16 +13039,16 @@ __metadata: languageName: node linkType: hard -"sass@npm:1.49.8": - version: 1.49.8 - resolution: "sass@npm:1.49.8" +"sass@npm:1.49.9": + version: 1.49.9 + resolution: "sass@npm:1.49.9" dependencies: chokidar: ">=3.0.0 <4.0.0" immutable: ^4.0.0 source-map-js: ">=0.6.2 <2.0.0" bin: sass: sass.js - checksum: ff4051c11223cb6e56ae62fa71448ed65b402949facfbd831f9781244eece9f1d22be45e61af8e0d0fbe186857de2613b07d9247b036ac2326c24e6ebd19bbbe + checksum: e5653e3499274c5127dcb5c9e7c5f6930378fc61764d999a5d8965782e027181ed09714f94836dec74ef55e3a858107fe6c571954c0cab0ad0be5ab8e586829c languageName: node linkType: hard @@ -13927,9 +13945,9 @@ __metadata: languageName: node linkType: hard -"stylelint@npm:14.5.2": - version: 14.5.2 - resolution: "stylelint@npm:14.5.2" +"stylelint@npm:14.5.3": + version: 14.5.3 + resolution: "stylelint@npm:14.5.3" dependencies: balanced-match: ^2.0.0 colord: ^2.9.2 @@ -13974,7 +13992,7 @@ __metadata: write-file-atomic: ^4.0.1 bin: stylelint: bin/stylelint.js - checksum: a54c42c8779c28d2dfade97fadac6040aad9581017f1f7cd28b9ed28e3cb3f1fe4c46a02fdbbd87e6eb497bb813e176063518a9cab0c4f0a4468e35e5d808354 + checksum: 5fadb61263e003fe791d6c8a31c48825e015a5fee909b0a484baad8d4a46622425409f18d2734a01e91405c825a5b3ccad943ed2298cd4f7df4a0a605c4d0292 languageName: node linkType: hard