Skip to content

Commit

Permalink
Replace rush with pnpm + lage + beachball (#707)
Browse files Browse the repository at this point in the history
* Replace rush with lage and beachball

* Restore dep versions

* Remove mentions of rush

* Cleanup

* Cleanup

* Cleanup root package.json file

* Continue if lint/test failure encountered

* Cleanup merge

* Update dependencies

* Update deps again

* Use node 20

* Fix missmatched peer dependency versions

* Update publish pipeline

* Update codeowners

* Readd extract-api

* Fix slow property-grid test

* Cleanup

* Update deprecated dependency

* Fix property grid search box in narrow panel

* Remove unnecessary pipeline steps

* Cleanup e2e pipeline

* Reduce e2e output noise

* More e2e pipeline cleanup

* Missed pnpm install

* Fix codeowners

* Cleanup beachball config

* Run CI on multiple platforms

* Cleanup pipeline

* Fix beachball config

* Do not use shared lock file

* Cleanup merge

* Disable pnpm side-effects-cache to make sure post install script is run
  • Loading branch information
saskliutas authored Jan 5, 2024
1 parent ef55b16 commit 5d64b08
Show file tree
Hide file tree
Showing 116 changed files with 91,717 additions and 28,117 deletions.
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
9 changes: 9 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@bentley:registry=https://registry.npmjs.org/
registry=https://registry.npmjs.org/

resolution-mode=lowest-direct

link-workspace-packages=false
shared-workspace-lockfile=false

side-effects-cache=false
48 changes: 48 additions & 0 deletions .pipelines/pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
trigger:
- master
- gh-readonly-queue/master

pr:
drafts: false
branches:
include:
- master

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

strategy:
matrix:
"Windows - Node 18.16.0":
NodeVersion: 18.16.0
OS: windows-latest
"Linux - Node 18.16.0":
NodeVersion: 18.16.0
OS: ubuntu-latest
"Mac - Node 18.16.0":
NodeVersion: 18.16.0
OS: macOS-latest

pool:
vmImage: $(OS)

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
29 changes: 29 additions & 0 deletions .pipelines/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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
- NodeVersion: 18.16.0

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"
24 changes: 24 additions & 0 deletions .pipelines/templates/build-steps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
steps:
# 1. Configure node
- task: NodeTool@0
displayName: "Use Node $(NodeVersion)"
inputs:
versionSpec: "$(NodeVersion)"

- 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 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 18.16.0
inputs:
versionSpec: 18.16.0

- 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()
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"
]
}
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"mike-co.import-sorter",
"streetsidesoftware.code-spell-checker"
]
}
Loading

0 comments on commit 5d64b08

Please sign in to comment.