syntropylog 0.12.2 → 0.12.4
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/CHANGELOG.md +15 -1
- package/CONTRIBUTING.md +33 -13
- package/dist/index.cjs +4 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +4 -5
- package/dist/types/config/loadLoggerConfig.d.ts +1 -1
- package/dist/types/logger/transports/optionalChalk.d.ts +4 -5
- package/package.json +2 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.12.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- **CI & native addon:** GitHub Actions (build-native, release, ci) now run `pnpm run build` in syntropylog-native so the post-build patch always runs: index.js (no execSync, resolveLddPathWithoutShell) and index.mjs (static require('./index.js'), no join/path/url). SECURITY.md documents fs module usage and native ESM entry; patch script also patches index.mjs when NAPI-RS generates dynamic require. ESLint: ignore syntropylog-native/scripts for Node CommonJS scripts.
|
|
8
|
+
|
|
9
|
+
## 0.12.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- **SECURITY.md:** Document supply-chain alerts that may appear on the **yaml** package: (1) **URLs** — documentation links only (caniuse, MDN), no runtime network requests; (2) **Behavioral (medium)** — stringify/serialization analysis, vendor states no malicious activity. Clarifies that SyntropyLog uses only `parse` with schema `json`.
|
|
14
|
+
|
|
3
15
|
## 0.12.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -8,6 +20,8 @@
|
|
|
8
20
|
|
|
9
21
|
**Docs - Universal Adapter:** README section 3 reworked: mapping is defined once with `UniversalLogFormatter` (outside the executor); executor receives the mapped object and can send it to multiple backends (e.g. Prisma, TypeORM, Mongoose) in one block. Single example shows one mapping → one object → three destinations with `Promise.all`.
|
|
10
22
|
|
|
23
|
+
- **YAML / supply chain:** Replaced **js-yaml** with **yaml** (eemeli/yaml). The new dependency has no external packages (no argparse), removing the transitive alerts for URLs, filesystem, and env vars that came from js-yaml’s CLI helper. `loadLoggerConfig` now uses `parse(..., { schema: 'json' })` for safe parsing.
|
|
24
|
+
|
|
11
25
|
## 0.12.0
|
|
12
26
|
|
|
13
27
|
First release after 0.11.3. Includes all framework refinements validated end-to-end with the examples repo (0.11.4 was never published to npm).
|
|
@@ -159,7 +173,7 @@ _Nothing at the moment._
|
|
|
159
173
|
|
|
160
174
|
### Security
|
|
161
175
|
|
|
162
|
-
- **loadLoggerConfig**: Use
|
|
176
|
+
- **loadLoggerConfig**: Use the **yaml** package (eemeli/yaml) with schema `json` when parsing YAML files to avoid prototype pollution and dangerous types; **yaml** has no external dependencies (no argparse). Use only with configuration files under deployment team control.
|
|
163
177
|
|
|
164
178
|
### Fixed
|
|
165
179
|
|
package/CONTRIBUTING.md
CHANGED
|
@@ -88,27 +88,47 @@ We welcome code contributions! To contribute code, please follow these steps:
|
|
|
88
88
|
|
|
89
89
|
## Release process (maintainers)
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Detailed guide: [docs/PREPARAR_PUBLICACION.md](docs/PREPARAR_PUBLICACION.md) (Spanish).
|
|
92
92
|
|
|
93
|
-
**
|
|
93
|
+
**Feature and develop branches:** On every push and on PRs, only the **CI** workflow runs (lint, build, tests, benchmark with native addon). Nothing is published to npm. This lets you validate everything before merging into `main`.
|
|
94
94
|
|
|
95
|
-
**
|
|
95
|
+
**Only when pushing to `main`** does the **Release** workflow run (build the addon on all platforms and, if there are changesets, versioning/publishing to npm).
|
|
96
96
|
|
|
97
|
-
Releases use [Changesets](https://github.com/changesets/changesets) and GitHub Actions. **
|
|
97
|
+
Releases use [Changesets](https://github.com/changesets/changesets) and GitHub Actions. **To have a new version published to npm, you must do one of the following:**
|
|
98
98
|
|
|
99
|
-
###
|
|
99
|
+
### Option A: Use the PR created by the action
|
|
100
100
|
|
|
101
|
-
1. **
|
|
102
|
-
2. **Push
|
|
103
|
-
3. **
|
|
101
|
+
1. **Add a changeset** when changing the library: `pnpm changeset` (choose version bump type and describe the change).
|
|
102
|
+
2. **Push to `main`**. The workflow creates a **"Version Packages"** PR with the version bump (e.g. 0.9.12 → 0.9.13) and updated CHANGELOG. **Nothing is published to npm yet.**
|
|
103
|
+
3. **Merge that PR** into `main`. That merge triggers the workflow again and **then** `publish` runs and the new version appears on npm.
|
|
104
104
|
|
|
105
|
-
###
|
|
105
|
+
### Option B: Bump the version manually (no PR)
|
|
106
106
|
|
|
107
|
-
1.
|
|
108
|
-
2. **Commit** (package.json, CHANGELOG.md,
|
|
109
|
-
3.
|
|
107
|
+
1. With changesets already in the repo, run locally: `pnpm run version-packages`. This updates `package.json`, CHANGELOG, and removes the consumed changesets.
|
|
108
|
+
2. **Commit** (package.json, CHANGELOG.md, and the removed .changeset/*.md files) and **push to `main`**.
|
|
109
|
+
3. The workflow runs, there are no changesets to apply, and it runs **publish** → the new version is published to npm.
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
In both cases, **main** and **npm** end up with the same version.
|
|
112
|
+
|
|
113
|
+
## Repository size and what not to commit
|
|
114
|
+
|
|
115
|
+
The repo should stay small so clones are fast. The following are in `.gitignore` and **must not** be committed:
|
|
116
|
+
|
|
117
|
+
- `node_modules/`, `dist/`, `coverage/`
|
|
118
|
+
- `assets/` (images; the README uses an external logo URL)
|
|
119
|
+
- `docs/`, `.cursor/`, `.turbo`
|
|
120
|
+
|
|
121
|
+
**If `assets/` or `coverage/` are already tracked**, remove them from Git (files stay on disk, only tracking is removed). Check first with `git ls-files assets/ coverage/`; if that lists files, run:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
git rm -r --cached assets/
|
|
125
|
+
git rm -r --cached coverage/
|
|
126
|
+
git commit -m "chore: stop tracking assets and coverage"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
If the path is not tracked, `git rm --cached` will report "did not match any file(s)" — that’s expected; nothing to do.
|
|
130
|
+
|
|
131
|
+
The clone size (~36 MB) is mostly **Git history** (old copies of heavy files). To reduce it you would need to rewrite history (e.g. `git filter-repo` or BFG to remove `assets/` from the past). That changes commit hashes and requires a force-push; only do it if the team agrees.
|
|
112
132
|
|
|
113
133
|
## Getting Help
|
|
114
134
|
|
package/dist/index.cjs
CHANGED
|
@@ -2397,8 +2397,8 @@ class ConsoleTransport extends Transport {
|
|
|
2397
2397
|
* @file src/logger/transports/optionalChalk.ts
|
|
2398
2398
|
* @description Built-in chalk-like API using ANSI escape codes. No chalk dependency.
|
|
2399
2399
|
* Used by ClassicConsoleTransport, PrettyConsoleTransport, CompactConsoleTransport, ColorfulConsoleTransport.
|
|
2400
|
-
*
|
|
2401
|
-
*
|
|
2400
|
+
* This module does not read environment variables. Pass disableColors from transport options;
|
|
2401
|
+
* to respect the NO_COLOR convention, set disableColors from your app (e.g. from the NO_COLOR env var). See SECURITY.md.
|
|
2402
2402
|
*/
|
|
2403
2403
|
const RESET = '\x1b[0m';
|
|
2404
2404
|
function wrap(s, codes) {
|
|
@@ -2450,9 +2450,8 @@ let cachedWithColors = null;
|
|
|
2450
2450
|
let cachedNoColors = null;
|
|
2451
2451
|
/**
|
|
2452
2452
|
* Returns a chalk-like instance using built-in ANSI colors. No external chalk dependency.
|
|
2453
|
-
* Does not read
|
|
2454
|
-
* When false, colors are used only if stdout is a TTY. To respect NO_COLOR, pass
|
|
2455
|
-
* disableColors: process.env.NO_COLOR != null && process.env.NO_COLOR !== '' && process.env.NO_COLOR !== '0'.
|
|
2453
|
+
* Does not read environment variables. Pass disableColors from transport options; when true, output has no colors.
|
|
2454
|
+
* When false, colors are used only if stdout is a TTY. To respect NO_COLOR, derive disableColors in your app and pass it here. See SECURITY.md.
|
|
2456
2455
|
*/
|
|
2457
2456
|
function getOptionalChalk(disableColors) {
|
|
2458
2457
|
if (disableColors) {
|
package/dist/index.d.ts
CHANGED
|
@@ -796,8 +796,8 @@ declare class ConsoleTransport extends Transport {
|
|
|
796
796
|
* @file src/logger/transports/optionalChalk.ts
|
|
797
797
|
* @description Built-in chalk-like API using ANSI escape codes. No chalk dependency.
|
|
798
798
|
* Used by ClassicConsoleTransport, PrettyConsoleTransport, CompactConsoleTransport, ColorfulConsoleTransport.
|
|
799
|
-
*
|
|
800
|
-
*
|
|
799
|
+
* This module does not read environment variables. Pass disableColors from transport options;
|
|
800
|
+
* to respect the NO_COLOR convention, set disableColors from your app (e.g. from the NO_COLOR env var). See SECURITY.md.
|
|
801
801
|
*/
|
|
802
802
|
/** Chalk-like API: chainable style that returns wrapped string when called. */
|
|
803
803
|
type ChalkLike = {
|
package/dist/index.mjs
CHANGED
|
@@ -2375,8 +2375,8 @@ class ConsoleTransport extends Transport {
|
|
|
2375
2375
|
* @file src/logger/transports/optionalChalk.ts
|
|
2376
2376
|
* @description Built-in chalk-like API using ANSI escape codes. No chalk dependency.
|
|
2377
2377
|
* Used by ClassicConsoleTransport, PrettyConsoleTransport, CompactConsoleTransport, ColorfulConsoleTransport.
|
|
2378
|
-
*
|
|
2379
|
-
*
|
|
2378
|
+
* This module does not read environment variables. Pass disableColors from transport options;
|
|
2379
|
+
* to respect the NO_COLOR convention, set disableColors from your app (e.g. from the NO_COLOR env var). See SECURITY.md.
|
|
2380
2380
|
*/
|
|
2381
2381
|
const RESET = '\x1b[0m';
|
|
2382
2382
|
function wrap(s, codes) {
|
|
@@ -2428,9 +2428,8 @@ let cachedWithColors = null;
|
|
|
2428
2428
|
let cachedNoColors = null;
|
|
2429
2429
|
/**
|
|
2430
2430
|
* Returns a chalk-like instance using built-in ANSI colors. No external chalk dependency.
|
|
2431
|
-
* Does not read
|
|
2432
|
-
* When false, colors are used only if stdout is a TTY. To respect NO_COLOR, pass
|
|
2433
|
-
* disableColors: process.env.NO_COLOR != null && process.env.NO_COLOR !== '' && process.env.NO_COLOR !== '0'.
|
|
2431
|
+
* Does not read environment variables. Pass disableColors from transport options; when true, output has no colors.
|
|
2432
|
+
* When false, colors are used only if stdout is a TTY. To respect NO_COLOR, derive disableColors in your app and pass it here. See SECURITY.md.
|
|
2434
2433
|
*/
|
|
2435
2434
|
function getOptionalChalk(disableColors) {
|
|
2436
2435
|
if (disableColors) {
|
|
@@ -35,7 +35,7 @@ export interface LoggerConfigLoaderOptions {
|
|
|
35
35
|
* It does NOT read environment variables directly; all state must be passed via `opts`.
|
|
36
36
|
* If no file is found, it returns an empty object, making the config file optional.
|
|
37
37
|
*
|
|
38
|
-
* **Security:** A restricted schema (
|
|
38
|
+
* **Security:** A restricted schema (`json`) is used to avoid prototype pollution
|
|
39
39
|
* and dangerous types. Only use with configuration files under deployment team
|
|
40
40
|
* control (controlled paths and permissions). This function reads only the paths
|
|
41
41
|
* derived from opts (configPath, configDir, defaultBase, environment); no other
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @file src/logger/transports/optionalChalk.ts
|
|
3
3
|
* @description Built-in chalk-like API using ANSI escape codes. No chalk dependency.
|
|
4
4
|
* Used by ClassicConsoleTransport, PrettyConsoleTransport, CompactConsoleTransport, ColorfulConsoleTransport.
|
|
5
|
-
*
|
|
6
|
-
*
|
|
5
|
+
* This module does not read environment variables. Pass disableColors from transport options;
|
|
6
|
+
* to respect the NO_COLOR convention, set disableColors from your app (e.g. from the NO_COLOR env var). See SECURITY.md.
|
|
7
7
|
*/
|
|
8
8
|
/** Chalk-like API: chainable style that returns wrapped string when called. */
|
|
9
9
|
export type ChalkLike = {
|
|
@@ -23,8 +23,7 @@ export type ChalkLike = {
|
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* Returns a chalk-like instance using built-in ANSI colors. No external chalk dependency.
|
|
26
|
-
* Does not read
|
|
27
|
-
* When false, colors are used only if stdout is a TTY. To respect NO_COLOR, pass
|
|
28
|
-
* disableColors: process.env.NO_COLOR != null && process.env.NO_COLOR !== '' && process.env.NO_COLOR !== '0'.
|
|
26
|
+
* Does not read environment variables. Pass disableColors from transport options; when true, output has no colors.
|
|
27
|
+
* When false, colors are used only if stdout is a TTY. To respect NO_COLOR, derive disableColors in your app and pass it here. See SECURITY.md.
|
|
29
28
|
*/
|
|
30
29
|
export declare function getOptionalChalk(disableColors: boolean): ChalkLike;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "syntropylog",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.4",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20.0.0"
|
|
6
6
|
},
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"provenance": true
|
|
141
141
|
},
|
|
142
142
|
"dependencies": {
|
|
143
|
-
"
|
|
143
|
+
"yaml": "^2.8.2"
|
|
144
144
|
},
|
|
145
145
|
"optionalDependencies": {
|
|
146
146
|
"syntropylog-native": "0.1.0"
|
|
@@ -153,7 +153,6 @@
|
|
|
153
153
|
"@rollup/plugin-json": "^6.1.0",
|
|
154
154
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
155
155
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
156
|
-
"@types/js-yaml": "^4.0.9",
|
|
157
156
|
"@types/node": "^22.13.5",
|
|
158
157
|
"@typescript-eslint/eslint-plugin": "8.56.1",
|
|
159
158
|
"@typescript-eslint/parser": "8.56.1",
|