@cedarjs/cli 4.0.0-canary.13779 → 4.0.0-canary.13781
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.
|
@@ -6,16 +6,16 @@ import { getMigrationsPath, getSchemaPath } from "@cedarjs/project-config";
|
|
|
6
6
|
import { errorTelemetry } from "@cedarjs/telemetry";
|
|
7
7
|
import { getPaths, transformTSToJS, writeFile } from "../../../lib/index.js";
|
|
8
8
|
import { isTypeScriptProject } from "../../../lib/project.js";
|
|
9
|
-
|
|
9
|
+
function getApiPackageJson() {
|
|
10
10
|
const apiPackageJsonPath = path.join(getPaths().api.base, "package.json");
|
|
11
11
|
return JSON.parse(fs.readFileSync(apiPackageJsonPath, "utf-8"));
|
|
12
|
-
}
|
|
13
|
-
|
|
12
|
+
}
|
|
13
|
+
function hasPackage(packageJson, packageName) {
|
|
14
14
|
return Boolean(
|
|
15
15
|
packageJson.dependencies?.[packageName] || packageJson.devDependencies?.[packageName]
|
|
16
16
|
);
|
|
17
|
-
}
|
|
18
|
-
|
|
17
|
+
}
|
|
18
|
+
async function getPrismaProvider() {
|
|
19
19
|
try {
|
|
20
20
|
const prismaConfigPath = getPaths().api.prismaConfig;
|
|
21
21
|
if (!prismaConfigPath) {
|
|
@@ -51,8 +51,8 @@ const getPrismaProvider = async () => {
|
|
|
51
51
|
} catch {
|
|
52
52
|
return void 0;
|
|
53
53
|
}
|
|
54
|
-
}
|
|
55
|
-
|
|
54
|
+
}
|
|
55
|
+
function findExistingLiveQueryMigration({ migrationsDirectoryPath }) {
|
|
56
56
|
if (!fs.existsSync(migrationsDirectoryPath)) {
|
|
57
57
|
return void 0;
|
|
58
58
|
}
|
|
@@ -62,8 +62,8 @@ const findExistingLiveQueryMigration = ({ migrationsDirectoryPath }) => {
|
|
|
62
62
|
const content = fs.readFileSync(migrationFilePath, "utf-8");
|
|
63
63
|
return content.includes("cedar_notify_table_change");
|
|
64
64
|
});
|
|
65
|
-
}
|
|
66
|
-
|
|
65
|
+
}
|
|
66
|
+
function generateMigrationFolderName() {
|
|
67
67
|
const now = /* @__PURE__ */ new Date();
|
|
68
68
|
const year = String(now.getFullYear());
|
|
69
69
|
const month = String(now.getMonth() + 1).padStart(2, "0");
|
|
@@ -72,8 +72,8 @@ const generateMigrationFolderName = () => {
|
|
|
72
72
|
const minute = String(now.getMinutes()).padStart(2, "0");
|
|
73
73
|
const second = String(now.getSeconds()).padStart(2, "0");
|
|
74
74
|
return `${year}${month}${day}${hour}${minute}${second}_live_queries_notifications`;
|
|
75
|
-
}
|
|
76
|
-
|
|
75
|
+
}
|
|
76
|
+
function addLiveQueryListenerToGraphqlHandler({ force }) {
|
|
77
77
|
const graphqlHandlerPath = path.join(
|
|
78
78
|
getPaths().api.functions,
|
|
79
79
|
`graphql.${isTypeScriptProject() ? "ts" : "js"}`
|
|
@@ -142,8 +142,8 @@ const addLiveQueryListenerToGraphqlHandler = ({ force }) => {
|
|
|
142
142
|
return {
|
|
143
143
|
skipped: false
|
|
144
144
|
};
|
|
145
|
-
}
|
|
146
|
-
|
|
145
|
+
}
|
|
146
|
+
async function handler({ force }) {
|
|
147
147
|
const projectIsTypescript = isTypeScriptProject();
|
|
148
148
|
const apiPackageJson = getApiPackageJson();
|
|
149
149
|
const migrationsPath = await getMigrationsPath(getPaths().api.prismaConfig);
|
|
@@ -282,7 +282,7 @@ const handler = async ({ force }) => {
|
|
|
282
282
|
console.error(c.error(e.message));
|
|
283
283
|
process.exit(e?.exitCode || 1);
|
|
284
284
|
}
|
|
285
|
-
}
|
|
285
|
+
}
|
|
286
286
|
export {
|
|
287
287
|
handler
|
|
288
288
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.13781+ef38e3e5bf",
|
|
4
4
|
"description": "The CedarJS Command Line",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,16 +33,16 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/parser": "7.29.2",
|
|
35
35
|
"@babel/preset-typescript": "7.28.5",
|
|
36
|
-
"@cedarjs/api-server": "4.0.0-canary.
|
|
37
|
-
"@cedarjs/cli-helpers": "4.0.0-canary.
|
|
38
|
-
"@cedarjs/fastify-web": "4.0.0-canary.
|
|
39
|
-
"@cedarjs/internal": "4.0.0-canary.
|
|
40
|
-
"@cedarjs/prerender": "4.0.0-canary.
|
|
41
|
-
"@cedarjs/project-config": "4.0.0-canary.
|
|
42
|
-
"@cedarjs/structure": "4.0.0-canary.
|
|
43
|
-
"@cedarjs/telemetry": "4.0.0-canary.
|
|
44
|
-
"@cedarjs/utils": "4.0.0-canary.
|
|
45
|
-
"@cedarjs/web-server": "4.0.0-canary.
|
|
36
|
+
"@cedarjs/api-server": "4.0.0-canary.13781",
|
|
37
|
+
"@cedarjs/cli-helpers": "4.0.0-canary.13781",
|
|
38
|
+
"@cedarjs/fastify-web": "4.0.0-canary.13781",
|
|
39
|
+
"@cedarjs/internal": "4.0.0-canary.13781",
|
|
40
|
+
"@cedarjs/prerender": "4.0.0-canary.13781",
|
|
41
|
+
"@cedarjs/project-config": "4.0.0-canary.13781",
|
|
42
|
+
"@cedarjs/structure": "4.0.0-canary.13781",
|
|
43
|
+
"@cedarjs/telemetry": "4.0.0-canary.13781",
|
|
44
|
+
"@cedarjs/utils": "4.0.0-canary.13781",
|
|
45
|
+
"@cedarjs/web-server": "4.0.0-canary.13781",
|
|
46
46
|
"@listr2/prompt-adapter-enquirer": "4.2.1",
|
|
47
47
|
"@opentelemetry/api": "1.9.0",
|
|
48
48
|
"@opentelemetry/core": "1.30.1",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"publishConfig": {
|
|
109
109
|
"access": "public"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "ef38e3e5bfe2db2f78a3faa0df19b725cfd2c9f4"
|
|
112
112
|
}
|