@c9up/rover 0.1.20 → 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.
- package/dist/configure.d.ts +6 -0
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +2 -18
- package/dist/configure.js.map +1 -1
- package/dist/stubs.d.ts +14 -0
- package/dist/stubs.d.ts.map +1 -0
- package/dist/stubs.js +15 -0
- package/dist/stubs.js.map +1 -0
- package/index.win32-x64-msvc.node +0 -0
- package/package.json +4 -3
- package/src/configure.ts +9 -21
- package/src/stubs.ts +16 -0
- package/stubs/config/mail.stub +21 -0
package/dist/configure.d.ts
CHANGED
|
@@ -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 {};
|
package/dist/configure.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../src/configure.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
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.
|
|
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
|
package/dist/configure.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../src/configure.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
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"}
|
package/dist/stubs.d.ts
ADDED
|
@@ -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
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c9up/rover",
|
|
3
|
-
"version": "0.1.
|
|
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",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@biomejs/biome": "^2.5.12",
|
|
75
75
|
"@c9up/bay": "^0.2.0",
|
|
76
76
|
"@c9up/helix": "^0.2.0",
|
|
77
|
-
"@c9up/ream": "^0.2.
|
|
77
|
+
"@c9up/ream": "^0.2.25",
|
|
78
78
|
"@types/node": "^22.20.1",
|
|
79
79
|
"@types/nodemailer": "^8.0.1",
|
|
80
80
|
"@vitest/coverage-v8": "4.1.11",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"@c9up/helix": "^0.2.0",
|
|
87
|
-
"@c9up/ream": "^0.2.
|
|
87
|
+
"@c9up/ream": "^0.2.26",
|
|
88
88
|
"ical-generator": ">=8"
|
|
89
89
|
},
|
|
90
90
|
"peerDependenciesMeta": {
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
"files": [
|
|
102
102
|
"src",
|
|
103
103
|
"dist",
|
|
104
|
+
"stubs",
|
|
104
105
|
"README.md",
|
|
105
106
|
"LICENSE",
|
|
106
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.
|
|
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
|
+
})
|