create-v-kit-spa 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/lib/162/.env.example +7 -1
- package/lib/162/README.md +19 -0
- package/lib/162/composer.json +7 -3
- package/lib/162/composer.lock +1140 -579
- package/lib/162/config/cache.php +3 -4
- package/lib/162/config/database.php +2 -5
- package/lib/162/config/filesystems.php +2 -3
- package/lib/162/config/logging.php +1 -1
- package/lib/162/config/mail.php +2 -15
- package/lib/162/config/queue.php +4 -4
- package/lib/162/config/services.php +0 -4
- package/lib/162/config/session.php +1 -0
- package/lib/162/package-lock.json +1330 -0
- package/lib/162/package.json +9 -1
- package/lib/162/public/.htaccess +8 -6
- package/lib/162/resources/js/app.js +10 -10
- package/lib/162/resources/js/components/About.vue +5 -0
- package/lib/162/resources/js/components/Home.vue +12 -0
- package/lib/162/resources/js/failOver.js +9 -0
- package/lib/162/resources/js/router.js +24 -40
- package/lib/162/resources/js/{mainStore.js → store.js} +18 -19
- package/lib/162/resources/js/{components/templates → templates}/App.vue +66 -86
- package/lib/162/resources/js/views/HomeView.vue +8 -0
- package/lib/162/resources/views/layouts/app.blade.php +14 -13
- package/lib/162/resources/views/welcome.blade.php +2 -2
- package/lib/162/routes/web.php +3 -2
- package/lib/162/storage/app/.gitignore +3 -0
- package/lib/162/storage/app/public/.gitignore +2 -0
- package/lib/162/storage/framework/cache/.gitignore +3 -0
- package/lib/162/storage/framework/cache/data/.gitignore +2 -0
- package/lib/162/storage/framework/sessions/.gitignore +2 -0
- package/lib/162/storage/framework/testing/.gitignore +2 -0
- package/lib/162/storage/framework/views/.gitignore +2 -0
- package/lib/162/storage/logs/.gitignore +2 -0
- package/lib/162/vite.config.js +1 -1
- package/package.json +3 -2
- package/lib/162/app/Http/Controllers/MainController.php +0 -12
- package/lib/162/database/database.sqlite +0 -0
- package/lib/162/resources/js/components/pages/About.vue +0 -5
- package/lib/162/resources/js/components/pages/Error.vue +0 -5
- package/lib/162/resources/js/components/pages/Home.vue +0 -21
package/lib/162/package.json
CHANGED
|
@@ -6,8 +6,16 @@
|
|
|
6
6
|
"build": "vite build"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
9
|
-
"
|
|
9
|
+
"@mdi/font": "^7.4.47",
|
|
10
|
+
"axios": "^1.6.4",
|
|
10
11
|
"laravel-vite-plugin": "^1.0",
|
|
11
12
|
"vite": "^5.0"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@vitejs/plugin-vue": "^5.2.1",
|
|
16
|
+
"pinia": "^2.3.0",
|
|
17
|
+
"vue": "^3.5.13",
|
|
18
|
+
"vue-router": "^4.5.0",
|
|
19
|
+
"vuetify": "^3.7.5"
|
|
12
20
|
}
|
|
13
21
|
}
|
package/lib/162/public/.htaccess
CHANGED
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
<IfModule mod_negotiation.c>
|
|
3
3
|
Options -MultiViews -Indexes
|
|
4
4
|
</IfModule>
|
|
5
|
-
|
|
5
|
+
|
|
6
6
|
RewriteEngine On
|
|
7
|
-
|
|
7
|
+
RewriteBase /ProjectName/
|
|
8
|
+
|
|
8
9
|
# Handle Authorization Header
|
|
9
10
|
RewriteCond %{HTTP:Authorization} .
|
|
10
11
|
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
|
11
|
-
|
|
12
|
+
|
|
12
13
|
# Redirect Trailing Slashes If Not A Folder...
|
|
13
14
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
14
15
|
RewriteCond %{REQUEST_URI} (.+)/$
|
|
15
16
|
RewriteRule ^ %1 [L,R=301]
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
RewriteRule ^(.*)/$ /ProjectName/$1 [L,R=301]
|
|
18
|
+
|
|
19
|
+
# Handle Front Controller...
|
|
18
20
|
RewriteCond %{REQUEST_FILENAME} !-d
|
|
19
21
|
RewriteCond %{REQUEST_FILENAME} !-f
|
|
20
22
|
RewriteRule ^ index.php [L]
|
|
21
|
-
</IfModule>
|
|
23
|
+
</IfModule>
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import './bootstrap
|
|
1
|
+
import './bootstrap';
|
|
2
2
|
import { createApp } from 'vue'
|
|
3
|
-
import App from './
|
|
3
|
+
import App from './templates/App.vue'
|
|
4
4
|
|
|
5
|
-
import router
|
|
5
|
+
import router from './router.js'
|
|
6
|
+
|
|
7
|
+
import { createPinia } from 'pinia'
|
|
8
|
+
const pinia = createPinia()
|
|
6
9
|
|
|
7
10
|
import 'vuetify/styles'
|
|
8
|
-
import { createVuetify } from 'vuetify'
|
|
11
|
+
import { createVuetify } from 'vuetify';
|
|
9
12
|
import * as components from 'vuetify/components'
|
|
10
13
|
import * as directives from 'vuetify/directives'
|
|
11
14
|
|
|
12
15
|
import '@mdi/font/css/materialdesignicons.css'
|
|
13
16
|
|
|
14
|
-
import { createPinia } from 'pinia'
|
|
15
|
-
|
|
16
|
-
const pinia = createPinia()
|
|
17
17
|
const vuetify = createVuetify({
|
|
18
18
|
components,
|
|
19
19
|
directives,
|
|
20
20
|
icons: {
|
|
21
|
-
defaultSet: 'mdi'
|
|
22
|
-
}
|
|
21
|
+
defaultSet: 'mdi'
|
|
22
|
+
}
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
const app = createApp(App)
|
|
26
|
+
app.use(router)
|
|
26
27
|
app.use(pinia)
|
|
27
28
|
app.use(vuetify)
|
|
28
|
-
app.use(router)
|
|
29
29
|
app.mount('#app')
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { piniaStore } from '../store.js';
|
|
3
|
+
const store = piniaStore();
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<template>
|
|
7
|
+
<h1>HOME</h1>
|
|
8
|
+
<h1>{{ store.greet }}</h1>
|
|
9
|
+
<h1>Original : {{ store.count }}</h1>
|
|
10
|
+
<h1>Getter : {{ store.doubleCount }}</h1>
|
|
11
|
+
<v-btn @click="store.increment">Add</v-btn>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import router from './router';
|
|
2
|
+
const routerBase = router.options.base;
|
|
3
|
+
|
|
4
|
+
export const base = routerBase == undefined ? '/' : '/ProjectName/'; // to be automated
|
|
5
|
+
|
|
6
|
+
// usage
|
|
7
|
+
// note: mainly used for multiple routes like /products/items/2 since api read it as items/2
|
|
8
|
+
// import { base } from '@/path.js'
|
|
9
|
+
// const response = await axios.get(`${base}api/getJobs`)
|
|
@@ -1,40 +1,24 @@
|
|
|
1
|
-
import { createRouter, createWebHistory } from
|
|
2
|
-
|
|
3
|
-
const Home = () => import('./
|
|
4
|
-
const About= () => import('./components/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
component: ErrorPage,
|
|
26
|
-
name: 'Error'
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// router.beforeEach((to, from, next) => {
|
|
32
|
-
// if(to.path == '/'){
|
|
33
|
-
// next('/')
|
|
34
|
-
// }else{
|
|
35
|
-
// next()
|
|
36
|
-
// }
|
|
37
|
-
// })
|
|
38
|
-
|
|
39
|
-
export default router;
|
|
40
|
-
|
|
1
|
+
import { createRouter, createWebHistory } from "vue-router";
|
|
2
|
+
|
|
3
|
+
const Home = () => import('./views/HomeView.vue');
|
|
4
|
+
const About = () => import('./components/About.vue');
|
|
5
|
+
|
|
6
|
+
const router = createRouter({
|
|
7
|
+
// history: createWebHistory(),
|
|
8
|
+
history: createWebHistory('/ProjectName/'),
|
|
9
|
+
base: '/ProjectName/',
|
|
10
|
+
routes:[
|
|
11
|
+
{
|
|
12
|
+
path:'/',
|
|
13
|
+
component: Home,
|
|
14
|
+
name: 'Home'
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
path:'/about',
|
|
18
|
+
component: About,
|
|
19
|
+
name: 'About'
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export default router;
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { defineStore } from 'pinia'
|
|
2
|
-
|
|
3
|
-
export const
|
|
4
|
-
state: () => {
|
|
5
|
-
return {
|
|
6
|
-
count: 0,
|
|
7
|
-
greet: 'Ohayooooo!',
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
getters: {
|
|
12
|
-
doubleCount: (state) => state.count * 2,
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
|
|
3
|
+
export const piniaStore = defineStore('store', {
|
|
4
|
+
state: () => {
|
|
5
|
+
return {
|
|
6
|
+
count: 0,
|
|
7
|
+
greet: 'Ohayooooo!',
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
getters: {
|
|
12
|
+
doubleCount: (state) => state.count * 2,
|
|
13
|
+
},
|
|
14
|
+
actions: {
|
|
15
|
+
increment() {
|
|
16
|
+
this.count++
|
|
17
|
+
},
|
|
18
|
+
},
|
|
20
19
|
})
|
|
@@ -1,86 +1,66 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-app>
|
|
3
|
-
<v-app-bar
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<v-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<!-- <script>
|
|
68
|
-
export default {
|
|
69
|
-
data: () => ({
|
|
70
|
-
drawer: false,
|
|
71
|
-
items: [
|
|
72
|
-
{
|
|
73
|
-
title: 'Home',
|
|
74
|
-
to: '/',
|
|
75
|
-
icon: 'mdi-home'
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
title: 'About',
|
|
79
|
-
to: 'about',
|
|
80
|
-
icon:'mdi-information-outline'
|
|
81
|
-
},
|
|
82
|
-
],
|
|
83
|
-
|
|
84
|
-
}),
|
|
85
|
-
}
|
|
86
|
-
</script> -->
|
|
1
|
+
<template>
|
|
2
|
+
<v-app>
|
|
3
|
+
<v-app-bar
|
|
4
|
+
elevation="0"
|
|
5
|
+
density="compact"
|
|
6
|
+
color="black"
|
|
7
|
+
prominent
|
|
8
|
+
>
|
|
9
|
+
<v-app-bar-nav-icon variant="text" @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
|
|
10
|
+
<v-toolbar-title >Vue 3 - Laravel 11 SPA</v-toolbar-title>
|
|
11
|
+
</v-app-bar>
|
|
12
|
+
|
|
13
|
+
<v-navigation-drawer
|
|
14
|
+
v-model="drawer"
|
|
15
|
+
temporary
|
|
16
|
+
>
|
|
17
|
+
|
|
18
|
+
<v-list density="compact" class="pt-0" >
|
|
19
|
+
<v-list-item
|
|
20
|
+
v-for="(item, i) in items"
|
|
21
|
+
:key="i"
|
|
22
|
+
:value="item"
|
|
23
|
+
color="gray"
|
|
24
|
+
@click="$router.push(item.to)"
|
|
25
|
+
>
|
|
26
|
+
<template v-slot:prepend>
|
|
27
|
+
<v-icon :icon="item.icon"></v-icon>
|
|
28
|
+
</template>
|
|
29
|
+
<v-list-item-title class="py-3" v-text="item.text"></v-list-item-title>
|
|
30
|
+
</v-list-item>
|
|
31
|
+
</v-list>
|
|
32
|
+
</v-navigation-drawer>
|
|
33
|
+
|
|
34
|
+
<v-main>
|
|
35
|
+
<router-view></router-view>
|
|
36
|
+
</v-main>
|
|
37
|
+
</v-app>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import { ref } from 'vue';
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
setup() {
|
|
45
|
+
const drawer = ref(false);
|
|
46
|
+
|
|
47
|
+
const items = ref([
|
|
48
|
+
{
|
|
49
|
+
text: 'Home',
|
|
50
|
+
to: '/',
|
|
51
|
+
icon: 'mdi-home'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
text: 'About',
|
|
55
|
+
to: '/about',
|
|
56
|
+
icon:'mdi-information-outline'
|
|
57
|
+
},
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
return {
|
|
61
|
+
drawer,
|
|
62
|
+
items
|
|
63
|
+
};
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
</script>
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
7
|
+
<title>Laravel-11 Vue-3</title>
|
|
8
|
+
|
|
9
|
+
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
|
10
|
+
|
|
11
|
+
</head>
|
|
12
|
+
<body>
|
|
13
|
+
<div id="app"></div>
|
|
14
|
+
</body>
|
|
14
15
|
</html>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
</style>
|
|
17
17
|
</head>
|
|
18
18
|
<body class="font-sans antialiased dark:bg-black dark:text-white/50">
|
|
19
|
-
<div
|
|
19
|
+
<div className="bg-gray-50 text-black/50 dark:bg-black dark:text-white/50">
|
|
20
20
|
<img id="background" class="absolute -left-20 top-0 max-w-[877px]" src="https://laravel.com/assets/img/welcome/background.svg" />
|
|
21
21
|
<div class="relative min-h-screen flex flex-col items-center justify-center selection:bg-[#FF2D20] selection:text-white">
|
|
22
22
|
<div class="relative w-full max-w-2xl px-6 lg:max-w-7xl">
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
<svg class="size-6 shrink-0 self-center stroke-[#FF2D20]" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12h15m0 0l-6.75-6.75M19.5 12l-6.75 6.75"/></svg>
|
|
141
141
|
</a>
|
|
142
142
|
|
|
143
|
-
<div class="flex items-start gap-4 rounded-lg bg-white p-6 shadow-[0px_14px_34px_0px_rgba(0,0,0,0.08)] ring-1 ring-white/[0.05]
|
|
143
|
+
<div class="flex items-start gap-4 rounded-lg bg-white p-6 shadow-[0px_14px_34px_0px_rgba(0,0,0,0.08)] ring-1 ring-white/[0.05] lg:pb-10 dark:bg-zinc-900 dark:ring-zinc-800">
|
|
144
144
|
<div class="flex size-12 shrink-0 items-center justify-center rounded-full bg-[#FF2D20]/10 sm:size-16">
|
|
145
145
|
<svg class="size-5 sm:size-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
146
146
|
<g fill="#FF2D20">
|
package/lib/162/routes/web.php
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
|
|
3
3
|
use Illuminate\Support\Facades\Route;
|
|
4
|
-
use App\Http\Controllers\MainController;
|
|
5
4
|
|
|
6
|
-
Route::get('/{any?}',
|
|
5
|
+
Route::get('/{any?}', function () {
|
|
6
|
+
return view('layouts.app');
|
|
7
|
+
})->where('any','.*');
|
package/lib/162/vite.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-v-kit-spa",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"description": "A simple way to start your Vue-Laravel SPA projects",
|
|
6
6
|
"repository": "Shuashuaa/v-kit-spa",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "ts-node dist/index.js",
|
|
9
9
|
"test-dev": "ts-node src/index.ts",
|
|
10
|
-
"build": "tsc"
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"deploy": "npm link && npm link create-v-kit-spa && npm publish --access public"
|
|
11
12
|
},
|
|
12
13
|
"bin": {
|
|
13
14
|
"create-v-kit-spa": "dist/index.js"
|
|
Binary file
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<h1>HOME</h1>
|
|
3
|
-
<h1>{{ sampleStore.greet }}</h1>
|
|
4
|
-
<h1>Original : {{ sampleStore.count }}</h1>
|
|
5
|
-
<h1>Getter : {{ sampleStore.doubleCount }}</h1>
|
|
6
|
-
<v-btn @click="sampleStore.increment">Add</v-btn>
|
|
7
|
-
</template>
|
|
8
|
-
|
|
9
|
-
<script>
|
|
10
|
-
import { useSampleStore } from '../../mainStore.js';
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
setup() {
|
|
14
|
-
const sampleStore = useSampleStore();
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
sampleStore,
|
|
18
|
-
};
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
</script>
|