@cedarjs/cli 1.0.0-canary.12748 → 1.0.0-rc.26
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/deploy/baremetal/baremetalHandler.js +26 -5
- package/dist/commands/deploy/baremetal.js +2 -17
- package/dist/commands/deploy/flightcontrol.js +0 -1
- package/dist/commands/deploy/flightcontrolHandler.js +9 -20
- package/dist/commands/execHandler.js +0 -5
- package/dist/commands/generate/cell/templates/stories.tsx.template +1 -1
- package/dist/commands/generate/component/templates/stories.tsx.template +1 -1
- package/dist/commands/generate/helpers.js +1 -1
- package/dist/commands/generate/layout/templates/stories.tsx.template +1 -1
- package/dist/commands/generate/page/templates/stories.tsx.parameters.template +1 -1
- package/dist/commands/generate/page/templates/stories.tsx.template +1 -1
- package/dist/commands/generate/service/serviceHandler.js +2 -5
- package/dist/commands/generate/service/templates/test.ts.template +1 -1
- package/dist/commands/record/init.js +1 -1
- package/dist/commands/setup/deploy/providers/coherenceHandler.js +3 -3
- package/dist/commands/setup/deploy/providers/flightcontrolHandler.js +3 -3
- package/dist/commands/setup/deploy/providers/renderHandler.js +3 -3
- package/dist/commands/setup/i18n/templates/storybook.preview.tsx.template +1 -1
- package/dist/commands/setup/jobs/jobsHandler.js +3 -3
- package/dist/commands/setup/ui/templates/chakra.storybook.preview.tsx.template +1 -1
- package/dist/commands/setup/ui/templates/mantine.storybook.preview.tsx.template +1 -1
- package/dist/commands/upgrade.js +3 -36
- package/dist/lib/schemaHelpers.js +8 -11
- package/dist/lib/templates/storybook.preview.tsx.template +1 -1
- package/package.json +13 -14
|
@@ -5,8 +5,10 @@ import { Listr } from "listr2";
|
|
|
5
5
|
import * as toml from "smol-toml";
|
|
6
6
|
import { env as envInterpolation } from "string-env-interpolation";
|
|
7
7
|
import { titleCase } from "title-case";
|
|
8
|
+
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
8
9
|
import c from "../../../lib/colors.js";
|
|
9
10
|
import { getPaths } from "../../../lib/index.js";
|
|
11
|
+
import { SshExecutor } from "./SshExecutor.js";
|
|
10
12
|
const CONFIG_FILENAME = "deploy.toml";
|
|
11
13
|
const SYMLINK_FLAGS = "-nsf";
|
|
12
14
|
const CURRENT_RELEASE_SYMLINK_NAME = "current";
|
|
@@ -17,8 +19,7 @@ const DEFAULT_SERVER_CONFIG = {
|
|
|
17
19
|
packageManagerCommand: "yarn",
|
|
18
20
|
monitorCommand: "pm2",
|
|
19
21
|
sides: ["api", "web"],
|
|
20
|
-
keepReleases: 5
|
|
21
|
-
freeSpaceRequired: 2048
|
|
22
|
+
keepReleases: 5
|
|
22
23
|
};
|
|
23
24
|
const pathJoin = path.posix.join;
|
|
24
25
|
const throwMissingConfig = (name) => {
|
|
@@ -47,7 +48,7 @@ const verifyServerConfig = (config) => {
|
|
|
47
48
|
if (!config.repo) {
|
|
48
49
|
throwMissingConfig("repo");
|
|
49
50
|
}
|
|
50
|
-
if (!/^\d+$/.test(config.freeSpaceRequired)) {
|
|
51
|
+
if (config.freeSpaceRequired && !/^\d+$/.test(config.freeSpaceRequired)) {
|
|
51
52
|
throw new Error('"freeSpaceRequired" must be an integer >= 0');
|
|
52
53
|
}
|
|
53
54
|
return true;
|
|
@@ -231,8 +232,15 @@ const deployTasks = (yargs, ssh, serverConfig, serverLifecycle) => {
|
|
|
231
232
|
10
|
|
232
233
|
);
|
|
233
234
|
if (dfMb < freeSpaceRequired) {
|
|
235
|
+
if (typeof serverConfig.freeSpaceRequired === "undefined") {
|
|
236
|
+
return task.skip(
|
|
237
|
+
c.warning(
|
|
238
|
+
`Warning: Your server is running low on disk space. (${Math.round(dfMb)}MB available)`
|
|
239
|
+
)
|
|
240
|
+
);
|
|
241
|
+
}
|
|
234
242
|
throw new Error(
|
|
235
|
-
`Not enough disk space. You need at least ${freeSpaceRequired}MB free space to continue
|
|
243
|
+
`Not enough disk space. You need at least ${freeSpaceRequired}MB free space to continue.`
|
|
236
244
|
);
|
|
237
245
|
}
|
|
238
246
|
}
|
|
@@ -491,7 +499,20 @@ const commands = (yargs, ssh) => {
|
|
|
491
499
|
return servers;
|
|
492
500
|
};
|
|
493
501
|
const handler = async (yargs) => {
|
|
494
|
-
|
|
502
|
+
recordTelemetryAttributes({
|
|
503
|
+
command: "deploy baremetal",
|
|
504
|
+
firstRun: yargs.firstRun,
|
|
505
|
+
df: yargs.df,
|
|
506
|
+
update: yargs.update,
|
|
507
|
+
install: yargs.install,
|
|
508
|
+
migrate: yargs.migrate,
|
|
509
|
+
build: yargs.build,
|
|
510
|
+
restart: yargs.restart,
|
|
511
|
+
cleanup: yargs.cleanup,
|
|
512
|
+
maintenance: yargs.maintenance,
|
|
513
|
+
rollback: yargs.rollback,
|
|
514
|
+
verbose: yargs.verbose
|
|
515
|
+
});
|
|
495
516
|
const tomlPath = path.join(getPaths().base, "deploy.toml");
|
|
496
517
|
const ecosystemPath = path.join(getPaths().base, "ecosystem.config.js");
|
|
497
518
|
if (!fs.existsSync(tomlPath) || !fs.existsSync(ecosystemPath)) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { terminalLink } from "termi-link";
|
|
2
|
-
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
3
2
|
const command = "baremetal [environment]";
|
|
4
3
|
const description = "Deploy to baremetal server(s)";
|
|
5
4
|
const builder = (yargs) => {
|
|
@@ -79,22 +78,8 @@ const builder = (yargs) => {
|
|
|
79
78
|
);
|
|
80
79
|
};
|
|
81
80
|
async function handler(yargs) {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
firstRun: yargs.firstRun,
|
|
85
|
-
df: yargs.df,
|
|
86
|
-
update: yargs.update,
|
|
87
|
-
install: yargs.install,
|
|
88
|
-
migrate: yargs.migrate,
|
|
89
|
-
build: yargs.build,
|
|
90
|
-
restart: yargs.restart,
|
|
91
|
-
cleanup: yargs.cleanup,
|
|
92
|
-
maintenance: yargs.maintenance,
|
|
93
|
-
rollback: yargs.rollback,
|
|
94
|
-
verbose: yargs.verbose
|
|
95
|
-
});
|
|
96
|
-
const { handler: baremetalHandler } = await import("./baremetal/baremetalHandler.js");
|
|
97
|
-
return baremetalHandler(yargs);
|
|
81
|
+
const { handler: importedHandler } = await import("./baremetal/baremetalHandler.js");
|
|
82
|
+
return importedHandler(yargs);
|
|
98
83
|
}
|
|
99
84
|
export {
|
|
100
85
|
builder,
|
|
@@ -3,12 +3,7 @@ import execa from "execa";
|
|
|
3
3
|
import fs from "fs-extra";
|
|
4
4
|
import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
|
|
5
5
|
import { getPaths } from "@cedarjs/project-config";
|
|
6
|
-
const handler = async ({
|
|
7
|
-
side,
|
|
8
|
-
serve,
|
|
9
|
-
prisma,
|
|
10
|
-
dm: dataMigrate
|
|
11
|
-
}) => {
|
|
6
|
+
const handler = async ({ side, serve, prisma, dm: dataMigrate }) => {
|
|
12
7
|
recordTelemetryAttributes({
|
|
13
8
|
command: "deploy flightcontrol",
|
|
14
9
|
side,
|
|
@@ -22,26 +17,20 @@ const handler = async ({
|
|
|
22
17
|
shell: true,
|
|
23
18
|
stdio: "inherit"
|
|
24
19
|
};
|
|
25
|
-
async function runExecaCommand(command) {
|
|
26
|
-
const result = await execa.command(command, execaConfig);
|
|
27
|
-
if (result.failed) {
|
|
28
|
-
throw new Error(`Command (${command}) failed`);
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
20
|
async function runApiCommands() {
|
|
33
21
|
if (!serve) {
|
|
34
22
|
console.log("Building api...");
|
|
35
|
-
|
|
23
|
+
execa.commandSync("yarn rw build api --verbose", execaConfig);
|
|
36
24
|
if (prisma) {
|
|
37
25
|
console.log("Running database migrations...");
|
|
38
|
-
|
|
39
|
-
`node_modules/.bin/prisma migrate deploy --schema "${rwjsPaths.api.dbSchema}"
|
|
26
|
+
execa.commandSync(
|
|
27
|
+
`node_modules/.bin/prisma migrate deploy --schema "${rwjsPaths.api.dbSchema}"`,
|
|
28
|
+
execaConfig
|
|
40
29
|
);
|
|
41
30
|
}
|
|
42
31
|
if (dataMigrate) {
|
|
43
32
|
console.log("Running data migrations...");
|
|
44
|
-
|
|
33
|
+
execa.commandSync("yarn rw dataMigrate up", execaConfig);
|
|
45
34
|
}
|
|
46
35
|
return;
|
|
47
36
|
}
|
|
@@ -56,12 +45,12 @@ const handler = async ({
|
|
|
56
45
|
}
|
|
57
46
|
async function runWebCommands() {
|
|
58
47
|
console.log("Building web...");
|
|
59
|
-
|
|
48
|
+
execa.commandSync("yarn rw build web --verbose", execaConfig);
|
|
60
49
|
}
|
|
61
50
|
if (side === "api") {
|
|
62
|
-
|
|
51
|
+
runApiCommands();
|
|
63
52
|
} else if (side === "web") {
|
|
64
|
-
|
|
53
|
+
runWebCommands();
|
|
65
54
|
}
|
|
66
55
|
};
|
|
67
56
|
export {
|
|
@@ -41,11 +41,6 @@ const handler = async (args) => {
|
|
|
41
41
|
printAvailableScriptsToConsole();
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
scriptArgs._ = scriptArgs._.slice(1);
|
|
45
|
-
delete scriptArgs.$0;
|
|
46
|
-
delete scriptArgs.l;
|
|
47
|
-
delete scriptArgs.s;
|
|
48
|
-
delete scriptArgs.silent;
|
|
49
44
|
const scriptPath = resolveScriptPath(name);
|
|
50
45
|
if (!scriptPath) {
|
|
51
46
|
console.error(
|
|
@@ -52,7 +52,7 @@ const scenarioFieldValue = (field) => {
|
|
|
52
52
|
case "String":
|
|
53
53
|
return field.isUnique ? `String${randInt}` : "String";
|
|
54
54
|
case "Bytes":
|
|
55
|
-
return `
|
|
55
|
+
return `Buffer.from([${randIntArray}])`;
|
|
56
56
|
default: {
|
|
57
57
|
if (field.kind === "enum" && field.enumValues[0]) {
|
|
58
58
|
return field.enumValues[0].dbName || field.enumValues[0].name;
|
|
@@ -118,10 +118,7 @@ const buildStringifiedScenario = async (model) => {
|
|
|
118
118
|
}
|
|
119
119
|
return value;
|
|
120
120
|
});
|
|
121
|
-
return jsonString.replace(
|
|
122
|
-
/"new Uint8Array\(([^)]+)\)"/g,
|
|
123
|
-
"new Uint8Array($1)"
|
|
124
|
-
);
|
|
121
|
+
return jsonString.replace(/"Buffer\.from\(([^)]+)\)"/g, "Buffer.from($1)");
|
|
125
122
|
};
|
|
126
123
|
const fieldTypes = async (model) => {
|
|
127
124
|
const { scalarFields } = await parseSchema(model);
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
})
|
|
30
30
|
|
|
31
31
|
// Not all values can be represented as JSON, like function invocations
|
|
32
|
-
return jsonString.replace(/"
|
|
32
|
+
return jsonString.replace(/"Buffer\.from\(([^)]+)\)"/g, 'Buffer.from($1)')
|
|
33
33
|
} %>
|
|
34
34
|
<% if (prismaImport) { %>import { Prisma, ${prismaModel} } from '@prisma/client'<% } else { %>import type { ${prismaModel} } from '@prisma/client'<% } %>
|
|
35
35
|
|
|
@@ -12,7 +12,7 @@ import { errorTelemetry } from "@cedarjs/telemetry";
|
|
|
12
12
|
import { printSetupNotes } from "../../../../lib/index.js";
|
|
13
13
|
import { serverFileExists } from "../../../../lib/project.js";
|
|
14
14
|
import { addFilesTask } from "../helpers/index.js";
|
|
15
|
-
const {
|
|
15
|
+
const { getSchema, getConfig } = prismaInternals;
|
|
16
16
|
const redwoodProjectPaths = getPaths();
|
|
17
17
|
const EXTENSION = isTypeScriptProject ? "ts" : "js";
|
|
18
18
|
async function handler({ force }) {
|
|
@@ -57,8 +57,8 @@ async function getAddCoherenceFilesTask(force) {
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
async function getCoherenceConfigFileContent() {
|
|
60
|
-
const
|
|
61
|
-
const prismaConfig = await getConfig({ datamodel:
|
|
60
|
+
const prismaSchema = await getSchema(redwoodProjectPaths.api.dbSchema);
|
|
61
|
+
const prismaConfig = await getConfig({ datamodel: prismaSchema });
|
|
62
62
|
let db = prismaConfig.datasources[0].activeProvider;
|
|
63
63
|
if (!SUPPORTED_DATABASES.includes(db)) {
|
|
64
64
|
throw new Error(
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
postgresDatabaseService,
|
|
19
19
|
mysqlDatabaseService
|
|
20
20
|
} from "../templates/flightcontrol.js";
|
|
21
|
-
const {
|
|
21
|
+
const { getSchema, getConfig } = prismaInternals;
|
|
22
22
|
const getFlightcontrolJson = async (database) => {
|
|
23
23
|
if (database === "none") {
|
|
24
24
|
return {
|
|
@@ -29,10 +29,10 @@ const getFlightcontrolJson = async (database) => {
|
|
|
29
29
|
if (!fs.existsSync(path.join(getPaths().base, "api/db/schema.prisma"))) {
|
|
30
30
|
throw new Error("Could not find prisma schema at 'api/db/schema.prisma'");
|
|
31
31
|
}
|
|
32
|
-
const
|
|
32
|
+
const schema = await getSchema(
|
|
33
33
|
path.join(getPaths().base, "api/db/schema.prisma")
|
|
34
34
|
);
|
|
35
|
-
const config = await getConfig({ datamodel:
|
|
35
|
+
const config = await getConfig({ datamodel: schema });
|
|
36
36
|
const detectedDatabase = config.datasources[0].activeProvider;
|
|
37
37
|
if (detectedDatabase === database) {
|
|
38
38
|
let dbService;
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
RENDER_YAML,
|
|
18
18
|
SQLITE_YAML
|
|
19
19
|
} from "../templates/render.js";
|
|
20
|
-
const {
|
|
20
|
+
const { getSchema, getConfig } = prismaInternals;
|
|
21
21
|
const getRenderYamlContent = async (database) => {
|
|
22
22
|
if (database === "none") {
|
|
23
23
|
return {
|
|
@@ -28,8 +28,8 @@ const getRenderYamlContent = async (database) => {
|
|
|
28
28
|
if (!fs.existsSync("api/db/schema.prisma")) {
|
|
29
29
|
throw new Error("Could not find prisma schema at 'api/db/schema.prisma'");
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
const config = await getConfig({ datamodel:
|
|
31
|
+
const schema = await getSchema("api/db/schema.prisma");
|
|
32
|
+
const config = await getConfig({ datamodel: schema });
|
|
33
33
|
const detectedDatabase = config.datasources[0].activeProvider;
|
|
34
34
|
if (detectedDatabase === database) {
|
|
35
35
|
switch (database) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
|
|
3
3
|
import type { GlobalTypes } from '@storybook/csf'
|
|
4
|
-
import type { Preview, StoryContext, StoryFn } from '@storybook/react
|
|
4
|
+
import type { Preview, StoryContext, StoryFn } from '@storybook/react'
|
|
5
5
|
import { I18nextProvider } from 'react-i18next'
|
|
6
6
|
import i18n from 'web/src/i18n'
|
|
7
7
|
|
|
@@ -6,7 +6,6 @@ import { addApiPackages } from "@cedarjs/cli-helpers";
|
|
|
6
6
|
import c from "../../../lib/colors.js";
|
|
7
7
|
import { getPaths, transformTSToJS, writeFile } from "../../../lib/index.js";
|
|
8
8
|
import { isTypeScriptProject } from "../../../lib/project.js";
|
|
9
|
-
const { getDMMF, getSchemaWithPath } = prismaInternals;
|
|
10
9
|
const MODEL_SCHEMA = `
|
|
11
10
|
model BackgroundJob {
|
|
12
11
|
id Int @id @default(autoincrement())
|
|
@@ -25,8 +24,9 @@ model BackgroundJob {
|
|
|
25
24
|
}
|
|
26
25
|
`;
|
|
27
26
|
const getModelNames = async () => {
|
|
28
|
-
const
|
|
29
|
-
|
|
27
|
+
const schema = await prismaInternals.getDMMF({
|
|
28
|
+
datamodelPath: getPaths().api.dbSchema
|
|
29
|
+
});
|
|
30
30
|
return schema.datamodel.models.map((model) => model.name);
|
|
31
31
|
};
|
|
32
32
|
const addDatabaseModel = () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
|
|
3
3
|
import { ChakraProvider, extendTheme } from '@chakra-ui/react'
|
|
4
|
-
import type { Preview, StoryFn } from '@storybook/react
|
|
4
|
+
import type { Preview, StoryFn } from '@storybook/react'
|
|
5
5
|
import theme from 'config/chakra.config'
|
|
6
6
|
|
|
7
7
|
const extendedTheme = extendTheme(theme)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
|
|
3
3
|
import { MantineProvider } from '@mantine/core'
|
|
4
|
-
import type { Preview, StoryFn } from '@storybook/react
|
|
4
|
+
import type { Preview, StoryFn } from '@storybook/react'
|
|
5
5
|
import theme from 'config/mantine.config'
|
|
6
6
|
|
|
7
7
|
import '@mantine/core/styles.css'
|
package/dist/commands/upgrade.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
-
import { ListrEnquirerPromptAdapter } from "@listr2/prompt-adapter-enquirer";
|
|
3
2
|
import execa from "execa";
|
|
4
3
|
import fs from "fs-extra";
|
|
5
4
|
import latestVersion from "latest-version";
|
|
@@ -36,11 +35,6 @@ const builder = (yargs) => {
|
|
|
36
35
|
description: "Skip dedupe check with --no-dedupe",
|
|
37
36
|
type: "boolean",
|
|
38
37
|
default: true
|
|
39
|
-
}).option("yes", {
|
|
40
|
-
alias: "y",
|
|
41
|
-
describe: "Skip prompts and use defaults",
|
|
42
|
-
default: false,
|
|
43
|
-
type: "boolean"
|
|
44
38
|
}).epilogue(
|
|
45
39
|
`Also see the ${terminalLink(
|
|
46
40
|
"CedarJS CLI Reference for the upgrade command",
|
|
@@ -70,43 +64,16 @@ const validateTag = (tag) => {
|
|
|
70
64
|
}
|
|
71
65
|
return tag;
|
|
72
66
|
};
|
|
73
|
-
const handler = async ({ dryRun, tag, verbose, dedupe
|
|
67
|
+
const handler = async ({ dryRun, tag, verbose, dedupe }) => {
|
|
74
68
|
recordTelemetryAttributes({
|
|
75
69
|
command: "upgrade",
|
|
76
70
|
dryRun,
|
|
77
71
|
tag,
|
|
78
72
|
verbose,
|
|
79
|
-
dedupe
|
|
80
|
-
yes
|
|
73
|
+
dedupe
|
|
81
74
|
});
|
|
82
75
|
const tasks = new Listr(
|
|
83
76
|
[
|
|
84
|
-
{
|
|
85
|
-
title: "Confirm upgrade",
|
|
86
|
-
task: async (ctx, task) => {
|
|
87
|
-
if (yes) {
|
|
88
|
-
task.skip("Skipping confirmation prompt because of --yes flag.");
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const prompt = task.prompt(ListrEnquirerPromptAdapter);
|
|
92
|
-
const proceed = await prompt.run({
|
|
93
|
-
type: "Confirm",
|
|
94
|
-
message: "This will upgrade your CedarJS project to the latest version. Do you want to proceed?",
|
|
95
|
-
initial: "Y",
|
|
96
|
-
default: "(Yes/no)",
|
|
97
|
-
format: function(value) {
|
|
98
|
-
if (this.state.submitted) {
|
|
99
|
-
return this.isTrue(value) ? "yes" : "no";
|
|
100
|
-
}
|
|
101
|
-
return "Yes";
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
if (!proceed) {
|
|
105
|
-
task.skip("Upgrade cancelled by user.");
|
|
106
|
-
process.exit(0);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
77
|
{
|
|
111
78
|
title: "Checking latest version",
|
|
112
79
|
task: async (ctx) => setLatestVersionToContext(ctx, tag)
|
|
@@ -197,7 +164,7 @@ const handler = async ({ dryRun, tag, verbose, dedupe, yes }) => {
|
|
|
197
164
|
}
|
|
198
165
|
],
|
|
199
166
|
{
|
|
200
|
-
renderer: verbose
|
|
167
|
+
renderer: verbose && "verbose",
|
|
201
168
|
rendererOptions: { collapseSubtasks: false }
|
|
202
169
|
}
|
|
203
170
|
);
|
|
@@ -2,7 +2,7 @@ import prismaInternals from "@prisma/internals";
|
|
|
2
2
|
import { ensureUniquePlural } from "./pluralHelpers.js";
|
|
3
3
|
import { singularize, isPlural } from "./rwPluralize.js";
|
|
4
4
|
import { getPaths } from "./index.js";
|
|
5
|
-
const { getConfig, getDMMF,
|
|
5
|
+
const { getConfig, getDMMF, getSchema: getSchemaPrisma } = prismaInternals;
|
|
6
6
|
const schemaMemo = {};
|
|
7
7
|
const getExistingModelName = async (name) => {
|
|
8
8
|
if (!name) {
|
|
@@ -62,18 +62,15 @@ const getEnum = async (name) => {
|
|
|
62
62
|
}
|
|
63
63
|
return model;
|
|
64
64
|
};
|
|
65
|
-
const getDataModel =
|
|
66
|
-
|
|
67
|
-
return result.schemas;
|
|
65
|
+
const getDataModel = (path = getPaths().api.dbSchema) => {
|
|
66
|
+
return getSchemaPrisma(path);
|
|
68
67
|
};
|
|
69
|
-
const getSchemaDefinitions =
|
|
70
|
-
return getDMMF({ datamodel:
|
|
71
|
-
};
|
|
72
|
-
const getSchemaConfig = async () => {
|
|
73
|
-
return getConfig({
|
|
74
|
-
datamodel: await getDataModel()
|
|
75
|
-
});
|
|
68
|
+
const getSchemaDefinitions = () => {
|
|
69
|
+
return getDMMF({ datamodel: getDataModel() });
|
|
76
70
|
};
|
|
71
|
+
const getSchemaConfig = () => getConfig({
|
|
72
|
+
datamodel: getDataModel()
|
|
73
|
+
});
|
|
77
74
|
async function verifyModelName(options) {
|
|
78
75
|
const modelName = await getExistingModelName(options.name) || await getExistingModelName(singularize(options.name));
|
|
79
76
|
if (modelName === void 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
|
|
3
3
|
import type { GlobalTypes } from '@storybook/csf'
|
|
4
|
-
import type { Preview, StoryContext, StoryFn } from '@storybook/react
|
|
4
|
+
import type { Preview, StoryContext, StoryFn } from '@storybook/react'
|
|
5
5
|
|
|
6
6
|
/** @see {@link https://storybook.js.org/docs/7/essentials/toolbars-and-globals#global-types-and-the-toolbar-annotation | Global types and the toolbar annotation} */
|
|
7
7
|
export const globalTypes: GlobalTypes = {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rc.26",
|
|
4
4
|
"description": "The CedarJS Command Line",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"bin": {
|
|
13
|
-
"cdr": "./dist/index.js",
|
|
14
13
|
"cedarjs": "./dist/index.js",
|
|
15
14
|
"redwood": "./dist/index.js",
|
|
16
15
|
"rw": "./dist/index.js",
|
|
@@ -32,15 +31,15 @@
|
|
|
32
31
|
"dependencies": {
|
|
33
32
|
"@babel/preset-typescript": "7.27.1",
|
|
34
33
|
"@babel/runtime-corejs3": "7.27.6",
|
|
35
|
-
"@cedarjs/api-server": "1.0.0-
|
|
36
|
-
"@cedarjs/cli-helpers": "1.0.0-
|
|
37
|
-
"@cedarjs/fastify-web": "1.0.0-
|
|
38
|
-
"@cedarjs/internal": "1.0.0-
|
|
39
|
-
"@cedarjs/prerender": "1.0.0-
|
|
40
|
-
"@cedarjs/project-config": "1.0.0-
|
|
41
|
-
"@cedarjs/structure": "1.0.0-
|
|
42
|
-
"@cedarjs/telemetry": "1.0.0-
|
|
43
|
-
"@cedarjs/web-server": "1.0.0-
|
|
34
|
+
"@cedarjs/api-server": "1.0.0-rc.26",
|
|
35
|
+
"@cedarjs/cli-helpers": "1.0.0-rc.26",
|
|
36
|
+
"@cedarjs/fastify-web": "1.0.0-rc.26",
|
|
37
|
+
"@cedarjs/internal": "1.0.0-rc.26",
|
|
38
|
+
"@cedarjs/prerender": "1.0.0-rc.26",
|
|
39
|
+
"@cedarjs/project-config": "1.0.0-rc.26",
|
|
40
|
+
"@cedarjs/structure": "1.0.0-rc.26",
|
|
41
|
+
"@cedarjs/telemetry": "1.0.0-rc.26",
|
|
42
|
+
"@cedarjs/web-server": "1.0.0-rc.26",
|
|
44
43
|
"@listr2/prompt-adapter-enquirer": "2.0.16",
|
|
45
44
|
"@opentelemetry/api": "1.8.0",
|
|
46
45
|
"@opentelemetry/core": "1.22.0",
|
|
@@ -48,7 +47,7 @@
|
|
|
48
47
|
"@opentelemetry/resources": "1.22.0",
|
|
49
48
|
"@opentelemetry/sdk-trace-node": "1.22.0",
|
|
50
49
|
"@opentelemetry/semantic-conventions": "1.22.0",
|
|
51
|
-
"@prisma/internals": "
|
|
50
|
+
"@prisma/internals": "5.20.0",
|
|
52
51
|
"ansis": "4.1.0",
|
|
53
52
|
"archiver": "7.0.1",
|
|
54
53
|
"boxen": "5.1.2",
|
|
@@ -75,7 +74,7 @@
|
|
|
75
74
|
"pluralize": "8.0.0",
|
|
76
75
|
"portfinder": "1.0.37",
|
|
77
76
|
"prettier": "3.6.2",
|
|
78
|
-
"prisma": "
|
|
77
|
+
"prisma": "5.20.0",
|
|
79
78
|
"prompts": "2.4.2",
|
|
80
79
|
"rimraf": "6.0.1",
|
|
81
80
|
"semver": "7.6.3",
|
|
@@ -102,5 +101,5 @@
|
|
|
102
101
|
"publishConfig": {
|
|
103
102
|
"access": "public"
|
|
104
103
|
},
|
|
105
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "2ea84a564123f5d986dd88efcb6dddc55cbef367"
|
|
106
105
|
}
|