Skip to content

Commit 211417f

Browse files
committed
docs: add initial documentation
chore: wip chore: wip
1 parent 0ea2e14 commit 211417f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3815
-31
lines changed

.github/art/cover.jpg

6.78 KB
Loading

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*.tgz
66
coverage
77
dist
8+
docs/.vitepress/cache
89
lib-cov
910
logs
1011
node_modules

.vscode/dictionary.txt

+1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,6 @@ upath
3535
vite
3636
vitebook
3737
vitejs
38+
vitepress
3839
vue-demi
3940
vueus

bun.lock

+1,087-25
Large diffs are not rendered by default.

docs/.vitepress/components.d.ts

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
// Generated by unplugin-vue-components
4+
// Read more: https://github.com/vuejs/core/pull/3399
5+
// biome-ignore lint: disable
6+
export {}
7+
8+
/* prettier-ignore */
9+
declare module 'vue' {
10+
export interface GlobalComponents {
11+
Home: typeof import('./theme/components/Home.vue')['default']
12+
HomeContributors: typeof import('./theme/components/HomeContributors.vue')['default']
13+
HomeSponsors: typeof import('./theme/components/HomeSponsors.vue')['default']
14+
HomeTeam: typeof import('./theme/components/HomeTeam.vue')['default']
15+
TeamMember: typeof import('./theme/components/TeamMember.vue')['default']
16+
}
17+
}

docs/.vitepress/config.ts

+150
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
import type { HeadConfig } from 'vitepress'
2+
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
3+
import { withPwa } from '@vite-pwa/vitepress'
4+
import { defineConfig } from 'vitepress'
5+
import vite from './vite.config'
6+
7+
// https://vitepress.dev/reference/site-config
8+
const analyticsHead: HeadConfig[] = [
9+
[
10+
'script',
11+
{
12+
'src': 'https://cdn.usefathom.com/script.js',
13+
'data-site': 'EVVUGSUE',
14+
'defer': '',
15+
},
16+
],
17+
]
18+
19+
const nav = [
20+
{ text: 'News', link: 'https://stacksjs.org/news' },
21+
{ text: 'Changelog', link: 'https://github.com/stacksjs/vite-plugin-dotenvx/releases' },
22+
{
23+
text: 'Resources',
24+
items: [
25+
{ text: 'Team', link: '/team' },
26+
{ text: 'Sponsors', link: '/sponsors' },
27+
{ text: 'Partners', link: '/partners' },
28+
{ text: 'Postcardware', link: '/postcardware' },
29+
{ text: 'License', link: '/license' },
30+
{
31+
items: [
32+
{ text: 'Awesome Stacks', link: 'https://github.com/stacksjs/awesome-stacks' },
33+
{ text: 'Contributing', link: 'https://github.com/stacksjs/vite-plugin-dotenvx/blob/main/.github/CONTRIBUTING.md' },
34+
],
35+
},
36+
],
37+
},
38+
]
39+
40+
const sidebar = [
41+
{
42+
text: 'Get Started',
43+
items: [
44+
{ text: 'Intro', link: '/intro' },
45+
{ text: 'Install', link: '/install' },
46+
{ text: 'Usage', link: '/usage' },
47+
],
48+
},
49+
{
50+
text: 'Examples',
51+
items: [
52+
{ text: 'Basic Usage', link: '/examples/basic' },
53+
{ text: 'Multiple Environments', link: '/examples/multiple-environments' },
54+
{ text: 'Client-Side Variables', link: '/examples/client-side' },
55+
{ text: 'Next.js Convention', link: '/examples/nextjs-convention' },
56+
{ text: 'Auto-Generation', link: '/examples/auto-generation' },
57+
],
58+
},
59+
{ text: 'Showcase', link: '/Showcase' },
60+
]
61+
62+
export default withPwa(
63+
defineConfig({
64+
lang: 'en-US',
65+
title: 'vite-plugin-dotenvx',
66+
description: 'A Vite plugin to seamlessly integrate with dotenvx.',
67+
cleanUrls: true,
68+
lastUpdated: true,
69+
metaChunk: true,
70+
71+
head: [
72+
['link', { rel: 'icon', type: 'image/svg+xml', href: './images/logo-mini.svg' }],
73+
['link', { rel: 'icon', type: 'image/png', href: './images/logo.png' }],
74+
// meta info
75+
['meta', { name: 'theme-color', content: '#0A0ABC' }],
76+
['meta', { name: 'title', content: 'vite-plugin-dotenvx | A Vite plugin to seamlessly integrate with dotenvx.' }],
77+
['meta', { name: 'description', content: 'A Vite plugin to seamlessly integrate with dotenvx.' }],
78+
['meta', { name: 'author', content: 'Stacks.js, Inc.' }],
79+
['meta', { name: 'tags', content: 'vite, vite-plugin, dotenvx, dotenv, environment, variables, development, lightweight' }],
80+
// open graph
81+
['meta', { property: 'og:type', content: 'website' }],
82+
['meta', { property: 'og:locale', content: 'en' }],
83+
['meta', { property: 'og:title', content: 'vite-plugin-dotenvx | A Vite plugin to seamlessly integrate with dotenvx.' }],
84+
['meta', { property: 'og:site_name', content: 'vite-plugin-dotenvx' }],
85+
['meta', { property: 'og:image', content: '/images/og-image.png' }],
86+
['meta', {
87+
property: 'og:description',
88+
content: 'A Vite plugin to seamlessly integrate with dotenvx.',
89+
}],
90+
['meta', { property: 'og:url', content: 'https://vite-plugin-dotenvx.netlify.app/' }],
91+
...analyticsHead,
92+
],
93+
94+
themeConfig: {
95+
search: {
96+
provider: 'local',
97+
},
98+
logo: {
99+
light: './images/logo-transparent.svg',
100+
dark: './images/logo-white-transparent.svg',
101+
},
102+
103+
nav,
104+
sidebar,
105+
106+
editLink: {
107+
pattern: 'https://github.com/stacksjs/stacks/edit/main/docs/docs/:path',
108+
text: 'Edit this page on GitHub',
109+
},
110+
111+
footer: {
112+
message: 'Released under the MIT License.',
113+
copyright: 'Copyright © 2025-present Stacks.js, Inc.',
114+
},
115+
116+
socialLinks: [
117+
{ icon: 'twitter', link: 'https://twitter.com/stacksjs' },
118+
{ icon: 'bluesky', link: 'https://bsky.app/profile/chrisbreuer.dev' },
119+
{ icon: 'github', link: 'https://github.com/stacksjs/vite-plugin-dotenvx' },
120+
{ icon: 'discord', link: 'https://discord.gg/stacksjs' },
121+
],
122+
123+
// algolia: services.algolia,
124+
125+
// carbonAds: {
126+
// code: '',
127+
// placement: '',
128+
// },
129+
},
130+
131+
pwa: {
132+
manifest: {
133+
theme_color: '#0A0ABC',
134+
},
135+
},
136+
137+
markdown: {
138+
theme: {
139+
light: 'github-light',
140+
dark: 'github-dark',
141+
},
142+
143+
codeTransformers: [
144+
transformerTwoslash(),
145+
],
146+
},
147+
148+
vite,
149+
}),
150+
)

