@cocreate/users 1.39.3 → 1.40.0
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 +23 -10
- package/.github/workflows/manual.yml +1 -2
- package/CHANGELOG.md +28 -0
- package/package.json +40 -18
- package/release.config.js +12 -4
- package/src/client.js +11 -6
- package/src/server.js +595 -459
- package/src/index.js +0 -14
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
name: Automated Workflow
|
|
2
|
+
|
|
2
3
|
on:
|
|
3
4
|
push:
|
|
4
5
|
branches:
|
|
5
6
|
- master
|
|
7
|
+
|
|
6
8
|
jobs:
|
|
7
9
|
about:
|
|
8
10
|
runs-on: ubuntu-latest
|
|
@@ -18,26 +20,37 @@ jobs:
|
|
|
18
20
|
with:
|
|
19
21
|
direction: overwrite-github
|
|
20
22
|
githubToken: "${{ secrets.GITHUB }}"
|
|
23
|
+
|
|
21
24
|
release:
|
|
22
25
|
runs-on: ubuntu-latest
|
|
23
26
|
steps:
|
|
24
27
|
- name: Checkout
|
|
25
28
|
uses: actions/checkout@v4
|
|
29
|
+
with:
|
|
30
|
+
fetch-depth: 0 # Required so semantic-release can trace git tags/history
|
|
31
|
+
|
|
26
32
|
- name: Setup Node.js
|
|
27
33
|
uses: actions/setup-node@v4
|
|
28
34
|
with:
|
|
29
|
-
node-version: 22
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
@semantic-release/changelog
|
|
35
|
+
node-version: 22
|
|
36
|
+
|
|
37
|
+
- name: Install Semantic Release & Plugins
|
|
38
|
+
# Installs semantic-release and its plugins on the runner
|
|
39
|
+
run: |
|
|
40
|
+
npm install -g semantic-release \
|
|
41
|
+
@semantic-release/changelog \
|
|
42
|
+
@semantic-release/npm \
|
|
43
|
+
@semantic-release/github \
|
|
36
44
|
@semantic-release/git
|
|
37
|
-
|
|
45
|
+
|
|
46
|
+
- name: Run Semantic Release (Native)
|
|
47
|
+
id: semantic
|
|
48
|
+
# This will automatically pick up your export default config file in the repository root
|
|
49
|
+
run: npx semantic-release
|
|
38
50
|
env:
|
|
39
|
-
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
51
|
+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
40
52
|
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
|
|
53
|
+
|
|
41
54
|
outputs:
|
|
42
55
|
new_release_published: "${{ steps.semantic.outputs.new_release_published }}"
|
|
43
|
-
new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
|
|
56
|
+
new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
# [1.40.0](https://github.com/CoCreate-app/CoCreate-users/compare/v1.39.5...v1.40.0) (2026-07-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* update automated workflow and release configuration for improved semantic release handling ([1b70088](https://github.com/CoCreate-app/CoCreate-users/commit/1b700884006163d9ad293307932b713978f207e6))
|
|
7
|
+
|
|
8
|
+
## [1.39.5](https://github.com/CoCreate-app/CoCreate-users/compare/v1.39.4...v1.39.5) (2026-07-14)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bump package versions ([5a13416](https://github.com/CoCreate-app/CoCreate-users/commit/5a1341674d2743422443d6702d475f6db4fdc322))
|
|
14
|
+
* remove unnecessary console logs in init function for cleaner output ([4e50944](https://github.com/CoCreate-app/CoCreate-users/commit/4e509445cc8eb972afe7cb15065bc34aeda68440))
|
|
15
|
+
* removed post install and add add packages to apprved list ([4ca4805](https://github.com/CoCreate-app/CoCreate-users/commit/4ca480518e6fa4320d04a77a22344e444b4c0fb0))
|
|
16
|
+
* semantic version handling ([faaf8be](https://github.com/CoCreate-app/CoCreate-users/commit/faaf8beced63fbbd31b709b35d0de88916cf5bd0))
|
|
17
|
+
* update dependencies and integrate @cocreate/config for user management ([810ca32](https://github.com/CoCreate-app/CoCreate-users/commit/810ca3290a2005a28fb9eda5ef0b9f9180b7df0f))
|
|
18
|
+
* update module export to ES6 syntax in release.config.js ([b3b0ba3](https://github.com/CoCreate-app/CoCreate-users/commit/b3b0ba3a99441bec2f5481013d88b9578a346df3))
|
|
19
|
+
* update package.json to use ESM and restructure entry points ([7da48f2](https://github.com/CoCreate-app/CoCreate-users/commit/7da48f2eb2630eb91df496977885e9880cd5b09d))
|
|
20
|
+
* update user creation to avoid conflicts and ensure correct array targeting ([4a5117f](https://github.com/CoCreate-app/CoCreate-users/commit/4a5117f4a24c1b9a8bacfb1cda9eba47b5cda6ac))
|
|
21
|
+
|
|
22
|
+
## [1.39.4](https://github.com/CoCreate-app/CoCreate-users/compare/v1.39.3...v1.39.4) (2026-04-04)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* improved ([6f0003b](https://github.com/CoCreate-app/CoCreate-users/commit/6f0003b6b151886e88d53de3271f63dde61d7e28))
|
|
28
|
+
|
|
1
29
|
## [1.39.3](https://github.com/CoCreate-app/CoCreate-users/compare/v1.39.2...v1.39.3) (2026-04-04)
|
|
2
30
|
|
|
3
31
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/users",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.40.0",
|
|
4
4
|
"description": "A simple users component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"users",
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"start": "npx webpack --config webpack.config.js",
|
|
20
20
|
"build": "npx webpack --mode=production --config webpack.config.js",
|
|
21
|
-
"dev": "npx webpack --config webpack.config.js --watch"
|
|
22
|
-
"postinstall": "node -e \"const { execSync } = require('child_process'); try { execSync('coc --version', { stdio: 'ignore' }); } catch (error) { try { execSync('npm install -g @cocreate/cli', { stdio: 'inherit' }); console.log('Installed \"@cocreate/cli\" globally.'); } catch (error) { console.error('Failed to install \"@cocreate/cli\" globally:', error); } }\""
|
|
21
|
+
"dev": "npx webpack --config webpack.config.js --watch"
|
|
23
22
|
},
|
|
24
23
|
"repository": {
|
|
25
24
|
"type": "git",
|
|
@@ -35,22 +34,45 @@
|
|
|
35
34
|
"type": "GitHub Sponsors ❤",
|
|
36
35
|
"url": "https://github.com/sponsors/CoCreate-app"
|
|
37
36
|
},
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
"type": "module",
|
|
38
|
+
"main": "./src/server.js",
|
|
39
|
+
"browser": "./src/client.js",
|
|
40
|
+
"exports": {
|
|
41
|
+
".": {
|
|
42
|
+
"node": "./src/server.js",
|
|
43
|
+
"deno": "./src/server.js",
|
|
44
|
+
"browser": "./src/client.js",
|
|
45
|
+
"default": "./src/server.js"
|
|
46
|
+
}
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@cocreate/actions": "^1.21.
|
|
50
|
-
"@cocreate/
|
|
51
|
-
"@cocreate/
|
|
52
|
-
"@cocreate/
|
|
53
|
-
"@cocreate/
|
|
54
|
-
"@cocreate/
|
|
49
|
+
"@cocreate/actions": "^1.21.4",
|
|
50
|
+
"@cocreate/config": "^1.13.4",
|
|
51
|
+
"@cocreate/crud-client": "^1.34.6",
|
|
52
|
+
"@cocreate/element-prototype": "^1.31.4",
|
|
53
|
+
"@cocreate/elements": "^1.42.9",
|
|
54
|
+
"@cocreate/local-storage": "^1.16.5",
|
|
55
|
+
"@cocreate/render": "^1.46.1"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@cocreate/webpack": "^1.4.3"
|
|
59
|
+
},
|
|
60
|
+
"allowScripts": {
|
|
61
|
+
"@cocreate/actions@1.21.4": true,
|
|
62
|
+
"@cocreate/api@1.22.5": true,
|
|
63
|
+
"@cocreate/config@1.13.4": true,
|
|
64
|
+
"@cocreate/crud-client@1.34.6": true,
|
|
65
|
+
"@cocreate/element-prototype@1.31.4": true,
|
|
66
|
+
"@cocreate/elements@1.42.9": true,
|
|
67
|
+
"@cocreate/filter@1.33.6": true,
|
|
68
|
+
"@cocreate/indexeddb@1.23.4": true,
|
|
69
|
+
"@cocreate/local-storage@1.16.5": true,
|
|
70
|
+
"@cocreate/observer@1.19.0": true,
|
|
71
|
+
"@cocreate/organizations@1.30.1": true,
|
|
72
|
+
"@cocreate/render@1.46.1": true,
|
|
73
|
+
"@cocreate/socket-client@1.40.5": true,
|
|
74
|
+
"@cocreate/utils@1.42.2": true,
|
|
75
|
+
"@cocreate/uuid@1.12.4": true,
|
|
76
|
+
"@cocreate/webpack@1.4.3": true
|
|
55
77
|
}
|
|
56
78
|
}
|
package/release.config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export default {
|
|
2
2
|
dryRun: false,
|
|
3
3
|
branches: ["master"],
|
|
4
4
|
plugins: [
|
|
@@ -10,12 +10,20 @@ module.exports = {
|
|
|
10
10
|
changelogFile: "CHANGELOG.md",
|
|
11
11
|
},
|
|
12
12
|
],
|
|
13
|
-
"@semantic-release/npm",
|
|
14
|
-
"@semantic-release/github",
|
|
13
|
+
"@semantic-release/npm",
|
|
15
14
|
[
|
|
16
|
-
"@semantic-release/
|
|
15
|
+
"@semantic-release/github",
|
|
17
16
|
{
|
|
17
|
+
successComment: false,
|
|
18
|
+
failTitle: false,
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
"@semantic-release/git",
|
|
23
|
+
{
|
|
24
|
+
// Only stage and commit the changelog and package.json
|
|
18
25
|
assets: ["CHANGELOG.md", "package.json"],
|
|
26
|
+
message: "chore(release): ${nextRelease.version} [skip ci]",
|
|
19
27
|
},
|
|
20
28
|
],
|
|
21
29
|
],
|
package/src/client.js
CHANGED
|
@@ -9,6 +9,7 @@ import "./index.css";
|
|
|
9
9
|
|
|
10
10
|
// TODO: Replace with @cocreate/config.
|
|
11
11
|
import localStorage from "@cocreate/local-storage";
|
|
12
|
+
import Config from "@cocreate/config";
|
|
12
13
|
|
|
13
14
|
const CoCreateUser = {
|
|
14
15
|
organization_id: async () => {
|
|
@@ -35,7 +36,6 @@ const CoCreateUser = {
|
|
|
35
36
|
method: "object.create",
|
|
36
37
|
array: "keys",
|
|
37
38
|
object: {
|
|
38
|
-
_id: user.object._id || user.object[0]?._id,
|
|
39
39
|
type: "user",
|
|
40
40
|
key: user.object._id || user.object[0]?._id,
|
|
41
41
|
roles: user.object.roles || [user.object["roles[]"]] || user.object[0]?.roles,
|
|
@@ -178,10 +178,15 @@ const CoCreateUser = {
|
|
|
178
178
|
|
|
179
179
|
},
|
|
180
180
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
181
|
+
signOut: function (action) {
|
|
182
|
+
// Remove user_id via Config to clear cookies and CoCreateConfig
|
|
183
|
+
Config.remove("user_id");
|
|
184
|
+
// token can remain in localStorage removal
|
|
184
185
|
localStorage.removeItem("token");
|
|
186
|
+
if (Crud && Crud.socket) {
|
|
187
|
+
Crud.socket.user_id = null;
|
|
188
|
+
if (Crud.socket.token) Crud.socket.token = null;
|
|
189
|
+
}
|
|
185
190
|
|
|
186
191
|
render({
|
|
187
192
|
selector: "[template*='signOut']",
|
|
@@ -194,7 +199,6 @@ const CoCreateUser = {
|
|
|
194
199
|
]
|
|
195
200
|
});
|
|
196
201
|
|
|
197
|
-
// TODO: replace with Custom event system
|
|
198
202
|
action.element.dispatchEvent(new CustomEvent("signOut"));
|
|
199
203
|
},
|
|
200
204
|
|
|
@@ -237,8 +241,9 @@ const CoCreateUser = {
|
|
|
237
241
|
let redirectLink = redirectTag.getAttribute("href");
|
|
238
242
|
if (redirectLink) {
|
|
239
243
|
if (userStatus == "offline") {
|
|
240
|
-
|
|
244
|
+
Config.removeItem("user_id");
|
|
241
245
|
localStorage.removeItem("token");
|
|
246
|
+
if (Crud && Crud.socket) Crud.socket.user_id = null;
|
|
242
247
|
}
|
|
243
248
|
|
|
244
249
|
// Normalize both URLs to compare paths in a uniform way
|