@banch0u/core-project-test-repository 1.1.0 → 1.2.2

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/README.md ADDED
@@ -0,0 +1,91 @@
1
+ # 📦 @banch0u/core-project-test-repository – Development & Deployment Guide
2
+
3
+ ## ✨ Live Development Setup
4
+
5
+ To develop and test changes in the core package **live** within another project (e.g., `docflow, hr, contract, account and etc.`):
6
+
7
+ ---
8
+
9
+ ### 💠 Step 1: Start the Core Package in Watch Mode
10
+
11
+ This will watch your `src/` directory for changes, rebuild the `dist/` folder, and automatically push updates to `.yalc`.
12
+
13
+ ```bash
14
+ npm run dev
15
+ ```
16
+
17
+ ---
18
+
19
+ ### 💠 Step 2: In Your Main Project (Consumer App)
20
+
21
+ #### ✅ a. Add the Core Package via Yalc
22
+
23
+ ```bash
24
+ yalc add @banch0u/core-project-test-repository
25
+ ```
26
+
27
+ This will copy the current `dist/` into your project’s `.yalc` folder and update your `package.json`.
28
+
29
+ #### 🔗 b. Link the Core Package
30
+
31
+ ```bash
32
+ yalc link @banch0u/core-project-test-repository
33
+ ```
34
+
35
+ This creates a symlink to the core package. Now, all changes from the `npm run dev` watcher will reflect in your main app automatically when running the dev server (`npm start`).
36
+
37
+ ---
38
+
39
+ ### ⚠️ Important Notes
40
+
41
+ - Your `package.json` will temporarily contain this line:
42
+
43
+ ```json
44
+ "@banch0u/core-project-test-repository": "file:.yalc/@banch0u/core-project-test-repository"
45
+ ```
46
+
47
+ - **This file path will break production builds or CI/CD pipelines.**
48
+
49
+ #### ✅ Before Deploying or Committing:
50
+
51
+ Replace the local Yalc reference with the actual npm package:
52
+
53
+ ```bash
54
+ npm install @banch0u/core-project-test-repository@latest
55
+ ```
56
+
57
+ ---
58
+
59
+ ## 📦 Publishing to NPM
60
+
61
+ ### 1. Build the Package
62
+
63
+ ```bash
64
+ npm run build
65
+ ```
66
+
67
+ This will transpile your `src/` folder into the `dist/` folder.
68
+
69
+ ### 2. Bump Version
70
+
71
+ Use `npm version` to update the package version according to the type of change:
72
+
73
+ - **Patch** (small fix): `npm version patch` → `1.0.0 → 1.0.1`
74
+ - **Minor** (new feature, backward compatible): `npm version minor` → `1.0.0 → 1.1.0`
75
+ - **Major** (breaking changes): `npm version major` → `1.0.0 → 2.0.0`
76
+
77
+ ### 3. Publish to NPM
78
+
79
+ ```bash
80
+ npm publish
81
+ ```
82
+
83
+ Your changes will now be available on the npm registry. Consumers can install the latest version via:
84
+
85
+ ```bash
86
+ npm install @banch0u/core-project-test-repository@latest
87
+ ```
88
+
89
+ ---
90
+
91
+ Happy coding 💻🚀
@@ -50,9 +50,41 @@ var succesMessage = exports.succesMessage = function succesMessage(value) {
50
50
  };
51
51
  var infoMessageBottomRight = exports.infoMessageBottomRight = function infoMessageBottomRight(value) {
52
52
  playNotificationSound();
53
+ var projects = ["", "Sənəd dövriyyəsi", "Kadrlar sistemi", "Müqavilələr", "Şəxsi kabinet"];
54
+ var parsedValue;
55
+ try {
56
+ parsedValue = JSON.parse(value);
57
+ } catch (e) {
58
+ console.error('Failed to parse notification value:', e);
59
+ parsedValue = {
60
+ Text: value || "Bildiriş"
61
+ };
62
+ }
63
+ var handleClick = function handleClick() {
64
+ switch (parsedValue.Project) {
65
+ case 1:
66
+ window.location = "".concat(window.location.origin, "/docflow/document-circulation/unread-docs");
67
+ break;
68
+ case 2:
69
+ window.location = "".concat(window.location.origin, "/hr/hr");
70
+ break;
71
+ case 3:
72
+ window.location = "".concat(window.location.origin, "/contracts/unread-contract");
73
+ break;
74
+ case 4:
75
+ window.location = "".concat(window.location.origin, "/accounts/private");
76
+ break;
77
+ default:
78
+ break;
79
+ }
80
+ };
53
81
  return _antd.notification.info({
54
- message: "Yeni bildiriş",
55
- description: value || "Bildiriş",
56
- placement: "bottomRight"
82
+ message: projects[parsedValue.Project],
83
+ description: parsedValue.Text || "Bildiriş",
84
+ placement: "bottomRight",
85
+ onClick: handleClick,
86
+ style: {
87
+ cursor: "pointer"
88
+ }
57
89
  });
58
90
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banch0u/core-project-test-repository",
3
- "version": "1.1.0",
3
+ "version": "1.2.2",
4
4
  "description": "Shared core features for all projects",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -14,15 +14,19 @@
14
14
  "author": "banch0u",
15
15
  "license": "MIT",
16
16
  "scripts": {
17
- "build": "babel src --out-dir dist --copy-files"
17
+ "build": "babel src --out-dir dist --copy-files",
18
+ "watch": "chokidar \"src\" -i 'dist' -c \"npm run build && yalc push --force\"",
19
+ "dev": "npm run watch"
18
20
  },
19
21
  "dependencies": {
20
22
  "@microsoft/signalr": "^8.0.7",
21
23
  "@pdftron/webviewer": "^11.2.0",
22
- "antd": "^5.16.0",
23
- "react": "^18.2.0",
24
- "react-dom": "^18.2.0",
25
- "react-router-dom": "^6.16.0"
24
+ "antd": "^5.16.0"
25
+ },
26
+ "peerDependencies": {
27
+ "react": "^18.0.0 || ^19.0.0",
28
+ "react-dom": "^18.0.0 || ^19.0.0",
29
+ "react-router-dom": "^6.0.0"
26
30
  },
27
31
  "devDependencies": {
28
32
  "@babel/cli": "^7.26.4",
@@ -30,6 +34,8 @@
30
34
  "@babel/plugin-transform-runtime": "^7.26.9",
31
35
  "@babel/preset-env": "^7.26.9",
32
36
  "@babel/preset-react": "^7.26.3",
33
- "babel-loader": "^9.2.1"
37
+ "babel-loader": "^9.2.1",
38
+ "chokidar-cli": "^3.0.0",
39
+ "npm-run-all": "^4.1.5"
34
40
  }
35
41
  }