create-bcp-app 0.1.13 → 0.1.14
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/index.mjs +38 -0
package/package.json
CHANGED
package/src/index.mjs
CHANGED
|
@@ -129,6 +129,11 @@ export async function createBcpApp(
|
|
|
129
129
|
auth,
|
|
130
130
|
});
|
|
131
131
|
|
|
132
|
+
configureFrameworkDatabaseEntry(
|
|
133
|
+
targetDirectory,
|
|
134
|
+
selectedOptions.database
|
|
135
|
+
);
|
|
136
|
+
|
|
132
137
|
fs.writeFileSync(
|
|
133
138
|
path.join(
|
|
134
139
|
targetDirectory,
|
|
@@ -336,6 +341,39 @@ function copyDirectoryContents(
|
|
|
336
341
|
}
|
|
337
342
|
}
|
|
338
343
|
|
|
344
|
+
function configureFrameworkDatabaseEntry(
|
|
345
|
+
targetDirectory,
|
|
346
|
+
database
|
|
347
|
+
) {
|
|
348
|
+
if (
|
|
349
|
+
database !== "mysql"
|
|
350
|
+
) {
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
const databaseFile =
|
|
355
|
+
path.join(
|
|
356
|
+
targetDirectory,
|
|
357
|
+
"lib",
|
|
358
|
+
"database.ts"
|
|
359
|
+
);
|
|
360
|
+
|
|
361
|
+
fs.mkdirSync(
|
|
362
|
+
path.dirname(
|
|
363
|
+
databaseFile
|
|
364
|
+
),
|
|
365
|
+
{
|
|
366
|
+
recursive: true,
|
|
367
|
+
}
|
|
368
|
+
);
|
|
369
|
+
|
|
370
|
+
fs.writeFileSync(
|
|
371
|
+
databaseFile,
|
|
372
|
+
`export {\n db,\n createDatabase,\n} from "bcp/database";\n`,
|
|
373
|
+
"utf8"
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
|
|
339
377
|
function readPackageMetadata() {
|
|
340
378
|
const packageJson =
|
|
341
379
|
JSON.parse(
|