docs/.vitepress/sw.ts

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
/// <reference types="vite/client" />
2+
3+
/// <reference lib="webworker" />
4+
5+
import { CacheableResponsePlugin } from 'workbox-cacheable-response'
6+
import { ExpirationPlugin } from 'workbox-expiration'
7+
import { cleanupOutdatedCaches, createHandlerBoundToURL, precacheAndRoute } from 'workbox-precaching'
8+
import { NavigationRoute, registerRoute } from 'workbox-routing'
9+
import { NetworkFirst, NetworkOnly, StaleWhileRevalidate } from 'workbox-strategies'
10+
11+
declare let self: ServiceWorkerGlobalScope
12+
13+
const entries = self.__WB_MANIFEST
14+
15+
// self.__WB_MANIFEST is the default injection point
16+
precacheAndRoute(entries)
17+
18+
// clean old assets
19+
cleanupOutdatedCaches()
20+
21+
let allowlist: undefined | RegExp[]
22+
if (import.meta.env.DEV)
23+
allowlist = [/^\/$/]
24+
25+
if (import.meta.env.PROD) {
26+
const swPath = self.location.pathname.lastIndexOf('/')
27+
const base = swPath === 0 ? '/' : self.location.pathname.slice(0, swPath + 1)
28+
function escapeStringRegexp(value: string) {
29+
// Escape characters with special meaning either inside or outside character sets.
30+
// Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
31+
return value
32+
.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
33+
.replace(/-/g, '\\x2d')
34+
}
35+
allowlist = entries.filter((page) => {
36+
return typeof page === 'string'
37+
? page.endsWith('.html')
38+
: page.url.endsWith('.html')
39+
}).map((page) => {
40+
const url = typeof page === 'string' ? page : page.url
41+
const regex = url === 'index.html'
42+
? escapeStringRegexp(base)
43+
: escapeStringRegexp(`${base}${url.replace(/\.html$/, '')}`)
44+
return new RegExp(`^${regex}(\\.html)?$`)
45+
})
46+
registerRoute(
47+
({ request, sameOrigin }) => {
48+
return sameOrigin && request.mode === 'navigate'
49+
},
50+
new NetworkOnly({
51+
plugins: [{
52+
/* this callback will be called when the fetch call fails */
53+
handlerDidError: async () => Response.redirect('404', 302),
54+
/* this callback will prevent caching the response */
55+
cacheWillUpdate: async () => null,
56+
}],
57+
}),
58+
'GET',
59+
)
60+
// googleapis
61+
registerRoute(
62+
/^https:\/\/fonts\.googleapis\.com\/.*/i,
63+
new NetworkFirst({
64+
cacheName: 'google-fonts-cache',
65+
plugins: [
66+
new CacheableResponsePlugin({ statuses: [0, 200] }),
67+
// we only need a few entries
68+
new ExpirationPlugin({
69+
maxEntries: 10,
70+
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
71+
}),
72+
],
73+
}),
74+
)
75+
// gstatic
76+
registerRoute(
77+
/^https:\/\/fonts\.gstatic\.com\/.*/i,
78+
new StaleWhileRevalidate({
79+
cacheName: 'google-fonts-cache',
80+
plugins: [
81+
new CacheableResponsePlugin({ statuses: [0, 200] }),
82+
// we only need a few entries
83+
new ExpirationPlugin({
84+
maxEntries: 10,
85+
maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days
86+
}),
87+
],
88+
}),
89+
)
90+
// antfu sponsors
91+
registerRoute(
92+
/^https:\/\/cdn\.jsdelivr\.net\/.*/i,
93+
new NetworkFirst({
94+
cacheName: 'jsdelivr-images-cache',
95+
plugins: [
96+
new CacheableResponsePlugin({ statuses: [0, 200] }),
97+
// we only need a few entries
98+
new ExpirationPlugin({
99+
maxEntries: 10,
100+
maxAgeSeconds: 60 * 60 * 24 * 7, // <== 7 days
101+
}),
102+
],
103+
}),
104+
)
105+
}
106+
107+
// to allow work offline
108+
registerRoute(new NavigationRoute(
109+
createHandlerBoundToURL('index.html'),
110+
{ allowlist },
111+
))
112+
113+
// Skip-Waiting Service Worker-based solution
114+
self.addEventListener('activate', async () => {
115+
// after we've taken over, iterate over all the current clients (windows)
116+
const clients = await self.clients.matchAll({ type: 'window' })
117+
clients.forEach((client) => {
118+
// ...and refresh each one of them
119+
client.navigate(client.url)
120+
})
121+
})
122+
123+
self.skipWaiting()
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<script setup lang="ts">
2+
import { onMounted } from 'vue'
3+
4+
onMounted(() => {
5+
// eslint-disable-next-line no-console
6+
console.log('HUGEICONS_TOKEN', import.meta.env.FRONTEND_HUGEICONS_TOKEN)
7+
})
8+
</script>
9+
10+
<template>
11+
<div class="flex flex-col items-center mt-4 home">
12+
<HomeTeam />
13+
14+
<HomeSponsors />
15+
16+
<HomeContributors />
17+
</div>
18+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script setup lang="ts">
2+
import { contributors } from './contributors'
3+
</script>
4+
5+
<template>
6+
<div class="vp-doc">
7+
<h2 pb-2 pt-5 font-normal op50>
8+
Contributors
9+
</h2>
10+
</div>
11+
12+
<div max-w-200 p-10 text-center text-lg leading-7>
13+
<div flex="~ wrap gap-1" justify-center>
14+
<a v-for="{ name, avatar } of contributors" :key="name" :href="`https://github.com/${name}`" m-0 rel="noopener noreferrer" :aria-label="`${name} on GitHub`">
15+
<img loading="lazy" :src="avatar" width="40" height="40" h-10 min-h-10 min-w-10 w-10 rounded-full :alt="`${name}'s avatar`">
16+
</a>
17+
</div>
18+
<br>
19+
</div>
20+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<template>
2+
<div class="vp-doc">
3+
<h2 pb-2 pt-5 font-normal op50>
4+
Stacks Sponsors
5+
</h2>
6+
</div>
7+
8+
<p id="sponsor" class="mt-5 text-center">
9+
<a href="https://github.com/sponsors/chrisbbreuer">
10+
<img src="https://cdn.jsdelivr.net/gh/stacksjs/sponsors/sponsorkit/sponsors.svg" class="m-auto">
11+
</a>
12+
</p>
13+
14+
<p class="mt-5 text-center">
15+
<a href="https://github.com/sponsors/chrisbbreuer" class="text-xs italic">
16+
Click here to become a sponsor.
17+
</a>
18+
</p>
19+
</template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<script setup lang="ts">
2+
import { coreTeamMembers } from './contributors'
3+
</script>
4+
5+
<template>
6+
<div class="vp-doc">
7+
<h2 pb-2 pt-5 font-normal op50>
8+
Meet The Team
9+
</h2>
10+
</div>
11+
12+
<div grid="~ cols-2 lg:cols-4 gap-x-3 gap-y-20 items-stretch" p-10>
13+
<TeamMember
14+
v-for="c of coreTeamMembers"
15+
:key="c.github"
16+
:data="c"
17+
class="flex flex-col items-center text-center p-4 h-full"
18+
/>
19+
</div>
20+
</template>

0 commit comments

Comments
 (0)