@ashtuka/react-lib 1.0.10 → 1.0.11
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 +2 -3
- package/scripts/postinstall.js +0 -44
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ashtuka/react-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"main": "./dist/react-lib.umd.js",
|
|
5
5
|
"module": "./dist/react-lib.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
-
"dist"
|
|
16
|
-
"scripts"
|
|
15
|
+
"dist"
|
|
17
16
|
],
|
|
18
17
|
"publishConfig": {
|
|
19
18
|
"access": "public"
|
package/scripts/postinstall.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
2
|
-
console.log("✅ @ashtuka/react-lib: postinstall script executed");
|
|
3
|
-
(async () => {
|
|
4
|
-
try {
|
|
5
|
-
const fs = require('fs');
|
|
6
|
-
const path = require('path');
|
|
7
|
-
console.log('call - test');
|
|
8
|
-
|
|
9
|
-
// Шлях до package.json користувацького проєкту
|
|
10
|
-
const projectPkgPath = path.resolve(process.cwd(), 'package.json');
|
|
11
|
-
if (!fs.existsSync(projectPkgPath)) {
|
|
12
|
-
console.warn('[peer-deps-check] Не знайдено package.json у проєкті');
|
|
13
|
-
process.exit(0);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const pkg = JSON.parse(fs.readFileSync(projectPkgPath, 'utf8'));
|
|
17
|
-
|
|
18
|
-
// peerDependencies твоєї бібліотеки
|
|
19
|
-
const libPkg = require(path.resolve(__dirname, '../package.json'));
|
|
20
|
-
const peers = libPkg.peerDependencies || {};
|
|
21
|
-
|
|
22
|
-
const missing = Object.keys(peers).filter(
|
|
23
|
-
dep => !(
|
|
24
|
-
(pkg.dependencies && pkg.dependencies[dep]) ||
|
|
25
|
-
(pkg.devDependencies && pkg.devDependencies[dep])
|
|
26
|
-
)
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
if (missing.length > 0) {
|
|
30
|
-
console.error(
|
|
31
|
-
`\n[peer-deps-check] ❌ Відсутні необхідні залежності:\n - ${missing.join('\n - ')}`
|
|
32
|
-
);
|
|
33
|
-
console.error('Встанови їх командою:');
|
|
34
|
-
console.error(`npm install ${missing.map(dep => `${dep}@${peers[dep]}`).join(' ')}`);
|
|
35
|
-
process.exit(1);
|
|
36
|
-
} else {
|
|
37
|
-
console.log('[peer-deps-check] ✅ Всі необхідні залежності встановлені');
|
|
38
|
-
}
|
|
39
|
-
} catch (err) {
|
|
40
|
-
console.error('[peer-deps-check] Помилка виконання:', err);
|
|
41
|
-
process.exit(1);
|
|
42
|
-
}
|
|
43
|
-
})();
|
|
44
|
-
|