@plasmicapp/cli 0.1.171 → 0.1.173

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.
@@ -13,14 +13,15 @@ exports.printProjectInfo = void 0;
13
13
  const deps_1 = require("../deps");
14
14
  const get_context_1 = require("../utils/get-context");
15
15
  function printProjectInfo(opts) {
16
+ var _a, _b;
16
17
  return __awaiter(this, void 0, void 0, function* () {
17
18
  let context = yield get_context_1.getContext(opts);
18
19
  const results = yield Promise.all(opts.projects.map((p) => __awaiter(this, void 0, void 0, function* () { return yield context.api.projectMeta(p); })));
19
20
  for (const meta of results) {
20
21
  deps_1.logger.info(`Id: ${meta.id}`);
21
22
  deps_1.logger.info(`Name: ${meta.name}`);
22
- deps_1.logger.info(`Host URL: ${meta.hostUrl}`);
23
- deps_1.logger.info(`Last published version: ${meta.lastPublishedVersion}`);
23
+ deps_1.logger.info(`Host URL: ${(_a = meta.hostUrl) !== null && _a !== void 0 ? _a : null}`);
24
+ deps_1.logger.info(`Last published version: ${(_b = meta.lastPublishedVersion) !== null && _b !== void 0 ? _b : null}`);
24
25
  }
25
26
  });
26
27
  }
package/dist/api.d.ts CHANGED
@@ -76,6 +76,13 @@ export interface RequiredPackages {
76
76
  "@plasmicapp/react-web": string;
77
77
  "@plasmicapp/react-web-runtime": string;
78
78
  }
79
+ export interface ProjectMetaInfo {
80
+ id: string;
81
+ name: string;
82
+ workspaceId?: string;
83
+ hostUrl?: string;
84
+ lastPublishedVersion?: string;
85
+ }
79
86
  export interface ProjectBundle {
80
87
  components: ComponentBundle[];
81
88
  codeComponentMetas: CodeComponentMeta[];
@@ -179,6 +186,7 @@ export declare class PlasmicApi {
179
186
  indirect: boolean;
180
187
  metadata?: Metadata;
181
188
  }): Promise<ProjectBundle>;
189
+ projectMeta(projectId: string): Promise<ProjectMetaInfo>;
182
190
  uploadBundle(projectId: string, bundleName: string, bundleJs: string, css: string[], metaJson: string, genModulePath: string | undefined, genCssPaths: string[], pkgVersion: string | undefined, extraPropMetaJson: string | undefined, themeProviderWrapper: string | undefined, themeModule: string | undefined): Promise<StyleTokensMap>;
183
191
  projectStyleTokens(projectId: string, versionRange?: string): Promise<StyleTokensMap>;
184
192
  projectIcons(projectId: string, versionRange?: string, iconIds?: string[]): Promise<ProjectIconsResponse>;
package/dist/api.js CHANGED
@@ -93,6 +93,12 @@ class PlasmicApi {
93
93
  return result.data;
94
94
  });
95
95
  }
96
+ projectMeta(projectId) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ const result = yield this.post(`${this.codegenHost}/api/v1/projects/${projectId}/code/meta`);
99
+ return result.data;
100
+ });
101
+ }
96
102
  uploadBundle(projectId, bundleName, bundleJs, css, metaJson, genModulePath, genCssPaths, pkgVersion, extraPropMetaJson, themeProviderWrapper, themeModule) {
97
103
  return __awaiter(this, void 0, void 0, function* () {
98
104
  const result = yield this.post(`${this.codegenHost}/api/v1/projects/${projectId}/jsbundle/upload`, {
package/dist/index.js CHANGED
@@ -28,6 +28,7 @@ const update_notifier_1 = __importDefault(require("update-notifier"));
28
28
  const yargs_1 = __importDefault(require("yargs"));
29
29
  const auth = __importStar(require("./actions/auth"));
30
30
  const fix_imports_1 = require("./actions/fix-imports");
31
+ const info_1 = require("./actions/info");
31
32
  const init_1 = require("./actions/init");
32
33
  const projectToken = __importStar(require("./actions/project-token"));
33
34
  const sync_1 = require("./actions/sync");
@@ -118,6 +119,14 @@ yargs_1.default
118
119
  }));
119
120
  })
120
121
  .command("fix-imports", "Fixes import paths after you've moved around Plasmic blackbox files", (yags) => 0, (argv) => error_1.handleError(fix_imports_1.fixImports(argv)))
