@component-compass/cli 0.1.22 → 0.1.24
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/cli.js +103503 -104
- package/package.json +21 -25
- package/dist/auth/browser.d.ts +0 -13
- package/dist/auth/browser.js +0 -21
- package/dist/auth/browser.js.map +0 -1
- package/dist/auth/client.d.ts +0 -48
- package/dist/auth/client.js +0 -89
- package/dist/auth/client.js.map +0 -1
- package/dist/auth/paths.d.ts +0 -2
- package/dist/auth/paths.js +0 -14
- package/dist/auth/paths.js.map +0 -1
- package/dist/auth/session.d.ts +0 -38
- package/dist/auth/session.js +0 -88
- package/dist/auth/session.js.map +0 -1
- package/dist/auth/store.d.ts +0 -16
- package/dist/auth/store.js +0 -37
- package/dist/auth/store.js.map +0 -1
- package/dist/auth/upload-auth.d.ts +0 -22
- package/dist/auth/upload-auth.js +0 -51
- package/dist/auth/upload-auth.js.map +0 -1
- package/dist/cli/help.d.ts +0 -4
- package/dist/cli/help.js +0 -52
- package/dist/cli/help.js.map +0 -1
- package/dist/cli/parse.d.ts +0 -14
- package/dist/cli/parse.js +0 -75
- package/dist/cli/parse.js.map +0 -1
- package/dist/cli/suggest.d.ts +0 -4
- package/dist/cli/suggest.js +0 -38
- package/dist/cli/suggest.js.map +0 -1
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js.map +0 -1
- package/dist/commands/auth.d.ts +0 -33
- package/dist/commands/auth.js +0 -248
- package/dist/commands/auth.js.map +0 -1
- package/dist/commands/init.d.ts +0 -11
- package/dist/commands/init.js +0 -112
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/scan.d.ts +0 -33
- package/dist/commands/scan.js +0 -745
- package/dist/commands/scan.js.map +0 -1
- package/dist/composition-rollup.d.ts +0 -23
- package/dist/composition-rollup.js +0 -64
- package/dist/composition-rollup.js.map +0 -1
- package/dist/config/loader.d.ts +0 -6
- package/dist/config/loader.js +0 -71
- package/dist/config/loader.js.map +0 -1
- package/dist/config/schema.d.ts +0 -18
- package/dist/config/schema.js +0 -15
- package/dist/config/schema.js.map +0 -1
- package/dist/dispatcher.d.ts +0 -8
- package/dist/dispatcher.js +0 -22
- package/dist/dispatcher.js.map +0 -1
- package/dist/envelope/git.d.ts +0 -13
- package/dist/envelope/git.js +0 -69
- package/dist/envelope/git.js.map +0 -1
- package/dist/envelope/index.d.ts +0 -1
- package/dist/envelope/index.js +0 -12
- package/dist/envelope/index.js.map +0 -1
- package/dist/envelope/repo-id.d.ts +0 -16
- package/dist/envelope/repo-id.js +0 -40
- package/dist/envelope/repo-id.js.map +0 -1
- package/dist/identity.d.ts +0 -56
- package/dist/identity.js +0 -115
- package/dist/identity.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
- package/dist/local-index/declared-props.d.ts +0 -15
- package/dist/local-index/declared-props.js +0 -101
- package/dist/local-index/declared-props.js.map +0 -1
- package/dist/local-index/detect-react.d.ts +0 -3
- package/dist/local-index/detect-react.js +0 -378
- package/dist/local-index/detect-react.js.map +0 -1
- package/dist/local-index/detect-vue.d.ts +0 -16
- package/dist/local-index/detect-vue.js +0 -284
- package/dist/local-index/detect-vue.js.map +0 -1
- package/dist/local-index/detect-wc.d.ts +0 -8
- package/dist/local-index/detect-wc.js +0 -70
- package/dist/local-index/detect-wc.js.map +0 -1
- package/dist/local-index/index.d.ts +0 -14
- package/dist/local-index/index.js +0 -46
- package/dist/local-index/index.js.map +0 -1
- package/dist/local-index/types.d.ts +0 -2
- package/dist/local-index/types.js +0 -2
- package/dist/local-index/types.js.map +0 -1
- package/dist/manifest/barrel-parser.d.ts +0 -35
- package/dist/manifest/barrel-parser.js +0 -76
- package/dist/manifest/barrel-parser.js.map +0 -1
- package/dist/manifest/lazy-resolver.d.ts +0 -123
- package/dist/manifest/lazy-resolver.js +0 -712
- package/dist/manifest/lazy-resolver.js.map +0 -1
- package/dist/occurrences.d.ts +0 -15
- package/dist/occurrences.js +0 -101
- package/dist/occurrences.js.map +0 -1
- package/dist/parse-by-ext.d.ts +0 -21
- package/dist/parse-by-ext.js +0 -53
- package/dist/parse-by-ext.js.map +0 -1
- package/dist/prompts/adapter.d.ts +0 -43
- package/dist/prompts/adapter.js +0 -32
- package/dist/prompts/adapter.js.map +0 -1
- package/dist/reporter/index.d.ts +0 -39
- package/dist/reporter/index.js +0 -144
- package/dist/reporter/index.js.map +0 -1
- package/dist/reporter/json.d.ts +0 -6
- package/dist/reporter/json.js +0 -11
- package/dist/reporter/json.js.map +0 -1
- package/dist/reporter/stdout.d.ts +0 -3
- package/dist/reporter/stdout.js +0 -41
- package/dist/reporter/stdout.js.map +0 -1
- package/dist/rollup.d.ts +0 -26
- package/dist/rollup.js +0 -135
- package/dist/rollup.js.map +0 -1
- package/dist/scan/cem-index.d.ts +0 -38
- package/dist/scan/cem-index.js +0 -139
- package/dist/scan/cem-index.js.map +0 -1
- package/dist/scan/entry-packages.d.ts +0 -42
- package/dist/scan/entry-packages.js +0 -87
- package/dist/scan/entry-packages.js.map +0 -1
- package/dist/scan/framework-root.d.ts +0 -1
- package/dist/scan/framework-root.js +0 -22
- package/dist/scan/framework-root.js.map +0 -1
- package/dist/scan/git-mtime.d.ts +0 -2
- package/dist/scan/git-mtime.js +0 -22
- package/dist/scan/git-mtime.js.map +0 -1
- package/dist/scan/global-components.d.ts +0 -37
- package/dist/scan/global-components.js +0 -228
- package/dist/scan/global-components.js.map +0 -1
- package/dist/scan/meta.d.ts +0 -5
- package/dist/scan/meta.js +0 -58
- package/dist/scan/meta.js.map +0 -1
- package/dist/scan/stamp-version.d.ts +0 -18
- package/dist/scan/stamp-version.js +0 -94
- package/dist/scan/stamp-version.js.map +0 -1
- package/dist/scan/wrap-relationships.d.ts +0 -12
- package/dist/scan/wrap-relationships.js +0 -38
- package/dist/scan/wrap-relationships.js.map +0 -1
- package/dist/seeds.d.ts +0 -81
- package/dist/seeds.js +0 -258
- package/dist/seeds.js.map +0 -1
- package/dist/types/brand.d.ts +0 -11
- package/dist/types/brand.js +0 -5
- package/dist/types/brand.js.map +0 -1
- package/dist/types/component-id.d.ts +0 -2
- package/dist/types/component-id.js +0 -2
- package/dist/types/component-id.js.map +0 -1
- package/dist/types.d.ts +0 -13
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/upload.d.ts +0 -18
- package/dist/upload.js +0 -34
- package/dist/upload.js.map +0 -1
- package/dist/util/color.d.ts +0 -24
- package/dist/util/color.js +0 -45
- package/dist/util/color.js.map +0 -1
- package/dist/util/git.d.ts +0 -10
- package/dist/util/git.js +0 -95
- package/dist/util/git.js.map +0 -1
- package/dist/util/interactive.d.ts +0 -17
- package/dist/util/interactive.js +0 -19
- package/dist/util/interactive.js.map +0 -1
- package/dist/util/log.d.ts +0 -9
- package/dist/util/log.js +0 -20
- package/dist/util/log.js.map +0 -1
- package/dist/util/pkg.d.ts +0 -1
- package/dist/util/pkg.js +0 -13
- package/dist/util/pkg.js.map +0 -1
- package/dist/util/pnp-check.d.ts +0 -1
- package/dist/util/pnp-check.js +0 -6
- package/dist/util/pnp-check.js.map +0 -1
- package/dist/util/posix.d.ts +0 -2
- package/dist/util/posix.js +0 -15
- package/dist/util/posix.js.map +0 -1
- package/dist/util/progress.d.ts +0 -21
- package/dist/util/progress.js +0 -54
- package/dist/util/progress.js.map +0 -1
- package/dist/util/version.d.ts +0 -7
- package/dist/util/version.js +0 -13
- package/dist/util/version.js.map +0 -1
- package/dist/walker/bounded-definition-resolver.d.ts +0 -9
- package/dist/walker/bounded-definition-resolver.js +0 -125
- package/dist/walker/bounded-definition-resolver.js.map +0 -1
- package/dist/walker/files.d.ts +0 -7
- package/dist/walker/files.js +0 -24
- package/dist/walker/files.js.map +0 -1
- package/dist/walker/package-alias-layers.d.ts +0 -7
- package/dist/walker/package-alias-layers.js +0 -40
- package/dist/walker/package-alias-layers.js.map +0 -1
- package/dist/walker/resolve-import.d.ts +0 -25
- package/dist/walker/resolve-import.js +0 -243
- package/dist/walker/resolve-import.js.map +0 -1
- package/dist/walker/tsconfig-discovery.d.ts +0 -36
- package/dist/walker/tsconfig-discovery.js +0 -52
- package/dist/walker/tsconfig-discovery.js.map +0 -1
- package/dist/walker/tsconfig-loader.d.ts +0 -35
- package/dist/walker/tsconfig-loader.js +0 -138
- package/dist/walker/tsconfig-loader.js.map +0 -1
- package/dist/walker/workspace-exports.d.ts +0 -3
- package/dist/walker/workspace-exports.js +0 -120
- package/dist/walker/workspace-exports.js.map +0 -1
- package/dist/workspace/build-graph.d.ts +0 -15
- package/dist/workspace/build-graph.js +0 -120
- package/dist/workspace/build-graph.js.map +0 -1
- package/dist/workspace/declared-deps.d.ts +0 -5
- package/dist/workspace/declared-deps.js +0 -42
- package/dist/workspace/declared-deps.js.map +0 -1
- package/dist/workspace/find-owning-package.d.ts +0 -8
- package/dist/workspace/find-owning-package.js +0 -69
- package/dist/workspace/find-owning-package.js.map +0 -1
- package/dist/workspace/find-workspace-root.d.ts +0 -1
- package/dist/workspace/find-workspace-root.js +0 -60
- package/dist/workspace/find-workspace-root.js.map +0 -1
- package/dist/workspace/index.d.ts +0 -4
- package/dist/workspace/index.js +0 -4
- package/dist/workspace/index.js.map +0 -1
- package/dist/workspace/types.d.ts +0 -49
- package/dist/workspace/types.js +0 -13
- package/dist/workspace/types.js.map +0 -1
package/dist/util/log.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createColor } from "./color.js";
|
|
2
|
-
export class Logger {
|
|
3
|
-
quiet;
|
|
4
|
-
color;
|
|
5
|
-
constructor(quiet = false, color = createColor({ isTTY: Boolean(process.stderr.isTTY) })) {
|
|
6
|
-
this.quiet = quiet;
|
|
7
|
-
this.color = color;
|
|
8
|
-
}
|
|
9
|
-
info(msg) {
|
|
10
|
-
if (!this.quiet)
|
|
11
|
-
process.stdout.write(`${msg}\n`);
|
|
12
|
-
}
|
|
13
|
-
warn(msg) {
|
|
14
|
-
process.stderr.write(`${this.color.yellow("⚠")} ${msg}\n`);
|
|
15
|
-
}
|
|
16
|
-
error(msg) {
|
|
17
|
-
process.stderr.write(`${this.color.red("error:")} ${msg}\n`);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=log.js.map
|
package/dist/util/log.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../src/util/log.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,YAAY,CAAC;AAEzD,MAAM,OAAO,MAAM;IAEP;IACS;IAFnB,YACU,QAAQ,KAAK,EACJ,QAAmB,WAAW,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QADjF,UAAK,GAAL,KAAK,CAAQ;QACJ,UAAK,GAAL,KAAK,CAAmE;IACxF,CAAC;IACJ,IAAI,CAAC,GAAW;QACd,IAAI,CAAC,IAAI,CAAC,KAAK;YAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;IACpD,CAAC;IACD,IAAI,CAAC,GAAW;QACd,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC;IAC9D,CAAC;IACD,KAAK,CAAC,GAAW;QACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAC/D,CAAC;CACF"}
|
package/dist/util/pkg.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function readPackageName(root: string): Promise<string | undefined>;
|
package/dist/util/pkg.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
export async function readPackageName(root) {
|
|
4
|
-
try {
|
|
5
|
-
const raw = await readFile(join(root, "package.json"), "utf8");
|
|
6
|
-
const p = JSON.parse(raw);
|
|
7
|
-
return p.name;
|
|
8
|
-
}
|
|
9
|
-
catch {
|
|
10
|
-
return undefined;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=pkg.js.map
|
package/dist/util/pkg.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pkg.js","sourceRoot":"","sources":["../../src/util/pkg.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,IAAY;IAChD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;QAC/D,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAsB,CAAC;QAC/C,OAAO,CAAC,CAAC,IAAI,CAAC;IAChB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/dist/util/pnp-check.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isPnpProject(root: string): boolean;
|
package/dist/util/pnp-check.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pnp-check.js","sourceRoot":"","sources":["../../src/util/pnp-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC;AACzF,CAAC"}
|
package/dist/util/posix.d.ts
DELETED
package/dist/util/posix.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { relative as nodeRelative, isAbsolute } from "node:path";
|
|
2
|
-
import { posixPath } from "@component-compass/plugin-core";
|
|
3
|
-
export { posixPath } from "@component-compass/plugin-core";
|
|
4
|
-
// Returns `file` as a posix path relative to `root`. Files outside `root`
|
|
5
|
-
// (e.g. resolved manifest paths in node_modules above the repo) keep their
|
|
6
|
-
// original posix-normalized form.
|
|
7
|
-
export function relativizePath(file, root) {
|
|
8
|
-
if (!isAbsolute(file))
|
|
9
|
-
return posixPath(file);
|
|
10
|
-
const rel = nodeRelative(root, file);
|
|
11
|
-
if (rel === "" || rel.startsWith(".."))
|
|
12
|
-
return posixPath(file);
|
|
13
|
-
return posixPath(rel);
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=posix.js.map
|
package/dist/util/posix.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"posix.js","sourceRoot":"","sources":["../../src/util/posix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,YAAY,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,0EAA0E;AAC1E,2EAA2E;AAC3E,kCAAkC;AAClC,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,IAAY;IACvD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACrC,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IAC/D,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC"}
|
package/dist/util/progress.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rate-limited progress reporter for the scan loop. Emits a single line on
|
|
3
|
-
* stderr — rewriting in place when stderr is a TTY, appending one line per
|
|
4
|
-
* tick otherwise (CI logs).
|
|
5
|
-
*
|
|
6
|
-
* Rate limit: emit when either ≥50 ticks have happened since the last emit
|
|
7
|
-
* OR ≥250ms have elapsed. Tuned so the line moves smoothly on TTYs without
|
|
8
|
-
* spamming non-TTY logs.
|
|
9
|
-
*/
|
|
10
|
-
export type ProgressOptions = {
|
|
11
|
-
total: number;
|
|
12
|
-
writer: (s: string) => void;
|
|
13
|
-
isTTY: boolean;
|
|
14
|
-
/** Verb prefix in the rendered line (default: "Scanned"). */
|
|
15
|
-
label?: string;
|
|
16
|
-
};
|
|
17
|
-
export type Progress = {
|
|
18
|
-
tick(): void;
|
|
19
|
-
done(): void;
|
|
20
|
-
};
|
|
21
|
-
export declare function createProgress(opts: ProgressOptions): Progress;
|
package/dist/util/progress.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Rate-limited progress reporter for the scan loop. Emits a single line on
|
|
3
|
-
* stderr — rewriting in place when stderr is a TTY, appending one line per
|
|
4
|
-
* tick otherwise (CI logs).
|
|
5
|
-
*
|
|
6
|
-
* Rate limit: emit when either ≥50 ticks have happened since the last emit
|
|
7
|
-
* OR ≥250ms have elapsed. Tuned so the line moves smoothly on TTYs without
|
|
8
|
-
* spamming non-TTY logs.
|
|
9
|
-
*/
|
|
10
|
-
const COUNT_THRESHOLD = 50;
|
|
11
|
-
const TIME_THRESHOLD_MS = 250;
|
|
12
|
-
export function createProgress(opts) {
|
|
13
|
-
const start = Date.now();
|
|
14
|
-
let processed = 0;
|
|
15
|
-
let lastEmitCount = -1; // forces emission on the first tick
|
|
16
|
-
let lastEmitTime = 0;
|
|
17
|
-
const label = opts.label ?? "Scanned";
|
|
18
|
-
function emit() {
|
|
19
|
-
const pct = opts.total > 0 ? ((processed / opts.total) * 100).toFixed(1) : "0.0";
|
|
20
|
-
const elapsedS = ((Date.now() - start) / 1000).toFixed(1);
|
|
21
|
-
const body = `${label} ${processed} / ${opts.total} files (${pct}%) — ${elapsedS}s elapsed`;
|
|
22
|
-
if (opts.isTTY) {
|
|
23
|
-
opts.writer(`\r${body}\x1b[K`);
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
opts.writer(`${body}\n`);
|
|
27
|
-
}
|
|
28
|
-
lastEmitCount = processed;
|
|
29
|
-
lastEmitTime = Date.now();
|
|
30
|
-
}
|
|
31
|
-
return {
|
|
32
|
-
tick() {
|
|
33
|
-
processed += 1;
|
|
34
|
-
// sinceEmit counts the current tick, so the COUNT_THRESHOLDth tick since
|
|
35
|
-
// the last emit fires this branch (e.g. with threshold 50: emit at the
|
|
36
|
-
// 1st tick, then at the 50th, 99th, …). Always emit on the final tick
|
|
37
|
-
// so the bar shows 100% before the next phase starts.
|
|
38
|
-
const sinceEmit = processed - lastEmitCount;
|
|
39
|
-
const elapsedSinceEmit = Date.now() - lastEmitTime;
|
|
40
|
-
if (lastEmitCount === -1 ||
|
|
41
|
-
sinceEmit >= COUNT_THRESHOLD - 1 ||
|
|
42
|
-
elapsedSinceEmit >= TIME_THRESHOLD_MS ||
|
|
43
|
-
processed === opts.total) {
|
|
44
|
-
emit();
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
done() {
|
|
48
|
-
if (opts.isTTY && lastEmitCount > 0) {
|
|
49
|
-
opts.writer("\r\x1b[K");
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=progress.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"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AAC,CAAC;YACf,yEAAyE;YACzE,uEAAuE;YACvE,sEAAsE;YACtE,sDAAsD;YACtD,MAAM,SAAS,GAAG,SAAS,GAAG,aAAa,CAAC;YAC5C,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC;YACnD,IACE,aAAa,KAAK,CAAC,CAAC;gBACpB,SAAS,IAAI,eAAe,GAAG,CAAC;gBAChC,gBAAgB,IAAI,iBAAiB;gBACrC,SAAS,KAAK,IAAI,CAAC,KAAK,EACxB,CAAC;gBACD,IAAI,EAAE,CAAC;YACT,CAAC;QACH,CAAC;QACD,IAAI;YACF,IAAI,IAAI,CAAC,KAAK,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;gBACpC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/util/version.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The CLI version, read from package.json at runtime so `--version` can never
|
|
3
|
-
* drift from the published build. From `dist/util/version.js` (or
|
|
4
|
-
* `src/util/version.ts` under Vitest) the package root is two directories up.
|
|
5
|
-
* This is the CLI tool version — distinct from the artifact's `meta.ccVersion`.
|
|
6
|
-
*/
|
|
7
|
-
export declare function readVersion(): string;
|
package/dist/util/version.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
/**
|
|
3
|
-
* The CLI version, read from package.json at runtime so `--version` can never
|
|
4
|
-
* drift from the published build. From `dist/util/version.js` (or
|
|
5
|
-
* `src/util/version.ts` under Vitest) the package root is two directories up.
|
|
6
|
-
* This is the CLI tool version — distinct from the artifact's `meta.ccVersion`.
|
|
7
|
-
*/
|
|
8
|
-
export function readVersion() {
|
|
9
|
-
const pkgUrl = new URL("../../package.json", import.meta.url);
|
|
10
|
-
const parsed = JSON.parse(readFileSync(pkgUrl, "utf8"));
|
|
11
|
-
return parsed.version ?? "0.0.0";
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=version.js.map
|
package/dist/util/version.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/util/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAyB,CAAC;IAChF,OAAO,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC;AACnC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ResolveImport } from "@component-compass/plugin-core";
|
|
2
|
-
export declare function createBoundedDefinitionResolver(opts: {
|
|
3
|
-
moduleResolver: ResolveImport;
|
|
4
|
-
maxFiles?: number;
|
|
5
|
-
onWarning?: (msg: string) => void;
|
|
6
|
-
}): (absTarget: string, imported: string) => {
|
|
7
|
-
absFile: string;
|
|
8
|
-
exportName: string;
|
|
9
|
-
} | null;
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pin the identity of an un-walked workspace-member import to its definition
|
|
3
|
-
* file (bounded re-export resolution: identity must be scope-invariant
|
|
4
|
-
* between whole-root and sub-package scans).
|
|
5
|
-
*
|
|
6
|
-
* Strategy: maintain a private "shadow graph" containing only chain files,
|
|
7
|
-
* parsed on demand, and re-run `followReExportChain` until the landing file is
|
|
8
|
-
* one we've parsed (fixpoint) or `maxFiles` is hit. For NAMED re-exports the
|
|
9
|
-
* seam returns the hop target when a file is absent from the graph, which is
|
|
10
|
-
* exactly the "parse this next" signal. For `export *` the seam recurses
|
|
11
|
-
* internally and returns null when the intermediate barrel isn't parsed yet, so
|
|
12
|
-
* a stalled walk triggers a bounded star-frontier expansion (parse one
|
|
13
|
-
* un-parsed star target, reading the graph's public `exports`, then retry) —
|
|
14
|
-
* the seam itself is never modified (single-seam requirement). Files parsed
|
|
15
|
-
* here are NEVER walked for occurrences/props/composition — they only pin
|
|
16
|
-
* identity.
|
|
17
|
-
*
|
|
18
|
-
* The shadow graph is built with NO `repoRoot`, so it has no
|
|
19
|
-
* `resolveToGraphKey`; `followReExportChain` hops therefore stay absolute,
|
|
20
|
-
* matching the `moduleResolver` output and the shadow-graph file keys.
|
|
21
|
-
*/
|
|
22
|
-
import { readFileSync } from "node:fs";
|
|
23
|
-
import { createGraphBuilder, followReExportChain } from "@component-compass/reference-graph";
|
|
24
|
-
import { emitReact } from "@component-compass/parser-react";
|
|
25
|
-
import { parseByExt } from "../parse-by-ext.js";
|
|
26
|
-
export function createBoundedDefinitionResolver(opts) {
|
|
27
|
-
const maxFiles = opts.maxFiles ?? 10;
|
|
28
|
-
const memo = new Map();
|
|
29
|
-
// Shadow graph keyed by ABSOLUTE paths: no repoRoot → no resolveToGraphKey,
|
|
30
|
-
// so followReExportChain hops stay absolute (matches moduleResolver output).
|
|
31
|
-
// lazyReExportResolution: true opts this shadow graph into the seam's
|
|
32
|
-
// advance terminal, so its parse-and-retry loop can follow barrel
|
|
33
|
-
// re-wraps of imported locals to the leaf, same as the whole-graph walk.
|
|
34
|
-
const builder = createGraphBuilder({ moduleResolver: opts.moduleResolver, lazyReExportResolution: true });
|
|
35
|
-
const parsed = new Set();
|
|
36
|
-
const tryParse = (absFile) => {
|
|
37
|
-
if (parsed.has(absFile))
|
|
38
|
-
return true;
|
|
39
|
-
let source;
|
|
40
|
-
try {
|
|
41
|
-
source = readFileSync(absFile, "utf8");
|
|
42
|
-
}
|
|
43
|
-
catch {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
let file;
|
|
47
|
-
try {
|
|
48
|
-
file = parseByExt(absFile, source);
|
|
49
|
-
}
|
|
50
|
-
catch {
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
if (file.kind !== "babel")
|
|
54
|
-
return false; // react-engine path only; Vue SFC barrels fall back
|
|
55
|
-
try {
|
|
56
|
-
const fb = builder.beginFile(absFile);
|
|
57
|
-
emitReact({ file: absFile, source, ast: file.ast, fileBuilder: fb });
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
return false;
|
|
61
|
-
}
|
|
62
|
-
parsed.add(absFile);
|
|
63
|
-
return true;
|
|
64
|
-
};
|
|
65
|
-
// Parse one not-yet-parsed `export *` target reachable from an already-parsed
|
|
66
|
-
// file. `followReExportChain` recurses into star sources internally and
|
|
67
|
-
// returns null (rather than a hop target) when the source file is absent from
|
|
68
|
-
// the graph, so a stalled named walk needs this to advance the star frontier.
|
|
69
|
-
// Returns true when it parsed a new file. Star `from` specifiers resolve from
|
|
70
|
-
// the parsed file's own absolute key.
|
|
71
|
-
const expandStarFrontier = () => {
|
|
72
|
-
const graph = builder.build();
|
|
73
|
-
for (const [fileKey, fileGraph] of graph.files) {
|
|
74
|
-
for (const exp of fileGraph.exports) {
|
|
75
|
-
if (exp.kind !== "star")
|
|
76
|
-
continue;
|
|
77
|
-
const targetAbs = opts.moduleResolver(fileKey, exp.from);
|
|
78
|
-
if (!targetAbs || parsed.has(targetAbs))
|
|
79
|
-
continue;
|
|
80
|
-
if (tryParse(targetAbs))
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return false;
|
|
85
|
-
};
|
|
86
|
-
return function resolveDefinition(absTarget, imported) {
|
|
87
|
-
const key = `${absTarget}\0${imported}`;
|
|
88
|
-
const hit = memo.get(key);
|
|
89
|
-
if (hit !== undefined)
|
|
90
|
-
return hit;
|
|
91
|
-
let result = null;
|
|
92
|
-
if (tryParse(absTarget)) {
|
|
93
|
-
let filesUsed = 1;
|
|
94
|
-
for (;;) {
|
|
95
|
-
const chained = followReExportChain(builder.build(), absTarget, imported);
|
|
96
|
-
if (chained) {
|
|
97
|
-
if (parsed.has(chained.file)) {
|
|
98
|
-
result = { absFile: chained.file, exportName: chained.localExport };
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
if (filesUsed >= maxFiles || !tryParse(chained.file)) {
|
|
102
|
-
// Cap or unparseable hop: best-effort pin to the named hop target.
|
|
103
|
-
opts.onWarning?.(`bounded re-export resolution stopped at ${chained.file} for "${imported}" (cap ${maxFiles})`);
|
|
104
|
-
result = { absFile: chained.file, exportName: chained.localExport };
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
filesUsed++;
|
|
108
|
-
continue;
|
|
109
|
-
}
|
|
110
|
-
// Named walk stalled. A star barrel we haven't parsed may still hold the
|
|
111
|
-
// name — expand one star target (bounded) and retry. Genuinely
|
|
112
|
-
// unresolvable when no unparsed star target remains: caller falls back
|
|
113
|
-
// to absTarget.
|
|
114
|
-
if (filesUsed >= maxFiles)
|
|
115
|
-
break;
|
|
116
|
-
if (!expandStarFrontier())
|
|
117
|
-
break;
|
|
118
|
-
filesUsed++;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
memo.set(key, result);
|
|
122
|
-
return result;
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
//# sourceMappingURL=bounded-definition-resolver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bounded-definition-resolver.js","sourceRoot":"","sources":["../../src/walker/bounded-definition-resolver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAE7F,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAmB,MAAM,oBAAoB,CAAC;AAEjE,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,OAAO,EAAE,CAAC;oBACZ,IAAI,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;wBAC7B,MAAM,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;wBACpE,MAAM;oBACR,CAAC;oBACD,IAAI,SAAS,IAAI,QAAQ,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;wBACrD,mEAAmE;wBACnE,IAAI,CAAC,SAAS,EAAE,CACd,2CAA2C,OAAO,CAAC,IAAI,SAAS,QAAQ,UAAU,QAAQ,GAAG,CAC9F,CAAC;wBACF,MAAM,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,WAAW,EAAE,CAAC;wBACpE,MAAM;oBACR,CAAC;oBACD,SAAS,EAAE,CAAC;oBACZ,SAAS;gBACX,CAAC;gBACD,yEAAyE;gBACzE,+DAA+D;gBAC/D,uEAAuE;gBACvE,gBAAgB;gBAChB,IAAI,SAAS,IAAI,QAAQ;oBAAE,MAAM;gBACjC,IAAI,CAAC,kBAAkB,EAAE;oBAAE,MAAM;gBACjC,SAAS,EAAE,CAAC;YACd,CAAC;QACH,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/walker/files.d.ts
DELETED
package/dist/walker/files.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { globby } from "globby";
|
|
2
|
-
export async function walkFiles(opts) {
|
|
3
|
-
// `dot: false` skips `.next/`, `.nuxt/`, `.turbo/`, etc. unless the user
|
|
4
|
-
// explicitly globs them in. `gitignore: true` is the default at the config
|
|
5
|
-
// layer; the explicit knob exists so users can opt out for WIP scans of
|
|
6
|
-
// untracked work. `suppressErrors` silences EACCES on unreadable dirs
|
|
7
|
-
// (vendored fixtures, transient OS turds) — the walker keeps going.
|
|
8
|
-
const files = await globby(opts.include, {
|
|
9
|
-
cwd: opts.root,
|
|
10
|
-
ignore: opts.exclude,
|
|
11
|
-
gitignore: opts.gitignore,
|
|
12
|
-
dot: false,
|
|
13
|
-
absolute: true,
|
|
14
|
-
onlyFiles: true,
|
|
15
|
-
suppressErrors: true,
|
|
16
|
-
});
|
|
17
|
-
// globby walks directories concurrently; the returned order depends on which
|
|
18
|
-
// dir-listing task resolves first and varies run-to-run. File order is the
|
|
19
|
-
// sole seed for every downstream order in the pipeline (graph builder, engine
|
|
20
|
-
// resolve, occurrence array, seed Map insertion), so a stable sort here is
|
|
21
|
-
// load-bearing for artefact determinism.
|
|
22
|
-
return files.sort();
|
|
23
|
-
}
|
|
24
|
-
//# sourceMappingURL=files.js.map
|
package/dist/walker/files.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../src/walker/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAShC,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAiB;IAC/C,yEAAyE;IACzE,2EAA2E;IAC3E,wEAAwE;IACxE,sEAAsE;IACtE,oEAAoE;IACpE,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE;QACvC,GAAG,EAAE,IAAI,CAAC,IAAI;QACd,MAAM,EAAE,IAAI,CAAC,OAAO;QACpB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,GAAG,EAAE,KAAK;QACV,QAAQ,EAAE,IAAI;QACd,SAAS,EAAE,IAAI;QACf,cAAc,EAAE,IAAI;KACrB,CAAC,CAAC;IACH,6EAA6E;IAC7E,2EAA2E;IAC3E,8EAA8E;IAC9E,2EAA2E;IAC3E,yCAAyC;IACzC,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceGraph } from "../workspace/types.js";
|
|
2
|
-
import { type AliasEntry } from "./tsconfig-loader.js";
|
|
3
|
-
export type PackageAliasLayer = {
|
|
4
|
-
pkgRealPath: string;
|
|
5
|
-
entries: AliasEntry[];
|
|
6
|
-
};
|
|
7
|
-
export declare function buildPackageAliasLayers(graph: WorkspaceGraph, onWarning?: (message: string) => void): PackageAliasLayer[];
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-workspace-package tsconfig alias layers. Each member's
|
|
3
|
-
* own tsconfig(.base).json contributes an AliasEntry[] applied ONLY to files
|
|
4
|
-
* owned by that member — two apps both defining `@/*` never collide.
|
|
5
|
-
* Discovery per member reuses resolveTsconfigPath with configDir = repoRoot =
|
|
6
|
-
* the member dir (no walk-up per member; the root layer covers inheritance).
|
|
7
|
-
*/
|
|
8
|
-
import { realpathSync } from "node:fs";
|
|
9
|
-
import { resolveTsconfigPath } from "./tsconfig-discovery.js";
|
|
10
|
-
import { loadTsconfigChain } from "./tsconfig-loader.js";
|
|
11
|
-
export function buildPackageAliasLayers(graph, onWarning) {
|
|
12
|
-
const layers = [];
|
|
13
|
-
for (const pkg of graph.packages) {
|
|
14
|
-
const tsconfigPath = resolveTsconfigPath({
|
|
15
|
-
configDir: pkg.absolutePath,
|
|
16
|
-
repoRoot: pkg.absolutePath,
|
|
17
|
-
});
|
|
18
|
-
if (!tsconfigPath)
|
|
19
|
-
continue;
|
|
20
|
-
const { entries, warnings } = loadTsconfigChain(tsconfigPath);
|
|
21
|
-
if (onWarning)
|
|
22
|
-
for (const w of warnings)
|
|
23
|
-
onWarning(`${pkg.name}: ${w}`);
|
|
24
|
-
if (entries.length === 0)
|
|
25
|
-
continue;
|
|
26
|
-
layers.push({ pkgRealPath: safeRealpath(pkg.absolutePath), entries });
|
|
27
|
-
}
|
|
28
|
-
// Longest path first → nested packages beat their ancestors.
|
|
29
|
-
layers.sort((a, b) => b.pkgRealPath.length - a.pkgRealPath.length);
|
|
30
|
-
return layers;
|
|
31
|
-
}
|
|
32
|
-
function safeRealpath(p) {
|
|
33
|
-
try {
|
|
34
|
-
return realpathSync(p);
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
return p;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=package-alias-layers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"package-alias-layers.js","sourceRoot":"","sources":["../../src/walker/package-alias-layers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAmB,MAAM,sBAAsB,CAAC;AAI1E,MAAM,UAAU,uBAAuB,CACrC,KAAqB,EACrB,SAAqC;IAErC,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,KAAK,MAAM,GAAG,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACjC,MAAM,YAAY,GAAG,mBAAmB,CAAC;YACvC,SAAS,EAAE,GAAG,CAAC,YAAY;YAC3B,QAAQ,EAAE,GAAG,CAAC,YAAY;SAC3B,CAAC,CAAC;QACH,IAAI,CAAC,YAAY;YAAE,SAAS;QAC5B,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;QAC9D,IAAI,SAAS;YAAE,KAAK,MAAM,CAAC,IAAI,QAAQ;gBAAE,SAAS,CAAC,GAAG,GAAG,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC,CAAC;QACxE,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QACnC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,YAAY,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,6DAA6D;IAC7D,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACnE,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,YAAY,CAAC,CAAS;IAC7B,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;IACzB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { ResolveImport } from "@component-compass/plugin-core";
|
|
2
|
-
import type { PackageAliasLayer } from "./package-alias-layers.js";
|
|
3
|
-
import type { WorkspaceGraph } from "../workspace/types.js";
|
|
4
|
-
export type { ResolveImport } from "@component-compass/plugin-core";
|
|
5
|
-
export type CreateImportResolverOptions = {
|
|
6
|
-
repoRoot: string;
|
|
7
|
-
/** Map of alias pattern → array of target patterns, both using `*` as the wildcard. */
|
|
8
|
-
aliases?: Record<string, string[]>;
|
|
9
|
-
/** Absolute path to a tsconfig.json whose `compilerOptions.paths` should layer in. */
|
|
10
|
-
tsconfigPath?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Workspace graph. When provided, each package's `package.json#exports` map
|
|
13
|
-
* contributes a resolver layer between tsconfig paths and Node `require.resolve`.
|
|
14
|
-
* See workspace-exports.ts for the supported `exports` shapes.
|
|
15
|
-
*/
|
|
16
|
-
workspaceGraph?: WorkspaceGraph;
|
|
17
|
-
/** Per-workspace-package tsconfig alias layers; the layer whose pkgRealPath
|
|
18
|
-
* owns `from` is applied between config aliases and the root tsconfig layer. */
|
|
19
|
-
packageAliasLayers?: PackageAliasLayer[];
|
|
20
|
-
/** Called once per non-fatal warning produced while loading the tsconfig chain
|
|
21
|
-
* (unreadable file, parse error, unresolvable extends, cycle). Invoked at
|
|
22
|
-
* resolver construction time, not per resolution call. */
|
|
23
|
-
onWarning?: (message: string) => void;
|
|
24
|
-
};
|
|
25
|
-
export declare function createImportResolver(opts: CreateImportResolverOptions): ResolveImport;
|