Skip to content

Commit 84ba3d0

Browse files
authored
chore: release v0.2.0 (#1880)
2 parents ca7c6d5 + 4d70dd8 commit 84ba3d0

File tree

13 files changed

+129
-46
lines changed

13 files changed

+129
-46
lines changed
Lines changed: 17 additions & 0 deletions
Loading
Lines changed: 17 additions & 0 deletions
Loading

app/assets/logos/sponsors/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import LogoVlt from './vlt.svg'
66
import LogoVltLight from './vlt-light.svg'
77
import LogoNetlify from './netlify.svg'
88
import LogoNetlifyLight from './netlify-light.svg'
9+
import LogoBluesky from './bluesky.svg'
10+
import LogoBlueskyLight from './bluesky-light.svg'
911

1012
// The list is used on the about page. To add, simply upload the logos nearby and add an entry here. Prefer SVGs.
1113
// For logo src, specify a string or object with the light and dark theme variants.
@@ -51,4 +53,13 @@ export const SPONSORS = [
5153
normalisingIndent: '0.125rem',
5254
url: 'https://netlify.com/',
5355
},
56+
{
57+
name: 'Bluesky',
58+
logo: {
59+
dark: LogoBluesky,
60+
light: LogoBlueskyLight,
61+
},
62+
normalisingIndent: '0.625rem',
63+
url: 'https://bsky.app/',
64+
},
5465
]

