create-plasmic-app 0.0.60 → 0.0.62

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 CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export declare type CodeScheme = "codegen" | "loader";
2
+ export type CodeScheme = "codegen" | "loader";
package/dist/lib.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { setMetadataEnv } from "@plasmicapp/cli";
2
- export declare type PlatformType = "nextjs" | "gatsby" | "react";
3
- export declare type SchemeType = "codegen" | "loader";
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, _a;
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(), !rl_1_1.done;) {
123
- const line = rl_1_1.value;
124
- if (line.includes("plugins: []")) {
125
- result += " plugins: [" + pluginConfig + "]\n";
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
- else if (line.includes("plugins: [")) {
128
- result += line + pluginConfig + "\n";
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 (rl_1_1 && !rl_1_1.done && (_a = rl_1.return)) yield _a.call(rl_1);
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 @latest ${useTypescript ? "--ts" : "--js"} --eslint --no-src-dir --no-experimental-app --import-alias "@/*" ${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
- declare type StringGen = string | (() => string);
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.60",
3
+ "version": "0.0.62",
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": "f31e93cf3bf477d955e1103432684811cdd259a9"
57
+ "gitHead": "34763fe8abd621c6ece1dfa6fa198e18fbd18ee5"
58
58
  }
@@ -16,9 +16,9 @@ import { CPAStrategy } from "./types";
16
16
  const nextjsStrategy: CPAStrategy = {
17
17
  create: async (args) => {
18
18
  const { projectPath, template, useTypescript } = args;
19
- const createCommand = `npx create-next-app@latest ${
19
+ const createCommand = `npx @latest ${
20
20
  useTypescript ? "--ts" : "--js"
21
- } --eslint ${projectPath}`;
21
+ } --eslint --no-src-dir --no-experimental-app --import-alias "@/*" ${projectPath}`;
22
22
  const templateArg = template ? ` --template ${template}` : "";
23
23
 
24
24
  // Default Next.js starter already supports Typescript