Skip to content

Commit

Permalink
feat: started moving app routes to the app folder
Browse files Browse the repository at this point in the history
  • Loading branch information
davay42 committed Feb 1, 2025
1 parent 88f8e3b commit 0c27a9c
Show file tree
Hide file tree
Showing 24 changed files with 15 additions and 138 deletions.
2 changes: 1 addition & 1 deletion app/components/SideBar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { rootRoutes } from '../routes'
import { rootRoutes } from '../pages'
import { version } from '../package.json'
</script>

Expand Down
2 changes: 1 addition & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

import { createRouter, createWebHashHistory } from "vue-router";

import routes from './routes/index'
import routes from './pages/index'

import { GunVuePlugin } from "../src/components"; // use '@gun-vue/components' in your apps

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/chat/[topic].vue → app/pages/chat/[topic].vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { currentRoom } from '#composables';
import { ChatRoom } from '../components'
import { ChatRoom } from '#components'
const props = defineProps({
topic: { type: String, default: '' }
Expand Down
2 changes: 1 addition & 1 deletion src/chat/chat.vue → app/pages/chat/chat.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ChatTopics } from '../components'
import { ChatTopics } from '#components'
</script>

<template lang="pug">
Expand Down
2 changes: 1 addition & 1 deletion src/chat/index.vue → app/pages/chat/index.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup>
import { currentRoom } from '#composables';
import { ChatRoom } from '../components'
import { ChatRoom } from '#components'
</script>

<template lang="pug">
Expand Down
2 changes: 1 addition & 1 deletion src/chat/routes.js → app/pages/chat/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default [
{
path: ':topic',
props: true,
component: () => import('./ChatRoom.vue')
component: () => import('./[topic].vue')
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion app/routes/index.js → app/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const modules = import.meta.glob('../../src/**/routes.js', { eager: true })
const modules = import.meta.glob('../../**/routes.js', { eager: true })

const routes = Object.values(modules).map(r => r?.default[0])

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions app/vite.config.lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default defineConfig({
allow: ['../']
}
},
envPrefix: ['VITE_', 'TAURI_'],
envPrefix: ['VITE_'],
publicDir: "public-lib",
plugins: [
vue(), Unocss()
Expand All @@ -30,7 +30,7 @@ export default defineConfig({
base: './',
build: {
lib: {
entry: path.resolve(dirname, 'app.js'),
entry: path.resolve(dirname, 'index.js'),
name: 'GunVue',
// the proper extensions will be added
fileName: 'app',
Expand Down
5 changes: 3 additions & 2 deletions composables/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { fileURLToPath } from "node:url";
import { defineConfig } from "vite";
import checker from "vite-plugin-checker";

//@ts-ignore
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);

Expand All @@ -17,6 +16,9 @@ export default defineConfig({
},
}),
],
rollupOptions: {
external: ['vue']
},
build: {
outDir: "dist",
lib: {
Expand All @@ -29,7 +31,6 @@ export default defineConfig({
minifyInternalExports: false,
},
},
commonjsOptions: {},
},
define: {
"process.env": {},
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
1. Create an empty text file and call it `app.html`
2. Copy and paste this code into it.

<<< ../../examples/app.html{8-19,26-30}
<<< ../../example.html{8-19,26-30}

3. Change in the `#app` section and modify the chat topic if you want.
4. Save the file and open it with any browser. Welcome to your first p2p chat app!
File renamed without changes.
61 changes: 0 additions & 61 deletions examples/CHANGELOG.md

This file was deleted.

7 changes: 0 additions & 7 deletions examples/README.md

This file was deleted.

34 changes: 0 additions & 34 deletions examples/_components.html

This file was deleted.

20 changes: 0 additions & 20 deletions examples/package.json

This file was deleted.

Binary file removed src/chat/safe.wav
Binary file not shown.
2 changes: 1 addition & 1 deletion src/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const GunVuePlugin = {
}

export * from './all-components'
export components
export * as components from './all-components'
export * as composables from "./composables";


4 changes: 1 addition & 3 deletions src/composables.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ import config from "../gun.config.json"

export const rootRoom = config.room

export { default as config } from "../gun.config.json"

export * as vue from 'vue'
export { config }
export { gunAvatar } from "gun-avatar"
export { default as slugify } from "slugify"
export { default as prettyBytes } from 'pretty-bytes'
Expand Down

0 comments on commit 0c27a9c

Please sign in to comment.