Skip to content

Commit

Permalink
[Tree-widget]: learning snippets (#1031)
Browse files Browse the repository at this point in the history
* initial tests

* test fixes and aditional tests

* Tree widget left over tests

* cleanup

* Update dependencies

* warning fixes

* readMe adjustments

* cleanUp

* cleanup

* dependencies and act warning fixes

* import fix

* fix

* small fixes

* Change

* import order fix

* fixes

* Update change/@itwin-tree-widget-react-0bdfd58a-2c3d-4499-9a14-66ff2ac7a367.json

Co-authored-by: Grigas <[email protected]>

* Fixes

* fixes

* readme adjustments

* pipeline fix

* Partial fixes

* Update apps/learning-snippets/src/test/tree-widget/Telemetry.test.tsx

Co-authored-by: Grigas <[email protected]>

* fixes

* fix

* Destructure useButtonProps result

* lint

---------

Co-authored-by: Grigas <[email protected]>
Co-authored-by: Saulius.Skliutas <[email protected]>
  • Loading branch information
3 people authored Sep 6, 2024
1 parent b000452 commit f9354fe
Show file tree
Hide file tree
Showing 29 changed files with 10,277 additions and 241 deletions.
18 changes: 17 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,22 @@
"outFiles": [
"${workspaceFolder}/packages/itwin/map-layers/lib/**/*.js"
]
},
{
"name": "Tests: Learning-snippets",
"cwd": "${workspaceFolder}/apps/learning-snippets",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/apps/learning-snippets/node_modules/mocha/bin/_mocha",
"args": [
"--config",
"./.mocharc.json",
"--no-timeouts",
"lib/test/**/*.test.js"
],
"outFiles": [
"${workspaceFolder}/apps/learning-snippets/lib/**/*.js"
]
}
]
}
}
24 changes: 24 additions & 0 deletions apps/learning-snippets/.mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"require": [
"raf/polyfill",
"ignore-styles"
],
"check-leaks": true,
"timeout": "60000",
"globals": [
"IS_REACT_ACT_ENVIRONMENT"
],
"file": [
"./lib/test/setup.js"
],
"ignore": [
"lib/coverage/**/*"
],
"reporter": "node_modules/@itwin/build-tools/mocha-reporter",
"reporter-option": [
"mochaFile=lib/test/junit_results.xml"
],
"spec": [
"./lib/test/**/*.test.js"
]
}
42 changes: 42 additions & 0 deletions apps/learning-snippets/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
const iTwinPlugin = require("@itwin/eslint-plugin");
const reactPlugin = require("eslint-plugin-react");
const eslintConfigPrettier = require("eslint-config-prettier");
const unusedImports = require("eslint-plugin-unused-imports");

module.exports = [
{
files: ["**/*.{ts,tsx}"],
...iTwinPlugin.configs.uiConfig,
rules: {
...iTwinPlugin.configs.uiConfig.rules,
"@itwin/no-internal": ["error"],
},
},
{
files: ["**/*.{ts,tsx}"],
rules: {
...reactPlugin.configs["jsx-runtime"].rules,
},
},
{
plugins: {
"unused-imports": unusedImports,
},
files: ["**/*.{ts,tsx}"],
rules: {
"no-duplicate-imports": "off",
"import/no-duplicates": "error",
"object-curly-spacing": ["error", "always"],
"@typescript-eslint/consistent-type-imports": "error",
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": ["error", { vars: "all", varsIgnorePattern: "^_", args: "after-used", argsIgnorePattern: "^_" }],
curly: ["error", "all"],
},
},
eslintConfigPrettier,
];
87 changes: 87 additions & 0 deletions apps/learning-snippets/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"name": "@itwin/presentation-learning-snippets",
"version": "0.0.0",
"description": "Learning snippets for ReadMes",
"private": true,
"scripts": {
"build": "npm run link:deps && tsc",
"build:watch": "tsc -w",
"clean": "rimraf lib build",
"cover": "npm run -s test",
"lint": "eslint ./src/**/*.{ts,tsx}",
"test": "mocha --enable-source-maps --config ./.mocharc.json",
"docs": "betools extract --fileExt=ts,tsx --extractFrom=./src --recursive --out=./build/docs/extract",
"link:deps": "node ./scripts/linkWorkspaceDeps.js"
},
"dependencies": {
"@itwin/tree-widget-react": "workspace:*",
"@itwin/presentation-hierarchies": "^0.5.0",
"@itwin/presentation-shared": "^0.4.1",
"@itwin/itwinui-react": "3.14.1",
"@itwin/unified-selection": "^0.5",
"@itwin/appui-abstract": "^4.8.0",
"@itwin/appui-react": "^4.16.0",
"@itwin/build-tools": "^4.8.0",
"@itwin/components-react": "^4.16.0",
"@itwin/core-backend": "^4.8.0",
"@itwin/core-bentley": "^4.8.0",
"@itwin/core-common": "^4.8.0",
"@itwin/core-frontend": "^4.8.0",
"@itwin/core-geometry": "^4.8.0",
"@itwin/core-orbitgt": "4.8.0",
"@itwin/core-quantity": "^4.8.0",
"@itwin/core-react": "^4.16.0",
"@itwin/core-telemetry": "^4.8.0",
"@itwin/ecschema-metadata": "^4.8.0",
"@itwin/ecschema-rpcinterface-common": "^4.8.0",
"@itwin/ecschema-rpcinterface-impl": "^4.8.0",
"@itwin/eslint-plugin": "^4.1.1",
"@itwin/imodel-components-react": "^4.16.0",
"@itwin/presentation-backend": "^4.8.0",
"@itwin/presentation-common": "^4.8.0",
"@itwin/presentation-components": "^5.3.3",
"@itwin/presentation-frontend": "^4.8.0",
"@itwin/presentation-testing": "^5.0.13",
"@testing-library/dom": "^9.3.3",
"@testing-library/react": "^14.1.2",
"@testing-library/user-event": "^14.5.2",
"@types/chai": "4.3.5",
"@types/jsdom": "^21.1.6",
"@types/mocha": "^10.0.6",
"@types/node": "^18.18.10",
"@types/react": "^18.2.57",
"@types/react-dom": "^18.2.19",
"@types/sinon": "^17.0.2",
"@types/sinon-chai": "^3.2.12",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"chai": "^4.3.7",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-react": "^7.34.4",
"eslint-plugin-unused-imports": "^3.2.0",
"fast-xml-parser": "^4.3.6",
"global-jsdom": "^9.2.0",
"ignore-styles": "^5.0.1",
"jsdom": "^23.1.0",
"mocha": "^10.2.0",
"raf": "^3.4.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "^6.0.1",
"sinon": "^17.0.1",
"sinon-chai": "^3.7.0",
"typescript": "~5.0.0",
"xmlhttprequest": "^1.8.0"
},
"dependenciesMeta": {
"@itwin/tree-widget-react": {
"injected": true
}
},
"eslintConfig": {
"extends": [
".eslintrc.js"
]
}
}
Loading

0 comments on commit f9354fe

Please sign in to comment.