sg-frontend-starter 1.0.17 → 1.0.18

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/postinstall.js +21 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sg-frontend-starter",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
package/postinstall.js CHANGED
@@ -59,16 +59,27 @@ if (fs.existsSync(source)) {
59
59
  console.log('✓ sg-frontend-starter tartalma sikeresen áthelyezve');
60
60
  }
61
61
 
62
- // Cseréljük le a package.json-t a package.json.dev tartalmával
63
- if (fs.existsSync(devPackageJson)) {
64
- try {
65
- fs.copyFileSync(devPackageJson, targetPackageJson);
66
- fs.unlinkSync(devPackageJson); // Töröljük a .dev fájlt
67
- console.log('package.json frissítve a template verzióval');
68
- } catch (error) {
69
- console.error('Hiba a package.json cseréje során:', error);
70
- }
71
- }
62
+ // Hozzunk létre egy setup.js fájlt a telepítés befejezéséhez
63
+ const setupScript = `import fs from 'fs';
64
+ import { execSync } from 'child_process';
65
+
66
+ console.log('📦 Package.json frissítése...');
67
+ fs.copyFileSync('package.json.dev', 'package.json');
68
+ fs.unlinkSync('package.json.dev');
69
+
70
+ console.log('📦 Függőségek telepítése...');
71
+ execSync('npm install', { stdio: 'inherit' });
72
+
73
+ console.log('🚀 Alkalmazás indítása...');
74
+ execSync('npm run dev', { stdio: 'inherit' });
75
+ `;
76
+
77
+ fs.writeFileSync(path.join(projectRoot, 'setup.js'), setupScript);
78
+ console.log('');
79
+ console.log('✓ Telepítés kész!');
80
+ console.log('');
81
+ console.log('⚡ A telepítés befejezéséhez futtasd: node setup.js');
82
+ console.log('');
72
83
 
73
84
  // Segédfunkció a mappák rekurzív másolásához
74
85
  function copyDir(src, dest) {