@plasmicapp/cli 0.1.303 → 0.1.305
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 +16 -0
- package/dist/actions/localization-strings.d.ts +9 -0
- package/dist/actions/sync-global-contexts.d.ts +1 -0
- package/dist/actions/sync-images.d.ts +1 -0
- package/dist/actions/sync.d.ts +0 -1
- package/dist/api.d.ts +22 -1
- package/dist/index.js +3582 -3321
- package/dist/lib.js +24 -45
- package/dist/utils/config-utils.d.ts +1 -11
- package/dist/utils/get-context.d.ts +6 -1
- package/dist/utils/test-utils.d.ts +1 -3
- package/package.json +2 -2
- package/src/__tests__/project-api-token-spec.ts +0 -51
- package/src/actions/export.ts +326 -0
- package/src/actions/localization-strings.ts +20 -1
- package/src/actions/sync-components.ts +1 -1
- package/src/actions/sync-global-contexts.ts +1 -0
- package/src/actions/sync-images.ts +1 -1
- package/src/actions/sync.ts +2 -55
- package/src/api.ts +34 -1
- package/src/index.ts +34 -20
- package/src/test-common/fixtures.ts +3 -4
- package/src/utils/config-utils.ts +0 -11
- package/src/utils/error.ts +2 -2
- package/src/utils/get-context.ts +7 -2
- package/src/utils/test-utils.ts +0 -10
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CommonArgs } from "..";
|
|
2
|
+
import { I18NConfig } from "../utils/config-utils";
|
|
3
|
+
export interface ExportArgs extends CommonArgs {
|
|
4
|
+
projects: readonly string[];
|
|
5
|
+
platform: "" | "react" | "nextjs" | "gatsby";
|
|
6
|
+
codeLang: "" | "ts" | "js";
|
|
7
|
+
styleScheme: "" | "css" | "css-modules";
|
|
8
|
+
imagesScheme: "" | "inlined" | "files" | "public-files";
|
|
9
|
+
imagesPublicDir: string;
|
|
10
|
+
imagesPublicUrlPrefix: string;
|
|
11
|
+
i18nKeyScheme: "" | I18NConfig["keyScheme"];
|
|
12
|
+
i18nTagPrefix: "" | I18NConfig["tagPrefix"];
|
|
13
|
+
skipFormatting?: boolean;
|
|
14
|
+
outDir: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function exportProjectsCli(opts: ExportArgs): Promise<void>;
|
|
@@ -10,4 +10,13 @@ export interface LocalizationStringsArgs extends CommonArgs {
|
|
|
10
10
|
tagPrefix: string | undefined;
|
|
11
11
|
excludeDeps: boolean | undefined;
|
|
12
12
|
}
|
|
13
|
+
export declare function getLocalizationYargs(key: "key-scheme" | "tag-prefix"): {
|
|
14
|
+
describe: string;
|
|
15
|
+
type: "string";
|
|
16
|
+
choices: string[];
|
|
17
|
+
} | {
|
|
18
|
+
describe: string;
|
|
19
|
+
type: "string";
|
|
20
|
+
choices?: undefined;
|
|
21
|
+
};
|
|
13
22
|
export declare function localizationStrings(opts: LocalizationStringsArgs): Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChecksumBundle, ProjectMetaBundle } from "../api";
|
|
2
2
|
import { PlasmicContext, ProjectConfig, ProjectLock } from "../utils/config-utils";
|
|
3
|
+
export declare const DEFAULT_GLOBAL_CONTEXTS_NAME = "PlasmicGlobalContextsProvider";
|
|
3
4
|
export declare function syncGlobalContexts(context: PlasmicContext, projectMeta: ProjectMetaBundle, projectConfig: ProjectConfig, projectLock: ProjectLock, checksums: ChecksumBundle, baseDir: string): Promise<void>;
|
|
4
5
|
export declare function getGlobalContextsResourcePath(context: PlasmicContext, projectConfig: ProjectConfig): string;
|
|
@@ -2,5 +2,6 @@ import { ChecksumBundle, ImageBundle } from "../api";
|
|
|
2
2
|
import { FixImportContext } from "../utils/code-utils";
|
|
3
3
|
import { PlasmicContext } from "../utils/config-utils";
|
|
4
4
|
export declare function syncProjectImageAssets(context: PlasmicContext, projectId: string, branchName: string, version: string, imageBundles: ImageBundle[], checksums: ChecksumBundle): Promise<void>;
|
|
5
|
+
export declare function ensureImageAssetContents(bundles: ImageBundle[]): Promise<void>;
|
|
5
6
|
export declare function fixComponentCssReferences(context: PlasmicContext, fixImportContext: FixImportContext, cssFilePath: string): Promise<void>;
|
|
6
7
|
export declare function fixComponentImagesReferences(context: PlasmicContext, fixImportContext: FixImportContext, renderModuleFilePath: string): Promise<boolean>;
|
package/dist/actions/sync.d.ts
CHANGED
package/dist/api.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface ComponentBundle {
|
|
|
13
13
|
cssFileName: string;
|
|
14
14
|
componentName: string;
|
|
15
15
|
id: string;
|
|
16
|
-
scheme:
|
|
16
|
+
scheme: "blackbox" | "plain";
|
|
17
17
|
nameInIdToUuid: Array<[string, string]>;
|
|
18
18
|
isPage: boolean;
|
|
19
19
|
plumeType?: string;
|
|
@@ -199,6 +199,27 @@ export declare class PlasmicApi {
|
|
|
199
199
|
wrapPagesWithGlobalContexts: boolean;
|
|
200
200
|
metadata?: Metadata;
|
|
201
201
|
}): Promise<ProjectBundle>;
|
|
202
|
+
/**
|
|
203
|
+
* Code-gen endpoint.
|
|
204
|
+
* This will fetch components from a given branch at an exact specified version
|
|
205
|
+
* using the "plain" scheme
|
|
206
|
+
*/
|
|
207
|
+
exportProject(projectId: string, branchName: string, opts: {
|
|
208
|
+
platform: string;
|
|
209
|
+
platformOptions: {
|
|
210
|
+
nextjs?: {
|
|
211
|
+
appDir: boolean;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
version: string;
|
|
215
|
+
imageOpts: ImagesConfig;
|
|
216
|
+
stylesOpts: StyleConfig;
|
|
217
|
+
i18nOpts?: I18NConfig;
|
|
218
|
+
codeOpts: Pick<CodeConfig, "lang">;
|
|
219
|
+
indirect: boolean;
|
|
220
|
+
wrapPagesWithGlobalContexts: boolean;
|
|
221
|
+
metadata?: Metadata;
|
|
222
|
+
}): Promise<ProjectBundle>;
|
|
202
223
|
projectMeta(projectId: string): Promise<ProjectMetaInfo>;
|
|
203
224
|
genLocalizationStrings(projects: readonly string[], format: "po" | "json" | "lingui", keyScheme: "content" | "hash" | "path", tagPrefix: string | undefined, projectIdsAndTokens: ProjectIdAndToken[], excludeDeps: boolean | undefined): Promise<string>;
|
|
204
225
|
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>;
|