Git Product home page Git Product logo

itwin / itwinjs-core Goto Github PK

View Code? Open in Web Editor NEW
583.0 71.0 211.0 493.27 MB

Monorepo for iTwin.js Library

Home Page: https://www.itwinjs.org

License: MIT License

JavaScript 0.63% TypeScript 98.94% CSS 0.03% Batchfile 0.01% HTML 0.01% Dockerfile 0.01% Objective-C 0.02% Objective-C++ 0.01% Swift 0.20% Shell 0.02% GAP 0.01% Python 0.09% Kotlin 0.05%
imodel bentley bim webgl nodejs sqlite autodesk monorepo rush typescript

itwinjs-core's Introduction

iTwin.js

Copyright © Bentley Systems, Incorporated. All rights reserved. See LICENSE.md for license terms and full copyright notice.

iTwin.js is an open source platform for creating, querying, modifying, and displaying Infrastructure Digital Twins.

If you have questions, or wish to contribute to iTwin.js, see our Contributing guide.

About this Repository

Build status

This repository is a monorepo that holds the source code to multiple iTwin.js npm packages. It is built using Rush.

See rush.json for the complete list of packages and Versioning.md for package and API versioning policies.

Each package has its own node_modules directory that contains symbolic links to common dependencies managed by Rush.

Prerequisites

  • Git
  • Node: an installation of the latest security patch of Node 20. The Node installation also includes the npm package manager.
  • Rush: to install npm install -g @microsoft/rush
  • TypeScript: this is listed as a devDependency, so if you're building it from source, you will get it with rush install.
  • Visual Studio Code: an optional dependency, but the repository structure is optimized for its use

See supported platforms for further information.

Build Instructions

  1. Clone repository (first time) with git clone or pull updates to the repository (subsequent times) with git pull
  2. Install dependencies: rush install
  3. Clean: rush clean
  4. Build source: rush build
  5. Run tests: rush cover

The -v option for rush is short for --verbose which results in a more verbose command.

The above commands iterate and perform their action against each package in the monorepo.

If you get an error similar to the following, it means that the repo has stopped making use of an npm package that was used in the past.

[Error: ENOENT: no such file or directory, stat '/.../itwinjs-core/test-apps/display-test-app/node_modules/@bentley/react-scripts']

To fix this build error, you should completely remove the node_modules directory that is referenced in the error with rush purge, and then rerun rush install.

For incremental builds, the rush build command can be used to only build packages that have changes versus rush rebuild which always rebuilds all packages.

Note: It is a good idea to rush install after each git pull as dependencies may have changed.

Source Code Edit Workflow

  1. Make source code changes on a new Git branch
  2. Ensure unit tests pass when run locally: rush cover
  3. Ensure linting passes when run locally: rush lint
  4. Locally commit changes: git commit (or use the Visual Studio Code user interface)
  5. Repeat steps 1-4 until ready to push changes
  6. Check for API signature changes: rush extract-api. This will update the signature files, located in common/api. Note: before doing this, first do the following:
    • Be sure that your branch is up to date with the target branch (i.e. git merge origin/master)
    • Cleanup your build output: rush clean
    • Rebuild the project: rush build
  7. Review any diffs to the API signature files in the common/api directory to ensure they are compatible with the intended release of the package.
    • If any differences are in packages not modified on this branch, revert the changes before committing.
  8. Add changelog entry (which could potentially cover several commits): rush change
  9. Follow prompts to enter a change description or press ENTER if the change does not warrant a changelog entry. If multiple packages have changed, multiple sets of prompts will be presented. If the changes are only to non-published packages (like display-test-app), then rush change will indicate that a changelog entry is not needed.
  10. Completing the rush change prompts will cause new changelog entry JSON files to be created.
  11. Add and commit the changelog JSON files and any API signature updates.
  12. Publish changes on the branch and open a pull request.

If using the command line, steps 8 through 11 above can be completed in one step by running rushchange.bat from the imodeljs root directory. Only use rushchange.bat if none of the changes require a changelog entry.

Note: The CI build will break if changes are pushed without running rush change and rush extract-api (if the API was changed). The fix will be to complete steps 6 through 11.

