adminforth 2.54.0-next.1 → 2.54.0-next.3
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/commands/createApp/templates/.agents/skills/adminforth-custom-vue/SKILL.md.hbs +3 -3
- package/commands/createApp/templates/package.json.hbs +2 -0
- package/commands/createApp/utils.js +40 -18
- package/commands/createCustomComponent/templates/customCrud/bottom.vue.hbs +1 -1
- package/package.json +1 -1
|
@@ -134,7 +134,7 @@ show: {
|
|
|
134
134
|
/>
|
|
135
135
|
|
|
136
136
|
<p v-if="errorMessage" class="text-sm text-red-600">
|
|
137
|
-
{{ errorMessage }}
|
|
137
|
+
\{{ errorMessage }}
|
|
138
138
|
</p>
|
|
139
139
|
|
|
140
140
|
<p v-else-if="isEmpty" class="text-sm text-amber-600">
|
|
@@ -227,9 +227,9 @@ function syncState() {
|
|
|
227
227
|
<template>
|
|
228
228
|
<div class="flex items-center gap-2">
|
|
229
229
|
<span>
|
|
230
|
-
{{ meta?.filler?.repeat(record.number_of_rooms || 0) }}
|
|
230
|
+
\{{ meta?.filler?.repeat(record.number_of_rooms || 0) }}
|
|
231
231
|
</span>
|
|
232
|
-
<span
|
|
232
|
+
<span>\{{ record.number_of_rooms }} \{{ meta?.suffix }}</span>
|
|
233
233
|
</div>
|
|
234
234
|
</template>
|
|
235
235
|
|
|
@@ -11,9 +11,11 @@
|
|
|
11
11
|
"dev": "{{packageManagerEnvDev}} tsx watch index.ts",
|
|
12
12
|
"prod": "{{packageManagerEnvProd}} tsx index.ts",
|
|
13
13
|
"start": "{{packageManagerRun}} dev",
|
|
14
|
+
{{#if includePrismaMigrations}}
|
|
14
15
|
"makemigration": "{{packageManagerEnvDev}} npx --yes prisma migrate dev --create-only",
|
|
15
16
|
"migrate:local": "{{packageManagerEnvDev}} npx --yes prisma migrate deploy",
|
|
16
17
|
"migrate:prod": "{{packageManagerEnvProd}} npx --yes prisma migrate deploy",
|
|
18
|
+
{{/if}}
|
|
17
19
|
"_env:dev": "dotenvx run -f .env -f .env.local --",
|
|
18
20
|
"_env:prod": "dotenvx run -f .env.prod --"
|
|
19
21
|
},
|
|
@@ -56,6 +56,7 @@ export function parseArgumentsIntoOptions(rawArgs) {
|
|
|
56
56
|
appName: args['--app-name'],
|
|
57
57
|
db: args['--db'],
|
|
58
58
|
useNpm: args['--use-npm'],
|
|
59
|
+
includePrismaMigrations: args['--include-prisma-migrations'],
|
|
59
60
|
};
|
|
60
61
|
}
|
|
61
62
|
|
|
@@ -93,12 +94,27 @@ export async function promptForMissingOptions(options) {
|
|
|
93
94
|
});
|
|
94
95
|
}
|
|
95
96
|
|
|
97
|
+
if (!options.includePrismaMigrations) {
|
|
98
|
+
questions.push({
|
|
99
|
+
type: 'select',
|
|
100
|
+
name: 'includePrismaMigrations',
|
|
101
|
+
message: 'Include Prisma migrations? >',
|
|
102
|
+
choices: [
|
|
103
|
+
{ name: 'Yes', value: true },
|
|
104
|
+
{ name: 'No', value: false },
|
|
105
|
+
],
|
|
106
|
+
default: true,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
}
|
|
110
|
+
|
|
96
111
|
const answers = await inquirer.prompt(questions);
|
|
97
112
|
return {
|
|
98
113
|
...options,
|
|
99
114
|
appName: options.appName || answers.appName,
|
|
100
115
|
db: options.db || answers.db,
|
|
101
116
|
useNpm: options.useNpm || answers.useNpm,
|
|
117
|
+
includePrismaMigrations: options.includePrismaMigrations || answers.includePrismaMigrations,
|
|
102
118
|
};
|
|
103
119
|
}
|
|
104
120
|
|
|
@@ -246,7 +262,7 @@ async function scaffoldProject(ctx, options, cwd) {
|
|
|
246
262
|
await fse.copy(sourceAssetsDir, targetAssetsDir);
|
|
247
263
|
|
|
248
264
|
// Write templated files
|
|
249
|
-
await writeTemplateFiles(dirname, projectDir, options.useNpm, {
|
|
265
|
+
await writeTemplateFiles(dirname, projectDir, options.useNpm, options.includePrismaMigrations, {
|
|
250
266
|
dbUrl: connectionString.toString(),
|
|
251
267
|
dbUrlProd: connectionStringProd,
|
|
252
268
|
prismaDbUrl,
|
|
@@ -274,7 +290,7 @@ function getPackageManagerTemplateData(useNpm, nodeMajor) {
|
|
|
274
290
|
};
|
|
275
291
|
}
|
|
276
292
|
|
|
277
|
-
async function writeTemplateFiles(dirname, cwd, useNpm, options) {
|
|
293
|
+
async function writeTemplateFiles(dirname, cwd, useNpm, includePrismaMigrations, options) {
|
|
278
294
|
const {
|
|
279
295
|
dbUrl, prismaDbUrl, appName, provider, nodeMajor,
|
|
280
296
|
dbUrlProd, prismaDbUrlProd, sqliteFile
|
|
@@ -288,17 +304,6 @@ async function writeTemplateFiles(dirname, cwd, useNpm, options) {
|
|
|
288
304
|
dest: 'tsconfig.json',
|
|
289
305
|
data: {},
|
|
290
306
|
},
|
|
291
|
-
{
|
|
292
|
-
src: 'schema.prisma.hbs',
|
|
293
|
-
dest: 'schema.prisma',
|
|
294
|
-
data: { provider },
|
|
295
|
-
condition: Boolean(prismaDbUrl), // only create if prismaDbUrl is truthy
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
src: 'prisma.config.ts.hbs',
|
|
299
|
-
dest: 'prisma.config.ts',
|
|
300
|
-
data: {},
|
|
301
|
-
},
|
|
302
307
|
{
|
|
303
308
|
src: 'index.ts.hbs',
|
|
304
309
|
dest: 'index.ts',
|
|
@@ -354,11 +359,11 @@ async function writeTemplateFiles(dirname, cwd, useNpm, options) {
|
|
|
354
359
|
dest: '.agents/skills/adminforth-hooks/SKILL.md',
|
|
355
360
|
data: {},
|
|
356
361
|
},
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
+
{
|
|
363
|
+
src: '.agents/skills/adminforth-custom-vue/SKILL.md.hbs',
|
|
364
|
+
dest: '.agents/skills/adminforth-custom-vue/SKILL.md',
|
|
365
|
+
data: {},
|
|
366
|
+
},
|
|
362
367
|
{
|
|
363
368
|
// We'll write .env using the same content as .env.sample
|
|
364
369
|
src: '.env.local.hbs',
|
|
@@ -393,6 +398,7 @@ async function writeTemplateFiles(dirname, cwd, useNpm, options) {
|
|
|
393
398
|
data: {
|
|
394
399
|
appName,
|
|
395
400
|
adminforthVersion: adminforthVersion,
|
|
401
|
+
includePrismaMigrations,
|
|
396
402
|
},
|
|
397
403
|
},
|
|
398
404
|
{
|
|
@@ -417,6 +423,22 @@ async function writeTemplateFiles(dirname, cwd, useNpm, options) {
|
|
|
417
423
|
)
|
|
418
424
|
}
|
|
419
425
|
|
|
426
|
+
if (includePrismaMigrations) {
|
|
427
|
+
templateTasks.push(
|
|
428
|
+
{
|
|
429
|
+
src: 'schema.prisma.hbs',
|
|
430
|
+
dest: 'schema.prisma',
|
|
431
|
+
data: { provider },
|
|
432
|
+
condition: Boolean(prismaDbUrl), // only create if prismaDbUrl is truthy
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
src: 'prisma.config.ts.hbs',
|
|
436
|
+
dest: 'prisma.config.ts',
|
|
437
|
+
data: {},
|
|
438
|
+
},
|
|
439
|
+
)
|
|
440
|
+
}
|
|
441
|
+
|
|
420
442
|
for (const task of templateTasks) {
|
|
421
443
|
// If a condition is specified and false, skip this file
|
|
422
444
|
if (task.condition === false) continue;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
@click="handleClick"
|
|
6
6
|
class="text-white bg-blue-600 hover:bg-blue-700 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-500 dark:hover:bg-blue-600 dark:focus:ring-blue-800"
|
|
7
7
|
>
|
|
8
|
-
{{ $t('Example') }}
|
|
8
|
+
\{{ $t('Example') }}
|
|
9
9
|
</button>
|
|
10
10
|
</div>
|
|
11
11
|
</template>
|