create-v-kit-spa 1.0.9 → 1.0.12

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 (37) hide show
  1. package/README.md +7 -3
  2. package/dist/commands.d.ts +1 -1
  3. package/dist/commands.js +78 -67
  4. package/dist/count.d.ts +2 -2
  5. package/dist/count.d.ts.map +1 -1
  6. package/dist/count.js +45 -44
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.js +3 -3
  9. package/dist/messages.d.ts +2 -2
  10. package/dist/messages.d.ts.map +1 -1
  11. package/dist/messages.js +70 -69
  12. package/dist/progress.d.ts +1 -1
  13. package/dist/progress.d.ts.map +1 -1
  14. package/dist/progress.js +38 -37
  15. package/dist/prompts.d.ts +4 -3
  16. package/dist/prompts.d.ts.map +1 -1
  17. package/dist/prompts.js +80 -77
  18. package/dist/utils.d.ts +1 -1
  19. package/dist/utils.js +33 -33
  20. package/dist/version.d.ts +1 -1
  21. package/dist/version.js +20 -20
  22. package/lib/162/resources/js/components/About.vue +5 -0
  23. package/lib/162/resources/js/components/Home.vue +12 -0
  24. package/lib/162/resources/js/failOver.js +9 -0
  25. package/lib/162/resources/js/store.js +19 -0
  26. package/lib/162/resources/js/templates/App.vue +66 -0
  27. package/lib/162/resources/js/views/HomeView.vue +8 -0
  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/package.json +3 -2
  37. package/lib/162/database/database.sqlite +0 -0
package/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  <br>
2
2
 
3
+
3
4
  <div align="center">
4
5
  <img src="https://gitlab.com/shuashuaa/v-kit-app/-/raw/main/@shuashuaa-v-kit.png?ref_type=heads" width="300" />
5
6
  </div>
@@ -25,6 +26,8 @@ vite/webpack, vuetify and pinia. up-to-date, ready for local-deployment and full
25
26
  <!-- <a href="https://www.npmjs.com/package/create-v-kit-spa"><img src="https://img.shields.io/npm/v/create-v-kit-spa?color=c95f8b&amp;label=" alt="NPM version"></a>
26
27
  <a href="https://www.npmjs.com/package/create-v-kit-spa"><img src="https://img.shields.io/npm/dw/create-v-kit-spa?style=flat-square" alt="NPM downloads"></a>
27
28
  <a href="https://github.com/shuashuaa/v-kit/blob/main/LICENSE"><img src="https://img.shields.io/npm/v/create-v-kit-spa?style=flat-square" alt="License"></a> -->
