create-tinny-backend 1.0.0 → 1.0.2

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 (2) hide show
  1. package/index.js +37 -7
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -1,26 +1,56 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const fs = require('fs-extra');
4
- const path = require('path');
5
- const { execSync } = require('child_process');
6
- const prompts = require('prompts');
7
- const { cyan, green, bold, yellow, red, gray } = require('kolorist');
8
- const ora = require('ora');
3
+ import fs from 'fs-extra';
4
+ import path from 'node:path';
5
+ import { execSync } from 'node:child_process';
6
+ import prompts from 'prompts';
7
+ import { cyan, green, bold, yellow, red, gray } from 'kolorist';
8
+ import ora from 'ora';
9
+ import { fileURLToPath } from 'node:url';
9
10
 
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = path.dirname(__filename);
10
13
 
11
14
  const args = process.argv.slice(2);
12
15
  const projectName = args[0] || 'myapp';
13
16
  const targetDir = path.join(process.cwd(), projectName);
14
17
 
15
18
 
19
+
16
20
  if (fs.existsSync(targetDir)) {
17
21
  console.error(red(`✖ Directory "${projectName}" already exists.`));
18
22
  process.exit(1);
19
23
  }
20
24
 
25
+ const header = {
26
+ message: ` █████ ███ █████ █████ █████
27
+ ░░███ ░░░ ░░███ ░░███ ░░███
28
+ ███████ ████ ████████ ████████ █████ ████ ░███████ ██████ ██████ ░███ █████ ██████ ████████ ███████
29
+ ░░░███░ ░░███ ░░███░░███ ░░███░░███ ░░███ ░███ ░███░░███ ░░░░░███ ███░░███ ░███░░███ ███░░███░░███░░███ ███░░███
30
+ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ███████ ░███ ░░░ ░██████░ ░███████ ░███ ░███ ░███ ░███
31
+ ░███ ███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ░███ ███░░███ ░███ ███ ░███░░███ ░███░░░ ░███ ░███ ░███ ░███
32
+ ░░█████ █████ ████ █████ ████ █████ ░░███████ ████████ ░░████████░░██████ ████ █████░░██████ ████ █████░░████████
33
+ ░░░░░ ░░░░░ ░░░░ ░░░░░ ░░░░ ░░░░░ ░░░░░███ ░░░░░░░░ ░░░░░░░░ ░░░░░░ ░░░░ ░░░░░ ░░░░░░ ░░░░ ░░░░░ ░░░░░░░░
34
+ ███ ░███
35
+ ░░██████
36
+ ░░░░░░ `,
37
+ by: `d88PPPo 888 88
38
+ 888ooo8 888ooo88
39
+ 888 8 88
40
+ 888PPPP PPPPPP8P
41
+ `,
42
+ author: `▗▖ ▗▖▗▄▖ ▗▄▄▖ ▗▄▄▖▗▄▄▄▖▗▖ ▗▖▗▄▄▄▖ ▗▄▖ ▗▖ ▗▄▖ ▗▄▄▖▗▄▄▖ ▗▄▖ ▗▖ ▗▖
43
+ ▝▚▞▘▐▌ ▐▌▐▌ ▐▌ █ ▐▛▚▖▐▌▐▌ ▐▌ ▐▌ ▐▌▐▌ ▐▌▐▌ ▐▌ ▐▌▐▌ ▐▌▐▌ ▐▌
44
+ ▐▌ ▐▛▀▜▌ ▝▀▚▖ ▝▀▚▖ █ ▐▌ ▝▜▌▐▛▀▀▘ ▐▛▀▜▌ ▐▌▐▛▀▜▌▐▌▝▜▌▐▛▀▚▖▐▌ ▐▌▐▌ ▐▌
45
+ ▐▌ ▐▌ ▐▌▗▄▄▞▘▗▄▄▞▘▗▄█▄▖▐▌ ▐▌▐▙▄▄▖ ▐▌ ▐▌▗▄▄▞▘▐▌ ▐▌▝▚▄▞▘▐▌ ▐▌▝▚▄▞▘▝▚▄▞▘
46
+
47
+
48
+ `
49
+ }
50
+
21
51
 
22
52
  (async function main() {
23
- console.log(cyan('\nWelcome to create-tinny-backend\n'));
53
+ console.log(cyan(`\n${header.message}\n${header.by}\n${header.author}\n`));
24
54
 
25
55
  const response = await prompts([
26
56
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tinny-backend",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Scaffold a new tinny-backend project",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -21,7 +21,7 @@
21
21
  ],
22
22
  "author": "Yassine Ajagrou",
23
23
  "license": "ISC",
24
- "type": "commonjs",
24
+ "type": "module",
25
25
  "bugs": {
26
26
  "url": "https://github.com/iaceene/create-tinny-backend/issues"
27
27
  },