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

Replace rush with pnpm + lage + beachball #707

Merged
merged 36 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
93118cf
Replace rush with lage and beachball
saskliutas Dec 7, 2023
8ee0ff8
Restore dep versions
saskliutas Dec 8, 2023
9d98eaf
Remove mentions of rush
saskliutas Dec 8, 2023
72467b9
Cleanup
saskliutas Dec 8, 2023
1bdf18d
Cleanup
saskliutas Dec 8, 2023
e883139
Cleanup root package.json file
saskliutas Dec 8, 2023
0eabf35
Continue if lint/test failure encountered
saskliutas Dec 8, 2023
53b515e
Merge branch 'master' into remove_rush
saskliutas Dec 12, 2023
0458d59
Cleanup merge
saskliutas Dec 12, 2023
9e07fc7
Update dependencies
saskliutas Dec 12, 2023
7c208b7
Update deps again
saskliutas Dec 12, 2023
b9359e6
Use node 20
saskliutas Dec 13, 2023
776e668
Fix missmatched peer dependency versions
saskliutas Dec 13, 2023
2b5162c
Update publish pipeline
saskliutas Dec 14, 2023
381ea2b
Update codeowners
saskliutas Dec 14, 2023
0b82944
Readd extract-api
saskliutas Dec 14, 2023
55be0a4
Fix slow property-grid test
saskliutas Dec 14, 2023
763ddf0
Merge branch 'master' into remove_rush
saskliutas Dec 14, 2023
9c67b18
Cleanup
saskliutas Dec 14, 2023
c558a36
Update deprecated dependency
saskliutas Dec 14, 2023
0cb289c
Fix property grid search box in narrow panel
saskliutas Dec 14, 2023
246176a
Remove unnecessary pipeline steps
saskliutas Dec 14, 2023
cceaa8d
Cleanup e2e pipeline
saskliutas Dec 14, 2023
ecf0803
Reduce e2e output noise
saskliutas Dec 15, 2023
54357b2
More e2e pipeline cleanup
saskliutas Dec 15, 2023
58dacc6
Missed pnpm install
saskliutas Dec 15, 2023
c80d5b5
Fix codeowners
saskliutas Dec 15, 2023
a19283b
Cleanup beachball config
saskliutas Dec 19, 2023
27875fd
Run CI on multiple platforms
saskliutas Dec 19, 2023
cabbc6f
Cleanup pipeline
saskliutas Dec 19, 2023
df9c16c
Fix beachball config
saskliutas Dec 22, 2023
27ad9d3
Do not use shared lock file
saskliutas Dec 22, 2023
22f7724
Merge branch 'master' into remove_rush
saskliutas Dec 22, 2023
25d3ae9
Cleanup merge
saskliutas Dec 22, 2023
49bb57e
Merge branch 'master' into remove_rush
saskliutas Jan 4, 2024
1fc7780
Disable pnpm side-effects-cache to make sure post install script is run
saskliutas Jan 5, 2024
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RUN \
fonts-liberation libayatana-appindicator1 libnss3 libsecret-1-0 \
lsb-release xdg-utils wget \
&& apt-get install -y git nodejs locales zsh procps \
&& npm install -g @microsoft/rush \
&& npm install -g pnpm \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8

ENV \
Expand Down
9 changes: 1 addition & 8 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Open your iTwin.js viewer-components-react repo in VS Code, click the green area

The _first time_ you "open" the container, you must clone the source code into the working directory, e.g. in VS Code's Terminal, `git clone URL /workspaces/viewer-components-react`. If you use a custom NPM package source, you must also configure that (e.g. `npm config set ...`).

As with any copy of the code, you must build iTwin.js inside the container. Use VS Code's Terminal to perform normal build commands such as `rush install`, `rush rebuild`, and `rush test`. You should also have access to the same launch profiles in VS Code for debugging.
As with any copy of the code, you must build iTwin.js inside the container. Use VS Code's Terminal to perform normal build commands such as `pnpm install`, `pnpm build`, and `pnpm test`. You should also have access to the same launch profiles in VS Code for debugging.

When you are done, click the green area in the status bar, and select 'Dev Containers: Reopen Folder Locally' to switch back to a local view on your host.

Expand All @@ -44,10 +44,3 @@ The first time you "open" a container for a project, it will be built and persis
- Use VS Code's Terminal window to interact directly with the container.
- The file system is **case-sensitive** (tab completion is configured to be _not_ case-sensitive)
- The container is configured with zsh + oh-my-zsh + fzf for some additional niceties (e.g. case-insensitivity, git info at the prompt, and fuzzy history search).

### Common issues

