create-plasmic-app 0.0.131 → 0.0.133
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/gatsby-codegen-js/package.json +4 -4
- package/cpa-out/gatsby-codegen-js/plasmic.json +7 -3
- package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicButton.jsx +11 -7
- package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +32 -8
- package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +1 -1
- package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +34 -13
- package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.jsx +2 -0
- package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicStyleTokensProvider.jsx +15 -0
- package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.jsx +1 -1
- package/cpa-out/gatsby-codegen-js/src/components/plasmic/create_plasmic_app/plasmic.jsx +11 -0
- package/cpa-out/gatsby-codegen-ts/package.json +4 -4
- package/cpa-out/gatsby-codegen-ts/plasmic.json +7 -3
- package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +17 -8
- package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +37 -9
- package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +1 -1
- package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +38 -14
- package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +7 -1
- package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicStyleTokensProvider.tsx +19 -0
- package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.tsx +1 -1
- package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/plasmic.tsx +14 -0
- package/cpa-out/gatsby-loader-js/package.json +3 -3
- package/cpa-out/gatsby-loader-ts/package.json +3 -3
- package/cpa-out/nextjs-app-loader-js/package.json +3 -3
- package/cpa-out/nextjs-app-loader-ts/package.json +3 -3
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicButton.jsx +8 -6
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +33 -7
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +1 -1
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +33 -7
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/PlasmicStyleTokensProvider.jsx +2 -10
- package/cpa-out/nextjs-pages-codegen-js/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.jsx +1 -1
- package/cpa-out/nextjs-pages-codegen-js/package.json +4 -4
- package/cpa-out/nextjs-pages-codegen-js/pages/dynamic/[slug].jsx +10 -7
- package/cpa-out/nextjs-pages-codegen-js/pages/index.jsx +10 -7
- package/cpa-out/nextjs-pages-codegen-js/plasmic.json +5 -3
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicButton.tsx +11 -7
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +37 -8
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +1 -1
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +37 -8
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +3 -1
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicStyleTokensProvider.tsx +2 -10
- package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.tsx +1 -1
- package/cpa-out/nextjs-pages-codegen-ts/package.json +4 -4
- package/cpa-out/nextjs-pages-codegen-ts/pages/dynamic/[slug].tsx +10 -7
- package/cpa-out/nextjs-pages-codegen-ts/pages/index.tsx +10 -7
- package/cpa-out/nextjs-pages-codegen-ts/plasmic.json +5 -3
- package/cpa-out/nextjs-pages-loader-js/package.json +3 -3
- package/cpa-out/nextjs-pages-loader-ts/package.json +3 -3
- package/cpa-out/react-codegen-js/eslint.config.js +1 -1
- package/cpa-out/react-codegen-js/package.json +13 -13
- package/cpa-out/react-codegen-js/plasmic.json +3 -2
- package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicButton.jsx +8 -6
- package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +29 -7
- package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +29 -7
- package/cpa-out/react-codegen-ts/eslint.config.js +1 -1
- package/cpa-out/react-codegen-ts/package.json +15 -15
- package/cpa-out/react-codegen-ts/plasmic.json +3 -2
- package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +8 -6
- package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +29 -7
- package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +29 -7
- package/cpa-out/tanstack-codegen-ts/package.json +26 -22
- package/cpa-out/tanstack-codegen-ts/plasmic.json +6 -2
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +22 -18
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +42 -19
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +1 -1
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +42 -23
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +12 -11
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicStyleTokensProvider.tsx +17 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__CheckSvg.tsx +1 -1
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/plasmic.tsx +14 -0
- package/cpa-out/tanstack-codegen-ts/src/main.tsx +23 -0
- package/cpa-out/tanstack-codegen-ts/src/routeTree.gen.ts +3 -3
- package/cpa-out/tanstack-codegen-ts/src/router.tsx +8 -8
- package/cpa-out/tanstack-codegen-ts/tsconfig.json +5 -5
- package/cpa-out/tanstack-codegen-ts/vite.config.ts +8 -9
- package/dist/utils/file-utils.js +6 -1
- package/package.json +2 -2
- package/src/utils/file-utils.ts +8 -1
- package/cpa-out/tanstack-codegen-ts/src/components/Header.tsx +0 -21
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// This code is auto-generated by Plasmic; please do not edit!
|
|
6
|
+
// Plasmic Project: 47tFXWjN2C4NyHFGGpaYQ3
|
|
7
|
+
|
|
8
|
+
import { createUseGlobalVariants } from "@plasmicapp/react-web";
|
|
9
|
+
|
|
10
|
+
import { useScreenVariants as useScreenVariantsscBjPxgdxdzbv } from "./PlasmicGlobalVariant__Screen"; // plasmic-import: SCBjPXGDXDZBV/globalVariant
|
|
11
|
+
|
|
12
|
+
export const _useGlobalVariants = createUseGlobalVariants({
|
|
13
|
+
screen: useScreenVariantsscBjPxgdxdzbv
|
|
14
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import ReactDOM from 'react-dom/client'
|
|
3
|
+
import { RouterProvider, createRouter } from '@tanstack/react-router'
|
|
4
|
+
import { routeTree } from './routeTree.gen'
|
|
5
|
+
|
|
6
|
+
const router = createRouter({
|
|
7
|
+
routeTree,
|
|
8
|
+
defaultPreload: 'intent',
|
|
9
|
+
scrollRestoration: true,
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
declare module '@tanstack/react-router' {
|
|
13
|
+
interface Register {
|
|
14
|
+
router: typeof router
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const rootElement = document.getElementById('app')!
|
|
19
|
+
|
|
20
|
+
if (!rootElement.innerHTML) {
|
|
21
|
+
const root = ReactDOM.createRoot(rootElement)
|
|
22
|
+
root.render(<RouterProvider router={router} />)
|
|
23
|
+
}
|
|
@@ -32,7 +32,7 @@ const DynamicSlugIndexRoute = DynamicSlugIndexRouteImport.update({
|
|
|
32
32
|
export interface FileRoutesByFullPath {
|
|
33
33
|
'/': typeof IndexRoute
|
|
34
34
|
'/plasmic-host': typeof PlasmicHostRoute
|
|
35
|
-
'/dynamic/$slug': typeof DynamicSlugIndexRoute
|
|
35
|
+
'/dynamic/$slug/': typeof DynamicSlugIndexRoute
|
|
36
36
|
}
|
|
37
37
|
export interface FileRoutesByTo {
|
|
38
38
|
'/': typeof IndexRoute
|
|
@@ -47,7 +47,7 @@ export interface FileRoutesById {
|
|
|
47
47
|
}
|
|
48
48
|
export interface FileRouteTypes {
|
|
49
49
|
fileRoutesByFullPath: FileRoutesByFullPath
|
|
50
|
-
fullPaths: '/' | '/plasmic-host' | '/dynamic/$slug'
|
|
50
|
+
fullPaths: '/' | '/plasmic-host' | '/dynamic/$slug/'
|
|
51
51
|
fileRoutesByTo: FileRoutesByTo
|
|
52
52
|
to: '/' | '/plasmic-host' | '/dynamic/$slug'
|
|
53
53
|
id: '__root__' | '/' | '/plasmic-host' | '/dynamic/$slug/'
|
|
@@ -78,7 +78,7 @@ declare module '@tanstack/react-router' {
|
|
|
78
78
|
'/dynamic/$slug/': {
|
|
79
79
|
id: '/dynamic/$slug/'
|
|
80
80
|
path: '/dynamic/$slug'
|
|
81
|
-
fullPath: '/dynamic/$slug'
|
|
81
|
+
fullPath: '/dynamic/$slug/'
|
|
82
82
|
preLoaderRoute: typeof DynamicSlugIndexRouteImport
|
|
83
83
|
parentRoute: typeof rootRouteImport
|
|
84
84
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { createRouter as
|
|
2
|
-
|
|
3
|
-
// Import the generated route tree
|
|
1
|
+
import { createRouter as createTanStackRouter } from '@tanstack/react-router'
|
|
4
2
|
import { routeTree } from './routeTree.gen'
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return createTanstackRouter({
|
|
4
|
+
export function getRouter() {
|
|
5
|
+
const router = createTanStackRouter({
|
|
9
6
|
routeTree,
|
|
7
|
+
|
|
10
8
|
scrollRestoration: true,
|
|
9
|
+
defaultPreload: 'intent',
|
|
11
10
|
defaultPreloadStaleTime: 0,
|
|
12
11
|
})
|
|
12
|
+
|
|
13
|
+
return router
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
// Register the router instance for type safety
|
|
16
16
|
declare module '@tanstack/react-router' {
|
|
17
17
|
interface Register {
|
|
18
|
-
router: ReturnType<typeof
|
|
18
|
+
router: ReturnType<typeof getRouter>
|
|
19
19
|
}
|
|
20
20
|
}
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
"target": "ES2022",
|
|
5
5
|
"jsx": "react-jsx",
|
|
6
6
|
"module": "ESNext",
|
|
7
|
+
"baseUrl": ".",
|
|
8
|
+
"paths": {
|
|
9
|
+
"@/*": ["./src/*"]
|
|
10
|
+
},
|
|
7
11
|
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
8
12
|
"types": ["vite/client"],
|
|
9
13
|
|
|
@@ -19,10 +23,6 @@
|
|
|
19
23
|
"noUnusedLocals": true,
|
|
20
24
|
"noUnusedParameters": true,
|
|
21
25
|
"noFallthroughCasesInSwitch": true,
|
|
22
|
-
"noUncheckedSideEffectImports": true
|
|
23
|
-
"baseUrl": ".",
|
|
24
|
-
"paths": {
|
|
25
|
-
"@/*": ["./src/*"],
|
|
26
|
-
}
|
|
26
|
+
"noUncheckedSideEffectImports": true
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { defineConfig } from 'vite'
|
|
2
|
-
import {
|
|
2
|
+
import { devtools } from '@tanstack/devtools-vite'
|
|
3
|
+
import tsconfigPaths from 'vite-tsconfig-paths'
|
|
4
|
+
|
|
5
|
+
import { tanstackRouter } from '@tanstack/router-plugin/vite'
|
|
6
|
+
|
|
3
7
|
import viteReact from '@vitejs/plugin-react'
|
|
4
|
-
import viteTsConfigPaths from 'vite-tsconfig-paths'
|
|
5
8
|
import tailwindcss from '@tailwindcss/vite'
|
|
6
9
|
|
|
7
10
|
const config = defineConfig({
|
|
@@ -15,14 +18,10 @@ const config = defineConfig({
|
|
|
15
18
|
],
|
|
16
19
|
},
|
|
17
20
|
plugins: [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
projects: ['./tsconfig.json'],
|
|
21
|
-
}),
|
|
21
|
+
devtools(),
|
|
22
|
+
tsconfigPaths({ projects: ['./tsconfig.json'] }),
|
|
22
23
|
tailwindcss(),
|
|
23
|
-
|
|
24
|
-
customViteReactPlugin: true,
|
|
25
|
-
}),
|
|
24
|
+
tanstackRouter({ target: 'react', autoCodeSplitting: true }),
|
|
26
25
|
viteReact(),
|
|
27
26
|
],
|
|
28
27
|
})
|
package/dist/utils/file-utils.js
CHANGED
|
@@ -146,12 +146,17 @@ function generateWelcomePage(config, platform) {
|
|
|
146
146
|
getPageSection: () => {
|
|
147
147
|
const pageLinks = components
|
|
148
148
|
.map((pc) => {
|
|
149
|
+
var _a;
|
|
149
150
|
// Get the relative path on the filesystem
|
|
150
151
|
const relativePath = path.relative(dir, pc.importSpec.modulePath);
|
|
151
152
|
// Format as an absolute path without the extension name
|
|
152
153
|
const relativeLink = "/" + stripExtension(relativePath);
|
|
153
154
|
if (platform === "nextjs") {
|
|
154
|
-
|
|
155
|
+
// Replace [param] with dummy values to avoid
|
|
156
|
+
// Next.js App Router error: "Dynamic href found in <Link>"
|
|
157
|
+
// https://nextjs.org/docs/messages/app-dir-dynamic-href
|
|
158
|
+
const href = ((_a = pc.path) !== null && _a !== void 0 ? _a : relativeLink).replace(/\[(\w+)\]/g, "placeholder");
|
|
159
|
+
return `<li><Link href="${href}">${pc.name} - ${pc.path}</Link></li>`;
|
|
155
160
|
}
|
|
156
161
|
else {
|
|
157
162
|
return `<li><a style={{ color: "blue" }} href="${relativeLink}">${pc.name} - ${relativeLink}</a></li>`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-plasmic-app",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.133",
|
|
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": "
|
|
50
|
+
"gitHead": "a18cd21936a28b372b3cbdd9f4a4c37b7d055eae"
|
|
51
51
|
}
|
package/src/utils/file-utils.ts
CHANGED
|
@@ -153,7 +153,14 @@ export function generateWelcomePage(
|
|
|
153
153
|
// Format as an absolute path without the extension name
|
|
154
154
|
const relativeLink = "/" + stripExtension(relativePath);
|
|
155
155
|
if (platform === "nextjs") {
|
|
156
|
-
|
|
156
|
+
// Replace [param] with dummy values to avoid
|
|
157
|
+
// Next.js App Router error: "Dynamic href found in <Link>"
|
|
158
|
+
// https://nextjs.org/docs/messages/app-dir-dynamic-href
|
|
159
|
+
const href = (pc.path ?? relativeLink).replace(
|
|
160
|
+
/\[(\w+)\]/g,
|
|
161
|
+
"placeholder"
|
|
162
|
+
);
|
|
163
|
+
return `<li><Link href="${href}">${pc.name} - ${pc.path}</Link></li>`;
|
|
157
164
|
} else {
|
|
158
165
|
return `<li><a style={{ color: "blue" }} href="${relativeLink}">${pc.name} - ${relativeLink}</a></li>`;
|
|
159
166
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Link } from '@tanstack/react-router'
|
|
2
|
-
|
|
3
|
-
export default function Header() {
|
|
4
|
-
return (
|
|
5
|
-
<header className="p-2 flex gap-2 bg-white text-black justify-between">
|
|
6
|
-
<nav className="flex flex-row">
|
|
7
|
-
<div className="px-2 font-bold">
|
|
8
|
-
<Link to="/">Home</Link>
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
<div className="px-2 font-bold">
|
|
12
|
-
<Link to="/demo/start/server-funcs">Start - Server Functions</Link>
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
<div className="px-2 font-bold">
|
|
16
|
-
<Link to="/demo/start/api-request">Start - API Request</Link>
|
|
17
|
-
</div>
|
|
18
|
-
</nav>
|
|
19
|
-
</header>
|
|
20
|
-
)
|
|
21
|
-
}
|