@cocreate/utils 1.42.1 → 1.44.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.
@@ -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,27 +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 # Required for the latest semantic-release plugins
30
- - name: Semantic Release
31
- uses: cycjimmy/semantic-release-action@v4 # Update to v4 for better Node 20+ support
32
- id: semantic
33
- with:
34
- extra_plugins: |
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
- @semantic-release/github
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 }}" # Use the built-in token if possible
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 }}"
44
-
56
+ new_release_version: "${{ steps.semantic.outputs.new_release_version }}"
@@ -14,8 +14,7 @@ jobs:
14
14
  env:
15
15
  DRY_RUN: ${{ github.event.inputs.dry_run }}
16
16
  GITHUB_TOKEN: "${{ secrets.GITHUB }}"
17
- NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
18
-
17
+
19
18
  steps:
20
19
  - name: Checkout
21
20
  uses: actions/checkout@v3
package/CHANGELOG.md CHANGED
@@ -1,3 +1,46 @@
1
+ # [1.44.0](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.43.0...v1.44.0) (2026-07-17)
2
+
3
+
4
+ ### Features
5
+
6
+ * update automated workflow and release configuration for improved semantic release handling ([0ed2578](https://github.com/CoCreate-app/CoCreate-utils/commit/0ed2578ab8fa636038076c0a3ec56f4426213deb))
7
+
8
+ # [1.43.0](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.42.3...v1.43.0) (2026-07-14)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * update module export to ES6 syntax in release.config.js ([94292aa](https://github.com/CoCreate-app/CoCreate-utils/commit/94292aa0c6cb730a052ed6ae582672b1f9ddb19f))
14
+
15
+
16
+ ### Features
17
+
18
+ * add AST evaluation engine and core operator engine in operators.v1.js ([75ac414](https://github.com/CoCreate-app/CoCreate-utils/commit/75ac414a92f6e5a6d1d062c3061010afa639f658))
19
+ * implement universal stateless AST operator engine in operators.ast.js ([432c083](https://github.com/CoCreate-app/CoCreate-utils/commit/432c083b51168419ebb5293508ea132c0ae94dd4))
20
+
21
+ ## [1.42.3](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.42.2...v1.42.3) (2026-07-11)
22
+
23
+
24
+ ### Bug Fixes
25
+
26
+ * if query is empty, return true in queryData ([ab76c21](https://github.com/CoCreate-app/CoCreate-utils/commit/ab76c21ff2fad97f9ed11981ffd3120ba8561251))
27
+ * merge conflicts and update package exports for CommonJS support ([259e489](https://github.com/CoCreate-app/CoCreate-utils/commit/259e489cff2f764bfc00a54e2ccd144558a37efd))
28
+ * minor improvements ([d9686fd](https://github.com/CoCreate-app/CoCreate-utils/commit/d9686fda4631c893f3fb360baf28fe941b623d89))
29
+ * package exports and main/module paths for better compatibility ([1c3ee8f](https://github.com/CoCreate-app/CoCreate-utils/commit/1c3ee8f95028804140a5039dbbd67b29d511026e))
30
+ * Remove safeParse exports and imports ([a120faf](https://github.com/CoCreate-app/CoCreate-utils/commit/a120faf2f2e0652afaafa847b9662c36de53b558))
31
+ * removed dist from git ignore to include built files in the repository ([001aa9d](https://github.com/CoCreate-app/CoCreate-utils/commit/001aa9d8fa659897f699b3da43c7c10049e061bb))
32
+ * removed post install and add add packages to apprved list ([08d5ca3](https://github.com/CoCreate-app/CoCreate-utils/commit/08d5ca3cbf1fbc7d095017449c2cd72668227161))
33
+ * root factory variable Module ([2d99013](https://github.com/CoCreate-app/CoCreate-utils/commit/2d9901364d435e8f02a0701a6fa578d55391a683))
34
+ * semantic version handling ([fd9156a](https://github.com/CoCreate-app/CoCreate-utils/commit/fd9156a67728e9382c3ec16b534972ba9ff27b3a))
35
+
36
+ ## [1.42.2](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.42.1...v1.42.2) (2026-03-04)
37
+
38
+
39
+ ### Bug Fixes
40
+
41
+ * suppuport for common.js ([384bb7c](https://github.com/CoCreate-app/CoCreate-utils/commit/384bb7c5f68a585ec322cc0c0c322ae1ef97bc09))
42
+ * update to exports ([e55e9a0](https://github.com/CoCreate-app/CoCreate-utils/commit/e55e9a031bd6044ed250c3b3e0824c0f2bac0069))
43
+
1
44
  ## [1.42.1](https://github.com/CoCreate-app/CoCreate-utils/compare/v1.42.0...v1.42.1) (2026-03-04)
2
45
 
3
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/utils",
3
- "version": "1.42.1",
3
+ "version": "1.44.0",
4
4
  "description": "A simple utils component in vanilla javascript. Easily configured using HTML5 attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "utils",
@@ -17,13 +17,8 @@
17
17
  },
18
18
  "scripts": {
19
19
  "start": "npx webpack --config webpack.config.js",
20
- "build:umd": "npx webpack --mode=production --config webpack.config.js",
21
- "build:modules:esm": "npx esbuild src/*.js --outdir=dist/esm --format=esm --target=es2017 && node -e \"require('fs').writeFileSync('dist/esm/package.json', '{\\n \\\"type\\\": \\\"module\\\"\\n}\\n')\"",
22
- "build:modules:cjs": "npx esbuild src/*.js --outdir=dist/cjs --format=cjs --target=node18",
23
- "build:modules": "npm run build:modules:esm && npm run build:modules:cjs",
24
- "build": "npm run build:umd && npm run build:modules",
25
- "dev": "npx webpack --config webpack.config.js --watch",
26
- "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); } }\""
20
+ "build": "npx webpack --mode=production --config webpack.config.js",
21
+ "dev": "npx webpack --config webpack.config.js --watch"
27
22
  },
28
23
  "repository": {
29
24
  "type": "git",
@@ -39,126 +34,10 @@
39
34
  "type": "GitHub Sponsors ❤",
40
35
  "url": "https://github.com/sponsors/CoCreate-app"
41
36
  },
42
- "main": "./dist/cjs/index.cjs",
43
- "module": "./dist/esm/index.js",
44
- "exports": {
45
- ".": {
46
- "import": "./dist/esm/index.js",
47
- "require": "./dist/cjs/index.cjs"
48
- },
49
- "./getRelativePath": {
50
- "import": "./dist/esm/getRelativePath.js",
51
- "require": "./dist/cjs/getRelativePath.js"
52
- },
53
- "./ObjectId": {
54
- "import": "./dist/esm/ObjectId.js",
55
- "require": "./dist/cjs/ObjectId.js"
56
- },
57
- "./uid": {
58
- "import": "./dist/esm/uid.js",
59
- "require": "./dist/cjs/uid.js"
60
- },
61
- "./checkValue": {
62
- "import": "./dist/esm/checkValue.js",
63
- "require": "./dist/cjs/checkValue.js"
64
- },
65
- "./isValidDate": {
66
- "import": "./dist/esm/isValidDate.js",
67
- "require": "./dist/cjs/isValidDate.js"
68
- },
69
- "./objectToSearchParams": {
70
- "import": "./dist/esm/objectToSearchParams.js",
71
- "require": "./dist/cjs/objectToSearchParams.js"
72
- },
73
- "./dotNotationToObject": {
74
- "import": "./dist/esm/dotNotationToObject.js",
75
- "require": "./dist/cjs/dotNotationToObject.js"
76
- },
77
- "./objectToDotNotation": {
78
- "import": "./dist/esm/objectToDotNotation.js",
79
- "require": "./dist/cjs/objectToDotNotation.js"
80
- },
81
- "./getValueFromObject": {
82
- "import": "./dist/esm/getValueFromObject.js",
83
- "require": "./dist/cjs/getValueFromObject.js"
84
- },
85
- "./createUpdate": {
86
- "import": "./dist/esm/createUpdate.js",
87
- "require": "./dist/cjs/createUpdate.js"
88
- },
89
- "./domParser": {
90
- "import": "./dist/esm/domParser.js",
91
- "require": "./dist/cjs/domParser.js"
92
- },
93
- "./parseTextToHtml": {
94
- "import": "./dist/esm/parseTextToHtml.js",
95
- "require": "./dist/cjs/parseTextToHtml.js"
96
- },
97
- "./escapeHtml": {
98
- "import": "./dist/esm/escapeHtml.js",
99
- "require": "./dist/cjs/escapeHtml.js"
100
- },
101
- "./cssPath": {
102
- "import": "./dist/esm/cssPath.js",
103
- "require": "./dist/cjs/cssPath.js"
104
- },
105
- "./queryElements": {
106
- "import": "./dist/esm/queryElements.js",
107
- "require": "./dist/cjs/queryElements.js"
108
- },
109
- "./checkMediaQueries": {
110
- "import": "./dist/esm/queryElements.js",
111
- "require": "./dist/cjs/queryElements.js"
112
- },
113
- "./queryData": {
114
- "import": "./dist/esm/dataQuery.js",
115
- "require": "./dist/cjs/dataQuery.js"
116
- },
117
- "./searchData": {
118
- "import": "./dist/esm/dataQuery.js",
119
- "require": "./dist/cjs/dataQuery.js"
120
- },
121
- "./sortData": {
122
- "import": "./dist/esm/dataQuery.js",
123
- "require": "./dist/cjs/dataQuery.js"
124
- },
125
- "./getAttributes": {
126
- "import": "./dist/esm/attributes.js",
127
- "require": "./dist/cjs/attributes.js"
128
- },
129
- "./getAttributeNames": {
130
- "import": "./dist/esm/attributes.js",
131
- "require": "./dist/cjs/attributes.js"
132
- },
133
- "./setAttributeNames": {
134
- "import": "./dist/esm/attributes.js",
135
- "require": "./dist/cjs/attributes.js"
136
- },
137
- "./processOperators": {
138
- "import": "./dist/esm/operators.js",
139
- "require": "./dist/cjs/operators.js"
140
- },
141
- "./processOperatorsAsync": {
142
- "import": "./dist/esm/operators.js",
143
- "require": "./dist/cjs/operators.js"
144
- },
145
- "./clickedElement": {
146
- "import": "./dist/esm/clickedElement.js",
147
- "require": "./dist/cjs/clickedElement.js"
148
- },
149
- "./init-browser": {
150
- "import": "./dist/esm/init-browser.js",
151
- "require": "./dist/cjs/init-browser.js"
152
- },
153
- "./package.json": "./package.json"
154
- },
155
- "sideEffects": [
156
- "./dist/esm/init-browser.js",
157
- "./dist/cjs/init-browser.js",
158
- "./dist/CoCreate-utils.js",
159
- "./dist/CoCreate-utils.min.js"
160
- ],
37
+ "type": "module",
38
+ "main": "./src/index.js",
161
39
  "devDependencies": {
40
+ "@cocreate/webpack": "^1.4.3",
162
41
  "css-loader": "^5.1.3",
163
42
  "esbuild": "^0.25.2",
164
43
  "esbuild-loader": "^4.3.0",
@@ -166,5 +45,10 @@
166
45
  "webpack": "^5.24.4",
167
46
  "webpack-cli": "^4.5.0",
168
47
  "webpack-log": "^3.0.1"
48
+ },
49
+ "allowScripts": {
50
+ "@cocreate/webpack@1.4.3": true,
51
+ "esbuild@0.25.12": true,
52
+ "esbuild@0.28.1": true
169
53
  }
170
54
  }
package/release.config.js CHANGED
@@ -1,4 +1,4 @@
1
- module.exports = {
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/git",
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/dataQuery.js CHANGED
@@ -192,6 +192,7 @@ function queryMatch(data, query) {
192
192
  }
193
193
 
194
194
  export function queryData(data, query) {
195
+ if (!query) return true
195
196
  if (query.$and) {
196
197
  for (let i = 0; i < query.$and.length; i++) {
197
198
  if (!queryData(data, query.$and[i])) return false;
package/src/index.js CHANGED
@@ -1,70 +1,90 @@
1
- export { getRelativePath } from "./getRelativePath.js";
2
- export { ObjectId } from "./ObjectId.js";
3
- export { uid } from "./uid.js";
4
- export { checkValue } from "./checkValue.js";
5
- export { isValidDate } from "./isValidDate.js";
6
- export { objectToSearchParams } from "./objectToSearchParams.js";
7
- export { dotNotationToObject } from "./dotNotationToObject.js";
8
- export { objectToDotNotation } from "./objectToDotNotation.js";
9
- export { getValueFromObject } from "./getValueFromObject.js";
10
- export { createUpdate } from "./createUpdate.js";
11
- export { domParser } from "./domParser.js";
12
- export { parseTextToHtml } from "./parseTextToHtml.js";
13
- export { escapeHtml } from "./escapeHtml.js";
14
- export { cssPath } from "./cssPath.js";
15
- export { queryElements, checkMediaQueries } from "./queryElements.js";
16
- export { queryData, searchData, sortData } from "./dataQuery.js";
17
- export { getAttributes, getAttributeNames, setAttributeNames } from "./attributes.js";
18
- // export { safeParse } from "./safeParse.js";
19
- export { clickedElement } from "./clickedElement.js";
20
- export { processOperators, processOperatorsAsync } from "./operators.js";
21
-
22
- import { getRelativePath } from "./getRelativePath.js";
23
- import { ObjectId } from "./ObjectId.js";
24
- import { uid } from "./uid.js";
25
- import { checkValue } from "./checkValue.js";
26
- import { isValidDate } from "./isValidDate.js";
27
- import { objectToSearchParams } from "./objectToSearchParams.js";
28
- import { dotNotationToObject } from "./dotNotationToObject.js";
29
- import { objectToDotNotation } from "./objectToDotNotation.js";
30
- import { getValueFromObject } from "./getValueFromObject.js";
31
- import { createUpdate } from "./createUpdate.js";
32
- import { domParser } from "./domParser.js";
33
- import { parseTextToHtml } from "./parseTextToHtml.js";
34
- import { escapeHtml } from "./escapeHtml.js";
35
- import { cssPath } from "./cssPath.js";
36
- import { queryElements, checkMediaQueries } from "./queryElements.js";
37
- import { queryData, searchData, sortData } from "./dataQuery.js";
38
- import { getAttributes, getAttributeNames, setAttributeNames } from "./attributes.js";
39
- // import { safeParse } from "./safeParse.js";
40
- import { processOperators, processOperatorsAsync } from "./operators.js";
41
-
42
- const utils = {
43
- getRelativePath,
44
- ObjectId,
45
- uid,
46
- checkValue,
47
- isValidDate,
48
- dotNotationToObject,
49
- objectToDotNotation,
50
- getValueFromObject,
51
- objectToSearchParams,
52
- domParser,
53
- parseTextToHtml,
54
- escapeHtml,
55
- cssPath,
56
- queryElements,
57
- checkMediaQueries,
58
- queryData,
59
- searchData,
60
- sortData,
61
- createUpdate,
62
- getAttributes,
63
- setAttributeNames,
64
- getAttributeNames,
65
- // safeParse,
66
- processOperators,
67
- processOperatorsAsync
68
- };
69
-
70
- export default utils;
1
+ /********************************************************************************
2
+ * Copyright (C) 2026 CoCreate and Contributors.
3
+ *
4
+ * This program is free software: you can redistribute it and/or modify
5
+ * it under the terms of the GNU Affero General Public License as published
6
+ * by the Free Software Foundation, either version 3 of the License, or
7
+ * (at your option) any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License
15
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
16
+ *
17
+ ********************************************************************************/
18
+
19
+ export { getRelativePath } from "./getRelativePath.js";
20
+ export { ObjectId } from "./ObjectId.js";
21
+ export { uid } from "./uid.js";
22
+ export { checkValue } from "./checkValue.js";
23
+ export { isValidDate } from "./isValidDate.js";
24
+ export { objectToSearchParams } from "./objectToSearchParams.js";
25
+ export { dotNotationToObject } from "./dotNotationToObject.js";
26
+ export { objectToDotNotation } from "./objectToDotNotation.js";
27
+ export { getValueFromObject } from "./getValueFromObject.js";
28
+ export { createUpdate } from "./createUpdate.js";
29
+ export { domParser } from "./domParser.js";
30
+ export { parseTextToHtml } from "./parseTextToHtml.js";
31
+ export { escapeHtml } from "./escapeHtml.js";
32
+ export { cssPath } from "./cssPath.js";
33
+ export { queryElements, checkMediaQueries } from "./queryElements.js";
34
+ export { queryData, searchData, sortData } from "./dataQuery.js";
35
+ export { getAttributes, getAttributeNames, setAttributeNames } from "./attributes.js";
36
+ export { clickedElement } from "./clickedElement.js";
37
+ export { processOperators, processOperatorsAsync, customOperators, safeParse } from "./operators.js";
38
+
39
+ import { getRelativePath } from "./getRelativePath.js";
40
+ import { ObjectId } from "./ObjectId.js";
41
+ import { uid } from "./uid.js";
42
+ import { checkValue } from "./checkValue.js";
43
+ import { isValidDate } from "./isValidDate.js";
44
+ import { objectToSearchParams } from "./objectToSearchParams.js";
45
+ import { dotNotationToObject } from "./dotNotationToObject.js";
46
+ import { objectToDotNotation } from "./objectToDotNotation.js";
47
+ import { getValueFromObject } from "./getValueFromObject.js";
48
+ import { createUpdate } from "./createUpdate.js";
49
+ import { domParser } from "./domParser.js";
50
+ import { parseTextToHtml } from "./parseTextToHtml.js";
51
+ import { escapeHtml } from "./escapeHtml.js";
52
+ import { cssPath } from "./cssPath.js";
53
+ import { queryElements, checkMediaQueries } from "./queryElements.js";
54
+ import { queryData, searchData, sortData } from "./dataQuery.js";
55
+ import { getAttributes, getAttributeNames, setAttributeNames } from "./attributes.js";
56
+ import { clickedElement } from "./clickedElement.js";
57
+ import { processOperators, processOperatorsAsync, customOperators, safeParse } from "./operators.js";
58
+
59
+ const utils = {
60
+ getRelativePath,
61
+ ObjectId,
62
+ uid,
63
+ checkValue,
64
+ isValidDate,
65
+ dotNotationToObject,
66
+ objectToDotNotation,
67
+ getValueFromObject,
68
+ objectToSearchParams,
69
+ domParser,
70
+ parseTextToHtml,
71
+ escapeHtml,
72
+ cssPath,
73
+ queryElements,
74
+ checkMediaQueries,
75
+ queryData,
76
+ searchData,
77
+ sortData,
78
+ createUpdate,
79
+ getAttributes,
80
+ setAttributeNames,
81
+ getAttributeNames,
82
+ clickedElement,
83
+ processOperators,
84
+ processOperatorsAsync,
85
+ customOperators,
86
+ safeParse
87
+
88
+ };
89
+
90
+ export default utils;