create-plasmic-app 0.0.101 → 0.0.102
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/dist/tanstack/tanstack.js +15 -1
- package/package.json +2 -2
- package/src/tanstack/tanstack.ts +19 -1
|
@@ -24,7 +24,21 @@ const root_1 = require("./templates/file-router/root");
|
|
|
24
24
|
exports.tanstackStrategy = {
|
|
25
25
|
create: (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
26
|
const { projectPath } = args;
|
|
27
|
-
|
|
27
|
+
/* create-tsrouter-app package receives the projectName as an argument, when we provide a fullProjectPath, it creates
|
|
28
|
+
package.json with name having the fullProjectPath causing illegal characters in the name field error.
|
|
29
|
+
|
|
30
|
+
To avoid this behaviour, we will ensure the fullProjectPath exists
|
|
31
|
+
1. we get the projectName (tanstack-codegen-ts), and parentDir (/private/tmp/cpa-out)
|
|
32
|
+
2. change directory to parentDir and execute the command with projectName
|
|
33
|
+
*/
|
|
34
|
+
const fullProjectPath = path_1.default.isAbsolute(projectPath)
|
|
35
|
+
? projectPath
|
|
36
|
+
: path_1.default.resolve(process.cwd(), projectPath);
|
|
37
|
+
yield fs_1.promises.mkdir(fullProjectPath, { recursive: true });
|
|
38
|
+
const projectName = path_1.default.basename(fullProjectPath);
|
|
39
|
+
const parentDir = path_1.default.dirname(fullProjectPath);
|
|
40
|
+
process.chdir(parentDir);
|
|
41
|
+
const createCommand = `npx create-tsrouter-app@latest ${projectName} --template file-router --add-ons start`;
|
|
28
42
|
yield (0, cmd_utils_1.spawnOrFail)(createCommand);
|
|
29
43
|
}),
|
|
30
44
|
installDeps: ({ scheme, projectPath }) => __awaiter(void 0, void 0, void 0, function* () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-plasmic-app",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.102",
|
|
4
4
|
"description": "Create Plasmic-powered React apps",
|
|
5
5
|
"main": "./dist/lib.js",
|
|
6
6
|
"types": "./dist/lib.d.ts",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"validate-npm-package-name": "^3.0.0",
|
|
47
47
|
"yargs": "^16.2.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "d4a7bb5ccb1aa9e35db3b4c751a2473c001e1ad0"
|
|
50
50
|
}
|
package/src/tanstack/tanstack.ts
CHANGED
|
@@ -11,7 +11,25 @@ import { makeCustomRoot_file_router_codegen } from "./templates/file-router/root
|
|
|
11
11
|
export const tanstackStrategy: CPAStrategy = {
|
|
12
12
|
create: async (args) => {
|
|
13
13
|
const { projectPath } = args;
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
/* create-tsrouter-app package receives the projectName as an argument, when we provide a fullProjectPath, it creates
|
|
16
|
+
package.json with name having the fullProjectPath causing illegal characters in the name field error.
|
|
17
|
+
|
|
18
|
+
To avoid this behaviour, we will ensure the fullProjectPath exists
|
|
19
|
+
1. we get the projectName (tanstack-codegen-ts), and parentDir (/private/tmp/cpa-out)
|
|
20
|
+
2. change directory to parentDir and execute the command with projectName
|
|
21
|
+
*/
|
|
22
|
+
const fullProjectPath = path.isAbsolute(projectPath)
|
|
23
|
+
? projectPath
|
|
24
|
+
: path.resolve(process.cwd(), projectPath);
|
|
25
|
+
|
|
26
|
+
await fs.mkdir(fullProjectPath, { recursive: true });
|
|
27
|
+
|
|
28
|
+
const projectName = path.basename(fullProjectPath);
|
|
29
|
+
const parentDir = path.dirname(fullProjectPath);
|
|
30
|
+
process.chdir(parentDir);
|
|
31
|
+
|
|
32
|
+
const createCommand = `npx create-tsrouter-app@latest ${projectName} --template file-router --add-ons start`;
|
|
15
33
|
|
|
16
34
|
await spawnOrFail(createCommand);
|
|
17
35
|
},
|