@commversion/libs 0.11.0 → 0.12.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/README.md +22 -0
- package/dist/lc-experiment.js +1 -1
- package/dist/lc-gclid.js +1 -0
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ Configuration takes place by global `window.commversion` object, make sure to no
|
|
|
28
28
|
All scripts are available under the `scripts/` directory.
|
|
29
29
|
|
|
30
30
|
- schedule-event
|
|
31
|
+
- lc-gclid
|
|
31
32
|
- lc-powered-by
|
|
32
33
|
- lc-ga-initialize-event
|
|
33
34
|
- lc-exit-intent
|
|
@@ -45,6 +46,21 @@ All scripts are available under the `scripts/` directory.
|
|
|
45
46
|
|
|
46
47
|
## Release new versions
|
|
47
48
|
|
|
49
|
+
**Important**
|
|
50
|
+
This project uses the npm.js public registry. Before trying to do any release, make sure you are logged with npm as Commversion.
|
|
51
|
+
The quickest way to do that, is to create a `.npmrc` file in the project directly and insert the following:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
//registry.npmjs.org/:_authToken=base64_encoded_npm_token
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
You can test if the above works by running:
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
$ npm whoami
|
|
61
|
+
commversion # this is the authenticated npm user
|
|
62
|
+
```
|
|
63
|
+
|
|
48
64
|
The project follows the semantic versioning convention.
|
|
49
65
|
|
|
50
66
|
Patch releases for bug fixes.
|
|
@@ -64,3 +80,9 @@ $ npx hygen scripts new script-name
|
|
|
64
80
|
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.
|
|
65
81
|
|
|
66
82
|
Start working on a specific script by running `npm run package:dev`.
|
|
83
|
+
|
|
84
|
+
Finally, you can run tests by running:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
$ npm test
|
|
88
|
+
```
|
package/dist/lc-experiment.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";const n=()=>()=>{const{LiveChatWidget:e}=window,{sessionVariables:t}=e.get("customer_data");if(t
|
|
1
|
+
(function(){"use strict";const n=()=>()=>{const{LiveChatWidget:e}=window,{sessionVariables:t}=e.get("customer_data");if(t!=null&&t.experiment)return;const o=i();e.call("update_session_variables",{experiment:o})},i=()=>Math.random()<.5?"A":"B";window.commversion=window.commversion||{},window.LiveChatWidget.on("ready",n())})();
|
package/dist/lc-gclid.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){"use strict";const e=()=>()=>{const{LiveChatWidget:n}=window,i=new URLSearchParams(location.search).get("gclid");typeof i=="undefined"||i===null||n.call("update_session_variables",{gclid:i})};window.commversion=window.commversion||{},window.LiveChatWidget.on("ready",e())})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commversion/libs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"author": "Marios Antonoudiou <mariosant@sent.com>",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"scripts": {
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
"test": "wtr ./scripts/**/*.test.js --node-resolve",
|
|
10
10
|
"prepack": "concurrently npm:build:*",
|
|
11
11
|
"release": "release-it",
|
|
12
|
+
"dev:lc-gclid": "vite serve scripts/lc-gclid/src/",
|
|
13
|
+
"build:lc-gclid": "vite build -c scripts/lc-gclid/vite.config.js",
|
|
12
14
|
"dev:lc-powered-by": "vite serve scripts/lc-powered-by/src/",
|
|
13
15
|
"preview:lc-powered-by": "npm run build:lc-powered-by && vite preview --host 0.0.0.0",
|
|
14
16
|
"build:lc-powered-by": "vite build -c scripts/lc-powered-by/vite.config.js",
|
|
@@ -51,6 +53,7 @@
|
|
|
51
53
|
"@web/test-runner": "^0.13.22",
|
|
52
54
|
"chai": "^4.3.4",
|
|
53
55
|
"concurrently": "^6.5.0",
|
|
56
|
+
"delay": "^5.0.0",
|
|
54
57
|
"hygen": "^6.1.0",
|
|
55
58
|
"prettier": "^2.7.1",
|
|
56
59
|
"release-it": "^14.12",
|