@gadicc/loom 1.16.1 → 1.18.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/README.md +74 -41
- package/deno.json +3 -0
- package/esm/_dnt.polyfills.d.ts +6 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/mod.d.ts +2 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +2 -0
- package/esm/src/cli/mod.d.ts +4 -2
- package/esm/src/cli/mod.d.ts.map +1 -1
- package/esm/src/cli/mod.js +2018 -369
- package/esm/src/cli/projectTooling.d.ts +138 -0
- package/esm/src/cli/projectTooling.d.ts.map +1 -0
- package/esm/src/cli/projectTooling.js +614 -0
- package/esm/src/mail/errors.d.ts +33 -0
- package/esm/src/mail/errors.d.ts.map +1 -0
- package/esm/src/mail/errors.js +89 -0
- package/esm/src/mail/memory.d.ts +30 -0
- package/esm/src/mail/memory.d.ts.map +1 -0
- package/esm/src/mail/memory.js +340 -0
- package/esm/src/mail/mod.d.ts +7 -0
- package/esm/src/mail/mod.d.ts.map +1 -0
- package/esm/src/mail/mod.js +6 -0
- package/esm/src/mail/postal.d.ts +57 -0
- package/esm/src/mail/postal.d.ts.map +1 -0
- package/esm/src/mail/postal.js +238 -0
- package/esm/src/mail/retry.d.ts +9 -0
- package/esm/src/mail/retry.d.ts.map +1 -0
- package/esm/src/mail/retry.js +19 -0
- package/esm/src/mail/service.d.ts +23 -0
- package/esm/src/mail/service.d.ts.map +1 -0
- package/esm/src/mail/service.js +185 -0
- package/esm/src/mail/types.d.ts +176 -0
- package/esm/src/mail/types.d.ts.map +1 -0
- package/esm/src/mail/types.js +1 -0
- package/esm/src/mui/mail.d.ts +29 -0
- package/esm/src/mui/mail.d.ts.map +1 -0
- package/esm/src/mui/mail.js +114 -0
- package/esm/src/mui/mailView.d.ts +20 -0
- package/esm/src/mui/mailView.d.ts.map +1 -0
- package/esm/src/mui/mailView.js +26 -0
- package/esm/src/mui/mod.d.ts +1 -0
- package/esm/src/mui/mod.d.ts.map +1 -1
- package/esm/src/mui/mod.js +1 -0
- package/esm/src/next/mail/mod.d.ts +3 -0
- package/esm/src/next/mail/mod.d.ts.map +1 -0
- package/esm/src/next/mail/mod.js +2 -0
- package/esm/src/next/mail/route.d.ts +12 -0
- package/esm/src/next/mail/route.d.ts.map +1 -0
- package/esm/src/next/mail/route.js +43 -0
- package/package.json +56 -2
- package/script/_dnt.polyfills.d.ts +6 -0
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/mod.d.ts +2 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +2 -0
- package/script/src/cli/mod.d.ts +4 -2
- package/script/src/cli/mod.d.ts.map +1 -1
- package/script/src/cli/mod.js +2018 -369
- package/script/src/cli/projectTooling.d.ts +138 -0
- package/script/src/cli/projectTooling.d.ts.map +1 -0
- package/script/src/cli/projectTooling.js +634 -0
- package/script/src/mail/errors.d.ts +33 -0
- package/script/src/mail/errors.d.ts.map +1 -0
- package/script/src/mail/errors.js +97 -0
- package/script/src/mail/memory.d.ts +30 -0
- package/script/src/mail/memory.d.ts.map +1 -0
- package/script/src/mail/memory.js +345 -0
- package/script/src/mail/mod.d.ts +7 -0
- package/script/src/mail/mod.d.ts.map +1 -0
- package/script/src/mail/mod.js +22 -0
- package/script/src/mail/postal.d.ts +57 -0
- package/script/src/mail/postal.d.ts.map +1 -0
- package/script/src/mail/postal.js +245 -0
- package/script/src/mail/retry.d.ts +9 -0
- package/script/src/mail/retry.d.ts.map +1 -0
- package/script/src/mail/retry.js +22 -0
- package/script/src/mail/service.d.ts +23 -0
- package/script/src/mail/service.d.ts.map +1 -0
- package/script/src/mail/service.js +189 -0
- package/script/src/mail/types.d.ts +176 -0
- package/script/src/mail/types.d.ts.map +1 -0
- package/script/src/mail/types.js +2 -0
- package/script/src/mui/mail.d.ts +29 -0
- package/script/src/mui/mail.d.ts.map +1 -0
- package/script/src/mui/mail.js +159 -0
- package/script/src/mui/mailView.d.ts +20 -0
- package/script/src/mui/mailView.d.ts.map +1 -0
- package/script/src/mui/mailView.js +32 -0
- package/script/src/mui/mod.d.ts +1 -0
- package/script/src/mui/mod.d.ts.map +1 -1
- package/script/src/mui/mod.js +1 -0
- package/script/src/next/mail/mod.d.ts +3 -0
- package/script/src/next/mail/mod.d.ts.map +1 -0
- package/script/src/next/mail/mod.js +18 -0
- package/script/src/next/mail/route.d.ts +12 -0
- package/script/src/next/mail/route.d.ts.map +1 -0
- package/script/src/next/mail/route.js +46 -0
- package/skills/loom/SKILL.md +34 -22
- package/skills/loom-db/SKILL.md +9 -7
- package/skills/loom-db/references/db-stack.md +2 -1
- package/skills/loom-jobs/SKILL.md +9 -6
- package/skills/loom-lingui/SKILL.md +38 -0
- package/skills/loom-lingui/agents/openai.yaml +4 -0
- package/skills/loom-mail/SKILL.md +68 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/mail/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,WAAW,GACX,QAAQ,GACR,qBAAqB,GACrB,QAAQ,GACR,SAAS,GACT,MAAM,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAC9B,UAAU,GACV,SAAS,GACT,WAAW,GACX,SAAS,GACT,WAAW,GACX,QAAQ,GACR,MAAM,GACN,QAAQ,CAAC;AAEb,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;AAExD,MAAM,MAAM,yBAAyB,GACjC,SAAS,GACT,SAAS,GACT,WAAW,GACX,QAAQ,GACR,MAAM,GACN,SAAS,CAAC;AAEd,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAA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G,EAAE,IAAI,CAAC;KACX,GAAG,IAAI,GAAG,IAAI,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,uBAAuB,CAAC;CAC3C;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe,CAC9B,QAAQ,SAAS,qBAAqB,GAAG,qBAAqB;IAE9D,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,WAAW,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAC;IACzE,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACpD,mBAAmB,CACjB,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnD,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC;QACtC,OAAO,EAAE,QAAQ,CAAC;QAClB,MAAM,EAAE,uBAAuB,CAAC;KACjC,CAAC,CAAC;CACJ"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "../../_dnt.polyfills.js";
|
|
2
|
+
import { type MailAdminRow } from "./mailView.js";
|
|
3
|
+
export * from "./mailView.js";
|
|
4
|
+
export interface MailTestActionState {
|
|
5
|
+
message: string | null;
|
|
6
|
+
messageId?: string;
|
|
7
|
+
status: "error" | "idle" | "success";
|
|
8
|
+
}
|
|
9
|
+
export type MailTestAction = (previous: MailTestActionState, formData: FormData) => Promise<MailTestActionState>;
|
|
10
|
+
export type MailRowAction = (formData: FormData) => Promise<void>;
|
|
11
|
+
export interface MailTestFormProps {
|
|
12
|
+
action: MailTestAction;
|
|
13
|
+
defaultSubject?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Reusable admin-only form. The injected server action must enforce auth. */
|
|
17
|
+
export declare function MailTestForm(props: MailTestFormProps): any;
|
|
18
|
+
export interface MailLogTableProps {
|
|
19
|
+
cancelAction?: MailRowAction;
|
|
20
|
+
detailsBasePath?: string;
|
|
21
|
+
retryAction?: MailRowAction;
|
|
22
|
+
rows: MailAdminRow[];
|
|
23
|
+
}
|
|
24
|
+
export declare function MailLogTable(props: MailLogTableProps): any;
|
|
25
|
+
export interface AdminMailConsoleProps extends MailLogTableProps {
|
|
26
|
+
testAction: MailTestAction;
|
|
27
|
+
}
|
|
28
|
+
export declare function AdminMailConsole(props: AdminMailConsoleProps): any;
|
|
29
|
+
//# sourceMappingURL=mail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mail.d.ts","sourceRoot":"","sources":["../../../src/src/mui/mail.tsx"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAoBjC,OAAO,EAIL,KAAK,YAAY,EAElB,MAAM,eAAe,CAAC;AAEvB,cAAc,eAAe,CAAC;AAE9B,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,MAAM,cAAc,GAAG,CAC3B,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,QAAQ,KACf,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAElC,MAAM,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAgBlE,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,cAAc,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,OAwEpD;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,OA+GpD;AAED,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,OA0B5D"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.MailTestForm = MailTestForm;
|
|
43
|
+
exports.MailLogTable = MailLogTable;
|
|
44
|
+
exports.AdminMailConsole = AdminMailConsole;
|
|
45
|
+
require("../../_dnt.polyfills.js");
|
|
46
|
+
"use client";
|
|
47
|
+
const Alert_1 = __importDefault(require("@mui/material/Alert"));
|
|
48
|
+
const Button_1 = __importDefault(require("@mui/material/Button"));
|
|
49
|
+
const Chip_1 = __importDefault(require("@mui/material/Chip"));
|
|
50
|
+
const Paper_1 = __importDefault(require("@mui/material/Paper"));
|
|
51
|
+
const Stack_1 = __importDefault(require("@mui/material/Stack"));
|
|
52
|
+
const Tab_1 = __importDefault(require("@mui/material/Tab"));
|
|
53
|
+
const Table_1 = __importDefault(require("@mui/material/Table"));
|
|
54
|
+
const TableBody_1 = __importDefault(require("@mui/material/TableBody"));
|
|
55
|
+
const TableCell_1 = __importDefault(require("@mui/material/TableCell"));
|
|
56
|
+
const TableContainer_1 = __importDefault(require("@mui/material/TableContainer"));
|
|
57
|
+
const TableHead_1 = __importDefault(require("@mui/material/TableHead"));
|
|
58
|
+
const TableRow_1 = __importDefault(require("@mui/material/TableRow"));
|
|
59
|
+
const Tabs_1 = __importDefault(require("@mui/material/Tabs"));
|
|
60
|
+
const TextField_1 = __importDefault(require("@mui/material/TextField"));
|
|
61
|
+
const Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
62
|
+
const react_1 = __importStar(require("react"));
|
|
63
|
+
const react_dom_1 = require("react-dom");
|
|
64
|
+
const mailView_js_1 = require("./mailView.js");
|
|
65
|
+
__exportStar(require("./mailView.js"), exports);
|
|
66
|
+
const initialTestState = {
|
|
67
|
+
message: null,
|
|
68
|
+
status: "idle",
|
|
69
|
+
};
|
|
70
|
+
function SubmitMailButton() {
|
|
71
|
+
const { pending } = (0, react_dom_1.useFormStatus)();
|
|
72
|
+
return (react_1.default.createElement(Button_1.default, { type: "submit", variant: "contained", disabled: pending }, pending ? "Sending…" : "Send test email"));
|
|
73
|
+
}
|
|
74
|
+
/** Reusable admin-only form. The injected server action must enforce auth. */
|
|
75
|
+
function MailTestForm(props) {
|
|
76
|
+
const [state, formAction] = (0, react_1.useActionState)(props.action, initialTestState);
|
|
77
|
+
const formRef = (0, react_1.useRef)(null);
|
|
78
|
+
(0, react_1.useEffect)(() => {
|
|
79
|
+
if (state.status === "success") {
|
|
80
|
+
formRef.current?.reset();
|
|
81
|
+
}
|
|
82
|
+
}, [state.status]);
|
|
83
|
+
return (react_1.default.createElement(Stack_1.default, { component: "form", action: formAction, ref: formRef, spacing: 2, noValidate: true },
|
|
84
|
+
react_1.default.createElement(Typography_1.default, { variant: "h6" }, "Test / one-off email"),
|
|
85
|
+
react_1.default.createElement(Typography_1.default, { color: "text.secondary" }, props.description ??
|
|
86
|
+
"Verify sender configuration and delivery while recording the attempt in the mail log."),
|
|
87
|
+
state.message
|
|
88
|
+
? (react_1.default.createElement(Alert_1.default, { severity: state.status === "success" ? "success" : "error" },
|
|
89
|
+
state.message,
|
|
90
|
+
state.messageId ? ` Message ID: ${state.messageId}` : null))
|
|
91
|
+
: null,
|
|
92
|
+
react_1.default.createElement(TextField_1.default, { name: "to", label: "To", required: true, fullWidth: true, helperText: "Separate multiple recipients with commas or new lines." }),
|
|
93
|
+
react_1.default.createElement(Stack_1.default, { direction: { xs: "column", md: "row" }, spacing: 2 },
|
|
94
|
+
react_1.default.createElement(TextField_1.default, { name: "cc", label: "CC", fullWidth: true }),
|
|
95
|
+
react_1.default.createElement(TextField_1.default, { name: "bcc", label: "BCC", fullWidth: true })),
|
|
96
|
+
react_1.default.createElement(Stack_1.default, { direction: { xs: "column", md: "row" }, spacing: 2 },
|
|
97
|
+
react_1.default.createElement(TextField_1.default, { name: "replyTo", label: "Reply-To", fullWidth: true }),
|
|
98
|
+
react_1.default.createElement(TextField_1.default, { name: "tag", label: "Tag", fullWidth: true })),
|
|
99
|
+
react_1.default.createElement(TextField_1.default, { name: "subject", label: "Subject", defaultValue: props.defaultSubject, required: true, fullWidth: true }),
|
|
100
|
+
react_1.default.createElement(TextField_1.default, { name: "plainBody", label: "Plain text body", fullWidth: true, multiline: true, minRows: 6 }),
|
|
101
|
+
react_1.default.createElement(TextField_1.default, { name: "htmlBody", label: "HTML body", fullWidth: true, multiline: true, minRows: 8 }),
|
|
102
|
+
react_1.default.createElement("div", null,
|
|
103
|
+
react_1.default.createElement(SubmitMailButton, null))));
|
|
104
|
+
}
|
|
105
|
+
function MailLogTable(props) {
|
|
106
|
+
if (props.rows.length === 0) {
|
|
107
|
+
return (react_1.default.createElement(Stack_1.default, { spacing: 1, sx: { p: 3 } },
|
|
108
|
+
react_1.default.createElement(Typography_1.default, { variant: "h6" }, "No mail yet"),
|
|
109
|
+
react_1.default.createElement(Typography_1.default, { color: "text.secondary" }, "Messages appear here after they are queued.")));
|
|
110
|
+
}
|
|
111
|
+
return (react_1.default.createElement(TableContainer_1.default, { component: Paper_1.default },
|
|
112
|
+
react_1.default.createElement(Table_1.default, { size: "small" },
|
|
113
|
+
react_1.default.createElement(TableHead_1.default, null,
|
|
114
|
+
react_1.default.createElement(TableRow_1.default, null,
|
|
115
|
+
react_1.default.createElement(TableCell_1.default, null, "Subject"),
|
|
116
|
+
react_1.default.createElement(TableCell_1.default, null, "Status"),
|
|
117
|
+
react_1.default.createElement(TableCell_1.default, null, "Recipients"),
|
|
118
|
+
react_1.default.createElement(TableCell_1.default, null, "Provider ID"),
|
|
119
|
+
react_1.default.createElement(TableCell_1.default, null, "Created"),
|
|
120
|
+
react_1.default.createElement(TableCell_1.default, { align: "right" }, "Actions"))),
|
|
121
|
+
react_1.default.createElement(TableBody_1.default, null, props.rows.map((row) => (react_1.default.createElement(TableRow_1.default, { key: row.id, hover: true },
|
|
122
|
+
react_1.default.createElement(TableCell_1.default, null,
|
|
123
|
+
react_1.default.createElement(Stack_1.default, { spacing: 0.5 },
|
|
124
|
+
react_1.default.createElement(Typography_1.default, { variant: "body2", sx: { fontWeight: 600 } }, row.subject),
|
|
125
|
+
react_1.default.createElement(Typography_1.default, { variant: "caption", color: "text.secondary" }, row.tag ?? "untagged"))),
|
|
126
|
+
react_1.default.createElement(TableCell_1.default, null,
|
|
127
|
+
react_1.default.createElement(Chip_1.default, { label: row.status.replaceAll("_", " "), color: (0, mailView_js_1.mailStatusColor)(row.status), size: "small" })),
|
|
128
|
+
react_1.default.createElement(TableCell_1.default, null, row.recipients.map((recipient) => recipient.email).join(", ") ||
|
|
129
|
+
"None"),
|
|
130
|
+
react_1.default.createElement(TableCell_1.default, null,
|
|
131
|
+
react_1.default.createElement(Typography_1.default, { variant: "caption" }, row.providerMessageId ?? "Pending")),
|
|
132
|
+
react_1.default.createElement(TableCell_1.default, null,
|
|
133
|
+
react_1.default.createElement(Typography_1.default, { variant: "caption" }, (0, mailView_js_1.formatMailAdminDate)(row.createdAt))),
|
|
134
|
+
react_1.default.createElement(TableCell_1.default, { align: "right" },
|
|
135
|
+
react_1.default.createElement(Stack_1.default, { direction: { xs: "column", md: "row" }, spacing: 1 },
|
|
136
|
+
props.detailsBasePath
|
|
137
|
+
? (react_1.default.createElement(Button_1.default, { component: "a", href: `${props.detailsBasePath}/${row.id}`, size: "small" }, "View"))
|
|
138
|
+
: null,
|
|
139
|
+
props.retryAction
|
|
140
|
+
? (react_1.default.createElement("form", { action: props.retryAction },
|
|
141
|
+
react_1.default.createElement("input", { type: "hidden", name: "messageId", value: row.id }),
|
|
142
|
+
react_1.default.createElement(Button_1.default, { size: "small", type: "submit", disabled: !(0, mailView_js_1.canRetryMail)(row.status) }, "Retry")))
|
|
143
|
+
: null,
|
|
144
|
+
props.cancelAction
|
|
145
|
+
? (react_1.default.createElement("form", { action: props.cancelAction },
|
|
146
|
+
react_1.default.createElement("input", { type: "hidden", name: "messageId", value: row.id }),
|
|
147
|
+
react_1.default.createElement(Button_1.default, { size: "small", type: "submit", color: "error", disabled: !(0, mailView_js_1.canCancelMail)(row.status) }, "Cancel")))
|
|
148
|
+
: null)))))))));
|
|
149
|
+
}
|
|
150
|
+
function AdminMailConsole(props) {
|
|
151
|
+
const [tab, setTab] = (0, react_1.useState)(0);
|
|
152
|
+
return (react_1.default.createElement(Paper_1.default, null,
|
|
153
|
+
react_1.default.createElement(Tabs_1.default, { value: tab, onChange: (_event, value) => setTab(value), "aria-label": "Mail administration" },
|
|
154
|
+
react_1.default.createElement(Tab_1.default, { label: "Mail log" }),
|
|
155
|
+
react_1.default.createElement(Tab_1.default, { label: "Send test" })),
|
|
156
|
+
react_1.default.createElement(Stack_1.default, { sx: { p: 3 } }, tab === 0
|
|
157
|
+
? (react_1.default.createElement(MailLogTable, { cancelAction: props.cancelAction, detailsBasePath: props.detailsBasePath, retryAction: props.retryAction, rows: props.rows }))
|
|
158
|
+
: react_1.default.createElement(MailTestForm, { action: props.testAction }))));
|
|
159
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LoomMailMessageStatus, LoomMailRecipientKind } from "../mail/types.js";
|
|
2
|
+
export interface MailAdminRecipientRow {
|
|
3
|
+
email: string;
|
|
4
|
+
kind: LoomMailRecipientKind;
|
|
5
|
+
status?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface MailAdminRow {
|
|
8
|
+
createdAt: string;
|
|
9
|
+
id: string;
|
|
10
|
+
providerMessageId?: string | null;
|
|
11
|
+
recipients: MailAdminRecipientRow[];
|
|
12
|
+
status: LoomMailMessageStatus;
|
|
13
|
+
subject: string;
|
|
14
|
+
tag?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare function mailStatusColor(status: LoomMailMessageStatus): "error" | "info" | "success" | "default" | "warning";
|
|
17
|
+
export declare function formatMailAdminDate(value: string): string;
|
|
18
|
+
export declare function canCancelMail(status: LoomMailMessageStatus): status is "failed" | "queued";
|
|
19
|
+
export declare function canRetryMail(status: LoomMailMessageStatus): status is "failed" | "cancelled";
|
|
20
|
+
//# sourceMappingURL=mailView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailView.d.ts","sourceRoot":"","sources":["../../../src/src/mui/mailView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,qBAAqB,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACpC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,wDAe5D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,UAGhD;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,qBAAqB,iCAE1D;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,qBAAqB,oCAEzD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mailStatusColor = mailStatusColor;
|
|
4
|
+
exports.formatMailAdminDate = formatMailAdminDate;
|
|
5
|
+
exports.canCancelMail = canCancelMail;
|
|
6
|
+
exports.canRetryMail = canRetryMail;
|
|
7
|
+
function mailStatusColor(status) {
|
|
8
|
+
switch (status) {
|
|
9
|
+
case "delivered":
|
|
10
|
+
return "success";
|
|
11
|
+
case "failed":
|
|
12
|
+
case "partially_delivered":
|
|
13
|
+
return "error";
|
|
14
|
+
case "sent":
|
|
15
|
+
return "info";
|
|
16
|
+
case "queued":
|
|
17
|
+
case "sending":
|
|
18
|
+
return "warning";
|
|
19
|
+
case "cancelled":
|
|
20
|
+
return "default";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function formatMailAdminDate(value) {
|
|
24
|
+
const date = new Date(value);
|
|
25
|
+
return Number.isNaN(date.valueOf()) ? value : date.toLocaleString();
|
|
26
|
+
}
|
|
27
|
+
function canCancelMail(status) {
|
|
28
|
+
return status === "queued" || status === "failed";
|
|
29
|
+
}
|
|
30
|
+
function canRetryMail(status) {
|
|
31
|
+
return status === "failed" || status === "cancelled";
|
|
32
|
+
}
|
package/script/src/mui/mod.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/mui/mod.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/mui/mod.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
package/script/src/mui/mod.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/src/next/mail/mod.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC;AACpC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
require("../../../_dnt.polyfills.js");
|
|
18
|
+
__exportStar(require("./route.js"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LoomMailProviderEvent, LoomMailProviderEventResult } from "../../mail/types.js";
|
|
2
|
+
import type { PostalWebhookPublicKey } from "../../mail/postal.js";
|
|
3
|
+
export interface CreatePostalWebhookRouteHandlerOptions {
|
|
4
|
+
handleEvent: (event: LoomMailProviderEvent) => Promise<LoomMailProviderEventResult>;
|
|
5
|
+
publicKeys: readonly PostalWebhookPublicKey[] | (() => readonly PostalWebhookPublicKey[]);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Next.js-compatible Postal webhook handler. Signature verification always
|
|
9
|
+
* runs against the exact raw text before JSON parsing or persistence.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createPostalWebhookRouteHandler(options: CreatePostalWebhookRouteHandlerOptions): (request: Request) => Promise<any>;
|
|
12
|
+
//# sourceMappingURL=route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/src/next/mail/route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,WAAW,sCAAsC;IACrD,WAAW,EAAE,CACX,KAAK,EAAE,qBAAqB,KACzB,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC1C,UAAU,EACN,SAAS,sBAAsB,EAAE,GACjC,CAAC,MAAM,SAAS,sBAAsB,EAAE,CAAC,CAAC;CAC/C;AASD;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,sCAAsC,IAEpB,SAAS,OAAO,kBAyC5C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPostalWebhookRouteHandler = createPostalWebhookRouteHandler;
|
|
4
|
+
const postal_js_1 = require("../../mail/postal.js");
|
|
5
|
+
function json(body, status) {
|
|
6
|
+
return Response.json(body, {
|
|
7
|
+
headers: { "Cache-Control": "no-store" },
|
|
8
|
+
status,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Next.js-compatible Postal webhook handler. Signature verification always
|
|
13
|
+
* runs against the exact raw text before JSON parsing or persistence.
|
|
14
|
+
*/
|
|
15
|
+
function createPostalWebhookRouteHandler(options) {
|
|
16
|
+
return async function POST(request) {
|
|
17
|
+
try {
|
|
18
|
+
const body = await request.text();
|
|
19
|
+
const publicKeys = typeof options.publicKeys === "function"
|
|
20
|
+
? options.publicKeys()
|
|
21
|
+
: options.publicKeys;
|
|
22
|
+
await (0, postal_js_1.verifyPostalWebhookSignature)({
|
|
23
|
+
body,
|
|
24
|
+
headers: request.headers,
|
|
25
|
+
publicKeys,
|
|
26
|
+
});
|
|
27
|
+
const event = (0, postal_js_1.parsePostalWebhook)(body);
|
|
28
|
+
const result = await options.handleEvent(event);
|
|
29
|
+
if (result.messageId === null) {
|
|
30
|
+
return json({ code: "mail_message_not_found", error: "Mail message not found." }, 503);
|
|
31
|
+
}
|
|
32
|
+
return json({ accepted: true, duplicate: !result.inserted }, 202);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error instanceof postal_js_1.LoomPostalWebhookError) {
|
|
36
|
+
return json({
|
|
37
|
+
code: error.code,
|
|
38
|
+
error: error.status >= 500
|
|
39
|
+
? "Webhook configuration failed."
|
|
40
|
+
: error.message,
|
|
41
|
+
}, error.status);
|
|
42
|
+
}
|
|
43
|
+
return json({ code: "webhook_processing_failed", error: "Webhook failed." }, 500);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
package/skills/loom/SKILL.md
CHANGED
|
@@ -15,10 +15,13 @@ project.
|
|
|
15
15
|
## Start here
|
|
16
16
|
|
|
17
17
|
1. Read `loom.json` first.
|
|
18
|
-
2.
|
|
19
|
-
|
|
18
|
+
2. Read `project.tooling` and use its recorded task runner/config and dependency
|
|
19
|
+
manager/config. Do not infer them again from whichever config you notice
|
|
20
|
+
first.
|
|
21
|
+
3. Identify which loom features are active and which paths are configured there.
|
|
22
|
+
4. Treat the active loom features as the contract between the app and the shared
|
|
20
23
|
package.
|
|
21
|
-
|
|
24
|
+
5. Run `loom status` when you need a quick summary of active features, local
|
|
22
25
|
Loom dev state, or managed/recommended skill links.
|
|
23
26
|
|
|
24
27
|
## Cross-repository Loom work
|
|
@@ -45,6 +48,12 @@ from the consumer's working directory.
|
|
|
45
48
|
instead of duplicating it in one app.
|
|
46
49
|
- Do not assume one file layout. Respect `app/...` vs `src/app/...` and any
|
|
47
50
|
configured loom paths.
|
|
51
|
+
- Do not assume commands live in `package.json` or run with pnpm. Projects may
|
|
52
|
+
use `deno.json`/`deno.jsonc`, package scripts, or package dependencies with
|
|
53
|
+
canonical Deno tasks.
|
|
54
|
+
- Preserve JSONC comments, unrelated tasks, and complex existing build commands.
|
|
55
|
+
Use Loom's project-tooling task helpers for shared CLI work instead of direct
|
|
56
|
+
whole-file rewrites or string-only runner guesses.
|
|
48
57
|
- If a loom-managed file exists only as a thin wrapper, keep it thin unless the
|
|
49
58
|
app intentionally needs custom behavior there.
|
|
50
59
|
|
|
@@ -52,9 +61,9 @@ from the consumer's working directory.
|
|
|
52
61
|
|
|
53
62
|
- Next commands such as `next dev`, `next build`, and server runtime code load
|
|
54
63
|
`.env*` files themselves. Do not add extra env loading around those paths.
|
|
55
|
-
- Non-Next commands that need app env should run through
|
|
56
|
-
|
|
57
|
-
`
|
|
64
|
+
- Non-Next commands that need app env should run through the authoritative
|
|
65
|
+
project task that centralizes env loading, or directly through the installed
|
|
66
|
+
`loom env -- <command>` command.
|
|
58
67
|
- `loom env -- <command> [...args]` loads env files from the consumer project
|
|
59
68
|
root with Next-compatible `@next/env` semantics, preserves existing shell env
|
|
60
69
|
precedence, then runs the command from the project root.
|
|
@@ -147,33 +156,36 @@ as more authoritative than a generic mapped error when deciding what failed.
|
|
|
147
156
|
|
|
148
157
|
## Local development
|
|
149
158
|
|
|
150
|
-
- For local unpublished Loom package development
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
- For local unpublished Loom package development, use `loom dev local <path>`.
|
|
160
|
+
Loom uses a managed `file:` override in `pnpm-workspace.yaml` for pnpm
|
|
161
|
+
projects and a local `links` entry in the authoritative Deno config for Deno
|
|
162
|
+
projects.
|
|
163
|
+
- The managed flow keeps the committed dependency/import on a published Loom
|
|
164
|
+
version. Use the printed pnpm refresh command or `deno install`, according to
|
|
165
|
+
`project.tooling`.
|
|
156
166
|
- This still avoids the peer-resolution problems we observed with `pnpm link`
|
|
157
167
|
when Loom is consumed by React apps.
|
|
158
168
|
- Treat this as a workaround for current pnpm behavior, not a permanent
|
|
159
169
|
preference. If pnpm's local-link behavior changes enough to preserve peer
|
|
160
170
|
resolution cleanly for Loom, this workaround can be revisited or removed.
|
|
161
171
|
- Before committing app changes or preparing a published build, switch back with
|
|
162
|
-
`loom dev published`, then run the
|
|
163
|
-
|
|
164
|
-
- `loom dev sync` records the Loom source commit in the managed
|
|
165
|
-
|
|
166
|
-
local package path points at a Loom git checkout.
|
|
172
|
+
`loom dev published`, then run the printed pnpm refresh command or
|
|
173
|
+
`deno install`.
|
|
174
|
+
- `loom dev sync` records the Loom source commit in the managed pnpm block when
|
|
175
|
+
applicable and gitignored `.loom/dev-state.json` for both project kinds when
|
|
176
|
+
the local package path points at a Loom git checkout.
|
|
167
177
|
- `loom dev published` uses that recorded commit as a release gate when present:
|
|
168
178
|
the commit must be cleanly synced, reachable from `origin/main`, and either
|
|
169
179
|
included in a semver release tag or package-equivalent to the latest semver
|
|
170
180
|
release because only non-package files changed after that tag. The app then
|
|
171
181
|
switches to the exact published Loom version that covers the sync.
|
|
172
|
-
- `loom dev published` also
|
|
173
|
-
still point at local Loom after
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
182
|
+
- `loom dev published` also removes Deno links and notices stale
|
|
183
|
+
`pnpm-lock.yaml` resolutions that still point at local Loom after a pnpm
|
|
184
|
+
workspace override has been removed.
|
|
185
|
+
- `loom check` should warn during normal development if a Deno link or pnpm
|
|
186
|
+
lockfile still resolves Loom locally, if the synced Loom commit is
|
|
187
|
+
unpublished, or if it is covered by a newer exact version than the app
|
|
188
|
+
currently pins.
|
|
177
189
|
- If an older local-dev block has no recorded commit, switch back carefully and
|
|
178
190
|
run `loom dev sync` first whenever the app may depend on unpublished Loom
|
|
179
191
|
changes.
|
package/skills/loom-db/SKILL.md
CHANGED
|
@@ -10,9 +10,12 @@ Use this skill when working on the shared DB stack from a consuming app.
|
|
|
10
10
|
## Start here
|
|
11
11
|
|
|
12
12
|
1. Read `loom.json`.
|
|
13
|
-
2.
|
|
13
|
+
2. Read `project.tooling` and use its authoritative task/dependency configs and
|
|
14
|
+
runners; DB tasks may live in `deno.json(c)` even when npm dependencies live
|
|
15
|
+
in `package.json`.
|
|
16
|
+
3. Inspect `features.db.config` and use the configured module and directory
|
|
14
17
|
paths instead of assuming defaults.
|
|
15
|
-
|
|
18
|
+
4. Check the app-local schema barrel before changing any Loom-managed DB files.
|
|
16
19
|
|
|
17
20
|
## Ownership boundaries
|
|
18
21
|
|
|
@@ -25,10 +28,9 @@ Use this skill when working on the shared DB stack from a consuming app.
|
|
|
25
28
|
shared PGlite test harness.
|
|
26
29
|
- Valibot generated files stay app-local, but should be regenerated through
|
|
27
30
|
`loom db schema-gen` instead of ad hoc commands.
|
|
28
|
-
- DB-backed
|
|
29
|
-
should use the app's env-aware
|
|
30
|
-
|
|
31
|
-
to implementation files.
|
|
31
|
+
- DB-backed tasks, Drizzle commands, direct SQL inspection, and migrations
|
|
32
|
+
should use the app's authoritative env-aware tasks or `loom env -- <command>`.
|
|
33
|
+
Do not add `dotenv` or `@next/env` imports to implementation files.
|
|
32
34
|
- `createDrizzleConfig()` prefers `MIGRATION_DATABASE_URL_UNPOOLED`, then
|
|
33
35
|
`MIGRATION_DATABASE_URL`, before the gradual-adoption fallbacks
|
|
34
36
|
`DATABASE_URL_UNPOOLED` and `DATABASE_URL`.
|
|
@@ -60,7 +62,7 @@ Use this skill when working on the shared DB stack from a consuming app.
|
|
|
60
62
|
## Verification
|
|
61
63
|
|
|
62
64
|
- Run `loom check` after DB feature changes.
|
|
63
|
-
- Confirm
|
|
65
|
+
- Confirm authoritative tasks still point at Loom-managed commands, especially
|
|
64
66
|
`schema:gen`, `db:fixtures`, and the Drizzle script that runs through
|
|
65
67
|
`loom env --`.
|
|
66
68
|
- Confirm `drizzle.config.ts` still points at the configured schema and drizzle
|
|
@@ -9,7 +9,8 @@ The Loom DB feature standardizes the cross-app wiring around:
|
|
|
9
9
|
- thin wrappers for `tests/memory-pglite.ts`
|
|
10
10
|
- thin wrappers for `src/db/valibot/refinements/_common.ts`
|
|
11
11
|
- `src/db/valibot/index.ts`
|
|
12
|
-
-
|
|
12
|
+
- authoritative DB tasks in `package.json` or `deno.json(c)`, including
|
|
13
|
+
`schema:gen` and `db:fixtures`
|
|
13
14
|
|
|
14
15
|
It does not own:
|
|
15
16
|
|
|
@@ -10,9 +10,11 @@ Use this skill when working on the shared jobs feature from a consuming app.
|
|
|
10
10
|
## Start here
|
|
11
11
|
|
|
12
12
|
1. Read `loom.json`.
|
|
13
|
-
2.
|
|
13
|
+
2. Read `project.tooling`; the `job` task may be a Deno task even when
|
|
14
|
+
dependencies are managed through `package.json`.
|
|
15
|
+
3. Inspect `features.jobs.config` and use the configured module and UI paths
|
|
14
16
|
instead of assuming defaults.
|
|
15
|
-
|
|
17
|
+
4. Check the app-local jobs catalog files before changing wrappers.
|
|
16
18
|
|
|
17
19
|
## Ownership boundaries
|
|
18
20
|
|
|
@@ -33,8 +35,8 @@ Use this skill when working on the shared jobs feature from a consuming app.
|
|
|
33
35
|
- The configured catalog imports, especially metadata-only exports used by the
|
|
34
36
|
jobs list page.
|
|
35
37
|
- Direct-runner settings and script paths when the app has opted into them.
|
|
36
|
-
- Direct job runners should assume env has already been loaded by the
|
|
37
|
-
|
|
38
|
+
- Direct job runners should assume env has already been loaded by the project
|
|
39
|
+
task. Keep env loading in tasks such as `job` via `loom env --`, not in
|
|
38
40
|
`scripts/jobDirect.ts`.
|
|
39
41
|
|
|
40
42
|
## Catalog runtime boundaries
|
|
@@ -144,5 +146,6 @@ When adding or upgrading a job:
|
|
|
144
146
|
`createJobsRunPage`, and `createJobsRouteHandler`.
|
|
145
147
|
- Confirm executable catalog entries use `createLazyJob` and the metadata
|
|
146
148
|
catalog does not import job implementations.
|
|
147
|
-
- Confirm the `job`
|
|
148
|
-
and that the direct-runner file does not import `dotenv` or
|
|
149
|
+
- Confirm the authoritative `job` task runs the direct runner through
|
|
150
|
+
`loom env --` and that the direct-runner file does not import `dotenv` or
|
|
151
|
+
`@next/env`.
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: loom-lingui
|
|
3
|
+
description: Manage Lingui catalog tooling in Loom consumer projects. Use when adding, migrating, reviewing, or repairing Lingui dependencies, catalog modes, extraction and compilation tasks, generated-catalog ignores, or Next.js loader and SWC wiring.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Loom Lingui
|
|
7
|
+
|
|
8
|
+
Treat `.po` catalogs as the reviewable translation source. Do not hand-edit
|
|
9
|
+
generated JavaScript catalogs.
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
1. Inspect `loom.json`, the Lingui config, dependency and task config,
|
|
14
|
+
`.gitignore`, Next config, and runtime catalog imports.
|
|
15
|
+
2. Run `loom add lingui` to adopt or repair the managed baseline.
|
|
16
|
+
3. Confirm the recorded catalog mode matches runtime imports:
|
|
17
|
+
- Use `precompile` when runtime code imports generated `.js` catalogs. Ensure
|
|
18
|
+
the compile task runs before the framework build.
|
|
19
|
+
- Use `loader` when runtime code imports `.po` catalogs. Ensure
|
|
20
|
+
`@lingui/loader` is configured for both Turbopack and webpack when both are
|
|
21
|
+
supported.
|
|
22
|
+
4. Keep generated catalog patterns ignored. If generated files are already
|
|
23
|
+
tracked, propose removing only those files from the Git index while leaving
|
|
24
|
+
local build output intact.
|
|
25
|
+
5. Run `loom check`, the Lingui compile task, and the production build.
|
|
26
|
+
|
|
27
|
+
## Boundaries
|
|
28
|
+
|
|
29
|
+
Leave locale lists, routing, translated content, message IDs, fallback behavior,
|
|
30
|
+
and automated translation providers app-owned. Change them only when the user
|
|
31
|
+
explicitly requests it.
|
|
32
|
+
|
|
33
|
+
Preserve existing Lingui config and custom tasks when Loom reports a conflict.
|
|
34
|
+
Diagnose the mismatch instead of overwriting app-owned behavior.
|
|
35
|
+
|
|
36
|
+
Prefer current package-specific macro entrypoints such as `@lingui/react/macro`
|
|
37
|
+
and `@lingui/core/macro`. Treat mismatched legacy `@lingui/macro` versions as
|
|
38
|
+
migration work, not generated-catalog policy.
|