@cedarjs/cli 7.0.0-canary.3260 → 7.0.0-rc.123
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 +1 -2
- package/dist/commands/build.js +1 -1
- package/dist/commands/check.js +1 -2
- package/dist/commands/deploy/baremetal/baremetalHandler.js +1 -1
- package/dist/commands/deploy/baremetal.js +1 -1
- package/dist/commands/deploy/flightcontrolHandler.js +1 -1
- package/dist/commands/deploy/helpers/deployHandler.js +1 -1
- package/dist/commands/deploy/netlify.js +1 -1
- package/dist/commands/deploy/renderHandler.js +1 -1
- package/dist/commands/deploy/serverlessHandler.js +1 -2
- package/dist/commands/deploy/vercel.js +1 -1
- package/dist/commands/destroy/handlerHelpers.js +1 -1
- 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 +4 -3
- package/dist/commands/dev/packageWatchCommands.js +3 -8
- package/dist/commands/dev.js +1 -1
- package/dist/commands/execHandler.js +1 -2
- package/dist/commands/experimental/live-queries/liveQueries.js +1 -1
- package/dist/commands/experimental/live-queries/liveQueriesHandler.js +3 -3
- package/dist/commands/experimental/setupInngest.js +1 -1
- package/dist/commands/experimental/setupInngestHandler.js +1 -1
- package/dist/commands/experimental/setupOpentelemetry.js +1 -1
- package/dist/commands/experimental/setupOpentelemetryHandler.js +1 -2
- package/dist/commands/experimental/setupReactCompiler.js +1 -1
- package/dist/commands/experimental/setupReactCompilerHandler.js +4 -4
- package/dist/commands/experimental/setupRsc.js +1 -1
- package/dist/commands/experimental/setupRscHandler.js +1 -2
- package/dist/commands/experimental/setupStreamingSsr.js +1 -1
- package/dist/commands/experimental/setupStreamingSsrHandler.js +2 -3
- package/dist/commands/generate/cell/cell.js +0 -20
- package/dist/commands/generate/cell/cellHandler.js +20 -68
- package/dist/commands/generate/cell/templates/cell.tsx.template +2 -21
- package/dist/commands/generate/cell/templates/cellList.tsx.template +2 -21
- package/dist/commands/generate/cell/templates/test.js.template +1 -1
- package/dist/commands/generate/dataMigration/dataMigration.js +1 -2
- package/dist/commands/generate/dbAuth/dbAuthHandler.js +3 -23
- package/dist/commands/generate/directive/directiveHandler.js +1 -2
- 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/filesTask.js +12 -9
- package/dist/commands/generate/package/packageHandler.js +4 -3
- package/dist/commands/generate/page/pageHandler.js +1 -2
- package/dist/commands/generate/realtime/realtime.js +1 -1
- package/dist/commands/generate/realtime/realtimeHandler.js +9 -2
- package/dist/commands/generate/realtime/templates/subscriptions/blank/blank.ts.template +1 -1
- package/dist/commands/generate/scaffold/scaffoldHandler.js +5 -10
- package/dist/commands/generate/scaffold/templates/components/NameForm.tsx.template +3 -3
- package/dist/commands/generate/scaffold/templates/lib/formatters.test.tsx.template +0 -11
- package/dist/commands/generate/scaffold/templates/lib/formatters.tsx.template +1 -13
- package/dist/commands/generate/script/scriptHandler.js +1 -2
- package/dist/commands/generate/sdl/sdlHandler.js +1 -2
- package/dist/commands/generate/secret/secret.js +1 -1
- package/dist/commands/generate/service/serviceHandler.js +38 -47
- package/dist/commands/generate/service/templates/service.ts.template +8 -22
- package/dist/commands/generate/service/templates/test.ts.template +1 -1
- package/dist/commands/generate/yargsCommandHelpers.js +1 -1
- package/dist/commands/generate/yargsHandlerHelpers.js +1 -2
- package/dist/commands/generate.js +1 -1
- package/dist/commands/info.js +1 -1
- package/dist/commands/lint.js +1 -1
- package/dist/commands/prerenderHandler.js +4 -11
- package/dist/commands/prismaHandler.js +2 -7
- package/dist/commands/record/init.js +1 -1
- package/dist/commands/serve.js +1 -2
- package/dist/commands/setup/auth/auth.js +4 -2
- package/dist/commands/setup/cache/cache.js +1 -1
- package/dist/commands/setup/cache/cacheHandler.js +1 -2
- package/dist/commands/setup/database/postgres.js +1 -1
- package/dist/commands/setup/database/postgresHandler.js +1 -3
- package/dist/commands/setup/deploy/providers/baremetalHandler.js +1 -2
- package/dist/commands/setup/deploy/providers/coherence.js +1 -1
- package/dist/commands/setup/deploy/providers/coherenceHandler.js +6 -7
- 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/universalDeployHandler.js +6 -4
- package/dist/commands/setup/deploy/providers/vercelHandler.js +1 -2
- package/dist/commands/setup/docker/docker.js +1 -1
- package/dist/commands/setup/docker/dockerHandler.js +1 -2
- package/dist/commands/setup/generator/generator.js +1 -1
- package/dist/commands/setup/generator/generatorHandler.js +1 -1
- package/dist/commands/setup/graphql/features/fragments/fragments.js +1 -1
- package/dist/commands/setup/graphql/features/fragments/fragmentsHandler.js +5 -3
- package/dist/commands/setup/graphql/features/trustedDocuments/trustedDocuments.js +1 -1
- package/dist/commands/setup/graphql/features/trustedDocuments/trustedDocumentsHandler.js +1 -2
- package/dist/commands/setup/i18n/i18n.js +1 -1
- package/dist/commands/setup/i18n/i18nHandler.js +1 -1
- package/dist/commands/setup/jobs/jobs.js +1 -1
- package/dist/commands/setup/jobs/jobsHandler.js +1 -2
- package/dist/commands/setup/mailer/mailer.js +1 -1
- package/dist/commands/setup/mailer/mailerHandler.js +1 -2
- package/dist/commands/setup/middleware/ogImage/ogImage.js +1 -1
- package/dist/commands/setup/middleware/ogImage/ogImageHandler.js +1 -2
- package/dist/commands/setup/monitoring/sentry/sentry.js +1 -1
- package/dist/commands/setup/monitoring/sentry/sentryHandler.js +7 -8
- package/dist/commands/setup/neon/neon.js +1 -1
- package/dist/commands/setup/neon/neonHandler.js +9 -5
- package/dist/commands/setup/package/package.js +1 -1
- package/dist/commands/setup/package/packageHandler.js +4 -4
- package/dist/commands/setup/realtime/addRealtimeToGraphql.js +1 -1
- package/dist/commands/setup/realtime/realtime.js +1 -1
- package/dist/commands/setup/realtime/realtimeHandler.js +16 -4
- package/dist/commands/setup/realtime/templates/subscriptions/countdown/countdown.ts.template +1 -1
- package/dist/commands/setup/realtime/templates/subscriptions/newMessage/newMessage.ts.template +1 -1
- package/dist/commands/setup/server-file/serverFile.js +1 -1
- package/dist/commands/setup/server-file/serverFileHandler.js +1 -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/dbCodemod.js +28 -0
- package/dist/commands/setup/uploads/templates/signedUrl.ts.template +21 -0
- package/dist/commands/setup/uploads/templates/srcLibUploads.ts.template +24 -23
- package/dist/commands/setup/uploads/uploads.js +7 -49
- package/dist/commands/setup/uploads/uploadsHandler.js +69 -256
- package/dist/commands/setup.js +1 -2
- package/dist/commands/studio.js +1 -1
- package/dist/commands/test/testHandler.js +71 -25
- package/dist/commands/test/testHandlerEsm.js +100 -0
- package/dist/commands/test.js +18 -10
- package/dist/commands/testEsm.js +41 -0
- package/dist/commands/type-checkHandler.js +1 -1
- package/dist/commands/upgrade/preUpgradeScripts.js +3 -3
- package/dist/commands/upgrade/upgrade.js +1 -1
- package/dist/commands/upgrade/upgradeHandler.js +1 -2
- package/dist/index.js +8 -5
- package/dist/lib/exit.js +1 -1
- package/dist/lib/index.js +25 -6
- package/dist/lib/loadEnvFiles.js +1 -1
- package/dist/lib/plugin.js +1 -1
- package/dist/lib/test.js +1 -1
- package/dist/lib/updateCheck.js +4 -4
- package/dist/middleware/checkNodeVersion.js +4 -4
- package/package.json +18 -18
- package/dist/commands/generate/cell/templates/cellFragment.tsx.template +0 -43
- package/dist/commands/generate/cell/templates/storiesFragment.tsx.template +0 -23
- package/dist/commands/generate/cell/templates/testFragment.js.template +0 -30
- package/dist/commands/generate/dbAuth/templates/login.oauth.tsx.template +0 -164
- package/dist/commands/generate/dbAuth/templates/signup.oauth.tsx.template +0 -147
- package/dist/commands/setup/tenancy/authCodemod.js +0 -66
- package/dist/commands/setup/tenancy/dbCodemod.js +0 -64
- package/dist/commands/setup/tenancy/graphqlCodemod.js +0 -88
- package/dist/commands/setup/tenancy/preflight.js +0 -49
- package/dist/commands/setup/tenancy/schemaPrisma.js +0 -81
- package/dist/commands/setup/tenancy/signupCodemod.js +0 -153
- package/dist/commands/setup/tenancy/templates/InvitePage.tsx.template +0 -63
- package/dist/commands/setup/tenancy/templates/OrgScope.tsx.template +0 -40
- package/dist/commands/setup/tenancy/templates/ensureDefaultOrganizations.dataMigration.ts.template +0 -39
- package/dist/commands/setup/tenancy/templates/organizations.scenarios.ts.template +0 -59
- package/dist/commands/setup/tenancy/templates/organizations.sdl.ts.template +0 -89
- package/dist/commands/setup/tenancy/templates/organizations.test.ts.template +0 -389
- package/dist/commands/setup/tenancy/templates/organizations.ts.template +0 -394
- package/dist/commands/setup/tenancy/templates/requireMembership.test.ts.template +0 -35
- package/dist/commands/setup/tenancy/templates/requireMembership.ts.template +0 -25
- package/dist/commands/setup/tenancy/tenancy.js +0 -30
- package/dist/commands/setup/tenancy/tenancyHandler.js +0 -425
- package/dist/commands/setup/uploads/schemaPrisma.js +0 -41
- package/dist/commands/setup/uploads/serverFile.js +0 -151
- package/dist/commands/setup/uploads/templates/requireUploadToken.ts.template +0 -15
- package/dist/commands/setup/uploads/templates/uploads.sdl.ts.template +0 -79
- package/dist/commands/setup/uploads/templates/uploads.ts.template +0 -89
- package/dist/commands/setup/uploads/templates/withDataUri.ts.template +0 -14
- package/dist/commands/setup/uploads/templates/withSignedUrl.ts.template +0 -16
- package/dist/commands/test/viteVersionCheck.js +0 -75
|
@@ -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 { colors as c } from "@cedarjs/cli-helpers
|
|
4
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
5
5
|
import { formatCedarCommand } from "@cedarjs/cli-helpers/packageManager/display";
|
|
6
|
-
import {
|
|
7
|
-
import { getConfig, getParsedScalars, getPaths } from "@cedarjs/project-config";
|
|
6
|
+
import { getConfig, getPaths, projectIsEsm } from "@cedarjs/project-config";
|
|
8
7
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
9
8
|
import { runScriptFunction } from "../lib/exec.js";
|
|
10
9
|
import { configureBabel } from "../lib/execBabel.js";
|
|
@@ -94,7 +93,7 @@ async function expandRouteParameters(route) {
|
|
|
94
93
|
return [route];
|
|
95
94
|
}
|
|
96
95
|
const getTasks = async (dryrun, routerPathFilter = null) => {
|
|
97
|
-
const detector = await import("@cedarjs/prerender/detection");
|
|
96
|
+
const detector = projectIsEsm() ? await import("@cedarjs/prerender/detection") : await import("@cedarjs/prerender/cjs/detection");
|
|
98
97
|
const detectedRoutes = detector.detectPrerenderRoutes();
|
|
99
98
|
const prerenderRoutes = detectedRoutes.filter(hasPath).map(normalizeRoute);
|
|
100
99
|
if (prerenderRoutes.length === 0) {
|
|
@@ -106,12 +105,6 @@ const getTasks = async (dryrun, routerPathFilter = null) => {
|
|
|
106
105
|
);
|
|
107
106
|
return [];
|
|
108
107
|
}
|
|
109
|
-
const parsedScalars = Object.keys(getParsedScalars());
|
|
110
|
-
if (parsedScalars.length > 0) {
|
|
111
|
-
throw new Error(
|
|
112
|
-
"Prerendering does not support `graphql.parsedScalars` yet. A prerendered Cell gets the raw GraphQL response, so " + parsedScalars.join(", ") + " would be a string when prerendering and parsed in the browser. Either remove the `prerender` prop from your routes, or remove `graphql.parsedScalars` from cedar.toml."
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
108
|
const indexHtmlPath = path.join(getPaths().web.dist, "index.html");
|
|
116
109
|
if (!fs.existsSync(indexHtmlPath)) {
|
|
117
110
|
console.error(
|
|
@@ -123,7 +116,7 @@ const getTasks = async (dryrun, routerPathFilter = null) => {
|
|
|
123
116
|
const expandedRouteParameters = await Promise.all(
|
|
124
117
|
prerenderRoutes.map((route) => expandRouteParameters(route))
|
|
125
118
|
);
|
|
126
|
-
const prerenderer = await import("@cedarjs/prerender");
|
|
119
|
+
const prerenderer = projectIsEsm() ? await import("@cedarjs/prerender") : await import("@cedarjs/prerender/cjs");
|
|
127
120
|
const listrTasks = expandedRouteParameters.flatMap((routesToPrerender) => {
|
|
128
121
|
const queryCache = {};
|
|
129
122
|
const shouldFold = routesToPrerender.length > 16;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import boxen from "boxen";
|
|
3
|
-
import { colors as c } from "@cedarjs/cli-helpers
|
|
3
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
4
4
|
import {
|
|
5
5
|
formatCedarCommand,
|
|
6
6
|
formatRunBinCommand,
|
|
7
7
|
formatRunTransitiveBinCommand
|
|
8
8
|
} from "@cedarjs/cli-helpers/packageManager/display";
|
|
9
9
|
import { runTransitiveBinSync } from "@cedarjs/cli-helpers/packageManager/exec";
|
|
10
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers/telemetry";
|
|
11
10
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
12
11
|
import { getPaths } from "../lib/index.js";
|
|
13
12
|
const getErrorMessage = (error) => {
|
|
@@ -63,11 +62,7 @@ const handler = async ({
|
|
|
63
62
|
try {
|
|
64
63
|
runTransitiveBinSync("prisma", args, {
|
|
65
64
|
cwd: cedarPaths.base,
|
|
66
|
-
stdio:
|
|
67
|
-
process.stdin.isTTY && !process.env.CI ? "inherit" : "pipe",
|
|
68
|
-
"inherit",
|
|
69
|
-
"inherit"
|
|
70
|
-
]
|
|
65
|
+
stdio: "inherit"
|
|
71
66
|
});
|
|
72
67
|
if (hasHelpOption || args.length === 0) {
|
|
73
68
|
printWrapInfo();
|
package/dist/commands/serve.js
CHANGED
|
@@ -5,8 +5,7 @@ import { serve as serveSrvx } from "srvx";
|
|
|
5
5
|
import { terminalLink } from "termi-link";
|
|
6
6
|
import * as apiServerCLIConfig from "@cedarjs/api-server/apiCliConfig";
|
|
7
7
|
import * as bothServerCLIConfig from "@cedarjs/api-server/bothCliConfig";
|
|
8
|
-
import { colors as c } from "@cedarjs/cli-helpers
|
|
9
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers/telemetry";
|
|
8
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
10
9
|
import * as webServerCLIConfig from "@cedarjs/web-server";
|
|
11
10
|
import { getPaths, getConfig } from "../lib/index.js";
|
|
12
11
|
import { serverFileExists } from "../lib/project.js";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { terminalLink } from "termi-link";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
recordTelemetryAttributes,
|
|
6
|
+
standardAuthBuilder
|
|
7
|
+
} from "@cedarjs/cli-helpers";
|
|
5
8
|
import { addRootPackages } from "@cedarjs/cli-helpers/packageManager/packages";
|
|
6
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers/telemetry";
|
|
7
9
|
import { getPaths } from "../../../lib/index.js";
|
|
8
10
|
const command = "auth <provider>";
|
|
9
11
|
const description = "Set up an auth configuration";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { terminalLink } from "termi-link";
|
|
2
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers
|
|
2
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
3
3
|
const command = "cache <client>";
|
|
4
4
|
const description = "Sets up an init file for service caching";
|
|
5
5
|
const builder = (yargs) => {
|
|
@@ -2,8 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import { terminalLink } from "termi-link";
|
|
5
|
-
import { colors as c } from "@cedarjs/cli-helpers
|
|
6
|
-
import { addEnvVarTask } from "@cedarjs/cli-helpers/project";
|
|
5
|
+
import { addEnvVarTask, colors as c } from "@cedarjs/cli-helpers";
|
|
7
6
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
8
7
|
import { addPackagesTask, getPaths, writeFile } from "../../../lib/index.js";
|
|
9
8
|
import { isTypeScriptProject } from "../../../lib/project.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers
|
|
1
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
2
2
|
const command = "postgres";
|
|
3
3
|
const description = "Switch your project from SQLite to PostgreSQL (schema, dependencies, and database adapter)";
|
|
4
4
|
function builder(yargs) {
|
|
@@ -2,11 +2,9 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import execa from "execa";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
|
-
import { colors } from "@cedarjs/cli-helpers
|
|
6
|
-
import { installPackages } from "@cedarjs/cli-helpers/installHelpers";
|
|
5
|
+
import { colors, getPaths, installPackages } from "@cedarjs/cli-helpers";
|
|
7
6
|
import { prettyPrintCedarCommand } from "@cedarjs/cli-helpers/packageManager";
|
|
8
7
|
import { addWorkspacePackages } from "@cedarjs/cli-helpers/packageManager/packages";
|
|
9
|
-
import { getPaths } from "@cedarjs/cli-helpers/paths";
|
|
10
8
|
import { resolveFile } from "@cedarjs/project-config";
|
|
11
9
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
12
10
|
function checkProjectShape(cedarPaths) {
|
|
@@ -2,8 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import prompts from "prompts";
|
|
5
|
-
import { colors as c } from "@cedarjs/cli-helpers
|
|
6
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers/telemetry";
|
|
5
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
7
6
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
8
7
|
import {
|
|
9
8
|
addPackagesTask,
|
|
@@ -3,17 +3,16 @@ import path from "path";
|
|
|
3
3
|
import prismaInternals from "@prisma/internals";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
5
|
import * as toml from "smol-toml";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
colors as c,
|
|
8
|
+
isTypeScriptProject,
|
|
9
|
+
getConfigPath
|
|
10
|
+
} from "@cedarjs/cli-helpers";
|
|
7
11
|
import {
|
|
8
12
|
formatCedarCommand,
|
|
9
13
|
formatRunBinCommand
|
|
10
14
|
} from "@cedarjs/cli-helpers/packageManager/display";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
getConfigPath,
|
|
14
|
-
getPaths,
|
|
15
|
-
getPrismaSchemas
|
|
16
|
-
} from "@cedarjs/project-config";
|
|
15
|
+
import { getPaths, getPrismaSchemas } from "@cedarjs/project-config";
|
|
17
16
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
18
17
|
import { printSetupNotes } from "../../../../lib/index.js";
|
|
19
18
|
import { serverFileExists } from "../../../../lib/project.js";
|
|
@@ -3,9 +3,8 @@ 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 { colors as c } from "@cedarjs/cli-helpers
|
|
6
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
7
7
|
import { formatCedarCommand } from "@cedarjs/cli-helpers/packageManager/display";
|
|
8
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers/telemetry";
|
|
9
8
|
import { getPaths, getPrismaSchemas } from "@cedarjs/project-config";
|
|
10
9
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
11
10
|
import { writeFilesTask, printSetupNotes } from "../../../../lib/index.js";
|
|
@@ -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 { colors as c } from "@cedarjs/cli-helpers
|
|
4
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
5
5
|
import { formatCedarCommand } from "@cedarjs/cli-helpers/packageManager/display";
|
|
6
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers/telemetry";
|
|
7
6
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
8
7
|
import {
|
|
9
8
|
addPackagesTask,
|
|
@@ -2,8 +2,7 @@ import path from "path";
|
|
|
2
2
|
import prismaInternals from "@prisma/internals";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import prompts from "prompts";
|
|
5
|
-
import { colors as c } from "@cedarjs/cli-helpers
|
|
6
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers/telemetry";
|
|
5
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
7
6
|
import { getPaths, getPrismaSchemas } from "@cedarjs/project-config";
|
|
8
7
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
9
8
|
import { writeFilesTask, printSetupNotes } from "../../../../lib/index.js";
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
|
-
import { colors as c } from "@cedarjs/cli-helpers
|
|
5
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers/telemetry";
|
|
4
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
6
5
|
import { getSchemaPath, getConfigPath } from "@cedarjs/project-config";
|
|
7
6
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
8
7
|
import {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import {
|
|
5
|
+
colors as c,
|
|
6
|
+
getPaths,
|
|
7
|
+
isTypeScriptProject,
|
|
8
|
+
recordTelemetryAttributes
|
|
9
|
+
} from "@cedarjs/cli-helpers";
|
|
8
10
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
9
11
|
import { printSetupNotes } from "../../../../lib/index.js";
|
|
10
12
|
const notes = [
|
|
@@ -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 { colors as c } from "@cedarjs/cli-helpers
|
|
4
|
+
import { recordTelemetryAttributes, colors as c } from "@cedarjs/cli-helpers";
|
|
5
5
|
import { formatCedarCommand } from "@cedarjs/cli-helpers/packageManager/display";
|
|
6
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers/telemetry";
|
|
7
6
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
8
7
|
import {
|
|
9
8
|
addPackagesTask,
|
|
@@ -3,8 +3,7 @@ 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 { colors as c } from "@cedarjs/cli-helpers
|
|
7
|
-
import { writeFile } from "@cedarjs/cli-helpers/fileHelpers";
|
|
6
|
+
import { writeFile, colors as c } from "@cedarjs/cli-helpers";
|
|
8
7
|
import { dedupe } from "@cedarjs/cli-helpers/packageManager";
|
|
9
8
|
import { formatCedarCommand } from "@cedarjs/cli-helpers/packageManager/display";
|
|
10
9
|
import { addWorkspacePackages } from "@cedarjs/cli-helpers/packageManager/packages";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { terminalLink } from "termi-link";
|
|
4
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers
|
|
4
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
5
|
const command = "generator <name>";
|
|
6
6
|
const description = "Copies generator templates locally for customization";
|
|
7
7
|
const EXCLUDE_GENERATORS = ["dataMigration", "dbAuth", "generator", "secret"];
|
|
@@ -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 { colors as c } from "@cedarjs/cli-helpers
|
|
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,10 +2,12 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import { format } from "prettier";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
colors,
|
|
7
|
+
getPrettierOptions,
|
|
8
|
+
setTomlSetting
|
|
9
|
+
} from "@cedarjs/cli-helpers";
|
|
7
10
|
import { runBinSync } from "@cedarjs/cli-helpers/packageManager/exec";
|
|
8
|
-
import { setTomlSetting } from "@cedarjs/cli-helpers/project";
|
|
9
11
|
import { getConfig, getPaths } from "@cedarjs/project-config";
|
|
10
12
|
import { runTransform } from "../../../../../lib/runTransform.js";
|
|
11
13
|
const command = "fragments";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers
|
|
1
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
2
2
|
const command = "trusted-documents";
|
|
3
3
|
const description = "Set up Trusted Documents for GraphQL";
|
|
4
4
|
function builder(yargs) {
|
|
@@ -2,9 +2,8 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import { format } from "prettier";
|
|
5
|
-
import { getPrettierOptions } from "@cedarjs/cli-helpers
|
|
5
|
+
import { getPrettierOptions, setTomlSetting } from "@cedarjs/cli-helpers";
|
|
6
6
|
import { runBinSync } from "@cedarjs/cli-helpers/packageManager/exec";
|
|
7
|
-
import { setTomlSetting } from "@cedarjs/cli-helpers/project";
|
|
8
7
|
import { getConfig, getPaths, resolveFile } from "@cedarjs/project-config";
|
|
9
8
|
import { runTransform } from "../../../../../lib/runTransform.js";
|
|
10
9
|
async function handler({ force }) {
|
|
@@ -2,7 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import { terminalLink } from "termi-link";
|
|
5
|
-
import { colors as c } from "@cedarjs/cli-helpers
|
|
5
|
+
import { colors as c } from "@cedarjs/cli-helpers";
|
|
6
6
|
import { addWorkspacePackages } from "@cedarjs/cli-helpers/packageManager/packages";
|
|
7
7
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
8
8
|
import extendStorybookConfiguration from "../../../lib/configureStorybook.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { terminalLink } from "termi-link";
|
|
2
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers
|
|
2
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
3
3
|
const command = "jobs";
|
|
4
4
|
const description = "Sets up the config file and parent directory for background jobs";
|
|
5
5
|
const builder = (yargs) => {
|
|
@@ -3,8 +3,7 @@ import * as path from "node:path";
|
|
|
3
3
|
import prismaInternals from "@prisma/internals";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
5
|
import { terminalLink } from "termi-link";
|
|
6
|
-
import { colors as c } from "@cedarjs/cli-helpers
|
|
7
|
-
import { addApiPackages } from "@cedarjs/cli-helpers/installHelpers";
|
|
6
|
+
import { addApiPackages, colors as c } from "@cedarjs/cli-helpers";
|
|
8
7
|
import { formatCedarCommand } from "@cedarjs/cli-helpers/packageManager/display";
|
|
9
8
|
import { getSchemaPath, getPrismaSchemas } from "@cedarjs/project-config";
|
|
10
9
|
import { getPaths, transformTSToJS, writeFile } from "../../../lib/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers
|
|
1
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
2
2
|
const command = "mailer";
|
|
3
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) => {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
|
-
import { colors as c } from "@cedarjs/cli-helpers
|
|
5
|
-
import { addApiPackages } from "@cedarjs/cli-helpers/installHelpers";
|
|
4
|
+
import { addApiPackages, colors as c } from "@cedarjs/cli-helpers";
|
|
6
5
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
7
6
|
import { getPaths, transformTSToJS, writeFile } from "../../../lib/index.js";
|
|
8
7
|
import { isTypeScriptProject } from "../../../lib/project.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers
|
|
1
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
2
2
|
const command = "og-image";
|
|
3
3
|
const aliases = ["ogImage", "ogimage"];
|
|
4
4
|
const description = "Set up OG Image generation middleware";
|
|
@@ -2,8 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import { format } from "prettier";
|
|
5
|
-
import { getPrettierOptions } from "@cedarjs/cli-helpers
|
|
6
|
-
import { addWebPackages } from "@cedarjs/cli-helpers/installHelpers";
|
|
5
|
+
import { addWebPackages, getPrettierOptions } from "@cedarjs/cli-helpers";
|
|
7
6
|
import { getConfig, getPaths } from "@cedarjs/project-config";
|
|
8
7
|
import { runTransform } from "../../../../lib/runTransform.js";
|
|
9
8
|
async function handler({ force }) {
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
|
-
import { colors } from "@cedarjs/cli-helpers/colors";
|
|
5
|
-
import { prettify, writeFilesTask } from "@cedarjs/cli-helpers/fileHelpers";
|
|
6
4
|
import {
|
|
7
5
|
addApiPackages,
|
|
8
|
-
addWebPackages
|
|
9
|
-
} from "@cedarjs/cli-helpers/installHelpers";
|
|
10
|
-
import { getPaths } from "@cedarjs/cli-helpers/paths";
|
|
11
|
-
import {
|
|
12
6
|
addEnvVarTask,
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
addWebPackages,
|
|
8
|
+
colors,
|
|
9
|
+
getPaths,
|
|
10
|
+
isTypeScriptProject,
|
|
11
|
+
prettify,
|
|
12
|
+
writeFilesTask
|
|
13
|
+
} from "@cedarjs/cli-helpers";
|
|
15
14
|
import { getConfigPath } from "@cedarjs/project-config";
|
|
16
15
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
17
16
|
const rwPaths = getPaths();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers
|
|
1
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
2
2
|
const command = "neon";
|
|
3
3
|
const description = "Provision a Neon Postgres database and configure your project";
|
|
4
4
|
function builder(yargs) {
|
|
@@ -3,11 +3,8 @@ import path from "node:path";
|
|
|
3
3
|
import execa from "execa";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
5
|
import prompts from "prompts";
|
|
6
|
-
import { colors } from "@cedarjs/cli-helpers
|
|
7
|
-
import { installPackages } from "@cedarjs/cli-helpers/installHelpers";
|
|
6
|
+
import { colors, getPaths, installPackages } from "@cedarjs/cli-helpers";
|
|
8
7
|
import { prettyPrintCedarCommand } from "@cedarjs/cli-helpers/packageManager";
|
|
9
|
-
import { getPaths } from "@cedarjs/cli-helpers/paths";
|
|
10
|
-
import { requireTTYOrExit } from "@cedarjs/cli-helpers/tty";
|
|
11
8
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
12
9
|
import {
|
|
13
10
|
checkProjectShape,
|
|
@@ -57,7 +54,14 @@ async function handler({ force, migrations, verbose }) {
|
|
|
57
54
|
}
|
|
58
55
|
let runMigrations = migrations;
|
|
59
56
|
if (!skipProvisioning && runMigrations === void 0) {
|
|
60
|
-
|
|
57
|
+
if (!process.stdin.isTTY) {
|
|
58
|
+
const error = new Error(
|
|
59
|
+
"Cannot prompt for confirmation in a non-interactive terminal. Please pass --migrations or --no-migrations explicitly."
|
|
60
|
+
);
|
|
61
|
+
errorTelemetry(process.argv, error.message);
|
|
62
|
+
console.error(colors.error(error.message));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
61
65
|
const response = await prompts({
|
|
62
66
|
type: "toggle",
|
|
63
67
|
name: "runMigrations",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { terminalLink } from "termi-link";
|
|
2
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers
|
|
2
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
3
3
|
const command = "package <npm-package>";
|
|
4
4
|
const description = "Run a bin from an NPM package with version compatibility checks";
|
|
5
5
|
const builder = (yargs) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import enq from "enquirer";
|
|
2
|
-
import
|
|
2
|
+
import semver from "semver";
|
|
3
|
+
import { getCompatibilityData } from "@cedarjs/cli-helpers";
|
|
3
4
|
import { dlx } from "@cedarjs/cli-helpers/packageManager/exec";
|
|
4
|
-
import { getCompatibilityData } from "@cedarjs/cli-helpers/version";
|
|
5
5
|
import { getPaths } from "@cedarjs/project-config";
|
|
6
6
|
async function handler({
|
|
7
7
|
npmPackage,
|
|
@@ -16,7 +16,7 @@ async function handler({
|
|
|
16
16
|
console.log(
|
|
17
17
|
"No compatibility check will be performed because you used the --force flag."
|
|
18
18
|
);
|
|
19
|
-
if (
|
|
19
|
+
if (semver.parse(packageVersion) !== null && semver.lt(packageVersion, "1.0.0")) {
|
|
20
20
|
console.log(
|
|
21
21
|
"Be aware that this package is under version 1.0.0 and so should be considered experimental."
|
|
22
22
|
);
|
|
@@ -86,7 +86,7 @@ The latest version compatible with your project is ${latestCompatibleVersionText
|
|
|
86
86
|
await runPackage(packageName, versionToUse, additionalOptionsToForward);
|
|
87
87
|
}
|
|
88
88
|
async function showExperimentalWarning(version) {
|
|
89
|
-
if (version === void 0 ||
|
|
89
|
+
if (version === void 0 || semver.parse(version) === null || semver.gte(version, "1.0.0")) {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
const decision = await promptWithChoices(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
-
import { isTypeScriptProject } from "@cedarjs/cli-helpers
|
|
3
|
+
import { isTypeScriptProject } from "@cedarjs/cli-helpers";
|
|
4
4
|
import { getPaths } from "@cedarjs/project-config";
|
|
5
5
|
function addRealtimeToGraphqlHandler(ctx, task, force) {
|
|
6
6
|
const graphqlHandlerPath = path.join(
|
|
@@ -2,10 +2,10 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
4
|
import prompts from "prompts";
|
|
5
|
-
import { colors as c } from "@cedarjs/cli-helpers
|
|
6
|
-
import { addApiPackages } from "@cedarjs/cli-helpers/installHelpers";
|
|
5
|
+
import { addApiPackages, colors as c } from "@cedarjs/cli-helpers";
|
|
7
6
|
import { runBinSync } from "@cedarjs/cli-helpers/packageManager/exec";
|
|
8
7
|
import { generate as generateTypes } from "@cedarjs/internal/dist/generate/generate";
|
|
8
|
+
import { projectIsEsm } from "@cedarjs/project-config";
|
|
9
9
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
10
10
|
import { getPaths, transformTSToJS, writeFile } from "../../../lib/index.js";
|
|
11
11
|
import { isTypeScriptProject, serverFileExists } from "../../../lib/project.js";
|
|
@@ -77,7 +77,7 @@ async function handler(args) {
|
|
|
77
77
|
title: "Adding Countdown example subscription...",
|
|
78
78
|
enabled: () => includeExamples,
|
|
79
79
|
task: async () => {
|
|
80
|
-
|
|
80
|
+
let exampleSubscriptionTemplateContent = fs.readFileSync(
|
|
81
81
|
path.resolve(
|
|
82
82
|
import.meta.dirname,
|
|
83
83
|
"templates",
|
|
@@ -87,6 +87,12 @@ async function handler(args) {
|
|
|
87
87
|
),
|
|
88
88
|
"utf-8"
|
|
89
89
|
);
|
|
90
|
+
if (projectIsEsm()) {
|
|
91
|
+
exampleSubscriptionTemplateContent = exampleSubscriptionTemplateContent.replace(
|
|
92
|
+
"import gql from 'graphql-tag'",
|
|
93
|
+
"import { gql } from 'graphql-tag'"
|
|
94
|
+
);
|
|
95
|
+
}
|
|
90
96
|
const exampleFile = path.join(
|
|
91
97
|
cedarPaths.api.subscriptions,
|
|
92
98
|
"countdown",
|
|
@@ -138,7 +144,7 @@ async function handler(args) {
|
|
|
138
144
|
`rooms.${isTypeScriptProject() ? "ts" : "js"}`
|
|
139
145
|
);
|
|
140
146
|
const serviceContent = ts ? exampleServiceTemplateContent : await transformTSToJS(serviceFile, exampleServiceTemplateContent);
|
|
141
|
-
|
|
147
|
+
let exampleSubscriptionTemplateContent = fs.readFileSync(
|
|
142
148
|
path.resolve(
|
|
143
149
|
import.meta.dirname,
|
|
144
150
|
"templates",
|
|
@@ -148,6 +154,12 @@ async function handler(args) {
|
|
|
148
154
|
),
|
|
149
155
|
"utf-8"
|
|
150
156
|
);
|
|
157
|
+
if (projectIsEsm()) {
|
|
158
|
+
exampleSubscriptionTemplateContent = exampleSubscriptionTemplateContent.replace(
|
|
159
|
+
"import gql from 'graphql-tag'",
|
|
160
|
+
"import { gql } from 'graphql-tag'"
|
|
161
|
+
);
|
|
162
|
+
}
|
|
151
163
|
const exampleFile = path.join(
|
|
152
164
|
cedarPaths.api.subscriptions,
|
|
153
165
|
"newMessage",
|