create-v-kit-spa 0.9.4 → 0.9.5-beta

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 CHANGED
@@ -143,4 +143,4 @@ To learn about the specific changes in each release, check the [Changelog](./Cha
143
143
  <br> -->
144
144
 
145
145
  ## License
146
- [MIT](./LICENSE) License &copy; 2024-PRESENT [Shuashuaa](https://github.com/Shuashuaa)
146
+ v-kit-spa is OpenSource and licensed under the Terms of The [MIT](./LICENSE) License &copy; 2024-PRESENT [Shuashuaa](https://github.com/Shuashuaa)
package/dist/commands.js CHANGED
@@ -18,6 +18,7 @@ const utils_1 = require("./utils");
18
18
  const prompts_1 = require("./prompts");
19
19
  const messages_1 = require("./messages");
20
20
  const yargs_1 = __importDefault(require("yargs"));
21
+ const count_1 = require("./count");
21
22
  function createProject() {
22
23
  return __awaiter(this, void 0, void 0, function* () {
23
24
  const argv = yargs_1.default.argv;
@@ -37,7 +38,7 @@ function createProject() {
37
38
  try {
38
39
  yield fs_1.default.promises.mkdir(destinationPath);
39
40
  yield (0, utils_1.copyProjectStructure)(sourcePath, destinationPath);
40
- (0, messages_1.successMessage)(templatePath);
41
+ (0, count_1.getCount)(sourcePath, templatePath);
41
42
  }
42
43
  catch (error) {
43
44
  (0, messages_1.errorMessage)(error);
@@ -0,0 +1,3 @@
1
+ export declare function countItems(dirPath: string): Promise<number>;
2
+ export declare function getCount(sourcePath: string, templatePath: string): void;
3
+ //# sourceMappingURL=count.d.ts.map
@@ -0,0 +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"}
package/dist/count.js ADDED
@@ -0,0 +1,44 @@
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,3 +1,3 @@
1
- export declare function successMessage(boilerplateChoice: string): void;
1
+ export declare function successMessage(sourceVal: string): Promise<void>;
2
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,wBAAgB,cAAc,CAAC,iBAAiB,EAAE,MAAM,QA4BvD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,QAExC"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAEA,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,iBA6BrD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,QAExC"}
package/dist/messages.js CHANGED
@@ -1,4 +1,13 @@
1
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
+ };
2
11
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
13
  };
@@ -6,48 +15,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
15
  exports.successMessage = successMessage;
7
16
  exports.errorMessage = errorMessage;
8
17
  const chalk_1 = __importDefault(require("chalk"));
9
- function successMessage(boilerplateChoice) {
10
- console.log(chalk_1.default.green('\n✔ Project created successfully! \n'));
11
- console.log(chalk_1.default.yellow.bold("              *       ˜"));
12
- console.log(chalk_1.default.cyan.bold("        ˜                  |"));
13
- console.log(chalk_1.default.red.bold("    ()    .-.,='``'=.    - o -"));
14
- console.log(chalk_1.default.yellow.bold("          '=/_       〵    |"));
15
- console.log(chalk_1.default.cyanBright.bold("       *   |  '=._    |"));
16
- console.log(chalk_1.default.yellow.bold("           \\      `=../`,        '"));
17
- console.log(chalk_1.default.redBright.bold("         .   '=.__.=' `='      *"));
18
- console.log(chalk_1.default.yellow.bold("˜                         +"));
19
- console.log(chalk_1.default.cyanBright.bold("     O      *        '       .\n"));
20
- console.log('Well done 🎉🎉,', chalk_1.default.green('A Boilerplates is created with coffee & passion by', chalk_1.default.green.bold.underline('Shuashuaa'), chalk_1.default.whiteBright('\nFor more info: >>'), chalk_1.default.green.underline('https://github.com/Shuashuaa/v-kit-spa\n')));
21
- if (boilerplateChoice == "158" || boilerplateChoice == "159") {
22
- 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'));
23
- console.log(chalk_1.default.bgBlack('Run Project:'), chalk_1.default.cyanBright('npm run artisan-watch') + '.\n');
24
- }
25
- else if (boilerplateChoice == "160" || boilerplateChoice == "161" || boilerplateChoice == "162") {
26
- 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'));
27
- console.log(chalk_1.default.bgBlack('Run Project:'), chalk_1.default.cyanBright('npm run artisan-dev') + '.\n');
28
- }
29
- console.log(chalk_1.default.bgBlack('Visit:'), chalk_1.default.bold('http://127.0.0.1:8000\n'));
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('A Boilerplates is created with coffee & passion by', chalk_1.default.green.bold.underline('Shuashuaa'), chalk_1.default.whiteBright('\nFor more info: >>'), chalk_1.default.green.underline('https://github.com/Shuashuaa/v-kit-spa\n')));
51
+ }, 800);
52
+ setTimeout(() => {
53
+ console.log(chalk_1.default.bgBlack('Install Dependencies:'), chalk_1.default.cyanBright('npm install'), 'or', chalk_1.default.cyanBright('yarn install') + ',', chalk_1.default.cyanBright('\ncopy .env.example .env') + ',', chalk_1.default.cyanBright('php artisan key:generate'), 'and', chalk_1.default.cyanBright('composer install') + '.');
54
+ console.log(chalk_1.default.bgBlack('Run Project:'), chalk_1.default.cyanBright('npm run artisan-watch') + '.\n');
55
+ console.log(chalk_1.default.bgBlack('Visit:'), chalk_1.default.bold('http://127.0.0.1:8000\n'));
56
+ }, 500);
57
+ });
30
58
  }