122
+ .command("info", "Fetches metadata for projects", (yags) => yags.option("projects", {
123
+ alias: "p",
124
+ describe: "ID of plasmic project to check",
125
+ type: "array",
126
+ default: [],
127
+ }), (argv) => {
128
+ error_1.handleError(info_1.printProjectInfo(argv));
129
+ })
121
130
  .command("upload-bundle", false, (yargs) => yargs
122
131
  .option("project", {
123
132
  alias: "p",
@@ -353,6 +353,9 @@
353
353
  "css-modules"
354
354
  ],
355
355
  "type": "string"
356
+ },
357
+ "skipGlobalCssImport": {
358
+ "type": "boolean"
356
359
  }
357
360
  },
358
361
  "required": [
@@ -73,6 +73,7 @@ export interface StyleConfig {
73
73
  scheme: "css" | "css-modules";
74
74
  /** File location for global css styles shared by all components. Relative to srcDir */
75
75
  defaultStyleCssFilePath: string;
76
+ skipGlobalCssImport?: boolean;
76
77
  }
77
78
  export interface ImagesConfig {
78
79
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plasmicapp/cli",
3
- "version": "0.1.171",
3
+ "version": "0.1.173",
4
4
  "description": "plasmic cli for syncing local code with Plasmic designs",
5
5
  "engines": {
6
6
  "node": ">=12"
@@ -0,0 +1,20 @@
1
+ import { CommonArgs } from "..";
2
+ import { logger } from "../deps";
3
+ import { getContext } from "../utils/get-context";
4
+
5
+ export interface InfoArgs extends CommonArgs {
6
+ projects: readonly string[];
7
+ }
8
+
9
+ export async function printProjectInfo(opts: InfoArgs): Promise<void> {
10
+ let context = await getContext(opts);
11
+ const results = await Promise.all(
12
+ opts.projects.map(async (p) => await context.api.projectMeta(p))
13
+ );
14
+ for (const meta of results) {
15
+ logger.info(`Id: ${meta.id}`);
16
+ logger.info(`Name: ${meta.name}`);
17
+ logger.info(`Host URL: ${meta.hostUrl ?? null}`);
18
+ logger.info(`Last published version: ${meta.lastPublishedVersion ?? null}`);
19
+ }
20
+ }
package/src/api.ts CHANGED
@@ -98,6 +98,14 @@ export interface RequiredPackages {
98
98
  "@plasmicapp/react-web-runtime": string;
99
99
  }
100
100
 
101
+ export interface ProjectMetaInfo {
102
+ id: string;
103
+ name: string;
104
+ workspaceId?: string;
105
+ hostUrl?: string;
106
+ lastPublishedVersion?: string;
107
+ }
108
+
101
109
  export interface ProjectBundle {
102
110
  components: ComponentBundle[];
103
111
  codeComponentMetas: CodeComponentMeta[];
@@ -270,6 +278,13 @@ export class PlasmicApi {
270
278
  return result.data as ProjectBundle;
271
279
  }
272
280
 
281
+ async projectMeta(projectId: string) {
282
+ const result = await this.post(
283
+ `${this.codegenHost}/api/v1/projects/${projectId}/code/meta`
284
+ );
285
+ return result.data as ProjectMetaInfo;
286
+ }
287
+
273
288
  async uploadBundle(
274
289
  projectId: string,
275
290
  bundleName: string,
package/src/index.ts CHANGED
@@ -4,6 +4,7 @@ import updateNotifier from "update-notifier";
4
4
  import yargs from "yargs";
5
5
  import * as auth from "./actions/auth";
6
6
  import { fixImports, FixImportsArgs } from "./actions/fix-imports";
7
+ import { InfoArgs, printProjectInfo } from "./actions/info";
7
8
  import { getYargsOption, InitArgs, initPlasmic } from "./actions/init";
8
9
  import * as projectToken from "./actions/project-token";
9
10
  import { sync, SyncArgs } from "./actions/sync";
@@ -134,6 +135,20 @@ yargs
134
135
  (yags) => 0,
135
136
  (argv) => handleError(fixImports(argv))
136
137
  )
138
+ .command<InfoArgs>(
139
+ "info",
140
+ "Fetches metadata for projects",
141
+ (yags) =>
142
+ yags.option("projects", {
143
+ alias: "p",
144
+ describe: "ID of plasmic project to check",
145
+ type: "array",
146
+ default: [],
147
+ }),
148
+ (argv) => {
149
+ handleError(printProjectInfo(argv));
150
+ }
151
+ )
137
152
  .command<UploadBundleArgs>(
138
153
  "upload-bundle",
139
154
  false,
@@ -108,6 +108,8 @@ export interface StyleConfig {
108
108
 
109
109
  /** File location for global css styles shared by all components. Relative to srcDir */
110
110
  defaultStyleCssFilePath: string;
111
+
112
+ skipGlobalCssImport?: boolean;
111
113
  }
112
114
 
113
115
  export interface ImagesConfig {