create-plasmic-app 0.0.64 → 0.0.65

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 (42) hide show
  1. package/cpa-out/nextjs-app-loader-js/app/[[...catchall]]/page.jsx +2 -2
  2. package/cpa-out/nextjs-app-loader-js/app/api/hello/route.js +3 -0
  3. package/cpa-out/nextjs-app-loader-js/app/layout.js +5 -5
  4. package/cpa-out/nextjs-app-loader-js/app/plasmic-host/page.jsx +1 -1
  5. package/cpa-out/nextjs-app-loader-js/package.json +4 -5
  6. package/cpa-out/nextjs-app-loader-js/plasmic-init-client.jsx +4 -4
  7. package/cpa-out/nextjs-app-loader-ts/app/[[...catchall]]/page.tsx +2 -2
  8. package/cpa-out/nextjs-app-loader-ts/app/api/hello/route.ts +3 -0
  9. package/cpa-out/nextjs-app-loader-ts/app/layout.tsx +5 -5
  10. package/cpa-out/nextjs-app-loader-ts/app/plasmic-host/page.tsx +1 -1
  11. package/cpa-out/nextjs-app-loader-ts/package.json +7 -8
  12. package/cpa-out/nextjs-app-loader-ts/plasmic-init-client.tsx +4 -4
  13. package/cpa-out/nextjs-app-loader-ts/tsconfig.json +0 -1
  14. package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +11 -0
  15. package/cpa-out/nextjs-pages-codegen-js/package.json +6 -7
  16. package/cpa-out/nextjs-pages-codegen-js/plasmic.json +2 -2
  17. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +11 -1
  18. package/cpa-out/nextjs-pages-codegen-ts/package.json +9 -10
  19. package/cpa-out/nextjs-pages-codegen-ts/plasmic.json +2 -2
  20. package/cpa-out/nextjs-pages-codegen-ts/tsconfig.json +0 -1
  21. package/cpa-out/nextjs-pages-loader-js/package.json +4 -5
  22. package/cpa-out/nextjs-pages-loader-js/pages/[[...catchall]].jsx +1 -1
  23. package/cpa-out/nextjs-pages-loader-js/pages/plasmic-host.jsx +1 -1
  24. package/cpa-out/nextjs-pages-loader-ts/package.json +7 -8
  25. package/cpa-out/nextjs-pages-loader-ts/pages/[[...catchall]].tsx +1 -1
  26. package/cpa-out/nextjs-pages-loader-ts/pages/plasmic-host.tsx +1 -1
  27. package/cpa-out/nextjs-pages-loader-ts/tsconfig.json +0 -1
  28. package/dist/nextjs/templates/app-loader/catchall-page.js +2 -2
  29. package/dist/nextjs/templates/app-loader/plasmic-host.js +1 -1
  30. package/dist/nextjs/templates/app-loader/plasmic-init-client.js +4 -4
  31. package/dist/nextjs/templates/pages-loader/catchall-page.js +1 -1
  32. package/dist/nextjs/templates/pages-loader/plasmic-host.js +1 -1
  33. package/package.json +2 -2
  34. package/src/nextjs/templates/app-loader/catchall-page.ts +2 -2
  35. package/src/nextjs/templates/app-loader/plasmic-host.ts +1 -1
  36. package/src/nextjs/templates/app-loader/plasmic-init-client.ts +4 -4
  37. package/src/nextjs/templates/pages-loader/catchall-page.ts +1 -1
  38. package/src/nextjs/templates/pages-loader/plasmic-host.ts +1 -1
  39. package/cpa-out/nextjs-app-loader-js/app/head.js +0 -10
  40. package/cpa-out/nextjs-app-loader-js/pages/api/hello.js +0 -5
  41. package/cpa-out/nextjs-app-loader-ts/app/head.tsx +0 -10
  42. package/cpa-out/nextjs-app-loader-ts/pages/api/hello.ts +0 -13
