@plasmicapp/cli 0.1.180 → 0.1.181

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.
@@ -287,6 +287,7 @@ class PlasmicApi {
287
287
  return {
288
288
  "@plasmicapp/loader": "0.0.1",
289
289
  "@plasmicapp/cli": "0.0.1",
290
+ "@plasmicapp/host": "0.0.1",
290
291
  "@plasmicapp/react-web": "0.0.1",
291
292
  "@plasmicapp/react-web-runtime": "0.0.1",
292
293
  };
@@ -42,9 +42,10 @@ function initPlasmic(opts) {
42
42
  if (!process.env.QUIET) {
43
43
  deps_1.logger.info("Successfully created plasmic.json.\n");
44
44
  }
45
- const answer = yield user_utils_1.confirmWithUser("@plasmicapp/react-web is a small runtime required by Plasmic-generated code.\n Do you want to add it now?", opts.yes);
45
+ const answer = yield user_utils_1.confirmWithUser("@plasmicapp/host and @plasmicapp/react-web are small runtimes required by Plasmic-generated code.\n Do you want to add them now?", opts.yes);
46
46
  if (answer) {
47
47
  npm_utils_1.installUpgrade("@plasmicapp/react-web", opts.baseDir);
48
+ npm_utils_1.installUpgrade("@plasmicapp/host", opts.baseDir);
48
49
  }
49
50
  });
50
51
  }
@@ -88,6 +88,13 @@ function ensureRequiredPackages(context, baseDir, yes) {
88
88
  semver.gt(requireds["@plasmicapp/react-web"], reactWebVersion)) {
89
89
  yield confirmInstall("@plasmicapp/react-web", requireds["@plasmicapp/react-web"], { global: false, dev: false });
90
90
  }
91
+ const hostVersion = npm_utils_1.findInstalledVersion(context, baseDir, "@plasmicapp/host");
92
+ if (!hostVersion || semver.gt(requireds["@plasmicapp/host"], hostVersion)) {
93
+ yield confirmInstall("@plasmicapp/host", requireds["@plasmicapp/host"], {
94
+ global: false,
95
+ dev: false,
96
+ });
97
+ }
91
98
  if (context.config.code.reactRuntime === "automatic") {
92
99
  // Using automatic runtime requires installing the @plasmicapp/react-web-runtime package
93
100
  const runtimeVersion = npm_utils_1.findInstalledVersion(context, baseDir, "@plasmicapp/react-web-runtime");
package/dist/api.d.ts CHANGED
@@ -73,6 +73,7 @@ export interface VersionResolution {
73
73
  export interface RequiredPackages {
74
74
  "@plasmicapp/loader": string;
75
75
  "@plasmicapp/cli": string;
76
+ "@plasmicapp/host": string;
76
77
  "@plasmicapp/react-web": string;
77
78
  "@plasmicapp/react-web-runtime": string;
78
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicapp/cli",
3
- "version": "0.1.180",
3
+ "version": "0.1.181",
4
4
  "description": "plasmic cli for syncing local code with Plasmic designs",
5
5
  "engines": {
6
6
  "node": ">=12"
@@ -381,6 +381,7 @@ class PlasmicApi {
381
381
  return {
382
382
  "@plasmicapp/loader": "0.0.1",
383
383
  "@plasmicapp/cli": "0.0.1",
384
+ "@plasmicapp/host": "0.0.1",
384
385
  "@plasmicapp/react-web": "0.0.1",
385
386
  "@plasmicapp/react-web-runtime": "0.0.1",
386
387
  };
@@ -73,11 +73,12 @@ export async function initPlasmic(
73
73
  }
74
74
 
75
75
  const answer = await confirmWithUser(
76
- "@plasmicapp/react-web is a small runtime required by Plasmic-generated code.\n Do you want to add it now?",
76
+ "@plasmicapp/host and @plasmicapp/react-web are small runtimes required by Plasmic-generated code.\n Do you want to add them now?",
77
77
  opts.yes
78
78
  );
79
79
  if (answer) {
80
80
  installUpgrade("@plasmicapp/react-web", opts.baseDir);
81
+ installUpgrade("@plasmicapp/host", opts.baseDir);
81
82
  }
82
83
  }
83
84
 
@@ -143,6 +143,18 @@ async function ensureRequiredPackages(
143
143
  );
144
144
  }
145
145
 
146
+ const hostVersion = findInstalledVersion(
147
+ context,
148
+ baseDir,
149
+ "@plasmicapp/host"
150
+ );
151
+ if (!hostVersion || semver.gt(requireds["@plasmicapp/host"], hostVersion)) {
152
+ await confirmInstall("@plasmicapp/host", requireds["@plasmicapp/host"], {
153
+ global: false,
154
+ dev: false,
155
+ });
156
+ }
157
+
146
158
  if (context.config.code.reactRuntime === "automatic") {
147
159
  // Using automatic runtime requires installing the @plasmicapp/react-web-runtime package
148
160
  const runtimeVersion = findInstalledVersion(
package/src/api.ts CHANGED
@@ -94,6 +94,7 @@ export interface VersionResolution {
94
94
  export interface RequiredPackages {
95
95
  "@plasmicapp/loader": string;
96
96
  "@plasmicapp/cli": string;
97
+ "@plasmicapp/host": string;
97
98
  "@plasmicapp/react-web": string;
98
99
  "@plasmicapp/react-web-runtime": string;
99
100
  }