worldstate-emitter 2.2.0 → 2.2.2
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/.babelrc.json +4 -0
- package/.commitlintrc.yml +5 -0
- package/.eslintignore +4 -0
- package/.eslintrc.yml +9 -0
- package/.lintstagedrc.yml +9 -0
- package/.mocharc.yml +3 -0
- package/.nycrc.yml +4 -0
- package/.prettierrc +1 -0
- package/handlers/RSS.js +1 -1
- package/handlers/Twitter.js +1 -1
- package/index.js +8 -0
- package/nodemon.json +8 -0
- package/package.json +13 -84
- package/utilities/WSCache.js +16 -4
- package/.jshintignore +0 -1
- package/.jshintrc +0 -10
package/.babelrc.json
ADDED
package/.eslintignore
ADDED
package/.eslintrc.yml
ADDED
package/.mocharc.yml
ADDED
package/.nycrc.yml
ADDED
package/.prettierrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"@wfcd/eslint-config/prettier"
|
package/handlers/RSS.js
CHANGED
package/handlers/Twitter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Twitter from 'twitter';
|
|
2
2
|
|
|
3
|
-
import toWatch from '../resources/tweeters.json'
|
|
3
|
+
import toWatch from '../resources/tweeters.json' with { type: 'json' };
|
|
4
4
|
import { logger } from '../utilities/index.js';
|
|
5
5
|
import { twiClientInfo, TWITTER_TIMEOUT } from '../utilities/env.js';
|
|
6
6
|
|
package/index.js
CHANGED
|
@@ -70,6 +70,14 @@ export default class WorldstateEmitter extends EventEmitter {
|
|
|
70
70
|
return this.#worldstate?.get(language);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
get debug() {
|
|
74
|
+
return {
|
|
75
|
+
rss: this.getRss(),
|
|
76
|
+
worldstate: this.#worldstate?.get(),
|
|
77
|
+
twitter: this.#twitter?.clientInfoValid ? this.#twitter.getData() : undefined,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
73
81
|
/**
|
|
74
82
|
* Get Twitter data
|
|
75
83
|
* @returns {Promise} promised twitter data
|
package/nodemon.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worldstate-emitter",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.2",
|
|
4
4
|
"description": "Event emitter for worldstate & other warframe events",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"warframe",
|
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"license": "Apache-2.0",
|
|
20
20
|
"author": "tobiah <tobiah@protonmail.com>",
|
|
21
21
|
"type": "module",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": "./index.js"
|
|
24
|
+
},
|
|
22
25
|
"main": "index.js",
|
|
23
26
|
"directories": {
|
|
24
27
|
"test": "test/specs"
|
|
@@ -29,92 +32,18 @@
|
|
|
29
32
|
"dev": "nodemon test/tester.js",
|
|
30
33
|
"lint": "eslint .",
|
|
31
34
|
"lint:fix": "eslint . --fix",
|
|
32
|
-
"prepare": "husky && install-peerdeps @wfcd/eslint-config@latest -S",
|
|
33
|
-
"report": "c8 report --reporter=text-lcov",
|
|
35
|
+
"prepare": "husky && npx install-peerdeps @wfcd/eslint-config@latest -S",
|
|
36
|
+
"report": "c8 report --reporter=text-lcov > coverage/lcov.info",
|
|
34
37
|
"test": "c8 mocha",
|
|
35
38
|
"validate": "npm ls"
|
|
36
39
|
},
|
|
37
40
|
"pre-commit": [
|
|
38
41
|
"lint",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
42
|
+
"validate",
|
|
43
|
+
"test"
|
|
41
44
|
],
|
|
42
|
-
"commitlint": {
|
|
43
|
-
"extends": [
|
|
44
|
-
"@commitlint/config-conventional"
|
|
45
|
-
],
|
|
46
|
-
"rules": {
|
|
47
|
-
"body-max-line-length": [
|
|
48
|
-
0
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"lint-staged": {
|
|
53
|
-
"*.js": [
|
|
54
|
-
"eslint --cache --fix",
|
|
55
|
-
"npm test"
|
|
56
|
-
],
|
|
57
|
-
"package*.json": [
|
|
58
|
-
"prettier --write",
|
|
59
|
-
"npm dedupe",
|
|
60
|
-
"npx sort-package-json"
|
|
61
|
-
],
|
|
62
|
-
"*.{json,yml,yaml}": [
|
|
63
|
-
"prettier --write"
|
|
64
|
-
]
|
|
65
|
-
},
|
|
66
|
-
"nodemonConfig": {
|
|
67
|
-
"delay": 5000,
|
|
68
|
-
"env": {
|
|
69
|
-
"LOG_LEVEL": "debug",
|
|
70
|
-
"CACHE_TIMEOUT": 60000,
|
|
71
|
-
"SEMLAR_TIMEOUT": 300000
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
"babel": {
|
|
75
|
-
"plugins": [
|
|
76
|
-
"@babel/plugin-transform-class-properties",
|
|
77
|
-
"@babel/plugin-transform-private-methods"
|
|
78
|
-
],
|
|
79
|
-
"presets": [
|
|
80
|
-
"@babel/preset-env"
|
|
81
|
-
]
|
|
82
|
-
},
|
|
83
|
-
"prettier": "@wfcd/eslint-config/prettier",
|
|
84
|
-
"eslintConfig": {
|
|
85
|
-
"parser": "@babel/eslint-parser",
|
|
86
|
-
"parserOptions": {
|
|
87
|
-
"ecmaFeatures": {
|
|
88
|
-
"modules": true
|
|
89
|
-
},
|
|
90
|
-
"ecmaVersion": 6,
|
|
91
|
-
"sourceType": "module"
|
|
92
|
-
},
|
|
93
|
-
"extends": "@wfcd/eslint-config/esm",
|
|
94
|
-
"rules": {
|
|
95
|
-
"no-underscore-dangle": "off"
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
"eslintIgnore": [
|
|
99
|
-
".github/**",
|
|
100
|
-
"docs/**",
|
|
101
|
-
"resources/**",
|
|
102
|
-
"types/**"
|
|
103
|
-
],
|
|
104
|
-
"mocha": {
|
|
105
|
-
"exit": true,
|
|
106
|
-
"spec": "test/specs/**/*.spec.js",
|
|
107
|
-
"timeout": 20000
|
|
108
|
-
},
|
|
109
|
-
"c8": {
|
|
110
|
-
"reporter": [
|
|
111
|
-
"lcov",
|
|
112
|
-
"text"
|
|
113
|
-
],
|
|
114
|
-
"skip-full": true
|
|
115
|
-
},
|
|
116
45
|
"dependencies": {
|
|
117
|
-
"cron": "^
|
|
46
|
+
"cron": "^4.0.0",
|
|
118
47
|
"rss-feed-emitter": "^3.2.2",
|
|
119
48
|
"twitter": "^1.7.1"
|
|
120
49
|
},
|
|
@@ -123,17 +52,17 @@
|
|
|
123
52
|
"@commitlint/config-conventional": "^19.1.0",
|
|
124
53
|
"@wfcd/eslint-config": "latest",
|
|
125
54
|
"c8": "^10.1.2",
|
|
126
|
-
"chai": "^
|
|
55
|
+
"chai": "^5.1.2",
|
|
127
56
|
"coveralls": "^3.1.0",
|
|
128
57
|
"husky": "^9.0.11",
|
|
129
58
|
"install-peerdeps": "^3.0.3",
|
|
130
|
-
"lint-staged": "^
|
|
131
|
-
"mocha": "^
|
|
59
|
+
"lint-staged": "^16.0.0",
|
|
60
|
+
"mocha": "^11.0.1",
|
|
132
61
|
"nodemon": "^3.0.3",
|
|
133
62
|
"prettier": "^3.2.5"
|
|
134
63
|
},
|
|
135
64
|
"peerDependencies": {
|
|
136
|
-
"warframe-worldstate-data": "^
|
|
65
|
+
"warframe-worldstate-data": "^3.x",
|
|
137
66
|
"warframe-worldstate-parser": "^4.x"
|
|
138
67
|
},
|
|
139
68
|
"optionalDependencies": {
|
package/utilities/WSCache.js
CHANGED
|
@@ -35,11 +35,23 @@ export default class WSCache {
|
|
|
35
35
|
* @returns {Promise<void>}
|
|
36
36
|
*/
|
|
37
37
|
#update = async (newData) => {
|
|
38
|
-
const
|
|
38
|
+
const deps = {
|
|
39
39
|
locale: this.#language,
|
|
40
|
-
kuvaData:
|
|
41
|
-
sentientData:
|
|
42
|
-
}
|
|
40
|
+
kuvaData: {},
|
|
41
|
+
sentientData: {},
|
|
42
|
+
};
|
|
43
|
+
try {
|
|
44
|
+
deps.kuvaData = JSON.parse(await this.#kuvaCache.get());
|
|
45
|
+
} catch (err) {
|
|
46
|
+
logger.warn(`Error parsing kuva data for ${this.#language}: ${err}`);
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
deps.sentientData = JSON.parse(await this.#sentientCache.get());
|
|
50
|
+
} catch (err) {
|
|
51
|
+
logger.warn(`Error parsing sentient data for ${this.#language}: ${err}`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const t = await WorldState.build(newData, deps);
|
|
43
55
|
if (!t.timestamp) return;
|
|
44
56
|
|
|
45
57
|
this.#inner = t;
|
package/.jshintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
node_modules
|