create-plasmic-app 0.0.92 → 0.0.93
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/cpa-out/nextjs-app-loader-js/pages/[[...catchall]].jsx +68 -0
- package/cpa-out/nextjs-app-loader-js/pages/api/hello.js +5 -0
- package/cpa-out/nextjs-app-loader-js/pages/plasmic-host.jsx +7 -0
- package/cpa-out/nextjs-app-loader-ts/pages/[[...catchall]].tsx +72 -0
- package/cpa-out/nextjs-app-loader-ts/pages/api/hello.ts +13 -0
- package/cpa-out/nextjs-app-loader-ts/pages/plasmic-host.tsx +7 -0
- package/cpa-out/nextjs-pages-codegen-js/components/Button.jsx +1 -3
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicButton.jsx +50 -98
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +36 -30
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +2 -14
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +25 -25
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.jsx +45 -59
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.jsx +2 -2
- package/cpa-out/nextjs-pages-codegen-js/package.json +9 -7
- package/cpa-out/nextjs-pages-codegen-js/pages/api/hello.js +1 -1
- package/cpa-out/nextjs-pages-codegen-js/pages/dynamic/[slug].jsx +4 -3
- package/cpa-out/nextjs-pages-codegen-js/pages/index.jsx +4 -3
- package/cpa-out/nextjs-pages-codegen-js/plasmic.json +14 -8
- package/cpa-out/nextjs-pages-codegen-ts/components/Button.tsx +4 -5
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicButton.tsx +86 -65
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +74 -43
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +2 -14
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +63 -37
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +84 -71
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.tsx +3 -3
- package/cpa-out/nextjs-pages-codegen-ts/package.json +13 -11
- package/cpa-out/nextjs-pages-codegen-ts/pages/api/hello.ts +5 -5
- package/cpa-out/nextjs-pages-codegen-ts/pages/dynamic/[slug].tsx +4 -4
- package/cpa-out/nextjs-pages-codegen-ts/pages/index.tsx +4 -4
- package/cpa-out/nextjs-pages-codegen-ts/plasmic.json +14 -8
- package/cpa-out/nextjs-pages-codegen-ts/tsconfig.json +1 -3
- package/cpa-out/nextjs-pages-loader-js/package.json +8 -6
- package/cpa-out/nextjs-pages-loader-js/pages/[[...catchall]].jsx +2 -0
- package/cpa-out/nextjs-pages-loader-js/pages/api/hello.js +1 -1
- package/cpa-out/nextjs-pages-loader-ts/package.json +12 -10
- package/cpa-out/nextjs-pages-loader-ts/pages/[[...catchall]].tsx +2 -0
- package/cpa-out/nextjs-pages-loader-ts/pages/api/hello.ts +5 -5
- package/cpa-out/nextjs-pages-loader-ts/tsconfig.json +1 -3
- package/dist/nextjs/nextjs.js +5 -23
- package/dist/nextjs/templates/pages-loader/catchall-page.js +1 -1
- package/package.json +2 -2
- package/src/nextjs/nextjs.ts +5 -24
- package/src/nextjs/templates/pages-loader/catchall-page.ts +1 -1
- package/.tool-versions +0 -1
|
@@ -9,15 +9,17 @@
|
|
|
9
9
|
"lint": "next lint"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@plasmicapp/loader-nextjs": "^1.0.
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
"react": "18
|
|
20
|
-
"react-dom": "18
|
|
21
|
-
"
|
|
12
|
+
"@plasmicapp/loader-nextjs": "^1.0.406",
|
|
13
|
+
"next": "14.2.15",
|
|
14
|
+
"react": "^18",
|
|
15
|
+
"react-dom": "^18"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/node": "^20",
|
|
19
|
+
"@types/react": "^18",
|
|
20
|
+
"@types/react-dom": "^18",
|
|
21
|
+
"eslint": "^8",
|
|
22
|
+
"eslint-config-next": "14.2.15",
|
|
23
|
+
"typescript": "^5"
|
|
22
24
|
}
|
|
23
25
|
}
|
|
@@ -26,6 +26,7 @@ export default function PlasmicLoaderPage(props: {
|
|
|
26
26
|
loader={PLASMIC}
|
|
27
27
|
prefetchedData={plasmicData}
|
|
28
28
|
prefetchedQueryData={queryCache}
|
|
29
|
+
pageRoute={pageMeta.path}
|
|
29
30
|
pageParams={pageMeta.params}
|
|
30
31
|
pageQuery={router.query}
|
|
31
32
|
>
|
|
@@ -48,6 +49,7 @@ export const getStaticProps: GetStaticProps = async (context) => {
|
|
|
48
49
|
<PlasmicRootProvider
|
|
49
50
|
loader={PLASMIC}
|
|
50
51
|
prefetchedData={plasmicData}
|
|
52
|
+
pageRoute={pageMeta.path}
|
|
51
53
|
pageParams={pageMeta.params}
|
|
52
54
|
>
|
|
53
55
|
<PlasmicComponent component={pageMeta.displayName} />
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
|
|
2
|
-
import type { NextApiRequest, NextApiResponse } from
|
|
2
|
+
import type { NextApiRequest, NextApiResponse } from "next";
|
|
3
3
|
|
|
4
4
|
type Data = {
|
|
5
|
-
name: string
|
|
6
|
-
}
|
|
5
|
+
name: string;
|
|
6
|
+
};
|
|
7
7
|
|
|
8
8
|
export default function handler(
|
|
9
9
|
req: NextApiRequest,
|
|
10
|
-
res: NextApiResponse<Data
|
|
10
|
+
res: NextApiResponse<Data>,
|
|
11
11
|
) {
|
|
12
|
-
res.status(200).json({ name:
|
|
12
|
+
res.status(200).json({ name: "John Doe" });
|
|
13
13
|
}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "es5",
|
|
4
3
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
4
|
"allowJs": true,
|
|
6
5
|
"skipLibCheck": true,
|
|
7
6
|
"strict": true,
|
|
8
|
-
"forceConsistentCasingInFileNames": true,
|
|
9
7
|
"noEmit": true,
|
|
10
8
|
"esModuleInterop": true,
|
|
11
9
|
"module": "esnext",
|
|
12
|
-
"moduleResolution": "
|
|
10
|
+
"moduleResolution": "bundler",
|
|
13
11
|
"resolveJsonModule": true,
|
|
14
12
|
"isolatedModules": true,
|
|
15
13
|
"jsx": "preserve",
|
package/dist/nextjs/nextjs.js
CHANGED
|
@@ -56,15 +56,8 @@ exports.nextjsStrategy = {
|
|
|
56
56
|
}
|
|
57
57
|
}),
|
|
58
58
|
overwriteConfig: (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
const nextjsConfigFile = path_1.default.join(projectPath, "next.config.js");
|
|
62
|
-
const appDirOption = ((_b = platformOptions.nextjs) === null || _b === void 0 ? void 0 : _b.appDir)
|
|
63
|
-
? `
|
|
64
|
-
experimental: {
|
|
65
|
-
appDir: true,
|
|
66
|
-
}`
|
|
67
|
-
: "";
|
|
59
|
+
const { projectPath, scheme } = args;
|
|
60
|
+
const nextjsConfigFile = path_1.default.join(projectPath, "next.config.mjs");
|
|
68
61
|
if (scheme === "codegen") {
|
|
69
62
|
yield fs_1.promises.writeFile(nextjsConfigFile, `
|
|
70
63
|
/** @type {import('next').NextConfig} */
|
|
@@ -72,22 +65,11 @@ const nextConfig = {
|
|
|
72
65
|
eslint: {
|
|
73
66
|
ignoreDuringBuilds: true,
|
|
74
67
|
},
|
|
75
|
-
trailingSlash: true
|
|
68
|
+
trailingSlash: true,
|
|
69
|
+
reactStrictMode: true,
|
|
76
70
|
};
|
|
77
71
|
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
yield fs_1.promises.writeFile(nextjsConfigFile, `
|
|
82
|
-
/** @type {import('next').NextConfig} */
|
|
83
|
-
const nextConfig = {
|
|
84
|
-
// Turn off React StrictMode for now, as react-aria (used by Plasmic)
|
|
85
|
-
// has some troubles with it. See
|
|
86
|
-
// https://github.com/adobe/react-spectrum/labels/strict%20mode
|
|
87
|
-
reactStrictMode: false,${appDirOption}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
module.exports = nextConfig;`);
|
|
72
|
+
export default nextConfig;`);
|
|
91
73
|
}
|
|
92
74
|
}),
|
|
93
75
|
generateFiles: (args) => {
|
|
@@ -17,7 +17,7 @@ import { PLASMIC } from "@/plasmic-init";
|
|
|
17
17
|
|
|
18
18
|
export default function PlasmicLoaderPage(props${(0, file_utils_1.ifTs)(jsOrTs, `: {
|
|
19
19
|
plasmicData?: ComponentRenderData;
|
|
20
|
-
queryCache?: Record<string,
|
|
20
|
+
queryCache?: Record<string, unknown>;
|
|
21
21
|
}`)}) {
|
|
22
22
|
const { plasmicData, queryCache } = props;
|
|
23
23
|
const router = useRouter();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-plasmic-app",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.93",
|
|
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": "e3e7a87846f4aafc0dbf7db2d7fa4aef81534835"
|
|
58
58
|
}
|
package/src/nextjs/nextjs.ts
CHANGED
|
@@ -47,14 +47,8 @@ export const nextjsStrategy: CPAStrategy = {
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
overwriteConfig: async (args) => {
|
|
50
|
-
const { projectPath, scheme
|
|
51
|
-
const nextjsConfigFile = path.join(projectPath, "next.config.
|
|
52
|
-
const appDirOption = platformOptions.nextjs?.appDir
|
|
53
|
-
? `
|
|
54
|
-
experimental: {
|
|
55
|
-
appDir: true,
|
|
56
|
-
}`
|
|
57
|
-
: "";
|
|
50
|
+
const { projectPath, scheme } = args;
|
|
51
|
+
const nextjsConfigFile = path.join(projectPath, "next.config.mjs");
|
|
58
52
|
if (scheme === "codegen") {
|
|
59
53
|
await fs.writeFile(
|
|
60
54
|
nextjsConfigFile,
|
|
@@ -64,24 +58,11 @@ const nextConfig = {
|
|
|
64
58
|
eslint: {
|
|
65
59
|
ignoreDuringBuilds: true,
|
|
66
60
|
},
|
|
67
|
-
trailingSlash: true
|
|
61
|
+
trailingSlash: true,
|
|
62
|
+
reactStrictMode: true,
|
|
68
63
|
};
|
|
69
64
|
|
|
70
|
-
|
|
71
|
-
);
|
|
72
|
-
} else {
|
|
73
|
-
await fs.writeFile(
|
|
74
|
-
nextjsConfigFile,
|
|
75
|
-
`
|
|
76
|
-
/** @type {import('next').NextConfig} */
|
|
77
|
-
const nextConfig = {
|
|
78
|
-
// Turn off React StrictMode for now, as react-aria (used by Plasmic)
|
|
79
|
-
// has some troubles with it. See
|
|
80
|
-
// https://github.com/adobe/react-spectrum/labels/strict%20mode
|
|
81
|
-
reactStrictMode: false,${appDirOption}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
module.exports = nextConfig;`
|
|
65
|
+
export default nextConfig;`
|
|
85
66
|
);
|
|
86
67
|
}
|
|
87
68
|
},
|
package/.tool-versions
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
nodejs 18.10.0
|