create-plasmic-app 0.0.145 → 0.0.147

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 (30) hide show
  1. package/cpa-out/gatsby-codegen-js/package.json +1 -1
  2. package/cpa-out/gatsby-codegen-ts/package.json +1 -1
  3. package/cpa-out/gatsby-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +1 -0
  4. package/cpa-out/gatsby-loader-js/package.json +1 -1
  5. package/cpa-out/gatsby-loader-ts/package.json +1 -1
  6. package/cpa-out/nextjs-app-codegen-js/app/plasmic-host/page.jsx +2 -0
  7. package/cpa-out/nextjs-app-codegen-js/package.json +1 -1
  8. package/cpa-out/nextjs-app-codegen-ts/app/plasmic-host/page.tsx +2 -0
  9. package/cpa-out/nextjs-app-codegen-ts/components/plasmic/create_plasmic_app/PlasmicButton.tsx +1 -0
  10. package/cpa-out/nextjs-app-codegen-ts/package.json +1 -1
  11. package/cpa-out/nextjs-app-loader-js/package.json +1 -1
  12. package/cpa-out/nextjs-app-loader-ts/package.json +1 -1
  13. package/cpa-out/nextjs-pages-codegen-js/package.json +1 -1
  14. package/cpa-out/nextjs-pages-codegen-ts/components/plasmic/create_plasmic_app/PlasmicButton.tsx +1 -0
  15. package/cpa-out/nextjs-pages-codegen-ts/package.json +1 -1
  16. package/cpa-out/nextjs-pages-loader-js/package.json +1 -1
  17. package/cpa-out/nextjs-pages-loader-ts/package.json +1 -1
  18. package/cpa-out/react-codegen-js/package.json +1 -1
  19. package/cpa-out/react-codegen-ts/package.json +1 -1
  20. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +1 -0
  21. package/cpa-out/tanstack-codegen-ts/package.json +2 -2
  22. package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +1 -0
  23. package/dist/nextjs/nextjs.js +9 -9
  24. package/dist/nextjs/templates/app-codegen/plasmic-host.d.ts +1 -0
  25. package/dist/nextjs/templates/app-codegen/plasmic-host.js +10 -0
  26. package/dist/tanstack/tanstack.js +4 -1
  27. package/package.json +2 -2
  28. package/src/nextjs/nextjs.ts +3 -2
  29. package/src/nextjs/templates/app-codegen/plasmic-host.ts +7 -0
  30. package/src/tanstack/tanstack.ts +6 -1
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@plasmicapp/cli": "^0.1.361",
18
- "@plasmicapp/react-web": "^1.0.6",
18
+ "@plasmicapp/react-web": "^1.0.8",
19
19
  "gatsby": "^5.14.6",
20
20
  "gatsby-plugin-react-helmet": "^6.16.0",
21
21
  "react": "^18.2.0",
@@ -16,7 +16,7 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@plasmicapp/cli": "^0.1.361",
19
- "@plasmicapp/react-web": "^1.0.6",
19
+ "@plasmicapp/react-web": "^1.0.8",
20
20
  "gatsby": "^5.14.6",
21
21
  "gatsby-plugin-react-helmet": "^6.16.0",
22
22
  "react": "^18.2.0",
@@ -248,6 +248,7 @@ function PlasmicButton__RenderFunc(props: {
248
248
  ],
249
249
  [$props, $ctx, $refs]
250
250
  );