Here is a sample changelog to demonstrate the level of detail expected.

Updating dependencies/devDependencies on packages within the monorepo

The version numbers of internal dependencies should not be manually edited. These will be automatically updated by the overall version bump workflow. Note that the packages are published by CI builds only.

Updating dependencies/devDependencies on packages external to monorepo

Use these instructions to update dependencies and devDependencies on external packages (ones that live outside of this monorepo).

  1. Edit the appropriate package.json file to update the semantic version range
  2. Run rush check to make sure that you are specifying consistent versions across the repository
  3. Run rush update to make sure the newer version of the module specified in #1 is installed

Other NPM Scripts

  1. Build TypeDoc documentation for all packages: rush docs
  2. Build TypeDoc documentation for a single package: cd core\backend and then npm run docs

itwinjs-core's People

Contributors

aruniverse avatar bbastings avatar bd041556 avatar bsteinbk avatar calebmshafer avatar christophermlawson avatar daneastbentley avatar earlinlutz avatar gerardasb avatar grigasp avatar hnn0003 avatar imodeljs-admin avatar jason-crow avatar jffmarker avatar kabentley avatar khanaffan avatar marcneely avatar markschlosseratbentley avatar nancymccallb avatar nick4598 avatar pmconne avatar ramanujam-raman-zz avatar rbbentley avatar saskliutas avatar scsewall avatar skirby1996 avatar swbsi avatar swwilson-bsi avatar wgoehrig avatar williamkbentley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

itwinjs-core's Issues

Failed to run build via npm

Hi,
I am getting the following error when I try to run the build after installing npm.

Note: I had to install via npm i npm@latest because the standard npm install command was also causing an error.

I am trying to run on MacOS Majave (10.14.5 (18F132)).

Regards,
Stephen.

2019-09-03T14_10_35_087Z-debug.log

Where create sample projects can be viewed?

Hi,

I requested to create new sample project and I received an e-mail the project and the iModel were created.

Where I can see (to list) the project (or more projects in future)? I expected it will be in my ProjectWise projects list, but I see only the empty project, not iModel. Maybe I did wrong that I created the project with the requested name upfront (before the request was sent).

With regards,

Jan

When trying to use the simple-viewer-app with own imodel it keeps giving Error 400

I've tried several times to run the simple-viewer-app with my own imodel loaded through the registered projects and it keeps returning Error 400 Unautorized Client. unauthorized_client - Invalid scope for client. @timestamp < DateTime('2019-08-30T11:01:40.588520Z') and RequestId='0HLP4PU9GMUMV:000003BB'

Could you please advise what could be the issue? I've done it well with the sample model previously so not sure why I can't do it with my own imodel.


⚠ Do not edit this section. It is required for imodeljs.github.io ➟ GitHub issue linking

Running test apps over SSL

Hello I have configured a self-signed cert for my localhost and have a key/cert file. I noticed that the "start:webserver" command will start a core Bentley webserver which is a wrapper of express server. Is there a way to pass parameters to it for the keyfile and certfile locations? Looking at the code it does not look like it is leveraging those options at the moment. https://github.com/imodeljs/imodeljs/blob/master/core/webserver/src/WebServer.ts

I require SSL for my application. Thank you advance of any advice.

Feature request: Callback for event listener error

I have a listener service for imodelhub event and creating listener would a great method to use. But the issue is that when something went wrong the listener stops and there's no feedback if the listener is stopped. It would be great if we can provide a callback for error like for do for processGlobalEvent.


⚠ Do not edit this section. It is required for imodeljs.github.io ➟ GitHub issue linking

How to change the viewport to a drawing selected from tree

How can the viewport be updated to a selected drawing using the simple-viewer-app as an example code base? E.g. App.tsx has an event (onSelectionChanged) allowing the user to retrieve the view id of the selected drawing. I would like to use this view id to update the viewport to the selected drawing content.


⚠ Do not edit this section. It is required for imodeljs.github.io ➟ GitHub issue linking

Error 400

after Edit src/common/configuration.ts and src/common/config.json to set the values you obtain from the registration process. but can not login,Error 400 ,why?


⚠ Do not edit this section. It is required for imodeljs.github.io ➟ GitHub issue linking

