create-plasmic-app 0.0.110 → 0.0.111
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/tanstack-codegen-ts/package.json +8 -11
- package/cpa-out/tanstack-codegen-ts/plasmic.json +2 -2
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +2 -4
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +2 -4
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +2 -4
- package/cpa-out/tanstack-codegen-ts/src/router.tsx +1 -5
- package/cpa-out/tanstack-codegen-ts/vite.config.ts +5 -1
- package/dist/tanstack/tanstack.js +18 -5
- package/package.json +2 -2
- package/src/tanstack/tanstack.ts +23 -6
- package/dist/tanstack/templates/file-router/config.d.ts +0 -1
- package/dist/tanstack/templates/file-router/config.js +0 -33
- package/src/tanstack/templates/file-router/config.ts +0 -29
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
"test": "vitest run"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@plasmicapp/cli": "^0.1.
|
|
14
|
-
"@plasmicapp/react-web": "^0.2.
|
|
13
|
+
"@plasmicapp/cli": "^0.1.341",
|
|
14
|
+
"@plasmicapp/react-web": "^0.2.397",
|
|
15
15
|
"@tailwindcss/vite": "^4.0.6",
|
|
16
|
-
"@tanstack/react-
|
|
17
|
-
"@tanstack/react-router
|
|
18
|
-
"@tanstack/react-router-
|
|
19
|
-
"@tanstack/react-
|
|
16
|
+
"@tanstack/react-query": "^5.84.2",
|
|
17
|
+
"@tanstack/react-router": "^1.130.2",
|
|
18
|
+
"@tanstack/react-router-devtools": "^1.130.2",
|
|
19
|
+
"@tanstack/react-router-with-query": "^1.130.2",
|
|
20
|
+
"@tanstack/react-start": "^1.130.2",
|
|
20
21
|
"@tanstack/router-plugin": "^1.121.2",
|
|
21
22
|
"react": "^19.0.0",
|
|
22
23
|
"react-dom": "^19.0.0",
|
|
23
24
|
"tailwindcss": "^4.0.6",
|
|
24
|
-
"vite": "^6.3.3",
|
|
25
25
|
"vite-tsconfig-paths": "^5.1.4"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
@@ -32,11 +32,8 @@
|
|
|
32
32
|
"@vitejs/plugin-react": "^4.3.4",
|
|
33
33
|
"jsdom": "^26.0.0",
|
|
34
34
|
"typescript": "^5.7.2",
|
|
35
|
-
"vite": "^6.
|
|
35
|
+
"vite": "^6.3.5",
|
|
36
36
|
"vitest": "^3.0.5",
|
|
37
37
|
"web-vitals": "^4.2.4"
|
|
38
|
-
},
|
|
39
|
-
"overrides": {
|
|
40
|
-
"@tanstack/react-router": "^1.121.2"
|
|
41
38
|
}
|
|
42
39
|
}
|
|
@@ -131,6 +131,6 @@
|
|
|
131
131
|
"tanstackConfig": {
|
|
132
132
|
"pagesDir": "../routes"
|
|
133
133
|
},
|
|
134
|
-
"cliVersion": "0.1.
|
|
135
|
-
"$schema": "https://unpkg.com/@plasmicapp/cli@0.1.
|
|
134
|
+
"cliVersion": "0.1.341",
|
|
135
|
+
"$schema": "https://unpkg.com/@plasmicapp/cli@0.1.341/dist/plasmic.schema.json"
|
|
136
136
|
}
|
package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx
CHANGED
|
@@ -266,13 +266,11 @@ function PlasmicButton__RenderFunc(props: {
|
|
|
266
266
|
};
|
|
267
267
|
|
|
268
268
|
return (
|
|
269
|
-
<
|
|
270
|
-
as={"button"}
|
|
269
|
+
<button
|
|
271
270
|
data-plasmic-name={"root"}
|
|
272
271
|
data-plasmic-override={overrides.root}
|
|
273
272
|
data-plasmic-root={true}
|
|
274
273
|
data-plasmic-for-node={forNode}
|
|
275
|
-
hasGap={true}
|
|
276
274
|
className={classNames(
|
|
277
275
|
"plasmic_default__all",
|
|
278
276
|
"plasmic_default__button",
|
|
@@ -734,7 +732,7 @@ function PlasmicButton__RenderFunc(props: {
|
|
|
734
732
|
})}
|
|
735
733
|
</div>
|
|
736
734
|
) : null}
|
|
737
|
-
</
|
|
735
|
+
</button>
|
|
738
736
|
) as React.ReactElement | null;
|
|
739
737
|
}
|
|
740
738
|
|
package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx
CHANGED
|
@@ -148,11 +148,9 @@ function PlasmicDynamicPage__RenderFunc(props: {
|
|
|
148
148
|
"DynamicPage__root__hgzte"
|
|
149
149
|
)}
|
|
150
150
|
>
|
|
151
|
-
<
|
|
152
|
-
as={"section"}
|
|
151
|
+
<section
|
|
153
152
|
data-plasmic-name={"section"}
|
|
154
153
|
data-plasmic-override={overrides.section}
|
|
155
|
-
hasGap={true}
|
|
156
154
|
className={classNames(
|
|
157
155
|
"plasmic_default__all",
|
|
158
156
|
"plasmic_default__section",
|
|
@@ -193,7 +191,7 @@ function PlasmicDynamicPage__RenderFunc(props: {
|
|
|
193
191
|
"DynamicPage__randomDynamicPageButton__kaCiI"
|
|
194
192
|
)}
|
|
195
193
|
/>
|
|
196
|
-
</
|
|
194
|
+
</section>
|
|
197
195
|
</div>
|
|
198
196
|
</div>
|
|
199
197
|
</React.Fragment>
|
package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx
CHANGED
|
@@ -156,11 +156,9 @@ function PlasmicHomepage__RenderFunc(props: {
|
|
|
156
156
|
"Homepage__root__qtZIr"
|
|
157
157
|
)}
|
|
158
158
|
>
|
|
159
|
-
<
|
|
160
|
-
as={"section"}
|
|
159
|
+
<section
|
|
161
160
|
data-plasmic-name={"section"}
|
|
162
161
|
data-plasmic-override={overrides.section}
|
|
163
|
-
hasGap={true}
|
|
164
162
|
className={classNames(
|
|
165
163
|
"plasmic_default__all",
|
|
166
164
|
"plasmic_default__section",
|
|
@@ -232,7 +230,7 @@ function PlasmicHomepage__RenderFunc(props: {
|
|
|
232
230
|
"Homepage__randomDynamicPageButton__y0MM"
|
|
233
231
|
)}
|
|
234
232
|
/>
|
|
235
|
-
</
|
|
233
|
+
</section>
|
|
236
234
|
</div>
|
|
237
235
|
</div>
|
|
238
236
|
</React.Fragment>
|
|
@@ -3,17 +3,13 @@ import { createRouter as createTanstackRouter } from '@tanstack/react-router'
|
|
|
3
3
|
// Import the generated route tree
|
|
4
4
|
import { routeTree } from './routeTree.gen'
|
|
5
5
|
|
|
6
|
-
import './styles.css'
|
|
7
|
-
|
|
8
6
|
// Create a new router instance
|
|
9
7
|
export const createRouter = () => {
|
|
10
|
-
|
|
8
|
+
return createTanstackRouter({
|
|
11
9
|
routeTree,
|
|
12
10
|
scrollRestoration: true,
|
|
13
11
|
defaultPreloadStaleTime: 0,
|
|
14
12
|
})
|
|
15
|
-
|
|
16
|
-
return router
|
|
17
13
|
}
|
|
18
14
|
|
|
19
15
|
// Register the router instance for type safety
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { defineConfig } from 'vite'
|
|
2
2
|
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
|
|
3
|
+
import viteReact from '@vitejs/plugin-react'
|
|
3
4
|
import viteTsConfigPaths from 'vite-tsconfig-paths'
|
|
4
5
|
import tailwindcss from '@tailwindcss/vite'
|
|
5
6
|
|
|
@@ -19,7 +20,10 @@ const config = defineConfig({
|
|
|
19
20
|
projects: ['./tsconfig.json'],
|
|
20
21
|
}),
|
|
21
22
|
tailwindcss(),
|
|
22
|
-
tanstackStart(
|
|
23
|
+
tanstackStart({
|
|
24
|
+
customViteReactPlugin: true,
|
|
25
|
+
}),
|
|
26
|
+
viteReact(),
|
|
23
27
|
],
|
|
24
28
|
})
|
|
25
29
|
|
|
@@ -18,7 +18,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
18
18
|
const cmd_utils_1 = require("../utils/cmd-utils");
|
|
19
19
|
const codegen_1 = require("../utils/codegen");
|
|
20
20
|
const file_utils_1 = require("../utils/file-utils");
|
|
21
|
-
const
|
|
21
|
+
const npm_utils_1 = require("../utils/npm-utils");
|
|
22
22
|
const plasmic_host_1 = require("./templates/file-router/plasmic-host");
|
|
23
23
|
const root_1 = require("./templates/file-router/root");
|
|
24
24
|
exports.tanstackStrategy = {
|
|
@@ -40,6 +40,10 @@ exports.tanstackStrategy = {
|
|
|
40
40
|
process.chdir(parentDir);
|
|
41
41
|
const createCommand = `npx create-tsrouter-app@latest ${projectName} --template file-router --add-ons start`;
|
|
42
42
|
yield (0, cmd_utils_1.spawnOrFail)(createCommand);
|
|
43
|
+
// Install peer-dep of @tanstack/react-router-with-query
|
|
44
|
+
yield (0, npm_utils_1.installUpgrade)("@tanstack/react-query", {
|
|
45
|
+
workingDir: projectPath,
|
|
46
|
+
});
|
|
43
47
|
}),
|
|
44
48
|
installDeps: ({ scheme, projectPath }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
49
|
if (scheme === "loader") {
|
|
@@ -51,10 +55,19 @@ exports.tanstackStrategy = {
|
|
|
51
55
|
}),
|
|
52
56
|
overwriteConfig: (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
53
57
|
const { projectPath } = args;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
yield fs_1.promises.writeFile(
|
|
58
|
+
// Add @plasmicapp/* packages in noExternal to work during SSR
|
|
59
|
+
const viteConfigPath = path_1.default.join(projectPath, "vite.config.ts");
|
|
60
|
+
const viteConfigContent = yield fs_1.promises.readFile(viteConfigPath, "utf8");
|
|
61
|
+
yield fs_1.promises.writeFile(viteConfigPath, viteConfigContent.replace(`defineConfig({`, `defineConfig({
|
|
62
|
+
ssr: {
|
|
63
|
+
noExternal: [
|
|
64
|
+
"@plasmicapp/data-sources",
|
|
65
|
+
"@plasmicapp/data-sources-context",
|
|
66
|
+
"@plasmicapp/prepass",
|
|
67
|
+
"@plasmicapp/query",
|
|
68
|
+
"@plasmicapp/react-web",
|
|
69
|
+
],
|
|
70
|
+
},`));
|
|
58
71
|
// Disable verbatimModuleSyntax in tsconfig.json
|
|
59
72
|
const tsconfigPath = path_1.default.join(projectPath, "tsconfig.json");
|
|
60
73
|
const tsconfigContent = yield fs_1.promises.readFile(tsconfigPath, "utf8");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-plasmic-app",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.111",
|
|
4
4
|
"description": "Create Plasmic-powered React apps",
|
|
5
5
|
"main": "./dist/lib.js",
|
|
6
6
|
"types": "./dist/lib.d.ts",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"validate-npm-package-name": "^3.0.0",
|
|
47
47
|
"yargs": "^16.2.0"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "cbcd0a1252a203464a0748ec682050dfb5eae769"
|
|
50
50
|
}
|
package/src/tanstack/tanstack.ts
CHANGED
|
@@ -3,8 +3,8 @@ import path from "path";
|
|
|
3
3
|
import { spawnOrFail } from "../utils/cmd-utils";
|
|
4
4
|
import { installCodegenDeps, runCodegenSync } from "../utils/codegen";
|
|
5
5
|
import { deleteGlob } from "../utils/file-utils";
|
|
6
|
+
import { installUpgrade } from "../utils/npm-utils";
|
|
6
7
|
import { CPAStrategy, GenerateFilesArgs } from "../utils/strategy";
|
|
7
|
-
import { makeCustomViteConfig_file_router_codegen } from "./templates/file-router/config";
|
|
8
8
|
import { makePlasmicHostPage_fileRouter_codegen } from "./templates/file-router/plasmic-host";
|
|
9
9
|
import { makeCustomRoot_file_router_codegen } from "./templates/file-router/root";
|
|
10
10
|
|
|
@@ -32,6 +32,11 @@ export const tanstackStrategy: CPAStrategy = {
|
|
|
32
32
|
const createCommand = `npx create-tsrouter-app@latest ${projectName} --template file-router --add-ons start`;
|
|
33
33
|
|
|
34
34
|
await spawnOrFail(createCommand);
|
|
35
|
+
|
|
36
|
+
// Install peer-dep of @tanstack/react-router-with-query
|
|
37
|
+
await installUpgrade("@tanstack/react-query", {
|
|
38
|
+
workingDir: projectPath,
|
|
39
|
+
});
|
|
35
40
|
},
|
|
36
41
|
installDeps: async ({ scheme, projectPath }) => {
|
|
37
42
|
if (scheme === "loader") {
|
|
@@ -45,12 +50,24 @@ export const tanstackStrategy: CPAStrategy = {
|
|
|
45
50
|
overwriteConfig: async (args) => {
|
|
46
51
|
const { projectPath } = args;
|
|
47
52
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
// Add @plasmicapp/* packages in noExternal to work during SSR
|
|
54
|
+
const viteConfigPath = path.join(projectPath, "vite.config.ts");
|
|
55
|
+
const viteConfigContent = await fs.readFile(viteConfigPath, "utf8");
|
|
51
56
|
await fs.writeFile(
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
viteConfigPath,
|
|
58
|
+
viteConfigContent.replace(
|
|
59
|
+
`defineConfig({`,
|
|
60
|
+
`defineConfig({
|
|
61
|
+
ssr: {
|
|
62
|
+
noExternal: [
|
|
63
|
+
"@plasmicapp/data-sources",
|
|
64
|
+
"@plasmicapp/data-sources-context",
|
|
65
|
+
"@plasmicapp/prepass",
|
|
66
|
+
"@plasmicapp/query",
|
|
67
|
+
"@plasmicapp/react-web",
|
|
68
|
+
],
|
|
69
|
+
},`
|
|
70
|
+
)
|
|
54
71
|
);
|
|
55
72
|
|
|
56
73
|
// Disable verbatimModuleSyntax in tsconfig.json
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function makeCustomViteConfig_file_router_codegen(): string;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeCustomViteConfig_file_router_codegen = void 0;
|
|
4
|
-
function makeCustomViteConfig_file_router_codegen() {
|
|
5
|
-
return `import { defineConfig } from 'vite'
|
|
6
|
-
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
|
|
7
|
-
import viteTsConfigPaths from 'vite-tsconfig-paths'
|
|
8
|
-
import tailwindcss from '@tailwindcss/vite'
|
|
9
|
-
|
|
10
|
-
const config = defineConfig({
|
|
11
|
-
ssr: {
|
|
12
|
-
noExternal: [
|
|
13
|
-
"@plasmicapp/data-sources",
|
|
14
|
-
"@plasmicapp/data-sources-context",
|
|
15
|
-
"@plasmicapp/prepass",
|
|
16
|
-
"@plasmicapp/query",
|
|
17
|
-
"@plasmicapp/react-web",
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
plugins: [
|
|
21
|
-
// this is the plugin that enables path aliases
|
|
22
|
-
viteTsConfigPaths({
|
|
23
|
-
projects: ['./tsconfig.json'],
|
|
24
|
-
}),
|
|
25
|
-
tailwindcss(),
|
|
26
|
-
tanstackStart(),
|
|
27
|
-
],
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
export default config
|
|
31
|
-
`;
|
|
32
|
-
}
|
|
33
|
-
exports.makeCustomViteConfig_file_router_codegen = makeCustomViteConfig_file_router_codegen;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export function makeCustomViteConfig_file_router_codegen(): string {
|
|
2
|
-
return `import { defineConfig } from 'vite'
|
|
3
|
-
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
|
|
4
|
-
import viteTsConfigPaths from 'vite-tsconfig-paths'
|
|
5
|
-
import tailwindcss from '@tailwindcss/vite'
|
|
6
|
-
|
|
7
|
-
const config = defineConfig({
|
|
8
|
-
ssr: {
|
|
9
|
-
noExternal: [
|
|
10
|
-
"@plasmicapp/data-sources",
|
|
11
|
-
"@plasmicapp/data-sources-context",
|
|
12
|
-
"@plasmicapp/prepass",
|
|
13
|
-
"@plasmicapp/query",
|
|
14
|
-
"@plasmicapp/react-web",
|
|
15
|
-
],
|
|
16
|
-
},
|
|
17
|
-
plugins: [
|
|
18
|
-
// this is the plugin that enables path aliases
|
|
19
|
-
viteTsConfigPaths({
|
|
20
|
-
projects: ['./tsconfig.json'],
|
|
21
|
-
}),
|
|
22
|
-
tailwindcss(),
|
|
23
|
-
tanstackStart(),
|
|
24
|
-
],
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
export default config
|
|
28
|
-
`;
|
|
29
|
-
}
|