chore(deps): switch to pnpm (#228)

This commit is contained in:
Benjamin Canac
2023-05-26 17:41:07 +02:00
committed by GitHub
parent b7099aa0d3
commit 2c6db975f9
12 changed files with 10174 additions and 9748 deletions

View File

@@ -22,30 +22,41 @@ jobs:
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
- name: Checkout - name: checkout
uses: actions/checkout@master uses: actions/checkout@master
with:
persist-credentials: false
fetch-depth: 0
- name: Cache - uses: pnpm/action-setup@v2
uses: actions/cache@v3 name: Install pnpm
id: pnpm-install
with: with:
path: node_modules version: 7
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} run_install: false
- name: Dependencies - name: Get pnpm store directory
if: steps.cache.outputs.cache-hit != 'true' id: pnpm-cache
run: yarn shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Lint - name: Lint
run: yarn lint run: pnpm run lint
- name: Typecheck - name: Typecheck
run: yarn typecheck run: pnpm run typecheck
- name: Build - name: Build
run: yarn build run: pnpm run build
- name: Release Edge - name: Release Edge
if: github.event_name == 'push' if: github.event_name == 'push'

View File

@@ -22,30 +22,41 @@ jobs:
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
- name: Checkout - name: checkout
uses: actions/checkout@master uses: actions/checkout@master
with:
persist-credentials: false
fetch-depth: 0
- name: Cache - uses: pnpm/action-setup@v2
uses: actions/cache@v3 name: Install pnpm
id: pnpm-install
with: with:
path: node_modules version: 7
key: ${{ matrix.os }}-node-v${{ matrix.node }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }} run_install: false
- name: Dependencies - name: Get pnpm store directory
if: steps.cache.outputs.cache-hit != 'true' id: pnpm-cache
run: yarn shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Lint - name: Lint
run: yarn lint run: pnpm run lint
- name: Typecheck - name: Typecheck
run: yarn typecheck run: pnpm run typecheck
- name: Build - name: Build
run: yarn build run: pnpm run build
- name: Version Check - name: Version Check
id: check id: check

1
.npmrc Normal file
View File

@@ -0,0 +1 @@
shamefully-hoist=true

View File

