create-v-kit-spa 1.1.0 → 1.1.1

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.
@@ -1,2 +1,2 @@
1
- export {};
1
+ export {};
2
2
  //# sourceMappingURL=commands.d.ts.map
package/dist/commands.js CHANGED
@@ -70,7 +70,7 @@ function createProject() {
70
70
  process.exit(1);
71
71
  }
72
72
  (0, messages_1.successMessage)(template.id, projectName);
73
- (0, prompts_1.outro)(chalk_1.default.green(`${template.label} boilerplate ready 🎉`));
73
+ (0, prompts_1.outro)(chalk_1.default.green(`${template.label} ready`) + chalk_1.default.dim(' · ') + chalk_1.default.cyan('http://127.0.0.1:8000'));
74
74
  });
75
75
  }
76
76
  createProject().catch((error) => {
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, projectName: string): void;
2
- export declare function errorMessage(error: Error): void;
1
+ export declare function successMessage(sourceVal: string, projectName: string): 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":"AAMA,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QA0BpE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,QAExC"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAOA,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAqCpE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,QAExC"}
package/dist/messages.js CHANGED
@@ -6,33 +6,39 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.successMessage = successMessage;
7
7
  exports.errorMessage = errorMessage;
8
8
  const chalk_1 = __importDefault(require("chalk"));
9
- const prompts_1 = require("./prompts");
9
+ const prompts_1 = require("@clack/prompts");
10
+ const prompts_2 = require("./prompts");
10
11
  // Templates whose install hint uses npm; the rest use yarn.
11
12
  const NPM_TEMPLATES = ['158', '159'];
