@bhsd/common 0.9.4 → 0.9.5
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/cm.d.ts +2 -0
- package/dist/cm.js +12 -2
- package/dist/cm.mjs +12 -2
- package/dist/stylelint.js +1 -0
- package/dist/stylelint.mjs +1 -0
- package/package.json +2 -2
package/dist/cm.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export interface MwConfig {
|
|
|
6
6
|
functionSynonyms: [Record<string, string>, Record<string, string>];
|
|
7
7
|
doubleUnderscore: [Record<string, unknown>, Record<string, unknown>];
|
|
8
8
|
variableIDs?: string[];
|
|
9
|
+
functionHooks?: string[];
|
|
10
|
+
redirection?: string[];
|
|
9
11
|
}
|
|
10
12
|
export interface MagicWord {
|
|
11
13
|
name: string;
|
package/dist/cm.js
CHANGED
|
@@ -36,7 +36,15 @@ const getConfig = (magicWords, rule, flip) => {
|
|
|
36
36
|
);
|
|
37
37
|
};
|
|
38
38
|
const getParserConfig = (minConfig, mwConfig) => {
|
|
39
|
-
const {
|
|
39
|
+
const {
|
|
40
|
+
tags,
|
|
41
|
+
doubleUnderscore,
|
|
42
|
+
urlProtocols,
|
|
43
|
+
functionSynonyms,
|
|
44
|
+
variableIDs,
|
|
45
|
+
functionHooks,
|
|
46
|
+
redirection
|
|
47
|
+
} = mwConfig, [insensitive, sensitive] = functionSynonyms, behaviorSwitch = doubleUnderscore.map(
|
|
40
48
|
(obj, i) => Object.entries(obj).map(([k, v]) => [
|
|
41
49
|
k.slice(2, -2),
|
|
42
50
|
i && typeof v === "string" ? v.toUpperCase() : v
|
|
@@ -58,7 +66,9 @@ const getParserConfig = (minConfig, mwConfig) => {
|
|
|
58
66
|
...behaviorSwitch.map(Object.fromEntries)
|
|
59
67
|
],
|
|
60
68
|
protocol: urlProtocols.replace(/\|\\?\/\\?\/$|\\(?=[:/])/gu, ""),
|
|
61
|
-
...variableIDs && { variable: [.../* @__PURE__ */ new Set([...variableIDs, "="])] }
|
|
69
|
+
...variableIDs && { variable: [.../* @__PURE__ */ new Set([...variableIDs, "="])] },
|
|
70
|
+
...functionHooks && { functionHook: [.../* @__PURE__ */ new Set([...functionHooks.map((s) => s.toLowerCase()), "msgnw"])] },
|
|
71
|
+
...redirection && { redirection: redirection.map((s) => s.toLowerCase()) }
|
|
62
72
|
};
|
|
63
73
|
};
|
|
64
74
|
const getVariants = (variants) => variants?.map(({ code }) => code) ?? [];
|
package/dist/cm.mjs
CHANGED
|
@@ -9,7 +9,15 @@ const getConfig = (magicWords, rule, flip) => {
|
|
|
9
9
|
);
|
|
10
10
|
};
|
|
11
11
|
const getParserConfig = (minConfig, mwConfig) => {
|
|
12
|
-
const {
|
|
12
|
+
const {
|
|
13
|
+
tags,
|
|
14
|
+
doubleUnderscore,
|
|
15
|
+
urlProtocols,
|
|
16
|
+
functionSynonyms,
|
|
17
|
+
variableIDs,
|
|
18
|
+
functionHooks,
|
|
19
|
+
redirection
|
|
20
|
+
} = mwConfig, [insensitive, sensitive] = functionSynonyms, behaviorSwitch = doubleUnderscore.map(
|
|
13
21
|
(obj, i) => Object.entries(obj).map(([k, v]) => [
|
|
14
22
|
k.slice(2, -2),
|
|
15
23
|
i && typeof v === "string" ? v.toUpperCase() : v
|
|
@@ -31,7 +39,9 @@ const getParserConfig = (minConfig, mwConfig) => {
|
|
|
31
39
|
...behaviorSwitch.map(Object.fromEntries)
|
|
32
40
|
],
|
|
33
41
|
protocol: urlProtocols.replace(/\|\\?\/\\?\/$|\\(?=[:/])/gu, ""),
|
|
34
|
-
...variableIDs && { variable: [.../* @__PURE__ */ new Set([...variableIDs, "="])] }
|
|
42
|
+
...variableIDs && { variable: [.../* @__PURE__ */ new Set([...variableIDs, "="])] },
|
|
43
|
+
...functionHooks && { functionHook: [.../* @__PURE__ */ new Set([...functionHooks.map((s) => s.toLowerCase()), "msgnw"])] },
|
|
44
|
+
...redirection && { redirection: redirection.map((s) => s.toLowerCase()) }
|
|
35
45
|
};
|
|
36
46
|
};
|
|
37
47
|
const getVariants = (variants) => variants?.map(({ code }) => code) ?? [];
|
package/dist/stylelint.js
CHANGED
|
@@ -26,5 +26,6 @@ const styleLint = async (stylelint, code, additionalRules) => {
|
|
|
26
26
|
const config = {
|
|
27
27
|
rules: { ...import_stylelint_config_recommended.rules, ...additionalRules }
|
|
28
28
|
};
|
|
29
|
+
delete config.rules["selector-type-no-unknown"];
|
|
29
30
|
return (await stylelint.lint({ code, config })).results.flatMap(({ warnings }) => warnings).filter(({ text }) => !text.startsWith("Unknown rule "));
|
|
30
31
|
};
|
package/dist/stylelint.mjs
CHANGED
|
@@ -3,6 +3,7 @@ const styleLint = async (stylelint, code, additionalRules) => {
|
|
|
3
3
|
const config = {
|
|
4
4
|
rules: { ...rules, ...additionalRules }
|
|
5
5
|
};
|
|
6
|
+
delete config.rules["selector-type-no-unknown"];
|
|
6
7
|
return (await stylelint.lint({ code, config })).results.flatMap(({ warnings }) => warnings).filter(({ text }) => !text.startsWith("Unknown rule "));
|
|
7
8
|
};
|
|
8
9
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bhsd/common",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Bhsd",
|
|
6
6
|
"files": [
|
|
@@ -63,6 +63,6 @@
|
|
|
63
63
|
"mocha": "^11.1.0",
|
|
64
64
|
"stylelint": "^16.19.1",
|
|
65
65
|
"typescript": "^5.8.2",
|
|
66
|
-
"wikiparser-node": "^1.20.
|
|
66
|
+
"wikiparser-node": "^1.20.2"
|
|
67
67
|
}
|
|
68
68
|
}
|