adminforth 1.10.0-next.1 → 1.10.0-next.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.
@@ -8,15 +8,17 @@
8
8
  "license": "ISC",
9
9
  "description": "",
10
10
  "scripts": {
11
- "start": "tsx watch --env-file=.env index.ts",
12
- "migrate": "npx prisma migrate deploy",
13
- "makemigration": "npx --yes prisma migrate deploy; npx --yes prisma migrate dev",
11
+ "env": "dotenvx run -f .env.local -f .env --overload --",
12
+ "start": "npm run env -- tsx watch index.ts",
13
+ "migrateLocal": "npm run env -- npx prisma migrate deploy",
14
+ "makemigration": "npm run migrateLocal; npm run env -- npx --yes prisma migrate dev",
14
15
  "test": "echo \"Error: no test specified\" && exit 1"
15
16
  },
16
17
  "engines": {
17
18
  "node": ">=20"
18
19
  },
19
20
  "dependencies": {
21
+ "@dotenvx/dotenvx": "^1.34.0",
20
22
  "adminforth": "latest",
21
23
  "express": "latest"
22
24
  },
@@ -182,15 +182,16 @@ async function writeTemplateFiles(dirname, cwd, options) {
182
182
  data: {},
183
183
  },
184
184
  {
185
- src: '.env.sample.hbs',
186
- dest: '.env.sample',
185
+ src: '.env.local.hbs',
186
+ dest: '.env.local',
187
187
  data: { dbUrl, prismaDbUrl },
188
188
  },
189
189
  {
190
190
  // We'll write .env using the same content as .env.sample
191
- src: '.env.sample.hbs',
191
+ src: '.env.local.hbs',
192
192
  dest: '.env',
193
- data: { dbUrl, prismaDbUrl },
193
+ data: {},
194
+ empty: true,
194
195
  },
195
196
  {
196
197
  src: 'adminuser.ts.hbs',
@@ -213,12 +214,16 @@ async function writeTemplateFiles(dirname, cwd, options) {
213
214
  // If a condition is specified and false, skip this file
214
215
  if (task.condition === false) continue;
215
216
 
216
- const templatePath = path.join(dirname, 'templates', task.src);
217
- const compiled = renderHBSTemplate(templatePath, task.data);
218
217
  const destPath = path.join(cwd, task.dest);
219
- // Ensure parent directory exists
220
218
  // fse.ensureDirSync(path.dirname(destPath));
221
- fs.writeFileSync(destPath, compiled);
219
+
220
+ if (task.empty) {
221
+ fs.writeFileSync(destPath, '');
222
+ } else {
223
+ const templatePath = path.join(dirname, 'templates', task.src);
224
+ const compiled = renderHBSTemplate(templatePath, task.data);
225
+ fs.writeFileSync(destPath, compiled);
226
+ }
222
227
  }
223
228
  }
224
229
 
@@ -235,11 +240,11 @@ function generateFinalInstructions(skipPrismaSetup) {
235
240
  let instruction = '⏭️ Run the following commands to get started:\n';
236
241
  if (!skipPrismaSetup)
237
242
  instruction += `
238
- ${chalk.dim('// runs "npx prisma migrate dev --name init" to generate and apply initial migration')};
243
+ ${chalk.dim('// Generate and apply initial migration')}
239
244
  ${chalk.cyan('$ npm run makemigration -- --name init')}\n`;
240
245
 
241
246
  instruction += `
242
- ${chalk.dim('// Starts dev server with tsx watch for hot-reloading')}
247
+ ${chalk.dim('// Start dev server with tsx watch for hot-reloading')}
243
248
  ${chalk.cyan('$ npm start')}\n
244
249
  `;
245
250
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.10.0-next.1",
3
+ "version": "1.10.0-next.2",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",