29
+
30
+ [![ci-test](https://github.com/Shuashuaa/create-v-kit-spa/actions/workflows/ci.yml/badge.svg)](https://github.com/Shuashuaa/create-v-kit-spa/actions/workflows/ci.yml)
28
31
  <a href="https://github.com/shuashuaa/v-kit/blob/main/LICENSE"><img src="https://img.shields.io/npm/v/create-v-kit-spa?style=flat-square&logo=npm&color=ffe963" alt="VERSION"></a>
29
32
  <a href="https://www.npmjs.com/package/create-v-kit-spa"><img src="https://img.shields.io/npm/dw/create-v-kit-spa?style=flat-square&logo=npm&color=ffe963" alt="NPM DOWNLOADS"></a>
30
33
  <a href="https://github.com/shuashuaa/v-kit/blob/main/LICENSE"><img src="https://img.shields.io/bundlejs/size/create-v-kit-spa?style=flat-square&logo=npm&color=ffe963" alt="MINIFIED SIZE"></a>
@@ -67,7 +70,7 @@ https://windows.php.net/downloads/releases/archives/php-8.0.9-Win32-vs16-x64.zip
67
70
 
68
71
  # Reference Table (❗ PHP Version is Important ❗)
69
72
 
70
- ### Mono Repo
73
+ ### Monolith Repo
71
74
  > frontend and backend are in a single folder, united via configuration.
72
75
 
73
76
  | Version & Type | Features | Prerequisite |
@@ -174,6 +177,7 @@ https://windows.php.net/downloads/releases/archives/php-8.0.9-Win32-vs16-x64.zip
174
177
  | `php artisan migrate` | Create a Sessions table |
175
178
  | `npm run artisan-dev` | Run both `php artisan serve` and `yarn dev` |
176
179
  | `http://127.0.0.1:8000/` | Visit your app, Enjoy! 🎉🎉 |
180
+ | `npm run build ` | Deploy! 🎉🎉 |
177
181
  <br>
178
182
 
179
183
  ## Docs
@@ -184,7 +188,7 @@ Have an idea? Found a bug? See [how to contribute](https://github.com/Shuashuaa/
184
188
 
185
189
  ## Contributors
186
190
  Thanks to:
187
- - [RGienz](https://github.com/RGienz) for contributing and maintaining [vuejs3 - laravel9](#vue-3---laravel-9) 👏
191
+ - [RGienz](https://github.com/RGienz) for contributing and maintaining [vuejs3 - laravel8](#vue-3---laravel-8) 👏
188
192
  <!-- <br>
189
193
 
190
194
  ## Changelog
@@ -192,4 +196,4 @@ To learn about the specific changes in each release, check the [Changelog](./Cha
192
196
  <br> -->
193
197
 
194
198
  ## License
195
- Free and Open Source Under [MIT](./LICENSE) License &copy; 2024-PRESENT [Shuashuaa](https://github.com/Shuashuaa)
199
+ Free and Open Source Under [MIT](./LICENSE) License &copy; 2024-PRESENT [Shuashuaa](https://github.com/Shuashuaa)
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=commands.d.ts.map
package/dist/commands.js CHANGED
@@ -1,67 +1,78 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- const path_1 = __importDefault(require("path"));
16
- const fs_1 = __importDefault(require("fs"));
17
- const utils_1 = require("./utils");
18
- const prompts_1 = require("./prompts");
19
- const messages_1 = require("./messages");
20
- const count_1 = require("./count");
21
- const yargs_1 = __importDefault(require("yargs"));
22
- function createProject() {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- const argv = yargs_1.default.argv;
25
- let projectName = process.argv[2];
26
- if (!projectName) {
27
- projectName = yield (0, prompts_1.getProjectName)();
28
- }
29
- const boilerplateChoice = yield (0, prompts_1.getBoilerplateChoice)();
30
- const templatePath = getTemplatePath(boilerplateChoice);
31
- if (!templatePath) {
32
- (0, messages_1.errorMessage)(new Error('\n✖ Invalid boilerplate choice.'));
33
- (0, prompts_1.closeReadline)();
34
- return;
35
- }
36
- const sourcePath = path_1.default.join(__dirname, '../lib', templatePath);
37
- const destinationPath = path_1.default.join(process.cwd(), projectName);
38
- try {
39
- yield fs_1.default.promises.mkdir(destinationPath);
40
- yield (0, utils_1.copyProjectStructure)(sourcePath, destinationPath);
41
- (0, count_1.getCount)(sourcePath, templatePath);
42
- }
43
- catch (error) {
44
- (0, messages_1.errorMessage)(error);
45
- }
46
- finally {
47
- (0, prompts_1.closeReadline)();
48
- }
49
- });
50
- }
51
- function getTemplatePath(boilerplateChoice) {
52
- switch (boilerplateChoice) {
53
- case 1:
54
- return '158';
55
- case 2:
56
- return '159';
57
- case 3:
58
- return '160';
59
- case 4:
60
- return '161';
61
- case 5:
62
- return '162';
63
- default:
64
- return null;
65
- }
66
- }
67
- createProject();
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const path_1 = __importDefault(require("path"));
16
+ const fs_1 = __importDefault(require("fs"));
17
+ const utils_1 = require("./utils");
18
+ const prompts_1 = require("./prompts");
19
+ const messages_1 = require("./messages");
20
+ const count_1 = require("./count");
21
+ const yargs_1 = __importDefault(require("yargs"));
22
+ function createProject() {
23
+ return __awaiter(this, void 0, void 0, function* () {
24
+ const argv = yargs_1.default.argv;
25
+ let projectName = process.argv[2];
26
+ if (!projectName) {
27
+ projectName = yield (0, prompts_1.getProjectName)();
28
+ }
29
+ // Checks the Destination Path if the inserted project name is already exists
30
+ const destinationPath = path_1.default.join(process.cwd(), projectName);
31
+ const dirExists = yield fs_1.default.promises
32
+ .access(destinationPath, fs_1.default.constants.F_OK)
33
+ .then(() => true)
34
+ .catch(() => false);
35
+ if (dirExists) {
36
+ (0, messages_1.errorMessage)(new Error(`\n✖ The directory "${projectName}" already exists.`));
37
+ (0, prompts_1.closeReadline)();
38
+ return;
39
+ }
40
+ // Proceeds to Selection of Boilerplate
41
+ const boilerplateChoice = yield (0, prompts_1.getBoilerplateChoice)();
42
+ const templatePath = getTemplatePath(boilerplateChoice);
43
+ if (!templatePath) {
44
+ (0, messages_1.errorMessage)(new Error('\n✖ Invalid boilerplate choice.'));
45
+ (0, prompts_1.closeReadline)();
46
+ return;
47
+ }
48
+ const sourcePath = path_1.default.join(__dirname, '../lib', templatePath);
49
+ try {
50
+ yield fs_1.default.promises.mkdir(destinationPath);
51
+ yield (0, utils_1.copyProjectStructure)(sourcePath, destinationPath);
52
+ (0, count_1.getCount)(sourcePath, templatePath);
53
+ }
54
+ catch (error) {
55
+ (0, messages_1.errorMessage)(error);
56
+ }
57
+ finally {
58
+ (0, prompts_1.closeReadline)();
59
+ }
60
+ });
61
+ }
62
+ function getTemplatePath(boilerplateChoice) {
63
+ switch (boilerplateChoice) {
64
+ case 1:
65
+ return '158';
66
+ case 2:
67
+ return '159';
68
+ case 3:
69
+ return '160';
70
+ case 4:
71
+ return '161';
72
+ case 5:
73
+ return '162';
74
+ default:
75
+ return null;
76
+ }
77
+ }
78
+ createProject();
package/dist/count.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export declare function countItems(dirPath: string): Promise<number>;
2
- export declare function getCount(sourcePath: string, templatePath: string): void;
1
+ export declare function countItems(dirPath: string): Promise<number>;
2
+ export declare function getCount(sourcePath: string, templatePath: string): void;
3
3
  //# sourceMappingURL=count.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../src/count.ts"],"names":[],"mappings":"AAKA,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,mBAgB/C;AAID,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,QAShE"}
1
+ {"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../src/count.ts"],"names":[],"mappings":"AAOA,wBAAsB,UAAU,CAAC,OAAO,EAAE,MAAM,mBAgB/C;AAID,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,QAShE"}
package/dist/count.js CHANGED
@@ -1,44 +1,45 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.countItems = countItems;
13
- exports.getCount = getCount;
14
- const fs = require('fs');
15
- const path = require('path');
16
- const progress_1 = require("./progress");
17
- function countItems(dirPath) {
18
- return __awaiter(this, void 0, void 0, function* () {
19
- let count = 0;
20
- const files = yield fs.promises.readdir(dirPath);
21
- for (const file of files) {
22
- const filePath = path.join(dirPath, file);
23
- const stat = yield fs.promises.stat(filePath);
24
- if (stat.isDirectory()) {
25
- count += yield countItems(filePath); // Recursive
26
- }
27
- else if (stat.isFile()) {
28
- count++;
29
- }
30
- }
31
- return count;
32
- });
33
- }
34
- // const sourcePath = path.join(__dirname, '../templates', '158');
35
- function getCount(sourcePath, templatePath) {
36
- countItems(sourcePath)
37
- .then((count) => {
38
- // console.log(`There are ${count} items (files and folders) in the folder.`);
39
- (0, progress_1.Progress)(count, templatePath);
40
- })
41
- .catch((err) => {
42
- console.error('Error:', err);
43
- });
44
- }
1
+ "use strict";
2
+ // counts the items inside the selected boilerplate
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.countItems = countItems;
14
+ exports.getCount = getCount;
15
+ const fs = require('fs');
16
+ const path = require('path');
17
+ const progress_1 = require("./progress");
18
+ function countItems(dirPath) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ let count = 0;
21
+ const files = yield fs.promises.readdir(dirPath);
22
+ for (const file of files) {
23
+ const filePath = path.join(dirPath, file);
24
+ const stat = yield fs.promises.stat(filePath);
25
+ if (stat.isDirectory()) {
26
+ count += yield countItems(filePath); // Recursive
27
+ }
28
+ else if (stat.isFile()) {
29
+ count++;
30
+ }
31
+ }
32
+ return count;
33
+ });
34
+ }
35
+ // const sourcePath = path.join(__dirname, '../templates', '158');
36
+ function getCount(sourcePath, templatePath) {
37
+ countItems(sourcePath)
38
+ .then((count) => {
39
+ // console.log(`There are ${count} items (files and folders) in the folder.`);
40
+ (0, progress_1.Progress)(count, templatePath);
41
+ })
42
+ .catch((err) => {
43
+ console.error('Error:', err);
44
+ });
45
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- #!/usr/bin/env node
2
- import './commands';
1
+ #!/usr/bin/env node
2
+ import './commands';
3
3
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- require("./commands");
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ require("./commands");
@@ -1,3 +1,3 @@
1
- export declare function successMessage(sourceVal: string): Promise<void>;
2
- export declare function errorMessage(error: Error): void;
1
+ export declare function successMessage(sourceVal: string): Promise<void>;
2
+ export declare function errorMessage(error: Error): void;
3
3
  //# sourceMappingURL=messages.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAEA,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,iBAsCrD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,QAExC"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAGA,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,iBAuCrD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,QAExC"}
package/dist/messages.js CHANGED
@@ -1,69 +1,70 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.successMessage = successMessage;
16
- exports.errorMessage = errorMessage;
17
- const chalk_1 = __importDefault(require("chalk"));
18
- function successMessage(sourceVal) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- // console.log(sourceVal)
21
- let tempVal = '';
22
- if (sourceVal == '158') {
23
- tempVal = 'Vue2-Laravel8';
24
- }
25
- else if (sourceVal == '159') {
26
- tempVal = 'Vue3-Laravel8';
27
- }
28
- else if (sourceVal == '160') {
29
- tempVal = 'Vue3-Laravel9';
30
- }
31
- else if (sourceVal == '161') {
32
- tempVal = 'Vue3-Laravel10';
33
- }
34
- else if (sourceVal == '162') {
35
- tempVal = 'Vue3-Laravel11';
36
- }
37
- console.log(chalk_1.default.green(`\n✔ ${tempVal} boilerplate is successfully downloaded!. \n`));
38
- setTimeout(() => {
39
- console.log(chalk_1.default.yellow.bold("              *       ˜"));
40
- console.log(chalk_1.default.cyan.bold("        ˜                  |"));
41
- console.log(chalk_1.default.red.bold("    ()    .-.,='``'=.    - o -"));
42
- console.log(chalk_1.default.yellow.bold("          '=/_       〵    |"));
43
- console.log(chalk_1.default.cyanBright.bold("       *   |  '=._     )"));
44
- console.log(chalk_1.default.yellow.bold("           \\      `=../`,        '"));
45
- console.log(chalk_1.default.redBright.bold("         .   '=.__.=' `='      *"));
46
- console.log(chalk_1.default.yellow.bold("˜                         +"));
47
- console.log(chalk_1.default.cyanBright.bold("     O      *        '       .\n"));
48
- }, 300);
49
- setTimeout(() => {
50
- console.log('Well done 🎉🎉,', chalk_1.default.green('These Boilerplates are created with coffee & passion by', chalk_1.default.green.underline('Joshua Tania'), chalk_1.default.whiteBright('\nFor more info (github): >>'), chalk_1.default.green.underline('https://github.com/Shuashuaa/create-v-kit-spa'), chalk_1.default.whiteBright('\nFor more info (gitlab): >>'), chalk_1.default.green.underline('https://gitlab.com/shuashuaa/create-v-kit-spa\n')));
51
- }, 800);
52
- setTimeout(() => {
53
- if (sourceVal == "158" || sourceVal == "159") {
54
- console.log(chalk_1.default.bgBlack('Locate Project:'), chalk_1.default.cyanBright('cd project_name,'));
55
- console.log(chalk_1.default.bgBlack('Install Dependencies:'), chalk_1.default.cyanBright('npm install') + ',', chalk_1.default.cyanBright('composer install') + ',', chalk_1.default.cyanBright('\ncopy .env.example .env'), 'and', chalk_1.default.cyanBright('php artisan key:generate'));
56
- console.log(chalk_1.default.bgBlack('Run Project:'), chalk_1.default.cyanBright('npm run artisan-watch') + '.\n');
57
- }
58
- else if (sourceVal == "160" || sourceVal == "161" || sourceVal == "162") {
59
- console.log(chalk_1.default.bgBlack('Locate Project:'), chalk_1.default.cyanBright('cd project_name,'));
60
- console.log(chalk_1.default.bgBlack('Install Dependencies:'), chalk_1.default.cyanBright('yarn install') + ',', chalk_1.default.cyanBright('composer install') + ',', chalk_1.default.cyanBright('\ncopy .env.example .env'), 'and', chalk_1.default.cyanBright('php artisan key:generate'));
61
- console.log(chalk_1.default.bgBlack('Run Project:'), chalk_1.default.cyanBright('npm run artisan-dev') + '.\n');
62
- }
63
- console.log(chalk_1.default.bgBlack('Visit:'), chalk_1.default.bold('http://127.0.0.1:8000\n'));
64
- }, 500);
65
- });
66
- }
67
- function errorMessage(error) {
68
- console.error(chalk_1.default.red.inverse(`\n✖ Error creating project. ${error.message}`));
69
- }
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.successMessage = successMessage;
16
+ exports.errorMessage = errorMessage;
17
+ const chalk_1 = __importDefault(require("chalk"));
18
+ const prompts_1 = require("./prompts");
19
+ function successMessage(sourceVal) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ // console.log(sourceVal)
22
+ let tempVal = '';
23
+ if (sourceVal == '158') {
24
+ tempVal = 'Vue2-Laravel8';
25
+ }
26
+ else if (sourceVal == '159') {
27
+ tempVal = 'Vue3-Laravel8';
28
+ }
29
+ else if (sourceVal == '160') {
30
+ tempVal = 'Vue3-Laravel9';
31
+ }
32
+ else if (sourceVal == '161') {
33
+ tempVal = 'Vue3-Laravel10';
34
+ }
35
+ else if (sourceVal == '162') {
36
+ tempVal = 'Vue3-Laravel11';
37
+ }
38
+ console.log(chalk_1.default.green(`\n✔ ${tempVal} boilerplate is successfully downloaded!. \n`));
39
+ setTimeout(() => {
40
+ console.log(chalk_1.default.yellow.bold("              *       ˜"));
41
+ console.log(chalk_1.default.cyan.bold("        ˜                  |"));
42
+ console.log(chalk_1.default.red.bold("    ()    .-.,='``'=.    - o -"));
43
+ console.log(chalk_1.default.yellow.bold("          '=/_       〵    |"));
44
+ console.log(chalk_1.default.cyanBright.bold("       *   |  '=._     )"));
45
+ console.log(chalk_1.default.yellow.bold("           \\      `=../`,        '"));
46
+ console.log(chalk_1.default.redBright.bold("         .   '=.__.=' `='      *"));
47
+ console.log(chalk_1.default.yellow.bold("˜                         +"));
48
+ console.log(chalk_1.default.cyanBright.bold("     O      *        '       .\n"));
49
+ }, 300);
50
+ setTimeout(() => {
51
+ console.log('Well done 🎉🎉,', chalk_1.default.green('These Boilerplates are created with coffee & passion by', chalk_1.default.green.underline('Joshua Tania'), chalk_1.default.whiteBright('\nFor more info (github): >>'), chalk_1.default.green.underline('https://github.com/Shuashuaa/create-v-kit-spa'), chalk_1.default.whiteBright('\nFor more info (gitlab): >>'), chalk_1.default.green.underline('https://gitlab.com/shuashuaa/create-v-kit-spa\n')));
52
+ }, 800);
53
+ setTimeout(() => {
54
+ if (sourceVal == "158" || sourceVal == "159") {
55
+ console.log(chalk_1.default.bgBlack('Locate Project:'), chalk_1.default.cyanBright(`cd ${prompts_1.fileNameVariable},`));
56
+ console.log(chalk_1.default.bgBlack('Install Dependencies:'), chalk_1.default.cyanBright('npm install') + ',', chalk_1.default.cyanBright('composer install') + ',', chalk_1.default.cyanBright('\ncopy .env.example .env'), 'and', chalk_1.default.cyanBright('php artisan key:generate'));
57
+ console.log(chalk_1.default.bgBlack('Run Project:'), chalk_1.default.cyanBright('npm run artisan-watch') + '.\n');
58
+ }
59
+ else if (sourceVal == "160" || sourceVal == "161" || sourceVal == "162") {
60
+ console.log(chalk_1.default.bgBlack('Locate Project:'), chalk_1.default.cyanBright(`cd ${prompts_1.fileNameVariable},`));
61
+ console.log(chalk_1.default.bgBlack('Install Dependencies:'), chalk_1.default.cyanBright('yarn install') + ',', chalk_1.default.cyanBright('composer install') + ',', chalk_1.default.cyanBright('\ncopy .env.example .env'), 'and', chalk_1.default.cyanBright('php artisan key:generate'));
62
+ console.log(chalk_1.default.bgBlack('Run Project:'), chalk_1.default.cyanBright('npm run artisan-dev') + '.\n');
63
+ }
64
+ console.log(chalk_1.default.bgBlack('Visit:'), chalk_1.default.bold('http://127.0.0.1:8000\n'));
65
+ }, 500);
66
+ });
67
+ }
68
+ function errorMessage(error) {
69
+ console.error(chalk_1.default.red.inverse(`\n✖ Error creating project. ${error.message}`));
70
+ }
@@ -1,2 +1,2 @@
1
- export declare function Progress(countVal: number, sourceVal: string): Promise<void>;
1
+ export declare function Progress(countVal: number, sourceVal: string): Promise<void>;
2
2
  //# sourceMappingURL=progress.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../src/progress.ts"],"names":[],"mappings":"AAKA,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBA0BjE"}
