create-plasmic-app 0.0.137 → 0.0.139

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.
Files changed (23) hide show
  1. package/cpa-out/nextjs-app-loader-js/plasmic-init.js +5 -4
  2. package/cpa-out/nextjs-app-loader-ts/plasmic-init.ts +5 -4
  3. package/cpa-out/nextjs-pages-loader-js/plasmic-init.js +6 -1
  4. package/cpa-out/nextjs-pages-loader-ts/plasmic-init.ts +6 -1
  5. package/cpa-out/react-codegen-js/package.json +1 -1
  6. package/cpa-out/react-codegen-js/src/App.jsx +4 -1
  7. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicButton.jsx +1 -0
  8. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +1 -0
  9. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +7 -2
  10. package/cpa-out/react-codegen-ts/package.json +1 -1
  11. package/cpa-out/react-codegen-ts/src/App.tsx +4 -1
  12. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +1 -0
  13. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +1 -0
  14. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +7 -2
  15. package/dist/nextjs/templates/app-loader/plasmic-init.js +5 -4
  16. package/dist/nextjs/templates/pages-loader/plasmic-init.js +6 -1
  17. package/dist/utils/file-utils.js +4 -1
  18. package/package.json +2 -2
  19. package/src/nextjs/templates/app-loader/plasmic-init.ts +5 -4
  20. package/src/nextjs/templates/pages-loader/plasmic-init.ts +6 -1
  21. package/src/utils/file-utils.ts +6 -1
  22. /package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/icons/{PlasmicIcon__Checksvg.jsx → PlasmicIcon__CheckSvg.jsx} +0 -0
  23. /package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/icons/{PlasmicIcon__Checksvg.tsx → PlasmicIcon__CheckSvg.tsx} +0 -0
@@ -1,5 +1,4 @@
1
1
  import { initPlasmicLoader } from "@plasmicapp/loader-nextjs/react-server-conditional";
2
- import * as NextNavigation from "next/navigation";
3
2
 
