@ashtuka/react-lib 1.0.6 → 1.0.7
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 +3 -2
- package/scripts/postinstall.js +42 -0
- package/dist/scripts/check-peer-deps.d.ts +0 -1
- package/dist/scripts/check-peer-deps.js +0 -21
- package/dist/scripts/postinstall.d.ts +0 -1
- package/dist/scripts/postinstall.js +0 -2
- package/dist/src/constans/breakpoints.js +0 -5
- package/dist/src/constans/index.js +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/modules/PageLoaderModule/PageLoaderModule.js +0 -23
- package/dist/src/modules/PageLoaderModule/index.js +0 -1
- package/dist/src/types/Locale.js +0 -5
- package/dist/src/types/index.js +0 -1
- /package/dist/{src/constans → constans}/breakpoints.d.ts +0 -0
- /package/dist/{src/constans → constans}/index.d.ts +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/modules → modules}/PageLoaderModule/PageLoaderModule.d.ts +0 -0
- /package/dist/{src/modules → modules}/PageLoaderModule/index.d.ts +0 -0
- /package/dist/{src/types → types}/Locale.d.ts +0 -0
- /package/dist/{src/types → types}/index.d.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ashtuka/react-lib",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"main": "./dist/react-lib.umd.js",
|
|
5
5
|
"module": "./dist/react-lib.mjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
-
"dist"
|
|
15
|
+
"dist",
|
|
16
|
+
"scripts/postinstall.js"
|
|
16
17
|
],
|
|
17
18
|
"publishConfig": {
|
|
18
19
|
"access": "public"
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
2
|
+
(async () => {
|
|
3
|
+
try {
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
|
|
7
|
+
// Шлях до package.json користувацького проєкту
|
|
8
|
+
const projectPkgPath = path.resolve(process.cwd(), 'package.json');
|
|
9
|
+
if (!fs.existsSync(projectPkgPath)) {
|
|
10
|
+
console.warn('[peer-deps-check] Не знайдено package.json у проєкті');
|
|
11
|
+
process.exit(0);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const pkg = JSON.parse(fs.readFileSync(projectPkgPath, 'utf8'));
|
|
15
|
+
|
|
16
|
+
// peerDependencies твоєї бібліотеки
|
|
17
|
+
const libPkg = require(path.resolve(__dirname, '../package.json'));
|
|
18
|
+
const peers = libPkg.peerDependencies || {};
|
|
19
|
+
|
|
20
|
+
const missing = Object.keys(peers).filter(
|
|
21
|
+
dep => !(
|
|
22
|
+
(pkg.dependencies && pkg.dependencies[dep]) ||
|
|
23
|
+
(pkg.devDependencies && pkg.devDependencies[dep])
|
|
24
|
+
)
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
if (missing.length > 0) {
|
|
28
|
+
console.error(
|
|
29
|
+
`\n[peer-deps-check] ❌ Відсутні необхідні залежності:\n - ${missing.join('\n - ')}`
|
|
30
|
+
);
|
|
31
|
+
console.error('Встанови їх командою:');
|
|
32
|
+
console.error(`npm install ${missing.map(dep => `${dep}@${peers[dep]}`).join(' ')}`);
|
|
33
|
+
process.exit(1);
|
|
34
|
+
} else {
|
|
35
|
+
console.log('[peer-deps-check] ✅ Всі необхідні залежності встановлені');
|
|
36
|
+
}
|
|
37
|
+
} catch (err) {
|
|
38
|
+
console.error('[peer-deps-check] Помилка виконання:', err);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
})();
|
|
42
|
+
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function checkPeerDependencies(): Promise<void>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from 'fs';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import { pathToFileURL } from 'url';
|
|
4
|
-
export async function checkPeerDependencies() {
|
|
5
|
-
const pkgJsonPath = join(__dirname, '..', 'package.json');
|
|
6
|
-
const pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'));
|
|
7
|
-
const peerDependencies = pkg.peerDependencies;
|
|
8
|
-
for (const dep of Object.keys(peerDependencies)) {
|
|
9
|
-
try {
|
|
10
|
-
const pkgPath = require.resolve(`${dep}/package.json`);
|
|
11
|
-
const { version: installedVersion } = await import(pathToFileURL(pkgPath).href);
|
|
12
|
-
const requiredVersion = peerDependencies[dep];
|
|
13
|
-
if (installedVersion !== requiredVersion) {
|
|
14
|
-
console.warn(`⚠️ ${dep}: expected ${requiredVersion}, but found ${installedVersion}`);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
catch (err) {
|
|
18
|
-
console.error(`❌ Missing peer dependency: ${dep}`, err);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './breakpoints';
|
package/dist/src/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { PageLoaderModule } from './modules/PageLoaderModule';
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import cn from 'classnames';
|
|
3
|
-
import LocalizedStrings from 'react-localization';
|
|
4
|
-
import { Locale } from '@/types';
|
|
5
|
-
import styles from './PageLoaderModule.module.scss';
|
|
6
|
-
const strings = new LocalizedStrings({
|
|
7
|
-
uk: {
|
|
8
|
-
sloganRow1: 'Класний пошукатор',
|
|
9
|
-
sloganRow2: 'страхових',
|
|
10
|
-
},
|
|
11
|
-
ru: {
|
|
12
|
-
sloganRow1: 'Классный пошукатор',
|
|
13
|
-
sloganRow2: 'страховых',
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
export const PageLoaderModule = ({ classes = '', isFullScreen, locale = Locale.UK, title, titleClasses = '', }) => {
|
|
17
|
-
strings.setLanguage(locale);
|
|
18
|
-
const containerClass = cn(styles.container, classes, {
|
|
19
|
-
[styles.fullScreen]: isFullScreen,
|
|
20
|
-
});
|
|
21
|
-
const titleClass = cn(styles.title, titleClasses);
|
|
22
|
-
return (_jsxs("div", { className: containerClass, children: [_jsxs("div", { className: styles.loaderContainer, children: [_jsxs("div", { className: styles.inner, children: [_jsx("div", { className: styles.item, children: "\u00A0" }), _jsx("div", { className: styles.item, children: "\u00A0" }), _jsx("div", { className: styles.item, children: "\u00A0" })] }), _jsx("div", { className: styles.logo, children: _jsx("img", { width: "148px", height: "40px", src: "https://polis.ua/static/img/logo/logoWithFlagLine.svg", alt: "Icon" }) }), _jsxs("div", { className: styles.sloganWrap, children: [_jsx("span", { className: styles.slogan, children: strings.sloganRow1 }), _jsx("span", { className: styles.slogan, children: strings.sloganRow2 })] })] }), title && _jsx("div", { className: titleClass, children: title })] }));
|
|
23
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { PageLoaderModule } from './PageLoaderModule';
|
package/dist/src/types/Locale.js
DELETED
package/dist/src/types/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Locale';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|