Skip to content

Commit

Permalink
chore(workspace): use pnpm (#646)
Browse files Browse the repository at this point in the history
#### What this PR does / why we need it:

As per title.
  • Loading branch information
fuxingloh authored Oct 20, 2023
1 parent 6f5d0e5 commit a327722
Show file tree
Hide file tree
Showing 27 changed files with 8,553 additions and 22,235 deletions.
11 changes: 0 additions & 11 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
<!-- Thanks for sending a pull request! -->

#### What this PR does / why we need it:

#### Which issue(s) will this PR fix?:

<!--
(Optional) Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

Fixes #

#### Additional notes:

<!-- delete where appropriate -->
107 changes: 0 additions & 107 deletions .github/governance.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,6 @@ labels:
matcher:
files: '.github/**'

- label: area/contented
sync: true
matcher:
files: 'packages/contented/**'

- label: area/contented-example
sync: true
matcher:
files: 'packages/contented-example/**'

- label: area/contented-preview
sync: true
matcher:
files: 'packages/contented-preview/**'

- label: area/contented-processor
sync: true
matcher:
files: 'packages/contented-processor/**'

- label: area/eslint-config
sync: true
matcher:
files: 'packages/eslint-config/**'

- label: area/jest-preset
sync: true
matcher:
files: 'packages/jest-preset/**'

checks:
- context: 'Semantic Pull Request'
description:
Expand Down
16 changes: 0 additions & 16 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,6 @@
name: kind/dependencies
description: Pull requests that update a dependency file

# Area
- color: fbca04
name: area/workflow
- color: fbca04
name: area/contented
- color: fbca04
name: area/contented-example
- color: fbca04
name: area/contented-preview
- color: fbca04
name: area/contented-processor
- color: fbca04
name: area/eslint-config
- color: fbca04
name: area/jest-preset

# Priority
- color: d93f0b
name: priority/urgent-now
Expand Down
56 changes: 30 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,73 +14,77 @@ permissions:
contents: read

jobs:
Build:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.6.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'
cache: 'npm'

- run: npm ci
- run: npm run build
- run: corepack enable pnpm
- run: pnpm install --frozen-lockfile

Test:
- run: pnpm build

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.6.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'
cache: 'npm'

- run: npm ci
- run: npm run test -- -- --maxWorkers=100% --coverage
- run: corepack enable pnpm
- run: pnpm install --frozen-lockfile

- uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
fail_ci_if_error: true
- run: pnpm run test

Generate:
generate:
name: Generate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.6.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'
cache: 'npm'

- run: npm ci
- run: npx turbo run generate
- run: corepack enable pnpm
- run: pnpm install --frozen-lockfile

- run: pnpm turbo run generate

lint_prettier:
name: Lint (prettier)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.6.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'
cache: npm

- run: npm ci
- run: npx --no-install prettier --check .
- run: corepack enable pnpm
- run: pnpm install --frozen-lockfile

- run: pnpm prettier --check .

lint_eslint:
name: Lint (eslint)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.6.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'
cache: npm

- run: npm ci
- run: npx --no-install turbo run lint
- run: corepack enable pnpm
- run: pnpm install --frozen-lockfile

- run: pnpm turbo run lint
22 changes: 0 additions & 22 deletions .github/workflows/oss-governance-bot.yml

This file was deleted.

22 changes: 13 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1
with:
script: |
const semver = context.ref.replace('refs/tags/v', '')
const semver = "${{ github.event.release.tag_name }}".replace('v', '');
if (semver.match(/^[0-9]+\.[0-9]+\.[0-9]+$/)) {
return semver
}
Expand All @@ -33,22 +33,26 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.6.0

- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'

- run: npm ci
- run: corepack enable pnpm

- run: lerna version ${{ needs.Version.outputs.result }} --yes --no-push --no-git-tag-version --exact
- run: pnpm install --frozen-lockfile

- run: npm run build
- run: pnpm -r exec npm version ${{ needs.Version.outputs.result }} --git-tag-version=false

- name: Publish
run: |
npm config set //registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN
npm publish --workspaces --access public
- run: pnpm build

- run: npm config set "//registry.npmjs.org/:_authToken" "\${NPM_AUTH_TOKEN}" --location=project

- run: pnpm -r publish --access public --tag latest --no-git-checks
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- run: npm config delete "//registry.npmjs.org/:_authToken" --location=project
if: always()
9 changes: 9 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Hosting Dev Tools
public-hoist-pattern[]=husky
public-hoist-pattern[]=lint-staged
public-hoist-pattern[]=typescript
public-hoist-pattern[]=turbo
public-hoist-pattern[]=*jest*
public-hoist-pattern[]=*eslint*
public-hoist-pattern[]=*prettier*
public-hoist-pattern[]=@types/*
13 changes: 4 additions & 9 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
.husky
.idea
.next
out
*.d.ts
*.d.ts.map
*.js
*.js.map
tsconfig.tsbuildinfo
package-lock.json
.vscode
.contented
node_modules
dist
coverage
package-lock.json
pnpm-lock.yaml
4 changes: 0 additions & 4 deletions lerna.json

This file was deleted.

Loading

0 comments on commit a327722

Please sign in to comment.