251
+
251
252
  const $state = useDollarState(stateSpecs, {
252
253
  $props,
253
254
  $ctx,
@@ -14,7 +14,7 @@
14
14
  "clean": "gatsby clean"
15
15
  },
16
16
  "dependencies": {
17
- "@plasmicapp/loader-gatsby": "^2.0.3",
17
+ "@plasmicapp/loader-gatsby": "^2.0.5",
18
18
  "gatsby": "^5.14.6",
19
19
  "gatsby-plugin-react-helmet": "^6.16.0",
20
20
  "react": "^18.2.0",
@@ -15,7 +15,7 @@
15
15
  "typecheck": "tsc --noEmit"
16
16
  },
17
17
  "dependencies": {
18
- "@plasmicapp/loader-gatsby": "^2.0.3",
18
+ "@plasmicapp/loader-gatsby": "^2.0.5",
19
19
  "gatsby": "^5.14.6",
20
20
  "gatsby-plugin-react-helmet": "^6.16.0",
21
21
  "react": "^18.2.0",
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import * as React from 'react';
2
4
  import { PlasmicCanvasHost, registerComponent } from '@plasmicapp/react-web/lib/host';
3
5
 
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@plasmicapp/cli": "^0.1.361",
13
- "@plasmicapp/react-web": "^1.0.6",
13
+ "@plasmicapp/react-web": "^1.0.8",
14
14
  "next": "14.2.35",
15
15
  "react": "^18",
16
16
  "react-dom": "^18"
@@ -1,3 +1,5 @@
1
+ "use client";
2
+
1
3
  import * as React from 'react';
2
4
  import { PlasmicCanvasHost, registerComponent } from '@plasmicapp/react-web/lib/host';
3
5
 
@@ -257,6 +257,7 @@ function PlasmicButton__RenderFunc(props: {
257
257
  ],
258
258
  [$props, $ctx, $refs]
259
259
  );
260
+
260
261
  const $state = useDollarState(stateSpecs, {
261
262
  $props,
262
263
  $ctx,
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@plasmicapp/cli": "^0.1.361",
13
- "@plasmicapp/react-web": "^1.0.6",
13
+ "@plasmicapp/react-web": "^1.0.8",
14
14
  "next": "14.2.35",
15
15
  "react": "^18",
16
16
  "react-dom": "^18"
@@ -9,7 +9,7 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@plasmicapp/loader-nextjs": "^2.0.3",
12
+ "@plasmicapp/loader-nextjs": "^2.0.4",
13
13
  "next": "14.2.35",
14
14
  "react": "^18",
15
15
  "react-dom": "^18"
@@ -9,7 +9,7 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@plasmicapp/loader-nextjs": "^2.0.3",
12
+ "@plasmicapp/loader-nextjs": "^2.0.4",
13
13
  "next": "14.2.35",
14
14
  "react": "^18",
15
15
  "react-dom": "^18"
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@plasmicapp/cli": "^0.1.361",
13
- "@plasmicapp/react-web": "^1.0.6",
13
+ "@plasmicapp/react-web": "^1.0.8",
14
14
  "next": "14.2.35",
15
15
  "react": "^18",
16
16
  "react-dom": "^18"
@@ -255,6 +255,7 @@ function PlasmicButton__RenderFunc(props: {
255
255
  ],
256
256
  [$props, $ctx, $refs]
257
257
  );
258
+
258
259
  const $state = useDollarState(stateSpecs, {
259
260
  $props,
260
261
  $ctx,
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "@plasmicapp/cli": "^0.1.361",
13
- "@plasmicapp/react-web": "^1.0.6",
13
+ "@plasmicapp/react-web": "^1.0.8",
14
14
  "next": "14.2.35",
15
15
  "react": "^18",
16
16
  "react-dom": "^18"
@@ -9,7 +9,7 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@plasmicapp/loader-nextjs": "^2.0.3",
12
+ "@plasmicapp/loader-nextjs": "^2.0.4",
13
13
  "next": "14.2.35",
14
14
  "react": "^18",
15
15
  "react-dom": "^18"
@@ -9,7 +9,7 @@
9
9
  "lint": "next lint"
10
10
  },
11
11
  "dependencies": {
12
- "@plasmicapp/loader-nextjs": "^2.0.3",
12
+ "@plasmicapp/loader-nextjs": "^2.0.4",
13
13
  "next": "14.2.35",
14
14
  "react": "^18",
15
15
  "react-dom": "^18"
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@plasmicapp/cli": "^0.1.361",
14
- "@plasmicapp/react-web": "^1.0.6",
14
+ "@plasmicapp/react-web": "^1.0.8",
15
15
  "react": "^18.3.1",
16
16
  "react-dom": "^18.3.1"
17
17
  },
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "@plasmicapp/cli": "^0.1.361",
14
- "@plasmicapp/react-web": "^1.0.6",
14
+ "@plasmicapp/react-web": "^1.0.8",
15
15
  "react": "^18.3.1",
16
16
  "react-dom": "^18.3.1"
17
17
  },
@@ -242,6 +242,7 @@ function PlasmicButton__RenderFunc(props: {
242
242
  ],
243
243
  [$props, $ctx, $refs]
244
244
  );
245
+
245
246
  const $state = useDollarState(stateSpecs, {
246
247
  $props,
247
248
  $ctx,
@@ -13,10 +13,10 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "@plasmicapp/cli": "^0.1.361",
16
- "@plasmicapp/react-web": "^1.0.6",
16
+ "@plasmicapp/react-web": "^1.0.8",
17
17
  "@tailwindcss/vite": "^4.1.18",
18
18
  "@tanstack/react-devtools": "latest",
19
- "@tanstack/react-query": "^5.100.9",
19
+ "@tanstack/react-query": "^5.100.10",
20
20
  "@tanstack/react-router": "latest",
21
21
  "@tanstack/react-router-devtools": "latest",
22
22
  "@tanstack/router-plugin": "^1.132.0",
@@ -254,6 +254,7 @@ function PlasmicButton__RenderFunc(props: {
254
254
  ],
255
255
  [$props, $ctx, $refs]
256
256
  );
257
+
257
258
  const $state = useDollarState(stateSpecs, {
258
259
  $props,
259
260
  $ctx,
@@ -22,15 +22,16 @@ const file_utils_1 = require("../utils/file-utils");
22
22
  const lang_utils_1 = require("../utils/lang-utils");
23
23
  const npm_utils_1 = require("../utils/npm-utils");
24
24
  const layout_1 = require("./templates/app-codegen/layout");
25
+ const plasmic_host_1 = require("./templates/app-codegen/plasmic-host");
25
26
  const plasmic_init_client_1 = require("./templates/app-codegen/plasmic-init-client");
26
27
  const catchall_page_1 = require("./templates/app-loader/catchall-page");
27
- const plasmic_host_1 = require("./templates/app-loader/plasmic-host");
28
+ const plasmic_host_2 = require("./templates/app-loader/plasmic-host");
28
29
  const plasmic_init_1 = require("./templates/app-loader/plasmic-init");
29
30
  const plasmic_init_client_2 = require("./templates/app-loader/plasmic-init-client");
30
31
  const app_1 = require("./templates/pages-codegen/app");
31
- const plasmic_host_2 = require("./templates/pages-codegen/plasmic-host");
32
+ const plasmic_host_3 = require("./templates/pages-codegen/plasmic-host");
32
33
  const catchall_page_2 = require("./templates/pages-loader/catchall-page");
33
- const plasmic_host_3 = require("./templates/pages-loader/plasmic-host");
34
+ const plasmic_host_4 = require("./templates/pages-loader/plasmic-host");
34
35
  const plasmic_init_2 = require("./templates/pages-loader/plasmic-init");
35
36
  exports.nextjsStrategy = {
36
37
  create: (args) => __awaiter(void 0, void 0, void 0, function* () {
@@ -40,7 +41,7 @@ exports.nextjsStrategy = {
40
41
  const experimentalAppArg = ((_a = platformOptions.nextjs) === null || _a === void 0 ? void 0 : _a.appDir)
41
42
  ? "--app"
42
43
  : "--no-app";
43
- const templateArg = template ? ` --template ${template}` : "";
44
+ const templateArg = template ? ` --example ${template}` : "";
44
45
  // TODO: Change to latest when nextjs stops using react@19-rc
45
46
  const createCommand = `npx create-next-app@14 ${projectPath} ${typescriptArg} ${experimentalAppArg} ${templateArg}` +
46
47
  ` --eslint --no-src-dir --import-alias "@/*" --no-tailwind`;
@@ -101,7 +102,7 @@ function generateFilesAppDir(args) {
101
102
  yield fs_1.promises.writeFile(path_1.default.join(projectPath, `plasmic-init-client.${jsOrTs}x`), (0, plasmic_init_client_2.makePlasmicInitClient_app_loader)(jsOrTs));
102
103
  // ./app/plasmic-host/page.tsx
103
104
  yield fs_1.promises.mkdir(path_1.default.join(projectPath, "app", "plasmic-host"));
104
- yield fs_1.promises.writeFile(path_1.default.join(projectPath, "app", "plasmic-host", `page.${jsOrTs}x`), (0, plasmic_host_1.makePlasmicHostPage_app_loader)());
105
+ yield fs_1.promises.writeFile(path_1.default.join(projectPath, "app", "plasmic-host", `page.${jsOrTs}x`), (0, plasmic_host_2.makePlasmicHostPage_app_loader)());
105
106
  // ./app/[[...catchall]]/page.tsx
106
107
  yield fs_1.promises.mkdir(path_1.default.join(projectPath, "app", "[[...catchall]]"));
107
108
  yield fs_1.promises.writeFile(path_1.default.join(projectPath, "app", "[[...catchall]]", `page.${jsOrTs}x`), (0, catchall_page_1.makeCatchallPage_app_loader)(jsOrTs));
@@ -115,8 +116,7 @@ function generateFilesAppDir(args) {
115
116
  yield fs_1.promises.writeFile(path_1.default.join(projectPath, `plasmic-init-client.${jsOrTs}x`), (0, plasmic_init_client_1.makePlasmicInitClient_app_codegen)(jsOrTs));
116
117
  // ./app/plasmic-host/page.tsx
117
118
  yield fs_1.promises.mkdir(path_1.default.join(projectPath, "app", "plasmic-host"));
118
- yield fs_1.promises.writeFile(path_1.default.join(projectPath, "app", "plasmic-host", `page.${jsOrTs}x`), (0, plasmic_host_2.makePlasmicHostPage_pages_codegen)() // plasmic-host page contents are the same as the pages router
119
- );
119
+ yield fs_1.promises.writeFile(path_1.default.join(projectPath, "app", "plasmic-host", `page.${jsOrTs}x`), (0, plasmic_host_1.makePlasmicHostPage_app_codegen)());
120
120
  // This should generate
121
121
  // ./plasmic.json
122
122
  // ./app/page.tsx
@@ -144,7 +144,7 @@ function generateFilesPagesDir(args) {
144
144
  // ./plasmic-init.ts
145
145
  yield fs_1.promises.writeFile(path_1.default.join(projectPath, `plasmic-init.${jsOrTs}`), (0, plasmic_init_2.makePlasmicInit_pages_loader)(projectId, (0, lang_utils_1.ensure)(projectApiToken, "Missing projectApiToken")));
146
146
  // ./pages/plasmic-host.tsx
147
- yield fs_1.promises.writeFile(path_1.default.join(projectPath, "pages", `plasmic-host.${jsOrTs}x`), (0, plasmic_host_3.makePlasmicHostPage_pages_loader)());
147
+ yield fs_1.promises.writeFile(path_1.default.join(projectPath, "pages", `plasmic-host.${jsOrTs}x`), (0, plasmic_host_4.makePlasmicHostPage_pages_loader)());
148
148
  // ./pages/[[...catchall]].tsx
149
149
  yield fs_1.promises.writeFile(path_1.default.join(projectPath, "pages", `[[...catchall]].${jsOrTs}x`), (0, catchall_page_2.makeCatchallPage_pages_loader)(jsOrTs));
150
150
  }
@@ -152,7 +152,7 @@ function generateFilesPagesDir(args) {
152
152
  // ./pages/_app.tsx
153
153
  yield fs_1.promises.writeFile(path_1.default.join(projectPath, "pages", `_app.${jsOrTs}x`), (0, app_1.makeCustomApp_pages_codegen)(jsOrTs));
154
154
  // ./pages/plasmic-host.tsx
155
- yield fs_1.promises.writeFile(path_1.default.join(projectPath, "pages", `plasmic-host.${jsOrTs}x`), (0, plasmic_host_2.makePlasmicHostPage_pages_codegen)());
155
+ yield fs_1.promises.writeFile(path_1.default.join(projectPath, "pages", `plasmic-host.${jsOrTs}x`), (0, plasmic_host_3.makePlasmicHostPage_pages_codegen)());
156
156
  // This should generate
157
157
  // ./plasmic.json
158
158
  // ./pages/index.tsx
@@ -0,0 +1 @@
1
+ export declare function makePlasmicHostPage_app_codegen(): string;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makePlasmicHostPage_app_codegen = void 0;
4
+ const plasmic_host_1 = require("../pages-codegen/plasmic-host");
5
+ function makePlasmicHostPage_app_codegen() {
6
+ return `"use client";
7
+
8
+ ${(0, plasmic_host_1.makePlasmicHostPage_pages_codegen)()}`;
9
+ }
10
+ exports.makePlasmicHostPage_app_codegen = makePlasmicHostPage_app_codegen;
@@ -23,7 +23,10 @@ const plasmic_host_1 = require("./templates/file-router/plasmic-host");
23
23
  const root_1 = require("./templates/file-router/root");
24
24
  exports.tanstackStrategy = {
25
25
  create: (args) => __awaiter(void 0, void 0, void 0, function* () {
26
- const { projectPath } = args;
26
+ const { projectPath, template } = args;
27
+ if (template) {
28
+ console.warn(`Warning: Ignoring template '${template}' (argument is not supported by TanStack).`);
29
+ }
27
30
  /* create-tsrouter-app package receives the projectName as an argument, when we provide a fullProjectPath, it creates
28
31
  package.json with name having the fullProjectPath causing illegal characters in the name field error.
29
32
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-plasmic-app",
3
- "version": "0.0.145",
3
+ "version": "0.0.147",
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": "a20807890e3caf3707c6bd214440d539ae53c01f"
50
+ "gitHead": "2e811068a089e1c86ca9213174860726042db0a9"
51
51
  }
@@ -12,6 +12,7 @@ import { ensure } from "../utils/lang-utils";
12
12
  import { installUpgrade } from "../utils/npm-utils";
13
13
  import { CPAStrategy, GenerateFilesArgs } from "../utils/strategy";
14
14
  import { makeLayout_app_codegen } from "./templates/app-codegen/layout";
15
+ import { makePlasmicHostPage_app_codegen } from "./templates/app-codegen/plasmic-host";
15
16
  import { makePlasmicInitClient_app_codegen } from "./templates/app-codegen/plasmic-init-client";
16
17
  import { makeCatchallPage_app_loader } from "./templates/app-loader/catchall-page";
17
18
  import { makePlasmicHostPage_app_loader } from "./templates/app-loader/plasmic-host";
@@ -30,7 +31,7 @@ export const nextjsStrategy: CPAStrategy = {
30
31
  const experimentalAppArg = platformOptions.nextjs?.appDir
31
32
  ? "--app"
32
33
  : "--no-app";
33
- const templateArg = template ? ` --template ${template}` : "";
34
+ const templateArg = template ? ` --example ${template}` : "";
34
35
  // TODO: Change to latest when nextjs stops using react@19-rc
35
36
  const createCommand =
36
37
  `npx create-next-app@14 ${projectPath} ${typescriptArg} ${experimentalAppArg} ${templateArg}` +
@@ -137,7 +138,7 @@ async function generateFilesAppDir(args: GenerateFilesArgs) {
137
138
  await fs.mkdir(path.join(projectPath, "app", "plasmic-host"));
138
139
  await fs.writeFile(
139
140
  path.join(projectPath, "app", "plasmic-host", `page.${jsOrTs}x`),
140
- makePlasmicHostPage_pages_codegen() // plasmic-host page contents are the same as the pages router
141
+ makePlasmicHostPage_app_codegen()
141
142
  );
142
143
 
143
144
  // This should generate
@@ -0,0 +1,7 @@
1
+ import { makePlasmicHostPage_pages_codegen } from "../pages-codegen/plasmic-host";
2
+
3
+ export function makePlasmicHostPage_app_codegen(): string {
4
+ return `"use client";
5
+
6
+ ${makePlasmicHostPage_pages_codegen()}`;
7
+ }
@@ -10,7 +10,12 @@ import { makeCustomRoot_file_router_codegen } from "./templates/file-router/root
10
10
 
11
11
  export const tanstackStrategy: CPAStrategy = {
12
12
  create: async (args) => {
13
- const { projectPath } = args;
13
+ const { projectPath, template } = args;
14
+ if (template) {
15
+ console.warn(
16
+ `Warning: Ignoring template '${template}' (argument is not supported by TanStack).`
17
+ );
18
+ }
14
19
 
15
20
  /* create-tsrouter-app package receives the projectName as an argument, when we provide a fullProjectPath, it creates
16
21
  package.json with name having the fullProjectPath causing illegal characters in the name field error.