@plasmicapp/cli 0.1.307 → 0.1.308
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/dist/actions/export.d.ts +1 -3
- package/dist/index.js +178 -179
- package/dist/lib.d.ts +1 -0
- package/dist/lib.js +3404 -3139
- package/package.json +2 -2
- package/src/actions/export.ts +9 -14
- package/src/index.ts +6 -6
- package/src/lib.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicapp/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.308",
|
|
4
4
|
"description": "plasmic cli for syncing local code with Plasmic designs",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=12"
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"wrap-ansi": "^7.0.0",
|
|
79
79
|
"yargs": "^15.4.1"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "bf12f2268d3e2794698bee0996d4e2008b6827c5"
|
|
82
82
|
}
|
package/src/actions/export.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import { promises as fs } from "fs";
|
|
1
2
|
import { keyBy, snakeCase } from "lodash";
|
|
3
|
+
import path from "path";
|
|
2
4
|
import { CommonArgs } from "..";
|
|
3
|
-
import {
|
|
5
|
+
import { PlasmicApi, ProjectBundle } from "../api";
|
|
6
|
+
import {
|
|
7
|
+
fixAllImportStatements,
|
|
8
|
+
formatAsLocal,
|
|
9
|
+
maybeConvertTsxToJsx,
|
|
10
|
+
} from "../utils/code-utils";
|
|
4
11
|
import {
|
|
5
12
|
CodeConfig,
|
|
6
13
|
I18NConfig,
|
|
@@ -11,25 +18,15 @@ import {
|
|
|
11
18
|
} from "../utils/config-utils";
|
|
12
19
|
import { getContext, getCurrentOrDefaultAuth } from "../utils/get-context";
|
|
13
20
|
import { tuple } from "../utils/lang-utils";
|
|
14
|
-
import {
|
|
15
|
-
fixAllImportStatements,
|
|
16
|
-
formatAsLocal,
|
|
17
|
-
maybeConvertTsxToJsx,
|
|
18
|
-
} from "../utils/code-utils";
|
|
19
|
-
import { promises as fs, write } from "fs";
|
|
20
|
-
import path from "path";
|
|
21
21
|
import { DEFAULT_GLOBAL_CONTEXTS_NAME } from "./sync-global-contexts";
|
|
22
22
|
import { ensureImageAssetContents } from "./sync-images";
|
|
23
|
-
import { logger } from "../deps";
|
|
24
23
|
|
|
25
24
|
export interface ExportArgs extends CommonArgs {
|
|
26
25
|
projects: readonly string[];
|
|
27
26
|
platform: "" | "react" | "nextjs" | "gatsby";
|
|
28
27
|
codeLang: "" | "ts" | "js";
|
|
29
28
|
styleScheme: "" | "css" | "css-modules";
|
|
30
|
-
imagesScheme: "" | "inlined" | "files"
|
|
31
|
-
imagesPublicDir: string;
|
|
32
|
-
imagesPublicUrlPrefix: string;
|
|
29
|
+
imagesScheme: "" | "inlined" | "files";
|
|
33
30
|
i18NKeyScheme: "" | I18NConfig["keyScheme"];
|
|
34
31
|
i18NTagPrefix: "" | I18NConfig["tagPrefix"];
|
|
35
32
|
|
|
@@ -155,8 +152,6 @@ export async function exportProjectsCli(opts: ExportArgs): Promise<void> {
|
|
|
155
152
|
},
|
|
156
153
|
images: {
|
|
157
154
|
scheme: opts.imagesScheme || "files",
|
|
158
|
-
publicDir: opts.imagesPublicDir,
|
|
159
|
-
publicUrlPrefix: opts.imagesPublicUrlPrefix,
|
|
160
155
|
},
|
|
161
156
|
style: {
|
|
162
157
|
scheme: opts.styleScheme || "css-modules",
|
package/src/index.ts
CHANGED
|
@@ -314,12 +314,12 @@ yargs
|
|
|
314
314
|
.option("code-lang", getYargsOption("codeLang"))
|
|
315
315
|
.option("code-scheme", getYargsOption("codeScheme"))
|
|
316
316
|
.option("style-scheme", getYargsOption("styleScheme"))
|
|
317
|
-
.option("images-scheme",
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
"
|
|
321
|
-
|
|
322
|
-
)
|
|
317
|
+
.option("images-scheme", {
|
|
318
|
+
describe:
|
|
319
|
+
"How to reference used images in designs; either `inlined`, which puts base64-encoded images directly into the React component files, or `files`, which puts images on disk and imports them from component files.",
|
|
320
|
+
type: "string",
|
|
321
|
+
choices: ["inlined", "files"],
|
|
322
|
+
})
|
|
323
323
|
.option("i18n-key-scheme", getLocalizationYargs("key-scheme"))
|
|
324
324
|
.option("i18n-tag-prefix", getLocalizationYargs("tag-prefix")),
|
|
325
325
|
(argv) => handleError(exportProjectsCli(argv))
|