app/components/BlogPostListCard.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ defineProps<{
3333
<!-- Text Content -->
3434
<div class="flex-1 min-w-0 text-start gap-2">
3535
<div class="flex items-center gap-2">
36-
<span class="text-xs text-fg-muted font-mono">{{ published }}</span>
36+
<span class="text-xs text-fg-muted font-mono">
37+
<DateTime :datetime="published" year="numeric" month="short" day="numeric" />
38+
</span>
3739
<span
3840
v-if="draft"
3941
class="text-xs px-1.5 py-0.5 rounded badge-orange font-sans font-medium"

app/components/BuildEnvironment.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const buildTime = computed(() => new Date(buildInfo.value.time))
2323
<span>&middot;</span>
2424
<LinkBase
2525
v-if="buildInfo.env === 'release'"
26-
:to="`https://github.com/npmx-dev/npmx.dev/tag/v${buildInfo.version}`"
26+
:to="`https://github.com/npmx-dev/npmx.dev/releases/tag/v${buildInfo.version}`"
2727
>
2828
v{{ buildInfo.version }}
2929
</LinkBase>

app/components/Header/ConnectorModal.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ function handleDisconnect() {
116116
dir="ltr"
117117
>
118118
<span class="text-fg-subtle">$</span>
119-
<span class="text-fg-subtle ms-2">pnpm npmx-connector</span>
119+
<span class="text-fg-subtle ms-2">npx npmx-connector</span>
120120
<ButtonBase
121121
:aria-label="copied ? $t('connector.modal.copied') : $t('connector.modal.copy_command')"
122-
@click="copy('pnpm npmx-connector')"
122+
@click="copy('npx npmx-connector')"
123123
class="ms-auto"
124124
:classicon="copied ? 'i-lucide:check text-green-500' : 'i-lucide:copy'"
125125
/>

app/pages/blog/alpha-release.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ headline="Read more from the community"
9090
description: 'Getting involved in open source doesn\'t have to be scary! Understand how to find a great project and make your first contribution in this guide from Salma.'
9191
},
9292
{
93-
url: 'https://roe.dev/blog/a-virtuous-cycle',
93+
url: 'https://roe.dev/blog/virtuous-circle',
9494
title: 'A Virtuous Circle',
9595
authorHandle: 'danielroe.dev',
9696
description: 'There\'s a reason why building npmx has been such a blast so far, and it\'s one of the most powerful patterns in open source software development. It\'s also why \'the 10x developer\' is an incredibly dangerous myth.'

config/env.ts

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
import Git from 'simple-git'
44
import * as process from 'node:process'
55

6-
export { version } from '../package.json'
6+
import { version as packageVersion } from '../package.json'
7+
8+
export { packageVersion as version }
79

810
/**
911
* Environment variable `PULL_REQUEST` provided by Netlify.
@@ -41,22 +43,24 @@ export const gitBranch = process.env.BRANCH || process.env.VERCEL_GIT_COMMIT_REF
4143
/**
4244
* Whether this is the canary environment (main.npmx.dev).
4345
*
44-
* Detected via the custom Vercel environment (`VERCEL_ENV === 'canary'`),
45-
* or as a fallback, a production deploy from the `main` branch.
46+
* Detected as any non-PR Vercel deploy from the `main` branch
47+
* (which may receive `VERCEL_ENV === 'production'` or `'preview'`
48+
* depending on the project's production branch configuration).
4649
*
4750
* @see {@link https://vercel.com/docs/environment-variables/system-environment-variables#VERCEL_ENV}
4851
*/
4952
export const isCanary =
50-
process.env.VERCEL_ENV === 'canary' ||
51-
(process.env.VERCEL_ENV === 'production' && gitBranch === 'main')
53+
(process.env.VERCEL_ENV === 'production' || process.env.VERCEL_ENV === 'preview') &&
54+
gitBranch === 'main' &&
55+
!isPR
5256

5357
/**
5458
* Environment variable `CONTEXT` provided by Netlify.
5559
* `dev`, `production`, `deploy-preview`, `branch-deploy`, `preview-server`, or a branch name
5660
* @see {@link https://docs.netlify.com/build/configure-builds/environment-variables/#build-metadata}
5761
*
5862
* Environment variable `VERCEL_ENV` provided by Vercel.
59-
* `production`, `preview`, `development`, or a custom environment name (e.g. `canary`).
63+
* `production`, `preview`, or `development`.
6064
* @see {@link https://vercel.com/docs/environment-variables/system-environment-variables#VERCEL_ENV}
6165
*
6266
* Whether this is some sort of preview environment.
@@ -152,12 +156,28 @@ export async function getFileLastUpdated(path: string) {
152156
}
153157
}
154158

159+
/**
160+
* Resolves the current version from git tags, falling back to `package.json`.
161+
*
162+
* Uses `git describe --tags --abbrev=0 --match 'v*'` to find the most recent
163+
* reachable release tag (e.g. `v0.1.0` -> `0.1.0`).
164+
*/
165+
export async function getVersion() {
166+
try {
167+
const tag = (await git.raw(['describe', '--tags', '--abbrev=0', '--match', 'v*'])).trim()
168+
return tag.replace(/^v/, '')
169+
} catch {
170+
return packageVersion
171+
}
172+
}
173+
155174
export async function getEnv(isDevelopment: boolean) {
156-
const { commit, shortCommit, branch } = await getGitInfo()
175+
const [{ commit, shortCommit, branch }, version] = await Promise.all([getGitInfo(), getVersion()])
157176
const env = isDevelopment ? 'dev' : isCanary ? 'canary' : isPreview ? 'preview' : 'release'
158177
const previewUrl = getPreviewUrl()
159178
const productionUrl = getProductionUrl()
160179
return {
180+
version,
161181
commit,
162182
shortCommit,
163183
branch,

modules/build-env.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { BuildInfo, EnvType } from '../shared/types'
22
import { createResolver, defineNuxtModule } from 'nuxt/kit'
33
import { isCI } from 'std-env'
4-
import { getEnv, getFileLastUpdated, version } from '../config/env'
4+
import { getEnv, getFileLastUpdated } from '../config/env'
55

66
const { resolve } = createResolver(import.meta.url)
77

@@ -26,7 +26,7 @@ export default defineNuxtModule({
2626
prNumber: null,
2727
} satisfies BuildInfo
2828
} else {
29-
const [{ env: useEnv, commit, shortCommit, branch, prNumber }, privacyPolicyDate] =
29+
const [{ env: useEnv, version, commit, shortCommit, branch, prNumber }, privacyPolicyDate] =
3030
await Promise.all([getEnv(nuxt.options.dev), getFileLastUpdated('app/pages/privacy.vue')])
3131
env = useEnv
3232
nuxt.options.appConfig.env = useEnv

nuxt.config.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default defineNuxtConfig({
5555
},
5656
},
5757

58-
devtools: { enabled: !true },
58+
devtools: { enabled: true },
5959

6060
devServer: {
6161
// Used with atproto oauth
@@ -136,6 +136,14 @@ export default defineNuxtConfig({
136136
// never cache
137137
'/api/auth/**': { isr: false, cache: false },
138138
'/api/social/**': { isr: false, cache: false },
139+
'/api/atproto/bluesky-comments': {
140+
isr: {
141+
expiration: 60 * 60 /* one hour */,
142+
passQuery: true,
143+
allowQuery: ['uri'],
144+
},
145+
cache: { maxAge: 3600 },
146+
},
139147
'/api/atproto/bluesky-author-profiles': {
140148
isr: {
141149
expiration: 60 * 60 /* one hour */,

0 commit comments

Comments
 (0)