@@ -1,7 +1,7 @@
1
1
  import { PlasmicComponent } from "@plasmicapp/loader-nextjs";
2
2
  import { notFound } from "next/navigation";
3
- import { PLASMIC } from "plasmic-init";
4
- import { ClientPlasmicRootProvider } from "plasmic-init-client";
3
+ import { PLASMIC } from "@/plasmic-init";
4
+ import { ClientPlasmicRootProvider } from "@/plasmic-init-client";
5
5
 
6
6
  // Use revalidate if you want incremental static regeneration
7
7
  export const revalidate = 60;
@@ -0,0 +1,3 @@
1
+ export async function GET(request) {
2
+ return new Response('Hello, Next.js!')
3
+ }
@@ -1,13 +1,13 @@
1
1
  import './globals.css'
2
2
 
3
+ export const metadata = {
4
+ title: 'Create Next App',
5
+ description: 'Generated by create next app',
6
+ }
7
+
3
8
  export default function RootLayout({ children }) {
4
9
  return (
5
10
  <html lang="en">
6
- {/*
7
- <head /> will contain the components returned by the nearest parent
8
- head.js. Find out more at https://beta.nextjs.org/docs/api-reference/file-conventions/head
9
- */}
10
- <head />
11
11
  <body>{children}</body>
12
12
  </html>
13
13
  )
@@ -1,5 +1,5 @@
1
1
  import { PlasmicCanvasHost } from "@plasmicapp/loader-nextjs";
2
- import "plasmic-init-client";
2
+ import "@/plasmic-init-client";
3
3
 
4
4
  export default function PlasmicHost() {
5
5
  return <PlasmicCanvasHost />;
@@ -9,11 +9,10 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@next/font": "13.1.6",
13
- "@plasmicapp/loader-nextjs": "^1.0.224",
14
- "eslint": "8.33.0",
15
- "eslint-config-next": "13.1.6",
16
- "next": "13.1.6",
12
+ "@plasmicapp/loader-nextjs": "^1.0.233",
13
+ "eslint": "8.35.0",
14
+ "eslint-config-next": "13.2.3",
15
+ "next": "13.2.3",
17
16
  "react": "18.2.0",
18
17
  "react-dom": "18.2.0"
19
18
  }
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { PlasmicRootProvider } from "@plasmicapp/loader-nextjs";
4
- import { PLASMIC } from "plasmic-init";
4
+ import { PLASMIC } from "@/plasmic-init";
5
5
 
6
6
  // You can register any code components that you want to use here; see
7
7
  // https://docs.plasmic.app/learn/code-components-ref/
@@ -22,7 +22,7 @@ import { PLASMIC } from "plasmic-init";
22
22
  * In a Server Component like app/<your-path>/path.tsx, rendering the following would not work:
23
23
  *
24
24
  * ```tsx
25
- * import { PLASMIC } from "plasmic-init";
25
+ * import { PLASMIC } from "@/plasmic-init";
26
26
  * import { PlasmicRootProvider } from "plasmicapp/loader-nextjs";
27
27
  * export default function MyPage() {
28
28
  * const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
@@ -42,8 +42,8 @@ import { PLASMIC } from "plasmic-init";
42
42
  * while allowing your Server Component to pass in prefetched data and other serializable props:
43
43
  *
44
44
  * ```tsx
45
- * import { PLASMIC } from "plasmic-init";
46
- * import { ClientPlasmicRootProvider } from "plasmic-init-client"; // changed
45
+ * import { PLASMIC } from "@/plasmic-init";
46
+ * import { ClientPlasmicRootProvider } from "@/plasmic-init-client"; // changed
47
47
  * export default function MyPage() {
48
48
  * const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
49
49
  * return (
@@ -1,7 +1,7 @@
1
1
  import { PlasmicComponent } from "@plasmicapp/loader-nextjs";
2
2
  import { notFound } from "next/navigation";
3
- import { PLASMIC } from "plasmic-init";
4
- import { ClientPlasmicRootProvider } from "plasmic-init-client";
3
+ import { PLASMIC } from "@/plasmic-init";
4
+ import { ClientPlasmicRootProvider } from "@/plasmic-init-client";
5
5
 
6
6
  // Use revalidate if you want incremental static regeneration
7
7
  export const revalidate = 60;
@@ -0,0 +1,3 @@
1
+ export async function GET(request: Request) {
2
+ return new Response('Hello, Next.js!')
3
+ }
@@ -1,5 +1,10 @@
1
1
  import './globals.css'
2
2
 
3
+ export const metadata = {
4
+ title: 'Create Next App',
5
+ description: 'Generated by create next app',
6
+ }
7
+
3
8
  export default function RootLayout({
4
9
  children,
5
10
  }: {
@@ -7,11 +12,6 @@ export default function RootLayout({
7
12
  }) {
8
13
  return (
9
14
  <html lang="en">
10
- {/*
11
- <head /> will contain the components returned by the nearest parent
12
- head.tsx. Find out more at https://beta.nextjs.org/docs/api-reference/file-conventions/head
13
- */}
14
- <head />
15
15
  <body>{children}</body>
16
16
  </html>
17
17
  )
@@ -1,5 +1,5 @@
1
1
  import { PlasmicCanvasHost } from "@plasmicapp/loader-nextjs";
2
- import "plasmic-init-client";
2
+ import "@/plasmic-init-client";
3
3
 
4
4
  export default function PlasmicHost() {
5
5
  return <PlasmicCanvasHost />;
@@ -9,14 +9,13 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@next/font": "13.1.6",
13
- "@plasmicapp/loader-nextjs": "^1.0.224",
14
- "@types/node": "18.11.18",
15
- "@types/react": "18.0.27",
16
- "@types/react-dom": "18.0.10",
17
- "eslint": "8.33.0",
18
- "eslint-config-next": "13.1.6",
19
- "next": "13.1.6",
12
+ "@plasmicapp/loader-nextjs": "^1.0.233",
13
+ "@types/node": "18.14.2",
14
+ "@types/react": "18.0.28",
15
+ "@types/react-dom": "18.0.11",
16
+ "eslint": "8.35.0",
17
+ "eslint-config-next": "13.2.3",
18
+ "next": "13.2.3",
20
19
  "react": "18.2.0",
21
20
  "react-dom": "18.2.0",
22
21
  "typescript": "4.9.5"
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { PlasmicRootProvider } from "@plasmicapp/loader-nextjs";
4
- import { PLASMIC } from "plasmic-init";
4
+ import { PLASMIC } from "@/plasmic-init";
5
5
 
6
6
  // You can register any code components that you want to use here; see
7
7
  // https://docs.plasmic.app/learn/code-components-ref/
@@ -22,7 +22,7 @@ import { PLASMIC } from "plasmic-init";
22
22
  * In a Server Component like app/<your-path>/path.tsx, rendering the following would not work:
23
23
  *
24
24
  * ```tsx
25
- * import { PLASMIC } from "plasmic-init";
25
+ * import { PLASMIC } from "@/plasmic-init";
26
26
  * import { PlasmicRootProvider } from "plasmicapp/loader-nextjs";
27
27
  * export default function MyPage() {
28
28
  * const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
@@ -42,8 +42,8 @@ import { PLASMIC } from "plasmic-init";
42
42
  * while allowing your Server Component to pass in prefetched data and other serializable props:
43
43
  *
44
44
  * ```tsx
45
- * import { PLASMIC } from "plasmic-init";
46
- * import { ClientPlasmicRootProvider } from "plasmic-init-client"; // changed
45
+ * import { PLASMIC } from "@/plasmic-init";
46
+ * import { ClientPlasmicRootProvider } from "@/plasmic-init-client"; // changed
47
47
  * export default function MyPage() {
48
48
  * const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
49
49
  * return (
@@ -19,7 +19,6 @@
19
19
  "name": "next"
20
20
  }
21
21
  ],
22
- "baseUrl": ".",
23
22
  "paths": {
24
23
  "@/*": ["./*"]
25
24
  }
@@ -10,6 +10,7 @@
10
10
  // Component: 6uuAAE1jiCew
11
11
  import * as React from "react";
12
12
  import Head from "next/head";
13
+ import { useRouter } from "next/router";
13
14
  import * as p from "@plasmicapp/react-web";
14
15
  import * as ph from "@plasmicapp/host";
15
16
  import {
@@ -37,14 +38,24 @@ const __wrapUserPromise =
37
38
  return await promise;
38
39
  });
39
40
 
41
+ function useNextRouter() {
42
+ try {
43
+ return useRouter();
44
+ } catch {}
45
+ return undefined;
46
+ }
47
+
40
48
  function PlasmicHomepage__RenderFunc(props) {
41
49
  const { variants, overrides, forNode } = props;
50
+ const __nextRouter = useNextRouter();
42
51
  const $ctx = ph.useDataEnv?.() || {};
43
52
  const args = React.useMemo(() => Object.assign({}, props.args), [props.args]);
44
53
  const $props = {
45
54
  ...args,
46
55
  ...variants
47
56
  };
57
+ const refsRef = React.useRef({});
58
+ const $refs = refsRef.current;
48
59
  const currentUser = p.useCurrentUser?.() || {};
49
60
  const [$queries, setDollarQueries] = React.useState({});
50
61
  const globalVariants = ensureGlobalVariants({
@@ -9,13 +9,12 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@next/font": "13.1.6",
13
- "@plasmicapp/cli": "^0.1.205",
14
- "@plasmicapp/host": "^1.0.100",
15
- "@plasmicapp/react-web": "^0.2.150",
16
- "eslint": "8.33.0",
17
- "eslint-config-next": "13.1.6",
18
- "next": "13.1.6",
12
+ "@plasmicapp/cli": "^0.1.216",
13
+ "@plasmicapp/host": "^1.0.107",
14
+ "@plasmicapp/react-web": "^0.2.161",
15
+ "eslint": "8.35.0",
16
+ "eslint-config-next": "13.2.3",
17
+ "next": "13.2.3",
19
18
  "react": "18.2.0",
20
19
  "react-dom": "18.2.0"
21
20
  }
@@ -74,6 +74,6 @@
74
74
  "nextjsConfig": {
75
75
  "pagesDir": "../pages"
76
76
  },
77
- "cliVersion": "0.1.205",
78
- "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.205/dist/plasmic.schema.json"
77
+ "cliVersion": "0.1.216",
78
+ "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.216/dist/plasmic.schema.json"
79
79
  }
@@ -14,6 +14,7 @@ import * as React from "react";
14
14
 
15
15
  import Head from "next/head";
16
16
  import Link, { LinkProps } from "next/link";
17
+ import { useRouter } from "next/router";
17
18
 
18
19
  import * as p from "@plasmicapp/react-web";
19
20
  import * as ph from "@plasmicapp/host";
@@ -68,6 +69,13 @@ const __wrapUserPromise =
68
69
  return await promise;
69
70
  });
70
71
 
72
+ function useNextRouter() {
73
+ try {
74
+ return useRouter();
75
+ } catch {}
76
+ return undefined;
77
+ }
78
+
71
79
  function PlasmicHomepage__RenderFunc(props: {
72
80
  variants: PlasmicHomepage__VariantsArgs;
73
81
  args: PlasmicHomepage__ArgsType;
@@ -76,6 +84,7 @@ function PlasmicHomepage__RenderFunc(props: {
76
84
  forNode?: string;
77
85
  }) {
78
86
  const { variants, overrides, forNode } = props;
87
+ const __nextRouter = useNextRouter();
79
88
 
80
89
  const $ctx = ph.useDataEnv?.() || {};
81
90
  const args = React.useMemo(() => Object.assign({}, props.args), [props.args]);
@@ -84,9 +93,10 @@ function PlasmicHomepage__RenderFunc(props: {
84
93
  ...args,
85
94
  ...variants
86
95
  };
96
+ const refsRef = React.useRef({});
97
+ const $refs = refsRef.current;
87
98
 
88
99
  const currentUser = p.useCurrentUser?.() || {};
89
-
90
100
  const [$queries, setDollarQueries] = React.useState({});
91
101
 
92
102
  const globalVariants = ensureGlobalVariants({
@@ -9,16 +9,15 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@next/font": "13.1.6",
13
- "@plasmicapp/cli": "^0.1.205",
14
- "@plasmicapp/host": "^1.0.100",
15
- "@plasmicapp/react-web": "^0.2.150",
16
- "@types/node": "18.11.18",
17
- "@types/react": "18.0.27",
18
- "@types/react-dom": "18.0.10",
19
- "eslint": "8.33.0",
20
- "eslint-config-next": "13.1.6",
21
- "next": "13.1.6",
12
+ "@plasmicapp/cli": "^0.1.216",
13
+ "@plasmicapp/host": "^1.0.107",
14
+ "@plasmicapp/react-web": "^0.2.161",
15
+ "@types/node": "18.14.2",
16
+ "@types/react": "18.0.28",
17
+ "@types/react-dom": "18.0.11",
18
+ "eslint": "8.35.0",
19
+ "eslint-config-next": "13.2.3",
20
+ "next": "13.2.3",
22
21
  "react": "18.2.0",
23
22
  "react-dom": "18.2.0",
24
23
  "typescript": "4.9.5"
@@ -74,6 +74,6 @@
74
74
  "nextjsConfig": {
75
75
  "pagesDir": "../pages"
76
76
  },
77
- "cliVersion": "0.1.205",
78
- "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.205/dist/plasmic.schema.json"
77
+ "cliVersion": "0.1.216",
78
+ "$schema": "https://unpkg.com/@plasmicapp/cli@0.1.216/dist/plasmic.schema.json"
79
79
  }
@@ -14,7 +14,6 @@
14
14
  "isolatedModules": true,
15
15
  "jsx": "preserve",
16
16
  "incremental": true,
17
- "baseUrl": ".",
18
17
  "paths": {
19
18
  "@/*": ["./*"]
20
19
  }
@@ -9,11 +9,10 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@next/font": "13.1.6",
13
- "@plasmicapp/loader-nextjs": "^1.0.224",
14
- "eslint": "8.33.0",
15
- "eslint-config-next": "13.1.6",
16
- "next": "13.1.6",
12
+ "@plasmicapp/loader-nextjs": "^1.0.233",
13
+ "eslint": "8.35.0",
14
+ "eslint-config-next": "13.2.3",
15
+ "next": "13.2.3",
17
16
  "react": "18.2.0",
18
17
  "react-dom": "18.2.0"
19
18
  }
@@ -8,7 +8,7 @@ import {
8
8
 
9
9
  import Error from "next/error";
10
10
  import { useRouter } from "next/router";
11
- import { PLASMIC } from "plasmic-init";
11
+ import { PLASMIC } from "@/plasmic-init";
12
12
 
13
13
  export default function PlasmicLoaderPage(props) {
14
14
  const { plasmicData, queryCache } = props;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { PlasmicCanvasHost } from '@plasmicapp/loader-nextjs';
3
- import { PLASMIC } from 'plasmic-init';
3
+ import { PLASMIC } from '@/plasmic-init';
4
4
 
5
5
  export default function PlasmicHost() {
6
6
  return PLASMIC && <PlasmicCanvasHost />;
@@ -9,14 +9,13 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@next/font": "13.1.6",
13
- "@plasmicapp/loader-nextjs": "^1.0.224",
14
- "@types/node": "18.11.18",
15
- "@types/react": "18.0.27",
16
- "@types/react-dom": "18.0.10",
17
- "eslint": "8.33.0",
18
- "eslint-config-next": "13.1.6",
19
- "next": "13.1.6",
12
+ "@plasmicapp/loader-nextjs": "^1.0.233",
13
+ "@types/node": "18.14.2",
14
+ "@types/react": "18.0.28",
15
+ "@types/react-dom": "18.0.11",
16
+ "eslint": "8.35.0",
17
+ "eslint-config-next": "13.2.3",
18
+ "next": "13.2.3",
20
19
  "react": "18.2.0",
21
20
  "react-dom": "18.2.0",
22
21
  "typescript": "4.9.5"
@@ -9,7 +9,7 @@ import type { GetStaticPaths, GetStaticProps } from "next";
9
9
 
10
10
  import Error from "next/error";
11
11
  import { useRouter } from "next/router";
12
- import { PLASMIC } from "plasmic-init";
12
+ import { PLASMIC } from "@/plasmic-init";
13
13
 
14
14
  export default function PlasmicLoaderPage(props: {
15
15
  plasmicData?: ComponentRenderData;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { PlasmicCanvasHost } from '@plasmicapp/loader-nextjs';
3
- import { PLASMIC } from 'plasmic-init';
3
+ import { PLASMIC } from '@/plasmic-init';
4
4
 
5
5
  export default function PlasmicHost() {
6
6
  return PLASMIC && <PlasmicCanvasHost />;
@@ -14,7 +14,6 @@
14
14
  "isolatedModules": true,
15
15
  "jsx": "preserve",
16
16
  "incremental": true,
17
- "baseUrl": ".",
18
17
  "paths": {
19
18
  "@/*": ["./*"]
20
19
  }
@@ -5,8 +5,8 @@ const file_utils_1 = require("../../../utils/file-utils");
5
5
  function makeCatchallPage_app_loader(jsOrTs) {
6
6
  return `import { PlasmicComponent } from "@plasmicapp/loader-nextjs";
7
7
  import { notFound } from "next/navigation";
8
- import { PLASMIC } from "plasmic-init";
9
- import { ClientPlasmicRootProvider } from "plasmic-init-client";
8
+ import { PLASMIC } from "@/plasmic-init";
9
+ import { ClientPlasmicRootProvider } from "@/plasmic-init-client";
10
10
 
11
11
  // Use revalidate if you want incremental static regeneration
12
12
  export const revalidate = 60;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makePlasmicHostPage_app_loader = void 0;
4
4
  function makePlasmicHostPage_app_loader() {
5
5
  return `import { PlasmicCanvasHost } from "@plasmicapp/loader-nextjs";
6
- import "plasmic-init-client";
6
+ import "@/plasmic-init-client";
7
7
 
8
8
  export default function PlasmicHost() {
9
9
  return <PlasmicCanvasHost />;
@@ -6,7 +6,7 @@ function makePlasmicInitClient_app_loader(jsOrTs) {
6
6
  return `"use client";
7
7
 
8
8
  import { PlasmicRootProvider } from "@plasmicapp/loader-nextjs";
9
- import { PLASMIC } from "plasmic-init";
9
+ import { PLASMIC } from "@/plasmic-init";
10
10
 
11
11
  // You can register any code components that you want to use here; see
12
12
  // https://docs.plasmic.app/learn/code-components-ref/
@@ -27,7 +27,7 @@ import { PLASMIC } from "plasmic-init";
27
27
  * In a Server Component like app/<your-path>/path.tsx, rendering the following would not work:
28
28
  *
29
29
  * \`\`\`tsx
30
- * import { PLASMIC } from "plasmic-init";
30
+ * import { PLASMIC } from "@/plasmic-init";
31
31
  * import { PlasmicRootProvider } from "plasmicapp/loader-nextjs";
32
32
  * export default function MyPage() {
33
33
  * const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
@@ -47,8 +47,8 @@ import { PLASMIC } from "plasmic-init";
47
47
  * while allowing your Server Component to pass in prefetched data and other serializable props:
48
48
  *
49
49
  * \`\`\`tsx
50
- * import { PLASMIC } from "plasmic-init";
51
- * import { ClientPlasmicRootProvider } from "plasmic-init-client"; // changed
50
+ * import { PLASMIC } from "@/plasmic-init";
51
+ * import { ClientPlasmicRootProvider } from "@/plasmic-init-client"; // changed
52
52
  * export default function MyPage() {
53
53
  * const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
54
54
  * return (
@@ -13,7 +13,7 @@ import {
13
13
  ${(0, file_utils_1.ifTs)(jsOrTs, `import type { GetStaticPaths, GetStaticProps } from "next";\n`)}
14
14
  import Error from "next/error";
15
15
  import { useRouter } from "next/router";
16
- import { PLASMIC } from "plasmic-init";
16
+ import { PLASMIC } from "@/plasmic-init";
17
17
 
18
18
  export default function PlasmicLoaderPage(props${(0, file_utils_1.ifTs)(jsOrTs, `: {
19
19
  plasmicData?: ComponentRenderData;
@@ -4,7 +4,7 @@ exports.makePlasmicHostPage_pages_loader = void 0;
4
4
  function makePlasmicHostPage_pages_loader() {
5
5
  return `import * as React from 'react';
6
6
  import { PlasmicCanvasHost } from '@plasmicapp/loader-nextjs';
7
- import { PLASMIC } from 'plasmic-init';
7
+ import { PLASMIC } from '@/plasmic-init';
8
8
 
9
9
  export default function PlasmicHost() {
10
10
  return PLASMIC && <PlasmicCanvasHost />;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-plasmic-app",
3
- "version": "0.0.64",
3
+ "version": "0.0.65",
4
4
  "description": "Create Plasmic-powered React apps",
5
5
  "main": "./dist/lib.js",
6
6
  "types": "./dist/lib.d.ts",
@@ -55,5 +55,5 @@
55
55
  "validate-npm-package-name": "^3.0.0",
56
56
  "yargs": "^16.2.0"
57
57
  },
58
- "gitHead": "56c15e54ed33294aaef992171bbb1b3ab1aa6c3a"
58
+ "gitHead": "460d0632e4a2432cdda51630a424335adebd7742"
59
59
  }
@@ -4,8 +4,8 @@ import { JsOrTs } from "../../../utils/types";
4
4
  export function makeCatchallPage_app_loader(jsOrTs: JsOrTs): string {
5
5
  return `import { PlasmicComponent } from "@plasmicapp/loader-nextjs";
6
6
  import { notFound } from "next/navigation";
7
- import { PLASMIC } from "plasmic-init";
8
- import { ClientPlasmicRootProvider } from "plasmic-init-client";
7
+ import { PLASMIC } from "@/plasmic-init";
8
+ import { ClientPlasmicRootProvider } from "@/plasmic-init-client";
9
9
 
10
10
  // Use revalidate if you want incremental static regeneration
11
11
  export const revalidate = 60;
@@ -1,6 +1,6 @@
1
1
  export function makePlasmicHostPage_app_loader(): string {
2
2
  return `import { PlasmicCanvasHost } from "@plasmicapp/loader-nextjs";
3
- import "plasmic-init-client";
3
+ import "@/plasmic-init-client";
4
4
 
5
5
  export default function PlasmicHost() {
6
6
  return <PlasmicCanvasHost />;
@@ -5,7 +5,7 @@ export function makePlasmicInitClient_app_loader(jsOrTs: JsOrTs): string {
5
5
  return `"use client";
6
6
 
7
7
  import { PlasmicRootProvider } from "@plasmicapp/loader-nextjs";
8
- import { PLASMIC } from "plasmic-init";
8
+ import { PLASMIC } from "@/plasmic-init";
9
9
 
10
10
  // You can register any code components that you want to use here; see
11
11
  // https://docs.plasmic.app/learn/code-components-ref/
@@ -26,7 +26,7 @@ import { PLASMIC } from "plasmic-init";
26
26
  * In a Server Component like app/<your-path>/path.tsx, rendering the following would not work:
27
27
  *
28
28
  * \`\`\`tsx
29
- * import { PLASMIC } from "plasmic-init";
29
+ * import { PLASMIC } from "@/plasmic-init";
30
30
  * import { PlasmicRootProvider } from "plasmicapp/loader-nextjs";
31
31
  * export default function MyPage() {
32
32
  * const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
@@ -46,8 +46,8 @@ import { PLASMIC } from "plasmic-init";
46
46
  * while allowing your Server Component to pass in prefetched data and other serializable props:
47
47
  *
48
48
  * \`\`\`tsx
49
- * import { PLASMIC } from "plasmic-init";
50
- * import { ClientPlasmicRootProvider } from "plasmic-init-client"; // changed
49
+ * import { PLASMIC } from "@/plasmic-init";
50
+ * import { ClientPlasmicRootProvider } from "@/plasmic-init-client"; // changed
51
51
  * export default function MyPage() {
52
52
  * const prefetchedData = await PLASMIC.fetchComponentData("YourPage");
53
53
  * return (
@@ -12,7 +12,7 @@ import {
12
12
  ${ifTs(jsOrTs, `import type { GetStaticPaths, GetStaticProps } from "next";\n`)}
13
13
  import Error from "next/error";
14
14
  import { useRouter } from "next/router";
15
- import { PLASMIC } from "plasmic-init";
15
+ import { PLASMIC } from "@/plasmic-init";
16
16
 
17
17
  export default function PlasmicLoaderPage(props${ifTs(
18
18
  jsOrTs,
@@ -1,7 +1,7 @@
1
1
  export function makePlasmicHostPage_pages_loader(): string {
2
2
  return `import * as React from 'react';
3
3
  import { PlasmicCanvasHost } from '@plasmicapp/loader-nextjs';
4
- import { PLASMIC } from 'plasmic-init';
4
+ import { PLASMIC } from '@/plasmic-init';
5
5
 
6
6
  export default function PlasmicHost() {
7
7
  return PLASMIC && <PlasmicCanvasHost />;
@@ -1,10 +0,0 @@
1
- export default function Head() {
2
- return (
3
- <>
4
- <title>Create Next App</title>
5
- <meta content="width=device-width, initial-scale=1" name="viewport" />
6
- <meta name="description" content="Generated by create next app" />
7
- <link rel="icon" href="/favicon.ico" />
8
- </>
9
- )
10
- }
@@ -1,5 +0,0 @@
1
- // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2
-
3
- export default function handler(req, res) {
4
- res.status(200).json({ name: 'John Doe' })
5
- }
@@ -1,10 +0,0 @@
1
- export default function Head() {
2
- return (
3
- <>
4
- <title>Create Next App</title>
5
- <meta content="width=device-width, initial-scale=1" name="viewport" />
6
- <meta name="description" content="Generated by create next app" />
7
- <link rel="icon" href="/favicon.ico" />
8
- </>
9
- )
10
- }
@@ -1,13 +0,0 @@
1
- // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
2
- import type { NextApiRequest, NextApiResponse } from 'next'
3
-
4
- type Data = {
5
- name: string
6
- }
7
-
8
- export default function handler(
9
- req: NextApiRequest,
10
- res: NextApiResponse<Data>
11
- ) {
12
- res.status(200).json({ name: 'John Doe' })
13
- }