@callidescope/nx 0.0.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/LICENSE +21 -0
- package/README.md +1041 -0
- package/dist/address.utilities-DJG3-xMW.js +20 -0
- package/dist/plugin-context.utilities-bBTXF3Wk.js +815 -0
- package/dist/plugin.utilities-CX_Q5t8_.js +18 -0
- package/dist/src/executors/breadth/executor.d.ts +34 -0
- package/dist/src/executors/breadth/executor.js +11 -0
- package/dist/src/executors/depth/executor.d.ts +34 -0
- package/dist/src/executors/depth/executor.js +11 -0
- package/dist/src/executors/gate/executor.d.ts +37 -0
- package/dist/src/executors/gate/executor.js +20 -0
- package/dist/src/executors/trace/executor.d.ts +33 -0
- package/dist/src/executors/trace/executor.js +21 -0
- package/dist/src/index.d.ts +698 -0
- package/dist/src/index.js +19 -0
- package/executors.json +25 -0
- package/package.json +78 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { n as e, r as t } from "./plugin-context.utilities-bBTXF3Wk.js";
|
|
2
|
+
//#region packages/ic-suite/callidescope/callidescope-nx/src/modules/plugin/plugin.utilities.ts
|
|
3
|
+
async function n(n) {
|
|
4
|
+
let r = await e(), i = r.readStringList(n.options.projects), a = r.readStringList(n.options.tags);
|
|
5
|
+
if (i.length === 0 && a.length === 0) {
|
|
6
|
+
if (n.context.projectName === void 0) throw Error(`The callidescope ${n.label} executor must be run against a project, or given \`projects\` or \`tags\`.`);
|
|
7
|
+
i.push(n.context.projectName);
|
|
8
|
+
}
|
|
9
|
+
let o = await t(), s = await o.resolveTraceScope({
|
|
10
|
+
projectNames: i,
|
|
11
|
+
tags: a,
|
|
12
|
+
withDependencies: n.options.withDependencies !== !1
|
|
13
|
+
});
|
|
14
|
+
if (s.unknownNames.length > 0 || s.unmatchedTags.length > 0) throw Error(o.describeRefusedScope(s));
|
|
15
|
+
return s;
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { n as t };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
|
|
3
|
+
/** Options the `depth` and `breadth` executors accept. */
|
|
4
|
+
declare interface AddressExecutorOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The callables to look up, each `<file>#<qualified-name>`.
|
|
7
|
+
*
|
|
8
|
+
* Plural to match the `--addresses` the command line takes, so one target
|
|
9
|
+
* run answers about a whole rename rather than one callable at a time.
|
|
10
|
+
*/
|
|
11
|
+
readonly addresses?: string[] | undefined;
|
|
12
|
+
readonly configurationPath?: string | undefined;
|
|
13
|
+
readonly format?: string | undefined;
|
|
14
|
+
/** Nx project names to resolve against, replacing the target's own project. */
|
|
15
|
+
readonly projects?: string[] | undefined;
|
|
16
|
+
/** Nx project tags to resolve against, matching a project carrying any of them. */
|
|
17
|
+
readonly tags?: string[] | undefined;
|
|
18
|
+
/** Widen the selection along the Nx dependency graph. Defaults to true. */
|
|
19
|
+
readonly withDependencies?: boolean | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Prints each named callable's direct callers and callees side by side — the two questions a rename or a refactor needs answered together.
|
|
24
|
+
*
|
|
25
|
+
* The addresses are resolved against the target's own project and its Nx
|
|
26
|
+
* dependencies rather than the whole workspace, which is both faster than the
|
|
27
|
+
* `callidescope breadth` command and the set the addresses actually belong to.
|
|
28
|
+
*/
|
|
29
|
+
declare function breadthExecutor(options: AddressExecutorOptions, context: ExecutorContext): Promise<{
|
|
30
|
+
success: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
export default breadthExecutor;
|
|
33
|
+
|
|
34
|
+
export { }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { t as e } from "../../../address.utilities-DJG3-xMW.js";
|
|
2
|
+
//#region packages/ic-suite/callidescope/callidescope-nx/src/executors/breadth/executor.ts
|
|
3
|
+
async function t(t, n) {
|
|
4
|
+
return await e({
|
|
5
|
+
context: n,
|
|
6
|
+
kind: "breadth",
|
|
7
|
+
options: t
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
|
|
3
|
+
/** Options the `depth` and `breadth` executors accept. */
|
|
4
|
+
declare interface AddressExecutorOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The callables to look up, each `<file>#<qualified-name>`.
|
|
7
|
+
*
|
|
8
|
+
* Plural to match the `--addresses` the command line takes, so one target
|
|
9
|
+
* run answers about a whole rename rather than one callable at a time.
|
|
10
|
+
*/
|
|
11
|
+
readonly addresses?: string[] | undefined;
|
|
12
|
+
readonly configurationPath?: string | undefined;
|
|
13
|
+
readonly format?: string | undefined;
|
|
14
|
+
/** Nx project names to resolve against, replacing the target's own project. */
|
|
15
|
+
readonly projects?: string[] | undefined;
|
|
16
|
+
/** Nx project tags to resolve against, matching a project carrying any of them. */
|
|
17
|
+
readonly tags?: string[] | undefined;
|
|
18
|
+
/** Widen the selection along the Nx dependency graph. Defaults to true. */
|
|
19
|
+
readonly withDependencies?: boolean | undefined;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Prints every call stack above and below each named callable — every caller chain up to a root, every callee chain down to a leaf.
|
|
24
|
+
*
|
|
25
|
+
* The addresses are resolved against the target's own project and its Nx
|
|
26
|
+
* dependencies rather than the whole workspace, which is both faster than the
|
|
27
|
+
* `callidescope depth` command and the set the addresses actually belong to.
|
|
28
|
+
*/
|
|
29
|
+
declare function depthExecutor(options: AddressExecutorOptions, context: ExecutorContext): Promise<{
|
|
30
|
+
success: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
export default depthExecutor;
|
|
33
|
+
|
|
34
|
+
export { }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { t as e } from "../../../address.utilities-DJG3-xMW.js";
|
|
2
|
+
//#region packages/ic-suite/callidescope/callidescope-nx/src/executors/depth/executor.ts
|
|
3
|
+
async function t(t, n) {
|
|
4
|
+
return await e({
|
|
5
|
+
context: n,
|
|
6
|
+
kind: "depth",
|
|
7
|
+
options: t
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as default };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Fails one project's task when its call stacks broke the limits it is held to.
|
|
5
|
+
*
|
|
6
|
+
* The gate rather than the trace: `trace` prints every stack in a project for
|
|
7
|
+
* somebody reading it, and this prints only the stacks and callables that
|
|
8
|
+
* decided the exit code, which is what a failed pipeline is asked to explain.
|
|
9
|
+
*
|
|
10
|
+
* Inferred onto every project holding a `tsconfig.json` that the workspace
|
|
11
|
+
* configuration does not exclude, so `nx affected -t gate` gates a branch by
|
|
12
|
+
* the projects it changed — and a project whose stacks got deeper is named by
|
|
13
|
+
* the task that failed, which one workspace-wide task never could.
|
|
14
|
+
*
|
|
15
|
+
* With neither `projects` nor `tags` given, the selection is the project this
|
|
16
|
+
* target belongs to, widened along the Nx dependency graph: a stack truncated
|
|
17
|
+
* at a package boundary measures the wrong thing. The widening decides what is
|
|
18
|
+
* traced and not what is judged — a dependency's breach fails the dependency's
|
|
19
|
+
* own gate, which is the task named after the project that owns it.
|
|
20
|
+
*/
|
|
21
|
+
declare function gateExecutor(options: GateExecutorOptions, context: ExecutorContext): Promise<{
|
|
22
|
+
success: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
export default gateExecutor;
|
|
25
|
+
|
|
26
|
+
/** Options the gate executor accepts. */
|
|
27
|
+
declare interface GateExecutorOptions {
|
|
28
|
+
readonly configurationPath?: string | undefined;
|
|
29
|
+
/** Nx project names to gate, replacing the target's own project. */
|
|
30
|
+
readonly projects?: string[] | undefined;
|
|
31
|
+
/** Nx project tags to gate, selecting a project carrying any of them. */
|
|
32
|
+
readonly tags?: string[] | undefined;
|
|
33
|
+
/** Widen the selection along the Nx dependency graph. Defaults to true. */
|
|
34
|
+
readonly withDependencies?: boolean | undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { c as e, r as t } from "../../../plugin-context.utilities-bBTXF3Wk.js";
|
|
2
|
+
import { t as n } from "../../../plugin.utilities-CX_Q5t8_.js";
|
|
3
|
+
//#region packages/ic-suite/callidescope/callidescope-nx/src/executors/gate/executor.ts
|
|
4
|
+
async function r(r, i) {
|
|
5
|
+
let a = await n({
|
|
6
|
+
context: i,
|
|
7
|
+
label: "gate",
|
|
8
|
+
options: r
|
|
9
|
+
});
|
|
10
|
+
if (a.directories.length === 0) return process.stdout.write(`${e}\n`), { success: !1 };
|
|
11
|
+
let o = await (await t()).runGate({
|
|
12
|
+
...r.configurationPath === void 0 ? {} : { configurationPath: r.configurationPath },
|
|
13
|
+
directories: a.directories,
|
|
14
|
+
judgedProjectNames: a.selectedDirectories,
|
|
15
|
+
workspaceRoot: i.root
|
|
16
|
+
});
|
|
17
|
+
return process.stdout.write(`${o.report}\n`), { success: o.ok };
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { r as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Traces one selection of Nx projects with callidescope.
|
|
5
|
+
*
|
|
6
|
+
* Inferred onto every project holding a `tsconfig.json`, so
|
|
7
|
+
* `nx run-many -t trace` covers the workspace,
|
|
8
|
+
* `nx run-many -t trace --projects=tag:type:package` covers a category, and
|
|
9
|
+
* `nx affected -t trace` covers only what changed — none of which the
|
|
10
|
+
* workspace-wide command can do, and none of which needs a flag of its own:
|
|
11
|
+
* selecting projects is what the task runner is for.
|
|
12
|
+
*
|
|
13
|
+
* With neither `projects` nor `tags` given, the selection is the project this
|
|
14
|
+
* target belongs to.
|
|
15
|
+
*/
|
|
16
|
+
declare function traceExecutor(options: TraceExecutorOptions, context: ExecutorContext): Promise<{
|
|
17
|
+
success: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
export default traceExecutor;
|
|
20
|
+
|
|
21
|
+
/** Options the trace executor accepts. */
|
|
22
|
+
declare interface TraceExecutorOptions {
|
|
23
|
+
readonly configurationPath?: string | undefined;
|
|
24
|
+
readonly format?: string | undefined;
|
|
25
|
+
/** Nx project names to trace, replacing the target's own project. */
|
|
26
|
+
readonly projects?: string[] | undefined;
|
|
27
|
+
/** Nx project tags to trace, selecting a project carrying any of them. */
|
|
28
|
+
readonly tags?: string[] | undefined;
|
|
29
|
+
/** Widen the selection along the Nx dependency graph. Defaults to true. */
|
|
30
|
+
readonly withDependencies?: boolean | undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { }
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { n as e, r as t } from "../../../plugin-context.utilities-bBTXF3Wk.js";
|
|
2
|
+
import { t as n } from "../../../plugin.utilities-CX_Q5t8_.js";
|
|
3
|
+
//#region packages/ic-suite/callidescope/callidescope-nx/src/executors/trace/executor.ts
|
|
4
|
+
async function r(r, i) {
|
|
5
|
+
let a = await n({
|
|
6
|
+
context: i,
|
|
7
|
+
label: "trace",
|
|
8
|
+
options: r
|
|
9
|
+
});
|
|
10
|
+
if (a.directories.length === 0) return { success: !0 };
|
|
11
|
+
let o = await e(), s = await (await t()).runTrace({
|
|
12
|
+
...r.configurationPath === void 0 ? {} : { configurationPath: r.configurationPath },
|
|
13
|
+
directories: a.directories,
|
|
14
|
+
format: o.readFormat(r.format),
|
|
15
|
+
judgedProjectNames: a.selectedDirectories,
|
|
16
|
+
workspaceRoot: i.root
|
|
17
|
+
});
|
|
18
|
+
return process.stdout.write(`${s.report}\n`), { success: s.ok };
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { r as default };
|