@cedarjs/cli 1.0.0-canary.13048 → 1.0.0-canary.13052
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
2
2
|
const command = "mailer";
|
|
3
|
-
const description = "Setup the
|
|
3
|
+
const description = "Setup the Cedar mailer. This will install the required packages and add the required initial configuration to your Cedar app.";
|
|
4
4
|
const builder = (yargs) => {
|
|
5
5
|
yargs.option("force", {
|
|
6
6
|
alias: "f",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
2
3
|
import fs from "fs-extra";
|
|
3
4
|
import { Listr } from "listr2";
|
|
4
5
|
import { addApiPackages } from "@cedarjs/cli-helpers";
|
|
@@ -9,14 +10,15 @@ import { isTypeScriptProject } from "../../../lib/project.js";
|
|
|
9
10
|
const handler = async ({ force, skipExamples }) => {
|
|
10
11
|
const projectIsTypescript = isTypeScriptProject();
|
|
11
12
|
const pkgJsonPath = path.join(getPaths().base, "package.json");
|
|
12
|
-
const { default: pkgJson } = await import(pkgJsonPath, {
|
|
13
|
+
const { default: pkgJson } = await import(pathToFileURL(pkgJsonPath), {
|
|
13
14
|
with: { type: "json" }
|
|
14
15
|
});
|
|
15
16
|
const cedarVersion = pkgJson.devDependencies["@cedarjs/core"] ?? "latest";
|
|
17
|
+
const extension = projectIsTypescript ? "ts" : "js";
|
|
16
18
|
const tasks = new Listr(
|
|
17
19
|
[
|
|
18
20
|
{
|
|
19
|
-
title: `Adding api/src/lib/mailer.${
|
|
21
|
+
title: `Adding api/src/lib/mailer.${extension}...`,
|
|
20
22
|
task: async () => {
|
|
21
23
|
const templatePath = path.resolve(
|
|
22
24
|
import.meta.dirname,
|
|
@@ -29,7 +31,7 @@ const handler = async ({ force, skipExamples }) => {
|
|
|
29
31
|
});
|
|
30
32
|
const mailerPath = path.join(
|
|
31
33
|
getPaths().api.lib,
|
|
32
|
-
`mailer.${
|
|
34
|
+
`mailer.${extension}`
|
|
33
35
|
);
|
|
34
36
|
const mailerContent = projectIsTypescript ? templateContent : await transformTSToJS(mailerPath, templateContent);
|
|
35
37
|
return writeFile(mailerPath, mailerContent, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli",
|
|
3
|
-
"version": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.13052+3928e8a04",
|
|
4
4
|
"description": "The CedarJS Command Line",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/preset-typescript": "7.28.5",
|
|
33
33
|
"@babel/runtime-corejs3": "7.28.4",
|
|
34
|
-
"@cedarjs/api-server": "1.0.0-canary.
|
|
35
|
-
"@cedarjs/cli-helpers": "1.0.0-canary.
|
|
36
|
-
"@cedarjs/fastify-web": "1.0.0-canary.
|
|
37
|
-
"@cedarjs/internal": "1.0.0-canary.
|
|
38
|
-
"@cedarjs/prerender": "1.0.0-canary.
|
|
39
|
-
"@cedarjs/project-config": "1.0.0-canary.
|
|
40
|
-
"@cedarjs/structure": "1.0.0-canary.
|
|
41
|
-
"@cedarjs/telemetry": "1.0.0-canary.
|
|
42
|
-
"@cedarjs/web-server": "1.0.0-canary.
|
|
34
|
+
"@cedarjs/api-server": "1.0.0-canary.13052",
|
|
35
|
+
"@cedarjs/cli-helpers": "1.0.0-canary.13052",
|
|
36
|
+
"@cedarjs/fastify-web": "1.0.0-canary.13052",
|
|
37
|
+
"@cedarjs/internal": "1.0.0-canary.13052",
|
|
38
|
+
"@cedarjs/prerender": "1.0.0-canary.13052",
|
|
39
|
+
"@cedarjs/project-config": "1.0.0-canary.13052",
|
|
40
|
+
"@cedarjs/structure": "1.0.0-canary.13052",
|
|
41
|
+
"@cedarjs/telemetry": "1.0.0-canary.13052",
|
|
42
|
+
"@cedarjs/web-server": "1.0.0-canary.13052",
|
|
43
43
|
"@listr2/prompt-adapter-enquirer": "2.0.16",
|
|
44
44
|
"@opentelemetry/api": "1.8.0",
|
|
45
45
|
"@opentelemetry/core": "1.22.0",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"publishConfig": {
|
|
103
103
|
"access": "public"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "3928e8a0411cedd6395520af3c2a5e17fbcb9de8"
|
|
106
106
|
}
|