- `rush test` fails with "... reporter blew up with error \\ Error: EINVAL: invalid argument, readlink ..."
- Cause: unknown
- Workaround: `rm -rf common/temp` and do `rush` install/rebuild/test again
- To know earlier if you will have this problem, after a `rush rebuild`, run `find -L common/temp -type l`, and if anything other than common/temp/pnpm-store or common/temp/pnpm-local is reported, repeat the above workaround
3 changes: 1 addition & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
common/temp/
**/node_modules/
lib/
playwright-report/
test-results/
test-results/
22 changes: 11 additions & 11 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Convert all line endings for files detected as text to lf to avoid OS specific
# line endings showing up in git diffs
* text=auto

# Ensure these file types use the correct OS specific line endings
*.bat eol=crlf
*.sh eol=lf

# Don't allow people to merge changes to these generated files, because the result
# may be invalid. You need to run "rush update" again.
# may be invalid. You need to run "pnpm install" again.
pnpm-lock.yaml merge=binary
shrinkwrap.yaml merge=binary
npm-shrinkwrap.json merge=binary
yarn.lock merge=binary

# Rush's JSON config files use JavaScript-style code comments. The rule below prevents pedantic
# syntax highlighters such as GitHub's from highlighting these comments as errors. Your text editor
# may also require a special configuration to allow comments in JSON.
#
# For more information, see this issue: https://github.com/Microsoft/web-build-tools/issues/1088
#
*.json linguist-language=JSON-with-Comments
CHANGELOG.json text eol=lf
CHANGELOG.md text eol=lf
28 changes: 12 additions & 16 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,34 @@
/apps/test-viewer @itwin/viewer-components-reviewers @itwin/itwinjs-core-presentation

/packages/itwin/property-grid @itwin/viewer-components-reviewers @itwin/itwinjs-core-presentation
/common/changes/@itwin/property-grid-react @itwin/viewer-components-reviewers @itwin/itwinjs-core-presentation
/common/api/summary/property-grid-react.exports.csv @itwin/itwinjs-core-presentation
/common/api/property-grid-react.api.md @itwin/itwinjs-core-presentation
/change/@itwin-property-grid-react* @itwin/viewer-components-reviewers @itwin/itwinjs-core-presentation

/common/api/summary/tree-widget-react.exports.csv @itwin/itwinjs-core-presentation
/common/api/tree-widget-react.api.md @itwin/itwinjs-core-presentation
/packages/itwin/tree-widget @itwin/viewer-components-reviewers @itwin/itwinjs-core-presentation
/common/changes/@itwin/tree-widget-react @itwin/viewer-components-reviewers @itwin/itwinjs-core-presentation
/change/@itwin-tree-widget-react* @itwin/viewer-components-reviewers @itwin/itwinjs-core-presentation

/packages/itwin/measure-tools @itwin/viewer-components-reviewers @simnorm @a-gagnon @bsy-nicholasw
/common/changes/@itwin/measure-tools-react @itwin/viewer-components-reviewers @simnorm @a-gagnon @bsy-nicholasw
/change/@itwin-measure-tools-react* @itwin/viewer-components-reviewers @simnorm @a-gagnon @bsy-nicholasw

/packages/itwin/grouping-mapping-widget @itwin/viewer-components-reviewers @itwin/insights-and-reporting-platform
/common/changes/@itwin/grouping-mapping-widget @itwin/viewer-components-reviewers @itwin/insights-and-reporting-platform
/change/@itwin-grouping-mapping-widget* @itwin/viewer-components-reviewers @itwin/insights-and-reporting-platform

/packages/itwin/one-click-lca-widget @itwin/viewer-components-reviewers @itwin/insights-and-reporting-platform
/common/changes/@itwin/one-click-lca-react @itwin/viewer-components-reviewers @itwin/insights-and-reporting-platform
/change/@itwin-one-click-lca-react* @itwin/viewer-components-reviewers @itwin/insights-and-reporting-platform

/packages/itwin/reports-config-widget @itwin/viewer-components-reviewers @itwin/insights-and-reporting-platform
/common/changes/@itwin/reports-config-widget-react @itwin/viewer-components-reviewers @itwin/insights-and-reporting-platform
/change/@itwin-reports-config-widget-react* @itwin/viewer-components-reviewers @itwin/insights-and-reporting-platform

/packages/itwin/breakdown-trees @itwin/viewer-components-reviewers @JValiunas @DanishMehmood-bit
/common/changes/@itwin/breakdown-trees-react @itwin/viewer-components-reviewers @JValiunas @DanishMehmood-bit
/packages/itwin/breakdown-trees @itwin/viewer-components-reviewers @DanishMehmood-bit
/change/@itwin-breakdown-trees-react* @itwin/viewer-components-reviewers @DanishMehmood-bit

