create-plasmic-app 0.0.103 → 0.0.104
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/react/react.js +10 -12
- package/package.json +2 -2
- package/src/react/react.ts +14 -18
package/dist/react/react.js
CHANGED
|
@@ -61,18 +61,16 @@ exports.reactStrategy = {
|
|
|
61
61
|
overwriteConfig: (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
62
|
const { projectPath, jsOrTs } = args;
|
|
63
63
|
if (jsOrTs === "ts") {
|
|
64
|
-
const
|
|
65
|
-
let
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
tsConfig.compilerOptions = Object.assign(Object.assign({}, tsConfig.compilerOptions), { noUnusedLocals: false });
|
|
75
|
-
yield fs_1.promises.writeFile(tsConfigJsonPath, JSON.stringify(tsConfig, null, 2));
|
|
64
|
+
const tsconfigPath = path_1.default.join(projectPath, "tsconfig.app.json");
|
|
65
|
+
let tsconfigContent = yield fs_1.promises.readFile(tsconfigPath, "utf8");
|
|
66
|
+
tsconfigContent = tsconfigContent
|
|
67
|
+
// Disable verbatimModuleSyntax
|
|
68
|
+
.replace(`"verbatimModuleSyntax": true`, `"verbatimModuleSyntax": false`)
|
|
69
|
+
/* In our codegen, we have components where React is imported but not used, we need to
|
|
70
|
+
turn off the `noUnusedLocals` rule to ensure the project builds successfully.
|
|
71
|
+
*/
|
|
72
|
+
.replace(`"noUnusedLocals": true`, `"noUnusedLocals": false`);
|
|
73
|
+
yield fs_1.promises.writeFile(tsconfigPath, tsconfigContent);
|
|
76
74
|
}
|
|
77
75
|
}),
|
|
78
76
|
generateFiles: ({ scheme, projectApiToken, projectId, projectPath, jsOrTs, }) => __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.104",
|
|
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": "c3c2b6066619e1581b3bbf22aa3de1acb58d7d33"
|
|
50
50
|
}
|
package/src/react/react.ts
CHANGED
|
@@ -59,24 +59,20 @@ export const reactStrategy: CPAStrategy = {
|
|
|
59
59
|
const { projectPath, jsOrTs } = args;
|
|
60
60
|
|
|
61
61
|
if (jsOrTs === "ts") {
|
|
62
|
-
const
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
noUnusedLocals: false,
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
await fs.writeFile(tsConfigJsonPath, JSON.stringify(tsConfig, null, 2));
|
|
62
|
+
const tsconfigPath = path.join(projectPath, "tsconfig.app.json");
|
|
63
|
+
let tsconfigContent = await fs.readFile(tsconfigPath, "utf8");
|
|
64
|
+
tsconfigContent = tsconfigContent
|
|
65
|
+
// Disable verbatimModuleSyntax
|
|
66
|
+
.replace(
|
|
67
|
+
`"verbatimModuleSyntax": true`,
|
|
68
|
+
`"verbatimModuleSyntax": false`
|
|
69
|
+
)
|
|
70
|
+
/* In our codegen, we have components where React is imported but not used, we need to
|
|
71
|
+
turn off the `noUnusedLocals` rule to ensure the project builds successfully.
|
|
72
|
+
*/
|
|
73
|
+
.replace(`"noUnusedLocals": true`, `"noUnusedLocals": false`);
|
|
74
|
+
|
|
75
|
+
await fs.writeFile(tsconfigPath, tsconfigContent);
|
|
80
76
|
}
|
|
81
77
|
},
|
|
82
78
|
generateFiles: async ({
|