@wwchen/stack-notify 0.10.1 → 0.11.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 CHANGED
@@ -17,5 +17,9 @@ await mailer.send({ to, subject, text });
17
17
  | `countSinkLines(path)` | how many links the sink holds now |
18
18
  | `waitForLink(path, afterLine, timeoutMs?)` | the first link after line `afterLine`, polling until the timeout |
19
19
 
20
- `@wwchen/stack-notify/stack` exports `notify()` for the app's `stack.config.ts`: mail's agent rules, its `.gitignore` entry and its `.env.example` variables, written by `stack sync-blocks`, and its `stack doctor` check, a warning when `RESEND_API_KEY` is one variable for Production and Preview.
20
+ `@wwchen/stack-notify/stack`'s default export is mail's factory, which takes no settings; listing the package in the app's `package.json` composes it. It adds to the app:
21
+
22
+ - Blocks in `AGENTS.md`, `CLAUDE.md`, `.gitignore` and `.env.example`, written by `stack sync`, and its env fragment, `notifyEnv`, in the generated `src/stack/env.ts`.
23
+ - A `stack doctor` check: a warning when `RESEND_API_KEY` is one variable for Production and Preview.
24
+ - No commands, build steps or owned files.
21
25
 
package/blocks/AGENTS.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- Owned by @wwchen/stack-notify: `stack sync-blocks` rewrites everything between these markers. Put your own text outside them. -->
1
+ <!-- Owned by @wwchen/stack-notify: `stack sync` rewrites everything between these markers. Put your own text outside them. -->
2
2
 
3
3
  ## Mail
4
4
 
package/blocks/CLAUDE.md CHANGED
@@ -1,4 +1,4 @@
1
- <!-- Owned by @wwchen/stack-notify: `stack sync-blocks` rewrites everything between these markers. Put your own text outside them. -->
1
+ <!-- Owned by @wwchen/stack-notify: `stack sync` rewrites everything between these markers. Put your own text outside them. -->
2
2
 
3
3
  ## Mail
4
4
 
package/dist/stack.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- /** The files `stack sync-blocks` writes mail's blocks into: the core's `BLOCK_FILES`. */
1
+ /** The files `stack sync` writes mail's blocks into: the core's `BLOCK_FILES`. */
2
2
  declare const BLOCK_FILES: readonly ["AGENTS.md", "CLAUDE.md", ".gitignore", ".env.example"];
3
- /** A file `stack sync-blocks` writes a marked block into, and the block's text. */
3
+ /** A file `stack sync` writes a marked block into, and the URL of the file the block's text is read from. */
4
4
  type Block = {
5
5
  file: (typeof BLOCK_FILES)[number];
6
6
  source: URL;
@@ -10,6 +10,11 @@ type Finding = {
10
10
  severity: "error" | "warning" | "info";
11
11
  message: string;
12
12
  };
13
+ /** The core's `Export`: an import specifier and an export name. */
14
+ type Export = {
15
+ from: string;
16
+ name: string;
17
+ };
13
18
  type Facts = {
14
19
  envs: {
15
20
  key: string;
@@ -17,11 +22,14 @@ type Facts = {
17
22
  }[];
18
23
  };
19
24
  /**
20
- * Mail's package for the app's `stack.config.ts`: its check for `stack doctor`, and its agent rules, `.gitignore` entries and `.env.example` variables, written by `stack sync-blocks`. Its shape is the stack's `StackPackage`, written out here because this package imports no stack package.
25
+ * Mail's package, which takes no settings: its check for `stack doctor`, its agent rules, `.gitignore` entries and `.env.example` variables, written by `stack sync`, and its env fragment, for the app's generated env module. Its shape is the stack's `StackPackage`, written out here because this package imports no stack package.
21
26
  */
22
- export declare function notify(): {
27
+ export default function notify(): {
23
28
  name: string;
24
29
  doctorChecks: ((facts: Facts) => Promise<Finding[]>)[];
25
30
  blocks: Block[];
31
+ runtime: {
32
+ env: Export;
33
+ };
26
34
  };
27
35
  export {};
package/dist/stack.js CHANGED
@@ -1,4 +1,4 @@
1
- /** The files `stack sync-blocks` writes mail's blocks into: the core's `BLOCK_FILES`. */
1
+ /** The files `stack sync` writes mail's blocks into: the core's `BLOCK_FILES`. */
2
2
  const BLOCK_FILES = ["AGENTS.md", "CLAUDE.md", ".gitignore", ".env.example"];
3
3
  /** The core's `VERCEL_TARGET`, the two the check compares. */
4
4
  const PRODUCTION = "production";
@@ -23,12 +23,13 @@ const block = (file) => ({
23
23
  source: new URL(`../blocks/${file.replace(/^\./, "")}`, import.meta.url),
24
24
  });
25
25
  /**
26
- * Mail's package for the app's `stack.config.ts`: its check for `stack doctor`, and its agent rules, `.gitignore` entries and `.env.example` variables, written by `stack sync-blocks`. Its shape is the stack's `StackPackage`, written out here because this package imports no stack package.
26
+ * Mail's package, which takes no settings: its check for `stack doctor`, its agent rules, `.gitignore` entries and `.env.example` variables, written by `stack sync`, and its env fragment, for the app's generated env module. Its shape is the stack's `StackPackage`, written out here because this package imports no stack package.
27
27
  */
28
- export function notify() {
28
+ export default function notify() {
29
29
  return {
30
30
  name: "@wwchen/stack-notify",
31
31
  doctorChecks: [sharedSecret],
32
32
  blocks: BLOCK_FILES.map(block),
33
+ runtime: { env: { from: "@wwchen/stack-notify", name: "notifyEnv" } },
33
34
  };
34
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wwchen/stack-notify",
3
- "version": "0.10.1",
3
+ "version": "0.11.0",
4
4
  "description": "Send mail through Resend, or to a sink file in development and tests.",
5
5
  "license": "MIT",
6
6
  "repository": {