Skip to content

Commit

Permalink
build: use pnpm instead of npm as package manager
Browse files Browse the repository at this point in the history
  • Loading branch information
yassinedoghri committed Feb 26, 2023
1 parent 087ac93 commit 17f41c2
Show file tree
Hide file tree
Showing 29 changed files with 45,497 additions and 69,153 deletions.
4 changes: 0 additions & 4 deletions .devcontainer/Dockerfile

This file was deleted.

33 changes: 13 additions & 20 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
{
"name": "astro-i18next",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "16-bullseye"
}
"image": "mcr.microsoft.com/vscode/devcontainers/javascript-node",
"args": {
"VARIANT": "16-bullseye"
},
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/guiyomh/features/vim:0": {},
"ghcr.io/NicoVIII/devcontainer-features/pnpm:2": {}
},
"remoteUser": "root",

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pnpm install",

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.defaultProfile.linux": "bash",
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"markdown.extension.toc.levels": "1..3"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"astro-build.astro-vscode",
"bradlc.vscode-tailwindcss",
Expand All @@ -28,16 +32,5 @@
"streetsidesoftware.code-spell-checker",
"wayou.vscode-todo-highlight",
"yzhang.markdown-all-in-one"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm install",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"features": {
"git": "latest"
}
]
}
20 changes: 15 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,24 @@ jobs:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Setup node ⚙️
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install pnpm 📦
uses: pnpm/action-setup@v2
with:
version: 7

- name: Install and Build 🔧
run: |
npm ci
npm run build
pnpm install
pnpm run build
cd website
npm ci
npm link ..
npm run build
pnpm install
pnpm link ..
pnpm run build
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4.3.3
Expand Down
34 changes: 24 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ jobs:
with:
node-version: 18

- name: Install pnpm 📦
uses: pnpm/action-setup@v2
with:
version: 7

- name: Quality check 👌
run: |
npm ci
npm run typecheck
npm run lint
npm run prettier
npm test
pnpm install
pnpm run typecheck
pnpm run lint
pnpm run prettier
pnpm test
bundle:
runs-on: ubuntu-latest
Expand All @@ -37,10 +42,15 @@ jobs:
with:
node-version: 18

- name: Install pnpm 📦
uses: pnpm/action-setup@v2
with:
version: 7

- name: Bundle 📦
run: |
npm ci
npm run build
pnpm install
pnpm run build
- name: Upload bundle as artifact 📤
uses: actions/upload-artifact@v3
Expand All @@ -65,6 +75,11 @@ jobs:
with:
node-version: 18

- name: Install pnpm 📦
uses: pnpm/action-setup@v2
with:
version: 7

- name: Download bundle artifact 📥
uses: actions/download-artifact@v3
with:
Expand All @@ -73,9 +88,8 @@ jobs:

- name: Release & Publish to NPM 🚀
run: |
npm set-script prepare ""
npm ci
npm run semantic-release
pnpm install
pnpm run semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 7 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ jobs:
with:
node-version: 18

- name: Install pnpm 📦
uses: pnpm/action-setup@v2
with:
version: 7

- name: Install dependencies 📥
run: npm ci
run: pnpm install

- name: Run tests and collect coverage 🛠️
run: npm run test:coverage
run: pnpm run test:coverage

- name: Upload coverage to Codecov 📤
uses: codecov/codecov-action@v3
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ coverage

# Local Netlify folder
.netlify

# pnpm
.pnpm-store
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --verbose --edit "$1"
pnpm exec commitlint --verbose --edit "$1"
9 changes: 5 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run typecheck
npx lint-staged
pnpm run test:coverage --run
pnpm exec lint-staged
pnpm run typecheck
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# [1.0.0-beta.17](https://github.com/yassinedoghri/astro-i18next/compare/v1.0.0-beta.16...v1.0.0-beta.17) (2023-01-24)


### Features

* Allow astro versions greater than 1.0.0 as peer dependency. ([0205d41](https://github.com/yassinedoghri/astro-i18next/commit/0205d41d282848bbe9b0ac153a4b024438e5ca65))
- Allow astro versions greater than 1.0.0 as peer dependency.
([0205d41](https://github.com/yassinedoghri/astro-i18next/commit/0205d41d282848bbe9b0ac153a4b024438e5ca65))

# [1.0.0-beta.16](https://github.com/yassinedoghri/astro-i18next/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2023-01-22)

Expand Down
4 changes: 2 additions & 2 deletions examples/basics/.stackblitzrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"startCommand": "npm start",
"startCommand": "pnpm start",
"env": {
"ENABLE_CJS_IMPORTS": true
}
}
}
Loading

0 comments on commit 17f41c2

Please sign in to comment.