@c9up/rover 0.1.19 → 0.1.21

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.
@@ -12,6 +12,12 @@ interface Codemods {
12
12
  writeFile(filePath: string, content: string, options?: {
13
13
  force?: boolean;
14
14
  }): Promise<void>;
15
+ makeUsingStub(stubsRoot: string, stubPath: string, state?: Record<string, string | number | boolean>, options?: {
16
+ force?: boolean;
17
+ }): Promise<{
18
+ path: string;
19
+ contents: string;
20
+ }>;
15
21
  }
16
22
  export declare function configure(codemods: Codemods): Promise<void>;
17
23
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../src/configure.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,UAAU,QAAQ;IACjB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,SAAS,CACR,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAC3B,OAAO,CAAC,IAAI,CAAC,CAAC;CACjB;AAED,wBAAsB,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAiCjE"}
1
+ {"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../src/configure.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,UAAU,QAAQ;IACjB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,SAAS,CACR,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAC3B,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,aAAa,CACZ,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EACjD,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAC3B,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/C;AAED,wBAAsB,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAajE"}
package/dist/configure.js CHANGED
@@ -6,6 +6,7 @@
6
6
  * application wants. Writing both together is what makes `ream add` mean
7
7
  * installed AND working.
8
8
  */
9
+ import { stubsRoot } from "./stubs.js";
9
10
  export async function configure(codemods) {
10
11
  // The config below reads these, so they are declared here. Writing the file
11
12
  // without them leaves an application whose config asks the environment for
@@ -17,23 +18,6 @@ export async function configure(codemods) {
17
18
  SMTP_PORT: "587",
18
19
  });
19
20
  await codemods.addProvider("@c9up/rover/provider");
20
- await codemods.writeFile("config/mail.ts", `import { defineConfig, transports } from '@c9up/rover'
21
- import env from '#start/env'
22
-
23
- export default defineConfig({
24
- // Has to name one of the mailers below, or the application refuses to boot.
25
- default: env.get('MAIL_MAILER', 'log'),
26
- from: env.get('MAIL_FROM', 'noreply@example.com'),
27
-
28
- mailers: {
29
- // Writes to the logger instead of sending. The development mailer.
30
- log: transports.log(),
31
-
32
- smtp: transports.smtp({
33
- host: env.get('SMTP_HOST', ''),
34
- port: Number(env.get('SMTP_PORT', '587')),
35
- }),
36
- },
37
- })`);
21
+ await codemods.makeUsingStub(stubsRoot, "config/mail.stub");
38
22
  }
39
23
  //# sourceMappingURL=configure.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configure.js","sourceRoot":"","sources":["../src/configure.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAAkB;IACjD,4EAA4E;IAC5E,2EAA2E;IAC3E,oCAAoC;IACpC,MAAM,QAAQ,CAAC,UAAU,CAAC;QACzB,WAAW,EAAE,KAAK;QAClB,SAAS,EAAE,qBAAqB;QAChC,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,KAAK;KAChB,CAAC,CAAC;IAEH,MAAM,QAAQ,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IACnD,MAAM,QAAQ,CAAC,SAAS,CACvB,gBAAgB,EAChB;;;;;;;;;;;;;;;;;GAiBC,CACD,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"configure.js","sourceRoot":"","sources":["../src/configure.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAkBvC,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,QAAkB;IACjD,4EAA4E;IAC5E,2EAA2E;IAC3E,oCAAoC;IACpC,MAAM,QAAQ,CAAC,UAAU,CAAC;QACzB,WAAW,EAAE,KAAK;QAClB,SAAS,EAAE,qBAAqB;QAChC,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,KAAK;KAChB,CAAC,CAAC;IAEH,MAAM,QAAQ,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IACnD,MAAM,QAAQ,CAAC,aAAa,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Where this package's stubs live.
3
+ *
4
+ * Its own module, as upstream keeps it: a stub root is a path a package
5
+ * publishes, and a caller importing it should not have to import the
6
+ * configure hook to get it.
7
+ *
8
+ * `import.meta.dirname` rather than a URL — upstream reads it straight off
9
+ * `import.meta`, and deriving it from `import.meta.url` breaks wherever that
10
+ * is not a `file://` URL, which is what a test runner serving modules over
11
+ * HTTP hands you.
12
+ */
13
+ export declare const stubsRoot: string;
14
+ //# sourceMappingURL=stubs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../src/stubs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,eAAO,MAAM,SAAS,QAA2C,CAAC"}
package/dist/stubs.js ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Where this package's stubs live.
3
+ *
4
+ * Its own module, as upstream keeps it: a stub root is a path a package
5
+ * publishes, and a caller importing it should not have to import the
6
+ * configure hook to get it.
7
+ *
8
+ * `import.meta.dirname` rather than a URL — upstream reads it straight off
9
+ * `import.meta`, and deriving it from `import.meta.url` breaks wherever that
10
+ * is not a `file://` URL, which is what a test runner serving modules over
11
+ * HTTP hands you.
12
+ */
13
+ import { join } from "node:path";
14
+ export const stubsRoot = join(import.meta.dirname, "..", "stubs");
15
+ //# sourceMappingURL=stubs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stubs.js","sourceRoot":"","sources":["../src/stubs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC"}
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c9up/rover",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "Mail transport for Ream — SMTP, log, and pluggable transports",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -63,8 +63,9 @@
63
63
  "import": "./dist/webhooks/resend.js"
64
64
  }
65
65
  },
