create-plasmic-app 0.0.59 → 0.0.61
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib.d.ts +2 -2
- package/dist/strategies/gatsby.js +18 -11
- package/dist/strategies/nextjs.js +1 -1
- package/dist/utils/lang-utils.d.ts +1 -1
- package/package.json +2 -2
- package/src/index.ts +1 -1
- package/src/strategies/nextjs.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export
|
|
2
|
+
export type CodeScheme = "codegen" | "loader";
|
package/dist/index.js
CHANGED
|
@@ -210,7 +210,7 @@ function run() {
|
|
|
210
210
|
What is the URL of your project?`,
|
|
211
211
|
}, firstPrompt);
|
|
212
212
|
firstPrompt = false; // avoid infinite loop with an invalid CLI answer
|
|
213
|
-
const matchUrl = rawProjectId.match(/studio\.plasmic\.app\/projects\/([a-z0-9]{5,})
|
|
213
|
+
const matchUrl = rawProjectId.match(/studio\.plasmic\.app\/projects\/([a-z0-9]{5,})(\/|$)/i);
|
|
214
214
|
if (matchUrl) {
|
|
215
215
|
projectId = matchUrl[1];
|
|
216
216
|
continue;
|
package/dist/lib.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { setMetadataEnv } from "@plasmicapp/cli";
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export type PlatformType = "nextjs" | "gatsby" | "react";
|
|
3
|
+
export type SchemeType = "codegen" | "loader";
|
|
4
4
|
export declare function toString(s: PlatformType): string;
|
|
5
5
|
export interface CreatePlasmicAppArgs {
|
|
6
6
|
resolvedProjectPath: string;
|
|
@@ -94,7 +94,7 @@ const gatsbyStrategy = {
|
|
|
94
94
|
}
|
|
95
95
|
}),
|
|
96
96
|
overwriteConfig: (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
|
-
var e_1,
|
|
97
|
+
var _a, e_1, _b, _c;
|
|
98
98
|
const { projectId, projectPath, projectApiToken, useTypescript, scheme, } = args;
|
|
99
99
|
const extension = useTypescript ? "ts" : "js";
|
|
100
100
|
const packageName = path_1.default.basename(projectPath);
|
|
@@ -119,23 +119,30 @@ const gatsbyStrategy = {
|
|
|
119
119
|
let result = useTypescript ? `import path from "path";\n` : "";
|
|
120
120
|
const pluginConfig = (0, gatsby_1.GATSBY_PLUGIN_CONFIG)(projectId, (0, lang_utils_1.ensure)(projectApiToken), useTypescript);
|
|
121
121
|
try {
|
|
122
|
-
for (var rl_1 = __asyncValues(rl), rl_1_1; rl_1_1 = yield rl_1.next(),
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
for (var _d = true, rl_1 = __asyncValues(rl), rl_1_1; rl_1_1 = yield rl_1.next(), _a = rl_1_1.done, !_a;) {
|
|
123
|
+
_c = rl_1_1.value;
|
|
124
|
+
_d = false;
|
|
125
|
+
try {
|
|
126
|
+
const line = _c;
|
|
127
|
+
if (line.includes("plugins: []")) {
|
|
128
|
+
result += " plugins: [" + pluginConfig + "]\n";
|
|
129
|
+
}
|
|
130
|
+
else if (line.includes("plugins: [")) {
|
|
131
|
+
result += line + pluginConfig + "\n";
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
result += line + "\n";
|
|
135
|
+
}
|
|
126
136
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
result += line + "\n";
|
|
137
|
+
finally {
|
|
138
|
+
_d = true;
|
|
132
139
|
}
|
|
133
140
|
}
|
|
134
141
|
}
|
|
135
142
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
136
143
|
finally {
|
|
137
144
|
try {
|
|
138
|
-
if (
|
|
145
|
+
if (!_d && !_a && (_b = rl_1.return)) yield _b.call(rl_1);
|
|
139
146
|
}
|
|
140
147
|
finally { if (e_1) throw e_1.error; }
|
|
141
148
|
}
|
|
@@ -23,7 +23,7 @@ const common_1 = require("./common");
|
|
|
23
23
|
const nextjsStrategy = {
|
|
24
24
|
create: (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
25
25
|
const { projectPath, template, useTypescript } = args;
|
|
26
|
-
const createCommand = `npx create-next-app@latest ${useTypescript ? "--ts" : "--js"} --eslint ${projectPath}`;
|
|
26
|
+
const createCommand = `npx create-next-app@latest ${useTypescript ? "--ts" : "--js"} --eslint --no-src-dir --no-experimental-app ${projectPath}`;
|
|
27
27
|
const templateArg = template ? ` --template ${template}` : "";
|
|
28
28
|
// Default Next.js starter already supports Typescript
|
|
29
29
|
// See where we `touch tsconfig.json` later on
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type StringGen = string | (() => string);
|
|
2
2
|
export declare function flatMap<T, U>(arr: T[], f: (x: T) => U[]): U[];
|
|
3
3
|
export declare function ensure<T>(x: T | null | undefined, msg?: StringGen): T;
|
|
4
4
|
export declare function ensureString(x: any): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-plasmic-app",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.61",
|
|
4
4
|
"description": "Create Plasmic-powered React apps",
|
|
5
5
|
"main": "./dist/lib.js",
|
|
6
6
|
"types": "./dist/lib.d.ts",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"validate-npm-package-name": "^3.0.0",
|
|
55
55
|
"yargs": "^16.2.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "450ed61be16d7970f33c4405aa3e19fa3026a9b0"
|
|
58
58
|
}
|
package/src/index.ts
CHANGED
|
@@ -200,7 +200,7 @@ What is the URL of your project?`,
|
|
|
200
200
|
firstPrompt = false; // avoid infinite loop with an invalid CLI answer
|
|
201
201
|
|
|
202
202
|
const matchUrl = rawProjectId.match(
|
|
203
|
-
/studio\.plasmic\.app\/projects\/([a-z0-9]{5,})
|
|
203
|
+
/studio\.plasmic\.app\/projects\/([a-z0-9]{5,})(\/|$)/i
|
|
204
204
|
);
|
|
205
205
|
if (matchUrl) {
|
|
206
206
|
projectId = matchUrl[1];
|
package/src/strategies/nextjs.ts
CHANGED
|
@@ -18,7 +18,7 @@ const nextjsStrategy: CPAStrategy = {
|
|
|
18
18
|
const { projectPath, template, useTypescript } = args;
|
|
19
19
|
const createCommand = `npx create-next-app@latest ${
|
|
20
20
|
useTypescript ? "--ts" : "--js"
|
|
21
|
-
} --eslint ${projectPath}`;
|
|
21
|
+
} --eslint --no-src-dir --no-experimental-app ${projectPath}`;
|
|
22
22
|
const templateArg = template ? ` --template ${template}` : "";
|
|
23
23
|
|
|
24
24
|
// Default Next.js starter already supports Typescript
|