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

build: set up rush #93

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
19 changes: 8 additions & 11 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
* text=auto eol=lf

*.js linguist-detectable=false
*.mjs linguist-detectable=false
*.cjs linguist-detectable=false
/.husky/** linguist-detectable=false
*.json linguist-language=JSON-with-Comments

**/tsconfig.json linguist-language=jsonc
**/tsconfig.*.json linguist-language=jsonc
/.lintstagedrc linguist-language=json
/.markdownlint.json linguist-language=jsonc
/.vscode/*.json linguist-language=jsonc
*.js linguist-detectable=false
*.mjs linguist-detectable=false
*.cjs linguist-detectable=false

/CHANGELOG.md linguist-generated
CHANGELOG.md linguist-generated

/docs/** linguist-documentation
docs/** linguist-documentation

pnpm-lock.yaml merge=text linguist-generated
10 changes: 7 additions & 3 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ runs:
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name ${GITHUB_ACTOR}
shell: bash
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: "pnpm"
- run: pnpm install --frozen-lockfile --ignore-scripts

- name: Rush Install
shell: bash
run: node common/scripts/install-run-rush.js install

- name: Rush rebuild
shell: bash
run: node common/scripts/install-run-rush.js rebuild --verbose
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Lint Packages
name: Build

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

env:
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 1

jobs:
lint_packages:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run lint:packages
- run: node common/scripts/install-run-rush.js build --verbose
8 changes: 7 additions & 1 deletion .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Lint Code

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

env:
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 1

jobs:
lint_js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run lint:js
- run: node common/scripts/install-run-rush.js lint:js --verbose
8 changes: 7 additions & 1 deletion .github/workflows/lint-knip-dev.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Lint Knip (Development)

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

env:
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 1

jobs:
lint_knip_dev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run lint:knip:development
- run: node common/scripts/install-run-rush.js lint:knip:development --verbose
8 changes: 7 additions & 1 deletion .github/workflows/lint-knip-prod.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Lint Knip (Production)

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

env:
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 1

jobs:
lint_knip_prod:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run lint:knip:production
- run: node common/scripts/install-run-rush.js lint:knip:production --verbose
8 changes: 7 additions & 1 deletion .github/workflows/lint-markdown.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Lint Markdown

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

env:
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 1

jobs:
lint_markdown:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run lint:md
- run: node common/scripts/install-run-rush.js lint:md --verbose
8 changes: 7 additions & 1 deletion .github/workflows/lint-spelling.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Lint Spelling

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

env:
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 1

jobs:
lint_spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run lint:spelling
- run: node common/scripts/install-run-rush.js lint:spelling --verbose
8 changes: 7 additions & 1 deletion .github/workflows/lint-yaml.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Lint Yaml

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

env:
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 1

jobs:
lint_yaml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run lint:yaml
- run: node common/scripts/install-run-rush.js lint:yaml --verbose
23 changes: 11 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Release

on:
push:
branches:
- main
workflow_dispatch:

permissions:
contents: write
Expand All @@ -14,6 +12,9 @@ concurrency:
group: Release
cancel-in-progress: false

env:
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 1

jobs:
lint_js:
uses: ./.github/workflows/lint-js.yml
Expand All @@ -23,8 +24,6 @@ jobs:
uses: ./.github/workflows/lint-knip-prod.yml
lint_markdown:
uses: ./.github/workflows/lint-markdown.yml
lint_packages:
uses: ./.github/workflows/lint-packages.yml
lint_spelling:
uses: ./.github/workflows/lint-spelling.yml
lint_yaml:
Expand All @@ -39,7 +38,6 @@ jobs:
- lint_js
- lint_knip_prod
- lint_markdown
- lint_packages
- lint_spelling
- lint_yaml
- test_js
Expand All @@ -53,10 +51,11 @@ jobs:
- uses: ./.github/actions/prepare

- name: Build
run: pnpm run build
run: node common/scripts/install-run-rush.js build --verbose

- name: Bump version
run: node common/scripts/install-run-rush.js version --bump --ensure-version-policy --ignore-git-hooks --verbose

- name: Publish
run: node common/scripts/install-run-rush.js publish --apply --publish --include-all --ignore-git-hooks --npm-auth-token ${{ secrets.NPM_TOKEN }} --verbose

- name: Release
run: pnpm -r --workspace-concurrency=1 exec -- pnpm run release
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 7 additions & 1 deletion .github/workflows/test-js.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
name: Test

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

env:
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 1

jobs:
test_js:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run test
- run: node common/scripts/install-run-rush.js test-run --verbose
- uses: codecov/codecov-action@v4
8 changes: 7 additions & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Type Check

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

env:
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 1

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm run typecheck
- run: node common/scripts/install-run-rush.js typecheck --verbose
21 changes: 21 additions & 0 deletions .github/workflows/verify-change-logs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Verify Change Logs

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
workflow_call:

env:
RUSH_ALLOW_WARNINGS_IN_SUCCESSFUL_BUILD: 1

jobs:
typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare

- run: node common/scripts/install-run-rush.js change --verify
37 changes: 32 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,37 @@
node_modules/
# Logs
*.log
.pnpm-debug.log*

# Distribution files
bin/
coverage/
dist/

tsconfig.tsbuildinfo
rollup.config-*.mjs
# Coverage directory used by tools like istanbul
coverage/

*.log
# Dependency directories
node_modules/

# TypeScript cache
*.tsbuildinfo

# Output of 'npm pack'
*.tgz

# dotenv environment variables file
.env

# OS X temporary files
.DS_Store

# Visual Studio Code
.vscode/
!.vscode/tasks.json
!.vscode/launch.json

# Rush temporary files
common/deploy/
common/temp/
common/autoinstallers/*/.npmrc
**/.rush/temp/
*.lock
1 change: 0 additions & 1 deletion .husky/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

19 changes: 3 additions & 16 deletions .lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
"*.{json,yml}":
- eslint --fix
- cspell lint --no-progress --show-suggestions --show-context --no-must-find-files --dot

"*.?([cm])[jt]s?(x)":
- eslint --fix
- cspell lint --no-progress --show-suggestions --show-context --no-must-find-files --dot
- tsc-files -p tsconfig.json --noEmit

"*.md":
- markdownlint-cli2 --fix
- eslint --fix
- cspell lint --no-progress --show-suggestions --show-context --no-must-find-files --dot

pnpm-lock.yaml:
- "pnpm dedupe && :"
{
"*": "echo ok"
}
Loading
Loading