sg-frontend-starter 1.0.15 → 1.0.17
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/postinstall.js +21 -2
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -14,10 +14,18 @@ const targetPackageJson = path.join(projectRoot, 'package.json');
|
|
|
14
14
|
const sourcePackageJson = path.join(source, 'package.json');
|
|
15
15
|
const devPackageJson = path.join(projectRoot, 'package.json.dev');
|
|
16
16
|
|
|
17
|
-
// Az eredeti package.json tartalmát másoljuk package.json.dev néven
|
|
17
|
+
// Az eredeti package.json tartalmát másoljuk package.json.dev néven, de postinstall script nélkül
|
|
18
18
|
if (fs.existsSync(sourcePackageJson)) {
|
|
19
19
|
try {
|
|
20
|
-
fs.
|
|
20
|
+
const raw = fs.readFileSync(sourcePackageJson, 'utf8');
|
|
21
|
+
const pkg = JSON.parse(raw);
|
|
22
|
+
|
|
23
|
+
// Eltávolítjuk a postinstall scriptet
|
|
24
|
+
if (pkg.scripts && pkg.scripts.postinstall) {
|
|
25
|
+
delete pkg.scripts.postinstall;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
fs.writeFileSync(devPackageJson, JSON.stringify(pkg, null, 2) + '\n');
|
|
21
29
|
console.log('✓ package.json.dev létrehozva');
|
|
22
30
|
} catch (error) {
|
|
23
31
|
console.error('Hiba a package.json.dev létrehozása során:', error);
|
|
@@ -51,6 +59,17 @@ if (fs.existsSync(source)) {
|
|
|
51
59
|
console.log('✓ sg-frontend-starter tartalma sikeresen áthelyezve');
|
|
52
60
|
}
|
|
53
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
|
+
}
|
|
72
|
+
|
|
54
73
|
// Segédfunkció a mappák rekurzív másolásához
|
|
55
74
|
function copyDir(src, dest) {
|
|
56
75
|
fs.mkdirSync(dest, { recursive: true });
|