@cocreate/utils 1.41.0 → 1.41.1
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/.github/workflows/automated.yml +5 -5
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/index.js +40 -0
|
@@ -22,13 +22,13 @@ jobs:
|
|
|
22
22
|
runs-on: ubuntu-latest
|
|
23
23
|
steps:
|
|
24
24
|
- name: Checkout
|
|
25
|
-
uses: actions/checkout@
|
|
25
|
+
uses: actions/checkout@v4
|
|
26
26
|
- name: Setup Node.js
|
|
27
|
-
uses: actions/setup-node@
|
|
27
|
+
uses: actions/setup-node@v4
|
|
28
28
|
with:
|
|
29
|
-
node-version:
|
|
29
|
+
node-version: 22 # Required for the latest semantic-release plugins
|
|
30
30
|
- name: Semantic Release
|
|
31
|
-
uses: cycjimmy/semantic-release-action@
|
|
31
|
+
uses: cycjimmy/semantic-release-action@v4 # Update to v4 for better Node 20+ support
|
|
32
32
|
id: semantic
|
|
33
33
|
with:
|
|
34
34
|
extra_plugins: |
|
|
@@ -36,7 +36,7 @@ jobs:
|
|
|
36
36
|
@semantic-release/git
|
|
37
37
|
@semantic-release/github
|
|
38
38
|
env:
|
|
39
|
-
GITHUB_TOKEN: "${{ secrets.
|
|
39
|
+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" # Use the built-in token if possible
|
|
40
40
|
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
|
|
41
41
|
outputs:
|
|
42
42
|
new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.41.1](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.41.0...v1.41.1) (2026-02-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update worklow ([5a12bfc](https://github.com/CoCreate-app/CoCreate-utils/commit/5a12bfc15a3be0161592ad041293b876dd92d186))
|
|
7
|
+
|
|
1
8
|
# [1.41.0](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.40.1...v1.41.0) (2025-11-16)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -67,6 +67,46 @@
|
|
|
67
67
|
return depth > 0 ? "../".repeat(depth) : "./";
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
// function getRelativePath(path) {
|
|
71
|
+
// const isBrowser = typeof window !== 'undefined';
|
|
72
|
+
|
|
73
|
+
// // If no path provided, use window.location.pathname
|
|
74
|
+
// if (!path && isBrowser) {
|
|
75
|
+
// path = window.location.pathname;
|
|
76
|
+
|
|
77
|
+
// // FIX: Only remove the end segment if it looks like a file (has an extension like .html)
|
|
78
|
+
// // This prevents stripping valid routes like /dashboard
|
|
79
|
+
// if (/\.[^/]+$/.test(path)) {
|
|
80
|
+
// path = path.replace(/\/[^\/]*$/, "");
|
|
81
|
+
// }
|
|
82
|
+
// }
|
|
83
|
+
|
|
84
|
+
// // For localhost/127.0.0.1, remove everything up to and including the first '/src'
|
|
85
|
+
// if (
|
|
86
|
+
// isBrowser &&
|
|
87
|
+
// (window.location.hostname === "localhost" ||
|
|
88
|
+
// window.location.hostname === "127.0.0.1")
|
|
89
|
+
// ) {
|
|
90
|
+
// const srcIndex = path.indexOf("/src");
|
|
91
|
+
// if (srcIndex !== -1) {
|
|
92
|
+
// // If path is "/BeautySalon/src", this returns ""
|
|
93
|
+
// path = path.slice(srcIndex + 4);
|
|
94
|
+
// }
|
|
95
|
+
// }
|
|
96
|
+
|
|
97
|
+
// // Handle the empty string case here:
|
|
98
|
+
// // "" does not end with "/", so it adds one -> "/"
|
|
99
|
+
// if (!path || !path.endsWith("/")) {
|
|
100
|
+
// path = (path || "") + "/";
|
|
101
|
+
// }
|
|
102
|
+
|
|
103
|
+
// // "/" splits to ['', ''], filter removes them -> length is 0
|
|
104
|
+
// let depth = path.split("/").filter(Boolean).length;
|
|
105
|
+
|
|
106
|
+
// // 0 depth returns "./"
|
|
107
|
+
// return depth > 0 ? "../".repeat(depth) : "./";
|
|
108
|
+
// }
|
|
109
|
+
|
|
70
110
|
/**
|
|
71
111
|
* Generates an ObjectId
|
|
72
112
|
*/
|