create-plasmic-app 0.0.103 → 0.0.105
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/.gitignore +4 -0
- package/cpa-out/tanstack-codegen-ts/package.json +42 -0
- package/cpa-out/tanstack-codegen-ts/plasmic.json +136 -0
- package/cpa-out/tanstack-codegen-ts/src/components/Button.tsx +35 -0
- package/cpa-out/tanstack-codegen-ts/src/components/Header.tsx +21 -0
- package/cpa-out/tanstack-codegen-ts/src/components/RandomDynamicPageButton.tsx +44 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +870 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +309 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +28 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +351 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +279 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__CheckSvg.tsx +44 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Icon.tsx +41 -0
- package/cpa-out/tanstack-codegen-ts/src/routeTree.gen.ts +95 -0
- package/cpa-out/tanstack-codegen-ts/src/router.tsx +24 -0
- package/cpa-out/tanstack-codegen-ts/src/routes/__root.tsx +37 -0
- package/cpa-out/tanstack-codegen-ts/src/routes/dynamic/$slug/index.tsx +49 -0
- package/cpa-out/tanstack-codegen-ts/src/routes/index.tsx +49 -0
- package/cpa-out/tanstack-codegen-ts/src/routes/plasmic-host.tsx +20 -0
- package/cpa-out/tanstack-codegen-ts/tsconfig.json +28 -0
- package/cpa-out/tanstack-codegen-ts/vite.config.ts +26 -0
- package/dist/react/react.js +10 -12
- package/dist/tanstack/tanstack.js +1 -1
- package/dist/tanstack/templates/file-router/config.d.ts +1 -1
- package/dist/tanstack/templates/file-router/config.js +27 -27
- package/package.json +2 -2
- package/src/react/react.ts +14 -18
- package/src/tanstack/tanstack.ts +3 -3
- package/src/tanstack/templates/file-router/config.ts +25 -25
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
|
|
3
|
+
import viteTsConfigPaths from 'vite-tsconfig-paths'
|
|
4
|
+
import tailwindcss from '@tailwindcss/vite'
|
|
5
|
+
|
|
6
|
+
const config = defineConfig({
|
|
7
|
+
ssr: {
|
|
8
|
+
noExternal: [
|
|
9
|
+
"@plasmicapp/data-sources",
|
|
10
|
+
"@plasmicapp/data-sources-context",
|
|
11
|
+
"@plasmicapp/prepass",
|
|
12
|
+
"@plasmicapp/query",
|
|
13
|
+
"@plasmicapp/react-web",
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
plugins: [
|
|
17
|
+
// this is the plugin that enables path aliases
|
|
18
|
+
viteTsConfigPaths({
|
|
19
|
+
projects: ['./tsconfig.json'],
|
|
20
|
+
}),
|
|
21
|
+
tailwindcss(),
|
|
22
|
+
tanstackStart(),
|
|
23
|
+
],
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
export default config
|
package/dist/react/react.js
CHANGED
|
@@ -61,18 +61,16 @@ exports.reactStrategy = {
|
|
|
61
61
|
overwriteConfig: (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
62
|
const { projectPath, jsOrTs } = args;
|
|
63
63
|
if (jsOrTs === "ts") {
|
|
64
|
-
const
|
|
65
|
-
let
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
tsConfig.compilerOptions = Object.assign(Object.assign({}, tsConfig.compilerOptions), { noUnusedLocals: false });
|
|
75
|
-
yield fs_1.promises.writeFile(tsConfigJsonPath, JSON.stringify(tsConfig, null, 2));
|
|
64
|
+
const tsconfigPath = path_1.default.join(projectPath, "tsconfig.app.json");
|
|
65
|
+
let tsconfigContent = yield fs_1.promises.readFile(tsconfigPath, "utf8");
|
|
66
|
+
tsconfigContent = tsconfigContent
|
|
67
|
+
// Disable verbatimModuleSyntax
|
|
68
|
+
.replace(`"verbatimModuleSyntax": true`, `"verbatimModuleSyntax": false`)
|
|
69
|
+
/* In our codegen, we have components where React is imported but not used, we need to
|
|
70
|
+
turn off the `noUnusedLocals` rule to ensure the project builds successfully.
|
|
71
|
+
*/
|
|
72
|
+
.replace(`"noUnusedLocals": true`, `"noUnusedLocals": false`);
|
|
73
|
+
yield fs_1.promises.writeFile(tsconfigPath, tsconfigContent);
|
|
76
74
|
}
|
|
77
75
|
}),
|
|
78
76
|
generateFiles: ({ scheme, projectApiToken, projectId, projectPath, jsOrTs, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -55,7 +55,7 @@ exports.tanstackStrategy = {
|
|
|
55
55
|
* them to work properly during ssr phase.
|
|
56
56
|
*/
|
|
57
57
|
if (jsOrTs === "ts") {
|
|
58
|
-
yield fs_1.promises.writeFile(path_1.default.join(projectPath, "
|
|
58
|
+
yield fs_1.promises.writeFile(path_1.default.join(projectPath, "vite.config.ts"), (0, config_1.makeCustomViteConfig_file_router_codegen)());
|
|
59
59
|
}
|
|
60
60
|
}),
|
|
61
61
|
generateFiles: (args) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function
|
|
1
|
+
export declare function makeCustomViteConfig_file_router_codegen(): string;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
5
|
-
return `import { defineConfig } from
|
|
6
|
-
import
|
|
7
|
-
import
|
|
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'
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
projects: ["./tsconfig.json"],
|
|
18
|
-
}),
|
|
19
|
-
tailwindcss(),
|
|
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",
|
|
20
18
|
],
|
|
21
|
-
ssr: {
|
|
22
|
-
noExternal: [
|
|
23
|
-
"@plasmicapp/data-sources",
|
|
24
|
-
"@plasmicapp/data-sources-context",
|
|
25
|
-
"@plasmicapp/prepass",
|
|
26
|
-
"@plasmicapp/query",
|
|
27
|
-
"@plasmicapp/react-web",
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
19
|
},
|
|
31
|
-
|
|
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
32
|
}
|
|
33
|
-
exports.
|
|
33
|
+
exports.makeCustomViteConfig_file_router_codegen = makeCustomViteConfig_file_router_codegen;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-plasmic-app",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.105",
|
|
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": "0c49eb5026b12b17d836be44234696d1f7560140"
|
|
50
50
|
}
|
package/src/react/react.ts
CHANGED
|
@@ -59,24 +59,20 @@ export const reactStrategy: CPAStrategy = {
|
|
|
59
59
|
const { projectPath, jsOrTs } = args;
|
|
60
60
|
|
|
61
61
|
if (jsOrTs === "ts") {
|
|
62
|
-
const
|
|
63
|
-
let
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
noUnusedLocals: false,
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
await fs.writeFile(tsConfigJsonPath, JSON.stringify(tsConfig, null, 2));
|
|
62
|
+
const tsconfigPath = path.join(projectPath, "tsconfig.app.json");
|
|
63
|
+
let tsconfigContent = await fs.readFile(tsconfigPath, "utf8");
|
|
64
|
+
tsconfigContent = tsconfigContent
|
|
65
|
+
// Disable verbatimModuleSyntax
|
|
66
|
+
.replace(
|
|
67
|
+
`"verbatimModuleSyntax": true`,
|
|
68
|
+
`"verbatimModuleSyntax": false`
|
|
69
|
+
)
|
|
70
|
+
/* In our codegen, we have components where React is imported but not used, we need to
|
|
71
|
+
turn off the `noUnusedLocals` rule to ensure the project builds successfully.
|
|
72
|
+
*/
|
|
73
|
+
.replace(`"noUnusedLocals": true`, `"noUnusedLocals": false`);
|
|
74
|
+
|
|
75
|
+
await fs.writeFile(tsconfigPath, tsconfigContent);
|
|
80
76
|
}
|
|
81
77
|
},
|
|
82
78
|
generateFiles: async ({
|
package/src/tanstack/tanstack.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { spawnOrFail } from "../utils/cmd-utils";
|
|
|
4
4
|
import { installCodegenDeps, runCodegenSync } from "../utils/codegen";
|
|
5
5
|
import { deleteGlob } from "../utils/file-utils";
|
|
6
6
|
import { CPAStrategy, GenerateFilesArgs } from "../utils/strategy";
|
|
7
|
-
import {
|
|
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
|
|
|
@@ -50,8 +50,8 @@ export const tanstackStrategy: CPAStrategy = {
|
|
|
50
50
|
*/
|
|
51
51
|
if (jsOrTs === "ts") {
|
|
52
52
|
await fs.writeFile(
|
|
53
|
-
path.join(projectPath, "
|
|
54
|
-
|
|
53
|
+
path.join(projectPath, "vite.config.ts"),
|
|
54
|
+
makeCustomViteConfig_file_router_codegen()
|
|
55
55
|
);
|
|
56
56
|
}
|
|
57
57
|
},
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export function
|
|
2
|
-
return `import { defineConfig } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
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'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
projects: ["./tsconfig.json"],
|
|
15
|
-
}),
|
|
16
|
-
tailwindcss(),
|
|
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",
|
|
17
15
|
],
|
|
18
|
-
ssr: {
|
|
19
|
-
noExternal: [
|
|
20
|
-
"@plasmicapp/data-sources",
|
|
21
|
-
"@plasmicapp/data-sources-context",
|
|
22
|
-
"@plasmicapp/prepass",
|
|
23
|
-
"@plasmicapp/query",
|
|
24
|
-
"@plasmicapp/react-web",
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
16
|
},
|
|
28
|
-
|
|
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
29
|
}
|