create-plasmic-app 0.0.51 → 0.0.53

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/lib.js CHANGED
@@ -84,10 +84,10 @@ function create(args) {
84
84
  useTypescript,
85
85
  template,
86
86
  });
87
- // Ensure that we have a empty tsconfig and @types packages
88
- // Gatsby by default supports typescript handling internally
89
- // tsconfig so we don't have to ensure it
90
- if (useTypescript && platform !== "gatsby") {
87
+ // Ensure that we have a empty tsconfig and @types packages.
88
+ // Gatsby and Next.js by default support typescript handling internally
89
+ // tsconfig so we don't have to ensure it.
90
+ if (useTypescript && platform === "react") {
91
91
  yield file_utils_1.ensureTsconfig(resolvedProjectPath);
92
92
  }
93
93
  // Make sure we have an api token for loader
@@ -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 -p create-next-app create-next-app ${useTypescript ? "--typescript" : ""} ${projectPath}`;
26
+ const createCommand = `npx create-next-app@latest ${useTypescript ? "--ts" : "--js"} --eslint ${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
@@ -57,7 +57,7 @@ module.exports = {
57
57
  yield fs_1.promises.writeFile(nextjsConfigFile, `
58
58
  /** @type {import('next').NextConfig} */
59
59
  const nextConfig = {
60
- // Turn off React StrictMode for now, as react-aria (used by Plasmic)
60
+ // Turn off React StrictMode for now, as react-aria (used by Plasmic)
61
61
  // has some troubles with it. See
62
62
  // https://github.com/adobe/react-spectrum/labels/strict%20mode
63
63
  reactStrictMode: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-plasmic-app",
3
- "version": "0.0.51",
3
+ "version": "0.0.53",
4
4
  "description": "Create Plasmic-powered React apps",
5
5
  "main": "./dist/lib.js",
6
6
  "types": "./dist/lib.d.ts",
package/src/lib.ts CHANGED
@@ -77,10 +77,10 @@ export async function create(args: CreatePlasmicAppArgs): Promise<void> {
77
77
  template,
78
78
  });
79
79
 
80
- // Ensure that we have a empty tsconfig and @types packages
81
- // Gatsby by default supports typescript handling internally
82
- // tsconfig so we don't have to ensure it
83
- if (useTypescript && platform !== "gatsby") {
80
+ // Ensure that we have a empty tsconfig and @types packages.
81
+ // Gatsby and Next.js by default support typescript handling internally
82
+ // tsconfig so we don't have to ensure it.
83
+ if (useTypescript && platform === "react") {
84
84
  await ensureTsconfig(resolvedProjectPath);
85
85
  }
86
86
 
@@ -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 -p create-next-app create-next-app ${
20
- useTypescript ? "--typescript" : ""
21
- } ${projectPath}`;
19
+ const createCommand = `npx create-next-app@latest ${
20
+ useTypescript ? "--ts" : "--js"
21
+ } --eslint ${projectPath}`;
22
22
  const templateArg = template ? ` --template ${template}` : "";
23
23
 
24
24
  // Default Next.js starter already supports Typescript
@@ -52,11 +52,11 @@ module.exports = {
52
52
  );
53
53
  } else {
54
54
  await fs.writeFile(
55
- nextjsConfigFile,
55
+ nextjsConfigFile,
56
56
  `
57
57
  /** @type {import('next').NextConfig} */
58
58
  const nextConfig = {
59
- // Turn off React StrictMode for now, as react-aria (used by Plasmic)
59
+ // Turn off React StrictMode for now, as react-aria (used by Plasmic)
60
60
  // has some troubles with it. See
61
61
  // https://github.com/adobe/react-spectrum/labels/strict%20mode
62
62
  reactStrictMode: false,
@@ -64,7 +64,7 @@ const nextConfig = {
64
64
 
65
65
  module.exports = nextConfig
66
66
  `
67
- )
67
+ );
68
68
  }
69
69
  },
70
70
  generateFiles: async (args) => {