@apc-projects/elysia-cli 0.1.1 → 0.1.2
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/package.json +1 -1
- package/src/commands/add.ts +21 -19
package/package.json
CHANGED
package/src/commands/add.ts
CHANGED
|
@@ -136,25 +136,7 @@ const PLUGINS: Record<string, Preset> = {
|
|
|
136
136
|
importName: "jwt",
|
|
137
137
|
importFrom: "@elysiajs/jwt",
|
|
138
138
|
}),
|
|
139
|
-
|
|
140
|
-
pkgs: ["chalk"],
|
|
141
|
-
apply: (config) => {
|
|
142
|
-
scaffoldFile(join(config.srcDir, "utils", "logger.ts"), loggerTemplate());
|
|
143
|
-
const project = loadTsProject();
|
|
144
|
-
const app = { entry: config.appEntry, variable: config.appVariable };
|
|
145
|
-
const loggerPath = join(config.srcDir, "utils", "logger");
|
|
146
|
-
appendChain(project, app, loggerHooksSegment(), {
|
|
147
|
-
dedupe: "Logger.app.request",
|
|
148
|
-
ensureImports: [
|
|
149
|
-
{
|
|
150
|
-
names: ["Logger"],
|
|
151
|
-
moduleSpecifier: moduleSpecifierFrom(config.appEntry, loggerPath),
|
|
152
|
-
},
|
|
153
|
-
],
|
|
154
|
-
});
|
|
155
|
-
replaceConsoleWithLogger(project, app, loggerPath);
|
|
156
|
-
},
|
|
157
|
-
},
|
|
139
|
+
|
|
158
140
|
prisma: {
|
|
159
141
|
pkgs: ["@prisma/client"],
|
|
160
142
|
devPkgs: ["prisma", "prismabox", "dotenv"],
|
|
@@ -257,6 +239,7 @@ const PLUGINS: Record<string, Preset> = {
|
|
|
257
239
|
"--name",
|
|
258
240
|
"add-auth",
|
|
259
241
|
]);
|
|
242
|
+
run("prisma generate", "bunx", ["prisma", "generate"]);
|
|
260
243
|
}
|
|
261
244
|
},
|
|
262
245
|
};
|
|
@@ -293,6 +276,25 @@ const PLUGINS: Record<string, Preset> = {
|
|
|
293
276
|
});
|
|
294
277
|
},
|
|
295
278
|
},
|
|
279
|
+
logger: {
|
|
280
|
+
pkgs: ["chalk"],
|
|
281
|
+
apply: (config) => {
|
|
282
|
+
scaffoldFile(join(config.srcDir, "utils", "logger.ts"), loggerTemplate());
|
|
283
|
+
const project = loadTsProject();
|
|
284
|
+
const app = { entry: config.appEntry, variable: config.appVariable };
|
|
285
|
+
const loggerPath = join(config.srcDir, "utils", "logger");
|
|
286
|
+
appendChain(project, app, loggerHooksSegment(), {
|
|
287
|
+
dedupe: "Logger.app.request",
|
|
288
|
+
ensureImports: [
|
|
289
|
+
{
|
|
290
|
+
names: ["Logger"],
|
|
291
|
+
moduleSpecifier: moduleSpecifierFrom(config.appEntry, loggerPath),
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
});
|
|
295
|
+
replaceConsoleWithLogger(project, app, loggerPath);
|
|
296
|
+
},
|
|
297
|
+
},
|
|
296
298
|
};
|
|
297
299
|
|
|
298
300
|
export const PLUGIN_KEYS = Object.keys(PLUGINS);
|