1
+ {"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../src/progress.ts"],"names":[],"mappings":"AAOA,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,iBA0BjE"}
package/dist/progress.js CHANGED
@@ -1,37 +1,38 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Progress = Progress;
13
- const _progress = require('cli-progress');
14
- const colors = require('ansi-colors');
15
- const messages_1 = require("./messages");
16
- function Progress(countVal, sourceVal) {
17
- return __awaiter(this, void 0, void 0, function* () {
18
- console.log('\n');
19
- const b1 = new _progress.SingleBar({
20
- format: 'Downloading... |' + colors.cyan('{bar}') + '| {percentage}% | {value}/{total} Files | ETA: {eta}s',
21
- barCompleteChar: '\u2588',
22
- barIncompleteChar: '\u2591',
23
- hideCursor: true
24
- });
25
- b1.start(countVal, 0);
26
- let value = 0;
27
- const timer = setInterval(function () {
28
- value++;
29
- b1.update(value);
30
- if (value >= b1.getTotal()) {
31
- clearInterval(timer);
32
- b1.stop();
33
- (0, messages_1.successMessage)(sourceVal);
34
- }
35
- }, 20);
36
- });
37
- }
1
+ "use strict";
2
+ // returns the countVal as a progress bar
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.Progress = Progress;
14
+ const _progress = require('cli-progress');
15
+ const colors = require('ansi-colors');
16
+ const messages_1 = require("./messages");
17
+ function Progress(countVal, sourceVal) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ console.log('\n');
20
+ const b1 = new _progress.SingleBar({
21
+ format: 'Downloading... |' + colors.cyan('{bar}') + '| {percentage}% | {value}/{total} Files | ETA: {eta}s',
22
+ barCompleteChar: '\u2588',
23
+ barIncompleteChar: '\u2591',
24
+ hideCursor: true
25
+ });
26
+ b1.start(countVal, 0);
27
+ let value = 0;
28
+ const timer = setInterval(function () {
29
+ value++;
30
+ b1.update(value);
31
+ if (value >= b1.getTotal()) {
32
+ clearInterval(timer);
33
+ b1.stop();
34
+ (0, messages_1.successMessage)(sourceVal);
35
+ }
36
+ }, 20);
37
+ });
38
+ }
package/dist/prompts.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export declare function getProjectName(): Promise<string>;
2
- export declare function getBoilerplateChoice(): Promise<number>;
3
- export declare function closeReadline(): void;
1
+ export declare let fileNameVariable: string;
2
+ export declare function getProjectName(): Promise<string>;
3
+ export declare function getBoilerplateChoice(): Promise<number>;
4
+ export declare function closeReadline(): void;
4
5
  //# sourceMappingURL=prompts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AASA,wBACgB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAWhD;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAwC5D;AAGD,wBAAgB,aAAa,SAE5B"}
