8000 Use Wireit for nimble-components build by m-akinc · Pull Request #1267 · ni/nimble · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use Wireit for nimble-components build #1267

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

Closed
wants to merge 18 commits into from
Closed
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,6 @@ package-lock.json

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed yesterday moving to draft and assigning to myself to take a look in the future.

# lighthouse build directory
.lighthouseci/

# wireit
.wireit
15 changes: 11 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ This repository uses the following tooling. See below for more info.

1. A monorepo containing multiple packages managed via [NPM workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces).
2. Linting via [ESLint](https://eslint.org/) following the [NI JavaScript and TypeScript Styleguide](https://github.com/ni/javascript-styleguide)
3. Testing via [Karma](http://karma-runner.github.io/6.3/index.html), [Jasmine](https://jasmine.github.io/), [bUnit](https://bunit.dev/), and [Playwright](https://playwright.dev/)
4. Releases via [beachball](https://microsoft.github.io/beachball/)
5. Pipelines automating the above via [GitHub Actions](https://github.com/features/actions)
6. Automated dependency updates via [Renovate](https://docs.renovatebot.com/)
3. Build via [Wireit](https://github.com/google/wireit)
4. Testing via [Karma](http://karma-runner.github.io/6.3/index.html), [Jasmine](https://jasmine.github.io/), [bUnit](https://bunit.dev/), and [Playwright](https://playwright.dev/)
5. Releases via [beachball](https://microsoft.github.io/beachball/)
6. Pipelines automating the above via [GitHub Actions](https://github.com/features/actions)
7. Automated dependency updates via [Renovate](https://docs.renovatebot.com/)

### Helpful links

Expand Down Expand Up @@ -177,6 +178,12 @@ Example: Add a monorepo package `nimble-tokens` as a dependency to another monor
npm install @ni/nimble-tokens --workspace=@ni/nimble-components
```

## Local repo maintenance

The Wireit tool used for building the repo will slowly accumulate build caches that grow unbounded. To reclaim disk space, you can delete these caches by running `npm run clear-cache --workspaces --if-present` from the root. Alternatively, if you periodically run `git clean -fdx`, this will also clear the `.wireit` directories along with all other files not tracked by git.

Clearing the Wireit caches will not necessarily force a rebuild. To force a rebuild, run `npm clear-wireit`.

## Updating dependencies

This repository uses [Renovate](https://docs.renovatebot.com/) to automatically create pull requests that bump the version of dependencies on a schedule. Renovate is configured via [`renovate.json`](./.github/renovate.json).
Expand Down
46 changes: 38 additions & 8 deletions angular-workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,48 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "npm run build:library && npm run build:application",
"build:library": "npm run generate-icons && ng build @ni/nimble-angular",
"build": "wireit",
"build:library": "wireit",
"watch:library": "npm run generate-icons && ng build @ni/nimble-angular --watch",
"build:application": "ng build example-client-app",
"generate-icons": "npm run generate-icons:bundle && npm run generate-icons:run",
"generate-icons:bundle": "rollup --bundleConfigAsCjs --config projects/ni/nimble-angular/build/generate-icons/rollup.config.js",
"generate-icons:run": "node projects/ni/nimble-angular/build/generate-icons/dist/index.js",
"build:application": "wireit",
"generate-icons": "wireit",
"pack": "npm run pack:library && npm run pack:application",
"pack:library": "cd dist/ni/nimble-angular && npm pack",
"pack:application": "cd dist/example-client-app && npm pack",
"watch": "ng build --watch --configuration development",
"test": "ng test --watch=false",
"lint": "ng lint",
"format": "ng lint --fix"
"format": "ng lint --fix",
"clear-cache": "rimraf .wireit/*/cache",
"clear-wireit": "rimraf .wireit"
},
"wireit": {
"build": {
"dependencies": ["build:library", "build:application"]
},
"build:application": {
"command": "ng build example-client-app",
"dependencies": ["build:library"],
"files": ["projects/example-client-app", "angular.json", "tsconfig.json"],
"output": ["dist/example-client-app"]
},
"build:library": {
"command": "ng build @ni/nimble-angular",
"dependencies": ["generate-icons"],
"files": ["projects/ni/nimble-angular", "angular.json", "tsconfig.json"],
"output": ["dist/ni/nimble-angular"]
},
"generate-icons": {
"command": "node projects/ni/nimble-angular/build/generate-icons/dist/index.js",
"dependencies": ["generate-icons:bundle"],
"files": ["projects/ni/nimble-angular/build/generate-icons/dist/index.js"],
"output": ["projects/ni/nimble-angular/src/directives/icons"]
},
"generate-icons:bundle": {
"command": "rollup --bundleConfigAsCjs --config projects/ni/nimble-angular/build/generate-icons/rollup.config.js",
"files": ["projects/ni/nimble-angular/build/generate-icons/rollup.config.js", "projects/ni/nimble-angular/build/generate-icons/source/index.js"],
"output": ["projects/ni/nimble-angular/build/generate-icons/dist/index.js"]
}
},
"dependencies": {
"@angular/animations": "^15.2.10",
Expand Down Expand Up @@ -56,7 +84,9 @@
"karma-jasmine-html-reporter": "^2.0.0",
"ng-packagr": "^15.2.2",
"playwright": "^1.30.0",
"rimraf": "^5.0.5",
"rollup": "^3.10.1",
"typescript": "~4.8.2"
"typescript": "~4.8.2",
"wireit": "^0.14.1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Use Wireit for build",
"packageName": "@ni/nimble-blazor",
"email": "7282195+m-akinc@users.noreply.github.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Use Wireit for nimble-components build",
"packageName": "@ni/nimble-components",
"email": "7282195+m-akinc@users.noreply.github.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Use Wireit for build",
"packageName": "@ni/nimble-tokens",
"email": "7282195+m-akinc@users.noreply.github.com",
"dependentChangeType": "none"
}
Loading
0