@salla.sa/twilight 2.0.285 → 2.0.287
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/dist/@salla.sa/twilight.min.js +4 -4
- package/dist/@salla.sa/twilight.min.js.map +1 -1
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +63 -64
- package/types/.DS_Store +0 -0
- package/types/api/.DS_Store +0 -0
- package/types/index.d.ts +4 -2
- package/types/lib/salla-logger.d.ts +9 -0
- package/watcher.js +7 -4
package/package.json
CHANGED
|
@@ -1,66 +1,65 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
2
|
+
"name": "@salla.sa/twilight",
|
|
3
|
+
"version": "2.0.287",
|
|
4
|
+
"description": "Salla Theme Toolkit, Webcomponents, Events, Requests, Utils",
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"types": "types/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"postinstall": "node ./postInstall.js",
|
|
10
|
+
"prepublishOnly": "rollup --config",
|
|
11
|
+
"build": "npx rollup --config",
|
|
12
|
+
"watch": "npx rollup --watch --config"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"salla",
|
|
16
|
+
"theme",
|
|
17
|
+
"utils",
|
|
18
|
+
"events",
|
|
19
|
+
"requests"
|
|
20
|
+
],
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/SallaApp/twilight-js.git"
|
|
24
|
+
},
|
|
25
|
+
"author": "Salla.sa",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"types",
|
|
30
|
+
"watcher.js",
|
|
31
|
+
"package.json",
|
|
32
|
+
"postInstall.js"
|
|
33
|
+
],
|
|
34
|
+
"homepage": "https://salla.dev",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@salla.sa/applepay": "~1.0",
|
|
37
|
+
"axios": "^0.27.2",
|
|
38
|
+
"eventemitter2": "^6.4.6",
|
|
39
|
+
"infinite-scroll": "^4.0.1",
|
|
40
|
+
"jwt-decode": "^3.1.2",
|
|
41
|
+
"lang.js": "^1.1.14",
|
|
42
|
+
"store": "^2.0.12",
|
|
43
|
+
"websocket": "^1.0.34"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@babel/core": "^7.18.6",
|
|
47
|
+
"@babel/preset-env": "^7.18.6",
|
|
48
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
49
|
+
"@rollup/plugin-commonjs": "^22.0.1",
|
|
50
|
+
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
51
|
+
"babel-loader": "^8.2.5",
|
|
52
|
+
"glob": "^8.0.3",
|
|
53
|
+
"rollup": "^2.75.7",
|
|
54
|
+
"rollup-plugin-cleaner": "^1.0.0",
|
|
55
|
+
"rollup-plugin-json": "^4.0.0",
|
|
56
|
+
"rollup-plugin-node-resolve": "^5.2.0",
|
|
57
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
58
|
+
"webpack": "^5.73.0",
|
|
59
|
+
"webpack-build-notifier": "^2.3.0",
|
|
60
|
+
"webpack-cli": "^4.10.0"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"webpack": "^4 || ^5"
|
|
64
|
+
}
|
|
66
65
|
}
|
package/types/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
package/types/index.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ import SallaConfig from "./lib/salla-config";
|
|
|
6
6
|
import {Price} from "./common";
|
|
7
7
|
import SallaHelpers, {UrlHelpers} from "./helpers/salla-helpers";
|
|
8
8
|
import AppHelpers from "./helpers/app-helpers";
|
|
9
|
-
import SallaNotify
|
|
9
|
+
import SallaNotify from "./lib/salla-notify";
|
|
10
|
+
import SallaLogger from "./lib/salla-logger";
|
|
10
11
|
import SallaStorage from "./lib/salla-storage";
|
|
11
12
|
import SallaLang from "./lib/salla-lang";
|
|
12
13
|
import SallaCookie from "./lib/salla-cookie";
|
|
@@ -22,7 +23,8 @@ export default interface Salla extends SallaActions {
|
|
|
22
23
|
lang: SallaLang;
|
|
23
24
|
|
|
24
25
|
notify: SallaNotify;
|
|
25
|
-
|
|
26
|
+
logger: SallaLogger;
|
|
27
|
+
log: (message: string, data?: any) => void;
|
|
26
28
|
success: (message: string, data?: any) => void;
|
|
27
29
|
error: (message: string, data?: any) => void;
|
|
28
30
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default interface SallaLogger {
|
|
2
|
+
trace(message?: any, ...optionalParams: any[]): void;
|
|
3
|
+
debug(message?: any, ...optionalParams: any[]): void;
|
|
4
|
+
info(message?: any, ...optionalParams: any[]): void;
|
|
5
|
+
log(message?: any, ...optionalParams: any[]): void;
|
|
6
|
+
trace(message?: any, ...optionalParams: any[]): void;
|
|
7
|
+
warn(message?: any, ...optionalParams: any[]): void;
|
|
8
|
+
event(message?: any, ...optionalParams: any[]): void;
|
|
9
|
+
}
|
package/watcher.js
CHANGED
|
@@ -3,7 +3,6 @@ const glob = require("glob");
|
|
|
3
3
|
const color = {normal: "\x1b[0m", red: "\x1b[31m", green: "\x1b[32m", yellow: "\x1b[33m", cyan: "\x1b[36m",}
|
|
4
4
|
const {execSync} = require("child_process");
|
|
5
5
|
const fs = require("fs");
|
|
6
|
-
const env = require("dotenv");
|
|
7
6
|
const WebSocketClient = require('websocket').client;
|
|
8
7
|
|
|
9
8
|
//const webpack = require("webpack");
|
|
@@ -53,10 +52,14 @@ const WebSocketClient = require('websocket').client;
|
|
|
53
52
|
*/
|
|
54
53
|
class WatcherPlugin {
|
|
55
54
|
constructor(params) {
|
|
56
|
-
|
|
55
|
+
|
|
56
|
+
let {port = 8000, sallaCli = "salla", theme_id, upload_url, store_id, draft_id} = params || {};
|
|
57
57
|
|
|
58
|
-
this.sallaCli =
|
|
58
|
+
this.sallaCli = sallaCli;
|
|
59
59
|
this.theme_id = theme_id;
|
|
60
|
+
this.upload_url = upload_url;
|
|
61
|
+
this.store_id = store_id;
|
|
62
|
+
this.draft_id = draft_id;
|
|
60
63
|
|
|
61
64
|
let client = new WebSocketClient();
|
|
62
65
|
|
|
@@ -100,7 +103,7 @@ class WatcherPlugin {
|
|
|
100
103
|
|
|
101
104
|
files.map((file)=>{
|
|
102
105
|
if(file.toLowerCase().endsWith('.twig'))
|
|
103
|
-
execSync(`${this.sallaCli} theme sync -f "${file}" -id ${this.theme_id}`, {stdio: 'inherit'});
|
|
106
|
+
execSync(`${this.sallaCli} theme sync -f "${file}" -id ${this.theme_id} -store_id=${this.store_id} -draft_id=${this.draft_id} -upload_url=${this.upload_url}`, {stdio: 'inherit'});
|
|
104
107
|
|
|
105
108
|
if(this.connection) this.connection.sendUTF(JSON.stringify({msg:"reload"}));
|
|
106
109
|
});
|