@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/package.json CHANGED
@@ -1,66 +1,65 @@
1
1
  {
2
- "name": "@salla.sa/twilight",
3
- "version": "2.0.285",
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.26.1",
38
- "eventemitter2": "^6.4.5",
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.17.7",
47
- "@babel/preset-env": "^7.16.11",
48
- "@rollup/plugin-babel": "^5.3.1",
49
- "@rollup/plugin-commonjs": "^21.0.2",
50
- "@rollup/plugin-node-resolve": "^13.1.3",
51
- "babel-loader": "^8.2.3",
52
- "dotenv": "^16.0.1",
53
- "glob": "^7.2.0",
54
- "rollup": "^2.70.1",
55
- "rollup-plugin-cleaner": "^1.0.0",
56
- "rollup-plugin-json": "^4.0.0",
57
- "rollup-plugin-node-resolve": "^5.2.0",
58
- "rollup-plugin-terser": "^7.0.2",
59
- "webpack": "^5.64.2",
60
- "webpack-build-notifier": "^2.3.0",
61
- "webpack-cli": "^4.9.1"
62
- },
63
- "peerDependencies": {
64
- "webpack": "^4 || ^5"
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
  }
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, {Logger} from "./lib/salla-notify";
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
- log: Logger;
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
- let {port = 8000, theme_id, cli = "salla"} = params || {};
55
+
56
+ let {port = 8000, sallaCli = "salla", theme_id, upload_url, store_id, draft_id} = params || {};
57
57
 
58
- this.sallaCli = cli;
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
  });