Roadmap to 1.0

Hi,

Amazing to see this from Bentley Systems. It really helps a lot with a stable production ready 1.0 release.

Do you have any roadmap and plan to a production ready 1.0?

Thanks

How can I publish mobile terminal

We are planning to use imodesjs on mobile terminal recently, but I have seen few materials on the network, could you please provide me with more learning materials on mobile terminal development

Pricing for iTwin subscription?

I dont know if this is the right place to ask, but where can we find information about pricing for iTwin subscription?
Regards
Helge

3d party IMODEL import/export file converter

Hi. We are looking in to possibilitys of creating a 3d party IMODEL import/export file converter ( import and export IMODEL files to/from a third party software ). For a simple import/export fileconverter, is it corect that you will have to have a full itwin suscription to be able to use/run the converter? Or is there any way to use the converter without a suscription ( Forexample if you are not interested in using the Imodelhub, but just want to convert in to local IMODEL file )

OPC UA server?

How about adding support for OPC UA? An OPC UA server on the imodel hub would publish OPC UA model change events. You could use Node OPCUA...

Should IModelConnection.openSnapshot() require a connection to IModelHub?

In the documentation and issues it says IModelConnection.openStandalone() is being removed in order to streamline operations through IModelConnection.openSnapshot(). The documentation however says we shouldn't use this in a web front-end. Can I use this? I am trying to "work offline" with the sample app in a web browser in order to try openSnapshot with a local file and I am getting an error stating I hav an invalid token for RPC operation request. I expected this would not need to talk to iModelHub since it's a snapshot. Thx

which format file are supported by imodeljs?

i try to read .imodel but failed, which format files are supported by imodeljs?(.model,.i.dgn,...?)
image


my SP_suidao1p6.imodel 's version is v1.6,while published by OpenRoads Designer(the original file is .dgn),

First attempt failed

Managed to get it up an running on Ubuntu, but there was an error message when I tried to connect to the sample project - usinjg the sample viewer app as a test.

Recieved this from bentley:
Från: [email protected]
Datum: 2018-11-01 13:35 (GMT+01:00)
Rubrik: Your Sample IModel Project has been created

Sample IModel Project was created with Project Name: 2114_dev, and IModel Name: 2114_dev

My configuration.ts
imjs_test_project : "2114_dev", // Set this to the name of the sample project
imjs_test_imodel : "2114_dev", // Set this to the name of the sample iModel

But the error message after pressing Open Sample Imodel is:

Project with name "2114_dev" does not exist

A solution to the problem of merging multiple imodel files

I downloaded the source code of imodeljs, and I found that there is an IModelImporter class that can merge and output two different imodel files.However, when I use this method for model merge presentation, I will report an error in the process of merging. Is there any detailed documentation about this class? Or what other ways can I realize the merging of multiple imodel files?Looking forward to your reply.

Uploading Pointcloud Data into an Imodel based Platform

Hello,
I've just discovered Imodel, and I'm thinking about developing a website that is based on Imodel api's, the website will serve to upload bim model and pointcloud data to help visualize construction development. Is it possible to do it using Imodel api's, uploading pointcloud data extension .las and bim model extension .ifc ?

Expiration emails

There appears to be an issue with the email expiration logic. I received more than 150 "InspectTechTestProject is about to expire" emails over the span of two days. Each email was about 10 minutes apart.

Compiling errors with FileReaderRpcInterface

I got compile errors when trying to use your example in
https://medium.com/imodeljs/imodel-js-meets-csv-part-1-3-79a8ffde51da

-------- Operation: Compile .tsc files --------
Errors:
src/common/FileReaderRpcImpl.ts(9,53): error TS2345: Argument of type 'typeof FileReaderRpcInterface' is not assignable to parameter of type 'RpcInterfaceDefinition'.
Type 'typeof FileReaderRpcInterface' is missing the following properties from type 'RpcInterfaceDefinition': interfaceName, interfaceVersion
src/common/FileReaderRpcInterface.ts(8,95): error TS2345: Argument of type 'typeof FileReaderRpcInterface' is not assignable to parameter of type 'RpcInterfaceDefinition'.
Type 'typeof FileReaderRpcInterface' is missing the following properties from type 'RpcInterfaceDefinition': interfaceName, interfaceVersion
src/common/rpcs.ts(16,2): error TS2304: Cannot find name 'FileReaderRpcInterface'.
src/frontend/components/App.tsx(20,38): error TS2307: Cannot find module '../common/FileReaderRpcInterface'.

