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.
Files changed (42) hide show
  1. package/README.md +3 -2
  2. package/lib/162/.env.example +7 -1
  3. package/lib/162/README.md +19 -0
  4. package/lib/162/composer.json +7 -3
  5. package/lib/162/composer.lock +1140 -579
  6. package/lib/162/config/cache.php +3 -4
  7. package/lib/162/config/database.php +2 -5
  8. package/lib/162/config/filesystems.php +2 -3
  9. package/lib/162/config/logging.php +1 -1
  10. package/lib/162/config/mail.php +2 -15
  11. package/lib/162/config/queue.php +4 -4
  12. package/lib/162/config/services.php +0 -4
  13. package/lib/162/config/session.php +1 -0
  14. package/lib/162/package-lock.json +1330 -0
  15. package/lib/162/package.json +9 -1
  16. package/lib/162/public/.htaccess +8 -6
  17. package/lib/162/resources/js/app.js +10 -10
  18. package/lib/162/resources/js/components/About.vue +5 -0
  19. package/lib/162/resources/js/components/Home.vue +12 -0
  20. package/lib/162/resources/js/failOver.js +9 -0
  21. package/lib/162/resources/js/router.js +24 -40
  22. package/lib/162/resources/js/{mainStore.js → store.js} +18 -19
  23. package/lib/162/resources/js/{components/templates → templates}/App.vue +66 -86
  24. package/lib/162/resources/js/views/HomeView.vue +8 -0
  25. package/lib/162/resources/views/layouts/app.blade.php +14 -13
  26. package/lib/162/resources/views/welcome.blade.php +2 -2
  27. package/lib/162/routes/web.php +3 -2
  28. package/lib/162/storage/app/.gitignore +3 -0
  29. package/lib/162/storage/app/public/.gitignore +2 -0
  30. package/lib/162/storage/framework/cache/.gitignore +3 -0
  31. package/lib/162/storage/framework/cache/data/.gitignore +2 -0
  32. package/lib/162/storage/framework/sessions/.gitignore +2 -0
  33. package/lib/162/storage/framework/testing/.gitignore +2 -0
  34. package/lib/162/storage/framework/views/.gitignore +2 -0
  35. package/lib/162/storage/logs/.gitignore +2 -0
  36. package/lib/162/vite.config.js +1 -1
  37. package/package.json +3 -2
  38. package/lib/162/app/Http/Controllers/MainController.php +0 -12
  39. package/lib/162/database/database.sqlite +0 -0
  40. package/lib/162/resources/js/components/pages/About.vue +0 -5
  41. package/lib/162/resources/js/components/pages/Error.vue +0 -5
  42. package/lib/162/resources/js/components/pages/Home.vue +0 -21
@@ -6,8 +6,16 @@
6
6
  "build": "vite build"
7
7
  },
8
8
  "devDependencies": {
9
- "axios": "^1.7.4",
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
  }
@@ -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
- # Send Requests To Front Controller...
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.js';
1
+ import './bootstrap';
2
2
  import { createApp } from 'vue'
3
- import App from './components/templates/App.vue'
3
+ import App from './templates/App.vue'
4
4
 