66
+ "//engines": "Node 24, not 22, because AsyncLocalStorage sits on the request hot path — the container resolves through it, HttpContext is it, and the emitter reads it on every event. Node 24 backs it with AsyncContextFrame by default, and measured on that exact pattern (one context per request, six async boundaries, several reads) it costs 0.61 us per request instead of 1.55 us: 2.5x, on every request, for free. Before 24 the same mechanism existed only behind an experimental flag, and a framework cannot base its performance on a flag the application has to remember to pass. This is NOT 'track the current LTS' — security fixes still land in 22 until 2027, npm 11 is irrelevant under pnpm, and node:sqlite is not what atlas uses.",
66
67
  "engines": {
67
- "node": ">=22.0.0"
68
+ "node": ">=24.0.0"
68
69
  },
69
70
  "dependencies": {
70
71
  "nodemailer": "^10.0.1"
@@ -73,7 +74,7 @@
73
74
  "@biomejs/biome": "^2.5.12",
74
75
  "@c9up/bay": "^0.2.0",
75
76
  "@c9up/helix": "^0.2.0",
76
- "@c9up/ream": "^0.2.0",
77
+ "@c9up/ream": "^0.2.25",
77
78
  "@types/node": "^22.20.1",
78
79
  "@types/nodemailer": "^8.0.1",
79
80
  "@vitest/coverage-v8": "4.1.11",
@@ -83,7 +84,7 @@
83
84
  },
84
85
  "peerDependencies": {
85
86
  "@c9up/helix": "^0.2.0",
86
- "@c9up/ream": "^0.2.0",
87
+ "@c9up/ream": "^0.2.26",
87
88
  "ical-generator": ">=8"
88
89
  },
89
90
  "peerDependenciesMeta": {
@@ -100,6 +101,7 @@
100
101
  "files": [
101
102
  "src",
102
103
  "dist",
104
+ "stubs",
103
105
  "README.md",
104
106
  "LICENSE",
105
107
  "index.*.node",
package/src/configure.ts CHANGED
@@ -7,6 +7,8 @@
7
7
  * installed AND working.
8
8
  */
9
9
 
10
+ import { stubsRoot } from "./stubs.js";
11
+
10
12
  interface Codemods {
11
13
  addProvider(importPath: string): Promise<void>;
12
14
  addEnvVars(vars: Record<string, string>): Promise<void>;
@@ -15,6 +17,12 @@ interface Codemods {
15
17
  content: string,
16
18
  options?: { force?: boolean },
17
19
  ): Promise<void>;
20
+ makeUsingStub(
21
+ stubsRoot: string,
22
+ stubPath: string,
23
+ state?: Record<string, string | number | boolean>,
24
+ options?: { force?: boolean },
25
+ ): Promise<{ path: string; contents: string }>;
18
26
  }
19
27
 
20
28
  export async function configure(codemods: Codemods): Promise<void> {
@@ -29,25 +37,5 @@ export async function configure(codemods: Codemods): Promise<void> {
29
37
  });
30
38
 
31
39
  await codemods.addProvider("@c9up/rover/provider");
32
- await codemods.writeFile(
33
- "config/mail.ts",
34
- `import { defineConfig, transports } from '@c9up/rover'
35
- import env from '#start/env'
36
-
37
- export default defineConfig({
38
- // Has to name one of the mailers below, or the application refuses to boot.
39
- default: env.get('MAIL_MAILER', 'log'),
40
- from: env.get('MAIL_FROM', 'noreply@example.com'),
41
-
42
- mailers: {
43
- // Writes to the logger instead of sending. The development mailer.
44
- log: transports.log(),
45
-
46
- smtp: transports.smtp({
47
- host: env.get('SMTP_HOST', ''),
48
- port: Number(env.get('SMTP_PORT', '587')),
49
- }),
50
- },
51
- })`,
52
- );
40
+ await codemods.makeUsingStub(stubsRoot, "config/mail.stub");
53
41
  }
package/src/stubs.ts ADDED
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Where this package's stubs live.
3
+ *
4
+ * Its own module, as upstream keeps it: a stub root is a path a package
5
+ * publishes, and a caller importing it should not have to import the
6
+ * configure hook to get it.
7
+ *
8
+ * `import.meta.dirname` rather than a URL — upstream reads it straight off
9
+ * `import.meta`, and deriving it from `import.meta.url` breaks wherever that
10
+ * is not a `file://` URL, which is what a test runner serving modules over
11
+ * HTTP hands you.
12
+ */
13
+
14
+ import { join } from "node:path";
15
+
16
+ export const stubsRoot = join(import.meta.dirname, "..", "stubs");
@@ -0,0 +1,21 @@
1
+ ---
2
+ to: config/mail.ts
3
+ ---
4
+ import { defineConfig, transports } from '@c9up/rover'
5
+ import env from '#start/env'
6
+
7
+ export default defineConfig({
8
+ // Has to name one of the mailers below, or the application refuses to boot.
9
+ default: env.get('MAIL_MAILER', 'log'),
10
+ from: env.get('MAIL_FROM', 'noreply@example.com'),
11
+
12
+ mailers: {
13
+ // Writes to the logger instead of sending. The development mailer.
14
+ log: transports.log(),
15
+
16
+ smtp: transports.smtp({
17
+ host: env.get('SMTP_HOST', ''),
18
+ port: Number(env.get('SMTP_PORT', '587')),
19
+ }),
20
+ },
21
+ })