Skip to content

Commit

Permalink
feat: update module to support Nuxt 3.x
Browse files Browse the repository at this point in the history
BREAKING CHANGE: The module now requires Nuxt version 3.x
  • Loading branch information
patrickcate committed Dec 23, 2022
1 parent e51ac1f commit 66b07b8
Show file tree
Hide file tree
Showing 36 changed files with 6,339 additions and 9,582 deletions.
File renamed without changes.
52 changes: 52 additions & 0 deletions .cz-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
module.exports = {
types: [
{ value: 'feat', name: '✨ feat: A new feature' },
{ value: 'fix', name: '🐛 fix: A bug fix' },
{ value: 'docs', name: '📚 docs: Documentation only changes' },
{
value: 'style',
name: '🎨 style: Changes that do not affect the meaning of the code\n(white-space, formatting, missing semi-colons, etc)'
},
{
value: 'refactor',
name: '♻️ refactor: A code change that neither fixes a bug nor adds a feature'
},
{
value: 'perf',
name: '🚀 perf: A code change that improves performance'
},
{
value: 'test',
name: '✅ test: Adding missing tests or stories (example scopes: Cypress, Storybook)'
},
{
value: 'build',
name: '🛠 build: Changes that affect the build system or external dependencies (example scopes: Vite, npm, Hygen)'
},
{
value: 'ci',
name: '⚙️ ci: Changes to our CI configuration files and scripts (example scopes: GitHub Actions, Cypress, Storybook)'
},
{
value: 'chore',
name: '👷 chore: Changes to the build process or auxiliary tools\nand libraries such as documentation generation'
},
{ value: 'revert', name: '🗑 revert: Reverts a previous commit' }
],

// override the messages, defaults are as follows
messages: {
type: "Select the type of change that you're committing:",
scope: '\nDenote the SCOPE of this change (optional):',
// used if allowCustomScopes is true
// customScope: 'Denote the SCOPE of this change:',
subject: 'Write a SHORT, IMPERATIVE tense description of the change:\n',
body: 'Provide a LONGER description of the change (optional). Use "|" to break new line:\n',
breaking: 'List any BREAKING CHANGES (optional):\n',
footer:
'List any ISSUES CLOSED by this change (optional). E.g.: #31, #34:\n',
confirmCommit: 'Are you sure you want to proceed with the commit above?'
},
allowCustomScopes: false,
allowBreakingChanges: ['feat', 'fix']
}
4 changes: 0 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# Common
node_modules
dist
.nuxt
coverage

# Plugin
lib/plugin.js
18 changes: 11 additions & 7 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
module.exports = {
root: true,
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module'
},
extends: ['@nuxtjs', 'plugin:prettier-vue/recommended', 'prettier'],
extends: [
'eslint:recommended',
'@nuxtjs/eslint-config-typescript',
'plugin:prettier-vue/recommended',
'plugin:prettier/recommended',
],
plugins: ['prettier'],
rules: {
'prettier/prettier': ['error'],
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-unused-vars': process.env.NODE_ENV === 'production' ? 'error' : 'warn'
}
'no-unused-vars': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'@typescript-eslint/no-unused-vars': [
process.env.NODE_ENV === 'production' ? 'error' : 'off',
],
},
}
31 changes: 14 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
name: ci
name: Tests

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

jobs:
ci:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [14, 16]
os: [ubuntu-latest]
node: [14, 16, 18]

steps:
- name: checkout
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}

- name: checkout
uses: actions/checkout@master

- name: cache node_modules
uses: actions/cache@v3
with:
Expand All @@ -35,11 +32,11 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: yarn

- name: Lint
run: yarn lint

- name: Test
run: yarn test

- name: Coverage
- name: Upload coverage to Codecov
if: github.actor != 'dependabot[bot]'
uses: codecov/codecov-action@v3
with:
file: ./coverage/lcov.info
32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Release

on:
workflow_dispatch:
push:
branches:
- main

jobs:
release:
if: "!contains(github.event.head_commit.message, 'skip release')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.SEMANTIC_RELEASE_GH_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: yarn install

- name: Release
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_GH_TOKEN }}
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }}
run: yarn semantic-release
57 changes: 52 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,56 @@
# Dependencies
node_modules
*.iml
.idea

# Logs
*.log*

# Temp directories
.temp
.tmp
.cache

# Yarn
**/.yarn/cache
**/.yarn/*state*

# Generated dirs
dist

# Nuxt
.nuxt
.vscode
.DS_Store
.output
.vercel_build_output
.build-*
.env
.netlify

# Env
.env

# Testing
reports
coverage
dist
*.lcov
.nyc_output

# VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets

# Intellij idea
*.iml
.idea

# OSX
.DS_Store
.AppleDouble
.LSOverride
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
25 changes: 25 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
default: true

# ===
# Rule customizations for markdownlint go here
# https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md
# ===

# Disable line length restrictions, because editor soft-wrapping is being
# used instead.
line-length: false

# Allow the `Meta` MDX component.
no-inline-html:
allowed_elements:
- 'Meta'

# Don't require the first element to be a heading tag.
first-line-heading: false

# ===
# Prettier overrides
# ===

no-multiple-blanks: false
list-marker-space: false
2 changes: 2 additions & 0 deletions .nuxtrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports.autoImport=false
typescript.includeWorkspace=true
5 changes: 2 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ node_modules
dist
.nuxt
coverage

# Plugin
lib/plugin.js
.nvmrc
CHANGELOG.md
2 changes: 1 addition & 1 deletion .prettierrc.js → .prettierrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module.exports = {
semi: false,
singleQuote: true,
tabWidth: 2,
trailingComma: 'none',
trailingComma: 'all',
useTabs: false,
vueIndentScriptAndStyle: false
}
33 changes: 33 additions & 0 deletions .releaserc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
branches: [
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{ name: 'beta', prerelease: true },
{ name: 'alpha', prerelease: true },
],
plugins: [
[
'@semantic-release/commit-analyzer',
{
config: '@commitlint/config-conventional',
},
],
'@semantic-release/release-notes-generator',
[
'@semantic-release/changelog',
{
changelogTitle: 'Changelog',
},
],
'@semantic-release/npm',
'@semantic-release/github',
[
'@semantic-release/git',
{
message: 'chore(release): ${nextRelease.version} [skip ci]',
},
],
],
}
Loading

0 comments on commit 66b07b8

Please sign in to comment.