diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 2735ea1..1b697bb 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,6 +1,6 @@ --- -name-template: "v$RESOLVED_VERSION" -tag-template: "v$RESOLVED_VERSION" +name-template: 'v$RESOLVED_VERSION' +tag-template: 'v$RESOLVED_VERSION' template: | # Changelog @@ -8,33 +8,33 @@ template: | See details of [all code changes](https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release. categories: - - title: "🚀 Features" + - title: '🚀 Features' labels: - - "feature" - - "enhancement" - - title: "🐛 Bug Fixes" + - 'feature' + - 'enhancement' + - title: '🐛 Bug Fixes' labels: - - "fix" - - "bugfix" - - "bug" - - title: "🧰 Maintenance" + - 'fix' + - 'bugfix' + - 'bug' + - title: '🧰 Maintenance' labels: - - "infrastructure" - - "automation" - - "documentation" - - title: "🏎 Performance" - label: "performance" -change-template: "- $TITLE @$AUTHOR (#$NUMBER)" + - 'infrastructure' + - 'automation' + - 'documentation' + - title: '🏎 Performance' + label: 'performance' +change-template: '- $TITLE @$AUTHOR (#$NUMBER)' version-resolver: major: labels: - - "type: breaking" + - 'type: breaking' minor: labels: - - "type: enhancement" + - 'type: enhancement' patch: labels: - - "type: bug" - - "type: maintenance" - - "type: documentation" + - 'type: bug' + - 'type: maintenance' + - 'type: documentation' default: patch diff --git a/.github/workflows/check-formatting.yml b/.github/workflows/check-formatting.yml index 0d9c6c9..2c8b85a 100644 --- a/.github/workflows/check-formatting.yml +++ b/.github/workflows/check-formatting.yml @@ -1,4 +1,4 @@ -name: Checking formatting +name: Check formatting on: push: @@ -17,11 +17,12 @@ concurrency: jobs: test: runs-on: ubuntu-latest + timeout-minutes: 2 steps: - name: Checkout uses: actions/checkout@v3 - - name: Setup Node.JS + - name: Setup Node uses: actions/setup-node@v3 with: node-version: 16.x diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5663fe..2f2f188 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: inputs: TAG_NAME: - description: "Tag name that the major tag will point to" + description: 'Tag name that the major tag will point to' required: true env: diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..49c3ce5 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +# Ignore build artifacts +/dist/ + +# Ignore all Markdown files +*.md diff --git a/package.json b/package.json index 6a74d6c..f37c680 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,8 @@ "main": "./dist/index.js", "scripts": { "all": "npm run format && npm run lint && npm run prepare && npm run test", - "format": "prettier --write 'src/**/*.js'", - "format:check": "prettier --check 'src/**/*.js'", + "format": "prettier --write .", + "format:check": "prettier --check .", "lint": "DEBUG=eslint:cli-engine eslint --fix .", "lint:check": "DEBUG=eslint:cli-engine eslint .", "prepare": "ncc build src/index.js -o dist --source-map --license licenses.txt", diff --git a/src/fixtures/next/default.cjs b/src/fixtures/next/default.cjs index ae88795..e674786 100644 --- a/src/fixtures/next/default.cjs +++ b/src/fixtures/next/default.cjs @@ -1,7 +1,7 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, - swcMinify: true, + swcMinify: true } module.exports = nextConfig diff --git a/src/fixtures/next/default.mjs b/src/fixtures/next/default.mjs index 07e1aaf..1b33dac 100644 --- a/src/fixtures/next/default.mjs +++ b/src/fixtures/next/default.mjs @@ -1,7 +1,7 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, - swcMinify: true, + swcMinify: true } export default nextConfig diff --git a/src/fixtures/nuxt/async.cjs b/src/fixtures/nuxt/async.cjs index d934c1c..5b87d9c 100644 --- a/src/fixtures/nuxt/async.cjs +++ b/src/fixtures/nuxt/async.cjs @@ -1,15 +1,15 @@ -const getAllDynamicRoute = async function() { +const getAllDynamicRoute = async function () { const routes = await (async () => { - return ['/posts/hello-world', '/posts/hello-again']; - })(); - return routes; -}; + return ['/posts/hello-world', '/posts/hello-again'] + })() + return routes +} module.exports = { mode: 'universal', generate: { - async routes () { - return getAllDynamicRoute(); + async routes() { + return getAllDynamicRoute() } } -}; +} diff --git a/src/fixtures/nuxt/async.expected.cjs b/src/fixtures/nuxt/async.expected.cjs index 94d01c4..6867d54 100644 --- a/src/fixtures/nuxt/async.expected.cjs +++ b/src/fixtures/nuxt/async.expected.cjs @@ -1,17 +1,17 @@ -const getAllDynamicRoute = async function() { +const getAllDynamicRoute = async function () { const routes = await (async () => { - return ['/posts/hello-world', '/posts/hello-again']; - })(); - return routes; -}; + return ['/posts/hello-world', '/posts/hello-again'] + })() + return routes +} module.exports = { target: 'static', router: { base: '/docs/' }, mode: 'universal', generate: { - async routes () { - return getAllDynamicRoute(); + async routes() { + return getAllDynamicRoute() } } -}; +} diff --git a/src/fixtures/nuxt/async.expected.mjs b/src/fixtures/nuxt/async.expected.mjs index 99bfcc5..231f6dc 100644 --- a/src/fixtures/nuxt/async.expected.mjs +++ b/src/fixtures/nuxt/async.expected.mjs @@ -1,17 +1,17 @@ -const getAllDynamicRoute = async function() { +const getAllDynamicRoute = async function () { const routes = await (async () => { - return ['/posts/hello-world', '/posts/hello-again']; - })(); - return routes; -}; + return ['/posts/hello-world', '/posts/hello-again'] + })() + return routes +} export default { target: 'static', router: { base: '/docs/' }, mode: 'universal', generate: { - async routes () { - return getAllDynamicRoute(); + async routes() { + return getAllDynamicRoute() } } -}; +} diff --git a/src/fixtures/nuxt/async.mjs b/src/fixtures/nuxt/async.mjs index 00b6057..a32b219 100644 --- a/src/fixtures/nuxt/async.mjs +++ b/src/fixtures/nuxt/async.mjs @@ -1,15 +1,15 @@ -const getAllDynamicRoute = async function() { +const getAllDynamicRoute = async function () { const routes = await (async () => { - return ['/posts/hello-world', '/posts/hello-again']; - })(); - return routes; -}; + return ['/posts/hello-world', '/posts/hello-again'] + })() + return routes +} export default { mode: 'universal', generate: { - async routes () { - return getAllDynamicRoute(); + async routes() { + return getAllDynamicRoute() } } -}; +} diff --git a/src/fixtures/nuxt/default.cjs b/src/fixtures/nuxt/default.cjs index 7e55793..f44ba4a 100644 --- a/src/fixtures/nuxt/default.cjs +++ b/src/fixtures/nuxt/default.cjs @@ -14,9 +14,7 @@ module.exports = { { hid: 'description', name: 'description', content: '' }, { name: 'format-detection', content: 'telephone=no' } ], - link: [ - { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } - ] + link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }] }, // Global CSS: https://go.nuxtjs.dev/config-css @@ -36,4 +34,4 @@ module.exports = { // Build Configuration: https://go.nuxtjs.dev/config-build build: {} -} \ No newline at end of file +} diff --git a/src/fixtures/nuxt/default.expected.cjs b/src/fixtures/nuxt/default.expected.cjs index e7e90b8..bf7f92b 100644 --- a/src/fixtures/nuxt/default.expected.cjs +++ b/src/fixtures/nuxt/default.expected.cjs @@ -16,9 +16,7 @@ module.exports = { { hid: 'description', name: 'description', content: '' }, { name: 'format-detection', content: 'telephone=no' } ], - link: [ - { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } - ] + link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }] }, // Global CSS: https://go.nuxtjs.dev/config-css @@ -38,4 +36,4 @@ module.exports = { // Build Configuration: https://go.nuxtjs.dev/config-build build: {} -} \ No newline at end of file +} diff --git a/src/fixtures/nuxt/default.expected.mjs b/src/fixtures/nuxt/default.expected.mjs index fd46ea4..32e84fc 100644 --- a/src/fixtures/nuxt/default.expected.mjs +++ b/src/fixtures/nuxt/default.expected.mjs @@ -16,9 +16,7 @@ export default { { hid: 'description', name: 'description', content: '' }, { name: 'format-detection', content: 'telephone=no' } ], - link: [ - { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } - ] + link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }] }, // Global CSS: https://go.nuxtjs.dev/config-css @@ -38,4 +36,4 @@ export default { // Build Configuration: https://go.nuxtjs.dev/config-build build: {} -} \ No newline at end of file +} diff --git a/src/fixtures/nuxt/default.mjs b/src/fixtures/nuxt/default.mjs index 20b7d86..11d92cd 100644 --- a/src/fixtures/nuxt/default.mjs +++ b/src/fixtures/nuxt/default.mjs @@ -14,9 +14,7 @@ export default { { hid: 'description', name: 'description', content: '' }, { name: 'format-detection', content: 'telephone=no' } ], - link: [ - { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' } - ] + link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }] }, // Global CSS: https://go.nuxtjs.dev/config-css @@ -36,4 +34,4 @@ export default { // Build Configuration: https://go.nuxtjs.dev/config-build build: {} -} \ No newline at end of file +}