31
59
  function errorMessage(error) {
32
60
  console.error(chalk_1.default.red.inverse(`\n✖ Error creating project. ${error.message}`));
33
61
  }
34
- // console.log(chalk.yellow(' /\_/\ \n ( o.o )\n >^<\n'));
35
- // console.log(chalk.yellow("              *       +"));
36
- // console.log(chalk.yellow("        '                  |"));
37
- // console.log(chalk.yellow("    ()    .-.,='``'=.    - o -"));
38
- // console.log(chalk.yellow("          '=/_       〵     |"));
39
- // console.log(chalk.yellow("       *   |  '=._    |"));
40
- // console.log(chalk.yellow("           \\      `=../`,        ' ╱|\\\\"));
41
- // console.log(chalk.yellow("         .   '=.__.=' `='      * (˚ˎ。7 "));
42
- // console.log(chalk.yellow("+                         + |、˜〵 "));
43
- // console.log(chalk.yellow("     O      *        '       . じしˍ,)ノ\n"));
44
- // console.log(chalk.yellow(" ╱|\\\\\n (˚ˎ。7 \n |、˜〵 \n じしˍ,)ノ\n"));
45
- // * +
46
- // ' |
47
- // () .-.,="``"=. - o -
48
- // '=/_ \ |
49
- // * | '=._ |
50
- // \ `=./`, '
51
- // . '=.__.=' `=' *
52
- // + +
53
- // o * ' .
@@ -0,0 +1,2 @@
1
+ export declare function Progress(countVal: number, sourceVal: string): Promise<void>;
2
+ //# sourceMappingURL=progress.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,37 @@
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
+ }
package/dist/prompts.js CHANGED
@@ -38,10 +38,10 @@ function getBoilerplateChoice() {
38
38
  return __awaiter(this, void 0, void 0, function* () {
39
39
  return new Promise((resolve) => {
40
40
  let message = `\n${chalk_1.default.bold.cyan('?')} ${chalk_1.default.bold('Select your preferred boilerplate:')}\n`;
41
- message += `\nMonoRepo: Decoupled:\n`;
42
- message += `[1] - ${chalk_1.default.bold.underline('Vue2-Laravel8')} [6] - ${chalk_1.default.bold.underline.gray('Vue2-Laravel8')} ${chalk_1.default.gray.dim.italic('(on-going..)')}\n`;
43
- message += `[2] - ${chalk_1.default.bold.underline.gray('Vue3-Laravel8')} ${chalk_1.default.gray.dim.italic('(on-going..)')} [7] - ${chalk_1.default.bold.underline.gray('Vue3-Laravel8')} ${chalk_1.default.gray.dim.italic('(on-going..)')}\n`;
44
- message += `[3] - ${chalk_1.default.bold.underline('Vue3-Laravel9')} [8] - ${chalk_1.default.bold.underline.gray('Vue3-Laravel9')} ${chalk_1.default.gray.dim.italic('(on-going..)')}\n`;
41
+ message += `\n MonoRepo: Decoupled:\n`;
42
+ message += `[1] - ${chalk_1.default.bold.underline('Vue2-Laravel8')} [6] - ${chalk_1.default.bold.underline.gray('Vue2-Laravel8')} ${chalk_1.default.gray.dim.italic('(on-going..)')}\n`;
43
+ message += `[2] - ${chalk_1.default.bold.underline('Vue3-Laravel8')} [7] - ${chalk_1.default.bold.underline.gray('Vue3-Laravel8')} ${chalk_1.default.gray.dim.italic('(on-going..)')}\n`;
44
+ message += `[3] - ${chalk_1.default.bold.underline('Vue3-Laravel9')} [8] - ${chalk_1.default.bold.underline.gray('Vue3-Laravel9')} ${chalk_1.default.gray.dim.italic('(on-going..)')}\n`;
45
45
  message += `[4] - ${chalk_1.default.bold.underline.gray('Vue3-Laravel10')} ${chalk_1.default.gray.dim.italic('(on-going..)')}\n`;
46
46
  message += `[5] - ${chalk_1.default.bold.underline.gray('Vue3-Laravel11')} ${chalk_1.default.gray.dim.italic('(on-going..)')}\n`;
47
47
  message += '=> ';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-v-kit-spa",
3
- "version": "0.9.4",
3
+ "version": "0.9.5-beta",
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",
@@ -22,21 +22,24 @@
22
22
  "license": "MIT",
23
23
  "homepage": "https://github.com/Shuashuaa/v-kit-spa#readme",
24
24
  "dependencies": {
25
+ "ansi-colors": "^4.1.3",
25
26
  "chalk": "^4.1.2",
27
+ "cli-progress": "^3.12.0",
26
28
  "fs": "^0.0.1-security",
27
29
  "path": "^0.12.7",
28
30
  "yargs": "^17.7.2"
29
31
  },
30
32
  "devDependencies": {
31
33
  "@types/yargs": "^17.0.33",
34
+ "@types/cli-progress": "^3.11.6",
32
35
  "ts-node": "^10.9.2",
33
36
  "typescript": "^5.6.2"
34
37
  },
35
38
  "files": [
36
- "dist",
37
- "lib",
38
- "index.d.ts",
39
+ "dist",
40
+ "lib",
41
+ "index.d.ts",
39
42
  "package.json",
40
43
  "@shuashuaa-v-kit.png"
41
44
  ]
42
- }
45
+ }