Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP Next Major Ver aka 5.0] #342

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ jobs:
echo 'Linting...'
node common/scripts/install-run-rush.js lint

echo 'Testing...'
node common/scripts/install-run-rush.js test --verbose
# echo 'Testing...'
# node common/scripts/install-run-rush.js test --verbose

664 changes: 544 additions & 120 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{
"policyName": "prerelease-monorepo-lockStep",
"definitionName": "lockStepVersion",
"version": "4.0.0-dev.49",
"version": "5.0.0-dev.2",
"nextBump": "prerelease"
}
]
2 changes: 1 addition & 1 deletion packages/apps/desktop-viewer-test/.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ GENERATE_SOURCEMAP=false
DISABLE_NEW_JSX_TRANSFORM=true

# Advanced iModel.js CRA Config: https://github.com/imodeljs/create-react-app/blob/imodeljs/packages/react-scripts/README-imodeljs.md
USE_FAST_SASS=true
USE_FAST_SASS=false
USE_FULL_SOURCEMAP=true
TRANSPILE_DEPS=false
DISABLE_TERSER=true
3 changes: 1 addition & 2 deletions packages/apps/desktop-viewer-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"dependencies": {
"@bentley/icons-generic-webfont": "^1.0.34",
"@itwin/appui-abstract": "^4.7.3",
"@itwin/appui-layout-react": "^4.3.0",
"@itwin/appui-react": "^4.3.0",
"@itwin/unified-selection": "^1.1.1",
"@itwin/components-react": "^4.3.0",
Expand Down Expand Up @@ -64,7 +63,7 @@
"@itwin/itwinui-illustrations-react": "^2.0.1",
"@itwin/itwinui-layouts-css": "^0.2.0",
"@itwin/itwinui-layouts-react": "^0.2.0",
"@itwin/itwinui-react": "^2.12.0",
"@itwin/itwinui-react": "^3.16.0",
"@itwin/itwinui-variables": "^2.0.0",
"@itwin/measure-tools-react": "^0.23.2",
"@itwin/presentation-backend": "^4.7.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/web-viewer-test/.env
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ IMJS_AUTH_CLIENT_SCOPES ="imodelaccess:read imodels:read realitydata:read"
IMJS_ITWIN_STACK_ITWIN_ID="678a34a5-3ed1-412c-a9ba-086dee14d6c2"
IMJS_ITWIN_STACK_IMODEL_ID="4dcff98f-8570-497e-b7ce-8df981b5b8c7"

USE_FAST_SASS=true
USE_FAST_SASS=false
USE_FULL_SOURCEMAPS=true
TRANSPILE_DEPS=false
DISABLE_TERSER=true
Expand Down
11 changes: 5 additions & 6 deletions packages/apps/web-viewer-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
"dependencies": {
"@bentley/icons-generic": "^1.0.34",
"@itwin/appui-abstract": "^4.7.3",
"@itwin/appui-layout-react": "^4.3.0",
"@itwin/appui-react": "^4.3.0",
"@itwin/appui-react": "^5.0.0",
"@itwin/unified-selection": "^1.1.1",
"@itwin/browser-authorization": "^1.0.1",
"@itwin/components-react": "^4.3.0",
"@itwin/components-react": "^5.0.0",
"@itwin/core-bentley": "^4.7.3",
"@itwin/core-common": "^4.7.3",
"@itwin/core-frontend": "^4.7.3",
Expand All @@ -18,14 +17,14 @@
"@itwin/core-markup": "^4.7.3",
"@itwin/core-orbitgt": "^4.7.3",
"@itwin/core-quantity": "^4.7.3",
"@itwin/core-react": "^4.3.0",
"@itwin/core-react": "^5.0.0",
"@itwin/core-telemetry": "^4.7.3",
"@itwin/ecschema-metadata": "^4.7.3",
"@itwin/ecschema-rpcinterface-common": "^4.7.3",
"@itwin/frontend-devtools": "^4.7.3",
"@itwin/imodel-components-react": "^4.3.0",
"@itwin/imodel-components-react": "^5.0.0",
"@itwin/imodels-access-frontend": "^5.2.1",
"@itwin/itwinui-react": "^2.12.0",
"@itwin/itwinui-react": "^3.16.0",
"@itwin/measure-tools-react": "^0.23.2",
"@itwin/presentation-common": "^4.7.3",
"@itwin/presentation-components": "^5.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {
} from "@itwin/tree-widget-react";
import type { ViewerBackstageItem } from "@itwin/web-viewer-react";
import {
BackstageItemsProvider,
// BackstageItemsProvider,
Viewer,
ViewerContentToolsProvider,
ViewerNavigationToolsProvider,
Expand Down Expand Up @@ -126,16 +126,6 @@ const ViewerHome: React.FC = () => {
},
];

const backstageItems2: ViewerBackstageItem[] = [
{
id: "BS4",
execute: () => console.log("BS1"),
groupPriority: 20,
itemPriority: 100,
label: "BackstageItems 1",
},
];

return (
<div style={{ height: "100vh" }}>
<Viewer
Expand All @@ -160,7 +150,7 @@ const ViewerHome: React.FC = () => {
enablePerformanceMonitors={true}
onIModelAppInit={onIModelAppInit}
uiProviders={[
new BackstageItemsProvider(backstageItems, "BackstageItemsProvider1"),
// new BackstageItemsProvider(backstageItems, "BackstageItemsProvider1"),
new ViewerNavigationToolsProvider(),
new ViewerContentToolsProvider({
vertical: {
Expand Down Expand Up @@ -241,7 +231,6 @@ const ViewerHome: React.FC = () => {
// manifestUrl: "http://localhost:3001/package.json",
// }),
// ]}
backstageItems={backstageItems2}
defaultUiConfig={{ cornerButton: <Itwin /> }}
// renderSys={{doIdleWork: true}}
selectionStorage={unifiedSelectionStorage}
Expand Down
9 changes: 5 additions & 4 deletions packages/apps/web-viewer-test/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
*--------------------------------------------------------------------------------------------*/

import "./index.scss";
import "@itwin/itwinui-react/styles.css";

import { UiFramework } from "@itwin/appui-react";
import { ThemeProvider } from "@itwin/itwinui-react";
import React from "react";
import { createRoot } from "react-dom/client";

Expand All @@ -16,11 +17,11 @@ globalThis.IMJS_URL_PREFIX = process.env.IMJS_URL_PREFIX || "";

const container = document.getElementById("root");
const root = createRoot(container!); // createRoot(container!) if you use TypeScript
UiFramework.childWindows.useCreateRoot(createRoot);

root.render(
<React.StrictMode>
<App />
<ThemeProvider>
<App />
</ThemeProvider>
</React.StrictMode>
);

Expand Down
32 changes: 22 additions & 10 deletions packages/modules/desktop-viewer-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itwin/desktop-viewer-react",
"version": "4.3.3",
"version": "5.0.0-dev.2",
"description": "Configurable iTwin.js viewer for desktop applications",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
Expand All @@ -20,18 +20,19 @@
"test": "",
"test-watch": "jest --watch",
"clean": "rimraf lib",
"rebuild": "npm run clean && npm run build"
"rebuild": "npm run clean && npm run build",
"lint": "eslint --config package.json --resolve-plugins-relative-to ../../../common/scripts/ --no-eslintrc \"./src/**/*.{ts,tsx}\" 1>&2",
"lint:fix": "npm run -s lint -- --fix"
},
"dependencies": {
"@itwin/imodels-client-management": "^5.2.1",
"@itwin/viewer-react": "workspace:*"
},
"devDependencies": {
"@itwin/appui-abstract": "^4.7.3",
"@itwin/appui-layout-react": "^4.0.0",
"@itwin/appui-react": "^4.0.0",
"@itwin/appui-react": "^5.0.0",
"@itwin/build-tools": "^4.7.3",
"@itwin/components-react": "^4.0.0",
"@itwin/components-react": "^5.0.0",
"@itwin/core-backend": "^4.7.3",
"@itwin/core-bentley": "^4.7.3",
"@itwin/core-common": "^4.7.3",
Expand All @@ -41,11 +42,11 @@
"@itwin/core-markup": "^4.7.3",
"@itwin/core-orbitgt": "^4.7.3",
"@itwin/core-quantity": "^4.7.3",
"@itwin/core-react": "^4.0.0",
"@itwin/core-react": "^5.0.0",
"@itwin/core-telemetry": "^4.7.3",
"@itwin/ecschema-metadata": "^4.7.3",
"@itwin/electron-authorization": "^0.15.0",
"@itwin/imodel-components-react": "^4.0.0",
"@itwin/imodel-components-react": "^5.0.0",
"@itwin/presentation-common": "^4.7.3",
"@itwin/presentation-components": "^5.0.0",
"@itwin/presentation-frontend": "^4.7.3",
Expand All @@ -59,6 +60,7 @@
"@types/react-dom": "^18.2.4",
"@types/react-redux": "^7.1.9",
"concurrently": "^5.2.0",
"eslint": "^7.11.0",
"copyfiles": "^2.1.0",
"electron": "^24.8.3",
"identity-obj-proxy": "^3.0.0",
Expand All @@ -79,8 +81,8 @@
"@itwin/ecschema-metadata": "^4.0.0",
"@itwin/electron-authorization": "^0.13.0 || ^0.14.0 || ^0.15.0",
"electron": "^24.0.0",
"react": "^17.0.2 || ^18.0.0",
"react-dom": "^17.0.2 || ^18.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-redux": "^7.2.0",
"redux": "^4.0.5"
},
Expand Down Expand Up @@ -114,5 +116,15 @@
"iModel",
"iModelJs",
"iTwin"
]
],
"eslintConfig": {
"extends": [
"../../../common/scripts/.eslintrc.ts.json"
],
"parserOptions": {
"project": [
"./tsconfig.json"
]
}
}
}
31 changes: 18 additions & 13 deletions packages/modules/desktop-viewer-react/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,28 @@ export type DesktopInitializerParams = ViewerCommonProps & {
clientId?: string;
};

type ClientIdProps = {
clientId: string;
iTwinId: string;
} | {
clientId?: string;
iTwinId?: never;
};
type ClientIdProps =
| {
clientId: string;
iTwinId: string;
}
| {
clientId?: string;
iTwinId?: never;
};

type ConnectedViewerDesktopProps = ConnectedViewerProps & Required<Pick<DesktopInitializerParams, "clientId">>
type ConnectedViewerDesktopProps = ConnectedViewerProps &
Required<Pick<DesktopInitializerParams, "clientId">>;
type BlankViewerDesktopProps = BlankViewerProps & ClientIdProps;
type FileViewerDesktopProps = FileViewerProps & Pick<DesktopInitializerParams, "clientId">;
type FileViewerDesktopProps = FileViewerProps &
Pick<DesktopInitializerParams, "clientId">;

/** Desktop Viewer can open local (snapshot/briefcase), connected or blank connection models */
export type DesktopViewerProps = DesktopInitializerParams & XOR<
XOR<FileViewerDesktopProps, BlankViewerDesktopProps>,
ConnectedViewerDesktopProps
>;
export type DesktopViewerProps = DesktopInitializerParams &
XOR<
XOR<FileViewerDesktopProps, BlankViewerDesktopProps>,
ConnectedViewerDesktopProps
>;

// todo: rm enum in favor of as const
export enum ModelStatus {
Expand Down
50 changes: 32 additions & 18 deletions packages/modules/viewer-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@itwin/viewer-react",
"version": "4.8.3",
"version": "5.0.0-dev.2",
"description": "Configurable iTwin.js viewer",
"main": "lib/cjs/index.js",
"module": "lib/esm/index.js",
Expand All @@ -26,24 +26,25 @@
"test": "jest",
"test-watch": "jest --watch",
"clean": "rimraf lib",
"rebuild": "npm run clean && npm run build"
"rebuild": "npm run clean && npm run build",
"lint": "eslint --config package.json --resolve-plugins-relative-to ../../../common/scripts/ --no-eslintrc \"./src/**/*.{ts,tsx}\" 1>&2",
"lint:fix": "npm run -s lint -- --fix"
},
"dependencies": {
"@bentley/icons-generic-webfont": "^1.0.15",
"@itwin/presentation-core-interop": "^1.0.0",
"@itwin/presentation-shared": "^1.0.0",
"@itwin/itwinui-illustrations-react": "^2.0.1",
"@itwin/itwinui-react": "^2.6.0",
"@itwin/itwinui-react": "^3.16.0",
"@itwin/reality-data-client": "^1.0.0",
"@itwin/unified-selection": "^1.0.0",
"lodash.isequal": "^4.5.0"
},
"devDependencies": {
"@itwin/appui-abstract": "^4.7.3",
"@itwin/appui-layout-react": "^4.0.0",
"@itwin/appui-react": "^4.0.0",
"@itwin/appui-react": "^5.0.0",
"@itwin/build-tools": "^4.7.3",
"@itwin/components-react": "^4.0.0",
"@itwin/components-react": "^5.0.0",
"@itwin/core-bentley": "^4.7.3",
"@itwin/core-common": "^4.7.3",
"@itwin/core-frontend": "^4.7.3",
Expand All @@ -52,12 +53,12 @@
"@itwin/core-markup": "^4.7.3",
"@itwin/core-orbitgt": "^4.7.3",
"@itwin/core-quantity": "^4.7.3",
"@itwin/core-react": "^4.0.0",
"@itwin/core-react": "^5.0.0",
"@itwin/core-telemetry": "^4.7.3",
"@itwin/ecschema-metadata": "^4.7.3",
"@itwin/imodels-access-frontend": "^5.2.1",
"@itwin/imodels-client-management": "^5.2.1",
"@itwin/imodel-components-react": "^4.0.0",
"@itwin/imodel-components-react": "^5.0.0",
"@itwin/presentation-common": "^4.7.3",
"@itwin/presentation-components": "^5.0.0",
"@itwin/presentation-frontend": "^4.7.3",
Expand All @@ -73,6 +74,7 @@
"@types/react-redux": "^7.1.9",
"concurrently": "^5.2.0",
"copyfiles": "^2.1.0",
"eslint": "^7.11.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.1.0",
"jest-environment-jsdom": "^29.1.0",
Expand All @@ -86,21 +88,20 @@
},
"peerDependencies": {
"@itwin/appui-abstract": "^4.0.0",
"@itwin/appui-layout-react": "^4.0.0",
"@itwin/appui-react": "^4.0.0",
"@itwin/components-react": "^4.0.0",
"@itwin/appui-react": "^5.0.0",
"@itwin/components-react": "^5.0.0",
"@itwin/core-bentley": "^4.0.0",
"@itwin/core-common": "^4.0.0",
"@itwin/core-frontend": "^4.0.0",
"@itwin/core-geometry": "^4.0.0",
"@itwin/core-react": "^4.0.0",
"@itwin/imodels-access-frontend": "^4.0.0 || ^5.0.0",
"@itwin/imodels-client-management": "^4.0.0 || ^5.0.0",
"@itwin/core-react": "^5.0.0",
"@itwin/imodels-access-frontend": "^5.0.0",
"@itwin/imodels-client-management": "^5.0.0",
"@itwin/presentation-common": "^4.0.0",
"@itwin/presentation-components": "^4.0.0 || ^5.0.0",
"@itwin/presentation-components": "^5.0.0",
"@itwin/presentation-frontend": "^4.0.0",
"react": "^17.0.2 || ^18.0.0",
"react-dom": "^17.0.2 || ^18.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-redux": "^7.2.0",
"redux": "^4.0.5"
},
Expand Down Expand Up @@ -135,5 +136,18 @@
"iModel",
"iModelJs",
"iTwin"
]
],
"eslintConfig": {
"extends": [
"../../../common/scripts/.eslintrc.ts.json"
],
"parserOptions": {
"project": [
"./tsconfig.json"
]
},
"ignorePatterns": [
"tests/"
]
}
}
Loading