@vtex-email/cli 0.0.0
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/bin.d.ts +2 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +2969 -0
- package/dist/commands/args.d.ts +39 -0
- package/dist/commands/args.d.ts.map +1 -0
- package/dist/commands/dev-notices.d.ts +51 -0
- package/dist/commands/dev-notices.d.ts.map +1 -0
- package/dist/commands/dev-presenter.d.ts +20 -0
- package/dist/commands/dev-presenter.d.ts.map +1 -0
- package/dist/commands/dev.d.ts +6 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/preview-export.d.ts +8 -0
- package/dist/commands/preview-export.d.ts.map +1 -0
- package/dist/commands/project-commands.d.ts +9 -0
- package/dist/commands/project-commands.d.ts.map +1 -0
- package/dist/commands/report.d.ts +40 -0
- package/dist/commands/report.d.ts.map +1 -0
- package/dist/commands/run.d.ts +3 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/config/config.d.ts +81 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/load-config.d.ts +10 -0
- package/dist/config/load-config.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +126 -0
- package/dist/project/build-project.d.ts +21 -0
- package/dist/project/build-project.d.ts.map +1 -0
- package/dist/project/catalogs.d.ts +4 -0
- package/dist/project/catalogs.d.ts.map +1 -0
- package/dist/project/compile-email.d.ts +4 -0
- package/dist/project/compile-email.d.ts.map +1 -0
- package/dist/project/discover.d.ts +15 -0
- package/dist/project/discover.d.ts.map +1 -0
- package/dist/project/fixtures.d.ts +8 -0
- package/dist/project/fixtures.d.ts.map +1 -0
- package/dist/project/manifest.d.ts +4 -0
- package/dist/project/manifest.d.ts.map +1 -0
- package/dist/project/merge-variants.d.ts +17 -0
- package/dist/project/merge-variants.d.ts.map +1 -0
- package/dist/project/module-loader.d.ts +12 -0
- package/dist/project/module-loader.d.ts.map +1 -0
- package/dist/project/policy.d.ts +4 -0
- package/dist/project/policy.d.ts.map +1 -0
- package/dist/project/preview-evaluation.d.ts +26 -0
- package/dist/project/preview-evaluation.d.ts.map +1 -0
- package/dist/project/revalidate.d.ts +4 -0
- package/dist/project/revalidate.d.ts.map +1 -0
- package/dist/project/settings.d.ts +9 -0
- package/dist/project/settings.d.ts.map +1 -0
- package/dist/project/types.d.ts +113 -0
- package/dist/project/types.d.ts.map +1 -0
- package/dist/project/write-output.d.ts +12 -0
- package/dist/project/write-output.d.ts.map +1 -0
- package/dist/project-api.d.ts +10 -0
- package/dist/project-api.d.ts.map +1 -0
- package/dist/project.d.ts +11 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +2590 -0
- package/package.json +35 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type OutputFormat = 'text' | 'json';
|
|
2
|
+
export type ParsedArgs = {
|
|
3
|
+
kind: 'help';
|
|
4
|
+
} | {
|
|
5
|
+
kind: 'version';
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'error';
|
|
8
|
+
format: OutputFormat;
|
|
9
|
+
message: string;
|
|
10
|
+
config?: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'build';
|
|
13
|
+
format: OutputFormat;
|
|
14
|
+
config?: string;
|
|
15
|
+
warningsAsErrors: boolean;
|
|
16
|
+
locale?: string;
|
|
17
|
+
emailId?: string;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'validate';
|
|
20
|
+
format: OutputFormat;
|
|
21
|
+
config?: string;
|
|
22
|
+
warningsAsErrors: boolean;
|
|
23
|
+
} | {
|
|
24
|
+
kind: 'dev';
|
|
25
|
+
format: OutputFormat;
|
|
26
|
+
config?: string;
|
|
27
|
+
warningsAsErrors: boolean;
|
|
28
|
+
} | {
|
|
29
|
+
kind: 'preview';
|
|
30
|
+
format: OutputFormat;
|
|
31
|
+
config?: string;
|
|
32
|
+
warningsAsErrors: boolean;
|
|
33
|
+
emailId: string;
|
|
34
|
+
fixtureId: string;
|
|
35
|
+
outDir: string;
|
|
36
|
+
};
|
|
37
|
+
export declare function parseArgs(argv: readonly string[]): ParsedArgs;
|
|
38
|
+
export declare function helpText(): string;
|
|
39
|
+
//# sourceMappingURL=args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/commands/args.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAA;AAE1C,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACzE;IACE,IAAI,EAAE,OAAO,CAAA;IACb,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,OAAO,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,GACD;IACE,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,OAAO,CAAA;CAC1B,GACD;IACE,IAAI,EAAE,KAAK,CAAA;IACX,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,OAAO,CAAA;CAC1B,GACD;IACE,IAAI,EAAE,SAAS,CAAA;IACf,MAAM,EAAE,YAAY,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,OAAO,CAAA;IACzB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAIL,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAwH7D;AAED,wBAAgB,QAAQ,IAAI,MAAM,CAgBjC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Diagnostic } from '@vtex-email/core';
|
|
2
|
+
export type DevPhase = 'config' | 'compile' | 'server';
|
|
3
|
+
export type DevIngestPlan = {
|
|
4
|
+
kind: 'full';
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'partial';
|
|
7
|
+
compile: string[];
|
|
8
|
+
fixtures: string[];
|
|
9
|
+
schemas: string[];
|
|
10
|
+
};
|
|
11
|
+
export type DevNotice = {
|
|
12
|
+
kind: 'version';
|
|
13
|
+
version: string;
|
|
14
|
+
} | {
|
|
15
|
+
kind: 'phase';
|
|
16
|
+
phase: DevPhase;
|
|
17
|
+
} | {
|
|
18
|
+
kind: 'project';
|
|
19
|
+
name: string;
|
|
20
|
+
} | {
|
|
21
|
+
kind: 'discovered';
|
|
22
|
+
emails: number;
|
|
23
|
+
fixtures: number;
|
|
24
|
+
} | {
|
|
25
|
+
kind: 'listening';
|
|
26
|
+
url: string;
|
|
27
|
+
} | {
|
|
28
|
+
kind: 'startup';
|
|
29
|
+
templatesReady: boolean;
|
|
30
|
+
elapsedMs: number;
|
|
31
|
+
diagnostics: readonly Diagnostic[];
|
|
32
|
+
} | {
|
|
33
|
+
kind: 'failed';
|
|
34
|
+
exitCode: 1 | 2;
|
|
35
|
+
diagnostics: readonly Diagnostic[];
|
|
36
|
+
} | {
|
|
37
|
+
kind: 'ingest';
|
|
38
|
+
plan: DevIngestPlan;
|
|
39
|
+
failed: boolean;
|
|
40
|
+
added: readonly string[];
|
|
41
|
+
removed: readonly string[];
|
|
42
|
+
diagnostics: readonly Diagnostic[];
|
|
43
|
+
} | {
|
|
44
|
+
kind: 'vite';
|
|
45
|
+
level: 'warn' | 'error';
|
|
46
|
+
message: string;
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'stopped';
|
|
49
|
+
};
|
|
50
|
+
export type DevNoticeHandler = (notice: DevNotice) => void | Promise<void>;
|
|
51
|
+
//# sourceMappingURL=dev-notices.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-notices.d.ts","sourceRoot":"","sources":["../../src/commands/dev-notices.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,CAAA;AAEtD,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,EAAE,CAAA;CAAE,CAAA;AAEjF,MAAM,MAAM,SAAS,GACjB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACpC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,QAAQ,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACjC;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAClC;IACE,IAAI,EAAE,SAAS,CAAA;IACf,cAAc,EAAE,OAAO,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,SAAS,UAAU,EAAE,CAAA;CACnC,GACD;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAA;IACf,WAAW,EAAE,SAAS,UAAU,EAAE,CAAA;CACnC,GACD;IACE,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,aAAa,CAAA;IACnB,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1B,WAAW,EAAE,SAAS,UAAU,EAAE,CAAA;CACnC,GACD;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAA;AAEvB,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,SAAS,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DevNotice } from './dev-notices';
|
|
2
|
+
/** Classic ASCII block for “VTEX”; “email React” sits under it. Max line width is 30. */
|
|
3
|
+
export declare const BANNER_ASCII: readonly ["__ ___ _____ _______ __", "\\ \\ / / |_ _| ____\\ \\/ /", " \\ \\ / / | | | _| \\ / ", " \\ V / | | | |___ / \\ ", " \\_/ |_| |_____/_/\\_\\", " email React"];
|
|
4
|
+
export declare const BANNER_COMPACT = "VTEX email React";
|
|
5
|
+
export interface DevPresenterOptions {
|
|
6
|
+
version: string;
|
|
7
|
+
format: 'text' | 'json';
|
|
8
|
+
stdout?: NodeJS.WriteStream;
|
|
9
|
+
stderr?: NodeJS.WriteStream;
|
|
10
|
+
env?: NodeJS.ProcessEnv;
|
|
11
|
+
columns?: number | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface DevPresenter {
|
|
14
|
+
printBanner(): Promise<void>;
|
|
15
|
+
handle(notice: DevNotice): Promise<void>;
|
|
16
|
+
}
|
|
17
|
+
export declare function createDevPresenter(options: DevPresenterOptions): DevPresenter;
|
|
18
|
+
export declare function supportsColor(stream: NodeJS.WriteStream, env?: NodeJS.ProcessEnv): boolean;
|
|
19
|
+
export declare function bannerWidth(): number;
|
|
20
|
+
//# sourceMappingURL=dev-presenter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-presenter.d.ts","sourceRoot":"","sources":["../../src/commands/dev-presenter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C,yFAAyF;AACzF,eAAO,MAAM,YAAY,kNAOf,CAAA;AAEV,eAAO,MAAM,cAAc,qBAAqB,CAAA;AAIhD,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAA;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC,WAAW,CAAA;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7B;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACzC;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,YAAY,CA4F7E;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAKvG;AAED,wBAAgB,WAAW,IAAI,MAAM,CAEpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../src/commands/dev.ts"],"names":[],"mappings":"AAUA,wBAAsB,eAAe,CACnC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE;IAAE,gBAAgB,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAC/E,OAAO,CAAC,MAAM,CAAC,CAiCjB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function runPreviewExport(configPath: string, configDir: string, cwd: string, options: {
|
|
2
|
+
emailId: string;
|
|
3
|
+
fixtureId: string;
|
|
4
|
+
outDir: string;
|
|
5
|
+
warningsAsErrors: boolean;
|
|
6
|
+
format: 'text' | 'json';
|
|
7
|
+
}): Promise<number>;
|
|
8
|
+
//# sourceMappingURL=preview-export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-export.d.ts","sourceRoot":"","sources":["../../src/commands/preview-export.ts"],"names":[],"mappings":"AAKA,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;IACP,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,EAAE,OAAO,CAAA;IACzB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB,GACA,OAAO,CAAC,MAAM,CAAC,CAsBjB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CliReport } from './report';
|
|
2
|
+
export declare function runProjectCommand(kind: 'build' | 'validate', configPath: string, configDir: string, options: {
|
|
3
|
+
warningsAsErrors?: boolean;
|
|
4
|
+
emailId?: string;
|
|
5
|
+
locale?: string;
|
|
6
|
+
format: 'text' | 'json';
|
|
7
|
+
}): Promise<number>;
|
|
8
|
+
export declare function usageReport(message: string, configDir: string): CliReport;
|
|
9
|
+
//# sourceMappingURL=project-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-commands.d.ts","sourceRoot":"","sources":["../../src/commands/project-commands.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,UAAU,CAAA;AAElE,wBAAsB,iBAAiB,CACrC,IAAI,EAAE,OAAO,GAAG,UAAU,EAC1B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAClG,OAAO,CAAC,MAAM,CAAC,CAejB;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,CAWzE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Diagnostic } from '@vtex-email/core';
|
|
2
|
+
export type CliDiagnostic = Diagnostic;
|
|
3
|
+
interface ReportedManifest {
|
|
4
|
+
formatVersion: 1;
|
|
5
|
+
homologation: 'experimental';
|
|
6
|
+
}
|
|
7
|
+
export interface UnverifiedCapability {
|
|
8
|
+
templateId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
evidence: string;
|
|
11
|
+
severity: 'error' | 'warning';
|
|
12
|
+
}
|
|
13
|
+
export interface CliReport {
|
|
14
|
+
formatVersion: 1;
|
|
15
|
+
command: 'build' | 'validate' | 'preview' | 'usage';
|
|
16
|
+
ok: boolean;
|
|
17
|
+
exitCode: 0 | 1 | 2;
|
|
18
|
+
diagnostics: CliDiagnostic[];
|
|
19
|
+
manifest: ReportedManifest | null;
|
|
20
|
+
wrote: string[];
|
|
21
|
+
preserved: string[];
|
|
22
|
+
unverifiedCapabilities: UnverifiedCapability[];
|
|
23
|
+
}
|
|
24
|
+
export declare function publishDiagnostics(diagnostics: readonly Diagnostic[], configDir: string): Diagnostic[];
|
|
25
|
+
export declare function buildReport(input: {
|
|
26
|
+
command: CliReport['command'];
|
|
27
|
+
ok: boolean;
|
|
28
|
+
exitCode: 0 | 1 | 2;
|
|
29
|
+
diagnostics: readonly Diagnostic[];
|
|
30
|
+
manifest: ReportedManifest | null;
|
|
31
|
+
wrote: readonly string[];
|
|
32
|
+
preserved: readonly string[];
|
|
33
|
+
configDir: string;
|
|
34
|
+
}): CliReport;
|
|
35
|
+
export declare function reportJson(report: CliReport): string;
|
|
36
|
+
export declare function reportText(report: CliReport): string;
|
|
37
|
+
export declare function emitReport(report: CliReport, format: 'text' | 'json'): Promise<void>;
|
|
38
|
+
export declare function writeStream(stream: NodeJS.WriteStream, text: string): Promise<void>;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/commands/report.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,MAAM,MAAM,aAAa,GAAG,UAAU,CAAA;AAEtC,UAAU,gBAAgB;IACxB,aAAa,EAAE,CAAC,CAAA;IAChB,YAAY,EAAE,cAAc,CAAA;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,MAAM,WAAW,SAAS;IACxB,aAAa,EAAE,CAAC,CAAA;IAChB,OAAO,EAAE,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAA;IACnD,EAAE,EAAE,OAAO,CAAA;IACX,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACnB,WAAW,EAAE,aAAa,EAAE,CAAA;IAC5B,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;IACjC,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,sBAAsB,EAAE,oBAAoB,EAAE,CAAA;CAC/C;AAED,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,EAAE,CAEtG;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE;IACjC,OAAO,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC7B,EAAE,EAAE,OAAO,CAAA;IACX,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACnB,WAAW,EAAE,SAAS,UAAU,EAAE,CAAA;IAClC,QAAQ,EAAE,gBAAgB,GAAG,IAAI,CAAA;IACjC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;IACxB,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5B,SAAS,EAAE,MAAM,CAAA;CAClB,GAAG,SAAS,CAaZ;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAEpD;AAED,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,CAcpD;AAwDD,wBAAsB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO1F;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQnF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,UAAU,EAAE,MAAM,QAAQ,CAAA;AAMlD,wBAAsB,GAAG,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqCzF"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { CompileEmailInput } from '@vtex-email/react';
|
|
2
|
+
import { type Diagnostic } from '@vtex-email/core';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
declare const ConfigSchema: z.ZodObject<{
|
|
5
|
+
emails: z.ZodArray<z.ZodString>;
|
|
6
|
+
outDir: z.ZodString;
|
|
7
|
+
fixturesDir: z.ZodOptional<z.ZodString>;
|
|
8
|
+
schemasDir: z.ZodOptional<z.ZodString>;
|
|
9
|
+
target: z.ZodObject<{
|
|
10
|
+
profile: z.ZodString;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
i18n: z.ZodObject<{
|
|
13
|
+
locales: z.ZodArray<z.ZodString>;
|
|
14
|
+
defaultLocale: z.ZodString;
|
|
15
|
+
catalogs: z.ZodString;
|
|
16
|
+
missingKey: z.ZodLiteral<"error">;
|
|
17
|
+
localePath: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strict>;
|
|
19
|
+
tailwind: z.ZodCustom<import("@react-email/components").TailwindConfig, import("@react-email/components").TailwindConfig>;
|
|
20
|
+
validation: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
unknownPath: z.ZodEnum<{
|
|
22
|
+
error: "error";
|
|
23
|
+
warning: "warning";
|
|
24
|
+
}>;
|
|
25
|
+
unverifiedCapability: z.ZodEnum<{
|
|
26
|
+
error: "error";
|
|
27
|
+
warning: "warning";
|
|
28
|
+
}>;
|
|
29
|
+
warningsAsErrors: z.ZodBoolean;
|
|
30
|
+
}, z.core.$strict>>;
|
|
31
|
+
compatibility: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
policy: z.ZodLiteral<"conservative">;
|
|
33
|
+
maxSourceBytes: z.ZodNumber;
|
|
34
|
+
warnRenderedBytes: z.ZodNumber;
|
|
35
|
+
}, z.core.$strict>>;
|
|
36
|
+
preview: z.ZodOptional<z.ZodObject<{
|
|
37
|
+
host: z.ZodString;
|
|
38
|
+
port: z.ZodNumber;
|
|
39
|
+
}, z.core.$strict>>;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
export interface ProjectConfig extends z.infer<typeof ConfigSchema> {
|
|
42
|
+
}
|
|
43
|
+
export interface ResolvedConfig {
|
|
44
|
+
configDir: string;
|
|
45
|
+
emails: string[];
|
|
46
|
+
outDir: string;
|
|
47
|
+
fixturesDir: string;
|
|
48
|
+
schemasDir: string;
|
|
49
|
+
localePath: string | null;
|
|
50
|
+
profilePath: string;
|
|
51
|
+
locales: string[];
|
|
52
|
+
defaultLocale: string;
|
|
53
|
+
catalogs: string;
|
|
54
|
+
tailwind: CompileEmailInput['tailwind'];
|
|
55
|
+
validation: {
|
|
56
|
+
unknownPath: 'error' | 'warning';
|
|
57
|
+
unverifiedCapability: 'error' | 'warning';
|
|
58
|
+
warningsAsErrors: boolean;
|
|
59
|
+
};
|
|
60
|
+
compatibility: {
|
|
61
|
+
policy: 'conservative';
|
|
62
|
+
maxSourceBytes: number;
|
|
63
|
+
warnRenderedBytes: number;
|
|
64
|
+
};
|
|
65
|
+
preview: {
|
|
66
|
+
host: string;
|
|
67
|
+
port: number;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export declare function defineConfig<T extends ProjectConfig>(config: T): T;
|
|
71
|
+
export declare function validateConfig(value: unknown, configDir: string): {
|
|
72
|
+
ok: true;
|
|
73
|
+
config: ResolvedConfig;
|
|
74
|
+
} | {
|
|
75
|
+
ok: false;
|
|
76
|
+
diagnostics: Diagnostic[];
|
|
77
|
+
};
|
|
78
|
+
export declare function configuredOutputError(config: ResolvedConfig, candidate: string): string | null;
|
|
79
|
+
export declare function outputDirectoryError(configDir: string, outDir: string, sourceDirs: readonly string[]): string | null;
|
|
80
|
+
export {};
|
|
81
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAE1D,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAEnE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAqBvB,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAsChB,CAAA;AAEF,MAAM,WAAW,aAAc,SAAQ,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC;CAAG;AAEtE,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAA;IACvC,UAAU,EAAE;QACV,WAAW,EAAE,OAAO,GAAG,SAAS,CAAA;QAChC,oBAAoB,EAAE,OAAO,GAAG,SAAS,CAAA;QACzC,gBAAgB,EAAE,OAAO,CAAA;KAC1B,CAAA;IACD,aAAa,EAAE;QACb,MAAM,EAAE,cAAc,CAAA;QACtB,cAAc,EAAE,MAAM,CAAA;QACtB,iBAAiB,EAAE,MAAM,CAAA;KAC1B,CAAA;IACD,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAA;QACZ,IAAI,EAAE,MAAM,CAAA;KACb,CAAA;CACF;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,aAAa,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAElE;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,MAAM,GAChB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,WAAW,EAAE,UAAU,EAAE,CAAA;CAAE,CA6CjF;AASD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAS9F;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAUpH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Diagnostic } from '@vtex-email/core';
|
|
2
|
+
import { type ResolvedConfig } from './config';
|
|
3
|
+
export declare function loadProjectConfig(configPath: string): Promise<{
|
|
4
|
+
ok: true;
|
|
5
|
+
config: ResolvedConfig;
|
|
6
|
+
} | {
|
|
7
|
+
ok: false;
|
|
8
|
+
diagnostics: Diagnostic[];
|
|
9
|
+
}>;
|
|
10
|
+
//# sourceMappingURL=load-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../src/config/load-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAInE,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9D,wBAAsB,iBAAiB,CACrC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,WAAW,EAAE,UAAU,EAAE,CAAA;CAAE,CAAC,CAU1F"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,iBAAiB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// src/config/config.ts
|
|
2
|
+
import { errorDiagnostic } from "@vtex-email/core";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
var defaults = {
|
|
6
|
+
fixturesDir: "fixtures",
|
|
7
|
+
schemasDir: "schemas",
|
|
8
|
+
validation: {
|
|
9
|
+
unknownPath: "error",
|
|
10
|
+
unverifiedCapability: "error",
|
|
11
|
+
warningsAsErrors: false
|
|
12
|
+
},
|
|
13
|
+
compatibility: {
|
|
14
|
+
policy: "conservative",
|
|
15
|
+
maxSourceBytes: 25e4,
|
|
16
|
+
warnRenderedBytes: 9e4
|
|
17
|
+
},
|
|
18
|
+
preview: {
|
|
19
|
+
host: "127.0.0.1",
|
|
20
|
+
port: 3e3
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var ConfigSchema = z.strictObject({
|
|
24
|
+
emails: z.array(z.string().min(1)).min(1),
|
|
25
|
+
outDir: z.string().min(1),
|
|
26
|
+
fixturesDir: z.string().min(1).optional(),
|
|
27
|
+
schemasDir: z.string().min(1).optional(),
|
|
28
|
+
target: z.strictObject({
|
|
29
|
+
profile: z.string().min(1)
|
|
30
|
+
}),
|
|
31
|
+
i18n: z.strictObject({
|
|
32
|
+
locales: z.array(z.string().min(1)).min(1),
|
|
33
|
+
defaultLocale: z.string().min(1),
|
|
34
|
+
catalogs: z.string().min(1),
|
|
35
|
+
missingKey: z.literal("error"),
|
|
36
|
+
localePath: z.string().min(1).optional()
|
|
37
|
+
}),
|
|
38
|
+
tailwind: z.custom(
|
|
39
|
+
(value) => value !== null && typeof value === "object" && !Array.isArray(value)
|
|
40
|
+
),
|
|
41
|
+
validation: z.strictObject({
|
|
42
|
+
unknownPath: z.enum(["error", "warning"]),
|
|
43
|
+
unverifiedCapability: z.enum(["error", "warning"]),
|
|
44
|
+
warningsAsErrors: z.boolean()
|
|
45
|
+
}).optional(),
|
|
46
|
+
compatibility: z.strictObject({
|
|
47
|
+
policy: z.literal("conservative"),
|
|
48
|
+
maxSourceBytes: z.number().int().positive(),
|
|
49
|
+
warnRenderedBytes: z.number().int().positive()
|
|
50
|
+
}).optional(),
|
|
51
|
+
preview: z.strictObject({
|
|
52
|
+
host: z.string().min(1),
|
|
53
|
+
port: z.number().int().positive()
|
|
54
|
+
}).optional()
|
|
55
|
+
});
|
|
56
|
+
function defineConfig(config) {
|
|
57
|
+
return config;
|
|
58
|
+
}
|
|
59
|
+
function validateConfig(value, configDir) {
|
|
60
|
+
const parsed = ConfigSchema.safeParse(value);
|
|
61
|
+
if (!parsed.success) {
|
|
62
|
+
return {
|
|
63
|
+
ok: false,
|
|
64
|
+
diagnostics: parsed.error.issues.map(
|
|
65
|
+
(issue) => errorDiagnostic("CFG001", issue.message, {
|
|
66
|
+
path: issue.path.join(".")
|
|
67
|
+
})
|
|
68
|
+
)
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if (!parsed.data.i18n.locales.includes(parsed.data.i18n.defaultLocale)) {
|
|
72
|
+
return { ok: false, diagnostics: [errorDiagnostic("CFG001", "defaultLocale must be one of locales.")] };
|
|
73
|
+
}
|
|
74
|
+
const fixturesDir = parsed.data.fixturesDir ?? defaults.fixturesDir;
|
|
75
|
+
const schemasDir = parsed.data.schemasDir ?? defaults.schemasDir;
|
|
76
|
+
const outDir = path.resolve(configDir, parsed.data.outDir);
|
|
77
|
+
const sourceDirs = [
|
|
78
|
+
staticRoot(parsed.data.emails[0] ?? "emails"),
|
|
79
|
+
staticRoot(parsed.data.i18n.catalogs),
|
|
80
|
+
staticRoot(fixturesDir),
|
|
81
|
+
staticRoot(schemasDir)
|
|
82
|
+
];
|
|
83
|
+
const outputError = outputDirectoryError(configDir, outDir, sourceDirs);
|
|
84
|
+
if (outputError) return { ok: false, diagnostics: [errorDiagnostic("CFG001", outputError)] };
|
|
85
|
+
return {
|
|
86
|
+
ok: true,
|
|
87
|
+
config: {
|
|
88
|
+
configDir,
|
|
89
|
+
emails: parsed.data.emails,
|
|
90
|
+
outDir,
|
|
91
|
+
fixturesDir,
|
|
92
|
+
schemasDir,
|
|
93
|
+
localePath: parsed.data.i18n.localePath ?? null,
|
|
94
|
+
profilePath: path.resolve(configDir, parsed.data.target.profile),
|
|
95
|
+
locales: parsed.data.i18n.locales,
|
|
96
|
+
defaultLocale: parsed.data.i18n.defaultLocale,
|
|
97
|
+
catalogs: parsed.data.i18n.catalogs,
|
|
98
|
+
tailwind: parsed.data.tailwind,
|
|
99
|
+
validation: { ...defaults.validation, ...parsed.data.validation },
|
|
100
|
+
compatibility: { ...defaults.compatibility, ...parsed.data.compatibility },
|
|
101
|
+
preview: { ...defaults.preview, ...parsed.data.preview }
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function staticRoot(pattern) {
|
|
106
|
+
const normalized = pattern.replaceAll("\\", "/");
|
|
107
|
+
const [first] = normalized.split("/");
|
|
108
|
+
if (!first || first.includes("*")) return "";
|
|
109
|
+
return first;
|
|
110
|
+
}
|
|
111
|
+
function outputDirectoryError(configDir, outDir, sourceDirs) {
|
|
112
|
+
const relativeToOutput = path.relative(outDir, configDir);
|
|
113
|
+
if (relativeToOutput === "" || !relativeToOutput.startsWith("..") && !path.isAbsolute(relativeToOutput)) {
|
|
114
|
+
return "outDir cannot be the project root or an ancestor of it.";
|
|
115
|
+
}
|
|
116
|
+
for (const source of sourceDirs) {
|
|
117
|
+
if (source.length === 0) continue;
|
|
118
|
+
if (path.resolve(configDir, source) === outDir) return "outDir cannot be a source directory.";
|
|
119
|
+
}
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
export {
|
|
123
|
+
defineConfig,
|
|
124
|
+
outputDirectoryError,
|
|
125
|
+
validateConfig
|
|
126
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ResolvedConfig } from '../config/config';
|
|
2
|
+
import { type ProjectResult } from './types';
|
|
3
|
+
export declare function buildProject(input: {
|
|
4
|
+
configPath: string;
|
|
5
|
+
onlyId?: string;
|
|
6
|
+
write?: boolean;
|
|
7
|
+
warningsAsErrors?: boolean;
|
|
8
|
+
locale?: string;
|
|
9
|
+
}): Promise<ProjectResult>;
|
|
10
|
+
export declare function validateProject(input: {
|
|
11
|
+
configPath: string;
|
|
12
|
+
onlyId?: string;
|
|
13
|
+
warningsAsErrors?: boolean;
|
|
14
|
+
}): Promise<ProjectResult>;
|
|
15
|
+
export declare function buildResolved(config: ResolvedConfig, input: {
|
|
16
|
+
onlyId?: string;
|
|
17
|
+
write?: boolean;
|
|
18
|
+
warningsAsErrors?: boolean;
|
|
19
|
+
locale?: string;
|
|
20
|
+
}): Promise<ProjectResult>;
|
|
21
|
+
//# sourceMappingURL=build-project.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-project.d.ts","sourceRoot":"","sources":["../../src/project/build-project.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAOtD,OAAO,EAML,KAAK,aAAa,EAEnB,MAAM,SAAS,CAAA;AAGhB,wBAAsB,YAAY,CAAC,KAAK,EAAE;IACxC,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,GAAG,OAAO,CAAC,aAAa,CAAC,CAIzB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE;IACrC,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,GAAG,OAAO,CAAC,aAAa,CAAC,CAEzB;AAED,wBAAsB,aAAa,CACjC,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE;IACL,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,GACA,OAAO,CAAC,aAAa,CAAC,CAkBxB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Diagnostic } from '@vtex-email/core';
|
|
2
|
+
import type { ResolvedConfig } from '../config/config';
|
|
3
|
+
export declare function readCatalogs(config: ResolvedConfig, locales: readonly string[], diagnostics: Diagnostic[]): Promise<Record<string, Record<string, string>>>;
|
|
4
|
+
//# sourceMappingURL=catalogs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalogs.d.ts","sourceRoot":"","sources":["../../src/project/catalogs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAInE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEtD,wBAAsB,YAAY,CAChC,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,WAAW,EAAE,UAAU,EAAE,GACxB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAkBjD"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ResolvedConfig } from '../config/config';
|
|
2
|
+
import type { BuiltEmail, LoadedProfile, ResolvedEmail } from './types';
|
|
3
|
+
export declare function compileOne(config: ResolvedConfig, profile: LoadedProfile, email: ResolvedEmail): Promise<BuiltEmail>;
|
|
4
|
+
//# sourceMappingURL=compile-email.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-email.d.ts","sourceRoot":"","sources":["../../src/project/compile-email.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAa,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAOlF,wBAAsB,UAAU,CAC9B,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,UAAU,CAAC,CA6CrB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Diagnostic } from '@vtex-email/core';
|
|
2
|
+
import type { ResolvedConfig } from '../config/config';
|
|
3
|
+
import type { LoadedProfile, ResolvedEmail } from './types';
|
|
4
|
+
export declare function discoverEmails(config: ResolvedConfig): Promise<{
|
|
5
|
+
ok: true;
|
|
6
|
+
emails: ResolvedEmail[];
|
|
7
|
+
} | {
|
|
8
|
+
ok: false;
|
|
9
|
+
diagnostics: Diagnostic[];
|
|
10
|
+
}>;
|
|
11
|
+
export declare function fileKeyFromPath(file: string): string | null;
|
|
12
|
+
export declare function schemaPathForKey(config: ResolvedConfig, fileKey: string): string;
|
|
13
|
+
export declare function duplicateId(ids: readonly string[]): string | null;
|
|
14
|
+
export declare function readProfile(module: Record<string, unknown>): LoadedProfile | null;
|
|
15
|
+
//# sourceMappingURL=discover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discover.d.ts","sourceRoot":"","sources":["../../src/project/discover.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,UAAU,EAKhB,MAAM,kBAAkB,CAAA;AAIzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAO3D,wBAAsB,cAAc,CAClC,MAAM,EAAE,cAAc,GACrB,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,aAAa,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,WAAW,EAAE,UAAU,EAAE,CAAA;CAAE,CAAC,CAoE3F;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI3D;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,GAAG,IAAI,CAOjE;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,aAAa,GAAG,IAAI,CAkBjF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ZodType } from 'zod';
|
|
2
|
+
import { type Diagnostic } from '@vtex-email/core';
|
|
3
|
+
import type { LoadedFixture } from './types';
|
|
4
|
+
export declare function readFixtures(configDir: string, emailId: string, fixturesRelative: string, diagnostics: Diagnostic[]): Promise<LoadedFixture[]>;
|
|
5
|
+
export declare function checkLoadedFixtures(emailId: string, schema: ZodType, fixtures: readonly LoadedFixture[]): Diagnostic[];
|
|
6
|
+
export declare function isPayloadFile(name: string): boolean;
|
|
7
|
+
export declare function fixtureIdFromName(name: string): string | null;
|
|
8
|
+
//# sourceMappingURL=fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/project/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAA;AAElC,OAAO,EAAiC,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAKjF,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,SAAS,CAAA;AAIzD,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,UAAU,EAAE,GACxB,OAAO,CAAC,aAAa,EAAE,CAAC,CA2E1B;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,OAAO,EACf,QAAQ,EAAE,SAAS,aAAa,EAAE,GACjC,UAAU,EAAE,CAqBd;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAInD;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM7D"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BuiltEmail, ProjectManifest } from './types';
|
|
2
|
+
export declare function projectManifest(profileId: string, emails: BuiltEmail[]): ProjectManifest;
|
|
3
|
+
export declare function localeInventory(previous: ProjectManifest | null, current: ProjectManifest, locale: string): ProjectManifest['emails'];
|
|
4
|
+
//# sourceMappingURL=manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/project/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE1D,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,eAAe,CAqBxF;AAED,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,eAAe,GAAG,IAAI,EAChC,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,MAAM,GACb,eAAe,CAAC,QAAQ,CAAC,CAqB3B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { BuildManifest } from '@vtex-email/react';
|
|
2
|
+
import { type Diagnostic } from '@vtex-email/core';
|
|
3
|
+
import type { BuiltFile, LoadedProfile, ResolvedEmail } from './types';
|
|
4
|
+
export interface LocaleDocument {
|
|
5
|
+
locale: string;
|
|
6
|
+
html: string;
|
|
7
|
+
sha256: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function mergeVariants(input: {
|
|
10
|
+
email: ResolvedEmail;
|
|
11
|
+
profile: LoadedProfile;
|
|
12
|
+
documents: LocaleDocument[];
|
|
13
|
+
files: BuiltFile[];
|
|
14
|
+
diagnostics: Diagnostic[];
|
|
15
|
+
manifest: BuildManifest | null;
|
|
16
|
+
}): BuildManifest | null;
|
|
17
|
+
//# sourceMappingURL=merge-variants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-variants.d.ts","sourceRoot":"","sources":["../../src/project/merge-variants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEtD,OAAO,EASL,KAAK,UAAU,EAChB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAEtE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE;IACnC,KAAK,EAAE,aAAa,CAAA;IACpB,OAAO,EAAE,aAAa,CAAA;IACtB,SAAS,EAAE,cAAc,EAAE,CAAA;IAC3B,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,QAAQ,EAAE,aAAa,GAAG,IAAI,CAAA;CAC/B,GAAG,aAAa,GAAG,IAAI,CA6CvB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type Diagnostic } from '@vtex-email/core';
|
|
2
|
+
export type LoadEmailResult = {
|
|
3
|
+
ok: true;
|
|
4
|
+
module: Record<string, unknown>;
|
|
5
|
+
dependencies: string[];
|
|
6
|
+
} | {
|
|
7
|
+
ok: false;
|
|
8
|
+
diagnostics: Diagnostic[];
|
|
9
|
+
};
|
|
10
|
+
export declare function importBundled(entry: string): Promise<Record<string, unknown>>;
|
|
11
|
+
export declare function loadEmailEntry(entry: string): Promise<LoadEmailResult>;
|
|
12
|
+
//# sourceMappingURL=module-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-loader.d.ts","sourceRoot":"","sources":["../../src/project/module-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAsBnE,MAAM,MAAM,eAAe,GACvB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,GACrE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,WAAW,EAAE,UAAU,EAAE,CAAA;CAAE,CAAA;AAmB5C,wBAAsB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAGnF;AAED,wBAAsB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAmB5E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/project/policy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,wBAAgB,WAAW,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,aAAa,GAAG,UAAU,EAAE,CAQzF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type BuiltEmail, type PreviewResult } from './types';
|
|
2
|
+
export declare function renderPreview(input: {
|
|
3
|
+
configPath: string;
|
|
4
|
+
emailId: string;
|
|
5
|
+
fixtureId: string;
|
|
6
|
+
mode: 'runtime' | 'forced' | 'locale';
|
|
7
|
+
locale?: string;
|
|
8
|
+
warningsAsErrors?: boolean;
|
|
9
|
+
}): Promise<PreviewResult>;
|
|
10
|
+
export declare function previewBuiltEmail(input: {
|
|
11
|
+
email: BuiltEmail;
|
|
12
|
+
fixtureId: string;
|
|
13
|
+
mode: 'runtime' | 'forced' | 'locale';
|
|
14
|
+
locale?: string;
|
|
15
|
+
}): PreviewResult;
|
|
16
|
+
export declare function refreshEmailFixtures(email: BuiltEmail, configDir: string): Promise<BuiltEmail>;
|
|
17
|
+
export declare function exportPreview(input: {
|
|
18
|
+
configPath: string;
|
|
19
|
+
emailId: string;
|
|
20
|
+
fixtureId: string;
|
|
21
|
+
outDir: string;
|
|
22
|
+
warningsAsErrors?: boolean;
|
|
23
|
+
}): Promise<PreviewResult & {
|
|
24
|
+
wrote: string[];
|
|
25
|
+
}>;
|
|
26
|
+
//# sourceMappingURL=preview-evaluation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview-evaluation.d.ts","sourceRoot":"","sources":["../../src/project/preview-evaluation.ts"],"names":[],"mappings":"AAeA,OAAO,EAAqC,KAAK,UAAU,EAAE,KAAK,aAAa,EAAsB,MAAM,SAAS,CAAA;AAEpH,wBAAsB,aAAa,CAAC,KAAK,EAAE;IACzC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACrC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,GAAG,OAAO,CAAC,aAAa,CAAC,CAQzB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE;IACvC,KAAK,EAAE,UAAU,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACrC,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,GAAG,aAAa,CAuDhB;AAED,wBAAsB,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CASpG;AAED,wBAAsB,aAAa,CAAC,KAAK,EAAE;IACzC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,GAAG,OAAO,CAAC,aAAa,GAAG;IAAE,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAiB/C"}
|