wext-manifest-transformer 1.3.0 → 1.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.
- package/lib/constants.js +11 -11
- package/lib/transform.js +1 -1
- package/package.json +15 -26
package/lib/constants.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export const ENVKeys = {
|
|
2
|
-
DEV:
|
|
3
|
-
PROD:
|
|
2
|
+
DEV: "dev",
|
|
3
|
+
PROD: "prod",
|
|
4
4
|
};
|
|
5
5
|
export const Browser = {
|
|
6
|
-
CHROME:
|
|
7
|
-
FIREFOX:
|
|
8
|
-
EDGE:
|
|
9
|
-
BRAVE:
|
|
10
|
-
OPERA:
|
|
11
|
-
VIVALDI:
|
|
12
|
-
ARC:
|
|
13
|
-
YANDEX:
|
|
6
|
+
CHROME: "chrome",
|
|
7
|
+
FIREFOX: "firefox",
|
|
8
|
+
EDGE: "edge",
|
|
9
|
+
BRAVE: "brave",
|
|
10
|
+
OPERA: "opera",
|
|
11
|
+
VIVALDI: "vivaldi",
|
|
12
|
+
ARC: "arc",
|
|
13
|
+
YANDEX: "yandex",
|
|
14
14
|
};
|
|
15
15
|
export const browserVendors = Object.values(Browser);
|
|
16
16
|
export const envVariables = [ENVKeys.DEV, ENVKeys.PROD];
|
|
17
|
-
export const CUSTOM_PREFIX_REGEX = new RegExp(`^__((?:(?:${[...browserVendors, ...envVariables].join(
|
|
17
|
+
export const CUSTOM_PREFIX_REGEX = new RegExp(`^__((?:(?:${[...browserVendors, ...envVariables].join("|")})\\|?)+)__(.*)`);
|
package/lib/transform.js
CHANGED
|
@@ -8,7 +8,7 @@ export const transformer = (manifest, selectedVendor, nodeEnv) => {
|
|
|
8
8
|
if (typeof manifest === "object" && !!manifest) {
|
|
9
9
|
return Object.entries(manifest).reduce((newManifest, [key, value]) => {
|
|
10
10
|
const vendorMatch = key.match(CUSTOM_PREFIX_REGEX);
|
|
11
|
-
if (
|
|
11
|
+
if (vendorMatch) {
|
|
12
12
|
const matches = vendorMatch[1]?.split("|") || [];
|
|
13
13
|
const isProd = nodeEnv === "production";
|
|
14
14
|
const hasCurrentVendor = matches.includes(selectedVendor);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wext-manifest-transformer",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Transformer that lets you specify `manifest.json` properties to appear only in specific browsers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/abhijithvijayan/wext-manifest-transformer.git",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://abhijithvijayan.in"
|
|
12
12
|
},
|
|
13
13
|
"engines": {
|
|
14
|
-
"node": ">=
|
|
14
|
+
"node": ">=20"
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"exports": {
|
|
@@ -22,16 +22,13 @@
|
|
|
22
22
|
"lib"
|
|
23
23
|
],
|
|
24
24
|
"scripts": {
|
|
25
|
-
"dev": "
|
|
26
|
-
"build
|
|
27
|
-
"build": "rimraf lib && npm run build:esm",
|
|
25
|
+
"dev": "tsc --outDir lib --watch",
|
|
26
|
+
"build": "rimraf lib && tsc --outDir lib",
|
|
28
27
|
"pack:list": "npm pack && tar -xvzf *.tgz && rm -rf package *.tgz",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"lint": "eslint . --ext .ts",
|
|
34
|
-
"lint:fix": "eslint . --ext .ts --fix"
|
|
28
|
+
"test": "jest",
|
|
29
|
+
"test:watch": "jest --watch",
|
|
30
|
+
"lint": "eslint .",
|
|
31
|
+
"lint:fix": "eslint . --fix"
|
|
35
32
|
},
|
|
36
33
|
"husky": {
|
|
37
34
|
"hooks": {
|
|
@@ -40,7 +37,7 @@
|
|
|
40
37
|
},
|
|
41
38
|
"lint-staged": {
|
|
42
39
|
"*.ts": [
|
|
43
|
-
"eslint
|
|
40
|
+
"eslint"
|
|
44
41
|
]
|
|
45
42
|
},
|
|
46
43
|
"keywords": [
|
|
@@ -58,30 +55,22 @@
|
|
|
58
55
|
"yandex"
|
|
59
56
|
],
|
|
60
57
|
"devDependencies": {
|
|
61
|
-
"@abhijithvijayan/eslint-config": "^2.8.0",
|
|
62
|
-
"@abhijithvijayan/eslint-config-airbnb": "^1.1.0",
|
|
63
58
|
"@abhijithvijayan/tsconfig": "^1.5.1",
|
|
64
|
-
"@babel/eslint-parser": "^7.23.9",
|
|
65
59
|
"@swc/core": "^1.12.7",
|
|
66
60
|
"@swc/jest": "^0.2.38",
|
|
67
61
|
"@types/jest": "^29.5.14",
|
|
68
62
|
"@types/node": "^20.19.1",
|
|
69
|
-
"@typescript-eslint/eslint-plugin": "^6.20.0",
|
|
70
|
-
"@typescript-eslint/parser": "^6.20.0",
|
|
71
63
|
"cross-env": "^7.0.3",
|
|
72
|
-
"eslint": "^
|
|
73
|
-
"eslint-config-prettier": "^
|
|
74
|
-
"eslint-plugin-import": "^2.29.1",
|
|
75
|
-
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
76
|
-
"eslint-plugin-node": "^11.1.0",
|
|
64
|
+
"eslint": "^9.0.0",
|
|
65
|
+
"eslint-config-prettier": "^10.0.0",
|
|
77
66
|
"eslint-plugin-prettier": "^5.1.3",
|
|
78
|
-
"
|
|
79
|
-
"eslint-plugin-react-hooks": "^4.6.0",
|
|
67
|
+
"globals": "^16.0.0",
|
|
80
68
|
"husky": "^4.3.8",
|
|
81
69
|
"jest": "^29.7.0",
|
|
82
70
|
"lint-staged": "^11.0.0",
|
|
83
71
|
"prettier": "^3.2.4",
|
|
84
72
|
"rimraf": "^3.0.2",
|
|
85
|
-
"typescript": "5.8.3"
|
|
73
|
+
"typescript": "5.8.3",
|
|
74
|
+
"typescript-eslint": "^8.0.0"
|
|
86
75
|
}
|
|
87
|
-
}
|
|
76
|
+
}
|