create-ts-express-app 1.0.0 → 1.0.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.
Files changed (2) hide show
  1. package/bin/cli.js +4 -8
  2. package/package.json +4 -2
package/bin/cli.js CHANGED
@@ -1,33 +1,29 @@
1
- #!/usr/bin/env node
2
-
3
1
  const fs = require('fs-extra');
4
2
  const path = require('path');
5
3
  const chalk = require('chalk');
6
4
 
7
- // Get project name from command line
8
5
  const projectName = process.argv[2] || 'ts-express-app';
9
6
 
10
- // Target directory
7
+
11
8
  const targetDir = path.join(process.cwd(), projectName);
12
9
 
13
- // Source template directory
14
10
  const templateDir = path.join(__dirname, '..', 'templates');
15
11
 
16
12
  async function createProject() {
17
13
  console.log(chalk.blue(`Creating a new TypeScript Express project in ${targetDir}`));
18
14
 
19
- // Check if directory exists
15
+
20
16
  if (fs.existsSync(targetDir)) {
21
17
  console.error(chalk.red(`Error: Directory ${projectName} already exists.`));
22
18
  process.exit(1);
23
19
  }
24
20
 
25
- // Copy template files
21
+
26
22
  try {
27
23
  await fs.copy(templateDir, targetDir);
28
24
  console.log(chalk.green('Template files copied successfully.'));
29
25
 
30
- // Update package.json with project name
26
+
31
27
  const packageJsonPath = path.join(targetDir, 'package.json');
32
28
  const packageJson = await fs.readJson(packageJsonPath);
33
29
  packageJson.name = projectName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-ts-express-app",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "index.js",
5
5
  "bin": {
6
6
  "create-ts-express-app": "bin/cli.js"
@@ -33,7 +33,9 @@
33
33
  "express": "^5.1.0",
34
34
  "fs": "^0.0.1-security",
35
35
  "ncp": "^2.0.0",
36
- "path": "^0.12.7"
36
+ "path": "^0.12.7",
37
+ "chalk": "^4.1.2",
38
+ "fs-extra": "^10.1.0"
37
39
  },
38
40
  "repository": {
39
41
  "type": "git",