@lokalise/node-core 9.6.0 → 9.6.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/README.md +7 -8
- package/dist/vitest.config.js +7 -5
- package/dist/vitest.config.js.map +1 -1
- package/package.json +14 -17
package/README.md
CHANGED
|
@@ -89,7 +89,7 @@ The library provides methods to resolve the default logging configuration. Publi
|
|
|
89
89
|
const logger = pino(loggerConfig)
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
-
- `resolveMonorepoLoggerConfiguration()`, which accepts as parameter an `appConfig`, defined by the `logLevel` and the `nodeEnv`. It mostly behaves the same as `resolveLoggerConfiguration`, with the exception of execution in `development environments`. Since monorepo services are usually ran concurrently, logs from `stdout` aren't easily accessible. For this reason this logging configuration writes development logs into files.
|
|
92
|
+
- `resolveMonorepoLoggerConfiguration()`, which accepts as parameter an `appConfig`, defined by the `logLevel` and the `nodeEnv`. It mostly behaves the same as `resolveLoggerConfiguration`, with the exception of execution in `development environments`. Since monorepo services are usually ran concurrently, logs from `stdout` aren't easily accessible. For this reason this logging configuration writes development logs into files.
|
|
93
93
|
|
|
94
94
|
The method returns a logger configuration that should be used with `pino` library as in the following example:
|
|
95
95
|
|
|
@@ -104,7 +104,6 @@ The library provides methods to resolve the default logging configuration. Publi
|
|
|
104
104
|
const logger = pino(loggerConfig)
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
|
|
108
107
|
## ConfigScope
|
|
109
108
|
|
|
110
109
|
`ConfigScope` is a class that provides a way to encapsulate a single config source (e. g. `process.env`) and produce a set of values out of it, defining constraints and transformations for them.
|
|
@@ -219,14 +218,14 @@ Additionally, `DefiniteEither` is also provided. It is a variation of the aforem
|
|
|
219
218
|
There is helper function available for writing event-driven assertions in automated tests, which rely on something eventually happening:
|
|
220
219
|
|
|
221
220
|
```ts
|
|
222
|
-
import { waitAndRetry } from
|
|
221
|
+
import { waitAndRetry } from '@lokalise/node-core'
|
|
223
222
|
|
|
224
223
|
const result = await waitAndRetry(
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
224
|
+
() => {
|
|
225
|
+
return someEventEmitter.emittedEvents.length > 0
|
|
226
|
+
},
|
|
227
|
+
20, // sleepTime between attempts
|
|
228
|
+
30, // maxRetryCount before timeout
|
|
230
229
|
)
|
|
231
230
|
|
|
232
231
|
expect(result).toBe(false) // resolves to what the last attempt has returned
|
package/dist/vitest.config.js
CHANGED
|
@@ -18,14 +18,16 @@ exports.default = (0, config_1.defineConfig)({
|
|
|
18
18
|
'src/config/configTypes.ts',
|
|
19
19
|
'src/errors/publicErrors.ts',
|
|
20
20
|
'src/errors/globalErrorHandler.ts',
|
|
21
|
-
'src/config/configTransformers.ts'
|
|
21
|
+
'src/config/configTransformers.ts',
|
|
22
22
|
],
|
|
23
23
|
reporter: ['text'],
|
|
24
24
|
all: true,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
thresholds: {
|
|
26
|
+
lines: 100,
|
|
27
|
+
functions: 100,
|
|
28
|
+
branches: 100,
|
|
29
|
+
statements: 100,
|
|
30
|
+
},
|
|
29
31
|
},
|
|
30
32
|
},
|
|
31
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest.config.js","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":";;AAAA,0CAA4C;AAE5C,kBAAe,IAAA,qBAAY,EAAC;IAC1B,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,MAAM;QACnB,SAAS,EAAE,CAAC,SAAS,CAAC;QACtB,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,aAAa,CAAC;YACxB,OAAO,EAAE;gBACP,kBAAkB;gBAClB,kCAAkC;gBAClC,sBAAsB;gBACtB,wBAAwB;gBACxB,2BAA2B;gBAC3B,2BAA2B;gBAC3B,4BAA4B;gBAC5B,kCAAkC;gBAClC,kCAAkC;aACnC;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;YAClB,GAAG,EAAE,IAAI;YACT,KAAK,EAAE,GAAG;
|
|
1
|
+
{"version":3,"file":"vitest.config.js","sourceRoot":"","sources":["../vitest.config.ts"],"names":[],"mappings":";;AAAA,0CAA4C;AAE5C,kBAAe,IAAA,qBAAY,EAAC;IAC1B,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,KAAK,EAAE,KAAK;QACZ,WAAW,EAAE,MAAM;QACnB,SAAS,EAAE,CAAC,SAAS,CAAC;QACtB,QAAQ,EAAE;YACR,OAAO,EAAE,CAAC,aAAa,CAAC;YACxB,OAAO,EAAE;gBACP,kBAAkB;gBAClB,kCAAkC;gBAClC,sBAAsB;gBACtB,wBAAwB;gBACxB,2BAA2B;gBAC3B,2BAA2B;gBAC3B,4BAA4B;gBAC5B,kCAAkC;gBAClC,kCAAkC;aACnC;YACD,QAAQ,EAAE,CAAC,MAAM,CAAC;YAClB,GAAG,EAAE,IAAI;YACT,UAAU,EAAE;gBACV,KAAK,EAAE,GAAG;gBACV,SAAS,EAAE,GAAG;gBACd,QAAQ,EAAE,GAAG;gBACb,UAAU,EAAE,GAAG;aAChB;SACF;KACF;CACF,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lokalise/node-core",
|
|
3
|
-
"version": "9.6.
|
|
3
|
+
"version": "9.6.1",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Lokalise",
|
|
6
6
|
"url": "https://lokalise.com/"
|
|
@@ -28,32 +28,29 @@
|
|
|
28
28
|
"test:coverage": "vitest --coverage",
|
|
29
29
|
"test:ci": "npm run lint && npm run test:coverage",
|
|
30
30
|
"test:update-snapshots": "vitest -u",
|
|
31
|
-
"lint": "eslint . --ext .ts",
|
|
32
|
-
"lint:fix": "eslint . --fix",
|
|
33
|
-
"format": "prettier --write .",
|
|
31
|
+
"lint": "eslint . --ext .ts && prettier --check --log-level warn \"**/*.{json,md,ts}\"",
|
|
32
|
+
"lint:fix": "eslint . --fix && prettier --write --log-level warn \"**/*.{json,md,ts}\"",
|
|
34
33
|
"version": "auto-changelog -p && git add CHANGELOG.md",
|
|
35
34
|
"prepublishOnly": "npm run build"
|
|
36
35
|
},
|
|
37
36
|
"dependencies": {
|
|
38
|
-
"pino": "^8.17.
|
|
39
|
-
"undici": "^6.0
|
|
37
|
+
"pino": "^8.17.2",
|
|
38
|
+
"undici": "^6.3.0",
|
|
40
39
|
"undici-retry": "^5.0.2",
|
|
41
40
|
"zod": "^3.22.4"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|
|
44
|
-
"@types/node": "^20.
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^6.
|
|
46
|
-
"@typescript-eslint/parser": "^6.
|
|
47
|
-
"@vitest/coverage-v8": "^
|
|
43
|
+
"@types/node": "^20.11.5",
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "^6.19.0",
|
|
45
|
+
"@typescript-eslint/parser": "^6.19.0",
|
|
46
|
+
"@vitest/coverage-v8": "^1.2.1",
|
|
48
47
|
"auto-changelog": "^2.4.0",
|
|
49
|
-
"eslint": "^8.
|
|
48
|
+
"eslint": "^8.56.0",
|
|
50
49
|
"eslint-config-prettier": "^9.1.0",
|
|
51
|
-
"eslint-plugin-import": "^2.29.
|
|
52
|
-
"eslint-plugin-
|
|
53
|
-
"
|
|
54
|
-
"prettier": "^3.1.1",
|
|
50
|
+
"eslint-plugin-import": "^2.29.1",
|
|
51
|
+
"eslint-plugin-vitest": "^0.3.20",
|
|
52
|
+
"prettier": "^3.2.4",
|
|
55
53
|
"typescript": "^5.3.3",
|
|
56
|
-
"vitest": "^
|
|
57
|
-
"vite": "4.5.0"
|
|
54
|
+
"vitest": "^1.2.1"
|
|
58
55
|
}
|
|
59
56
|
}
|