@cedarjs/cli 8.0.0-canary.3331 → 8.0.0-canary.3335
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.
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const UPLOADS_GITIGNORE_ENTRY = "api/.uploads";
|
|
2
|
+
function transformGitignore(source) {
|
|
3
|
+
const activeLines = source.split("\n").map((line) => line.trimEnd()).filter((line) => line.length > 0 && !line.startsWith("#"));
|
|
4
|
+
if (activeLines.includes(UPLOADS_GITIGNORE_ENTRY)) {
|
|
5
|
+
return source;
|
|
6
|
+
}
|
|
7
|
+
if (/^dev\.db\*$/m.test(source)) {
|
|
8
|
+
return source.replace(/^(dev\.db\*)$/m, `$1
|
|
9
|
+
${UPLOADS_GITIGNORE_ENTRY}`);
|
|
10
|
+
}
|
|
11
|
+
const prefix = source === "" || source.endsWith("\n") ? source : source + "\n";
|
|
12
|
+
return prefix + UPLOADS_GITIGNORE_ENTRY + "\n";
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
UPLOADS_GITIGNORE_ENTRY,
|
|
16
|
+
transformGitignore
|
|
17
|
+
};
|
|
@@ -18,6 +18,7 @@ import { getPaths, transformTSToJS, writeFile } from "../../../lib/index.js";
|
|
|
18
18
|
import { isTypeScriptProject } from "../../../lib/project.js";
|
|
19
19
|
import { generateSecret } from "../../generate/secret/secret.js";
|
|
20
20
|
import { setupServerFileTasks } from "../server-file/serverFileHandler.js";
|
|
21
|
+
import { transformGitignore } from "./gitignore.js";
|
|
21
22
|
import { addUploadModel } from "./schemaPrisma.js";
|
|
22
23
|
import {
|
|
23
24
|
addUploadsPlugin,
|
|
@@ -264,6 +265,20 @@ const handler = async ({ targets, force }) => {
|
|
|
264
265
|
}
|
|
265
266
|
}
|
|
266
267
|
},
|
|
268
|
+
{
|
|
269
|
+
title: "Adding the fs upload directory to .gitignore...",
|
|
270
|
+
skip: () => wantsFs ? false : "No fs target selected; skipping.",
|
|
271
|
+
task: (_ctx, task) => {
|
|
272
|
+
const gitignorePath = path.join(paths.base, ".gitignore");
|
|
273
|
+
const source = fs.existsSync(gitignorePath) ? fs.readFileSync(gitignorePath, "utf-8") : "";
|
|
274
|
+
const updated = transformGitignore(source);
|
|
275
|
+
if (updated === source) {
|
|
276
|
+
task.skip(".gitignore already up to date");
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
fs.writeFileSync(gitignorePath, updated, "utf-8");
|
|
280
|
+
}
|
|
281
|
+
},
|
|
267
282
|
{
|
|
268
283
|
title: "Prettifying changed files",
|
|
269
284
|
task: async (_ctx, task) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli",
|
|
3
|
-
"version": "8.0.0-canary.
|
|
3
|
+
"version": "8.0.0-canary.3335",
|
|
4
4
|
"description": "The CedarJS Command Line",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
"@babel/preset-typescript": "7.29.7",
|
|
37
37
|
"@babel/traverse": "7.29.8",
|
|
38
38
|
"@babel/types": "7.29.8",
|
|
39
|
-
"@cedarjs/api-server": "8.0.0-canary.
|
|
40
|
-
"@cedarjs/babel-config": "8.0.0-canary.
|
|
41
|
-
"@cedarjs/cli-helpers": "8.0.0-canary.
|
|
42
|
-
"@cedarjs/internal": "8.0.0-canary.
|
|
43
|
-
"@cedarjs/prerender": "8.0.0-canary.
|
|
44
|
-
"@cedarjs/project-config": "8.0.0-canary.
|
|
45
|
-
"@cedarjs/structure": "8.0.0-canary.
|
|
46
|
-
"@cedarjs/telemetry": "8.0.0-canary.
|
|
47
|
-
"@cedarjs/utils": "8.0.0-canary.
|
|
48
|
-
"@cedarjs/vite": "8.0.0-canary.
|
|
49
|
-
"@cedarjs/web-server": "8.0.0-canary.
|
|
39
|
+
"@cedarjs/api-server": "8.0.0-canary.3335",
|
|
40
|
+
"@cedarjs/babel-config": "8.0.0-canary.3335",
|
|
41
|
+
"@cedarjs/cli-helpers": "8.0.0-canary.3335",
|
|
42
|
+
"@cedarjs/internal": "8.0.0-canary.3335",
|
|
43
|
+
"@cedarjs/prerender": "8.0.0-canary.3335",
|
|
44
|
+
"@cedarjs/project-config": "8.0.0-canary.3335",
|
|
45
|
+
"@cedarjs/structure": "8.0.0-canary.3335",
|
|
46
|
+
"@cedarjs/telemetry": "8.0.0-canary.3335",
|
|
47
|
+
"@cedarjs/utils": "8.0.0-canary.3335",
|
|
48
|
+
"@cedarjs/vite": "8.0.0-canary.3335",
|
|
49
|
+
"@cedarjs/web-server": "8.0.0-canary.3335",
|
|
50
50
|
"@listr2/prompt-adapter-enquirer": "4.3.3",
|
|
51
51
|
"@opentelemetry/api": "1.9.1",
|
|
52
52
|
"@opentelemetry/core": "2.11.0",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"yargs": "17.7.3"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@cedarjs/framework-tools": "8.0.0-canary.
|
|
97
|
+
"@cedarjs/framework-tools": "8.0.0-canary.3335",
|
|
98
98
|
"@prisma/dmmf": "7.10.0",
|
|
99
99
|
"@types/archiver": "^7.0.0",
|
|
100
100
|
"memfs": "4.80.0",
|