Skip to content

Commit 3561807

Browse files
maneikeactions-user
authored andcommitted
Prettified Code!
1 parent 957a11d commit 3561807

File tree

9 files changed

+58
-45
lines changed

9 files changed

+58
-45
lines changed

packages/cli/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"outDir": "./dist",
88
"rootDir": ".",
99
"composite": true
10-
},
11-
}
10+
}
11+
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
import type { NextApiRequest, NextApiResponse } from 'next';
2-
import { supabase } from '../../lib/supabase';
1+
import type { NextApiRequest, NextApiResponse } from "next";
2+
import { supabase } from "../../lib/supabase";
33

4-
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
5-
const { data, error } = await supabase.from('your_table').select('*');
4+
export default async function handler(
5+
req: NextApiRequest,
6+
res: NextApiResponse,
7+
) {
8+
const { data, error } = await supabase.from("your_table").select("*");
69

710
if (error) {
811
return res.status(500).json({ error: error.message });
912
}
1013

1114
return res.status(200).json(data);
12-
}
15+
}
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,16 @@
11
export const supabaseFiles = [
2-
{
3-
path: 'supabase/src/',
4-
files: [
5-
'client.ts',
6-
'index.ts',
7-
'middleware.ts',
8-
'server.ts',
9-
'types.ts',
10-
],
11-
},
12-
{
13-
path: 'supabase/',
14-
files: [
15-
'package',
16-
],
17-
rename: [
18-
{
19-
from: 'package',
20-
to: 'package.json',
21-
}
22-
]
23-
},
24-
];
2+
{
3+
path: "supabase/src/",
4+
files: ["client.ts", "index.ts", "middleware.ts", "server.ts", "types.ts"],
5+
},
6+
{
7+
path: "supabase/",
8+
files: ["package"],
9+
rename: [
10+
{
11+
from: "package",
12+
to: "package.json",
13+
},
14+
],
15+
},
16+
];

packages/core/utils/bar/prepareDrink.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ export const prepareDrink = (name: string) => {
1919
console.log(
2020
`\x1b[32m%s\x1b[0m`,
2121
`🍸 Your Stapled ${getName(name)} is ready!`,
22-
`\x1b[0m`
22+
`\x1b[0m`,
2323
);
2424
// I'm too lazy to mess with modules building to allow coloring library to be installed lol
2525
console.log(
2626
`🍸 You can now run:`,
27-
`\x1b[36mcd ${name} && pnpm dev\x1b[0m`
27+
`\x1b[36mcd ${name} && pnpm dev\x1b[0m`,
2828
);
2929
}, 1000);
3030
}, 1000);
+26-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import fs from 'fs';
2-
import path from 'path';
1+
import fs from "fs";
2+
import path from "path";
33

44
interface TemplateFilesObject {
55
path: string;
@@ -11,27 +11,45 @@ interface TemplateFilesObject {
1111
}
1212
export type Template = TemplateFilesObject[];
1313

14-
export const templateGenerator = (template: Template, templateDir: string, destinationDir: string) => {
14+
export const templateGenerator = (
15+
template: Template,
16+
templateDir: string,
17+
destinationDir: string,
18+
) => {
1519
template.forEach((templateFilesObject) => {
1620
templateFilesObject.files.forEach((file) => {
1721
// Construct source and destination paths
1822
const source = path.join(templateDir, file);
1923
// console.log(source);
20-
const destination = path.join(destinationDir, templateFilesObject.path, file);
24+
const destination = path.join(
25+
destinationDir,
26+
templateFilesObject.path,
27+
file,
28+
);
2129
// check if the directory exists, if not create it
2230
if (!fs.existsSync(path.join(destinationDir, templateFilesObject.path))) {
23-
fs.mkdirSync(path.join(destinationDir, templateFilesObject.path), { recursive: true });
31+
fs.mkdirSync(path.join(destinationDir, templateFilesObject.path), {
32+
recursive: true,
33+
});
2434
}
2535
fs.copyFileSync(source, destination);
2636

2737
// Handle file renaming if needed
2838
if (templateFilesObject.rename) {
2939
templateFilesObject.rename.forEach((rename) => {
30-
const oldPath = path.join(process.cwd(), templateFilesObject.path, rename.from);
31-
const newPath = path.join(process.cwd(), templateFilesObject.path, rename.to);
40+
const oldPath = path.join(
41+
process.cwd(),
42+
templateFilesObject.path,
43+
rename.from,
44+
);
45+
const newPath = path.join(
46+
process.cwd(),
47+
templateFilesObject.path,
48+
rename.to,
49+
);
3250
fs.renameSync(oldPath, newPath);
3351
});
3452
}
3553
});
3654
});
37-
};
55+
};

packages/core/utils/payload/install.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const preparePayload = async () => {
2020
`mkdir -p ./app/\\(app\\) && find ./app -maxdepth 1 ! -path './app' ! -path './app/\\(app\\)' -exec mv {} ./app/\\(app\\)/ \\;`,
2121
{
2222
stdio: "inherit",
23-
}
23+
},
2424
);
2525

2626
console.log("🍸 Installing Payload to Next.js...");

packages/core/utils/payload/preparePayloadConfig.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export const preparePayloadConfig = async (configPath: PathLike) => {
1818
// Append schemaName to the existing pool configuration (avoiding the extra comma)
1919
return match.replace(
2020
group1.trimEnd(),
21-
`${group1.trimEnd()} schemaName: 'payload',\n`
21+
`${group1.trimEnd()} schemaName: 'payload',\n`,
2222
);
23-
}
23+
},
2424
);
2525

2626
// Write the updated payload.config.ts back to the file

packages/core/utils/payload/removeTurboFlag.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export const removeTurboFlag = () => {
3232
if (err) {
3333
console.error("🍸 Error writing to package.json", err);
3434
}
35-
}
35+
},
3636
);
3737
});
3838
};

packages/core/utils/payload/updatePackages.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { execSync } from "child_process";
22

33
export const updatePackages = () => {
44
console.log(
5-
"🍸 Updating Next and React to their respective release candidates..."
5+
"🍸 Updating Next and React to their respective release candidates...",
66
);
77
execSync(`pnpm up next@rc react@rc react-dom@rc eslint-config-next@rc`, {
88
stdio: "inherit",

0 commit comments

Comments
 (0)