create-tanstack-app 1.1.6 → 1.2.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.
package/index.js CHANGED
@@ -1,65 +1,20 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  const { execSync } = require("child_process");
4
- const fs = require("fs");
5
- const path = require("path");
6
- const readline = require("readline");
7
-
8
- // Prompt the user for input
9
- const rl = readline.createInterface({
10
- input: process.stdin,
11
- output: process.stdout,
12
- });
13
-
14
- async function getFolderName(defaultName) {
15
- return new Promise((resolve) => {
16
- rl.question(
17
- `Enter the folder name (or use './' for the current directory) [${defaultName}]: `,
18
- (input) => {
19
- resolve(input || defaultName);
20
- }
21
- );
22
- });
23
- }
24
4
 
25
5
  async function initApp() {
26
6
  try {
27
- // Get the folder name from the user or command-line argument
28
- const argFolderName = process.argv[2];
29
- const folderName = argFolderName || (await getFolderName("my-tanstack-app"));
30
- rl.close();
31
-
32
- const dest =
33
- folderName === "./" ? process.cwd() : path.join(process.cwd(), folderName);
34
-
35
- // Check if the destination already exists
36
- if (fs.existsSync(dest)) {
37
- console.log(
38
- "āŒ Directory already exists. Please choose another name or delete the existing directory."
39
- );
40
- return;
41
- }
42
-
43
- console.log("šŸ“„ Cloning TanStack app template from GitHub...");
44
-
45
- // Clone the repository
46
- execSync(
47
- `git clone https://github.com/SH20RAJ/tanstack-start.git ${dest}`,
48
- {
49
- stdio: "inherit",
50
- }
51
- );
7
+ // Get all command-line arguments
8
+ const args = process.argv.slice(2);
52
9
 
53
- console.log("āœ… Template successfully cloned!");
10
+ console.log("šŸ“„ Running create-tsrouter-app...");
54
11
 
55
- // Install dependencies
56
- console.log("šŸ“¦ Installing dependencies...");
57
- execSync("npm install", { cwd: dest, stdio: "inherit" });
12
+ // Run create-tsrouter-app with forwarded flags
13
+ execSync(`npx create-tsrouter-app ${args.join(" ")}`, {
14
+ stdio: "inherit",
15
+ });
58
16
 
59
- console.log(`šŸŽ‰ Setup complete! Navigate to your project folder:\n`);
60
- console.log(` cd ${folderName === "./" ? "." : folderName}`);
61
- console.log(` npm run dev`);
62
- console.log("\nšŸš€ Happy coding with TanStack!");
17
+ console.log("\nšŸš€ Happy coding with TanStack Router!");
63
18
  } catch (error) {
64
19
  console.error("āŒ Error during setup:", error.message);
65
20
  }
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "create-tanstack-app",
3
- "version": "1.1.6",
3
+ "version": "1.2.2",
4
4
  "main": "index.js",
5
- "bin": "./dist/index.js",
6
- "type": "module",
5
+ "bin": {
6
+ "create-tanstack-app": "./index.js"
7
+ },
7
8
  "author": "Shaswat Raj",
8
9
  "license": "ISC",
9
10
  "description": "A CLI tool to create a Tanstack app",
@@ -12,12 +13,5 @@
12
13
  "type": "git",
13
14
  "url": "https://github.com/SH20RAJ/create-tanstack-app.git"
14
15
  },
15
- "dependencies": {
16
- "@tanstack/cta-engine": "0.12.0"
17
- },
18
- "devDependencies": {
19
- "@types/node": "^22.13.4",
20
- "typescript": "^5.6.3"
21
- },
22
- "scripts": {}
16
+ "dependencies": {}
23
17
  }
package/src/index.ts CHANGED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { cli } from '@tanstack/cta-engine'
3
-
4
- cli({
5
- name: 'create-tsrouter-app',
6
- appName: 'TanStack',
7
- })
8
- P
package/dist/index.ts DELETED
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env node
2
- import { cli } from '@tanstack/cta-engine';
3
- cli({
4
- name: 'create-tsrouter-app',
5
- appName: 'TanStack',
6
- });