@commversion/libs 0.2.0-4 → 0.3.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.
@@ -0,0 +1,4 @@
1
+ dist
2
+ node_modules
3
+ *.ejs.t
4
+ _templates/generator/**/*.js
package/README.md CHANGED
@@ -23,6 +23,16 @@ Configuration takes place by global `window.commversion` object, make sure to no
23
23
  </script>
24
24
  ```
25
25
 
26
+ ## Available scripts
27
+
28
+ All scripts are available under the `scripts/` directory.
29
+
30
+ - lc-exit-intent
31
+ - lc-ga-tags
32
+ - lc-input-errors
33
+ - lc-show-hide
34
+ - schedule-event
35
+
26
36
  ## Release new versions
27
37
 
28
38
  The project follows the semantic versioning convention.
@@ -31,11 +41,16 @@ Patch releases for bug fixes.
31
41
  Minor releases for new features.
32
42
  Major releases for breaking changes.
33
43
 
34
- The release is fully automated by executing `npm run release`.
44
+ The release is fully automated by executing `npm run release`. No need to run build scripts beforehand, this is done automatically.
35
45
 
36
46
  ## Guideline for contributing
37
47
 
38
- WIP.
39
- This will be updated soon.
48
+ To create a new script, run the following command in a shell.
49
+
50
+ ```bash
51
+ $ npx hygen scripts new script-name
52
+ ```
53
+
54
+ The command above will create e new script containing the absolute minimum files. It will also amend root `README.md` and `package.json` to include required entries.
40
55
 
41
- Short version, new packages go in `packages/` directory and vite configuration is required.
56
+ Start working on a specific script by running `npm run package:dev`.
@@ -1 +1 @@
1
- (function(){"use strict";const t=()=>{const{LiveChatWidget:e}=window;e.call("update_session_variables",{input_error:"false"}),document.querySelectorAll("input").forEach(i=>{i.addEventListener("invalid",()=>{e.call("update_session_variables",{input_error:"true"}),e.call("maximize")})})};window.LiveChatWidget.on("ready",t)})();
1
+ (function(){"use strict";const t=()=>{const{LiveChatWidget:e}=window;document.querySelectorAll("input").forEach(n=>{n.addEventListener("invalid",()=>{e.call("update_session_variables",{input_error:"true"})})})};window.LiveChatWidget.on("ready",t)})();
@@ -0,0 +1 @@
1
+ (function(){"use strict";const i=(e,o)=>!e.test(o),t=(e,o)=>e.test(o),s=["browsing"],d=e=>e.show&&e.hide?{predicateFn:()=>console.error("Cannot set both show and hide configuration. Please choose one.")}:e.show?{predicateFn:i,pluginConfiguration:e.show}:e.hide?{predicateFn:t,pluginConfiguration:e.hide}:{predicateFn:()=>console.error("No configuration for show/hide script.")},r=e=>({customerData:o})=>{const{LiveChatWidget:n}=window,c=window.location.pathname,{predicateFn:h,pluginConfiguration:u}=d(e);h(new RegExp(u),c)&&s.includes(o.status)&&n.call("hide")};window.commversion=window.commversion||{},window.LiveChatWidget.on("ready",r(window.commversion))})();
package/package.json CHANGED
@@ -1,21 +1,23 @@
1
1
  {
2
2
  "name": "@commversion/libs",
3
- "version": "0.2.0-4",
3
+ "version": "0.3.1",
4
4
  "author": "Marios Antonoudiou <mariosant@sent.com>",
5
5
  "license": "UNLICENSED",
6
6
  "scripts": {
7
7
  "lint": "prettier -c .",
8
- "test": "wtr ./packages/**/*.test.js --node-resolve",
8
+ "test": "wtr ./scripts/**/*.test.js --node-resolve",
9
9
  "prepack": "concurrently npm:build:*",
10
10
  "release": "release-it",
11
- "dev:schedule-event": "vite serve packages/schedule-event/src/",
12
- "build:schedule-event": "vite build -c packages/schedule-event/vite.config.js",
13
- "dev:lc-ga-tags": "vite serve packages/lc-ga-tags/src/",
14
- "build:lc-ga-tags": "vite build -c packages/lc-ga-tags/vite.config.js",
15
- "dev:lc-exit-intent": "vite serve packages/lc-exit-intent/src/",
16
- "build:lc-exit-intent": "vite build -c packages/lc-exit-intent/vite.config.js",
17
- "dev:lc-input-error": "vite serve packages/lc-input-error/src/",
18
- "build:lc-input-error": "vite build -c packages/lc-input-error/vite.config.js"
11
+ "dev:lc-show-hide": "vite serve scripts/lc-show-hide/src/",
12
+ "build:lc-show-hide": "vite build -c scripts/lc-show-hide/vite.config.js",
13
+ "dev:schedule-event": "vite serve scripts/schedule-event/src/",
14
+ "build:schedule-event": "vite build -c scripts/schedule-event/vite.config.js",
15
+ "dev:lc-ga-tags": "vite serve scripts/lc-ga-tags/src/",
16
+ "build:lc-ga-tags": "vite build -c scripts/lc-ga-tags/vite.config.js",
17
+ "dev:lc-exit-intent": "vite serve scripts/lc-exit-intent/src/",
18
+ "build:lc-exit-intent": "vite build -c scripts/lc-exit-intent/vite.config.js",
19
+ "dev:lc-input-error": "vite serve scripts/lc-input-error/src/",
20
+ "build:lc-input-error": "vite build -c scripts/lc-input-error/vite.config.js"
19
21
  },
20
22
  "publishConfig": {
21
23
  "access": "public"
@@ -26,6 +28,7 @@
26
28
  "@web/test-runner": "^0.13.22",
27
29
  "chai": "^4.3.4",
28
30
  "concurrently": "^6.5.0",
31
+ "hygen": "^6.1.0",
29
32
  "prettier": "^2.5.0",
30
33
  "release-it": "^14.11.8",
31
34
  "rimraf": "^3.0.2",
@@ -34,5 +37,8 @@
34
37
  },
35
38
  "dependencies": {
36
39
  "spacetime": "^6.16.3"
40
+ },
41
+ "volta": {
42
+ "node": "16.13.2"
37
43
  }
38
44
  }