@cedarjs/cli 3.1.1 → 3.1.2-next.126
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/commands/build/buildHandler.js +23 -5
- package/dist/commands/build/buildPackagesTask.js +2 -2
- package/dist/commands/build.js +1 -1
- package/dist/commands/check.js +1 -2
- package/dist/commands/consoleHandler.js +1 -1
- package/dist/commands/deploy/baremetal/baremetalHandler.js +1 -2
- package/dist/commands/deploy/helpers/deployHandler.js +1 -1
- package/dist/commands/deploy/serverlessHandler.js +1 -2
- package/dist/commands/destroy/page/pageHandler.js +1 -2
- package/dist/commands/destroy/scaffold/scaffoldHandler.js +1 -2
- package/dist/commands/destroy/sdl/sdlHandler.js +1 -2
- package/dist/commands/dev/devHandler.js +12 -4
- package/dist/commands/dev/packageWatchCommands.js +1 -1
- package/dist/commands/dev.js +1 -1
- package/dist/commands/execHandler.js +10 -7
- package/dist/commands/{setup → experimental}/live-queries/liveQueries.js +5 -4
- package/dist/commands/{setup → experimental}/live-queries/liveQueriesHandler.js +80 -27
- package/dist/commands/{setup → experimental}/live-queries/templates/liveQueriesListener.ts.template +14 -3
- package/dist/commands/experimental/setupInngestHandler.js +1 -1
- package/dist/commands/experimental/setupOpentelemetryHandler.js +1 -2
- package/dist/commands/experimental/setupReactCompilerHandler.js +1 -1
- package/dist/commands/experimental/setupRscHandler.js +1 -2
- package/dist/commands/experimental/setupStreamingSsrHandler.js +1 -2
- package/dist/commands/experimental/templates/streamingSsr/tsconfig.json.template +6 -6
- package/dist/commands/experimental/util.js +24 -23
- package/dist/commands/experimental.js +2 -1
- package/dist/commands/generate/dataMigration/dataMigration.js +1 -2
- package/dist/commands/generate/dbAuth/dbAuthHandler.js +1 -2
- package/dist/commands/generate/directive/directiveHandler.js +3 -4
- package/dist/commands/generate/function/functionHandler.js +1 -2
- package/dist/commands/generate/job/jobHandler.js +1 -2
- package/dist/commands/generate/model/modelHandler.js +1 -2
- package/dist/commands/generate/ogImage/ogImageHandler.js +1 -2
- package/dist/commands/generate/package/packageHandler.js +1 -2
- package/dist/commands/generate/page/pageHandler.js +1 -2
- package/dist/commands/generate/realtime/realtimeHandler.js +1 -1
- package/dist/commands/generate/scaffold/scaffoldHandler.js +1 -2
- package/dist/commands/generate/script/scriptHandler.js +1 -2
- package/dist/commands/generate/script/templates/tsconfig.json.template +2 -2
- package/dist/commands/generate/sdl/sdlHandler.js +1 -2
- package/dist/commands/generate/yargsHandlerHelpers.js +1 -2
- package/dist/commands/generate.js +1 -1
- package/dist/commands/lint.js +12 -5
- package/dist/commands/prerenderHandler.js +6 -4
- package/dist/commands/prismaHandler.js +1 -2
- package/dist/commands/serve.js +1 -2
- package/dist/commands/setup/cache/cacheHandler.js +3 -3
- package/dist/commands/setup/deploy/providers/baremetalHandler.js +1 -2
- package/dist/commands/setup/deploy/providers/flightcontrolHandler.js +1 -2
- package/dist/commands/setup/deploy/providers/netlifyHandler.js +1 -2
- package/dist/commands/setup/deploy/providers/renderHandler.js +1 -2
- package/dist/commands/setup/deploy/providers/serverlessHandler.js +1 -2
- package/dist/commands/setup/deploy/providers/vercelHandler.js +1 -2
- package/dist/commands/setup/docker/dockerHandler.js +1 -2
- package/dist/commands/setup/docker/templates/dockerignore +1 -0
- package/dist/commands/setup/generator/generatorHandler.js +1 -1
- package/dist/commands/setup/i18n/i18nHandler.js +3 -2
- package/dist/commands/setup/jobs/jobsHandler.js +3 -3
- package/dist/commands/setup/mailer/mailerHandler.js +1 -2
- package/dist/commands/setup/realtime/realtimeHandler.js +3 -4
- package/dist/commands/setup/server-file/serverFileHandler.js +1 -2
- package/dist/commands/setup/tsconfig/tsconfigHandler.js +3 -2
- package/dist/commands/setup/ui/libraries/chakra-uiHandler.js +1 -2
- package/dist/commands/setup/ui/libraries/mantineHandler.js +1 -2
- package/dist/commands/setup/ui/libraries/tailwindcssHandler.js +1 -2
- package/dist/commands/setup/uploads/uploadsHandler.js +7 -4
- package/dist/commands/setup/vite/viteHandler.js +1 -2
- package/dist/commands/setup.js +1 -2
- package/dist/commands/test/testHandler.js +1 -2
- package/dist/commands/test.js +1 -1
- package/dist/commands/testEsm.js +1 -1
- package/dist/commands/type-checkHandler.js +1 -1
- package/dist/commands/upgrade/upgrade.js +1 -1
- package/dist/commands/upgrade/upgradeHandler.js +1 -2
- package/dist/index.js +5 -2
- package/dist/lib/exec.js +8 -4
- package/dist/lib/index.js +1 -1
- package/dist/lib/merge/index.js +2 -0
- package/dist/lib/test.js +4 -4
- package/dist/middleware/checkNodeVersion.js +1 -1
- package/package.json +16 -16
- package/dist/lib/colors.js +0 -18
- /package/dist/commands/{setup → experimental}/live-queries/templates/migration.sql.template +0 -0
|
@@ -4,39 +4,40 @@ import ansis from "ansis";
|
|
|
4
4
|
import { terminalLink } from "termi-link";
|
|
5
5
|
import { getPaths } from "../../lib/index.js";
|
|
6
6
|
import { isTypeScriptProject, serverFileExists } from "../../lib/project.js";
|
|
7
|
-
|
|
7
|
+
function link(topicId, isTerminal = false) {
|
|
8
8
|
const communityLink = `https://community.redwoodjs.com/t/${topicId}`;
|
|
9
9
|
if (isTerminal) {
|
|
10
10
|
return terminalLink(communityLink, communityLink);
|
|
11
11
|
} else {
|
|
12
12
|
return communityLink;
|
|
13
13
|
}
|
|
14
|
-
}
|
|
15
|
-
|
|
14
|
+
}
|
|
15
|
+
function getEpilogue(command, description, topicId, isTerminal = false) {
|
|
16
|
+
let epilogue = `This is an experimental feature to: ${description}.
|
|
17
|
+
|
|
18
|
+
If you need help with ${command}, please join our Discord community.
|
|
19
|
+
-> ${terminalLink("", "https://cedarjs.com/discord")}`;
|
|
20
|
+
if (topicId) {
|
|
21
|
+
epilogue += `
|
|
16
22
|
|
|
17
|
-
|
|
18
|
-
-> ${link(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
You might also be able to find some information at:
|
|
24
|
+
-> ${link(topicId, isTerminal)}`;
|
|
25
|
+
}
|
|
26
|
+
return epilogue;
|
|
27
|
+
}
|
|
28
|
+
function printTaskEpilogue(command, description, topicId) {
|
|
29
|
+
const orangeLine = ansis.hex("#ff845e")("-".repeat(64));
|
|
23
30
|
console.log(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
------------------------------------------------------------------`
|
|
30
|
-
)}`
|
|
31
|
+
[
|
|
32
|
+
orangeLine,
|
|
33
|
+
`\u{1F9EA} ${ansis.green("Experimental Feature")} \u{1F9EA}`,
|
|
34
|
+
orangeLine
|
|
35
|
+
].join("\n")
|
|
31
36
|
);
|
|
32
37
|
console.log(getEpilogue(command, description, topicId, false));
|
|
33
|
-
console.log(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
)}
|
|
37
|
-
`
|
|
38
|
-
);
|
|
39
|
-
};
|
|
38
|
+
console.log(`${orangeLine}
|
|
39
|
+
`);
|
|
40
|
+
}
|
|
40
41
|
const isServerFileSetup = () => {
|
|
41
42
|
if (!serverFileExists()) {
|
|
42
43
|
throw new Error(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { terminalLink } from "termi-link";
|
|
2
2
|
import { detectCedarVersion } from "../middleware/detectProjectCedarVersion.js";
|
|
3
|
+
import * as experimentalLiveQueries from "./experimental/live-queries/liveQueries.js";
|
|
3
4
|
import * as experimentalInngest from "./experimental/setupInngest.js";
|
|
4
5
|
import * as experimentalOpenTelemetry from "./experimental/setupOpentelemetry.js";
|
|
5
6
|
import * as experimentalReactCompiler from "./experimental/setupReactCompiler.js";
|
|
@@ -8,7 +9,7 @@ import * as experimentalStreamingSsr from "./experimental/setupStreamingSsr.js";
|
|
|
8
9
|
const command = "experimental <command>";
|
|
9
10
|
const aliases = ["exp"];
|
|
10
11
|
const description = "Run or setup experimental features";
|
|
11
|
-
const builder = (yargs) => yargs.command(experimentalInngest).command(experimentalOpenTelemetry).command(experimentalReactCompiler).command(experimentalRsc).command(experimentalStreamingSsr).demandCommand().middleware(detectCedarVersion).epilogue(
|
|
12
|
+
const builder = (yargs) => yargs.command(experimentalInngest).command(experimentalLiveQueries).command(experimentalOpenTelemetry).command(experimentalReactCompiler).command(experimentalRsc).command(experimentalStreamingSsr).demandCommand().middleware(detectCedarVersion).epilogue(
|
|
12
13
|
`Also see the ${terminalLink(
|
|
13
14
|
"CedarJS CLI Reference",
|
|
14
15
|
"https://cedarjs.com/docs/cli-commands#experimental"
|
|
@@ -2,9 +2,8 @@ import path from "node:path";
|
|
|
2
2
|
import { paramCase } from "change-case";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import { terminalLink } from "termi-link";
|
|
5
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
6
6
|
import { getDataMigrationsPath } from "@cedarjs/project-config";
|
|
7
|
-
import c from "../../../lib/colors.js";
|
|
8
7
|
import {
|
|
9
8
|
generateTemplate,
|
|
10
9
|
getPaths,
|
|
@@ -5,8 +5,7 @@ import { camelCase } from "camel-case";
|
|
|
5
5
|
import execa from "execa";
|
|
6
6
|
import { Listr } from "listr2";
|
|
7
7
|
import { titleCase } from "title-case";
|
|
8
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
9
|
-
import c from "../../../lib/colors.js";
|
|
8
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
10
9
|
import {
|
|
11
10
|
addRoutesToRouterTask,
|
|
12
11
|
addScaffoldImport,
|
|
@@ -2,9 +2,8 @@ import camelcase from "camelcase";
|
|
|
2
2
|
import execa from "execa";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import prompts from "prompts";
|
|
5
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
6
6
|
import { getConfig } from "@cedarjs/project-config";
|
|
7
|
-
import c from "../../../lib/colors.js";
|
|
8
7
|
import { writeFilesTask, transformTSToJS } from "../../../lib/index.js";
|
|
9
8
|
import {
|
|
10
9
|
prepareForRollback,
|
|
@@ -110,9 +109,9 @@ const handler = async (args) => {
|
|
|
110
109
|
title: "Generating TypeScript definitions and GraphQL schemas ...",
|
|
111
110
|
task: () => {
|
|
112
111
|
addFunctionToRollback(async () => {
|
|
113
|
-
await execa("yarn", ["
|
|
112
|
+
await execa("yarn", ["cedar-gen"], { stdio: "pipe" });
|
|
114
113
|
}, true);
|
|
115
|
-
return execa("yarn", ["
|
|
114
|
+
return execa("yarn", ["cedar-gen"], { stdio: "inherit" });
|
|
116
115
|
}
|
|
117
116
|
},
|
|
118
117
|
{
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Listr } from "listr2";
|
|
2
2
|
import { terminalLink } from "termi-link";
|
|
3
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
3
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
4
4
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
5
|
-
import c from "../../../lib/colors.js";
|
|
6
5
|
import { transformTSToJS, writeFilesTask } from "../../../lib/index.js";
|
|
7
6
|
import { prepareForRollback } from "../../../lib/rollback.js";
|
|
8
7
|
import { validateName } from "../helpers.js";
|
|
@@ -3,9 +3,8 @@ import { pathToFileURL } from "node:url";
|
|
|
3
3
|
import * as changeCase from "change-case";
|
|
4
4
|
import execa from "execa";
|
|
5
5
|
import { Listr } from "listr2";
|
|
6
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
6
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
7
7
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
8
|
-
import c from "../../../lib/colors.js";
|
|
9
8
|
import {
|
|
10
9
|
getPaths,
|
|
11
10
|
transformTSToJS,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import { Listr } from "listr2";
|
|
3
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
4
|
-
import c from "../../../lib/colors.js";
|
|
3
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
5
4
|
import {
|
|
6
5
|
getPaths,
|
|
7
6
|
writeFilesTask,
|
|
@@ -2,10 +2,9 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fg from "fast-glob";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
6
6
|
import { ensurePosixPath } from "@cedarjs/project-config";
|
|
7
7
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
8
|
-
import c from "../../../lib/colors.js";
|
|
9
8
|
import {
|
|
10
9
|
generateTemplate,
|
|
11
10
|
getPaths,
|
|
@@ -7,11 +7,10 @@ import { modify, applyEdits } from "jsonc-parser";
|
|
|
7
7
|
import { Listr } from "listr2";
|
|
8
8
|
import { terminalLink } from "termi-link";
|
|
9
9
|
import ts from "typescript";
|
|
10
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
10
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
11
11
|
import { workspacePackageSpecifier } from "@cedarjs/cli-helpers/packageManager";
|
|
12
12
|
import { getConfig } from "@cedarjs/project-config";
|
|
13
13
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
14
|
-
import c from "../../../lib/colors.js";
|
|
15
14
|
import { getPaths, writeFilesTask } from "../../../lib/index.js";
|
|
16
15
|
import { prepareForRollback } from "../../../lib/rollback.js";
|
|
17
16
|
import { files } from "./filesTask.js";
|
|
@@ -2,11 +2,10 @@ import { execSync } from "child_process";
|
|
|
2
2
|
import camelcase from "camelcase";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import pascalcase from "pascalcase";
|
|
5
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
6
6
|
import { generate as generateTypes } from "@cedarjs/internal/dist/generate/generate";
|
|
7
7
|
import { getConfig } from "@cedarjs/project-config";
|
|
8
8
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
9
|
-
import c from "../../../lib/colors.js";
|
|
10
9
|
import {
|
|
11
10
|
addRoutesToRouterTask,
|
|
12
11
|
transformTSToJS,
|
|
@@ -4,10 +4,10 @@ import { Listr } from "listr2";
|
|
|
4
4
|
import pascalcase from "pascalcase";
|
|
5
5
|
import pluralize from "pluralize";
|
|
6
6
|
import prompts from "prompts";
|
|
7
|
+
import { colors as c } from "@cedarjs/cli-helpers";
|
|
7
8
|
import { generate as generateTypes } from "@cedarjs/internal/dist/generate/generate";
|
|
8
9
|
import { projectIsEsm } from "@cedarjs/project-config";
|
|
9
10
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
10
|
-
import c from "../../../lib/colors.js";
|
|
11
11
|
import {
|
|
12
12
|
generateTemplate,
|
|
13
13
|
getPaths,
|
|
@@ -6,11 +6,10 @@ import execa from "execa";
|
|
|
6
6
|
import humanize from "humanize-string";
|
|
7
7
|
import { Listr } from "listr2";
|
|
8
8
|
import pascalcase from "pascalcase";
|
|
9
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
9
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
10
10
|
import { generate as generateTypes } from "@cedarjs/internal/dist/generate/generate";
|
|
11
11
|
import { getConfig } from "@cedarjs/project-config";
|
|
12
12
|
import { pluralize, singularize } from "@cedarjs/utils/cedarPluralize";
|
|
13
|
-
import c from "../../../lib/colors.js";
|
|
14
13
|
import {
|
|
15
14
|
generateTemplate,
|
|
16
15
|
readFile,
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
4
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
5
5
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
6
|
-
import c from "../../../lib/colors.js";
|
|
7
6
|
import {
|
|
8
7
|
getPaths,
|
|
9
8
|
writeFilesTask,
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
],
|
|
20
20
|
"$web/src/*": [
|
|
21
21
|
"../web/src/*",
|
|
22
|
-
"../.
|
|
22
|
+
"../.cedar/types/mirror/web/src/*"
|
|
23
23
|
],
|
|
24
24
|
"web/src/*": [
|
|
25
25
|
"../web/src/*",
|
|
26
|
-
"../.
|
|
26
|
+
"../.cedar/types/mirror/web/src/*"
|
|
27
27
|
],
|
|
28
28
|
"types/*": ["../types/*", "../web/types/*", "../api/types/*"],
|
|
29
29
|
},
|
|
@@ -2,12 +2,11 @@ import ansis from "ansis";
|
|
|
2
2
|
import boxen from "boxen";
|
|
3
3
|
import camelcase from "camelcase";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
6
6
|
import { generate as generateTypes } from "@cedarjs/internal/dist/generate/generate";
|
|
7
7
|
import { getConfig } from "@cedarjs/project-config";
|
|
8
8
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
9
9
|
import { pluralize } from "@cedarjs/utils/cedarPluralize";
|
|
10
|
-
import c from "../../../lib/colors.js";
|
|
11
10
|
import { transformTSToJS, writeFilesTask } from "../../../lib/index.js";
|
|
12
11
|
import {
|
|
13
12
|
prepareForRollback,
|
|
@@ -3,10 +3,9 @@ import path from "node:path";
|
|
|
3
3
|
import { camelCase } from "change-case";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
5
|
import pascalcase from "pascalcase";
|
|
6
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
6
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
7
7
|
import { ensurePosixPath, getConfig } from "@cedarjs/project-config";
|
|
8
8
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
9
|
-
import c from "../../lib/colors.js";
|
|
10
9
|
import { generateTemplate, getPaths, writeFilesTask } from "../../lib/index.js";
|
|
11
10
|
import { prepareForRollback } from "../../lib/rollback.js";
|
|
12
11
|
import {
|
|
@@ -32,7 +32,7 @@ const getExitCode = (error) => {
|
|
|
32
32
|
const builder = (yargs) => yargs.command("types", "Generate supplementary code", {}, () => {
|
|
33
33
|
recordTelemetryAttributes({ command: "generate types" });
|
|
34
34
|
try {
|
|
35
|
-
execa.sync("yarn", ["
|
|
35
|
+
execa.sync("yarn", ["cedar-gen"], { stdio: "inherit" });
|
|
36
36
|
} catch (error) {
|
|
37
37
|
process.exitCode = getExitCode(error) ?? 1;
|
|
38
38
|
}
|
package/dist/commands/lint.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import execa from "execa";
|
|
4
3
|
import { terminalLink } from "termi-link";
|
|
5
4
|
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
|
+
import { runBin } from "@cedarjs/cli-helpers/packageManager/exec";
|
|
6
6
|
import { getPaths, getConfig } from "@cedarjs/project-config";
|
|
7
7
|
function detectLegacyEslintConfig() {
|
|
8
8
|
const projectRoot = getPaths().base;
|
|
@@ -93,9 +93,14 @@ const handler = async ({
|
|
|
93
93
|
}
|
|
94
94
|
try {
|
|
95
95
|
const sbPath = getPaths().web.storybook;
|
|
96
|
-
const
|
|
96
|
+
const eslintArgs = [
|
|
97
|
+
fix && "--fix",
|
|
98
|
+
"--format",
|
|
99
|
+
format,
|
|
100
|
+
...paths
|
|
101
|
+
];
|
|
97
102
|
if (paths.length === 0) {
|
|
98
|
-
|
|
103
|
+
eslintArgs.push(
|
|
99
104
|
fs.existsSync(getPaths().web.src) && "web/src",
|
|
100
105
|
fs.existsSync(getPaths().web.config) && "web/config",
|
|
101
106
|
fs.existsSync(sbPath) && "web/.storybook",
|
|
@@ -103,8 +108,10 @@ const handler = async ({
|
|
|
103
108
|
fs.existsSync(getPaths().api.src) && "api/src"
|
|
104
109
|
);
|
|
105
110
|
}
|
|
106
|
-
const
|
|
107
|
-
|
|
111
|
+
const filteredEslintArgs = eslintArgs.filter(
|
|
112
|
+
(arg) => Boolean(arg)
|
|
113
|
+
);
|
|
114
|
+
const result = await runBin("eslint", filteredEslintArgs, {
|
|
108
115
|
cwd: getPaths().base,
|
|
109
116
|
stdio: "inherit"
|
|
110
117
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
4
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
5
|
+
import { formatCedarCommand } from "@cedarjs/cli-helpers/packageManager/display";
|
|
5
6
|
import { getConfig, getPaths, projectIsEsm } from "@cedarjs/project-config";
|
|
6
7
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
7
|
-
import c from "../lib/colors.js";
|
|
8
8
|
import { runScriptFunction } from "../lib/exec.js";
|
|
9
9
|
import { configureBabel } from "../lib/execBabel.js";
|
|
10
10
|
class PathParamError extends Error {
|
|
@@ -108,7 +108,7 @@ const getTasks = async (dryrun, routerPathFilter = null) => {
|
|
|
108
108
|
const indexHtmlPath = path.join(getPaths().web.dist, "index.html");
|
|
109
109
|
if (!fs.existsSync(indexHtmlPath)) {
|
|
110
110
|
console.error(
|
|
111
|
-
|
|
111
|
+
`You must run \`${formatCedarCommand(["build", "web"])}\` before trying to prerender.`
|
|
112
112
|
);
|
|
113
113
|
process.exit(1);
|
|
114
114
|
}
|
|
@@ -236,7 +236,9 @@ const prerenderRoute = async (prerenderer, queryCache, routeToPrerender, dryrun,
|
|
|
236
236
|
} catch (error) {
|
|
237
237
|
console.log();
|
|
238
238
|
console.log(
|
|
239
|
-
c.warning(
|
|
239
|
+
c.warning(
|
|
240
|
+
"You can use `" + formatCedarCommand(["prerender", "--dry-run"]) + "` to debug"
|
|
241
|
+
)
|
|
240
242
|
);
|
|
241
243
|
console.log();
|
|
242
244
|
const sep = c.info("-".repeat(10));
|
|
@@ -2,9 +2,8 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import boxen from "boxen";
|
|
4
4
|
import execa from "execa";
|
|
5
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
6
6
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
7
|
-
import c from "../lib/colors.js";
|
|
8
7
|
import { getPaths } from "../lib/index.js";
|
|
9
8
|
const getErrorMessage = (error) => {
|
|
10
9
|
return error instanceof Error ? error.message : String(error);
|
package/dist/commands/serve.js
CHANGED
|
@@ -3,10 +3,9 @@ import path from "path";
|
|
|
3
3
|
import { terminalLink } from "termi-link";
|
|
4
4
|
import * as apiServerCLIConfig from "@cedarjs/api-server/apiCliConfig";
|
|
5
5
|
import * as bothServerCLIConfig from "@cedarjs/api-server/bothCliConfig";
|
|
6
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
6
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
7
7
|
import { projectIsEsm } from "@cedarjs/project-config";
|
|
8
8
|
import * as webServerCLIConfig from "@cedarjs/web-server";
|
|
9
|
-
import c from "../lib/colors.js";
|
|
10
9
|
import { getPaths, getConfig } from "../lib/index.js";
|
|
11
10
|
import { serverFileExists } from "../lib/project.js";
|
|
12
11
|
import { webSsrServerHandler } from "./serveWebHandler.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
|
-
import {
|
|
4
|
+
import { terminalLink } from "termi-link";
|
|
5
|
+
import { addEnvVarTask, colors as c } from "@cedarjs/cli-helpers";
|
|
5
6
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
6
|
-
import c from "../../../lib/colors.js";
|
|
7
7
|
import { addPackagesTask, getPaths, writeFile } from "../../../lib/index.js";
|
|
8
8
|
import { isTypeScriptProject } from "../../../lib/project.js";
|
|
9
9
|
const CLIENT_PACKAGE_MAP = {
|
|
@@ -51,7 +51,7 @@ const handler = async ({ client, force }) => {
|
|
|
51
51
|
task.title = `One more thing...
|
|
52
52
|
|
|
53
53
|
${c.tip("Check out the Service Cache docs for config and usage:")}
|
|
54
|
-
${
|
|
54
|
+
${terminalLink("", "https://cedarjs.com/docs/services#caching")}
|
|
55
55
|
`;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import { Listr } from "listr2";
|
|
3
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
3
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
4
4
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
5
|
-
import c from "../../../../lib/colors.js";
|
|
6
5
|
import {
|
|
7
6
|
addPackagesTask,
|
|
8
7
|
getPaths,
|
|
@@ -3,10 +3,9 @@ import { EOL } from "os";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
import prismaInternals from "@prisma/internals";
|
|
5
5
|
import { Listr } from "listr2";
|
|
6
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
6
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
7
7
|
import { getPaths, getPrismaSchemas } from "@cedarjs/project-config";
|
|
8
8
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
9
|
-
import c from "../../../../lib/colors.js";
|
|
10
9
|
import { writeFilesTask, printSetupNotes } from "../../../../lib/index.js";
|
|
11
10
|
import { updateApiURLTask } from "../helpers/index.js";
|
|
12
11
|
import {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import { Listr } from "listr2";
|
|
3
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
3
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
4
4
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
5
|
-
import c from "../../../../lib/colors.js";
|
|
6
5
|
import { getPaths, printSetupNotes } from "../../../../lib/index.js";
|
|
7
6
|
import { addFilesTask, updateApiURLTask } from "../helpers/index.js";
|
|
8
7
|
import { NETLIFY_TOML } from "../templates/netlify.js";
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import prismaInternals from "@prisma/internals";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
4
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
5
5
|
import { getPaths, getPrismaSchemas } from "@cedarjs/project-config";
|
|
6
6
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
7
|
-
import c from "../../../../lib/colors.js";
|
|
8
7
|
import { writeFilesTask, printSetupNotes } from "../../../../lib/index.js";
|
|
9
8
|
import { addFilesTask, updateApiURLTask } from "../helpers/index.js";
|
|
10
9
|
import {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
4
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
5
5
|
import { getSchemaPath, getConfigPath } from "@cedarjs/project-config";
|
|
6
6
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
7
|
-
import c from "../../../../lib/colors.js";
|
|
8
7
|
import {
|
|
9
8
|
addPackagesTask,
|
|
10
9
|
getPaths,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import path from "path";
|
|
2
2
|
import { Listr } from "listr2";
|
|
3
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
3
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
4
4
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
5
|
-
import c from "../../../../lib/colors.js";
|
|
6
5
|
import { getPaths, printSetupNotes, writeFile } from "../../../../lib/index.js";
|
|
7
6
|
import { updateApiURLTask } from "../helpers/index.js";
|
|
8
7
|
async function handler(options) {
|
|
@@ -3,10 +3,9 @@ import { createRequire } from "node:module";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import execa from "execa";
|
|
5
5
|
import { Listr } from "listr2";
|
|
6
|
-
import { writeFile } from "@cedarjs/cli-helpers";
|
|
6
|
+
import { writeFile, colors as c } from "@cedarjs/cli-helpers";
|
|
7
7
|
import { getConfig, getConfigPath, getPaths } from "@cedarjs/project-config";
|
|
8
8
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
9
|
-
import c from "../../../lib/colors.js";
|
|
10
9
|
async function handler({ force }) {
|
|
11
10
|
const TEMPLATE_DIR = path.join(import.meta.dirname, "templates");
|
|
12
11
|
let dockerfileTemplateContent = fs.readFileSync(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
|
-
import c from "
|
|
4
|
+
import { colors as c } from "@cedarjs/cli-helpers";
|
|
5
5
|
import { getPaths } from "../../../lib/index.js";
|
|
6
6
|
const SIDE_MAP = {
|
|
7
7
|
web: ["cell", "component", "layout", "page", "scaffold"],
|
|
@@ -2,8 +2,9 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import execa from "execa";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
|
+
import { terminalLink } from "termi-link";
|
|
6
|
+
import { colors as c } from "@cedarjs/cli-helpers";
|
|
5
7
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
6
|
-
import c from "../../../lib/colors.js";
|
|
7
8
|
import extendStorybookConfiguration from "../../../lib/configureStorybook.js";
|
|
8
9
|
import { fileIncludes } from "../../../lib/extendFile.js";
|
|
9
10
|
import { getPaths, writeFile } from "../../../lib/index.js";
|
|
@@ -149,7 +150,7 @@ const handler = async ({ force }) => {
|
|
|
149
150
|
|
|
150
151
|
${c.tip("Quick link to the docs:")}
|
|
151
152
|
|
|
152
|
-
${
|
|
153
|
+
${terminalLink("react-i18next quick start guide", "https://react.i18next.com/guides/quick-start/")}
|
|
153
154
|
`;
|
|
154
155
|
}
|
|
155
156
|
}
|
|
@@ -2,9 +2,9 @@ import * as fs from "node:fs";
|
|
|
2
2
|
import * as path from "node:path";
|
|
3
3
|
import prismaInternals from "@prisma/internals";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
|
-
import {
|
|
5
|
+
import { terminalLink } from "termi-link";
|
|
6
|
+
import { addApiPackages, colors as c } from "@cedarjs/cli-helpers";
|
|
6
7
|
import { getSchemaPath, getPrismaSchemas } from "@cedarjs/project-config";
|
|
7
|
-
import c from "../../../lib/colors.js";
|
|
8
8
|
import { getPaths, transformTSToJS, writeFile } from "../../../lib/index.js";
|
|
9
9
|
import { isTypeScriptProject } from "../../../lib/project.js";
|
|
10
10
|
const { getDMMF } = prismaInternals;
|
|
@@ -103,7 +103,7 @@ const tasks = async ({ force }) => {
|
|
|
103
103
|
Execute jobs with: ${c.highlight("yarn cedar jobs work\n")}
|
|
104
104
|
|
|
105
105
|
Check out the docs for more info:
|
|
106
|
-
${
|
|
106
|
+
${terminalLink("", "https://cedarjs.com/docs/background-jobs")}
|
|
107
107
|
|
|
108
108
|
`;
|
|
109
109
|
}
|
|
@@ -2,9 +2,8 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { pathToFileURL } from "node:url";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
|
-
import { addApiPackages } from "@cedarjs/cli-helpers";
|
|
5
|
+
import { addApiPackages, colors as c } from "@cedarjs/cli-helpers";
|
|
6
6
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
7
|
-
import c from "../../../lib/colors.js";
|
|
8
7
|
import { getPaths, transformTSToJS, writeFile } from "../../../lib/index.js";
|
|
9
8
|
import { isTypeScriptProject } from "../../../lib/project.js";
|
|
10
9
|
const handler = async ({ force, skipExamples }) => {
|
|
@@ -3,10 +3,10 @@ import path from "path";
|
|
|
3
3
|
import execa from "execa";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
5
|
import prompts from "prompts";
|
|
6
|
-
import { addApiPackages } from "@cedarjs/cli-helpers";
|
|
6
|
+
import { addApiPackages, colors as c } from "@cedarjs/cli-helpers";
|
|
7
|
+
import { generate as generateTypes } from "@cedarjs/internal/dist/generate/generate";
|
|
7
8
|
import { projectIsEsm } from "@cedarjs/project-config";
|
|
8
9
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
9
|
-
import c from "../../../lib/colors.js";
|
|
10
10
|
import { getPaths, transformTSToJS, writeFile } from "../../../lib/index.js";
|
|
11
11
|
import { isTypeScriptProject, serverFileExists } from "../../../lib/project.js";
|
|
12
12
|
import { setupServerFileTasks } from "../server-file/serverFileHandler.js";
|
|
@@ -320,8 +320,7 @@ async function handler(args) {
|
|
|
320
320
|
{
|
|
321
321
|
title: `Generating types...`,
|
|
322
322
|
task: async () => {
|
|
323
|
-
|
|
324
|
-
await generate();
|
|
323
|
+
await generateTypes();
|
|
325
324
|
console.log(
|
|
326
325
|
"Note: You may need to manually restart GraphQL in VSCode to see the new types take effect.\n\n"
|
|
327
326
|
);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
|
-
import { addApiPackages } from "@cedarjs/cli-helpers";
|
|
4
|
+
import { addApiPackages, colors as c } from "@cedarjs/cli-helpers";
|
|
5
5
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
6
|
-
import c from "../../../lib/colors.js";
|
|
7
6
|
import { getPaths, transformTSToJS, writeFile } from "../../../lib/index.js";
|
|
8
7
|
import { isTypeScriptProject } from "../../../lib/project.js";
|
|
9
8
|
const { version } = JSON.parse(
|