1
+ {"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AASA,eAAO,IAAI,gBAAgB,QAAK,CAAC;AAEjC,wBACgB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CAYhD;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAwC5D;AAGD,wBAAgB,aAAa,SAE5B"}
package/dist/prompts.js CHANGED
@@ -1,77 +1,80 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.getProjectName = getProjectName;
16
- exports.getBoilerplateChoice = getBoilerplateChoice;
17
- exports.closeReadline = closeReadline;
18
- const chalk_1 = __importDefault(require("chalk"));
19
- const { spawn } = require('child_process');
20
- const readline_1 = require("readline");
21
- const readline = (0, readline_1.createInterface)({
22
- input: process.stdin,
23
- output: process.stdout
24
- });
25
- function getProjectName() {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- return new Promise((resolve) => {
28
- // readline.question('? Enter a project name (using default "v-kit-app" if left blank): ', (answer) => {
29
- //   resolve(answer || 'v-kit-app');
30
- // });
31
- let message = `\n${chalk_1.default.bold.cyan('?')} ${chalk_1.default.bold('Enter a project name')} (using default "${chalk_1.default.bold.magentaBright('v-kit-app')}" if left blank): `;
32
- readline.question(message, (answer) => {
33
- resolve(answer || 'v-kit-app');
34
- });
35
- });
36
- });
37
- }
38
- function getBoilerplateChoice() {
39
- return __awaiter(this, void 0, void 0, function* () {
40
- return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
41
- //!
42
- const phpProcess = spawn('php', ['-v']);
43
- let version = null;
44
- phpProcess.stdout.on('data', (data) => {
45
- const match = data.toString().match(/PHP (\d+\.\d+\.\d+)/);
46
- if (match) {
47
- version = `v${match[1]}`;
48
- console.log(chalk_1.default.italic('Scanning... your php is:'), chalk_1.default.greenBright(version));
49
- }
50
- else {
51
- console.log(chalk_1.default.redBright(`Php is not installed in your machine`));
52
- }
53
- });
54
- phpProcess.stderr.on('data', (data) => {
55
- console.error(`Php not found: ${data}`);
56
- });
57
- //!!
58
- yield new Promise((resolve) => {
59
- phpProcess.stdout.once('data', () => resolve());
60
- });
61
- //! This will not run before the function above 'resolve'
62
- let message = `\n${chalk_1.default.bold.cyan('?')} ${chalk_1.default.bold('Select your preferred boilerplate:')}\n`;
63
- message += `[1] - ${chalk_1.default.underline('Vue2-Laravel8')} ${chalk_1.default.grey.italic('~ php v7.4')}\n`;
64
- message += `[2] - ${chalk_1.default.underline('Vue3-Laravel8')} ${chalk_1.default.grey.italic('~ php v7.4')}\n`;
65
- message += `[3] - ${chalk_1.default.underline('Vue3-Laravel9')} ${chalk_1.default.grey.italic('~ php v8.0')}\n`;
66
- message += `[4] - ${chalk_1.default.underline('Vue3-Laravel10')} ${chalk_1.default.grey.italic('~ php v8.1')}\n`;
67
- message += `[5] - ${chalk_1.default.underline('Vue3-Laravel11')} ${chalk_1.default.grey.italic('~ php v8.2 - v8.3')}\n`;
68
- message += '=> ';
69
- readline.question(message, (answer) => __awaiter(this, void 0, void 0, function* () {
70
- resolve(parseInt(answer));
71
- }));
72
- }));
73
- });
74
- }
75
- function closeReadline() {
76
- readline.close();
77
- }
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.fileNameVariable = void 0;
16
+ exports.getProjectName = getProjectName;
17
+ exports.getBoilerplateChoice = getBoilerplateChoice;
18
+ exports.closeReadline = closeReadline;
19
+ const chalk_1 = __importDefault(require("chalk"));
20
+ const { spawn } = require('child_process');
21
+ const readline_1 = require("readline");
22
+ const readline = (0, readline_1.createInterface)({
23
+ input: process.stdin,
24
+ output: process.stdout
25
+ });
26
+ exports.fileNameVariable = '';
27
+ function getProjectName() {
28
+ return __awaiter(this, void 0, void 0, function* () {
29
+ return new Promise((resolve) => {
30
+ // readline.question('? Enter a project name (using default "v-kit-app" if left blank): ', (answer) => {
31
+ //   resolve(answer || 'v-kit-app');
32
+ // });
33
+ let message = `\n${chalk_1.default.bold.cyan('?')} ${chalk_1.default.bold('Enter a project name')} (using default "${chalk_1.default.bold.magentaBright('v-kit-app')}" if left blank): `;
34
+ readline.question(message, (answer) => {
35
+ exports.fileNameVariable = answer ? answer : 'v-kit-spa';
36
+ resolve(answer || 'v-kit-app');
37
+ });
38
+ });
39
+ });
40
+ }
41
+ function getBoilerplateChoice() {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {
44
+ //!
45
+ const phpProcess = spawn('php', ['-v']);
46
+ let version = null;
47
+ phpProcess.stdout.on('data', (data) => {
48
+ const match = data.toString().match(/PHP (\d+\.\d+\.\d+)/);
49
+ if (match) {
50
+ version = `v${match[1]}`;
51
+ console.log(chalk_1.default.italic('Scanning... your php is:'), chalk_1.default.greenBright(version));
52
+ }
53
+ else {
54
+ console.log(chalk_1.default.redBright(`Php is not installed in your machine`));
55
+ }
56
+ });
57
+ phpProcess.stderr.on('data', (data) => {
58
+ console.error(`Php not found: ${data}`);
59
+ });
60
+ //!!
61
+ yield new Promise((resolve) => {
62
+ phpProcess.stdout.once('data', () => resolve());
63
+ });
64
+ //! This will not run before the function above 'resolve'
65
+ let message = `\n${chalk_1.default.bold.cyan('?')} ${chalk_1.default.bold('Select your preferred boilerplate:')}\n`;
66
+ message += `[1] - ${chalk_1.default.underline('Vue2-Laravel8')} ${chalk_1.default.grey.italic('~ php v7.4')}\n`;
67
+ message += `[2] - ${chalk_1.default.underline('Vue3-Laravel8')} ${chalk_1.default.grey.italic('~ php v7.4')}\n`;
68
+ message += `[3] - ${chalk_1.default.underline('Vue3-Laravel9')} ${chalk_1.default.grey.italic('~ php v8.0')}\n`;
69
+ message += `[4] - ${chalk_1.default.underline('Vue3-Laravel10')} ${chalk_1.default.grey.italic('~ php v8.1')}\n`;
70
+ message += `[5] - ${chalk_1.default.underline('Vue3-Laravel11')} ${chalk_1.default.grey.italic('~ php v8.2 - v8.3')}\n`;
71
+ message += '=> ';
72
+ readline.question(message, (answer) => __awaiter(this, void 0, void 0, function* () {
73
+ resolve(parseInt(answer));
74
+ }));
75
+ }));
76
+ });
77
+ }
78
+ function closeReadline() {
79
+ readline.close();
80
+ }
package/dist/utils.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare function copyProjectStructure(sourcePath: string, destinationPath: string): Promise<void>;
1
+ export declare function copyProjectStructure(sourcePath: string, destinationPath: string): Promise<void>;
2
2
  //# sourceMappingURL=utils.d.ts.map