4
3
  export const PLASMIC = initPlasmicLoader({
5
4
  projects: [
@@ -8,13 +7,15 @@ export const PLASMIC = initPlasmicLoader({
8
7
  token: "7BRFratDxPLMGZHnd2grV5QP6mlHcZ1AK3BJSIeh7xzUlHgWh25XpgXvUaKAqHXFMXQQuzpADqboibF6nqNWQ",
9
8
  },
10
9
  ],
10
+ platformOptions: {
11
+ nextjs: {
12
+ appDir: true,
13
+ },
14
+ },
11
15
 
12
16
  // By default Plasmic will use the last published version of your project.
13
17
  // For development, you can set preview to true, which will use the unpublished
14
18
  // project, allowing you to see your designs without publishing. Please
15
19
  // only use this for development, as this is significantly slower.
16
20
  preview: false,
17
-
18
- // Needed for Next.js app router support.
19
- nextNavigation: NextNavigation,
20
21
  });
@@ -1,5 +1,4 @@
1
1
  import { initPlasmicLoader } from "@plasmicapp/loader-nextjs/react-server-conditional";
2
- import * as NextNavigation from "next/navigation";
3
2
 
4
3
  export const PLASMIC = initPlasmicLoader({
5
4
  projects: [
@@ -8,13 +7,15 @@ export const PLASMIC = initPlasmicLoader({
8
7
  token: "7BRFratDxPLMGZHnd2grV5QP6mlHcZ1AK3BJSIeh7xzUlHgWh25XpgXvUaKAqHXFMXQQuzpADqboibF6nqNWQ",
9
8
  },
10
9
  ],
10
+ platformOptions: {
11
+ nextjs: {
12
+ appDir: true,
13
+ },
14
+ },
11
15
 
12
16
  // By default Plasmic will use the last published version of your project.
13
17
  // For development, you can set preview to true, which will use the unpublished
14
18
  // project, allowing you to see your designs without publishing. Please
15
19
  // only use this for development, as this is significantly slower.
16
20
  preview: false,
17
-
18
- // Needed for Next.js app router support.
19
- nextNavigation: NextNavigation,
20
21
  });
@@ -7,7 +7,12 @@ export const PLASMIC = initPlasmicLoader({
7
7
  token: "7BRFratDxPLMGZHnd2grV5QP6mlHcZ1AK3BJSIeh7xzUlHgWh25XpgXvUaKAqHXFMXQQuzpADqboibF6nqNWQ",
8
8
  },
9
9
  ],
10
-
10
+ platformOptions: {
11
+ nextjs: {
12
+ appDir: false,
13
+ }
14
+ },
15
+
11
16
  // By default Plasmic will use the last published version of your project.
12
17
  // For development, you can set preview to true, which will use the unpublished
13
18
  // project, allowing you to see your designs without publishing. Please
@@ -7,7 +7,12 @@ export const PLASMIC = initPlasmicLoader({
7
7
  token: "7BRFratDxPLMGZHnd2grV5QP6mlHcZ1AK3BJSIeh7xzUlHgWh25XpgXvUaKAqHXFMXQQuzpADqboibF6nqNWQ",
8
8
  },
9
9
  ],
10
-
10
+ platformOptions: {
11
+ nextjs: {
12
+ appDir: false,
13
+ }
14
+ },
15
+
11
16
  // By default Plasmic will use the last published version of your project.
12
17
  // For development, you can set preview to true, which will use the unpublished
13
18
  // project, allowing you to see your designs without publishing. Please
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@plasmicapp/cli": "^0.1.359",
14
- "@plasmicapp/react-web": "^0.2.425",
14
+ "@plasmicapp/react-web": "^1.0.0",
15
15
  "react": "^18.3.1",
16
16
  "react-dom": "^18.3.1"
17
17
  },
@@ -1,9 +1,12 @@
1
1
 
2
+ import React from "react";
2
3
  import Homepage from './components/Homepage';
3
4
 
4
5
 
5
6
  function App() {
6
- return (<Homepage />);
7
+ return (
8
+ <React.Suspense><Homepage /></React.Suspense>
9
+ );
7
10
  }
8
11
 
9
12
  export default App;
@@ -135,6 +135,7 @@ function PlasmicButton__RenderFunc(props) {
135
135
  className={classNames(
136
136
  projectcss.all,
137
137
  projectcss.button,
138
+ projectcss.button__47tFX,
138
139
  projectcss.root_reset,
139
140
  projectcss.plasmic_default_styles,
140
141
  projectcss.plasmic_mixins,
@@ -101,6 +101,7 @@ function PlasmicDynamicPage__RenderFunc(props) {
101
101
  className={classNames(
102
102
  projectcss.all,
103
103
  projectcss.h1,
104
+ projectcss.h1__47tFX,
104
105
  projectcss.__wab_text,
105
106
  sty.h1
106
107
  )}
@@ -104,6 +104,7 @@ function PlasmicHomepage__RenderFunc(props) {
104
104
  className={classNames(
105
105
  projectcss.all,
106
106
  projectcss.h1,
107
+ projectcss.h1__47tFX,
107
108
  projectcss.__wab_text,
108
109
  sty.h1
109
110
  )}
@@ -127,7 +128,9 @@ function PlasmicHomepage__RenderFunc(props) {
127
128
  }
128
129
  </React.Fragment>
129
130
  <span
130
- className={"plasmic_default__all plasmic_default__span"}
131
+ className={
132
+ "plasmic_default__all plasmic_default__span plasmic_default__span__47tFX"
133
+ }
131
134
  style={{ fontWeight: 700 }}
132
135
  >
133
136
  {"Therefore, please avoid changing this project."}
@@ -141,7 +144,9 @@ function PlasmicHomepage__RenderFunc(props) {
141
144
  }
142
145
  </React.Fragment>
143
146
  <span
144
- className={"plasmic_default__all plasmic_default__span"}
147
+ className={
148
+ "plasmic_default__all plasmic_default__span plasmic_default__span__47tFX"
149
+ }
145
150
  style={{ fontWeight: 700 }}
146
151
  >
147
152
  {"Code"}
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@plasmicapp/cli": "^0.1.359",
14
- "@plasmicapp/react-web": "^0.2.425",
14
+ "@plasmicapp/react-web": "^1.0.0",
15
15
  "react": "^18.3.1",
16
16
  "react-dom": "^18.3.1"
17
17
  },
@@ -1,9 +1,12 @@
1
1
 
2
+ import React from "react";
2
3
  import Homepage from './components/Homepage';
3
4
 
4
5
 
5
6
  function App() {
6
- return (<Homepage />);
7
+ return (
8
+ <React.Suspense><Homepage /></React.Suspense>
9
+ );
7
10
  }
8
11
 
9
12
  export default App;
@@ -269,6 +269,7 @@ function PlasmicButton__RenderFunc(props: {
269
269
  className={classNames(
270
270
  projectcss.all,
271
271
  projectcss.button,
272
+ projectcss.button__47tFX,
272
273
  projectcss.root_reset,
273
274
  projectcss.plasmic_default_styles,
274
275
  projectcss.plasmic_mixins,
@@ -177,6 +177,7 @@ function PlasmicDynamicPage__RenderFunc(props: {
177
177
  className={classNames(
178
178
  projectcss.all,
179
179
  projectcss.h1,
180
+ projectcss.h1__47tFX,
180
181
  projectcss.__wab_text,
181
182
  sty.h1
182
183
  )}
@@ -181,6 +181,7 @@ function PlasmicHomepage__RenderFunc(props: {
181
181
  className={classNames(
182
182
  projectcss.all,
183
183
  projectcss.h1,
184
+ projectcss.h1__47tFX,
184
185
  projectcss.__wab_text,
185
186
  sty.h1
186
187
  )}
@@ -204,7 +205,9 @@ function PlasmicHomepage__RenderFunc(props: {
204
205
  }
205
206
  </React.Fragment>
206
207
  <span
207
- className={"plasmic_default__all plasmic_default__span"}
208
+ className={
209
+ "plasmic_default__all plasmic_default__span plasmic_default__span__47tFX"
210
+ }
208
211
  style={{ fontWeight: 700 }}
209
212
  >
210
213
  {"Therefore, please avoid changing this project."}
@@ -218,7 +221,9 @@ function PlasmicHomepage__RenderFunc(props: {
218
221
  }
219
222
  </React.Fragment>
220
223
  <span
221
- className={"plasmic_default__all plasmic_default__span"}
224
+ className={
225
+ "plasmic_default__all plasmic_default__span plasmic_default__span__47tFX"
226
+ }
222
227
  style={{ fontWeight: 700 }}
223
228
  >
224
229
  {"Code"}
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makePlasmicInit_app_loader = void 0;
4
4
  function makePlasmicInit_app_loader(projectId, projectApiToken) {
5
5
  return `import { initPlasmicLoader } from "@plasmicapp/loader-nextjs/react-server-conditional";
6
- import * as NextNavigation from "next/navigation";
7
6
 
8
7
  export const PLASMIC = initPlasmicLoader({
9
8
  projects: [
@@ -12,15 +11,17 @@ export const PLASMIC = initPlasmicLoader({
12
11
  token: "${projectApiToken}",
13
12
  },
14
13
  ],
14
+ platformOptions: {
15
+ nextjs: {
16
+ appDir: true,
17
+ },
18
+ },
15
19
 
16
20
  // By default Plasmic will use the last published version of your project.
17
21
  // For development, you can set preview to true, which will use the unpublished
18
22
  // project, allowing you to see your designs without publishing. Please
19
23
  // only use this for development, as this is significantly slower.
20
24
  preview: false,
21
-
22
- // Needed for Next.js app router support.
23
- nextNavigation: NextNavigation,
24
25
  });
25
26
  `;
26
27
  }
@@ -11,7 +11,12 @@ export const PLASMIC = initPlasmicLoader({
11
11
  token: "${projectApiToken}",
12
12
  },
13
13
  ],
14
-
14
+ platformOptions: {
15
+ nextjs: {
16
+ appDir: false,
17
+ }
18
+ },
19
+
15
20
  // By default Plasmic will use the last published version of your project.
16
21
  // For development, you can set preview to true, which will use the unpublished
17
22
  // project, allowing you to see your designs without publishing. Please
@@ -115,11 +115,14 @@ function generateHomePage(componentAbsPath, indexAbsPath, globalContextsAbsPath)
115
115
  : content;
116
116
  };
117
117
  const appjsContents = `
118
+ import React from "react";
118
119
  import ${componentName} from './${stripExtension(componentRelativePath)}';
119
120
  ${globalContextsImport}
120
121
 
121
122
  function App() {
122
- return (${maybeWrapInGlobalContexts(`<${componentName} />`)});
123
+ return (
124
+ ${maybeWrapInGlobalContexts(`<React.Suspense><${componentName} /></React.Suspense>`)}
125
+ );
123
126
  }
124
127
 
125
128
  export default App;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-plasmic-app",
3
- "version": "0.0.137",
3
+ "version": "0.0.139",
4
4
  "description": "Create Plasmic-powered React apps",
5
5
  "main": "./dist/lib.js",
6
6
  "types": "./dist/lib.d.ts",
@@ -47,5 +47,5 @@
47
47
  "validate-npm-package-name": "^3.0.0",
48
48
  "yargs": "^16.2.0"
49
49
  },
50
- "gitHead": "0f7c4954ca621261810ce9bcf074ccb86cf3f0e9"
50
+ "gitHead": "addf9e93ce8076ad8080722bbcab32d93cd2a44a"
51
51
  }
@@ -3,7 +3,6 @@ export function makePlasmicInit_app_loader(
3
3
  projectApiToken: string
4
4
  ): string {
5
5
  return `import { initPlasmicLoader } from "@plasmicapp/loader-nextjs/react-server-conditional";
6
- import * as NextNavigation from "next/navigation";
7
6
 
8
7
  export const PLASMIC = initPlasmicLoader({
9
8
  projects: [
@@ -12,15 +11,17 @@ export const PLASMIC = initPlasmicLoader({
12
11
  token: "${projectApiToken}",
13
12
  },
14
13
  ],
14
+ platformOptions: {
15
+ nextjs: {
16
+ appDir: true,
17
+ },
18
+ },
15
19
 
16
20
  // By default Plasmic will use the last published version of your project.
17
21
  // For development, you can set preview to true, which will use the unpublished
18
22
  // project, allowing you to see your designs without publishing. Please
19
23
  // only use this for development, as this is significantly slower.
20
24
  preview: false,
21
-
22
- // Needed for Next.js app router support.
23
- nextNavigation: NextNavigation,
24
25
  });
25
26
  `;
26
27
  }
@@ -11,7 +11,12 @@ export const PLASMIC = initPlasmicLoader({
11
11
  token: "${projectApiToken}",
12
12
  },
13
13
  ],
14
-
14
+ platformOptions: {
15
+ nextjs: {
16
+ appDir: false,
17
+ }
18
+ },
19
+
15
20
  // By default Plasmic will use the last published version of your project.
16
21
  // For development, you can set preview to true, which will use the unpublished
17
22
  // project, allowing you to see your designs without publishing. Please
@@ -106,11 +106,16 @@ export function generateHomePage(
106
106
  };
107
107
 
108
108
  const appjsContents = `
109
+ import React from "react";
109
110
  import ${componentName} from './${stripExtension(componentRelativePath)}';
110
111
  ${globalContextsImport}
111
112
 
112
113
  function App() {
113
- return (${maybeWrapInGlobalContexts(`<${componentName} />`)});
114
+ return (
115
+ ${maybeWrapInGlobalContexts(
116
+ `<React.Suspense><${componentName} /></React.Suspense>`
117
+ )}
118
+ );
114
119
  }
115
120
 
116
121
  export default App;