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

PNPM migration #150

Merged
merged 6 commits into from
Aug 30, 2024
Merged
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
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
root = true

[*]
indent_size = 4
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
Expand Down
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

18 changes: 0 additions & 18 deletions .eslintrc

This file was deleted.

10 changes: 0 additions & 10 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
**Is your PR related to a specific issue/feature? Please describe and mention issues.**

A clear and concise description of what was fixed or implemented.

**Additional context**

Add any other context or screenshots about the feature request here.

**Checklist:**

- [ ] Code style and linters are passing
- [ ] Backwards compatibility is maintained
- [ ] Documentation is updated
113 changes: 72 additions & 41 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,79 @@
name: Publish new version to NPM
name: Nuxt [Release]

env:
node_version: 20.x
package_manager: yarn # or npm
install_command: yarn install # or npm ci
script_command: yarn # or npm run
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
NODE_REGISTRY: 'https://registry.npmjs.org' # setup credentials
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # pass token to generate sync release via changelogen
node_version: 20
changelog_user: Github CI
changelog_email: [email protected]
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
NODE_REGISTRY: https://registry.npmjs.org/ # setup credentials for npm
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # pass token to generate changelog

on:
workflow_dispatch: # manual trigger
concurrency:
group: nuxt-auth-sanctum-release
cancel-in-progress: false

permissions:
contents: write
id-token: write
contents: write
id-token: write

on:
workflow_dispatch: # manual trigger

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
cache: ${{ env.package_manager }}
registry-url: ${{ env.NODE_REGISTRY }}

- name: Install dependencies
run: ${{ env.install_command }}

- name: Validate package
run: ${{ env.script_command }} validate

- name: Build package
run: ${{ env.script_command }} prepack

- name: Generate changelog and publish package
run: |
git config --global user.name "changelog_action"
git config --global user.email "[email protected]"
${{ env.script_command }} changelogen --release --push --publish
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Enable corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

- name: Install dependencies
run: npx nypm@latest i

- name: Prepare stubs
run: pnpm dev:prepare

- name: Validate package
run: pnpm validate

publish:
runs-on: ubuntu-latest
needs: lint

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history for tags

- name: Enable corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
registry-url: ${{ env.NODE_REGISTRY }}

- name: Install dependencies
run: npx nypm@latest i

- name: Prepare stubs
run: pnpm dev:prepare

- name: Build
run: pnpm prepack

- name: Generate changelog and publish release
run: |
git config --global user.name "${{ env.changelog_user }}"
git config --global user.email "${{ env.changelog_email }}"
pnpm changelogen --release --push --publish
117 changes: 60 additions & 57 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
@@ -1,63 +1,66 @@
# Pipeline to run code quality checks (eslint, prettier, typecheck)
name: Nuxt 3 [Validate]
name: Nuxt [Validate]

env:
node_version: 20.x
package_manager: yarn # or npm
install_command: yarn install # or npm ci
script_command: yarn # or npm run

on:
workflow_dispatch: # manual trigger
pull_request:
branches: [main]
node_version: 20

concurrency:
group: module-validation
cancel-in-progress: false
group: nuxt-auth-sanctum-ci
cancel-in-progress: false

on:
workflow_dispatch: # manual trigger
pull_request:
branches:
- main

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ env.node_version }}
cache: ${{ env.package_manager }}

- name: Create packages cache
uses: actions/cache@v3
with:
path: |
dist
.nuxt
key: ${{ runner.os }}-nuxt-build-${{ hashFiles('dist') }}
restore-keys: |
${{ runner.os }}-nuxt-build-

- name: Install dependencies
run: ${{ env.install_command }}

- name: Run Prettier
run: |
${{ env.script_command }} fmt:check

- name: Run ESLint
run: |
${{ env.script_command }} lint

- name: Run TypeCheck
run: |
${{ env.script_command }} test:types

- name: Run tests
run: |
${{ env.script_command }} test

- name: Run build
run: |
${{ env.script_command }} prepack
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Enable corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

- name: Install dependencies
run: npx nypm@latest i

- name: Lint
run: pnpm lint

- name: Build stubs
run: pnpm dev:prepare

- name: Type check
run: pnpm test:types

test:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Enable corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}

- name: Install dependencies
run: npx nypm@latest i

- name: Build stubs
run: pnpm dev:prepare

- name: Test
run: pnpm test
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
shamefully-hoist=true
strict-peer-dependencies=false
4 changes: 0 additions & 4 deletions .nuxtrc

This file was deleted.

9 changes: 0 additions & 9 deletions .prettierignore

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierrc.json

This file was deleted.

Loading