Skip to content

Commit

Permalink
Migrate to pnpm (#483)
Browse files Browse the repository at this point in the history
* build: Migrate from npm to pnpm
* ci: 👷 update Github Action for pnpm
* ci: 👷 update scripts & azure pipeline config
  • Loading branch information
JeffJacobson authored Oct 24, 2024
1 parent ff2ee0b commit 4eec1c7
Show file tree
Hide file tree
Showing 8 changed files with 4,332 additions and 7,159 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ jobs:

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm install-ci-test
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,8 @@
"biome.rename": true,
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"[json]": {
"editor.defaultFormatter": "biomejs.biome"
}
}
48 changes: 24 additions & 24 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,32 @@ stages:
inputs:
version: 22.X

# Install project dependencies using npm in a clean state.
- task: Npm@1
name: npm_install
displayName: NPM Clean Install (CI)
- task: Cache@2
enabled: false
inputs:
# The npm command to run. 'ci' installs dependencies based on the lock file.
command: ci
key: 'pnpm | "$(Agent.OS)" | pnpm-lock.yaml'
path: $(pnpm_config_cache)
displayName: Cache pnpm
- script: |
corepack enable
displayName: "Setup pnpm"
- task: Npm@1
name: npm_test
displayName: NPM Test
continueOnError: true
inputs:
command: custom
customCommand: test
# - script: |
# corepack enable
# corepack prepare pnpm@latest-9 --activate
# pnpm config set store-dir $(pnpm_config_cache)
# displayName: "Setup pnpm"

- script: |
pnpm install
pnpm run build
displayName: "pnpm install and build"
- script: |
pnpm test
name: pnpm_test
displayName: "pnpm test"
- task: PublishTestResults@2
name: publish_test_results
Expand All @@ -77,17 +88,6 @@ stages:
inputs:
summaryFileLocation: coverage/cobertura-coverage.xml

# Run the npm build script to compile the project.
- task: Npm@1
name: run_build
displayName: NPM Build
inputs:
command: custom
# The npm command to run the build script defined in package.json.
customCommand: run build
# Sets the current working directory for this task to the sources directory.
workingDir: $(Build.SourcesDirectory)

# Copy the build output (dist folder) to the staging directory for artifact publishing.
- task: CopyFiles@2
name: copy_files
Expand Down
8 changes: 6 additions & 2 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
},
"files": {
"ignoreUnknown": false,
"ignore": ["**/wsdot-web-styles/**", "tests/routes.json"]
"ignore": [
"**/wsdot-web-styles/**",
"tests/routes.json",
"*.arcade"
]
},
"formatter": {
"enabled": true,
Expand All @@ -27,4 +31,4 @@
"quoteStyle": "double"
}
}
}
}
Loading

0 comments on commit 4eec1c7

Please sign in to comment.