12
13
  function successMessage(sourceVal, projectName) {
13
14
  var _a, _b;
14
- const label = (_b = (_a = prompts_1.TEMPLATES.find((t) => t.id === sourceVal)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : sourceVal;
15
- console.log(chalk_1.default.green(`\n✔ ${label} boilerplate is successfully downloaded!\n`));
16
- console.log(chalk_1.default.yellow.bold(" * ˜"));
17
- console.log(chalk_1.default.cyan.bold(" ˜ |"));
18
- console.log(chalk_1.default.red.bold(" () .-.,='``'=. - o -"));
19
- console.log(chalk_1.default.yellow.bold(" '=/_ 〵 |"));
20
- console.log(chalk_1.default.cyanBright.bold(" * | '=._ )"));
21
- console.log(chalk_1.default.yellow.bold(" \\ `=../`, '"));
22
- console.log(chalk_1.default.redBright.bold(" . '=.__.=' `=' *"));
23
- console.log(chalk_1.default.yellow.bold("˜ +"));
24
- console.log(chalk_1.default.cyanBright.bold(" O * ' .\n"));
25
- console.log(chalk_1.default.bgBlack('Locate Project:'), chalk_1.default.cyanBright(`cd ${projectName},`));
26
- if (NPM_TEMPLATES.includes(sourceVal)) {
27
- 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'));
28
- console.log(chalk_1.default.bgBlack('Run Project:'), chalk_1.default.cyanBright('npm run artisan-watch') + '.\n');
29
- }
30
- else {
31
- 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'));
32
- console.log(chalk_1.default.bgBlack('Run Project:'), chalk_1.default.cyanBright('npm run artisan-dev') + '.\n');
33
- }
34
- console.log(chalk_1.default.bgBlack('Visit:'), chalk_1.default.bold('http://127.0.0.1:8000\n'));
35
- 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')));
15
+ const label = (_b = (_a = prompts_2.TEMPLATES.find((t) => t.id === sourceVal)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : sourceVal;
16
+ const isNpm = NPM_TEMPLATES.includes(sourceVal);
17
+ const installCmd = isNpm ? 'npm install' : 'yarn install';
18
+ const runCmd = isNpm ? 'npm run artisan-watch' : 'npm run artisan-dev';
19
+ console.log(chalk_1.default.green(`\n✔ ${label} boilerplate downloaded\n`));
20
+ // Galaxy — created with coffee & passion.
21
+ console.log(chalk_1.default.gray(" ˚ · ⋆ · ˚ ✧ ·"));
22
+ console.log(chalk_1.default.white(" ✧ · ˚ ✦ · ⋆ · ✦ · ˚"));
23
+ console.log(chalk_1.default.white(" · ⋆ ✦ · ✺ ") + chalk_1.default.whiteBright.bold("★ ✦ ★") + chalk_1.default.white(" ✺ · ✦ ⋆ ·"));
24
+ console.log(chalk_1.default.white(" · ✧ · ✦ · ⋆ · ✦ ˚ · ✧"));
25
+ console.log(chalk_1.default.gray(" ˚ · ✦ ⋆ · ✦ · ˚\n"));
26
+ const steps = [
27
+ `cd ${projectName}`,
28
+ installCmd,
29
+ 'composer install',
30
+ 'copy .env.example .env',
31
+ 'php artisan key:generate',
32
+ runCmd,
33
+ ]
34
+ .map((cmd, i) => `${chalk_1.default.dim(`${i + 1}.`)} ${chalk_1.default.cyan(cmd)}`)
35
+ .join('\n');
36
+ (0, prompts_1.note)(steps, 'Next steps');
37
+ console.log(chalk_1.default.dim(' built with coffee & passion by ') + chalk_1.default.green.underline('Joshua Tania'));
38
+ console.log(chalk_1.default.dim(' github.com/Shuashuaa/create-v-kit-spa') +
39
+ chalk_1.default.dim(' · ') +
40
+ chalk_1.default.dim('gitlab.com/shuashuaa/create-v-kit-spa') +
41
+ '\n');
36
42
  }
37
43
  function errorMessage(error) {
38
44
  console.error(chalk_1.default.red.inverse(`\n✖ Error creating project. ${error.message}`));
package/dist/prompts.d.ts CHANGED
@@ -1,16 +1,16 @@
1
- export interface Template {
2
- id: string;
3
- label: string;
4
- hint: string;
5
- }
6
- export declare const TEMPLATES: Template[];
7
- export declare function getProjectName(): Promise<string>;
8
- export declare function getTemplateChoice(): Promise<string>;
9
- /**
10
- * Resolve the installed PHP version, or null if PHP is missing.
11
- * `shell: true` so the bare name `php` resolves via PATH/PATHEXT on Windows,
12
- * matching how the interactive shell finds php.exe. Never rejects/throws:
13
- * a missing binary emits 'error', which we catch and report as null.
14
- */
15
- export declare function detectPhp(): Promise<string | null>;
1
+ export interface Template {
2
+ id: string;
3
+ label: string;
4
+ hint: string;
5
+ }
6
+ export declare const TEMPLATES: Template[];
7
+ export declare function getProjectName(): Promise<string>;
8
+ export declare function getTemplateChoice(): Promise<string>;
9
+ /**
10
+ * Resolve the installed PHP version, or null if PHP is missing.
11
+ * `shell: true` so the bare name `php` resolves via PATH/PATHEXT on Windows,
12
+ * matching how the interactive shell finds php.exe. Never rejects/throws:
13
+ * a missing binary emits 'error', which we catch and report as null.
14
+ */
15
+ export declare function detectPhp(): Promise<string | null>;
16
16
  //# sourceMappingURL=prompts.d.ts.map
package/dist/prompts.js CHANGED
@@ -1,98 +1,98 @@
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.TEMPLATES = void 0;
16
- exports.getProjectName = getProjectName;
17
- exports.getTemplateChoice = getTemplateChoice;
18
- exports.detectPhp = detectPhp;
19
- const fs_1 = __importDefault(require("fs"));
20
- const path_1 = __importDefault(require("path"));
21
- const prompts_1 = require("@clack/prompts");
22
- const { spawn } = require('child_process');
23
- // Single source of truth for the boilerplates. Folder ids map to ./lib/<id>.
24
- exports.TEMPLATES = [
25
- { id: '158', label: 'Vue2-Laravel8', hint: 'php 7.4' },
26
- { id: '159', label: 'Vue3-Laravel8', hint: 'php 7.4' },
27
- { id: '160', label: 'Vue3-Laravel9', hint: 'php 8.0' },
28
- { id: '161', label: 'Vue3-Laravel10', hint: 'php 8.1' },
29
- { id: '162', label: 'Vue3-Laravel11', hint: 'php 8.2 - 8.3' },
30
- ];
31
- const DEFAULT_NAME = 'v-kit-app';
32
- // Characters that are illegal in Windows paths (and a good ban list elsewhere too).
33
- const INVALID_NAME = /[<>:"/\\|?*\x00-\x1f]/;
34
- function bail(value) {
35
- if ((0, prompts_1.isCancel)(value)) {
36
- (0, prompts_1.cancel)('Cancelled.');
37
- process.exit(0);
38
- }
39
- }
40
- function getProjectName() {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- const answer = yield (0, prompts_1.text)({
43
- message: 'Project name',
44
- placeholder: DEFAULT_NAME,
45
- defaultValue: DEFAULT_NAME,
46
- validate(value) {
47
- const v = (value !== null && value !== void 0 ? value : '').trim();
48
- if (!v)
49
- return; // empty -> default name is used
50
- if (INVALID_NAME.test(v))
51
- return 'Name contains invalid path characters.';
52
- if (fs_1.default.existsSync(path_1.default.join(process.cwd(), v)))
53
- return `Directory "${v}" already exists.`;
54
- },
55
- });
56
- bail(answer);
57
- return answer.trim() || DEFAULT_NAME;
58
- });
59
- }
60
- function getTemplateChoice() {
61
- return __awaiter(this, void 0, void 0, function* () {
62
- const choice = yield (0, prompts_1.select)({
63
- message: 'Select your preferred boilerplate',
64
- options: exports.TEMPLATES.map((t) => ({ value: t.id, label: t.label, hint: t.hint })),
65
- });
66
- bail(choice);
67
- return choice;
68
- });
69
- }
70
- /**
71
- * Resolve the installed PHP version, or null if PHP is missing.
72
- * `shell: true` so the bare name `php` resolves via PATH/PATHEXT on Windows,
73
- * matching how the interactive shell finds php.exe. Never rejects/throws:
74
- * a missing binary emits 'error', which we catch and report as null.
75
- */
76
- function detectPhp() {
77
- return __awaiter(this, void 0, void 0, function* () {
78
- return new Promise((resolve) => {
79
- let output = '';
80
- let settled = false;
81
- const finish = (version) => {
82
- if (settled)
83
- return;
84
- settled = true;
85
- resolve(version);
86
- };
87
- const phpProcess = spawn('php', ['-v'], { shell: true });
88
- phpProcess.stdout.on('data', (data) => {
89
- output += data.toString();
90
- });
91
- phpProcess.on('error', () => finish(null));
92
- phpProcess.on('close', () => {
93
- const match = output.match(/PHP (\d+\.\d+\.\d+)/);
94
- finish(match ? `v${match[1]}` : null);
95
- });
96
- });
97
- });
98
- }
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.TEMPLATES = void 0;
16
+ exports.getProjectName = getProjectName;
17
+ exports.getTemplateChoice = getTemplateChoice;
18
+ exports.detectPhp = detectPhp;
19
+ const fs_1 = __importDefault(require("fs"));
20
+ const path_1 = __importDefault(require("path"));
21
+ const prompts_1 = require("@clack/prompts");
22
+ const { spawn } = require('child_process');
23
+ // Single source of truth for the boilerplates. Folder ids map to ./lib/<id>.
24
+ exports.TEMPLATES = [
25
+ { id: '158', label: 'Vue2-Laravel8', hint: 'php 7.4' },
26
+ { id: '159', label: 'Vue3-Laravel8', hint: 'php 7.4' },
27
+ { id: '160', label: 'Vue3-Laravel9', hint: 'php 8.0' },
28
+ { id: '161', label: 'Vue3-Laravel10', hint: 'php 8.1' },
29
+ { id: '162', label: 'Vue3-Laravel11', hint: 'php 8.2 - 8.3' },
30
+ ];
31
+ const DEFAULT_NAME = 'v-kit-app';
32
+ // Characters that are illegal in Windows paths (and a good ban list elsewhere too).
33
+ const INVALID_NAME = /[<>:"/\\|?*\x00-\x1f]/;
34
+ function bail(value) {
35
+ if ((0, prompts_1.isCancel)(value)) {
36
+ (0, prompts_1.cancel)('Cancelled.');
37
+ process.exit(0);
38
+ }
39
+ }
40
+ function getProjectName() {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ const answer = yield (0, prompts_1.text)({
43
+ message: 'Project name',
44
+ placeholder: DEFAULT_NAME,
45
+ defaultValue: DEFAULT_NAME,
46
+ validate(value) {
47
+ const v = (value !== null && value !== void 0 ? value : '').trim();
48
+ if (!v)
49
+ return; // empty -> default name is used
50
+ if (INVALID_NAME.test(v))
51
+ return 'Name contains invalid path characters.';
52
+ if (fs_1.default.existsSync(path_1.default.join(process.cwd(), v)))
53
+ return `Directory "${v}" already exists.`;
54
+ },
55
+ });
56
+ bail(answer);
57
+ return answer.trim() || DEFAULT_NAME;
58
+ });
59
+ }
60
+ function getTemplateChoice() {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ const choice = yield (0, prompts_1.select)({
63
+ message: 'Select your preferred boilerplate',
64
+ options: exports.TEMPLATES.map((t) => ({ value: t.id, label: t.label, hint: t.hint })),
65
+ });
66
+ bail(choice);
67
+ return choice;
68
+ });
69
+ }
70
+ /**
71
+ * Resolve the installed PHP version, or null if PHP is missing.
72
+ * `shell: true` so the bare name `php` resolves via PATH/PATHEXT on Windows,
73
+ * matching how the interactive shell finds php.exe. Never rejects/throws:
74
+ * a missing binary emits 'error', which we catch and report as null.
75
+ */
76
+ function detectPhp() {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ return new Promise((resolve) => {
79
+ let output = '';
80
+ let settled = false;
81
+ const finish = (version) => {
82
+ if (settled)
83
+ return;
84
+ settled = true;
85
+ resolve(version);
86
+ };
87
+ const phpProcess = spawn('php', ['-v'], { shell: true });
88
+ phpProcess.stdout.on('data', (data) => {
89
+ output += data.toString();
90
+ });
91
+ phpProcess.on('error', () => finish(null));
92
+ phpProcess.on('close', () => {
93
+ const match = output.match(/PHP (\d+\.\d+\.\d+)/);
94
+ finish(match ? `v${match[1]}` : null);
95
+ });
96
+ });
97
+ });
98
+ }
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,25 +1,25 @@
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'], { shell: true });
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 check error: ${data}`);
20
- });
21
- // Spawn failure (binary not found) emits 'error', not stderr.
22
- // Without this, Node throws on the unhandled 'error' event and crashes.
23
- phpProcess.on('error', () => {
24
- console.error(chalk_1.default.redBright('Php not found in PATH.'));
25
- });
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'], { shell: true });
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 check error: ${data}`);
20
+ });
21
+ // Spawn failure (binary not found) emits 'error', not stderr.
22
+ // Without this, Node throws on the unhandled 'error' event and crashes.
23
+ phpProcess.on('error', () => {
24
+ console.error(chalk_1.default.redBright('Php not found in PATH.'));
25
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-v-kit-spa",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
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",