@cosider.construction/eapp-maker 1.0.2 → 1.0.4

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +9 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosider.construction/eapp-maker",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Scaffold a new Electron + Vue ERP project",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -9,6 +9,13 @@ import { input, select, confirm, password } from '@inquirer/prompts';
9
9
  const __myDir = path.dirname(fileURLToPath(import.meta.url));
10
10
  const stubsBase = path.join(__myDir, 'stubs');
11
11
 
12
+ // Read eapp version so generated package.json always pins the correct version
13
+ let _eappVersion = '*';
14
+ try {
15
+ const _eappPkg = JSON.parse(await fs.readFile(path.resolve(__myDir, '../../eapp/package.json'), 'utf8').catch(() => '{}'));
16
+ if (_eappPkg.version) _eappVersion = _eappPkg.version;
17
+ } catch { /* ignore */ }
18
+
12
19
  const HELP = `
13
20
  ${chalk.bold.cyan('eapp-maker')} — Scaffold a new Electron + Vue ERP project
14
21
 
@@ -458,7 +465,7 @@ const pkgJson = (name, dbType, tailwind, eappVersion) => {
458
465
  return JSON.stringify({
459
466
  name, version: '0.1.0', private: true, type: 'module',
460
467
  main: 'src/backend/main.js',
461
- scripts: { dev: 'electron-vite dev', build: 'electron-vite build', eapp: 'eapp' },
468
+ scripts: { dev: 'electron-vite dev', build: 'electron-vite build', eapp: 'eapp', setup: 'npm install && npm link @cosider.construction/eapp' },
462
469
  dependencies: deps, devDependencies: devDeps,
463
470
  }, null, 2);
464
471
  };
@@ -565,7 +572,7 @@ async function main() {
565
572
  console.log('');
566
573
 
567
574
  // ── Write everything ───────────────────────────────────────────────────────
568
- await write(p('package.json'), pkgJson(appName, dbType, tailwind, '1.0.0'));
575
+ await write(p('package.json'), pkgJson(appName, dbType, tailwind, _eappVersion));
569
576
  await write(p('electron-vite.config.js'), viteConfig(tailwind));
570
577
  await write(p('.gitignore'), `node_modules/\ndist/\nout/\n.env\n`);
571
578
  await write(p('db.config.json'), JSON.stringify({ mode: dbMode, connections }, null, 2));