package/dist/utils.js CHANGED
@@ -1,33 +1,33 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.copyProjectStructure = copyProjectStructure;
16
- const fs_1 = __importDefault(require("fs"));
17
- const path_1 = __importDefault(require("path"));
18
- function copyProjectStructure(sourcePath, destinationPath) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- const entries = yield fs_1.default.promises.readdir(sourcePath, { withFileTypes: true });
21
- for (const entry of entries) {
22
- const sourceFile = path_1.default.join(sourcePath, entry.name);
23
- const destinationFile = path_1.default.join(destinationPath, entry.name);
24
- if (entry.isDirectory()) {
25
- yield fs_1.default.promises.mkdir(destinationFile);
26
- yield copyProjectStructure(sourceFile, destinationFile);
27
- }
28
- else {
29
- yield fs_1.default.promises.copyFile(sourceFile, destinationFile);
30
- }
31
- }
32
- });
33
- }
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.copyProjectStructure = copyProjectStructure;
16
+ const fs_1 = __importDefault(require("fs"));
17
+ const path_1 = __importDefault(require("path"));
18
+ function copyProjectStructure(sourcePath, destinationPath) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ const entries = yield fs_1.default.promises.readdir(sourcePath, { withFileTypes: true });
21
+ for (const entry of entries) {
22
+ const sourceFile = path_1.default.join(sourcePath, entry.name);
23
+ const destinationFile = path_1.default.join(destinationPath, entry.name);
24
+ if (entry.isDirectory()) {
25
+ yield fs_1.default.promises.mkdir(destinationFile);
26
+ yield copyProjectStructure(sourceFile, destinationFile);
27
+ }
28
+ else {
29
+ yield fs_1.default.promises.copyFile(sourceFile, destinationFile);
30
+ }
31
+ }
32
+ });
33
+ }
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1,20 +1,20 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const chalk_1 = __importDefault(require("chalk"));
7
- const { spawn } = require('child_process');
8
- const phpProcess = spawn('php', ['-v']);
9
- phpProcess.stdout.on('data', (data) => {
10
- const match = data.toString().match(/PHP (\d+\.\d+\.\d+)/);
11
- if (match) {
12
- console.log('Scanning... your php is:', chalk_1.default.greenBright(`v${match[1]}`));
13
- }
14
- else {
15
- console.error('Could not find Php version');
16
- }
17
- });
18
- phpProcess.stderr.on('data', (data) => {
19
- console.error(`Php not found: ${data}`);
20
- });
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const chalk_1 = __importDefault(require("chalk"));
7
+ const { spawn } = require('child_process');
8
+ const phpProcess = spawn('php', ['-v']);
9
+ phpProcess.stdout.on('data', (data) => {
10
+ const match = data.toString().match(/PHP (\d+\.\d+\.\d+)/);
11
+ if (match) {
12
+ console.log('Scanning... your php is:', chalk_1.default.greenBright(`v${match[1]}`));
13
+ }
14
+ else {
15
+ console.error('Could not find Php version');
16
+ }
17
+ });
18
+ phpProcess.stderr.on('data', (data) => {
19
+ console.error(`Php not found: ${data}`);
20
+ });
@@ -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`)
@@ -0,0 +1,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
+ },
19
+ })
@@ -0,0 +1,66 @@
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>
@@ -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
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.12",
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