Skip to content

Commit

Permalink
refactor(module): update to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
sfxcode committed Mar 16, 2024
1 parent b5a8b58 commit 5285797
Show file tree
Hide file tree
Showing 18 changed files with 761 additions and 2,880 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"extends": "@antfu",
"root": true,
"extends": ["@nuxt/eslint-config"]
}
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:
body: ${{ steps.changelog.outputs.changes }}
token: ${{ github.token }}

- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: main
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
file_pattern: CHANGELOG.md
# - name: Commit CHANGELOG.md
# uses: stefanzweifel/git-auto-commit-action@v5
# with:
# branch: main
# commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
# file_pattern: CHANGELOG.md


26 changes: 14 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,33 @@
"failOnWarn": false
},
"scripts": {
"prepack": "nuxt-module-build",
"prepack": "nuxt-module-build build",
"dev": "nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
"release": "npm run lint && npm run test && npm run prepack && changelogen --release && npm publish --access public && git push --follow-tags",
"lint": "eslint .",
"test": "vitest run",
"test:watch": "vitest watch",
"api-codegen": "openapi-generator-cli generate -i https://raw.githubusercontent.com/typesense/typesense-api-spec/master/openapi.yml -g typescript-fetch -o src/runtime/api --additional-properties=typescriptThreePlus=true,supportsES6=true"
},
"dependencies": {
"@nuxt/kit": "^3.10.3",
"primeicons": "^6.0.1"
"@nuxt/kit": "^3.10.3"
},
"devDependencies": {
"@antfu/eslint-config": "2.8.2",
"@formkit/nuxt": "^1.6.0",
"@iconify-json/bx": "^1.1.10",
"@nuxt/devtools": "^1.0.8",
"@nuxt/eslint-config": "^0.2.0",
"@nuxt/module-builder": "^0.5.5",
"@nuxt/schema": "^3.10.3",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@openapitools/openapi-generator-cli": "^2.12.0",
"@types/node": "^20.11.27",
"@nuxt/test-utils": "^3.11.0",
"@types/node": "^20.11.28",
"@unocss/nuxt": "^0.58.6",
"defu": "^6.1.4",
"changelogen": "^0.5.5",
"eslint": "^8.57.0",
"jiti": "^1.21.0",
"nuxt": "^3.10.3",
"nuxt-primevue": "^0.3.1",
"sass": "^1.72.0"
"primeicons": "^6.0.1",
"vitest": "^1.4.0"
}
}
4 changes: 0 additions & 4 deletions playground/app.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<script setup lang="ts">
const url = useTypesenseUrl()
const api = useTypesenseApiKey()
useHead({
titleTemplate: '%s - Typesense',
htmlAttrs: {
Expand Down
37 changes: 28 additions & 9 deletions playground/components/TypesenseCollections.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,45 @@ const { data: infos, refresh: refreshInfos} = await useAsyncData('infos', () =>
<div>
<Card>
<template #header>
<div class="p-2"><Button @click="refreshInfos">Reload</Button></div>
<div class="p-2">
<Button @click="refreshInfos">
Reload
</Button>
</div>
</template>
<template #title>
Collection Infos
</template>
<template #content>
<DataTable :value="infos">
<Column field="name" header="Name" sortable/>
<Column field="numDocuments" header="Count" />
<Column field="fields" header="Fields" />
<Column field="defaultSortingField" header="Sort By" />
<Column field="date" header="Date" sortable>
<Column
field="name"
header="Name"
sortable
/>
<Column
field="numDocuments"
header="Count"
/>
<Column
field="fields"
header="Fields"
/>
<Column
field="defaultSortingField"
header="Sort By"
/>
<Column
field="date"
header="Date"
sortable
>
<template #body="{data}">
{{data.date.toLocaleString()}}
{{ data.date.toLocaleString() }}
</template>
</Column>
</DataTable>
</template>

</Card>

</div>
</template>
40 changes: 27 additions & 13 deletions playground/components/TypesenseHealth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,50 @@ healthApi.health().then(res => {
health.value = res.ok
})
const { data: result, refresh:reloadKeys} = await useAsyncData('keys', () => keysApi.getKeys())
</script>
<template>
const { data: result} = await useAsyncData('keys', () => keysApi.getKeys())
<div >
</script>

<template>
<div>
<Card>
<template #header>
<div class="p-2">Typesense Nuxt</div>

<div class="p-2">
Typesense Nuxt
</div>
</template>
<template #title>
API Status
</template>
<template #subtitle>
OK {{ health}} - Version {{ version}}
</template>
OK {{ health }} - Version {{ version }}
</template>
<template #content>
<h3>Keys</h3>
<DataTable :value="result.keys">
<Column field="valuePrefix" header="Prefix" sortable/>
<Column field="description" header="Description" />
<Column field="collections" header="Collections" />
<Column field="actions" header="Actions" />
<Column
field="valuePrefix"
header="Prefix"
sortable
/>
<Column
field="description"
header="Description"
/>
<Column
field="collections"
header="Collections"
/>
<Column
field="actions"
header="Actions"
/>
</DataTable>
</template>

</Card>
</div>
</template>
2 changes: 1 addition & 1 deletion playground/data.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const testSchema = {
export const testSchema = {
'name': 'books_test',
'fields': [
{'name': 'title', 'type': 'string' },
Expand Down
4 changes: 1 addition & 3 deletions playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import {defineNuxtConfig} from 'nuxt/config'
import NuxtTypesense from '..'

export default defineNuxtConfig({
ssr: true,
modules: [
NuxtTypesense,
'@formkit/nuxt',
'../src/module',
'nuxt-primevue',
'@unocss/nuxt',
],
Expand Down
5 changes: 2 additions & 3 deletions playground/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

<template>
<div>
<TypesenseHealth class="pb-4 "/>
<TypesenseCollections/>
<TypesenseHealth class="pb-4 " />
<TypesenseCollections />
</div>

</template>
3 changes: 3 additions & 0 deletions playground/server/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../.nuxt/tsconfig.server.json"
}
3 changes: 3 additions & 0 deletions playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "./.nuxt/tsconfig.json"
}
Loading

0 comments on commit 5285797

Please sign in to comment.