@brad-frost-web/eddie-reporter 0.62.0 → 0.63.0
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 +13 -1
- package/dist/cli-args.d.ts +30 -0
- package/dist/cli-args.d.ts.map +1 -0
- package/dist/cli-args.js +110 -0
- package/dist/cli-args.js.map +1 -0
- package/dist/cli.d.ts +6 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +16 -70
- package/dist/cli.js.map +1 -1
- package/dist/product.d.ts.map +1 -1
- package/dist/product.js +49 -10
- package/dist/product.js.map +1 -1
- package/dist/report.d.ts +2 -2
- package/dist/report.d.ts.map +1 -1
- package/dist/report.js +2 -2
- package/dist/report.js.map +1 -1
- package/dist/scanner.d.ts +15 -0
- package/dist/scanner.d.ts.map +1 -1
- package/dist/scanner.js +17 -2
- package/dist/scanner.js.map +1 -1
- package/dist/version.d.ts +12 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +12 -0
- package/dist/version.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,11 +85,23 @@ eddie-report [dir] [options]
|
|
|
85
85
|
--token <token> Bearer token (env: EDDIE_REPORT_TOKEN)
|
|
86
86
|
--event <name> build | deploy | install | ci | dev | manual (default: manual)
|
|
87
87
|
--out <path> Local artifact path (default: .eddie/usage-report.json; '' to skip)
|
|
88
|
+
--ignore <path> Skip a file or directory, relative to dir (repeatable)
|
|
89
|
+
--ignore-dir <n> Skip every directory named <n>, anywhere in the tree (repeatable)
|
|
88
90
|
--dry-run Scan and print, but don't POST or write
|
|
89
91
|
--json Print the full report JSON to stdout
|
|
90
92
|
--quiet Suppress the human summary
|
|
91
93
|
```
|
|
92
94
|
|
|
95
|
+
### Build output that lives beside the sources
|
|
96
|
+
|
|
97
|
+
The scanner already skips the usual output directories (`dist`, `_site`, `.output`, …). It cannot tell that a file *inside* a source directory is generated. A committed `css/styles.css` compiled from `css/*.scss` inlines Eddie's entire token sheet, so a site that uses two dozen tokens reports six hundred. Name such files explicitly:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
eddie-report --event ci --ignore css/styles.css --ignore css/styles.tmp.css
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The same option exists on the API as `ignorePaths` (paths relative to the scanned directory; a directory skips its subtree). Matching is case-sensitive; an absolute path inside the scanned directory is accepted, one outside it never matches. A missing or flag-shaped value (`--ignore --dry-run`) is a usage error and exits 2.
|
|
104
|
+
|
|
93
105
|
## Programmatic API
|
|
94
106
|
|
|
95
107
|
```ts
|
|
@@ -104,7 +116,7 @@ await sendReport(report, { endpoint: process.env.EDDIE_REPORT_ENDPOINT });
|
|
|
104
116
|
```jsonc
|
|
105
117
|
{
|
|
106
118
|
"schema": "eddie-usage-report/1",
|
|
107
|
-
"reporterVersion": "0.
|
|
119
|
+
"reporterVersion": "0.62.1",
|
|
108
120
|
"generatedAt": "2026-07-14T00:00:00.000Z",
|
|
109
121
|
"event": "build",
|
|
110
122
|
"product": {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cli-args — the eddie-report argument parser, kept pure so it can be tested
|
|
3
|
+
* without spawning the binary. Returns a value or a message; the entry point
|
|
4
|
+
* decides how to exit. Zero dependencies: hand rolled to keep the install tiny.
|
|
5
|
+
*/
|
|
6
|
+
import type { ReportEvent } from './types.js';
|
|
7
|
+
export interface ParsedArgs {
|
|
8
|
+
dir?: string;
|
|
9
|
+
endpoint?: string;
|
|
10
|
+
token?: string;
|
|
11
|
+
event: ReportEvent;
|
|
12
|
+
out?: string;
|
|
13
|
+
ignorePaths: string[];
|
|
14
|
+
ignoreDirs: string[];
|
|
15
|
+
dryRun: boolean;
|
|
16
|
+
json: boolean;
|
|
17
|
+
quiet: boolean;
|
|
18
|
+
help: boolean;
|
|
19
|
+
}
|
|
20
|
+
export type ParseResult = {
|
|
21
|
+
ok: true;
|
|
22
|
+
args: ParsedArgs;
|
|
23
|
+
} | {
|
|
24
|
+
ok: false;
|
|
25
|
+
message: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const VALID_EVENTS: ReportEvent[];
|
|
28
|
+
export declare function parseArgs(argv: string[]): ParseResult;
|
|
29
|
+
export declare const HELP = "eddie-report \u2014 report Eddie asset usage back to Eddie's Brain\n\nUsage:\n eddie-report [dir] [options]\n\nOptions:\n --endpoint <url> Brain ingestion URL (env: EDDIE_REPORT_ENDPOINT)\n --token <token> Bearer token (env: EDDIE_REPORT_TOKEN)\n --event <name> build | deploy | install | ci | dev | manual (default: manual)\n --out <path> Local artifact path (default: .eddie/usage-report.json; '' to skip)\n --ignore <path> Skip a file or directory, relative to dir (repeatable) \u2014 e.g. a\n committed build artifact like css/styles.css, which would\n otherwise report the whole token sheet as usage. Case-sensitive;\n an absolute path inside dir is accepted, one outside never matches.\n --ignore-dir <n> Skip every directory named <n>, anywhere in the tree (repeatable)\n --dry-run Scan and print, but don't POST or write\n --json Print the full report JSON to stdout\n --quiet Suppress the human summary\n -h, --help Show this help\n\nExamples:\n eddie-report --event build --endpoint https://ds.bradfrost.com/report\n eddie-report ./apps/web --dry-run --json\n eddie-report --event ci --ignore css/styles.css --ignore css/styles.tmp.css\n";
|
|
30
|
+
//# sourceMappingURL=cli-args.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-args.d.ts","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,WAAW,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,MAAM,WAAW,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F,eAAO,MAAM,YAAY,EAAE,WAAW,EAA0D,CAAC;AAiBjG,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,WAAW,CAkDrD;AAED,eAAO,MAAM,IAAI,uwCAwBhB,CAAC"}
|
package/dist/cli-args.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* cli-args — the eddie-report argument parser, kept pure so it can be tested
|
|
3
|
+
* without spawning the binary. Returns a value or a message; the entry point
|
|
4
|
+
* decides how to exit. Zero dependencies: hand rolled to keep the install tiny.
|
|
5
|
+
*/
|
|
6
|
+
export const VALID_EVENTS = ['build', 'deploy', 'install', 'ci', 'dev', 'manual'];
|
|
7
|
+
/**
|
|
8
|
+
* Take the value for a value-taking flag. A missing value, or one that looks
|
|
9
|
+
* like another flag, is an error rather than a path: `--ignore --dry-run`
|
|
10
|
+
* used to record "--dry-run" as a path to ignore and then run for real, which
|
|
11
|
+
* is the exact failure a safety flag must not have.
|
|
12
|
+
*/
|
|
13
|
+
function takeValue(argv, i, flag) {
|
|
14
|
+
const value = argv[i + 1];
|
|
15
|
+
if (value === undefined || (value.startsWith('-') && value !== '-')) {
|
|
16
|
+
return { message: `${flag} needs a value${value === undefined ? '' : ` (got "${value}")`}. Try --help.` };
|
|
17
|
+
}
|
|
18
|
+
return { value };
|
|
19
|
+
}
|
|
20
|
+
export function parseArgs(argv) {
|
|
21
|
+
const args = {
|
|
22
|
+
event: 'manual',
|
|
23
|
+
ignorePaths: [],
|
|
24
|
+
ignoreDirs: [],
|
|
25
|
+
dryRun: false,
|
|
26
|
+
json: false,
|
|
27
|
+
quiet: false,
|
|
28
|
+
help: false,
|
|
29
|
+
};
|
|
30
|
+
for (let i = 0; i < argv.length; i++) {
|
|
31
|
+
const a = argv[i];
|
|
32
|
+
switch (a) {
|
|
33
|
+
case '-h':
|
|
34
|
+
case '--help':
|
|
35
|
+
args.help = true;
|
|
36
|
+
break;
|
|
37
|
+
case '--dry-run':
|
|
38
|
+
args.dryRun = true;
|
|
39
|
+
break;
|
|
40
|
+
case '--json':
|
|
41
|
+
args.json = true;
|
|
42
|
+
break;
|
|
43
|
+
case '--quiet':
|
|
44
|
+
args.quiet = true;
|
|
45
|
+
break;
|
|
46
|
+
case '--endpoint':
|
|
47
|
+
case '--token':
|
|
48
|
+
case '--out':
|
|
49
|
+
case '--ignore':
|
|
50
|
+
case '--ignore-dir':
|
|
51
|
+
case '--event': {
|
|
52
|
+
// `--out ''` is legitimate (skip the artifact), so an empty string is a
|
|
53
|
+
// value here; only absence and flag-shaped tokens are rejected.
|
|
54
|
+
const taken = takeValue(argv, i, a);
|
|
55
|
+
if ('message' in taken)
|
|
56
|
+
return { ok: false, message: taken.message };
|
|
57
|
+
i++;
|
|
58
|
+
if (a === '--endpoint')
|
|
59
|
+
args.endpoint = taken.value;
|
|
60
|
+
else if (a === '--token')
|
|
61
|
+
args.token = taken.value;
|
|
62
|
+
else if (a === '--out')
|
|
63
|
+
args.out = taken.value;
|
|
64
|
+
else if (a === '--ignore')
|
|
65
|
+
args.ignorePaths.push(taken.value);
|
|
66
|
+
else if (a === '--ignore-dir')
|
|
67
|
+
args.ignoreDirs.push(taken.value);
|
|
68
|
+
else {
|
|
69
|
+
const v = taken.value;
|
|
70
|
+
if (!VALID_EVENTS.includes(v)) {
|
|
71
|
+
return { ok: false, message: `invalid --event "${v}". Valid: ${VALID_EVENTS.join(', ')}` };
|
|
72
|
+
}
|
|
73
|
+
args.event = v;
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
default:
|
|
78
|
+
if (a.startsWith('-'))
|
|
79
|
+
return { ok: false, message: `unknown option "${a}". Try --help.` };
|
|
80
|
+
args.dir = a; // first positional is the directory
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return { ok: true, args };
|
|
84
|
+
}
|
|
85
|
+
export const HELP = `eddie-report — report Eddie asset usage back to Eddie's Brain
|
|
86
|
+
|
|
87
|
+
Usage:
|
|
88
|
+
eddie-report [dir] [options]
|
|
89
|
+
|
|
90
|
+
Options:
|
|
91
|
+
--endpoint <url> Brain ingestion URL (env: EDDIE_REPORT_ENDPOINT)
|
|
92
|
+
--token <token> Bearer token (env: EDDIE_REPORT_TOKEN)
|
|
93
|
+
--event <name> build | deploy | install | ci | dev | manual (default: manual)
|
|
94
|
+
--out <path> Local artifact path (default: .eddie/usage-report.json; '' to skip)
|
|
95
|
+
--ignore <path> Skip a file or directory, relative to dir (repeatable) — e.g. a
|
|
96
|
+
committed build artifact like css/styles.css, which would
|
|
97
|
+
otherwise report the whole token sheet as usage. Case-sensitive;
|
|
98
|
+
an absolute path inside dir is accepted, one outside never matches.
|
|
99
|
+
--ignore-dir <n> Skip every directory named <n>, anywhere in the tree (repeatable)
|
|
100
|
+
--dry-run Scan and print, but don't POST or write
|
|
101
|
+
--json Print the full report JSON to stdout
|
|
102
|
+
--quiet Suppress the human summary
|
|
103
|
+
-h, --help Show this help
|
|
104
|
+
|
|
105
|
+
Examples:
|
|
106
|
+
eddie-report --event build --endpoint https://ds.bradfrost.com/report
|
|
107
|
+
eddie-report ./apps/web --dry-run --json
|
|
108
|
+
eddie-report --event ci --ignore css/styles.css --ignore css/styles.tmp.css
|
|
109
|
+
`;
|
|
110
|
+
//# sourceMappingURL=cli-args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-args.js","sourceRoot":"","sources":["../src/cli-args.ts"],"names":[],"mappings":"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,IAAI,CAAC,EAAE,EAAE,CAAC;oBAC7F,CAAC;oBACD,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;gBACjB,CAAC;gBACD,MAAM;YACR,CAAC;YACD;gBACE,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;oBAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,mBAAmB,CAAC,gBAAgB,EAAE,CAAC;gBAC3F,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,oCAAoC;QACtD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC5B,CAAC;AAED,MAAM,CAAC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwBnB,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -15,13 +15,18 @@
|
|
|
15
15
|
* --token <token> Bearer token (or set EDDIE_REPORT_TOKEN).
|
|
16
16
|
* --event <name> build | deploy | install | ci | dev | manual (default: manual).
|
|
17
17
|
* --out <path> Local artifact path (default: .eddie/usage-report.json). '' to skip.
|
|
18
|
+
* --ignore <path> Skip a file or directory relative to dir (repeatable) — committed
|
|
19
|
+
* build output such as css/styles.css (#1856).
|
|
20
|
+
* --ignore-dir <n> Skip every directory named <n> (repeatable).
|
|
18
21
|
* --dry-run Scan and print, but don't POST or write.
|
|
19
22
|
* --json Print the full report JSON to stdout.
|
|
20
23
|
* --quiet Suppress the human summary.
|
|
21
24
|
* -h, --help Show help.
|
|
22
25
|
*
|
|
23
26
|
* Exit code is always 0 on a successful scan, even if the beacon fails — a
|
|
24
|
-
* usage report must never break a build.
|
|
27
|
+
* usage report must never break a build. The one exception is a usage error
|
|
28
|
+
* (unknown flag, missing value): that exits 2 so a broken CI step is seen.
|
|
29
|
+
* Use --json in CI to inspect delivery.
|
|
25
30
|
*/
|
|
26
31
|
export {};
|
|
27
32
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG"}
|
package/dist/cli.js
CHANGED
|
@@ -15,83 +15,22 @@
|
|
|
15
15
|
* --token <token> Bearer token (or set EDDIE_REPORT_TOKEN).
|
|
16
16
|
* --event <name> build | deploy | install | ci | dev | manual (default: manual).
|
|
17
17
|
* --out <path> Local artifact path (default: .eddie/usage-report.json). '' to skip.
|
|
18
|
+
* --ignore <path> Skip a file or directory relative to dir (repeatable) — committed
|
|
19
|
+
* build output such as css/styles.css (#1856).
|
|
20
|
+
* --ignore-dir <n> Skip every directory named <n> (repeatable).
|
|
18
21
|
* --dry-run Scan and print, but don't POST or write.
|
|
19
22
|
* --json Print the full report JSON to stdout.
|
|
20
23
|
* --quiet Suppress the human summary.
|
|
21
24
|
* -h, --help Show help.
|
|
22
25
|
*
|
|
23
26
|
* Exit code is always 0 on a successful scan, even if the beacon fails — a
|
|
24
|
-
* usage report must never break a build.
|
|
27
|
+
* usage report must never break a build. The one exception is a usage error
|
|
28
|
+
* (unknown flag, missing value): that exits 2 so a broken CI step is seen.
|
|
29
|
+
* Use --json in CI to inspect delivery.
|
|
25
30
|
*/
|
|
26
31
|
import { buildReport } from './report.js';
|
|
27
32
|
import { sendReport } from './transport.js';
|
|
28
|
-
|
|
29
|
-
function parseArgs(argv) {
|
|
30
|
-
const args = { event: 'manual', dryRun: false, json: false, quiet: false, help: false };
|
|
31
|
-
for (let i = 0; i < argv.length; i++) {
|
|
32
|
-
const a = argv[i];
|
|
33
|
-
switch (a) {
|
|
34
|
-
case '-h':
|
|
35
|
-
case '--help':
|
|
36
|
-
args.help = true;
|
|
37
|
-
break;
|
|
38
|
-
case '--dry-run':
|
|
39
|
-
args.dryRun = true;
|
|
40
|
-
break;
|
|
41
|
-
case '--json':
|
|
42
|
-
args.json = true;
|
|
43
|
-
break;
|
|
44
|
-
case '--quiet':
|
|
45
|
-
args.quiet = true;
|
|
46
|
-
break;
|
|
47
|
-
case '--endpoint':
|
|
48
|
-
args.endpoint = argv[++i];
|
|
49
|
-
break;
|
|
50
|
-
case '--token':
|
|
51
|
-
args.token = argv[++i];
|
|
52
|
-
break;
|
|
53
|
-
case '--out':
|
|
54
|
-
args.out = argv[++i];
|
|
55
|
-
break;
|
|
56
|
-
case '--event': {
|
|
57
|
-
const v = argv[++i];
|
|
58
|
-
if (VALID_EVENTS.includes(v))
|
|
59
|
-
args.event = v;
|
|
60
|
-
else {
|
|
61
|
-
process.stderr.write(`eddie-report: invalid --event "${v}". Valid: ${VALID_EVENTS.join(', ')}\n`);
|
|
62
|
-
process.exit(2);
|
|
63
|
-
}
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
default:
|
|
67
|
-
if (a.startsWith('-')) {
|
|
68
|
-
process.stderr.write(`eddie-report: unknown option "${a}". Try --help.\n`);
|
|
69
|
-
process.exit(2);
|
|
70
|
-
}
|
|
71
|
-
args.dir = a; // first positional is the directory
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return args;
|
|
75
|
-
}
|
|
76
|
-
const HELP = `eddie-report — report Eddie asset usage back to Eddie's Brain
|
|
77
|
-
|
|
78
|
-
Usage:
|
|
79
|
-
eddie-report [dir] [options]
|
|
80
|
-
|
|
81
|
-
Options:
|
|
82
|
-
--endpoint <url> Brain ingestion URL (env: EDDIE_REPORT_ENDPOINT)
|
|
83
|
-
--token <token> Bearer token (env: EDDIE_REPORT_TOKEN)
|
|
84
|
-
--event <name> build | deploy | install | ci | dev | manual (default: manual)
|
|
85
|
-
--out <path> Local artifact path (default: .eddie/usage-report.json; '' to skip)
|
|
86
|
-
--dry-run Scan and print, but don't POST or write
|
|
87
|
-
--json Print the full report JSON to stdout
|
|
88
|
-
--quiet Suppress the human summary
|
|
89
|
-
-h, --help Show this help
|
|
90
|
-
|
|
91
|
-
Examples:
|
|
92
|
-
eddie-report --event build --endpoint https://ds.bradfrost.com/report
|
|
93
|
-
eddie-report ./apps/web --dry-run --json
|
|
94
|
-
`;
|
|
33
|
+
import { HELP, parseArgs } from './cli-args.js';
|
|
95
34
|
/** Render a short human summary of the report + delivery result. */
|
|
96
35
|
function printSummary(report, delivery) {
|
|
97
36
|
const t = report.totals;
|
|
@@ -111,14 +50,21 @@ function printSummary(report, delivery) {
|
|
|
111
50
|
process.stdout.write(lines.join('\n'));
|
|
112
51
|
}
|
|
113
52
|
async function main() {
|
|
114
|
-
const
|
|
53
|
+
const parsed = parseArgs(process.argv.slice(2));
|
|
54
|
+
if (!parsed.ok) {
|
|
55
|
+
// Usage errors are the one thing that exits non-zero: a misspelt flag in a
|
|
56
|
+
// CI step must be visible, not a silently absent beacon.
|
|
57
|
+
process.stderr.write(`eddie-report: ${parsed.message}\n`);
|
|
58
|
+
process.exit(2);
|
|
59
|
+
}
|
|
60
|
+
const { args } = parsed;
|
|
115
61
|
if (args.help) {
|
|
116
62
|
process.stdout.write(HELP);
|
|
117
63
|
return;
|
|
118
64
|
}
|
|
119
65
|
const endpoint = args.endpoint ?? process.env.EDDIE_REPORT_ENDPOINT;
|
|
120
66
|
const token = args.token ?? process.env.EDDIE_REPORT_TOKEN;
|
|
121
|
-
const report = buildReport({ dir: args.dir, event: args.event });
|
|
67
|
+
const report = buildReport({ dir: args.dir, event: args.event, ignorePaths: args.ignorePaths, ignoreDirs: args.ignoreDirs });
|
|
122
68
|
const result = await sendReport(report, {
|
|
123
69
|
endpoint,
|
|
124
70
|
token,
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli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AM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"product.d.ts","sourceRoot":"","sources":["../src/product.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAqB,MAAM,YAAY,CAAC;AAsI1F,4EAA4E;AAC5E,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB,CAczE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAenE"}
|
package/dist/product.js
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Everything here is best-effort: any field that can't be resolved is simply
|
|
8
8
|
* omitted. A report with just a directory name for an id is still useful.
|
|
9
9
|
*/
|
|
10
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
11
|
-
import { basename, join, resolve } from 'node:path';
|
|
10
|
+
import { existsSync, readFileSync, statSync } from 'node:fs';
|
|
11
|
+
import { basename, dirname, join, resolve } from 'node:path';
|
|
12
12
|
const EDDIE_PKG_PREFIX = '@brad-frost-web/eddie-';
|
|
13
13
|
function readPackageJson(dir) {
|
|
14
14
|
const path = join(dir, 'package.json');
|
|
@@ -28,11 +28,49 @@ function parseRepoSlug(remoteUrl) {
|
|
|
28
28
|
const m = cleaned.match(/[:/]([^/:]+)\/([^/]+)$/);
|
|
29
29
|
return m ? `${m[1]}/${m[2]}` : undefined;
|
|
30
30
|
}
|
|
31
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* Find the `.git` that governs `dir`, walking UP toward the filesystem root. A
|
|
33
|
+
* workspace inside a monorepo (`packages/app`) has no `.git` of its own; before
|
|
34
|
+
* this walk such a product reported no repo, branch or commit at all
|
|
35
|
+
* (we-are-here#191). A `.git` file's `gitdir:` pointer is followed once, and
|
|
36
|
+
* its `commondir` (worktrees) once more.
|
|
37
|
+
*/
|
|
38
|
+
function findGitDirs(startDir) {
|
|
39
|
+
let dir = resolve(startDir);
|
|
40
|
+
for (;;) {
|
|
41
|
+
const candidate = join(dir, '.git');
|
|
42
|
+
if (existsSync(candidate)) {
|
|
43
|
+
try {
|
|
44
|
+
if (statSync(candidate).isDirectory())
|
|
45
|
+
return { gitDir: candidate, commonDir: candidate };
|
|
46
|
+
const pointer = readFileSync(candidate, 'utf-8').match(/^gitdir:\s*(.+)$/m);
|
|
47
|
+
if (pointer) {
|
|
48
|
+
const gitDir = resolve(dir, pointer[1].trim());
|
|
49
|
+
if (!existsSync(gitDir))
|
|
50
|
+
return undefined;
|
|
51
|
+
const commondirFile = join(gitDir, 'commondir');
|
|
52
|
+
const commonDir = existsSync(commondirFile)
|
|
53
|
+
? resolve(gitDir, readFileSync(commondirFile, 'utf-8').trim())
|
|
54
|
+
: gitDir;
|
|
55
|
+
return { gitDir, commonDir };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const parent = dirname(dir);
|
|
63
|
+
if (parent === dir)
|
|
64
|
+
return undefined;
|
|
65
|
+
dir = parent;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/** Read branch + commit + origin remote directly from the governing git directories. */
|
|
32
69
|
function readGitInfo(dir) {
|
|
33
|
-
const
|
|
34
|
-
if (!
|
|
70
|
+
const dirs = findGitDirs(dir);
|
|
71
|
+
if (!dirs)
|
|
35
72
|
return {};
|
|
73
|
+
const { gitDir, commonDir } = dirs;
|
|
36
74
|
const info = {};
|
|
37
75
|
// HEAD → branch (and commit, when HEAD is detached).
|
|
38
76
|
try {
|
|
@@ -41,13 +79,14 @@ function readGitInfo(dir) {
|
|
|
41
79
|
if (refMatch) {
|
|
42
80
|
const ref = refMatch[1].trim();
|
|
43
81
|
info.branch = ref.replace(/^refs\/heads\//, '');
|
|
44
|
-
// Resolve the ref to a SHA, trying the loose ref then packed-refs
|
|
45
|
-
|
|
82
|
+
// Resolve the ref to a SHA, trying the loose ref then packed-refs — both
|
|
83
|
+
// live in the common dir (the main repo, for a linked worktree).
|
|
84
|
+
const looseRef = join(commonDir, ref);
|
|
46
85
|
if (existsSync(looseRef)) {
|
|
47
86
|
info.commit = readFileSync(looseRef, 'utf-8').trim();
|
|
48
87
|
}
|
|
49
|
-
else if (existsSync(join(
|
|
50
|
-
const packed = readFileSync(join(
|
|
88
|
+
else if (existsSync(join(commonDir, 'packed-refs'))) {
|
|
89
|
+
const packed = readFileSync(join(commonDir, 'packed-refs'), 'utf-8');
|
|
51
90
|
const line = packed.split('\n').find((l) => l.endsWith(` ${ref}`));
|
|
52
91
|
if (line)
|
|
53
92
|
info.commit = line.split(' ')[0];
|
|
@@ -62,7 +101,7 @@ function readGitInfo(dir) {
|
|
|
62
101
|
}
|
|
63
102
|
// origin remote → owner/repo slug.
|
|
64
103
|
try {
|
|
65
|
-
const config = readFileSync(join(
|
|
104
|
+
const config = readFileSync(join(commonDir, 'config'), 'utf-8');
|
|
66
105
|
const originBlock = config.split(/\[/).find((b) => b.startsWith('remote "origin"'));
|
|
67
106
|
const urlMatch = originBlock?.match(/url\s*=\s*(.+)/);
|
|
68
107
|
if (urlMatch)
|
package/dist/product.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.js","sourceRoot":"","sources":["../src/product.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"product.js","sourceRoot":"","sources":["../src/product.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG7D,MAAM,gBAAgB,GAAG,wBAAwB,CAAC;AAQlD,SAAS,eAAe,C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AC,gBAAgB,CAAC;gBAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC;QAClE,CAAC;IACH,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;SACnC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;SAC3C,IAAI,EAAE,CAAC;IAEV,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAW;IAChD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,GAAG,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IAElC,MAAM,EAAE,GAAG,GAAG,EAAE,IAAI,IAAI,GAAG,CAAC,IAAI,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEvD,OAAO;QACL,EAAE;QACF,IAAI,EAAE,GAAG,EAAE,IAAI;QACf,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,WAAW,EAAE,iBAAiB,EAAE;KACjC,CAAC;AACJ,CAAC"}
|
package/dist/report.d.ts
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { type ScanOptions } from './scanner.js';
|
|
6
6
|
import { type ReportEvent, type UsageReport } from './types.js';
|
|
7
|
-
|
|
8
|
-
export
|
|
7
|
+
import { REPORTER_VERSION } from './version.js';
|
|
8
|
+
export { REPORTER_VERSION };
|
|
9
9
|
export interface BuildReportOptions extends ScanOptions {
|
|
10
10
|
/** Directory to scan and identify. Defaults to cwd. */
|
|
11
11
|
dir?: string;
|
package/dist/report.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAiB,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAiB,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,MAAM,WAAW,kBAAmB,SAAQ,WAAW;IACrD,uDAAuD;IACvD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAMD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,kBAAuB,GAAG,WAAW,CA4BzE"}
|
package/dist/report.js
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import { scanUsage } from './scanner.js';
|
|
6
6
|
import { resolveEddieDependencies, resolveProductIdentity } from './product.js';
|
|
7
7
|
import { REPORT_SCHEMA } from './types.js';
|
|
8
|
-
|
|
9
|
-
export
|
|
8
|
+
import { REPORTER_VERSION } from './version.js';
|
|
9
|
+
export { REPORTER_VERSION };
|
|
10
10
|
const distinct = (m) => Object.keys(m).length;
|
|
11
11
|
const sum = (m) => Object.values(m).reduce((a, b) => a + b, 0);
|
|
12
12
|
/**
|
package/dist/report.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,aAAa,EAAsC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../src/report.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,aAAa,EAAsC,MAAM,YAAY,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAc5B,MAAM,QAAQ,GAAG,CAAC,CAAyB,EAAU,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAC9E,MAAM,GAAG,GAAG,CAAC,CAAyB,EAAU,EAAE,CAChD,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AAE9C;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,UAA8B,EAAE;IAC1D,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IACzC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,QAAQ,CAAC;IACxC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAE5D,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC;IAC5C,MAAM,KAAK,GAAG,wBAAwB,CAAC,GAAG,CAAC,CAAC;IAE5C,MAAM,WAAW,GACf,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAEpF,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,eAAe,EAAE,gBAAgB;QACjC,WAAW;QACX,KAAK;QACL,OAAO;QACP,KAAK;QACL,KAAK;QACL,MAAM,EAAE;YACN,kBAAkB,EAAE,QAAQ,CAAC,KAAK,CAAC,UAAU,CAAC;YAC9C,eAAe,EAAE,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC;YACxC,aAAa,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC;YACpC,cAAc,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC;YACtC,WAAW;SACZ;KACF,CAAC;AACJ,CAAC"}
|
package/dist/scanner.d.ts
CHANGED
|
@@ -21,6 +21,21 @@ export interface ScanOptions {
|
|
|
21
21
|
maxFiles?: number;
|
|
22
22
|
/** Extra directory names to ignore, merged with the defaults. */
|
|
23
23
|
ignoreDirs?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Paths to skip, relative to the scanned directory, each matched as an
|
|
26
|
+
* exact file or as a directory prefix (`css/vendor` skips everything under
|
|
27
|
+
* it). For build output that lives beside its sources — a committed
|
|
28
|
+
* `css/styles.css` compiled from `css/*.scss` inlines the entire token
|
|
29
|
+
* sheet and would report the design system to itself (#1856).
|
|
30
|
+
*
|
|
31
|
+
* Normalisation, decided rather than accidental: `./` prefixes and trailing
|
|
32
|
+
* slashes are dropped; backslashes are treated as separators (a Windows
|
|
33
|
+
* user pasting `css\styles.css` is far likelier than a web-source filename
|
|
34
|
+
* containing `\`); an absolute path INSIDE the scanned directory is
|
|
35
|
+
* accepted; one outside it, or a `../` escape, can never match and is
|
|
36
|
+
* dropped. Matching is case-sensitive, like the filesystems CI runs on.
|
|
37
|
+
*/
|
|
38
|
+
ignorePaths?: string[];
|
|
24
39
|
}
|
|
25
40
|
export interface ScanResult {
|
|
26
41
|
components: Record<string, number>;
|
package/dist/scanner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../src/scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAkCH,MAAM,WAAW,WAAW;IAC1B,+FAA+F;IAC/F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../src/scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAkCH,MAAM,WAAW,WAAW;IAC1B,+FAA+F;IAC/F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iEAAiE;IACjE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;;;;;;;;;;;OAaG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACtB;AAwCD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,UAAU,CAiE5E"}
|
package/dist/scanner.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Both are counted by occurrence, across every scanned file.
|
|
16
16
|
*/
|
|
17
17
|
import { readdirSync, readFileSync, statSync } from 'node:fs';
|
|
18
|
-
import { join, extname } from 'node:path';
|
|
18
|
+
import { join, extname, isAbsolute, relative, resolve, sep } from 'node:path';
|
|
19
19
|
/** File extensions worth scanning for Eddie markup and token references. */
|
|
20
20
|
const SCANNED_EXTENSIONS = new Set([
|
|
21
21
|
'.html', '.htm',
|
|
@@ -89,6 +89,19 @@ export function scanUsage(dir, options = {}) {
|
|
|
89
89
|
const ignore = new Set(IGNORED_DIRS);
|
|
90
90
|
for (const d of options.ignoreDirs ?? [])
|
|
91
91
|
ignore.add(d);
|
|
92
|
+
const root = resolve(dir);
|
|
93
|
+
const ignorePaths = (options.ignorePaths ?? [])
|
|
94
|
+
.filter((p) => typeof p === 'string')
|
|
95
|
+
.map((p) => p.replace(/\\/g, '/'))
|
|
96
|
+
.map((p) => (isAbsolute(p) ? relative(root, p).split(sep).join('/') : p))
|
|
97
|
+
.map((p) => p.replace(/^\.\//, '').replace(/\/+$/, ''))
|
|
98
|
+
.filter((p) => p.length > 0 && p !== '.' && !p.startsWith('../') && p !== '..');
|
|
99
|
+
const isIgnoredPath = (full) => {
|
|
100
|
+
if (ignorePaths.length === 0)
|
|
101
|
+
return false;
|
|
102
|
+
const rel = relative(root, full).split(sep).join('/');
|
|
103
|
+
return ignorePaths.some((p) => rel === p || rel.startsWith(`${p}/`));
|
|
104
|
+
};
|
|
92
105
|
const result = {
|
|
93
106
|
components: {},
|
|
94
107
|
recipes: {},
|
|
@@ -112,7 +125,7 @@ export function scanUsage(dir, options = {}) {
|
|
|
112
125
|
for (const entry of entries) {
|
|
113
126
|
const full = join(current, entry.name);
|
|
114
127
|
if (entry.isDirectory()) {
|
|
115
|
-
if (ignore.has(entry.name) || entry.name.startsWith('.'))
|
|
128
|
+
if (ignore.has(entry.name) || entry.name.startsWith('.') || isIgnoredPath(full))
|
|
116
129
|
continue;
|
|
117
130
|
stack.push(full);
|
|
118
131
|
continue;
|
|
@@ -121,6 +134,8 @@ export function scanUsage(dir, options = {}) {
|
|
|
121
134
|
continue;
|
|
122
135
|
if (!SCANNED_EXTENSIONS.has(extname(entry.name).toLowerCase()))
|
|
123
136
|
continue;
|
|
137
|
+
if (isIgnoredPath(full))
|
|
138
|
+
continue;
|
|
124
139
|
if (result.filesScanned >= maxFiles)
|
|
125
140
|
break;
|
|
126
141
|
try {
|
package/dist/scanner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner.js","sourceRoot":"","sources":["../src/scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"scanner.js","sourceRoot":"","sources":["../src/scanner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAE9E,4EAA4E;AAC5E,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC;IACjC,OAAO,EAAE,MAAM;IACf,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAC5C,MA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aAAa,CAAC,IAAI,CAAC;oBAAE,SAAS;gBAC1F,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACjB,SAAS;YACX,CAAC;YACD,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;gBAAE,SAAS;YAC9B,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;gBAAE,SAAS;YACzE,IAAI,aAAa,CAAC,IAAI,CAAC;gBAAE,SAAS;YAClC,IAAI,MAAM,CAAC,YAAY,IAAI,QAAQ;gBAAE,MAAM;YAE3C,IAAI,CAAC;gBACH,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;gBAChC,IAAI,IAAI,GAAG,YAAY;oBAAE,SAAS;gBAClC,MAAM,CAAC,YAAY,EAAE,CAAC;gBACtB,MAAM,IAAI,GAAG,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBACzC,IAAI,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC;oBAAE,MAAM,CAAC,YAAY,EAAE,CAAC;YACpD,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The reporter's own version, stamped into every report as `reporterVersion`
|
|
3
|
+
* so the Brain can tell which report shape a product runs.
|
|
4
|
+
*
|
|
5
|
+
* Rewritten by `scripts/update-version.mjs` on every bump and pinned to the
|
|
6
|
+
* root version by `packages/eddie-brain/test/version-lockstep.test.ts`. It
|
|
7
|
+
* used to be a hand-maintained literal in report.ts, which the bumper never
|
|
8
|
+
* touched: every beacon claimed 0.39.0 for twenty-three minor versions
|
|
9
|
+
* (#1845).
|
|
10
|
+
*/
|
|
11
|
+
export declare const REPORTER_VERSION = "0.63.0";
|
|
12
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,WAAW,CAAC"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The reporter's own version, stamped into every report as `reporterVersion`
|
|
3
|
+
* so the Brain can tell which report shape a product runs.
|
|
4
|
+
*
|
|
5
|
+
* Rewritten by `scripts/update-version.mjs` on every bump and pinned to the
|
|
6
|
+
* root version by `packages/eddie-brain/test/version-lockstep.test.ts`. It
|
|
7
|
+
* used to be a hand-maintained literal in report.ts, which the bumper never
|
|
8
|
+
* touched: every beacon claimed 0.39.0 for twenty-three minor versions
|
|
9
|
+
* (#1845).
|
|
10
|
+
*/
|
|
11
|
+
export const REPORTER_VERSION = '0.63.0';
|
|
12
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brad-frost-web/eddie-reporter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.63.0",
|
|
4
4
|
"description": "The Eddie-reporter \u2014 a zero-dependency usage reporter installed on downstream Eddie products. It statically scans a product for Eddie asset usage (components, recipes, pages, tokens) and reports the activity back to Eddie's Brain, so adoption and activity of the design system can be tracked as a living feedback loop.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|