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 +8 -53
- package/package.json +5 -11
- package/src/index.ts +0 -8
- package/dist/index.ts +0 -6
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
|
|
28
|
-
const
|
|
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("
|
|
10
|
+
console.log("š„ Running create-tsrouter-app...");
|
|
54
11
|
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
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(
|
|
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.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"main": "index.js",
|
|
5
|
-
"bin":
|
|
6
|
-
|
|
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