@samva/cli 0.7.0 → 0.7.1
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/AGENTS.md +2 -1
- package/dist/bin.mjs +42 -33
- package/package.json +7 -7
package/AGENTS.md
CHANGED
|
@@ -16,7 +16,8 @@ The developer loop for a template project is `samva templates dev` (the local vi
|
|
|
16
16
|
and `snapshot <template> --fixture <name>` (desktop and mobile PNGs, light and dark, in
|
|
17
17
|
`.samva/snapshots`, needing `playwright` in the project or a system Chrome). With `--json`, every
|
|
18
18
|
finding carries `code`, `severity`, `message`, `file`, `line`/`column`, `range`, and, where the
|
|
19
|
-
compiler has them, `fix
|
|
19
|
+
compiler has them, `fix`, a machine-applicable `edit`, and `upgrade`, the instructions for migrating
|
|
20
|
+
a template written in a format the compiler rejects. Templates live in `templates/` and
|
|
20
21
|
`emails/`; a template is a `.tsx` file that default-exports `defineTemplate`, and the compiler reads
|
|
21
22
|
it without running it.
|
|
22
23
|
|
package/dist/bin.mjs
CHANGED
|
@@ -4028,6 +4028,10 @@ var ignore = /* @__PURE__ */ dual((args) => isEffect(args[0]), (self, options) =
|
|
|
4028
4028
|
onSuccess: (_) => void_
|
|
4029
4029
|
});
|
|
4030
4030
|
});
|
|
4031
|
+
var option = (self) => match5(self, {
|
|
4032
|
+
onFailure: none2,
|
|
4033
|
+
onSuccess: some2
|
|
4034
|
+
});
|
|
4031
4035
|
var result = (self) => matchEager(self, {
|
|
4032
4036
|
onFailure: fail2,
|
|
4033
4037
|
onSuccess: succeed2
|
|
@@ -5597,6 +5601,7 @@ var flatMap3 = flatMap2;
|
|
|
5597
5601
|
var andThen2 = andThen;
|
|
5598
5602
|
var tap2 = tap;
|
|
5599
5603
|
var result2 = result;
|
|
5604
|
+
var option2 = option;
|
|
5600
5605
|
var exit2 = exit;
|
|
5601
5606
|
var map6 = map4;
|
|
5602
5607
|
var as2 = as;
|
|
@@ -13674,7 +13679,7 @@ var layer12 = /* @__PURE__ */ layer.pipe(/* @__PURE__ */ provideMerge(/* @__PURE
|
|
|
13674
13679
|
// package.json
|
|
13675
13680
|
var package_default = {
|
|
13676
13681
|
name: "@samva/cli",
|
|
13677
|
-
version: "0.7.
|
|
13682
|
+
version: "0.7.1",
|
|
13678
13683
|
description: "Samva CLI \u2014 email and platform operations from your terminal",
|
|
13679
13684
|
keywords: [
|
|
13680
13685
|
"cli",
|
|
@@ -13722,8 +13727,8 @@ var package_default = {
|
|
|
13722
13727
|
devDependencies: {
|
|
13723
13728
|
"@effect/platform-bun": "catalog:effect",
|
|
13724
13729
|
"@effect/vitest": "catalog:effect",
|
|
13725
|
-
"@samva/markup": "
|
|
13726
|
-
"@samva/vite": "
|
|
13730
|
+
"@samva/markup": "^0.11.4",
|
|
13731
|
+
"@samva/vite": "^0.11.4",
|
|
13727
13732
|
"@types/node": "catalog:",
|
|
13728
13733
|
"better-auth": "catalog:",
|
|
13729
13734
|
effect: "catalog:effect",
|
|
@@ -13733,10 +13738,10 @@ var package_default = {
|
|
|
13733
13738
|
vitest: "catalog:"
|
|
13734
13739
|
},
|
|
13735
13740
|
optionalDependencies: {
|
|
13736
|
-
"@samva/cli-darwin-arm64": "workspace:0.7.
|
|
13737
|
-
"@samva/cli-darwin-x64": "workspace:0.7.
|
|
13738
|
-
"@samva/cli-linux-arm64": "workspace:0.7.
|
|
13739
|
-
"@samva/cli-linux-x64": "workspace:0.7.
|
|
13741
|
+
"@samva/cli-darwin-arm64": "workspace:0.7.1",
|
|
13742
|
+
"@samva/cli-darwin-x64": "workspace:0.7.1",
|
|
13743
|
+
"@samva/cli-linux-arm64": "workspace:0.7.1",
|
|
13744
|
+
"@samva/cli-linux-x64": "workspace:0.7.1"
|
|
13740
13745
|
},
|
|
13741
13746
|
engines: {
|
|
13742
13747
|
node: ">=18"
|
|
@@ -42413,7 +42418,7 @@ var $ = (e) => {
|
|
|
42413
42418
|
};
|
|
42414
42419
|
var ae = { ok: l, isOk: u, err: d, isError: f, try: T, tryPromise: E, map: D, mapError: O, tryRecover: k, andThen: A, tryRecoverAsync: ee, andThenAsync: te, match: ne, tap: j, tapAsync: M, tapError: N6, tapErrorAsync: P, tapBoth: F4, tapBothAsync: I, unwrap: L, unwrapOr: z, gen: B, await: V, codec: re, all: Q, allAsync: ie, partition: $, partitionAsync: async (e) => $(await Z(e, `Result.partitionAsync input promise rejected`)), flatten: (e) => e.status === `ok` ? e.value : e };
|
|
42415
42420
|
|
|
42416
|
-
//
|
|
42421
|
+
// ../../node_modules/.bun/@samva+markup@0.11.4+a19bcd7db259aaf7/node_modules/@samva/markup/dist/theme-css-CEUrDpqq.js
|
|
42417
42422
|
var BRAND_NAMESPACES = [
|
|
42418
42423
|
"--color-",
|
|
42419
42424
|
"--font-",
|
|
@@ -42606,7 +42611,7 @@ var parseBrandCss = (css) => {
|
|
|
42606
42611
|
fontFaces
|
|
42607
42612
|
});
|
|
42608
42613
|
};
|
|
42609
|
-
//
|
|
42614
|
+
// ../../node_modules/.bun/@samva+markup@0.11.4+a19bcd7db259aaf7/node_modules/@samva/markup/dist/diagnostic-codes-BduqCv_h.js
|
|
42610
42615
|
var buildLineMap = (source) => {
|
|
42611
42616
|
const lineStarts = [0];
|
|
42612
42617
|
for (let index = 0;index < source.length; index++) {
|
|
@@ -42631,8 +42636,6 @@ var lineColumn = (lineMap, offset) => {
|
|
|
42631
42636
|
column: offset - lineMap[low] + 1
|
|
42632
42637
|
};
|
|
42633
42638
|
};
|
|
42634
|
-
|
|
42635
|
-
// ../markup/dist/diagnostics.js
|
|
42636
42639
|
var codes2 = (table) => table;
|
|
42637
42640
|
var DIAGNOSTIC_CODES = codes2({
|
|
42638
42641
|
"no-template": {
|
|
@@ -43029,7 +43032,6 @@ var DIAGNOSTIC_CODES = codes2({
|
|
|
43029
43032
|
channelOnly: true
|
|
43030
43033
|
}
|
|
43031
43034
|
});
|
|
43032
|
-
|
|
43033
43035
|
// ../sdk/dist/normalize-B79uJIeb.js
|
|
43034
43036
|
function toRecipientArray(recipient) {
|
|
43035
43037
|
return Array.isArray(recipient) ? recipient : [recipient];
|
|
@@ -62979,6 +62981,7 @@ var reportDiagnostic = (diagnostic, context) => {
|
|
|
62979
62981
|
...origin === undefined ? {} : { line: origin.lineNumber, column: origin.columnNumber },
|
|
62980
62982
|
...range === undefined ? {} : { range },
|
|
62981
62983
|
...diagnostic.fix === undefined ? {} : { fix: diagnostic.fix },
|
|
62984
|
+
...diagnostic.upgrade === undefined ? {} : { upgrade: diagnostic.upgrade },
|
|
62982
62985
|
...diagnostic.edit === undefined ? {} : { edit: diagnostic.edit },
|
|
62983
62986
|
...context.fixture === undefined ? {} : { fixture: context.fixture }
|
|
62984
62987
|
};
|
|
@@ -62986,8 +62989,10 @@ var reportDiagnostic = (diagnostic, context) => {
|
|
|
62986
62989
|
var formatReportedDiagnostic = (diagnostic) => {
|
|
62987
62990
|
const at = diagnostic.line === undefined ? diagnostic.file : `${diagnostic.file}:${diagnostic.line}${diagnostic.column === undefined ? "" : `:${diagnostic.column}`}`;
|
|
62988
62991
|
const head = `${at} ${diagnostic.severity} ${diagnostic.code}: ${diagnostic.message}`;
|
|
62989
|
-
|
|
62992
|
+
const fixed = diagnostic.fix === undefined ? head : `${head}
|
|
62990
62993
|
Fix: ${diagnostic.fix}`;
|
|
62994
|
+
return diagnostic.upgrade === undefined ? fixed : `${fixed}
|
|
62995
|
+
Upgrade: ${diagnostic.upgrade}`;
|
|
62991
62996
|
};
|
|
62992
62997
|
|
|
62993
62998
|
// src/commands/templates/local-build.ts
|
|
@@ -64880,28 +64885,32 @@ var observeTemplateCheck = (dir, tsconfig, build) => gen2(function* () {
|
|
|
64880
64885
|
line: diagnostic.line,
|
|
64881
64886
|
column: diagnostic.column
|
|
64882
64887
|
}));
|
|
64883
|
-
|
|
64884
|
-
|
|
64885
|
-
|
|
64888
|
+
const typeFailure = () => ({
|
|
64889
|
+
ok: false,
|
|
64890
|
+
message: `TypeScript check failed (${typeProblems.length} problem(s)).`,
|
|
64891
|
+
problems: typeProblems,
|
|
64892
|
+
payload: {
|
|
64893
|
+
action: "templates.check",
|
|
64886
64894
|
ok: false,
|
|
64887
|
-
|
|
64888
|
-
|
|
64889
|
-
|
|
64890
|
-
|
|
64891
|
-
|
|
64892
|
-
|
|
64893
|
-
|
|
64894
|
-
|
|
64895
|
-
|
|
64896
|
-
|
|
64897
|
-
|
|
64898
|
-
|
|
64899
|
-
|
|
64900
|
-
|
|
64901
|
-
const
|
|
64895
|
+
phase: "typescript",
|
|
64896
|
+
tsconfig,
|
|
64897
|
+
typescriptVersion: typecheck.version,
|
|
64898
|
+
problems: typeProblems
|
|
64899
|
+
}
|
|
64900
|
+
});
|
|
64901
|
+
const attempted = typeProblems.length > 0 ? yield* option2(build()) : some2(yield* build());
|
|
64902
|
+
if (isNone2(attempted))
|
|
64903
|
+
return typeFailure();
|
|
64904
|
+
const built = attempted.value;
|
|
64905
|
+
const buildProblems = collectBuildProblems(built);
|
|
64906
|
+
if (typeProblems.length > 0 && built.files.length === 0 && buildProblems.length === 0) {
|
|
64907
|
+
return typeFailure();
|
|
64908
|
+
}
|
|
64909
|
+
const problems = [...typeProblems, ...buildProblems];
|
|
64910
|
+
const ok = typeProblems.length === 0 && isSuccessfulBuild(built);
|
|
64902
64911
|
const compilerVersion = built.compilerVersion;
|
|
64903
64912
|
const warnings = compatibilityFindings(built, "warning");
|
|
64904
|
-
const message = ok ? `TypeScript v${typecheck.version} \xB7 compiler ${compilerVersion} \xB7 ${built.files.length} template(s) compiled \xB7 ${warnings.length} compatibility warning(s)` : built.files.length === 0 ? NO_TEMPLATES(dir) : `Template check failed (${problems.length} problem(s)).`;
|
|
64913
|
+
const message = ok ? `TypeScript v${typecheck.version} \xB7 compiler ${compilerVersion} \xB7 ${built.files.length} template(s) compiled \xB7 ${warnings.length} compatibility warning(s)` : typeProblems.length > 0 ? `TypeScript check failed (${typeProblems.length} problem(s)); template check found ${problems.length - typeProblems.length} more.` : built.files.length === 0 ? NO_TEMPLATES(dir) : `Template check failed (${problems.length} problem(s)).`;
|
|
64905
64914
|
return {
|
|
64906
64915
|
ok,
|
|
64907
64916
|
message,
|
|
@@ -64909,7 +64918,7 @@ var observeTemplateCheck = (dir, tsconfig, build) => gen2(function* () {
|
|
|
64909
64918
|
payload: {
|
|
64910
64919
|
action: "templates.check",
|
|
64911
64920
|
ok,
|
|
64912
|
-
phase: ok ? "complete" : "templates",
|
|
64921
|
+
phase: ok ? "complete" : typeProblems.length > 0 ? "typescript" : "templates",
|
|
64913
64922
|
tsconfig,
|
|
64914
64923
|
typescriptVersion: typecheck.version,
|
|
64915
64924
|
compilerVersion,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@samva/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"description": "Samva CLI — email and platform operations from your terminal",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@effect/platform-bun": "4.0.0",
|
|
50
50
|
"@effect/vitest": "4.0.0",
|
|
51
|
-
"@samva/markup": "0.11.
|
|
52
|
-
"@samva/vite": "0.11.
|
|
51
|
+
"@samva/markup": "^0.11.4",
|
|
52
|
+
"@samva/vite": "^0.11.4",
|
|
53
53
|
"@types/node": "^26.6.2",
|
|
54
54
|
"better-auth": "1.7.5",
|
|
55
55
|
"effect": "4.0.0",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"vitest": "^5.0.3"
|
|
60
60
|
},
|
|
61
61
|
"optionalDependencies": {
|
|
62
|
-
"@samva/cli-darwin-arm64": "0.7.
|
|
63
|
-
"@samva/cli-darwin-x64": "0.7.
|
|
64
|
-
"@samva/cli-linux-arm64": "0.7.
|
|
65
|
-
"@samva/cli-linux-x64": "0.7.
|
|
62
|
+
"@samva/cli-darwin-arm64": "0.7.1",
|
|
63
|
+
"@samva/cli-darwin-x64": "0.7.1",
|
|
64
|
+
"@samva/cli-linux-arm64": "0.7.1",
|
|
65
|
+
"@samva/cli-linux-x64": "0.7.1"
|
|
66
66
|
},
|
|
67
67
|
"engines": {
|
|
68
68
|
"node": ">=18"
|