@vtex-email/core 0.1.0 → 0.2.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/expression/path.d.ts.map +1 -1
- package/dist/fixture/file.d.ts +31 -0
- package/dist/fixture/file.d.ts.map +1 -0
- package/dist/fixture.schema.json +85 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +167 -11
- package/dist/markers/sites.d.ts +5 -1
- package/dist/markers/sites.d.ts.map +1 -1
- package/dist/profile.d.ts +10 -0
- package/dist/profile.d.ts.map +1 -1
- package/dist/runtime/evaluate.d.ts.map +1 -1
- package/package.json +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/expression/path.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,EAAE,CAAA;CAAE,CAAA;AAExD,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3G,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAO9D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/expression/path.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,EAAE,CAAA;CAAE,CAAA;AAExD,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3G,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAO9D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,UAAU,CAoCzE;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAc5D"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const fixtureMetaSchema: z.ZodObject<{
|
|
3
|
+
description: z.ZodString;
|
|
4
|
+
origin: z.ZodString;
|
|
5
|
+
event: z.ZodString;
|
|
6
|
+
purpose: z.ZodString;
|
|
7
|
+
expectedLocale: z.ZodOptional<z.ZodString>;
|
|
8
|
+
expect: z.ZodDefault<z.ZodEnum<{
|
|
9
|
+
valid: "valid";
|
|
10
|
+
invalid: "invalid";
|
|
11
|
+
}>>;
|
|
12
|
+
}, z.core.$strict>;
|
|
13
|
+
export declare const fixtureFileSchema: z.ZodObject<{
|
|
14
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
15
|
+
meta: z.ZodObject<{
|
|
16
|
+
description: z.ZodString;
|
|
17
|
+
origin: z.ZodString;
|
|
18
|
+
event: z.ZodString;
|
|
19
|
+
purpose: z.ZodString;
|
|
20
|
+
expectedLocale: z.ZodOptional<z.ZodString>;
|
|
21
|
+
expect: z.ZodDefault<z.ZodEnum<{
|
|
22
|
+
valid: "valid";
|
|
23
|
+
invalid: "invalid";
|
|
24
|
+
}>>;
|
|
25
|
+
}, z.core.$strict>;
|
|
26
|
+
data: z.ZodJSONSchema;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
export type FixtureMeta = z.infer<typeof fixtureMetaSchema>;
|
|
29
|
+
export type FixtureFile = z.infer<typeof fixtureFileSchema>;
|
|
30
|
+
export declare function fixtureFileJsonSchema(): Record<string, unknown>;
|
|
31
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/fixture/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,iBAAiB;;;;;;;;;;kBASnB,CAAA;AAEX,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;kBAMnB,CAAA;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAC3D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D,wBAAgB,qBAAqB,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE/D"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"$schema": {
|
|
6
|
+
"type": "string"
|
|
7
|
+
},
|
|
8
|
+
"meta": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"description": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"origin": {
|
|
15
|
+
"type": "string"
|
|
16
|
+
},
|
|
17
|
+
"event": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
},
|
|
20
|
+
"purpose": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"expectedLocale": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"expect": {
|
|
27
|
+
"default": "valid",
|
|
28
|
+
"type": "string",
|
|
29
|
+
"enum": [
|
|
30
|
+
"valid",
|
|
31
|
+
"invalid"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"required": [
|
|
36
|
+
"description",
|
|
37
|
+
"origin",
|
|
38
|
+
"event",
|
|
39
|
+
"purpose"
|
|
40
|
+
],
|
|
41
|
+
"additionalProperties": false
|
|
42
|
+
},
|
|
43
|
+
"data": {
|
|
44
|
+
"$ref": "#/$defs/__schema0"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": [
|
|
48
|
+
"meta",
|
|
49
|
+
"data"
|
|
50
|
+
],
|
|
51
|
+
"additionalProperties": false,
|
|
52
|
+
"$defs": {
|
|
53
|
+
"__schema0": {
|
|
54
|
+
"anyOf": [
|
|
55
|
+
{
|
|
56
|
+
"type": "string"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "number"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"type": "boolean"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"type": "null"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": {
|
|
70
|
+
"$ref": "#/$defs/__schema0"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"type": "object",
|
|
75
|
+
"propertyNames": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"additionalProperties": {
|
|
79
|
+
"$ref": "#/$defs/__schema0"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { isSafeEmailId, type EmailDefinition, type EmailDocument, type EmailI18n
|
|
|
6
6
|
export { errorDiagnostic, warningDiagnostic, type Diagnostic, type DiagnosticSource, type Failure } from './diagnostics';
|
|
7
7
|
export { emitPath, parentHops, parsePath, type Expression, type PathResult } from './expression/path';
|
|
8
8
|
export { checkFixture, schemaMutates } from './fixture/check';
|
|
9
|
+
export { fixtureFileJsonSchema, fixtureFileSchema, fixtureMetaSchema, type FixtureFile, type FixtureMeta, } from './fixture/file';
|
|
9
10
|
export { readPathValue, withForcedLocale } from './fixture/locale-path';
|
|
10
11
|
export { emitBlockClose, emitBlockOpen, emitHelperCall, emitInterpolation, emitLiteral } from './hbs/source';
|
|
11
12
|
export { checkCatalogs } from './i18n/catalog';
|
|
@@ -13,10 +14,10 @@ export { mergeLocaleDocuments } from './i18n/merge';
|
|
|
13
14
|
export { parseMessage, placeholderSignature, type MessagePart, type ParsedMessage } from './i18n/message';
|
|
14
15
|
export { bindSites, type BindResult } from './markers/bind';
|
|
15
16
|
export { restoreHandlebars, type RestoreResult } from './markers/restore';
|
|
16
|
-
export type { BlockName, DynamicAttribute, ResolvedPath, SiteArgument, SiteRecord } from './markers/sites';
|
|
17
|
+
export type { BlockName, DynamicAttribute, ResolvedPath, SiteArgument, SiteHash, SiteRecord } from './markers/sites';
|
|
17
18
|
export { mintToken, opaqueTokenIssue, scanTokens, TOKEN_BODY_LENGTH, TOKEN_LENGTH, TOKEN_PREFIX, type AttrMarker, type ElseMarker, type Marker, type OpenMarker, type TextMarker, } from './markers/tokens';
|
|
18
19
|
export { commitArtifacts, releaseArtifacts } from './output/commit';
|
|
19
|
-
export { findCapability, syntaxHelperNames, type BlockHelper, type BlockOptions, type EmissionCapability, type EmissionProfile, type Evidence, type InlineHelper, type LocalSimulator, type Profile, type SimulatorHelper, } from './profile';
|
|
20
|
+
export { findCapability, syntaxHelperNames, type BlockHelper, type BlockOptions, type EmissionCapability, type EmissionProfile, type Evidence, type HashArg, type InlineHelper, type LocalSimulator, type Profile, type SimulatorHelper, } from './profile';
|
|
20
21
|
export { singleDocumentIssue } from './runtime/document';
|
|
21
22
|
export { evaluateArtifact, renderTemplate, TemplateFailure } from './runtime/evaluate';
|
|
22
23
|
export { analyzePaths, analyzeRootPath } from './scope/analyze-paths';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,MAAM,EACN,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,EACL,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,uBAAuB,GAC7B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AACxH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,UA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CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACnE,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,eAAe,GACrB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACtF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACrE,OAAO,EAAE,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -199,9 +199,19 @@ function checkCapabilities(sites, profile) {
|
|
|
199
199
|
if (capability.context === void 0 || capability.elseContext === void 0) {
|
|
200
200
|
diagnostics.push(errorDiagnostic("HBS002", `Block ${site.block ?? ""} does not declare its context.`));
|
|
201
201
|
}
|
|
202
|
+
diagnostics.push(...checkArguments(capability, site));
|
|
203
|
+
diagnostics.push(...checkHash(capability, site));
|
|
204
|
+
diagnostics.push(...checkLiterals(capability, site));
|
|
205
|
+
}
|
|
206
|
+
if (site.path?.emitted === "@index") {
|
|
207
|
+
const capability = findCapability(profile, "@index", "path");
|
|
208
|
+
if (!capability) {
|
|
209
|
+
diagnostics.push(errorDiagnostic("HBS002", "The profile does not enable the @index path.", { path: "@index" }));
|
|
210
|
+
}
|
|
202
211
|
}
|
|
203
212
|
diagnostics.push(...checkParentCapability(site.path, profile));
|
|
204
213
|
for (const arg of site.args ?? []) diagnostics.push(...checkParentCapability(arg.path, profile));
|
|
214
|
+
for (const arg of Object.values(site.hash ?? {})) diagnostics.push(...checkParentCapability(arg.path, profile));
|
|
205
215
|
}
|
|
206
216
|
return diagnostics;
|
|
207
217
|
}
|
|
@@ -227,6 +237,69 @@ function checkArguments(capability, site) {
|
|
|
227
237
|
});
|
|
228
238
|
return diagnostics;
|
|
229
239
|
}
|
|
240
|
+
function checkHash(capability, site) {
|
|
241
|
+
if (!capability.hash) {
|
|
242
|
+
if (site.hash && Object.keys(site.hash).length > 0) {
|
|
243
|
+
return [errorDiagnostic("HBS002", `Helper ${capability.name} does not accept named arguments.`)];
|
|
244
|
+
}
|
|
245
|
+
return [];
|
|
246
|
+
}
|
|
247
|
+
const diagnostics = [];
|
|
248
|
+
const provided = site.hash ?? {};
|
|
249
|
+
for (const expected of capability.hash) {
|
|
250
|
+
const actual = provided[expected.name];
|
|
251
|
+
if (!actual) {
|
|
252
|
+
diagnostics.push(errorDiagnostic("HBS002", `Helper ${capability.name} requires named argument ${expected.name}.`));
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
if (actual.kind !== expected.kind) {
|
|
256
|
+
diagnostics.push(
|
|
257
|
+
errorDiagnostic(
|
|
258
|
+
"HBS002",
|
|
259
|
+
`Helper ${capability.name} named argument ${expected.name} must be a ${expected.kind}.`
|
|
260
|
+
)
|
|
261
|
+
);
|
|
262
|
+
}
|
|
263
|
+
if (expected.name === "by" && actual.kind === "literal") {
|
|
264
|
+
const raw = unwrapQuotedLiteral(actual.emitted);
|
|
265
|
+
if (raw === null || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(raw)) {
|
|
266
|
+
diagnostics.push(
|
|
267
|
+
errorDiagnostic("HBS002", `Helper ${capability.name} named argument by must be an identifier literal.`)
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
for (const name of Object.keys(provided)) {
|
|
273
|
+
if (!capability.hash.some((item) => item.name === name)) {
|
|
274
|
+
diagnostics.push(errorDiagnostic("HBS002", `Helper ${capability.name} does not accept named argument ${name}.`));
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return diagnostics;
|
|
278
|
+
}
|
|
279
|
+
function checkLiterals(capability, site) {
|
|
280
|
+
if (!capability.literals) return [];
|
|
281
|
+
const diagnostics = [];
|
|
282
|
+
for (const rule of capability.literals) {
|
|
283
|
+
const actual = site.args?.[rule.index];
|
|
284
|
+
if (!actual || actual.kind !== "literal") continue;
|
|
285
|
+
const raw = unwrapQuotedLiteral(actual.emitted);
|
|
286
|
+
if (raw === null || !rule.values.includes(raw)) {
|
|
287
|
+
diagnostics.push(
|
|
288
|
+
errorDiagnostic(
|
|
289
|
+
"HBS002",
|
|
290
|
+
`Helper ${capability.name} argument ${rule.index + 1} must be one of ${rule.values.join(", ")}.`
|
|
291
|
+
)
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return diagnostics;
|
|
296
|
+
}
|
|
297
|
+
function unwrapQuotedLiteral(emitted) {
|
|
298
|
+
if (emitted.length >= 2 && emitted.startsWith('"') && emitted.endsWith('"')) {
|
|
299
|
+
return emitted.slice(1, -1).replaceAll('\\"', '"').replaceAll("\\\\", "\\");
|
|
300
|
+
}
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
230
303
|
function checkParentCapability(path2, profile) {
|
|
231
304
|
if (!path2 || path2.parentHops === 0) return [];
|
|
232
305
|
const capability = findCapability(profile, "../", "path");
|
|
@@ -243,9 +316,11 @@ function checkScope(sites, anchors, profile) {
|
|
|
243
316
|
diagnostics.push(errorDiagnostic("TOK001", `Marker ${id} was not located for scope validation.`));
|
|
244
317
|
continue;
|
|
245
318
|
}
|
|
246
|
-
const depth = depthAt(anchor.start, id, regions);
|
|
247
|
-
|
|
248
|
-
|
|
319
|
+
const depth = depthAt(anchor.start, id, regions, "item");
|
|
320
|
+
const eachDepth = depthAt(anchor.start, id, regions, "each");
|
|
321
|
+
diagnostics.push(...checkDepth(site.path, depth, eachDepth));
|
|
322
|
+
for (const arg of site.args ?? []) diagnostics.push(...checkDepth(arg.path, depth, eachDepth));
|
|
323
|
+
for (const arg of Object.values(site.hash ?? {})) diagnostics.push(...checkDepth(arg.path, depth, eachDepth));
|
|
249
324
|
}
|
|
250
325
|
return diagnostics;
|
|
251
326
|
}
|
|
@@ -256,20 +331,34 @@ function regionsFrom(sites, anchors, profile) {
|
|
|
256
331
|
const anchor = anchors.get(id);
|
|
257
332
|
const capability = findCapability(profile, site.block);
|
|
258
333
|
if (!anchor || !capability) continue;
|
|
259
|
-
regions.push({
|
|
334
|
+
regions.push({
|
|
335
|
+
...anchor,
|
|
336
|
+
id,
|
|
337
|
+
pushes: capability.context === "item",
|
|
338
|
+
each: site.block === "each"
|
|
339
|
+
});
|
|
260
340
|
}
|
|
261
341
|
return regions;
|
|
262
342
|
}
|
|
263
|
-
function depthAt(offset, selfId, regions) {
|
|
343
|
+
function depthAt(offset, selfId, regions, mode) {
|
|
264
344
|
let depth = 0;
|
|
265
345
|
for (const region of regions) {
|
|
266
|
-
if (
|
|
346
|
+
if (region.id === selfId) continue;
|
|
347
|
+
if (mode === "item" && !region.pushes) continue;
|
|
348
|
+
if (mode === "each" && !region.each) continue;
|
|
267
349
|
if (offset > region.start && offset < region.end) depth += 1;
|
|
268
350
|
}
|
|
269
351
|
return depth;
|
|
270
352
|
}
|
|
271
|
-
function checkDepth(path2, depth) {
|
|
272
|
-
if (!path2
|
|
353
|
+
function checkDepth(path2, depth, eachDepth) {
|
|
354
|
+
if (!path2) return [];
|
|
355
|
+
if (path2.emitted === "@index") {
|
|
356
|
+
if (eachDepth < 1) {
|
|
357
|
+
return [errorDiagnostic("HBS001", 'Path "@index" is only available inside each.', { path: "@index" })];
|
|
358
|
+
}
|
|
359
|
+
return [];
|
|
360
|
+
}
|
|
361
|
+
if (path2.parentHops <= depth) return [];
|
|
273
362
|
return [errorDiagnostic("HBS001", `Path "${path2.emitted}" goes beyond the root context.`, { path: path2.emitted })];
|
|
274
363
|
}
|
|
275
364
|
function usedCapabilities(sites, profile) {
|
|
@@ -277,8 +366,14 @@ function usedCapabilities(sites, profile) {
|
|
|
277
366
|
for (const site of sites.values()) {
|
|
278
367
|
if (site.kind === "block" && site.block) names.add(site.block);
|
|
279
368
|
if (site.kind === "helper" && site.helper) names.add(site.helper);
|
|
369
|
+
if (site.path?.emitted === "@index") names.add("@index");
|
|
280
370
|
if (site.path && site.path.parentHops > 0) names.add("../");
|
|
281
371
|
for (const arg of site.args ?? []) {
|
|
372
|
+
if (arg.path?.emitted === "@index") names.add("@index");
|
|
373
|
+
if (arg.path && arg.path.parentHops > 0) names.add("../");
|
|
374
|
+
}
|
|
375
|
+
for (const arg of Object.values(site.hash ?? {})) {
|
|
376
|
+
if (arg.path?.emitted === "@index") names.add("@index");
|
|
282
377
|
if (arg.path && arg.path.parentHops > 0) names.add("../");
|
|
283
378
|
}
|
|
284
379
|
}
|
|
@@ -313,11 +408,15 @@ function materialize(marker, site) {
|
|
|
313
408
|
if (literal) return { ok: true, marker: { ...marker, replacement: emitInterpolation(literal.emitted) } };
|
|
314
409
|
}
|
|
315
410
|
if (marker.kind === "open" && site.kind === "block" && site.block && site.path) {
|
|
411
|
+
const parts = [site.path.emitted, ...(site.args ?? []).map((arg) => arg.emitted)];
|
|
412
|
+
for (const [name, arg] of Object.entries(site.hash ?? {})) {
|
|
413
|
+
parts.push(`${name}=${arg.emitted}`);
|
|
414
|
+
}
|
|
316
415
|
return {
|
|
317
416
|
ok: true,
|
|
318
417
|
marker: {
|
|
319
418
|
...marker,
|
|
320
|
-
open: emitBlockOpen(site.block,
|
|
419
|
+
open: emitBlockOpen(site.block, parts),
|
|
321
420
|
close: emitBlockClose(site.block)
|
|
322
421
|
}
|
|
323
422
|
};
|
|
@@ -739,6 +838,9 @@ function parentHops(segments) {
|
|
|
739
838
|
}
|
|
740
839
|
function parsePath(input, allowParent) {
|
|
741
840
|
if (input.length === 0) return { ok: false, message: "Empty path." };
|
|
841
|
+
if (input === "@index") {
|
|
842
|
+
return { ok: true, segments: ["@index"], emitted: "@index" };
|
|
843
|
+
}
|
|
742
844
|
if (input.includes("@") || input.includes("[") || input.includes("]")) {
|
|
743
845
|
return { ok: false, message: `Unsupported path syntax: ${input}` };
|
|
744
846
|
}
|
|
@@ -863,6 +965,25 @@ function checkFixture(schema, data) {
|
|
|
863
965
|
return null;
|
|
864
966
|
}
|
|
865
967
|
|
|
968
|
+
// src/fixture/file.ts
|
|
969
|
+
import { z as z2 } from "zod";
|
|
970
|
+
var fixtureMetaSchema = z2.object({
|
|
971
|
+
description: z2.string(),
|
|
972
|
+
origin: z2.string(),
|
|
973
|
+
event: z2.string(),
|
|
974
|
+
purpose: z2.string(),
|
|
975
|
+
expectedLocale: z2.string().optional(),
|
|
976
|
+
expect: z2.enum(["valid", "invalid"]).default("valid")
|
|
977
|
+
}).strict();
|
|
978
|
+
var fixtureFileSchema = z2.object({
|
|
979
|
+
$schema: z2.string().optional(),
|
|
980
|
+
meta: fixtureMetaSchema,
|
|
981
|
+
data: z2.json()
|
|
982
|
+
}).strict();
|
|
983
|
+
function fixtureFileJsonSchema() {
|
|
984
|
+
return z2.toJSONSchema(fixtureFileSchema, { io: "input" });
|
|
985
|
+
}
|
|
986
|
+
|
|
866
987
|
// src/fixture/locale-path.ts
|
|
867
988
|
function readPathValue(data, pathExpression) {
|
|
868
989
|
const parsed = parsePath(pathExpression, false);
|
|
@@ -1148,8 +1269,12 @@ function renderTemplate(source, data, simulator) {
|
|
|
1148
1269
|
} else {
|
|
1149
1270
|
const apply = helper.apply;
|
|
1150
1271
|
instance.registerHelper(helper.name, function(...args) {
|
|
1151
|
-
const
|
|
1152
|
-
return apply(this, args.slice(0, -1),
|
|
1272
|
+
const raw = args.at(-1);
|
|
1273
|
+
return apply(this, args.slice(0, -1), {
|
|
1274
|
+
fn: raw.fn,
|
|
1275
|
+
inverse: raw.inverse,
|
|
1276
|
+
hash: raw.hash ?? {}
|
|
1277
|
+
});
|
|
1153
1278
|
});
|
|
1154
1279
|
}
|
|
1155
1280
|
}
|
|
@@ -1216,6 +1341,21 @@ function walk(nodes, stack, guards) {
|
|
|
1216
1341
|
diagnostics.push(...walk(node.fallback, outer, guards));
|
|
1217
1342
|
continue;
|
|
1218
1343
|
}
|
|
1344
|
+
if (node.block === "group") {
|
|
1345
|
+
const elements = arrayElements(lookup.schema);
|
|
1346
|
+
if (!elements) {
|
|
1347
|
+
diagnostics.push(errorDiagnostic("PATH001", `Path "${node.path}" is not an array.`, { path: node.path }));
|
|
1348
|
+
continue;
|
|
1349
|
+
}
|
|
1350
|
+
const child = {
|
|
1351
|
+
schema: groupFrameSchema(elements),
|
|
1352
|
+
prefix: [...absolute.segments, "group"]
|
|
1353
|
+
};
|
|
1354
|
+
const outer = framesAt(stack, node.parentHops);
|
|
1355
|
+
diagnostics.push(...walk(node.children, [...outer, child], guards));
|
|
1356
|
+
diagnostics.push(...walk(node.fallback, outer, guards));
|
|
1357
|
+
continue;
|
|
1358
|
+
}
|
|
1219
1359
|
const nextGuards = [...guards, absolute.segments];
|
|
1220
1360
|
diagnostics.push(...walk(node.children, stack, nextGuards));
|
|
1221
1361
|
diagnostics.push(...walk(node.fallback, stack, nextGuards));
|
|
@@ -1231,6 +1371,7 @@ function inspectRef(node, stack, guards) {
|
|
|
1231
1371
|
return diagnostics;
|
|
1232
1372
|
}
|
|
1233
1373
|
function inspectPath(path2, hops, stack, guards) {
|
|
1374
|
+
if (path2 === "@index") return [];
|
|
1234
1375
|
const absolute = absoluteSegments(path2, hops, stack);
|
|
1235
1376
|
if (!absolute) {
|
|
1236
1377
|
const missing = contractDiagnostic(path2, "missing");
|
|
@@ -1322,6 +1463,18 @@ function arrayElements(schema) {
|
|
|
1322
1463
|
}
|
|
1323
1464
|
return null;
|
|
1324
1465
|
}
|
|
1466
|
+
function groupFrameSchema(element) {
|
|
1467
|
+
return {
|
|
1468
|
+
def: {
|
|
1469
|
+
type: "object",
|
|
1470
|
+
shape: {
|
|
1471
|
+
index: { def: { type: "number" } },
|
|
1472
|
+
value: {},
|
|
1473
|
+
items: { def: { type: "array", element } }
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
};
|
|
1477
|
+
}
|
|
1325
1478
|
export {
|
|
1326
1479
|
TOKEN_BODY_LENGTH,
|
|
1327
1480
|
TOKEN_LENGTH,
|
|
@@ -1343,6 +1496,9 @@ export {
|
|
|
1343
1496
|
errorDiagnostic,
|
|
1344
1497
|
evaluateArtifact,
|
|
1345
1498
|
findCapability,
|
|
1499
|
+
fixtureFileJsonSchema,
|
|
1500
|
+
fixtureFileSchema,
|
|
1501
|
+
fixtureMetaSchema,
|
|
1346
1502
|
isSafeEmailId,
|
|
1347
1503
|
mergeLocaleDocuments,
|
|
1348
1504
|
mintToken,
|
package/dist/markers/sites.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ArgKind } from '../profile';
|
|
2
|
-
export type BlockName = 'each' | 'if' | 'unless';
|
|
2
|
+
export type BlockName = 'each' | 'if' | 'unless' | 'ifCond' | 'hasSubStr' | 'group' | 'eq';
|
|
3
3
|
export type DynamicAttribute = 'href' | 'src' | 'alt' | 'title';
|
|
4
4
|
export interface ResolvedPath {
|
|
5
5
|
emitted: string;
|
|
@@ -10,12 +10,16 @@ export interface SiteArgument {
|
|
|
10
10
|
emitted: string;
|
|
11
11
|
path?: ResolvedPath;
|
|
12
12
|
}
|
|
13
|
+
export interface SiteHash {
|
|
14
|
+
readonly [name: string]: SiteArgument;
|
|
15
|
+
}
|
|
13
16
|
export interface SiteRecord {
|
|
14
17
|
kind: 'value' | 'helper' | 'block' | 'attr' | 'literal';
|
|
15
18
|
path?: ResolvedPath;
|
|
16
19
|
block?: BlockName;
|
|
17
20
|
helper?: string;
|
|
18
21
|
args?: readonly SiteArgument[];
|
|
22
|
+
hash?: SiteHash;
|
|
19
23
|
attribute?: DynamicAttribute;
|
|
20
24
|
}
|
|
21
25
|
//# sourceMappingURL=sites.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sites.d.ts","sourceRoot":"","sources":["../../src/markers/sites.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"sites.d.ts","sourceRoot":"","sources":["../../src/markers/sites.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,WAAW,GAAG,OAAO,GAAG,IAAI,CAAA;AAE1F,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,OAAO,CAAA;AAE/D,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,YAAY,CAAA;CACpB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAAA;CACtC;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;IACvD,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,SAAS,YAAY,EAAE,CAAA;IAC9B,IAAI,CAAC,EAAE,QAAQ,CAAA;IACf,SAAS,CAAC,EAAE,gBAAgB,CAAA;CAC7B"}
|
package/dist/profile.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export type Evidence = 'documented' | 'verified' | 'experimental';
|
|
2
2
|
export type ArgKind = 'path' | 'literal';
|
|
3
|
+
export interface HashArg {
|
|
4
|
+
name: string;
|
|
5
|
+
kind: ArgKind;
|
|
6
|
+
}
|
|
3
7
|
export interface EmissionCapability {
|
|
4
8
|
name: string;
|
|
5
9
|
form: 'inline' | 'block' | 'path';
|
|
@@ -10,6 +14,11 @@ export interface EmissionCapability {
|
|
|
10
14
|
max: number;
|
|
11
15
|
};
|
|
12
16
|
args?: readonly ArgKind[];
|
|
17
|
+
hash?: readonly HashArg[];
|
|
18
|
+
literals?: ReadonlyArray<{
|
|
19
|
+
index: number;
|
|
20
|
+
values: readonly string[];
|
|
21
|
+
}>;
|
|
13
22
|
context?: 'preserve' | 'item';
|
|
14
23
|
elseContext?: 'preserve' | 'outer';
|
|
15
24
|
}
|
|
@@ -28,6 +37,7 @@ export interface InlineHelper {
|
|
|
28
37
|
export interface BlockOptions {
|
|
29
38
|
fn: (context: unknown) => string;
|
|
30
39
|
inverse: (context: unknown) => string;
|
|
40
|
+
hash: Readonly<Record<string, unknown>>;
|
|
31
41
|
}
|
|
32
42
|
export interface BlockHelper {
|
|
33
43
|
name: string;
|
package/dist/profile.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,UAAU,GAAG,cAAc,CAAA;AAEjE,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,SAAS,CAAA;AAExC,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAA;IACjC,QAAQ,EAAE,QAAQ,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE;QAAE,GAAG,E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AED,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,WAAW,CAAA;AAExD,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,SAAS,eAAe,EAAE,CAAA;CACpC;AAED,MAAM,WAAW,OAAQ,SAAQ,eAAe;IAC9C,OAAO,EAAE,SAAS,eAAe,EAAE,CAAA;CACpC;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,EAAE,CAEpE;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,GAChC,kBAAkB,GAAG,SAAS,CAGhC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../src/runtime/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAMjE,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAA;gBAEtB,WAAW,EAAE,UAAU,EAAE;CAKtC;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../src/runtime/evaluate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAMjE,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAA;gBAEtB,WAAW,EAAE,UAAU,EAAE;CAKtC;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,GAAG,MAAM,CAiC/F;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACtC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,eAAe,CAAA;IACxB,SAAS,EAAE,cAAc,CAAA;CAC1B,GAAG,MAAM,CAQT"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vtex-email/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/marcelotk15/vtex-react-email.git"
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"import": "./dist/index.js",
|
|
17
17
|
"default": "./dist/index.js"
|
|
18
|
-
}
|
|
18
|
+
},
|
|
19
|
+
"./fixture.schema.json": "./dist/fixture.schema.json"
|
|
19
20
|
},
|
|
20
21
|
"dependencies": {
|
|
21
22
|
"handlebars": "4.7.9",
|