diff --git a/.env.example b/.env.example index beff9e50c..dd95e80fa 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,5 @@ -#secure password, can use openssl rand -hex 32 +# secure password, can use `openssl rand -hex 32` NUXT_SESSION_PASSWORD="" -#HMAC secret for image proxy URL signing, can use openssl rand -hex 32 -NUXT_IMAGE_PROXY_SECRET="" \ No newline at end of file +# HMAC secret for image-proxy and OG image URL signing, can use `openssl rand -hex 32` +NUXT_IMAGE_PROXY_SECRET="" diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 9e9a183b2..20598ffe2 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,5 +1,7 @@ name: "\U0001F41E Bug report" description: Create a report to help us improve npmx +type: bug +labels: ['pending triage'] body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 3d1d430bd..20ad6fce0 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -1,5 +1,6 @@ name: '🚀 Feature request' description: Suggest a feature that will improve npmx +type: feature labels: ['pending triage'] body: - type: markdown diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 654a07fc0..9181ebc8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,6 +114,9 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: 👑 Fix Git ownership + run: git config --global --add safe.directory /__w/npmx.dev/npmx.dev + - uses: voidzero-dev/setup-vp@8ecb39174989ce55af90f45cf55b02738599831d # v1 with: node-version: lts/* diff --git a/.github/workflows/dependency-diff.yml b/.github/workflows/dependency-diff.yml index afc1070f9..ae10eee37 100644 --- a/.github/workflows/dependency-diff.yml +++ b/.github/workflows/dependency-diff.yml @@ -35,7 +35,8 @@ jobs: with: mode: artifact detect-replacements: 'true' - duplicate-threshold: '4' + # Too noisy. Disabling until this can report on duplicate CHANGES in this PR. + duplicate-threshold: '999' dependency-threshold: '15' size-threshold: '200000' diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 000000000..064a9abde --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,41 @@ +name: Stale Issues and PRs + +on: + schedule: + # Run daily at 2 AM UTC + - cron: '0 2 * * *' + workflow_dispatch: # Allow manual trigger + +permissions: + issues: write + pull-requests: write + +jobs: + stale-bugs: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f + with: + days-before-issue-stale: 30 + days-before-issue-close: 7 + days-before-pr-stale: -1 + days-before-pr-close: -1 + remove-stale-when-updated: true + only-issue-types: 'bug' + stale-issue-label: 'stale' + close-issue-label: 'stale' + operations-per-run: 500 + + stale-prs: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f + with: + days-before-issue-stale: -1 + days-before-issue-close: -1 + days-before-pr-stale: 30 + days-before-pr-close: 7 + remove-stale-when-updated: true + stale-pr-label: 'stale' + close-pr-label: 'stale' + operations-per-run: 500 diff --git a/.nuxtrc b/.nuxtrc index 1e1fe8339..4f03c3fcf 100644 --- a/.nuxtrc +++ b/.nuxtrc @@ -1 +1 @@ -setups.@nuxt/test-utils="4.0.0" \ No newline at end of file +setups.@nuxt/test-utils="4.0.2" \ No newline at end of file diff --git a/.storybook/main.ts b/.storybook/main.ts index 8e14495eb..e7f727018 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -5,8 +5,7 @@ import { resolve } from 'node:path' const config = { stories: [ // List welcome first in sidebar - '../.storybook/docs/welcome.mdx', - '../.storybook/docs/*.mdx', + '../app/storybook/welcome.mdx', '../app/**/*.@(mdx|stories.@(js|ts))', ], addons: [ diff --git a/.storybook/preview-head.html b/.storybook/preview-head.html index f644bb743..c626f23ef 100644 --- a/.storybook/preview-head.html +++ b/.storybook/preview-head.html @@ -61,3 +61,19 @@ background-color: var(--bg, oklch(0.171 0 0)) !important; } + diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 30d8f6cfc..e64a50168 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -10,18 +10,8 @@ import npmxDark from './theme' initialize() -// related: https://github.com/npmx-dev/npmx.dev/blob/1431d24be555bca5e1ae6264434d49ca15173c43/test/nuxt/setup.ts#L12-L26 -// Stub Nuxt specific globals // @ts-expect-error - dynamic global name -globalThis['__NUXT_COLOR_MODE__'] ??= { - preference: 'system', - value: 'dark', - getColorScheme: fn(() => 'dark'), - addColorScheme: fn(), - removeColorScheme: fn(), -} -// @ts-expect-error - dynamic global name -globalThis.defineOgImageComponent = fn() +globalThis.defineOgImage = fn() // Subscribe to locale changes from storybook-i18n addon (once, outside decorator) let currentI18nInstance: any = null diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b6cd39f1c..be673d26f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -348,7 +348,7 @@ Ideally, extract utilities into separate files so they can be unit tested. 🙏 ### Internal linking -Always use **object syntax with named routes** for internal navigation. This makes links resilient to URL structure changes and provides type safety via `unplugin-vue-router`. +Always use **object syntax with named routes** for internal navigation. This makes links resilient to URL structure changes and provides type safety with the [typedPages Nuxt option](https://nuxt.com/docs/4.x/guide/going-further/experimental-features#typedpages). ```vue diff --git a/app/app.vue b/app/app.vue index 510fb719e..34fc1d5c0 100644 --- a/app/app.vue +++ b/app/app.vue @@ -127,6 +127,10 @@ if (import.meta.client) { useEventListener(document, 'click', handleModalLightDismiss) } } + +// title and description will be inferred +// this will be overridden by upstream pages that use different templates +defineOgImage('Page.takumi', {}, { alt: 'npmx — a fast, modern browser for the npm registry' })