/packages/itwin/geo-tools @itwin/viewer-components-reviewers @mdastous-bentley
/common/changes/@itwin/geo-tools-react @itwin/viewer-components-reviewers @mdastous-bentley
/change/@itwin-geo-tools-react* @itwin/viewer-components-reviewers @mdastous-bentley

/packages/itwin/imodel-react-hooks @itwin/viewer-components-reviewers @michaelbelousov
/common/changes/@itwin/imodel-react-hooks @itwin/viewer-components-reviewers @michaelbelousov
/change/@itwin-imodel-react-hooks* @itwin/viewer-components-reviewers @michaelbelousov

/packages/itwin/ec3-widget @itwin/viewer-components-reviewers @itwin/insights-and-reporting-platform
/common/changes/@itwin/ec3-widget-react @itwin/viewer-components-reviewers @itwin/insights-and-reporting-platform
/change/@itwin-ec3-widget-react* @itwin/viewer-components-reviewers @itwin/insights-and-reporting-platform

/packages/itwin/map-layers @itwin/viewer-components-reviewers @mdastous-bentley @eringram
/common/changes/@itwin/map-layers @itwin/viewer-components-reviewers @mdastous-bentley @eringram
/change/@itwin-map-layers* @itwin/viewer-components-reviewers @mdastous-bentley @eringram
18 changes: 3 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,10 @@ package-lock.json
*.orig
.node-xmlhttprequest-sync*

# rush specific
common/temp/**
common/autoinstallers/*/.npmrc
.rush/temp/**
/**/.rush
package-deps.json
*.build.log
*.build.error.log

# DS store
.DS_Store

# IDE configuration
.idea

# e2e tests output
/**/test-results
/**/playwright-report
/**/playwright/.cache

# api extractor temp files
/packages/**/api/temp
11 changes: 11 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@bentley:registry=https://registry.npmjs.org/
registry=https://registry.npmjs.org/