5
- import router from './router.js'
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,5 @@
1
+ <script setup></script>
2
+
3
+ <template>
4
+ About
5
+ </template>
@@ -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 'vue-router'
2
-
3
- const Home = () => import('./components/pages/Home.vue');
4
- const About= () => import('./components/pages/About.vue');
5
- const ErrorPage = () => import('./components/pages/Error.vue');
6
- // import Home from './components/pages/Home.vue';
7
- // import About from './components/pages/About.vue';
8
- // import ErrorPage from './components/pages/Error.vue';
9
-
10
- const router = createRouter({
11
- history: createWebHistory(import.meta.env.BASE_URL),
12
- routes: [
13
- {
14
- path: '/',
15
- component: Home,
16
- name: 'Home',
17
- },
18
- {
19
- path: '/about',
20
- component: About,
21
- name: 'About',
22
- },
23
- {
24
- path: '/:catchAll(.*)',
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 useSampleStore = defineStore('counter', {
4
- state: () => {
5
- return {
6
- count: 0,
7
- greet: 'Ohayooooo!',
8
- }
9
- },
10
-
11
- getters: {
12
- doubleCount: (state) => state.count * 2,
13
- },
14
-
15
- actions: {
16
- increment() {
17
- this.count++
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
- density="compact"
5
- color="primary"
6
- prominent
7
- >
8
- <v-app-bar-nav-icon variant="text" @click.stop="drawer = !drawer"></v-app-bar-nav-icon>
9
- <v-toolbar-title>Vue 3 - Laravel 11 SPA</v-toolbar-title>
10
- </v-app-bar>
11
-
12
- <v-navigation-drawer
13
- v-model="drawer"
14
- temporary
15
- >
16
-
17
- <v-list density="compact" class="pt-0" >
18
- <v-list-item
19
- v-for="(item, i) in items"
20
- :key="i"
21
- :value="item"
22
- color="primary"
23
- @click="$router.push(item.to)"
24
- >
25
- <template v-slot:prepend>
26
- <v-icon :icon="item.icon"></v-icon>
27
- </template>
28
- <v-list-item-title v-text="item.text"></v-list-item-title>
29
- </v-list-item>
30
- </v-list>
31
- </v-navigation-drawer>
32
-
33
- <v-main>
34
- <router-view></router-view>
35
- </v-main>
36
- </v-app>
37
- </template>
38
-
39
- <script>
40
- import { ref } from 'vue';
41
-
42
- export default {
43
- setup() {
44
- const drawer = ref(false);
45
-
46
- const items = ref([
47
- {
48
- text: 'Home',
49
- to: '/',
50
- icon: 'mdi-home'
51
- },
52
- {
53
- text: 'About',
54
- to: '/about',
55
- icon:'mdi-information-outline'
56
- },
57
- ]);
58
-
59
- return {
60
- drawer,
61
- items
62
- };
63
- },
64
- };
65
- </script>
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>
@@ -0,0 +1,8 @@
1
+ <script setup>
2
+ import Home from '../components/Home.vue'
3
+
4
+ </script>
5
+
6
+ <template>
7
+ <Home/>
8
+ </template>
@@ -1,14 +1,15 @@
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
- <title>Vue 3 - Laravel 11 SPA</title>
7
-
8
- @vite(['resources/css/app.css', 'resources/js/app.js'])
9
-
10
- </head>
11
- <body>
12
- <div id="app"></div>
13
- </body>
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 class="bg-gray-50 text-black/50 dark:bg-black dark:text-white/50">
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] transition duration-300 hover:text-black/70 hover:ring-black/20 focus:outline-none focus-visible:ring-[#FF2D20] lg:pb-10 dark:bg-zinc-900 dark:ring-zinc-800 dark:hover:text-white/70 dark:hover:ring-zinc-700 dark:focus-visible:ring-[#FF2D20]">
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">
@@ -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?}', [MainController::class, 'index'])->where('any', '.*');
5
+ Route::get('/{any?}', function () {
6
+ return view('layouts.app');
7
+ })->where('any','.*');
@@ -0,0 +1,3 @@
1
+ *
2
+ !public/
3
+ !.gitignore
@@ -0,0 +1,2 @@
1
+ *
2
+ !.gitignore
@@ -0,0 +1,3 @@
1
+ *
2
+ !data/
3
+ !.gitignore
@@ -0,0 +1,2 @@
1
+ *
2
+ !.gitignore
@@ -0,0 +1,2 @@
1
+ *
2
+ !.gitignore
@@ -0,0 +1,2 @@
1
+ *
2
+ !.gitignore
@@ -0,0 +1,2 @@
1
+ *
2
+ !.gitignore
@@ -0,0 +1,2 @@
1
+ *
2
+ !.gitignore
@@ -10,4 +10,4 @@ export default defineConfig({
10
10
  }),
11
11
  vue(),
12
12
  ],
13
- });
13
+ });
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "create-v-kit-spa",
3
- "version": "1.0.9",
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"
@@ -1,12 +0,0 @@
1
- <?php
2
-
3
- namespace App\Http\Controllers;
4
-
5
- use Illuminate\Http\Request;
6
-
7
- class mainController extends Controller
8
- {
9
- public function index(){
10
- return view('layouts.app');
11
- }
12
- }
Binary file
@@ -1,5 +0,0 @@
1
- <template>
2
- <div>
3
- <p>About Page</p>
4
- </div>
5
- </template>
@@ -1,5 +0,0 @@
1
- <template>
2
- <div>
3
- <p>Error Page | 404 Not Found</p>
4
- </div>
5
- </template>
@@ -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>