Skip to content

Commit

Permalink
fix: update the warehouse address to the correct one
Browse files Browse the repository at this point in the history
  • Loading branch information
elonehoo committed Aug 22, 2024
1 parent 111caa3 commit 96e1be1
Show file tree
Hide file tree
Showing 16 changed files with 366 additions and 439 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ Starter template for Vue

### GitHub Template

[Create a repo from this template on GitHub](https://github.com/elonehoo/starter-vue/generate).
[Create a repo from this template on GitHub](https://github.com/elonehoo-starter/vue/generate).

### Clone to local

If you prefer to do it manually with the cleaner git history

```bash
sudo npx degit elonehoo/starter-vue my-vue-app
sudo npx degit elonehoo-starter/vue my-vue-app
cd my-vue-app
pnpm i # If you don't have pnpm installed, run: npm install -g pnpm
```
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,30 @@
"release": "bumpp package.json --commit --push --tag"
},
"dependencies": {
"@unhead/vue": "^1.9.16",
"@unhead/vue": "^1.10.0",
"@unocss/reset": "^0.62.2",
"@vueuse/core": "^11.0.0",
"@vueuse/core": "^11.0.1",
"unocss": "^0.62.2",
"vue": "^3.4.38",
"vue-router": "^4.4.3"
},
"devDependencies": {
"@antfu/eslint-config": "^2.26.0",
"@antfu/eslint-config": "^2.27.0",
"@iconify-json/carbon": "^1.1.37",
"@types/node": "^22.4.0",
"@types/node": "^22.5.0",
"@vitejs/plugin-vue": "^5.1.2",
"@vitest/coverage-v8": "^2.0.5",
"@vitest/ui": "^2.0.5",
"@vue/test-utils": "^2.4.6",
"bumpp": "^9.5.1",
"eslint": "^9.9.0",
"happy-dom": "^14.12.3",
"happy-dom": "^15.0.0",
"typescript": "^5.5.4",
"unplugin-auto-import": "^0.18.2",
"unplugin-deploy-info": "^0.0.3",
"unplugin-vue-components": "^0.27.4",
"unplugin-vue-router": "^0.10.7",
"vite": "^5.4.1",
"vite": "^5.4.2",
"vite-inspector": "^0.1.4",
"vite-plugin-alias": "^0.1.1",
"vite-plugin-auto-env": "^0.0.2",
Expand Down
698 changes: 317 additions & 381 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ useHead({
<template>
<main font-sans p="x-4 y-10" text="center gray-700 dark:gray-200">
<RouterView />
<TheFooter />
<Footer />
</main>
</template>
23 changes: 23 additions & 0 deletions src/components/Footer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<script setup lang="ts">
const router = useRouter()
</script>

<template>
<nav class="text-xl mt-6 inline-flex gap-2">
<button class="icon-btn" @click="router.push('/')">
<div i-carbon-home />
</button>

<a
class="icon-btn i-carbon-logo-github"
rel="noreferrer"
href="https://github.com/elonehoo-starter/vue"
target="_blank"
title="GitHub"
/>

<button class="icon-btn" @click="toggleDark()">
<div class="dark:i-carbon-moon i-carbon-sun" />
</button>
</nav>
</template>
File renamed without changes.
23 changes: 0 additions & 23 deletions src/components/footer/TheFooter.vue

This file was deleted.

10 changes: 3 additions & 7 deletions src/components/input/TheInput.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
<script setup lang="ts">
import type { Input } from '~components/input/prop'
const { modelValue } = defineProps<Input>()
const emit = defineEmits(['update:modelValue'])
const model = defineModel<string>()
</script>

<template>
<input
id="input"
:value="modelValue"
type="text"
v-bind="$attrs"
v-model="model"
type="text"
p="x-4 y-2"
w="250px"
text="center"
bg="transparent"
border="~ rounded gray-200 dark:gray-700"
outline="none active:none"
@input="emit('update:modelValue', $event.target.value)"
>
</template>
3 changes: 0 additions & 3 deletions src/components/input/prop.ts

This file was deleted.

6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router/auto'
import { createRouter, createWebHistory } from 'vue-router'
import { routes } from 'vue-router/auto-routes'
import { createHead } from '@unhead/vue'
import App from './App.vue'
import '@unocss/reset/tailwind.css'
Expand All @@ -9,7 +10,8 @@ import 'uno.css'
const head = createHead()

const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
history: createWebHistory(),
routes,
})

const app = createApp(App)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/hi/[name].vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const name = computed(() => {
<em>Dynamic route!</em>
</p>

<TheCounter :initial="4" />
<Counter :initial="4" />

<div>
<button
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const name = ref('')
const router = useRouter()
function go() {
if (name)
if (name.value)
router.push(`/hi/${encodeURIComponent(name.value)}`)
}
</script>
Expand Down
8 changes: 4 additions & 4 deletions test/__snapshots__/component.test.ts.snap
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`theCounter.vue > should render 1`] = `
"<div data-loc="/src/components/counter/TheCounter.vue:10" inline-flex="" m="y-3"><button data-loc="/src/components/counter/TheCounter.vue:11" class="dec" btn="" p-2="" rounded-full="">
<div data-loc="/src/components/counter/TheCounter.vue:12" i-carbon-subtract=""></div>
"<div data-loc="/src/components/counter/Counter.vue:10" inline-flex="" m="y-3"><button data-loc="/src/components/counter/Counter.vue:11" class="dec" btn="" p-2="" rounded-full="">
<div data-loc="/src/components/counter/Counter.vue:12" i-carbon-subtract=""></div>
</button>
<div data-loc="/src/components/counter/TheCounter.vue:14" font="mono" w="15" m-auto="" inline-block="">10</div><button data-loc="/src/components/counter/TheCounter.vue:17" class="inc" btn="" p-2="" rounded-full="">
<div data-loc="/src/components/counter/TheCounter.vue:18" i-carbon-add=""></div>
<div data-loc="/src/components/counter/Counter.vue:14" font="mono" w="15" m-auto="" inline-block="">10</div><button data-loc="/src/components/counter/Counter.vue:17" class="inc" btn="" p-2="" rounded-full="">
<div data-loc="/src/components/counter/Counter.vue:18" i-carbon-add=""></div>
</button>
</div>"
`;
6 changes: 3 additions & 3 deletions test/component.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { mount } from '@vue/test-utils'
import TheCounter from '~/components/counter/TheCounter.vue'
import Counter from '~/components/counter/Counter.vue'

describe('theCounter.vue', () => {
it('should render', () => {
const wrapper = mount(TheCounter, { props: { initial: 10 } })
const wrapper = mount(Counter, { props: { initial: 10 } })
expect(wrapper.text()).toContain('10')
expect(wrapper.html()).toMatchSnapshot()
})

it('should be interactive', async () => {
const wrapper = mount(TheCounter, { props: { initial: 0 } })
const wrapper = mount(Counter, { props: { initial: 0 } })
expect(wrapper.text()).toContain('0')

expect(wrapper.find('.inc').exists()).toBe(true)
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.node.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"vite.config.ts",
"auto-imports.d.ts",
"components.d.ts",
"./typed-router.d.ts"
"typed-router.d.ts"
]
}
4 changes: 0 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ export default defineConfig({
'vitest',
unheadVueComposablesImports,
VueRouterAutoImports,
{
// add any other imports you were relying on
'vue-router/auto': ['useLink'],
},
],
dts: true,
dirs: [
Expand Down

0 comments on commit 96e1be1

Please sign in to comment.