hoist-pattern[]=*
hoist-pattern[]=!typescript
hoist-pattern[]=!*eslint*
hoist-pattern[]=!react*
hoist-pattern[]=!@types/*
hoist-pattern[]=!@itwin/*

resolution-mode=lowest-direct
36 changes: 36 additions & 0 deletions .pipelines/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
trigger:
- master
- gh-readonly-queue/master

pr:
drafts: false
branches:
include:
- master

jobs:
- job: Build
condition: succeeded()
workspace:
clean: all

pool:
vmImage: "ubuntu-latest"

steps:
- template: templates/build-steps.yaml

- job: Run_e2e_tests
displayName: "Run e2e tests"
condition: succeeded()
workspace:
clean: all

pool:
vmImage: ubuntu-latest

variables:
- group: "viewer-components-react e2e tests env"

steps:
- template: templates/e2e-steps.yaml
28 changes: 28 additions & 0 deletions .pipelines/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
parameters:
- name: dev
type: boolean
default: false
displayName: "Publish pre-release versions"

trigger: none
pr: none

pool:
vmImage: "ubuntu-latest"

variables:
- group: "Caleb - iTwin GitHub Token"
- name: REPO_URL
value: github.com/iTwin/viewer-components-react

steps:
- template: templates/build-steps.yaml
- script: |
git config --global user.email imodeljs-admin@users.noreply.github.com
git config --global user.name imodeljs-admin
git remote set-url origin "https://$(GITHUBTOKEN)@$(REPO_URL)"
pnpm run publish --message "applying package updates" $beachballOptions
displayName: "Publish packages"
env:
${{ if eq(parameters.dev, true) }}:
beachballOptions: "--config beachball.config.dev.js --keep-change-files"
26 changes: 26 additions & 0 deletions .pipelines/templates/build-steps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
steps:
# 1. Configure node
- task: NodeTool@0
displayName: Use Node 20.x
inputs:
versionSpec: 20.x

- task: Npm@1
displayName: install pnpm ^8.11.0
inputs:
command: "custom"
customCommand: "install -g pnpm@^8.11.0"

- script: cp .npmrc ~/.npmrc

- script: pnpm install --frozen-lockfile
displayName: pnpm install

- script: pnpm audit --registry=https://registry.npmjs.org --audit-level=high --production
displayName: Audit

# - script: pnpm exec prettier . --check
# displayName: Check formatting

- script: pnpm exec lage lint cover --grouped
displayName: Build, Lint and Cover
30 changes: 30 additions & 0 deletions .pipelines/templates/e2e-steps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
steps:
- task: NodeTool@0
displayName: Use Node 20.x
inputs:
versionSpec: 20.x

- task: Npm@1
displayName: install pnpm ^8.11.0
inputs:
command: "custom"
customCommand: "install -g pnpm@^8.11.0"

- script: pnpm install --frozen-lockfile
displayName: pnpm install

- script: pnpm test:e2e
displayName: "pnpm test:e2e"
env:
CI: true
IMJS_AUTH_CLIENT_CLIENT_ID: $(IMJS_AUTH_CLIENT_CLIENT_ID)
IMJS_USER_EMAIL: $(IMJS_USER_EMAIL)
IMJS_USER_PASSWORD: $(IMJS_USER_PASSWORD)

- publish: $(System.DefaultWorkingDirectory)/packages/itwin/tree-widget/test-results
artifact: TreeWidgetE2ETestResults
condition: succeededOrFailed()

- publish: $(System.DefaultWorkingDirectory)/packages/itwin/property-grid/test-results
artifact: PropertyGridE2ETestResults
condition: succeededOrFailed()
75 changes: 75 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/

function readPackage(pkg, context) {
if (pkg.dependencies["@types/react"] === "*") {
pkg.dependencies["@types/react"] = undefined;
pkg.peerDependencies["@types/react"] = "*";
}
if (pkg.peerDependencies["react"] !== undefined && pkg.peerDependencies["@types/react"] === undefined) {
pkg.peerDependencies["@types/react"] = "*";
}
if (pkg.name === "@itwin/map-layers-formats") {
pkg.peerDependencies["@itwin/core-frontend"] = pkg.version;
}
if (pkg.name === "simple-react-validator") {
pkg.peerDependencies["react"] = "*";
pkg.peerDependencies["@types/react"] = "*";
}

// patch peer dependencies of packages from `itwinjs-core` to make sure that they are resolved to same version.
// peer dependencies in those packages are defined with `^` and that allows to resolve some of them to different version.
if (corePackages.includes(pkg.name) && pkg.peerDependencies) {
const fixedPeers = Object.entries(pkg.peerDependencies).reduce(
(deps, [name, version]) => ({ ...deps, [name]: corePackages.includes(name) ? version.replaceAll("^", "") : version }),
{},
);
pkg.peerDependencies = fixedPeers;
}

// patch peer dependencies of packages from `appui` to make sure that they are resolved to same version.
if (appuiPackages.includes(pkg.name) && pkg.peerDependencies) {
const fixedPeers = Object.entries(pkg.peerDependencies).reduce(
(deps, [name, version]) => ({ ...deps, [name]: appuiPackages.includes(name) ? version.replaceAll("^", "") : version }),
{},
);
pkg.peerDependencies = fixedPeers;
}

return pkg;
}

module.exports = {
hooks: {
readPackage,
},
};

const corePackages = [
"@itwin/appui-abstract",
"@itwin/core-bentley",
"@itwin/core-common",
"@itwin/core-frontend",
"@itwin/core-geometry",
"@itwin/core-i18n",
"@itwin/core-markup",
"@itwin/core-orbitgt",
"@itwin/core-quantity",
"@itwin/core-telemetry",
"@itwin/ecschema-metadata",
"@itwin/frontend-devtools",
"@itwin/map-layers-formats",
"@itwin/map-layers-auth",
"@itwin/presentation-common",
"@itwin/presentation-frontend",
"@itwin/webgl-compatibility",
"@itwin/appui-abstract",
"@itwin/build-tools",
"@itwin/certa",
"@itwin/core-backend",
"@itwin/presentation-backend",
];

const appuiPackages = ["@itwin/appui-layout-react", "@itwin/appui-react", "@itwin/components-react", "@itwin/core-react", "@itwin/imodel-components-react"];
18 changes: 18 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Ignore artifacts
change
lib

# Ignore auto-generated files
CHANGELOG.md
CHANGELOG.json

# Ignore vscode settings
.vscode

# Ignore pnpm files
pnpm-lock.yaml
pnpm-workspace.yaml

# Ignore configs and pipelines
.pipelines
.github
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"printWidth": 160,
"trailingComma": "all",
"tabWidth": 2,
"singleQuote": false
}
16 changes: 16 additions & 0 deletions .vscode/cSpell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// cSpell Settings
{
// Version of the setting file
"version": "0.2",
// language - current active spelling language
"language": "en",
"ignorePaths": [
"package.json",
"package-lock.json",
"tsconfig.json",
"tslint.json"
],
"words": [
"changehint"
]
}
Loading
Loading