FileReaderRpcInterface.ts
import { RpcInterface, IModelToken, RpcManager } from "@bentley/imodeljs-common";

//file reader interface for the frontend
export abstract class FileReaderRpcInterface extends RpcInterface {
public static types = () => [IModelToken];
public static version = "1.0.0"; // The API version of the interface

public static getClient(): FileReaderRpcInterface { return RpcManager.getClientForInterface(this); }
public async fetchInfo (_token: IModelToken): Promise<any[]> { return this.forward.apply(this, arguments as any) as any;}
}

FileReaderRpcImpl.ts
import { RpcManager, IModelToken } from "@bentley/imodeljs-common";
import { FileReaderRpcInterface } from "../common/FileReaderRpcInterface";
import * as fs from "fs";
//import * as parse from "csv-parse/lib/sync";

// Implement FileReaderRpcInterface
export class FileReaderRpcImpl extends FileReaderRpcInterface {
public static register() {RpcManager.registerImpl(FileReaderRpcInterface, FileReaderRpcImpl);}
private _filePath = "assets/testdata.csv";

public async fetchInfo(_token: IModelToken): Promise<any[]> {
const data: any = fs.readFileSync(this._filePath, "utf8");
//const info = parse(data, {delimiter: ",",columns: ["status", "component_id"]});
//return info;
return data;
}
}

rpct.ts
import { RpcInterfaceDefinition, IModelReadRpcInterface, IModelTileRpcInterface, SnapshotIModelRpcInterface } from "@bentley/imodeljs-common";
import { PresentationRpcInterface } from "@bentley/presentation-common";
import {FileReaderRpcInterface} from "../common/FileReaderRpcInterface";

/**

  • Returns a list of RPCs supported by this application
    */
    export default function getSupportedRpcs(): RpcInterfaceDefinition[] {
    return [
    IModelReadRpcInterface,
    IModelTileRpcInterface,
    FileReaderRpcInterface,
    PresentationRpcInterface,
    SnapshotIModelRpcInterface,
    ];
    }

iModel 1.0

Will this work with iModel 1.0 files?

Are EC schema the same / compatible with older ones?

Hi,

when reading documenation EC schemas, I have not found any comparison or information about "compatibility" with existing EC schemas as used in V8i and CONNECT Edition products.

Questions that crossed my mind:

  • Are EC schemas used in iModelJs the same? E.g. version information is based on 3 digits (I like an idea behing the digits meaning :-), but now 2 digits are used, so it seems the schemas itself developed into new version / syntax.
  • Are schemas available also as XML?
  • What about compatibility with existing schemas tool like Bentley Class Editor or iModel Schema Editor?
  • What about compatibility with DGN storage? Now MicroStation is able to import EC schemas into DGN file, which creates self-contained repository (similar to iModel SQLite). Is such scenario applicable also for new EC schemas?

With regards,

Jan

Official provided examples of measurement error problems

When I ran the official UI example, I found the following error when I opened imodel in local mode:

Plµgíñ 'MeasurePoints' vërsìøñ próblèms éñçòûñtërèd

Mòdùlê main ïs ñøt lòádèd Mòdùlê react ïs ñøt lòádèd Mòdùlê react-dom ïs ñøt lòádèd Mòdùlê redux ïs ñøt lòádèd Mòdùlê lodash ïs ñøt lòádèd Mòdùlê inspire-tree ïs ñøt lòádèd Mòdùlê react-dnd ïs ñøt lòádèd Mòdùlê react-dnd-html5-backend ïs ñøt lòádèd Mòdùlê react-redux ïs ñøt lòádèd!
How to solve this problem? Thank you

login issue

We are trying to run the simple-viewer-app which you have provided on github, but get the loginfailed error when trying to open the sample iModel.

loginissue_1

We have made changes in configuration.ts as per your documentation

