@ashtuka/react-lib 1.0.6 → 1.0.8

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ashtuka/react-lib",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
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"
16
17
  ],
17
18
  "publishConfig": {
18
19
  "access": "public"
@@ -23,7 +24,7 @@
23
24
  "lint": "eslint . --ext .ts,.tsx --fix",
24
25
  "format": "prettier --write .",
25
26
  "release": "npm version patch && npm publish --access public",
26
- "postinstall": "node dist/scripts/postinstall.js"
27
+ "postinstall": "node scripts/postinstall.js"
27
28
  },
28
29
  "peerDependencies": {
29
30
  "react": "^19.1.1",
@@ -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,2 +0,0 @@
1
- import { checkPeerDependencies } from './check-peer-deps';
2
- checkPeerDependencies();
@@ -1,5 +0,0 @@
1
- export const BREAKPOINT_SM = 576;
2
- export const BREAKPOINT_MD = 768;
3
- export const BREAKPOINT_LG = 992;
4
- export const BREAKPOINT_XL = 1200;
5
- export const BREAKPOINT_2XL = 1400;
@@ -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';
@@ -1,5 +0,0 @@
1
- export var Locale;
2
- (function (Locale) {
3
- Locale["UK"] = "uk";
4
- Locale["RU"] = "ru";
5
- })(Locale || (Locale = {}));
@@ -1 +0,0 @@
1
- export * from './Locale';
File without changes
File without changes
File without changes
File without changes