diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c126e5e7..4159bb48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,13 +22,13 @@ jobs: lfs: true - name: Use Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: 20.x - - uses: pnpm/action-setup@v2.0.1 + - uses: pnpm/action-setup@v4 with: - version: 7.4.1 + version: 9.8.0 run_install: | - recursive: false @@ -59,13 +59,13 @@ jobs: - uses: actions/checkout@v2 - name: Use Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: 16.x + node-version: 20.x - - uses: pnpm/action-setup@v2.0.1 + - uses: pnpm/action-setup@v4 with: - version: 7.4.1 + version: 9.8.0 run_install: | - recursive: false @@ -78,14 +78,14 @@ jobs: - name: Cypress run: pnpm -C docs run cy:run - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 if: failure() with: name: cypress-screenshots path: docs/cypress/screenshots retention-days: 1 - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 if: failure() with: name: cypress-videos diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100755 index 00000000..5e4a6152 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "Vue.volar", + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "antfu.unocss" + ] +} diff --git a/README.md b/README.md index 97d2ddeb..83255c14 100644 --- a/README.md +++ b/README.md @@ -83,7 +83,7 @@ Visit the [documentation website][docs] to check out the [guides][guide] and sea - [Vite] and [Vue]: for enabling an amazing development experience - [Astro](https://astro.build): for sharing a novel way to define islands - [MDX]: provides amazing flexibility when processing Markdown -- [vue-router], [@vueuse/head], and [vite-plugin-pages]: the backbone of this library +- [vue-router], [@unhead/vue], and [vite-plugin-pages]: the backbone of this library - [unplugin-vue-components]: allows you to avoid the boilerplate - [VitePress] and [vite-ssg]: for their different ideas on SSR @@ -96,5 +96,5 @@ Visit the [documentation website][docs] to check out the [guides][guide] and sea [VitePress]: https://vitepress.vuejs.org/ [vite-ssg]: https://github.com/antfu/vite-ssg [vue-router]: https://next.router.vuejs.org/ -[@vueuse/head]: https://github.com/vueuse/head +[@unhead/vue]: https://github.com/unjs/unhead diff --git a/docs/cypress/e2e/dark-mode.cypress.cy.js b/docs/cypress/e2e/dark-mode.cypress.cy.js index 093d2e21..08d34dff 100644 --- a/docs/cypress/e2e/dark-mode.cypress.cy.js +++ b/docs/cypress/e2e/dark-mode.cypress.cy.js @@ -6,12 +6,12 @@ describe('Dark Mode', () => { } const assertTheme = (theme) => - cy.get('html').then(html => + cy.get('html').then((html) => expect(html.hasClass('dark')).to.equal(theme === 'dark')) it('can toggle on and off', () => { visitHome() - cy.get('html').then(html => { + cy.get('html').then((html) => { if (html.hasClass('dark')) toggleTheme() assertTheme('light') }) diff --git a/docs/cypress/e2e/docsearch.cypress.cy.js b/docs/cypress/e2e/docsearch.cypress.cy.js index 2c44c657..e25d8687 100644 --- a/docs/cypress/e2e/docsearch.cypress.cy.js +++ b/docs/cypress/e2e/docsearch.cypress.cy.js @@ -15,7 +15,7 @@ describe('DocSearch', () => { const searchModal = () => cy.get('.DocSearch-Modal') - const closeSearchModal = () =>{ + const closeSearchModal = () => { cy.get('body').type('{esc}') searchModal().should('not.exist') } diff --git a/docs/icons/arrowRight.svg b/docs/icons/arrowRight.svg index 3df7d07c..8f542e6d 100644 --- a/docs/icons/arrowRight.svg +++ b/docs/icons/arrowRight.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/docs/icons/logo.svg b/docs/icons/logo.svg index ee45c710..622e7654 100644 --- a/docs/icons/logo.svg +++ b/docs/icons/logo.svg @@ -1 +1 @@ - + diff --git a/docs/icons/text.svg b/docs/icons/text.svg index 75ee2c3b..7ccab2d1 100644 --- a/docs/icons/text.svg +++ b/docs/icons/text.svg @@ -1,4 +1,4 @@ -îles +îles diff --git a/docs/icons/vite.svg b/docs/icons/vite.svg index de4aeddc..fe3311b1 100644 --- a/docs/icons/vite.svg +++ b/docs/icons/vite.svg @@ -1,4 +1,4 @@ - + diff --git a/docs/iles.config.ts b/docs/iles.config.ts index bd74cbb6..764fbe80 100644 --- a/docs/iles.config.ts +++ b/docs/iles.config.ts @@ -5,8 +5,9 @@ import headings from '@islands/headings' import icons from '@islands/icons' import prism from '@islands/prism' import pwa from '@islands/pwa' +import reactivityTransform from '@vue-macros/reactivity-transform/vite' -import windicss from 'vite-plugin-windicss' +import UnoCSS from 'unocss/vite' import inspect from 'vite-plugin-inspect' import lastUpdated from './modules/lastUpdated' import site from './src/site' @@ -53,36 +54,6 @@ export default defineConfig({ }, workbox: { globPatterns: ['**/*.{js,css,svg,ico,png,avif,json,xml,html}'], - runtimeCaching: [ - { - urlPattern: new RegExp('https://unpkg.com/.*', 'i'), - handler: 'CacheFirst', - options: { - cacheName: 'unpkg-cache', - expiration: { - maxEntries: 10, - maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days - }, - cacheableResponse: { - statuses: [0, 200], - }, - }, - }, - { - urlPattern: new RegExp('https://pixel.thesemetrics.org/.*', 'i'), - handler: 'CacheFirst', - options: { - cacheName: 'thesemetrics-cache', - expiration: { - maxEntries: 10, - maxAgeSeconds: 60 * 60 * 24 * 365, // <== 365 days - }, - cacheableResponse: { - statuses: [0, 200], - }, - }, - }, - ], }, }), ], @@ -104,8 +75,9 @@ export default defineConfig({ }, }, plugins: [ - windicss(), - Boolean(process.env.DEBUG) && inspect(), + reactivityTransform(), + UnoCSS() as any, + Boolean(process.env.DEBUG) && inspect() as any, ], }, }) diff --git a/docs/package.json b/docs/package.json index 700dd5af..45a82231 100644 --- a/docs/package.json +++ b/docs/package.json @@ -8,7 +8,8 @@ "build": "iles build", "preview": "iles preview --open --port 3050", "now": "npm run build && npm run preview", - "lint": "eslint . --ext .ts,.js,.vue,.html", + "lint": "eslint .", + "lint:fix": "eslint . --fix", "check": "vue-tsc --noEmit", "cy:run": "scripts/test-cypress" }, @@ -16,39 +17,29 @@ "node": "^14.18 || >= 16.0.0" }, "devDependencies": { - "@iconify-json/bx": "^1.0.3", - "@iconify-json/heroicons-outline": "^1.0.2", + "@iconify-json/bx": "^1.1.10", + "@iconify-json/heroicons-outline": "^1.1.10", "@islands/headings": "workspace:*", "@islands/icons": "workspace:*", "@islands/prism": "workspace:*", "@islands/pwa": "workspace:*", - "@preact/preset-vite": "^2.5.0", - "@types/cross-spawn": "^6.0.2", - "@vueuse/core": "^6.9.2", - "autoprefixer": "^10.4.0", + "@preact/preset-vite": "^2.9.0", + "@types/cross-spawn": "^6.0.6", + "@vueuse/core": "^10.11.0", + "@vue-macros/reactivity-transform": "^1.0.4", + "autoprefixer": "^10.4.19", "cross-spawn": "^7.0.3", "iles": "workspace:*", - "postcss-nesting": "^8.0.1", - "preact": "^10.11.2", - "preact-render-to-string": "^6.1.0", - "rehype-external-links": "^1.0.0", - "vite-plugin-inspect": "^0.7.29", - "vite-plugin-windicss": "^1.9.0", - "vue-tsc": "^0.29.8" + "postcss-nesting": "^12.1.5", + "preact": "^10.24.3", + "preact-render-to-string": "^6.5.11", + "rehype-external-links": "^3.0.0", + "unocss": "^0.61.8", + "vite-plugin-inspect": "^0.8.7", + "vue-tsc": "^2.1.10" }, "dependencies": { - "@docsearch/css": "^3.1.1", - "@mussi/docsearch": "^3.1.2-beta.0" - }, - "eslintConfig": { - "rules": { - "react/react-in-jsx-scope": "off" - }, - "globals": { - "$ref": "readonly", - "$computed": "readonly", - "$$": "readonly", - "$": "readonly" - } + "@docsearch/css": "^3.6.1", + "@mussi/docsearch": "3.1.2-beta.0" } } diff --git a/docs/public/_headers b/docs/public/_headers index 2b177783..77bb066c 100644 --- a/docs/public/_headers +++ b/docs/public/_headers @@ -30,4 +30,4 @@ x-content-type-options: nosniff referrer-policy: no-referrer strict-transport-security: max-age=31536000; includeSubDomains - content-security-policy-report-only: default-src 'self'; font-src 'self'; img-src 'self' data: pixel.thesemetrics.org developer.stackblitz.com; script-src 'self' 'unsafe-inline' unpkg.com; connect-src 'self' 'unsafe-inline' pixel.thesemetrics.org; style-src 'self' + content-security-policy-report-only: default-src 'self'; font-src 'self'; img-src 'self' data: developer.stackblitz.com; script-src 'self' 'unsafe-inline'; connect-src 'self' 'unsafe-inline'; style-src 'self' diff --git a/docs/src/app.ts b/docs/src/app.ts index 407e35a1..fdc7011c 100644 --- a/docs/src/app.ts +++ b/docs/src/app.ts @@ -1,5 +1,5 @@ -import 'virtual:windi.css' -import 'virtual:windi-devtools' +import 'virtual:uno.css' +import '@unocss/reset/tailwind-compat.css' import '~/styles/all.css' import { defineApp } from 'iles' @@ -11,16 +11,11 @@ import type { Script } from '@unhead/schema' type TurboScript = Script & { once: true } -const prodScripts = import.meta.env.PROD ? [ - { src: 'https://unpkg.com/thesemetrics@latest', async: true, once: true, crossorigin: 'anonymous' } as TurboScript, -] : [] - export default defineApp({ head: { htmlAttrs: { lang: 'en-US' }, script: [ { children: checkDarkTheme, once: true } as TurboScript, - ...prodScripts, ], }, mdxComponents: { diff --git a/docs/src/components/AppButton.vue b/docs/src/components/AppButton.vue index 48642407..463d89ce 100644 --- a/docs/src/components/AppButton.vue +++ b/docs/src/components/AppButton.vue @@ -26,7 +26,7 @@ defineProps({ .outline { background: theme('colors.gray.100'); color: theme('colors.gray.500'); - + outline-style: none; &:hover { background: theme('colors.gray.200'); } @@ -43,11 +43,11 @@ html.dark { } .outline { - background: theme('colors.warm-gray.800'); + background: theme('colors.warmgray.800'); color: theme('colors.gray.200'); &:hover { - background: theme('colors.warm-gray.600'); + background: theme('colors.warmgray.600'); } } } diff --git a/docs/src/components/Iles.vue b/docs/src/components/Iles.vue index cdf09d4d..0a2748e8 100644 --- a/docs/src/components/Iles.vue +++ b/docs/src/components/Iles.vue @@ -1,11 +1,12 @@
- + diff --git a/docs/src/components/SidebarLink.vue b/docs/src/components/SidebarLink.vue index d63c5b1e..5cb72f4f 100644 --- a/docs/src/components/SidebarLink.vue +++ b/docs/src/components/SidebarLink.vue @@ -1,15 +1,9 @@