loginissue_2
Can you please advise on the error? Also, where do we upload .i.dgn (ie iModels) to be able to access this model? Do you have sample iModels for us to try out?

Thanks in advance.

Fetching...failed?Error: 404 Not Found.

Hi,
we want to test the display-test-app, when we try to Install dependencies(rush install),
the following installation errors will occur.

image
image
image

How can we solve this problem?
Regards,
He, China

Bis Documentation?

Hi, I am new to iModel 2.0. I am trying understand the concepts of BIS, and its role in interdisciplinary infrastructure modeling. Is there any documentation on the subject?

Some questions regarding iModel and iModel.js

Hi,

I have some questions regarding iModel and iModel.js that I hope someone here can answer. If this is the wrong place for one or more of the questions below I would appreciate feedback on that as well.

  1. I understand the C++ SDKs for iModel are only for iModel 1.x and will no longer be developed, is that correct?
  2. Are there any plans for publishing a C++/C library for reading iModel 2.x? For a lot of existing applications, including SW products that I am involved with, it will be quite difficult to integrate with iModel.js without doing a complete rewrite or making a converter using iModel.js and Electron.
  3. We currently use a library from ODA (previously called Teigha) to import CAD files (e.g. DGN, DWG etc.) into our software. As Bentley is founding/corporate member of the ODA, are there any concrete plans and timeline to add support for iModel in ODA?
  4. Regarding the iModel.js native module license (https://github.com/imodeljs/imodeljs/blob/master/core/backend/src/imodeljs-native-LICENSE.md) are there any restrictions on including this in a commercial product?

rush install error

"rush install" command is not successful on Mac OS NodeJS - v12.13.1
Error: Command failed: npm install --no-save @bentley/imodeljs-darwin-x64@1.
│ npm ERR! code E404
│ npm ERR! 404 Not Found - GET https://registry.npmjs.org/@bentley%2fimodeljs-
│ npm ERR! 404
│ npm ERR! 404 '@bentley/[email protected]' is not in the npm registr
│ npm ERR! 404 You should bug the author to publish it (or use the name yourse

Error 400: "invalid_request invalid redirect_uri" on sign-in

I get the following error when I sign into the simple-viewer-app after I set it up following the instructions provided.

redirect_1

This happens if I use my client-id along with the default redirect-path (imjs_test_oidc_redirect_path) provided in the configuration.ts file.

redirect_3

The reason for this is that there is currently a mismatch between the default redirect_path in the config vs. the default provided in the registration form (ie. signin-oidc vs. signin-callback).

redirect_2

The iModel.js team has been notified about this discrepancy and a fix is currently underway. As a work-around for those who have already registered using the default redirect path simply update the imjs_test_oidc_redirect_path as follows:

redirect_4

Thanks,
Roop

On server processing?

Hi,

it's more a thought than issue reporting:

As far as I remember iModelJs library now, it's based on classic client - server schema. My question is whether a server processing has been evaluated as possible future iModelHub feature?

Because iModelHub is designed as digital twin repository, I suppose some analysis will require to access all data, which maybe time and resource consuming to create in a form of briefcase to the client.

With regards,

  

iModel Upload,outdated file

@Josh-Schifter 

微信截图_20191122103139
I am a novice. I have some problems when I register the project. Can you teach me,Thanks

When creating projects with own imodel file just keep loading.

When trying to register a new projects with my own .imodel file created from publishing a single package of a 2.0 .idgn. the system just keeps spinning and projects don't get created. It is even not relevant the size of the file. At present I have 2 projects pending creation for a couple of days without success so far.


⚠ Do not edit this section. It is required for imodeljs.github.io ➟ GitHub issue linking

Handling authenticationCallback errors

When we are creating a listener for Global Events we have to provide an authentication callback. Some times due to connectivity issue the authentication callback that we are providing had to throw an error because it's failed to fetch the token. I'm getting an error of unhandled promise rejection from the iModelJs library. Is there any better way to handle this issue?

npm run start is throwing error

I was able to do "npm install" without any issues. But with "npm run start" i am getting exception as attached.
I am not sure how to debug. Is there a recommended reading on basics of Typescript/Javascript?

capture

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.