@@ -49,6 +49,7 @@
// @ts-expect-error // @ts-expect-error
import { transformContent } from '@nuxt/content/transformers' import { transformContent } from '@nuxt/content/transformers'
// eslint-disable-next-line vue/no-dupe-keys
const props = defineProps({ const props = defineProps({
slug: { slug: {
type: String, type: String,
@@ -84,11 +85,13 @@ const props = defineProps({
} }
}) })
// eslint-disable-next-line vue/no-dupe-keys
const baseProps = reactive({ ...props.baseProps }) const baseProps = reactive({ ...props.baseProps })
const componentProps = reactive({ ...props.props }) const componentProps = reactive({ ...props.props })
const appConfig = useAppConfig() const appConfig = useAppConfig()
const route = useRoute() const route = useRoute()
// eslint-disable-next-line vue/no-dupe-keys
const slug = props.slug || route.params.slug[1] const slug = props.slug || route.params.slug[1]
const camelName = useCamelCase(slug) const camelName = useCamelCase(slug)
const name = `U${useUpperFirst(camelName)}` const name = `U${useUpperFirst(camelName)}`
@@ -97,6 +100,7 @@ const meta = await fetchComponentMeta(name)
// Computed // Computed
// eslint-disable-next-line vue/no-dupe-keys
const ui = computed(() => ({ ...appConfig.ui[camelName], ...props.ui })) const ui = computed(() => ({ ...appConfig.ui[camelName], ...props.ui }))
const fullProps = computed(() => ({ ...props.baseProps, ...componentProps })) const fullProps = computed(() => ({ ...props.baseProps, ...componentProps }))
@@ -128,6 +132,7 @@ const propsToSelect = computed(() => Object.keys(componentProps).map((key) => {
} }
}).filter(Boolean)) }).filter(Boolean))
// eslint-disable-next-line vue/no-dupe-keys
const code = computed(() => { const code = computed(() => {
let code = `\`\`\`html let code = `\`\`\`html
<${name}` <${name}`

View File

@@ -15,6 +15,7 @@ const props = defineProps({
const appConfig = useAppConfig() const appConfig = useAppConfig()
const route = useRoute() const route = useRoute()
// eslint-disable-next-line vue/no-dupe-keys
const slug = props.slug || route.params.slug[1] const slug = props.slug || route.params.slug[1]
const camelName = useCamelCase(slug) const camelName = useCamelCase(slug)
const name = `U${useUpperFirst(camelName)}` const name = `U${useUpperFirst(camelName)}`

View File

@@ -43,6 +43,7 @@ const props = defineProps({
}) })
const route = useRoute() const route = useRoute()
// eslint-disable-next-line vue/no-dupe-keys
const slug = props.slug || route.params.slug[1] const slug = props.slug || route.params.slug[1]
const camelName = useCamelCase(slug) const camelName = useCamelCase(slug)
const name = `U${useUpperFirst(camelName)}` const name = `U${useUpperFirst(camelName)}`

View File

@@ -26,6 +26,7 @@ const props = defineProps({
}) })
const route = useRoute() const route = useRoute()
// eslint-disable-next-line vue/no-dupe-keys
const slug = props.slug || route.params.slug[1] const slug = props.slug || route.params.slug[1]
const camelName = useCamelCase(slug) const camelName = useCamelCase(slug)
const name = `U${useUpperFirst(camelName)}` const name = `U${useUpperFirst(camelName)}`

View File

@@ -17,6 +17,7 @@ export default defineNuxtConfig({
highlight: { highlight: {
theme: { theme: {
light: 'material-lighter', light: 'material-lighter',
default: 'material-default',
dark: 'material-palenight' dark: 'material-palenight'
}, },
preload: ['json', 'js', 'ts', 'html', 'css', 'vue', 'diff', 'shell', 'markdown', 'yaml', 'bash', 'ini'] preload: ['json', 'js', 'ts', 'html', 'css', 'vue', 'diff', 'shell', 'markdown', 'yaml', 'bash', 'ini']
@@ -35,5 +36,13 @@ export default defineNuxtConfig({
}, },
generate: { generate: {
routes: ['/getting-started'] routes: ['/getting-started']
},
componentMeta: {
metaFields: {
props: true,
slots: false,
events: false,
exposed: false
}
} }
}) })

View File

@@ -18,20 +18,21 @@
"node": ">=16.14.0" "node": ">=16.14.0"
}, },
"scripts": { "scripts": {
"preinstall": "npx only-allow pnpm",
"build": "nuxt-module-build", "build": "nuxt-module-build",
"prepack": "yarn build", "prepack": "pnpm build",
"dev": "nuxi dev docs", "dev": "nuxi dev docs",
"build:docs": "nuxi generate docs", "build:docs": "nuxi generate docs",
"lint": "eslint .", "lint": "eslint .",
"typecheck": "nuxi typecheck", "typecheck": "nuxi typecheck",
"prepare": "nuxi prepare docs", "prepare": "nuxi prepare docs",
"release": "yarn lint && standard-version && git push --follow-tags" "release": "pnpm lint && standard-version && git push --follow-tags"
}, },
"dependencies": { "dependencies": {
"@egoist/tailwindcss-icons": "^1.0.7", "@egoist/tailwindcss-icons": "^1.0.7",
"@headlessui/vue": "1.7.10", "@headlessui/vue": "1.7.10",
"@iconify-json/heroicons": "^1.1.10", "@iconify-json/heroicons": "^1.1.10",
"@nuxt/kit": "^3.4.3", "@nuxt/kit": "^3.5.1",
"@nuxtjs/color-mode": "^3.2.0", "@nuxtjs/color-mode": "^3.2.0",
"@nuxtjs/tailwindcss": "^6.7.0", "@nuxtjs/tailwindcss": "^6.7.0",
"@popperjs/core": "^2.11.7", "@popperjs/core": "^2.11.7",
@@ -47,19 +48,19 @@
"tailwindcss": "^3.3.2" "tailwindcss": "^3.3.2"
}, },
"devDependencies": { "devDependencies": {
"@iconify-json/simple-icons": "^1.1.53", "@iconify-json/simple-icons": "^1.1.54",
"@nuxt/content": "^2.6.0", "@nuxt/content": "^2.6.0",
"@nuxt/devtools": "^0.4.6", "@nuxt/devtools": "^0.5.5",
"@nuxt/eslint-config": "^0.1.1", "@nuxt/eslint-config": "^0.1.1",
"@nuxt/module-builder": "^0.3.1", "@nuxt/module-builder": "^0.3.1",
"@nuxthq/studio": "^0.12.1", "@nuxthq/studio": "^0.12.1",
"@nuxtjs/plausible": "^0.2.1", "@nuxtjs/plausible": "^0.2.1",
"@types/lodash-es": "^4.17.7", "@types/lodash-es": "^4.17.7",
"@types/node": "^20.1.7", "@types/node": "^20.2.4",
"@vueuse/nuxt": "^10.1.2", "@vueuse/nuxt": "^10.1.2",
"eslint": "^8.40.0", "eslint": "^8.41.0",
"nuxt": "^3.4.3", "nuxt": "^3.5.1",
"nuxt-component-meta": "^0.5.2", "nuxt-component-meta": "^0.5.3",
"nuxt-lodash": "^2.4.1", "nuxt-lodash": "^2.4.1",
"standard-version": "^9.5.0", "standard-version": "^9.5.0",
"unbuild": "^1.2.1", "unbuild": "^1.2.1",

10095
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,6 @@
import { createSharedComposable, useActiveElement } from '@vueuse/core' import { createSharedComposable, useActiveElement } from '@vueuse/core'
import { ref, computed, onMounted } from 'vue' import { ref, computed, onMounted } from 'vue'
import type {} from '@vueuse/shared'
export const _useShortcuts = () => { export const _useShortcuts = () => {
const macOS = computed(() => process.client && navigator && navigator.userAgent && navigator.userAgent.match(/Macintosh;/)) const macOS = computed(() => process.client && navigator && navigator.userAgent && navigator.userAgent.match(/Macintosh;/))

9711
yarn.lock

File diff suppressed because it is too large Load Diff