@codefast/cli 0.10.0 → 0.12.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/CHANGELOG.md +84 -0
- package/README.md +66 -41
- package/dist/arrange/command.js +99 -136
- package/dist/arrange/domain/ast/collectors-cn.d.ts +2 -2
- package/dist/arrange/domain/ast/collectors-cn.js +2 -2
- package/dist/arrange/domain/ast/collectors-jsx.d.ts +2 -2
- package/dist/arrange/domain/ast/collectors-jsx.js +1 -1
- package/dist/arrange/domain/ast/collectors-tv.d.ts +2 -2
- package/dist/arrange/domain/ast/collectors-tv.js +5 -5
- package/dist/arrange/domain/ast/helpers.d.ts +2 -2
- package/dist/arrange/domain/ast/helpers.js +3 -4
- package/dist/arrange/domain/ast/simplify-targets.d.ts +1 -1
- package/dist/arrange/domain/ast/simplify-targets.js +23 -28
- package/dist/arrange/domain/ast/targets.d.ts +2 -2
- package/dist/arrange/domain/ast/targets.js +9 -9
- package/dist/arrange/{typescript-ast-translator.d.ts → domain/ast/translator.d.ts} +6 -5
- package/dist/arrange/{typescript-ast-translator.js → domain/ast/translator.js} +20 -23
- package/dist/arrange/domain/constants.d.ts +1 -1
- package/dist/arrange/domain/grouping-service.d.ts +2 -2
- package/dist/arrange/domain/grouping-service.js +3 -3
- package/dist/arrange/domain/grouping.js +3 -3
- package/dist/arrange/domain/imports.d.ts +1 -1
- package/dist/arrange/domain/imports.js +2 -2
- package/dist/arrange/domain/source-text-formatters.js +1 -1
- package/dist/arrange/domain/tailwind-token.js +1 -1
- package/dist/arrange/domain/token-classifier.d.ts +1 -1
- package/dist/arrange/domain/token-classifier.js +2 -2
- package/dist/arrange/domain/types.d.ts +3 -3
- package/dist/arrange/group/cli-result.d.ts +7 -0
- package/dist/arrange/group/cli-result.js +12 -0
- package/dist/arrange/group/cli-schema.d.ts +17 -0
- package/dist/arrange/group/cli-schema.js +13 -0
- package/dist/arrange/group/output.d.ts +7 -0
- package/dist/arrange/group/output.js +10 -0
- package/dist/arrange/group/suggest.d.ts +8 -0
- package/dist/arrange/{suggest.js → group/suggest.js} +2 -2
- package/dist/arrange/inspect/cli-result.d.ts +7 -0
- package/dist/arrange/inspect/cli-result.js +8 -0
- package/dist/arrange/inspect/cli-schema.d.ts +15 -0
- package/dist/arrange/inspect/cli-schema.js +9 -0
- package/dist/arrange/{domain → inspect/domain}/analyze-service.d.ts +2 -2
- package/dist/arrange/{domain → inspect/domain}/analyze-service.js +7 -7
- package/dist/arrange/inspect/output.d.ts +7 -0
- package/dist/arrange/inspect/output.js +42 -0
- package/dist/arrange/inspect/run.d.ts +10 -0
- package/dist/arrange/{analyze.js → inspect/run.js} +7 -7
- package/dist/arrange/prepare.d.ts +13 -0
- package/dist/arrange/{workspace.js → prepare.js} +9 -12
- package/dist/arrange/regroup/cli-result.d.ts +13 -0
- package/dist/arrange/regroup/cli-result.js +23 -0
- package/dist/arrange/regroup/cli-schema.d.ts +20 -0
- package/dist/arrange/regroup/cli-schema.js +14 -0
- package/dist/arrange/regroup/output.d.ts +14 -0
- package/dist/arrange/regroup/output.js +72 -0
- package/dist/arrange/{process-file.d.ts → regroup/process-file.d.ts} +3 -3
- package/dist/arrange/{process-file.js → regroup/process-file.js} +3 -3
- package/dist/arrange/regroup/run.d.ts +11 -0
- package/dist/arrange/{sync.js → regroup/run.js} +5 -5
- package/dist/arrange/resolve-target.d.ts +2 -2
- package/dist/arrange/resolve-target.js +2 -2
- package/dist/arrange/scan-target.d.ts +2 -2
- package/dist/arrange/scan-target.js +3 -3
- package/dist/arrange/simplify/cli-result.d.ts +7 -0
- package/dist/arrange/simplify/cli-result.js +8 -0
- package/dist/arrange/simplify/cli-schema.d.ts +17 -0
- package/dist/arrange/simplify/cli-schema.js +11 -0
- package/dist/arrange/simplify/fold-targets.d.ts +13 -0
- package/dist/arrange/simplify/fold-targets.js +139 -0
- package/dist/arrange/simplify/output.d.ts +7 -0
- package/dist/arrange/simplify/output.js +15 -0
- package/dist/arrange/simplify/process-file.d.ts +13 -0
- package/dist/arrange/simplify/process-file.js +49 -0
- package/dist/arrange/simplify/run.d.ts +14 -0
- package/dist/arrange/simplify/run.js +38 -0
- package/dist/arrange/simplify/variant-classname-probe.d.ts +35 -0
- package/dist/arrange/simplify/variant-classname-probe.js +95 -0
- package/dist/arrange/source-parse.d.ts +1 -1
- package/dist/arrange/source-parse.js +3 -3
- package/dist/audit/command.js +152 -212
- package/dist/audit/comments/cli-result.d.ts +13 -0
- package/dist/audit/comments/cli-result.js +22 -0
- package/dist/audit/comments/cli-schema.d.ts +19 -0
- package/dist/audit/comments/cli-schema.js +13 -0
- package/dist/audit/comments/output.d.ts +7 -0
- package/dist/audit/comments/output.js +27 -0
- package/dist/audit/comments/prepare.d.ts +16 -0
- package/dist/audit/comments/prepare.js +12 -0
- package/dist/audit/{run-comments.d.ts → comments/run.d.ts} +5 -5
- package/dist/audit/{run-comments.js → comments/run.js} +9 -9
- package/dist/audit/display-names/cli-result.d.ts +13 -0
- package/dist/audit/display-names/cli-result.js +22 -0
- package/dist/audit/display-names/cli-schema.d.ts +18 -0
- package/dist/audit/display-names/cli-schema.js +12 -0
- package/dist/audit/{domain → display-names/domain}/display-names.d.ts +1 -1
- package/dist/audit/display-names/output.d.ts +7 -0
- package/dist/audit/display-names/output.js +21 -0
- package/dist/audit/display-names/prepare.d.ts +16 -0
- package/dist/audit/display-names/prepare.js +12 -0
- package/dist/audit/display-names/run.d.ts +14 -0
- package/dist/audit/{run-display-names.js → display-names/run.js} +5 -5
- package/dist/audit/domain/types.d.ts +43 -0
- package/dist/audit/imports/cli-result.d.ts +13 -0
- package/dist/audit/imports/cli-result.js +22 -0
- package/dist/audit/imports/cli-schema.d.ts +18 -0
- package/dist/audit/imports/cli-schema.js +12 -0
- package/dist/audit/{domain → imports/domain}/import-policy.d.ts +3 -3
- package/dist/audit/{domain → imports/domain}/import-policy.js +4 -11
- package/dist/audit/imports/output.d.ts +7 -0
- package/dist/audit/imports/output.js +21 -0
- package/dist/audit/imports/prepare.d.ts +16 -0
- package/dist/audit/imports/prepare.js +12 -0
- package/dist/audit/imports/run.d.ts +14 -0
- package/dist/audit/{run-imports.js → imports/run.js} +6 -6
- package/dist/audit/links/cli-result.d.ts +13 -0
- package/dist/audit/links/cli-result.js +22 -0
- package/dist/audit/links/cli-schema.d.ts +18 -0
- package/dist/audit/links/cli-schema.js +12 -0
- package/dist/audit/{domain → links/domain}/markdown-links.d.ts +3 -3
- package/dist/audit/{domain → links/domain}/markdown-links.js +22 -8
- package/dist/audit/links/output.d.ts +7 -0
- package/dist/audit/links/output.js +21 -0
- package/dist/audit/links/prepare.d.ts +16 -0
- package/dist/audit/links/prepare.js +12 -0
- package/dist/audit/links/run.d.ts +14 -0
- package/dist/audit/{run-links.js → links/run.js} +4 -4
- package/dist/audit/prepare.d.ts +13 -52
- package/dist/audit/prepare.js +13 -136
- package/dist/audit/publish/cli-result.d.ts +13 -0
- package/dist/audit/publish/cli-result.js +22 -0
- package/dist/audit/publish/cli-schema.d.ts +18 -0
- package/dist/audit/publish/cli-schema.js +12 -0
- package/dist/audit/publish/domain/legacy-subpath.d.ts +8 -0
- package/dist/audit/publish/domain/legacy-subpath.js +22 -0
- package/dist/audit/publish/output.d.ts +7 -0
- package/dist/audit/publish/output.js +24 -0
- package/dist/audit/publish/prepare.d.ts +16 -0
- package/dist/audit/publish/prepare.js +12 -0
- package/dist/audit/publish/run.d.ts +14 -0
- package/dist/audit/publish/run.js +62 -0
- package/dist/audit/rtl/cli-result.d.ts +13 -0
- package/dist/audit/rtl/cli-result.js +22 -0
- package/dist/audit/rtl/cli-schema.d.ts +18 -0
- package/dist/audit/rtl/cli-schema.js +12 -0
- package/dist/audit/{domain → rtl/domain}/audit-file.d.ts +1 -1
- package/dist/audit/{domain → rtl/domain}/audit-file.js +2 -2
- package/dist/audit/{domain → rtl/domain}/tokenize.d.ts +1 -1
- package/dist/audit/rtl/output.d.ts +7 -0
- package/dist/audit/rtl/output.js +21 -0
- package/dist/audit/rtl/prepare.d.ts +13 -0
- package/dist/audit/rtl/prepare.js +41 -0
- package/dist/audit/rtl/run.d.ts +14 -0
- package/dist/audit/{run.js → rtl/run.js} +4 -4
- package/dist/bin.js +1 -1
- package/dist/cli.js +5 -5
- package/dist/core/cli/command-pipeline.d.ts +90 -0
- package/dist/core/cli/command-pipeline.js +83 -0
- package/dist/core/cli/format-error.d.ts +1 -1
- package/dist/core/cli/global-options.d.ts +1 -1
- package/dist/core/cli/global-options.js +1 -1
- package/dist/core/cli/resolve-root.d.ts +9 -0
- package/dist/core/cli/resolve-root.js +16 -0
- package/dist/core/cli/result-handle.d.ts +3 -9
- package/dist/core/cli/result-handle.js +4 -17
- package/dist/core/config/define-config.d.ts +1 -1
- package/dist/core/config/loader.d.ts +3 -3
- package/dist/core/config/loader.js +2 -2
- package/dist/core/config/schema.d.ts +1 -1
- package/dist/core/config/schema.js +1 -1
- package/dist/core/config/warnings.js +1 -1
- package/dist/core/config.d.ts +5 -5
- package/dist/core/config.js +4 -4
- package/dist/core/filesystem/{port.d.ts → filesystem.d.ts} +1 -1
- package/dist/core/filesystem/node.d.ts +3 -3
- package/dist/core/filesystem/node.js +1 -1
- package/dist/core/schema-parse.d.ts +2 -2
- package/dist/core/schema-parse.js +2 -2
- package/dist/core/source-text-edit.d.ts +14 -0
- package/dist/core/source-text-edit.js +22 -0
- package/dist/core/workspace/markdown-walk.d.ts +2 -2
- package/dist/core/workspace/markdown-walk.js +1 -1
- package/dist/core/workspace/package-version.d.ts +2 -2
- package/dist/core/workspace/package-version.js +2 -2
- package/dist/core/workspace/resolver.d.ts +3 -3
- package/dist/core/workspace/resolver.js +5 -5
- package/dist/core/workspace/source-walk.d.ts +2 -2
- package/dist/core/workspace/source-walk.js +1 -1
- package/dist/core/workspace/typescript-walk.d.ts +2 -2
- package/dist/core/workspace/typescript-walk.js +1 -1
- package/dist/core/workspace/walk-files.d.ts +2 -2
- package/dist/core/workspace/walk-files.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/mirror/cli-result.d.ts +1 -1
- package/dist/mirror/cli-result.js +1 -1
- package/dist/mirror/cli-schema.d.ts +2 -2
- package/dist/mirror/cli-schema.js +1 -1
- package/dist/mirror/command.js +36 -65
- package/dist/mirror/dist-filesystem-node.d.ts +8 -0
- package/dist/mirror/{dist-filesystem-impl.js → dist-filesystem-node.js} +3 -3
- package/dist/mirror/domain/dirent-guard.d.ts +1 -1
- package/dist/mirror/domain/exports.d.ts +2 -2
- package/dist/mirror/domain/exports.js +1 -1
- package/dist/mirror/domain/types.d.ts +59 -2
- package/dist/mirror/output.d.ts +1 -3
- package/dist/mirror/output.js +127 -2
- package/dist/mirror/package-path.d.ts +5 -5
- package/dist/mirror/package-path.js +3 -3
- package/dist/mirror/prepare.d.ts +6 -6
- package/dist/mirror/prepare.js +8 -12
- package/dist/mirror/run.d.ts +12 -0
- package/dist/mirror/{sync.js → run.js} +7 -7
- package/dist/mirror/supplement-exports.d.ts +3 -3
- package/dist/mirror/supplement-exports.js +2 -2
- package/dist/mirror/sync-workspace-package.d.ts +4 -4
- package/dist/mirror/sync-workspace-package.js +11 -14
- package/dist/mirror/write-exports.d.ts +3 -3
- package/dist/mirror/write-exports.js +3 -3
- package/dist/pack-slim/cli-result.d.ts +1 -1
- package/dist/pack-slim/cli-result.js +1 -1
- package/dist/pack-slim/cli-schema.d.ts +1 -1
- package/dist/pack-slim/cli-schema.js +1 -1
- package/dist/pack-slim/command.js +36 -71
- package/dist/pack-slim/domain/transform.d.ts +22 -1
- package/dist/pack-slim/domain/transform.js +65 -8
- package/dist/pack-slim/output.d.ts +1 -1
- package/dist/pack-slim/output.js +1 -1
- package/dist/pack-slim/prepare.d.ts +21 -0
- package/dist/pack-slim/prepare.js +14 -0
- package/dist/pack-slim/{sync.d.ts → run.d.ts} +6 -6
- package/dist/pack-slim/{sync.js → run.js} +5 -5
- package/dist/pack-slim/working-tree.d.ts +2 -2
- package/dist/pack-slim/working-tree.js +2 -2
- package/dist/tag/cli-result.d.ts +8 -2
- package/dist/tag/cli-result.js +15 -2
- package/dist/tag/cli-schema.d.ts +4 -4
- package/dist/tag/cli-schema.js +3 -4
- package/dist/tag/command.js +34 -61
- package/dist/tag/domain/skip-filter.d.ts +13 -0
- package/dist/tag/domain/skip-filter.js +29 -0
- package/dist/tag/domain/types.d.ts +22 -2
- package/dist/tag/domain/version-summary.d.ts +13 -0
- package/dist/tag/domain/version-summary.js +24 -0
- package/dist/tag/output.d.ts +4 -4
- package/dist/tag/output.js +7 -10
- package/dist/tag/prepare.d.ts +5 -5
- package/dist/tag/prepare.js +5 -5
- package/dist/tag/run.d.ts +10 -0
- package/dist/tag/{sync.js → run.js} +23 -53
- package/dist/tag/target/candidates.d.ts +8 -0
- package/dist/tag/{target-candidates.js → target/candidates.js} +3 -3
- package/dist/tag/{resolve-target-path.d.ts → target/resolve-path.d.ts} +2 -2
- package/dist/tag/target/runner.d.ts +8 -0
- package/dist/tag/{target-runner.js → target/runner.js} +3 -3
- package/dist/tag/{since-writer.d.ts → writer/since-writer.d.ts} +3 -3
- package/dist/tag/{since-writer.js → writer/since-writer.js} +1 -1
- package/dist/tag/{version-resolver.d.ts → writer/version-resolver.d.ts} +2 -2
- package/dist/tag/{version-resolver.js → writer/version-resolver.js} +1 -1
- package/package.json +15 -7
- package/dist/arrange/analyze.d.ts +0 -10
- package/dist/arrange/cli-schema.d.ts +0 -50
- package/dist/arrange/cli-schema.js +0 -34
- package/dist/arrange/output.d.ts +0 -26
- package/dist/arrange/output.js +0 -127
- package/dist/arrange/simplify-process-file.d.ts +0 -11
- package/dist/arrange/simplify-process-file.js +0 -30
- package/dist/arrange/simplify-sync.d.ts +0 -13
- package/dist/arrange/simplify-sync.js +0 -30
- package/dist/arrange/suggest.d.ts +0 -8
- package/dist/arrange/sync.d.ts +0 -11
- package/dist/arrange/workspace.d.ts +0 -13
- package/dist/audit/cli-schema.d.ts +0 -93
- package/dist/audit/cli-schema.js +0 -66
- package/dist/audit/output.d.ts +0 -91
- package/dist/audit/output.js +0 -213
- package/dist/audit/run-display-names.d.ts +0 -14
- package/dist/audit/run-imports.d.ts +0 -14
- package/dist/audit/run-links.d.ts +0 -14
- package/dist/audit/run.d.ts +0 -14
- package/dist/mirror/dist-filesystem-impl.d.ts +0 -8
- package/dist/mirror/sync-reporter.d.ts +0 -60
- package/dist/mirror/sync-reporter.js +0 -128
- package/dist/mirror/sync-types.d.ts +0 -43
- package/dist/mirror/sync-types.js +0 -1
- package/dist/mirror/sync.d.ts +0 -12
- package/dist/tag/sync.d.ts +0 -42
- package/dist/tag/target-candidates.d.ts +0 -8
- package/dist/tag/target-runner.d.ts +0 -8
- /package/dist/audit/{domain → comments/domain}/comment-content.d.ts +0 -0
- /package/dist/audit/{domain → comments/domain}/comment-content.js +0 -0
- /package/dist/audit/{domain → comments/domain}/comment-dividers.d.ts +0 -0
- /package/dist/audit/{domain → comments/domain}/comment-dividers.js +0 -0
- /package/dist/audit/{domain → comments/domain}/link-references.d.ts +0 -0
- /package/dist/audit/{domain → comments/domain}/link-references.js +0 -0
- /package/dist/audit/{domain → comments/domain}/since-versions.d.ts +0 -0
- /package/dist/audit/{domain → comments/domain}/since-versions.js +0 -0
- /package/dist/audit/{domain → comments/domain}/tsdoc-syntax.d.ts +0 -0
- /package/dist/audit/{domain → comments/domain}/tsdoc-syntax.js +0 -0
- /package/dist/audit/{domain → display-names/domain}/display-names.js +0 -0
- /package/dist/audit/{domain → rtl/domain}/mappings.d.ts +0 -0
- /package/dist/audit/{domain → rtl/domain}/mappings.js +0 -0
- /package/dist/audit/{domain → rtl/domain}/tokenize.js +0 -0
- /package/dist/core/filesystem/{port.js → filesystem.js} +0 -0
- /package/dist/tag/{resolve-target-path.js → target/resolve-path.js} +0 -0
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* The request payload for `arrange analyze`.
|
|
4
|
-
*
|
|
5
|
-
* @since 0.3.16-canary.0
|
|
6
|
-
*/
|
|
7
|
-
export type ArrangeAnalyzeDirectoryRequest = {
|
|
8
|
-
analyzeRootPath: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* The request payload for a top-level `arrange` run.
|
|
12
|
-
*
|
|
13
|
-
* @since 0.3.16-canary.0
|
|
14
|
-
*/
|
|
15
|
-
export type ArrangeSyncRunRequest = {
|
|
16
|
-
rootDir: string;
|
|
17
|
-
targetPath: string;
|
|
18
|
-
write: boolean;
|
|
19
|
-
withClassName?: boolean | undefined;
|
|
20
|
-
cnImport?: string | undefined;
|
|
21
|
-
config?: unknown;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* The request payload for `arrange group`.
|
|
25
|
-
*
|
|
26
|
-
* @since 0.3.16-canary.0
|
|
27
|
-
*/
|
|
28
|
-
export type ArrangeSuggestGroupsRequest = {
|
|
29
|
-
inlineClasses: string;
|
|
30
|
-
emitTvStyleArray: boolean;
|
|
31
|
-
trailingClassName: boolean;
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* The `zod` schema validating an `arrange analyze` request.
|
|
35
|
-
*
|
|
36
|
-
* @since 0.3.16-canary.0
|
|
37
|
-
*/
|
|
38
|
-
export declare const arrangeAnalyzeDirectoryRequestSchema: z.ZodType<ArrangeAnalyzeDirectoryRequest>;
|
|
39
|
-
/**
|
|
40
|
-
* The `zod` schema validating an `arrange` run request.
|
|
41
|
-
*
|
|
42
|
-
* @since 0.3.16-canary.0
|
|
43
|
-
*/
|
|
44
|
-
export declare const arrangeSyncRunRequestSchema: z.ZodType<ArrangeSyncRunRequest>;
|
|
45
|
-
/**
|
|
46
|
-
* The `zod` schema validating an `arrange group` request.
|
|
47
|
-
*
|
|
48
|
-
* @since 0.3.16-canary.0
|
|
49
|
-
*/
|
|
50
|
-
export declare const arrangeSuggestGroupsRequestSchema: z.ZodType<ArrangeSuggestGroupsRequest>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* The `zod` schema validating an `arrange analyze` request.
|
|
4
|
-
*
|
|
5
|
-
* @since 0.3.16-canary.0
|
|
6
|
-
*/
|
|
7
|
-
export const arrangeAnalyzeDirectoryRequestSchema = z.object({
|
|
8
|
-
analyzeRootPath: z.string().min(1, "analyzeRootPath is required"),
|
|
9
|
-
});
|
|
10
|
-
/**
|
|
11
|
-
* The `zod` schema validating an `arrange` run request.
|
|
12
|
-
*
|
|
13
|
-
* @since 0.3.16-canary.0
|
|
14
|
-
*/
|
|
15
|
-
export const arrangeSyncRunRequestSchema = z.object({
|
|
16
|
-
rootDir: z.string().min(1),
|
|
17
|
-
targetPath: z.string().min(1),
|
|
18
|
-
write: z.boolean(),
|
|
19
|
-
withClassName: z.boolean().optional(),
|
|
20
|
-
cnImport: z.string().optional(),
|
|
21
|
-
config: z.unknown().optional(),
|
|
22
|
-
});
|
|
23
|
-
/**
|
|
24
|
-
* The `zod` schema validating an `arrange group` request.
|
|
25
|
-
*
|
|
26
|
-
* @since 0.3.16-canary.0
|
|
27
|
-
*/
|
|
28
|
-
export const arrangeSuggestGroupsRequestSchema = z.object({
|
|
29
|
-
inlineClasses: z
|
|
30
|
-
.string()
|
|
31
|
-
.min(1, 'Pass a class string. Example: codefast arrange group "flex gap-2 text-sm rounded-md"'),
|
|
32
|
-
emitTvStyleArray: z.boolean(),
|
|
33
|
-
trailingClassName: z.boolean(),
|
|
34
|
-
});
|
package/dist/arrange/output.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { GroupFileWorkPlan } from "#/arrange/domain/grouping-service";
|
|
2
|
-
import type { AnalyzeReport, ArrangeRunResult } from "#/arrange/domain/types";
|
|
3
|
-
/**
|
|
4
|
-
* Prints the human-readable summary of an `arrange analyze` report.
|
|
5
|
-
*
|
|
6
|
-
* @since 0.3.16-canary.0
|
|
7
|
-
*/
|
|
8
|
-
export declare function printAnalyzeReport(resolvedTargetPath: string, report: AnalyzeReport): void;
|
|
9
|
-
/**
|
|
10
|
-
* Prints the totals and follow-up hints for an `arrange` run.
|
|
11
|
-
*
|
|
12
|
-
* @since 0.3.16-canary.0
|
|
13
|
-
*/
|
|
14
|
-
export declare function printSyncResult(result: ArrangeRunResult, write: boolean): void;
|
|
15
|
-
/**
|
|
16
|
-
* Prints the totals for an `arrange simplify` run.
|
|
17
|
-
*
|
|
18
|
-
* @since 0.3.16-canary.0
|
|
19
|
-
*/
|
|
20
|
-
export declare function printSimplifyResult(result: ArrangeRunResult, write: boolean): void;
|
|
21
|
-
/**
|
|
22
|
-
* Prints the per-file preview of a work plan's unwrap and grouping edits.
|
|
23
|
-
*
|
|
24
|
-
* @since 0.3.16-canary.0
|
|
25
|
-
*/
|
|
26
|
-
export declare function printGroupFilePreviewFromWork(work: GroupFileWorkPlan): void;
|
package/dist/arrange/output.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { lineOf } from "#/arrange/domain/ast/helpers";
|
|
3
|
-
import { LONG_STRING_TOKEN_THRESHOLD, MAX_REPORT_LINES } from "#/arrange/domain/constants";
|
|
4
|
-
import { logger } from "#/core/logger";
|
|
5
|
-
/**
|
|
6
|
-
* Prints the human-readable summary of an `arrange analyze` report.
|
|
7
|
-
*
|
|
8
|
-
* @since 0.3.16-canary.0
|
|
9
|
-
*/
|
|
10
|
-
export function printAnalyzeReport(resolvedTargetPath, report) {
|
|
11
|
-
logger.out(`Path: ${path.resolve(resolvedTargetPath)}`);
|
|
12
|
-
logger.out(`.ts/.tsx files: ${report.files}`);
|
|
13
|
-
logger.out(`cn(...) call sites: ${report.cnCallExpressions}`);
|
|
14
|
-
logger.out(`tv(...) call sites: ${report.tvCallExpressions}`);
|
|
15
|
-
logger.out(`\nLong cn(...) string literals (≥${LONG_STRING_TOKEN_THRESHOLD} tokens — consider splitting arguments): ${report.longCnStringLiterals.length}`);
|
|
16
|
-
for (const findingEntry of report.longCnStringLiterals.slice(0, MAX_REPORT_LINES)) {
|
|
17
|
-
logger.out(` ${findingEntry.file}:${findingEntry.line} (${findingEntry.tokenCount} tokens) ${findingEntry.preview}`);
|
|
18
|
-
}
|
|
19
|
-
if (report.longCnStringLiterals.length > MAX_REPORT_LINES) {
|
|
20
|
-
logger.out(` … and ${report.longCnStringLiterals.length - MAX_REPORT_LINES} more`);
|
|
21
|
-
}
|
|
22
|
-
logger.out(`\nLong tv({...}) string literals in base/variants/… (≥${LONG_STRING_TOKEN_THRESHOLD} tokens): ${report.longTvStringLiterals.length}`);
|
|
23
|
-
for (const findingEntry of report.longTvStringLiterals.slice(0, MAX_REPORT_LINES)) {
|
|
24
|
-
logger.out(` ${findingEntry.file}:${findingEntry.line} (${findingEntry.tokenCount} tokens) ${findingEntry.preview}`);
|
|
25
|
-
}
|
|
26
|
-
if (report.longTvStringLiterals.length > MAX_REPORT_LINES) {
|
|
27
|
-
logger.out(` … and ${report.longTvStringLiterals.length - MAX_REPORT_LINES} more`);
|
|
28
|
-
}
|
|
29
|
-
logger.out(`\nJSX className="..." or className={'...'} (static strings, ≥${LONG_STRING_TOKEN_THRESHOLD} tokens): ${report.longJsxClassNameLiterals.length}`);
|
|
30
|
-
for (const findingEntry of report.longJsxClassNameLiterals.slice(0, MAX_REPORT_LINES)) {
|
|
31
|
-
logger.out(` ${findingEntry.file}:${findingEntry.line} (${findingEntry.tokenCount} tokens) ${findingEntry.preview}`);
|
|
32
|
-
}
|
|
33
|
-
if (report.longJsxClassNameLiterals.length > MAX_REPORT_LINES) {
|
|
34
|
-
logger.out(` … and ${report.longJsxClassNameLiterals.length - MAX_REPORT_LINES} more`);
|
|
35
|
-
}
|
|
36
|
-
logger.out(`\ncn(...) nested inside tv({...}) (prefer a string or array — preview/apply can rewrite): ${report.cnInsideTvCalls.length}`);
|
|
37
|
-
for (const findingEntry of report.cnInsideTvCalls.slice(0, MAX_REPORT_LINES)) {
|
|
38
|
-
logger.out(` ${findingEntry.file}:${findingEntry.line} (${findingEntry.argCount} args) ${findingEntry.preview}`);
|
|
39
|
-
}
|
|
40
|
-
if (report.cnInsideTvCalls.length > MAX_REPORT_LINES) {
|
|
41
|
-
logger.out(` … and ${report.cnInsideTvCalls.length - MAX_REPORT_LINES} more`);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Prints the totals and follow-up hints for an `arrange` run.
|
|
46
|
-
*
|
|
47
|
-
* @since 0.3.16-canary.0
|
|
48
|
-
*/
|
|
49
|
-
export function printSyncResult(result, write) {
|
|
50
|
-
logger.out(`\nTotal: ${result.filePaths.length} file(s), ${result.totalFound} site(s) (cn/tv/JSX className) to review.`);
|
|
51
|
-
if (write) {
|
|
52
|
-
logger.out(`Applied: ${result.totalChanged} site(s) updated.`);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
logger.out(`(Re-run without --dry-run to write changes, or "pnpm cli:arrange" / "pnpm exec codefast arrange")`);
|
|
56
|
-
}
|
|
57
|
-
const shouldShowCascadeHint = write ? result.totalChanged > 0 : result.totalFound > 0;
|
|
58
|
-
if (shouldShowCascadeHint) {
|
|
59
|
-
logger.out("Note: class order may change across concern groups — smoke-test the UI if you rely on cascade order.");
|
|
60
|
-
}
|
|
61
|
-
if (result.hookError !== null) {
|
|
62
|
-
logger.err(result.hookError);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Prints the totals for an `arrange simplify` run.
|
|
67
|
-
*
|
|
68
|
-
* @since 0.3.16-canary.0
|
|
69
|
-
*/
|
|
70
|
-
export function printSimplifyResult(result, write) {
|
|
71
|
-
logger.out(`\nTotal: ${result.filePaths.length} file(s), ${result.totalFound} site(s) to simplify.`);
|
|
72
|
-
if (write) {
|
|
73
|
-
logger.out(`Applied: ${result.totalChanged} site(s) updated.`);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
logger.out(`(Run "simplify" to write changes, or "pnpm cli:arrange-simplify" / "pnpm exec codefast arrange simplify")`);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Prints the per-file preview of a work plan's unwrap and grouping edits.
|
|
81
|
-
*
|
|
82
|
-
* @since 0.3.16-canary.0
|
|
83
|
-
*/
|
|
84
|
-
export function printGroupFilePreviewFromWork(work) {
|
|
85
|
-
printGroupFilePreviewBody({
|
|
86
|
-
filePath: work.filePath,
|
|
87
|
-
reportTotal: work.reportTotal,
|
|
88
|
-
cnInTvNoReplacement: work.cnInTvNoReplacement,
|
|
89
|
-
cnInTvCalls: work.cnInTvCalls,
|
|
90
|
-
unwrapReplacementByCall: work.unwrapReplacementByCall,
|
|
91
|
-
sourceText: work.sourceText,
|
|
92
|
-
domainSf: work.domainSfForLineNumbers,
|
|
93
|
-
unwrapEdits: work.unwrapEdits,
|
|
94
|
-
plannedGroupEdits: work.plannedGroupEdits,
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
function printGroupFilePreviewBody(args) {
|
|
98
|
-
const { filePath, reportTotal, cnInTvNoReplacement, cnInTvCalls, unwrapReplacementByCall, sourceText, domainSf, unwrapEdits, plannedGroupEdits, } = args;
|
|
99
|
-
let header = `\n── ${filePath} (${reportTotal} site(s)`;
|
|
100
|
-
if (cnInTvNoReplacement > 0) {
|
|
101
|
-
header += `; plus ${cnInTvNoReplacement} cn() inside tv left unchanged (0 args)`;
|
|
102
|
-
}
|
|
103
|
-
header += `) ──`;
|
|
104
|
-
logger.out(header);
|
|
105
|
-
for (const call of cnInTvCalls) {
|
|
106
|
-
const replacement = unwrapReplacementByCall.get(call);
|
|
107
|
-
if (replacement === undefined) {
|
|
108
|
-
logger.out(` Line ${lineOf(domainSf, call)} [tv ⊃ cn]: cn(...) has no arguments — skipped`);
|
|
109
|
-
continue;
|
|
110
|
-
}
|
|
111
|
-
const start = call.pos;
|
|
112
|
-
const end = call.end;
|
|
113
|
-
if (sourceText.slice(start, end) === replacement) {
|
|
114
|
-
continue;
|
|
115
|
-
}
|
|
116
|
-
logger.out(` Line ${lineOf(domainSf, call)} [tv ⊃ cn → string/array]:`);
|
|
117
|
-
logger.out(` ${replacement.split("\n").join("\n ")}`);
|
|
118
|
-
}
|
|
119
|
-
if (unwrapEdits.length > 0 && plannedGroupEdits.length > 0) {
|
|
120
|
-
logger.out(" ([cn] / [tv] / [JSX className] lines below reflect content after unwrap of cn inside tv.)");
|
|
121
|
-
}
|
|
122
|
-
for (const plan of plannedGroupEdits) {
|
|
123
|
-
logger.out(` Line ${lineOf(plan.lineSf, plan.reportNode)} [${plan.label}]:`);
|
|
124
|
-
logger.out(` ${plan.replacement.split("\n").join("\n ")}`);
|
|
125
|
-
logger.out(` // Buckets: ${JSON.stringify(plan.bucketSummary)}`);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { GroupFileResult } from "#/arrange/domain/types";
|
|
2
|
-
import type { FilesystemPort } from "#/core/filesystem/port";
|
|
3
|
-
/**
|
|
4
|
-
* Runs the simplify pass on one file — flattening class expressions and pruning an unused `cn` import.
|
|
5
|
-
*
|
|
6
|
-
* @since 0.3.16-canary.0
|
|
7
|
-
*/
|
|
8
|
-
export declare function processArrangeSimplifyFile(fs: FilesystemPort, args: {
|
|
9
|
-
readonly filePath: string;
|
|
10
|
-
readonly write: boolean;
|
|
11
|
-
}): GroupFileResult;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { collectSimplifyTargets } from "#/arrange/domain/ast/simplify-targets";
|
|
2
|
-
import { dropCnImportIfUnused } from "#/arrange/domain/imports";
|
|
3
|
-
import { parseDomainSourceFile } from "#/arrange/source-parse";
|
|
4
|
-
import { applyEditsDescending } from "#/core/source-text-edit";
|
|
5
|
-
/**
|
|
6
|
-
* Runs the simplify pass on one file — flattening class expressions and pruning an unused `cn` import.
|
|
7
|
-
*
|
|
8
|
-
* @since 0.3.16-canary.0
|
|
9
|
-
*/
|
|
10
|
-
export function processArrangeSimplifyFile(fs, args) {
|
|
11
|
-
const { filePath, write } = args;
|
|
12
|
-
const sourceText = fs.readFileSync(filePath, "utf8");
|
|
13
|
-
const domainSf = parseDomainSourceFile(filePath, sourceText);
|
|
14
|
-
const edits = collectSimplifyTargets(domainSf);
|
|
15
|
-
const meaningful = edits.filter((edit) => sourceText.slice(edit.start, edit.end) !== edit.replacement);
|
|
16
|
-
// Apply class-simplification edits first, then prune any cn import that
|
|
17
|
-
// became (or was already) unused.
|
|
18
|
-
const textAfterEdits = meaningful.length > 0 ? applyEditsDescending(sourceText, meaningful) : sourceText;
|
|
19
|
-
const textAfterImportDrop = dropCnImportIfUnused(parseDomainSourceFile(filePath, textAfterEdits));
|
|
20
|
-
const importDropped = textAfterImportDrop !== textAfterEdits;
|
|
21
|
-
const totalFound = meaningful.length + (importDropped ? 1 : 0);
|
|
22
|
-
if (totalFound === 0) {
|
|
23
|
-
return { filePath, totalFound: 0, changed: 0 };
|
|
24
|
-
}
|
|
25
|
-
if (!write) {
|
|
26
|
-
return { filePath, totalFound, changed: 0 };
|
|
27
|
-
}
|
|
28
|
-
fs.writeFileSync(filePath, textAfterImportDrop, "utf8");
|
|
29
|
-
return { filePath, totalFound, changed: totalFound };
|
|
30
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ArrangeRunResult } from "#/arrange/domain/types";
|
|
2
|
-
import type { AppError } from "#/core/errors";
|
|
3
|
-
import type { FilesystemPort } from "#/core/filesystem/port";
|
|
4
|
-
import type { Result } from "#/core/result";
|
|
5
|
-
/**
|
|
6
|
-
* Runs the simplify pass over every target file and returns the aggregated result.
|
|
7
|
-
*
|
|
8
|
-
* @since 0.3.16-canary.0
|
|
9
|
-
*/
|
|
10
|
-
export declare function runArrangeSimplify(fs: FilesystemPort, args: {
|
|
11
|
-
targetPath: string;
|
|
12
|
-
write: boolean;
|
|
13
|
-
}): Promise<Result<ArrangeRunResult, AppError>>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { scanArrangeTargets } from "#/arrange/scan-target";
|
|
2
|
-
import { processArrangeSimplifyFile } from "#/arrange/simplify-process-file";
|
|
3
|
-
import { ok } from "#/core/result";
|
|
4
|
-
/**
|
|
5
|
-
* Runs the simplify pass over every target file and returns the aggregated result.
|
|
6
|
-
*
|
|
7
|
-
* @since 0.3.16-canary.0
|
|
8
|
-
*/
|
|
9
|
-
export async function runArrangeSimplify(fs, args) {
|
|
10
|
-
const filePaths = scanArrangeTargets(fs, args.targetPath);
|
|
11
|
-
const modifiedFiles = [];
|
|
12
|
-
let totalFound = 0;
|
|
13
|
-
let totalChanged = 0;
|
|
14
|
-
for (const filePath of filePaths) {
|
|
15
|
-
const result = processArrangeSimplifyFile(fs, { filePath, write: args.write });
|
|
16
|
-
totalFound += result.totalFound;
|
|
17
|
-
totalChanged += result.changed;
|
|
18
|
-
if (result.changed > 0) {
|
|
19
|
-
modifiedFiles.push(result.filePath);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return ok({
|
|
23
|
-
filePaths,
|
|
24
|
-
modifiedFiles,
|
|
25
|
-
totalFound,
|
|
26
|
-
totalChanged,
|
|
27
|
-
hookError: null,
|
|
28
|
-
previewPlans: [],
|
|
29
|
-
});
|
|
30
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ArrangeSuggestGroupsRequest } from "#/arrange/cli-schema";
|
|
2
|
-
import type { ArrangeSuggestGroupsOutput } from "#/arrange/domain/types";
|
|
3
|
-
/**
|
|
4
|
-
* Formats the suggested grouping for an inline class string as `arrange group` output lines.
|
|
5
|
-
*
|
|
6
|
-
* @since 0.3.16-canary.0
|
|
7
|
-
*/
|
|
8
|
-
export declare function suggestCnGroupsFromCli(request: ArrangeSuggestGroupsRequest): ArrangeSuggestGroupsOutput;
|
package/dist/arrange/sync.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ArrangeSyncRunRequest } from "#/arrange/cli-schema";
|
|
2
|
-
import type { ArrangeRunResult } from "#/arrange/domain/types";
|
|
3
|
-
import type { AppError } from "#/core/errors";
|
|
4
|
-
import type { FilesystemPort } from "#/core/filesystem/port";
|
|
5
|
-
import type { Result } from "#/core/result";
|
|
6
|
-
/**
|
|
7
|
-
* Runs the grouping pipeline over every target file and returns the aggregated result.
|
|
8
|
-
*
|
|
9
|
-
* @since 0.3.16-canary.0
|
|
10
|
-
*/
|
|
11
|
-
export declare function runArrangeSync(fs: FilesystemPort, request: ArrangeSyncRunRequest): Promise<Result<ArrangeRunResult, AppError>>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ArrangeTargetWorkspaceAndConfig } from "#/arrange/domain/types";
|
|
2
|
-
import { AppError } from "#/core/errors";
|
|
3
|
-
import type { FilesystemPort } from "#/core/filesystem/port";
|
|
4
|
-
import type { Result } from "#/core/result";
|
|
5
|
-
/**
|
|
6
|
-
* Resolves the arrange target, repo root, and loaded config an arrange run needs.
|
|
7
|
-
*
|
|
8
|
-
* @since 0.3.16-canary.0
|
|
9
|
-
*/
|
|
10
|
-
export declare function prepareArrangeWorkspace(fs: FilesystemPort, args: {
|
|
11
|
-
readonly currentWorkingDirectory: string;
|
|
12
|
-
readonly rawTarget: string | undefined;
|
|
13
|
-
}): Promise<Result<ArrangeTargetWorkspaceAndConfig, AppError>>;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Resolved request for a single RTL audit run.
|
|
4
|
-
*
|
|
5
|
-
* @since 0.5.0-canary.6
|
|
6
|
-
*/
|
|
7
|
-
export type RtlAuditRunRequest = {
|
|
8
|
-
readonly rootDir: string;
|
|
9
|
-
readonly targetPath: string;
|
|
10
|
-
readonly allowlist?: ReadonlyArray<string> | undefined;
|
|
11
|
-
readonly json: boolean;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Zod schema for {@link RtlAuditRunRequest}.
|
|
15
|
-
*
|
|
16
|
-
* @since 0.5.0-canary.6
|
|
17
|
-
*/
|
|
18
|
-
export declare const rtlAuditRunRequestSchema: z.ZodType<RtlAuditRunRequest>;
|
|
19
|
-
/**
|
|
20
|
-
* Resolved request for a single link audit run.
|
|
21
|
-
*
|
|
22
|
-
* @since 0.5.0
|
|
23
|
-
*/
|
|
24
|
-
export type LinkAuditRunRequest = {
|
|
25
|
-
readonly rootDir: string;
|
|
26
|
-
readonly targetPath: string;
|
|
27
|
-
readonly allowlist?: ReadonlyArray<string> | undefined;
|
|
28
|
-
readonly json: boolean;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Zod schema for {@link LinkAuditRunRequest}.
|
|
32
|
-
*
|
|
33
|
-
* @since 0.5.0
|
|
34
|
-
*/
|
|
35
|
-
export declare const linkAuditRunRequestSchema: z.ZodType<LinkAuditRunRequest>;
|
|
36
|
-
/**
|
|
37
|
-
* Resolved request for a single comment-divider audit run.
|
|
38
|
-
*
|
|
39
|
-
* @since 0.6.0
|
|
40
|
-
*/
|
|
41
|
-
export type CommentAuditRunRequest = {
|
|
42
|
-
readonly rootDir: string;
|
|
43
|
-
readonly targetPath: string;
|
|
44
|
-
readonly allowlist?: ReadonlyArray<string> | undefined;
|
|
45
|
-
readonly fix: boolean;
|
|
46
|
-
readonly json: boolean;
|
|
47
|
-
};
|
|
48
|
-
/**
|
|
49
|
-
* Zod schema for {@link CommentAuditRunRequest}.
|
|
50
|
-
*
|
|
51
|
-
* @since 0.6.0
|
|
52
|
-
*/
|
|
53
|
-
export declare const commentAuditRunRequestSchema: z.ZodType<CommentAuditRunRequest>;
|
|
54
|
-
/**
|
|
55
|
-
* Resolved request for a single import-policy audit run.
|
|
56
|
-
*
|
|
57
|
-
* @since 0.10.0
|
|
58
|
-
*/
|
|
59
|
-
export type ImportsAuditRunRequest = {
|
|
60
|
-
readonly rootDir: string;
|
|
61
|
-
readonly targetPath: string;
|
|
62
|
-
readonly allowlist?: ReadonlyArray<string> | undefined;
|
|
63
|
-
readonly json: boolean;
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* Zod schema for {@link ImportsAuditRunRequest}.
|
|
67
|
-
*
|
|
68
|
-
* @since 0.10.0
|
|
69
|
-
*/
|
|
70
|
-
export declare const importsAuditRunRequestSchema: z.ZodType<ImportsAuditRunRequest>;
|
|
71
|
-
/**
|
|
72
|
-
* Resolved request for a single display-name audit run.
|
|
73
|
-
*
|
|
74
|
-
* @since 0.9.0
|
|
75
|
-
*/
|
|
76
|
-
export type DisplayNameAuditRunRequest = {
|
|
77
|
-
readonly rootDir: string;
|
|
78
|
-
readonly targetPath: string;
|
|
79
|
-
readonly allowlist?: ReadonlyArray<string> | undefined;
|
|
80
|
-
readonly json: boolean;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Zod schema for {@link DisplayNameAuditRunRequest}.
|
|
84
|
-
*
|
|
85
|
-
* @since 0.9.0
|
|
86
|
-
*/
|
|
87
|
-
export declare const displayNameAuditRunRequestSchema: z.ZodType<DisplayNameAuditRunRequest>;
|
|
88
|
-
/**
|
|
89
|
-
* Resolves a path that may be absolute or relative to `rootDir`.
|
|
90
|
-
*
|
|
91
|
-
* @since 0.5.0-canary.6
|
|
92
|
-
*/
|
|
93
|
-
export declare function resolveRepoRelativePath(rootDir: string, maybeRelative: string): string;
|
package/dist/audit/cli-schema.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import path from "node:path";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
/**
|
|
4
|
-
* Zod schema for {@link RtlAuditRunRequest}.
|
|
5
|
-
*
|
|
6
|
-
* @since 0.5.0-canary.6
|
|
7
|
-
*/
|
|
8
|
-
export const rtlAuditRunRequestSchema = z.object({
|
|
9
|
-
rootDir: z.string().min(1),
|
|
10
|
-
targetPath: z.string().min(1),
|
|
11
|
-
allowlist: z.array(z.string()).optional(),
|
|
12
|
-
json: z.boolean(),
|
|
13
|
-
});
|
|
14
|
-
/**
|
|
15
|
-
* Zod schema for {@link LinkAuditRunRequest}.
|
|
16
|
-
*
|
|
17
|
-
* @since 0.5.0
|
|
18
|
-
*/
|
|
19
|
-
export const linkAuditRunRequestSchema = z.object({
|
|
20
|
-
rootDir: z.string().min(1),
|
|
21
|
-
targetPath: z.string().min(1),
|
|
22
|
-
allowlist: z.array(z.string()).optional(),
|
|
23
|
-
json: z.boolean(),
|
|
24
|
-
});
|
|
25
|
-
/**
|
|
26
|
-
* Zod schema for {@link CommentAuditRunRequest}.
|
|
27
|
-
*
|
|
28
|
-
* @since 0.6.0
|
|
29
|
-
*/
|
|
30
|
-
export const commentAuditRunRequestSchema = z.object({
|
|
31
|
-
rootDir: z.string().min(1),
|
|
32
|
-
targetPath: z.string().min(1),
|
|
33
|
-
allowlist: z.array(z.string()).optional(),
|
|
34
|
-
fix: z.boolean(),
|
|
35
|
-
json: z.boolean(),
|
|
36
|
-
});
|
|
37
|
-
/**
|
|
38
|
-
* Zod schema for {@link ImportsAuditRunRequest}.
|
|
39
|
-
*
|
|
40
|
-
* @since 0.10.0
|
|
41
|
-
*/
|
|
42
|
-
export const importsAuditRunRequestSchema = z.object({
|
|
43
|
-
rootDir: z.string().min(1),
|
|
44
|
-
targetPath: z.string().min(1),
|
|
45
|
-
allowlist: z.array(z.string()).optional(),
|
|
46
|
-
json: z.boolean(),
|
|
47
|
-
});
|
|
48
|
-
/**
|
|
49
|
-
* Zod schema for {@link DisplayNameAuditRunRequest}.
|
|
50
|
-
*
|
|
51
|
-
* @since 0.9.0
|
|
52
|
-
*/
|
|
53
|
-
export const displayNameAuditRunRequestSchema = z.object({
|
|
54
|
-
rootDir: z.string().min(1),
|
|
55
|
-
targetPath: z.string().min(1),
|
|
56
|
-
allowlist: z.array(z.string()).optional(),
|
|
57
|
-
json: z.boolean(),
|
|
58
|
-
});
|
|
59
|
-
/**
|
|
60
|
-
* Resolves a path that may be absolute or relative to `rootDir`.
|
|
61
|
-
*
|
|
62
|
-
* @since 0.5.0-canary.6
|
|
63
|
-
*/
|
|
64
|
-
export function resolveRepoRelativePath(rootDir, maybeRelative) {
|
|
65
|
-
return path.isAbsolute(maybeRelative) ? path.resolve(maybeRelative) : path.resolve(rootDir, maybeRelative);
|
|
66
|
-
}
|
package/dist/audit/output.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import type { CommentAuditResult, ImportsAuditResult, LinkAuditResult, RtlAuditResult, DisplayNameAuditResult } from "#/audit/domain/types";
|
|
2
|
-
/**
|
|
3
|
-
* Exit `1` when any non-allowlisted violation remains.
|
|
4
|
-
*
|
|
5
|
-
* @since 0.5.0-canary.6
|
|
6
|
-
*/
|
|
7
|
-
export declare function exitCodeForRtlAuditResult(result: RtlAuditResult): number;
|
|
8
|
-
/**
|
|
9
|
-
* Human-readable RTL audit report (matches the former packages/ui script shape).
|
|
10
|
-
*
|
|
11
|
-
* @since 0.5.0-canary.6
|
|
12
|
-
*/
|
|
13
|
-
export declare function presentRtlAuditResult(result: RtlAuditResult): void;
|
|
14
|
-
/**
|
|
15
|
-
* Machine-readable RTL audit summary for `--json`.
|
|
16
|
-
*
|
|
17
|
-
* @since 0.5.0-canary.6
|
|
18
|
-
*/
|
|
19
|
-
export declare function formatRtlAuditJsonOutput(result: RtlAuditResult, rootDir: string): string;
|
|
20
|
-
/**
|
|
21
|
-
* Exit `1` when any non-allowlisted broken link remains.
|
|
22
|
-
*
|
|
23
|
-
* @since 0.5.0
|
|
24
|
-
*/
|
|
25
|
-
export declare function exitCodeForLinkAuditResult(result: LinkAuditResult): number;
|
|
26
|
-
/**
|
|
27
|
-
* Human-readable link audit report.
|
|
28
|
-
*
|
|
29
|
-
* @since 0.5.0
|
|
30
|
-
*/
|
|
31
|
-
export declare function presentLinkAuditResult(result: LinkAuditResult): void;
|
|
32
|
-
/**
|
|
33
|
-
* Machine-readable link audit summary for `--json`.
|
|
34
|
-
*
|
|
35
|
-
* @since 0.5.0
|
|
36
|
-
*/
|
|
37
|
-
export declare function formatLinkAuditJsonOutput(result: LinkAuditResult, rootDir: string): string;
|
|
38
|
-
/**
|
|
39
|
-
* Exit `1` when any non-allowlisted import-policy violation remains.
|
|
40
|
-
*
|
|
41
|
-
* @since 0.10.0
|
|
42
|
-
*/
|
|
43
|
-
export declare function exitCodeForImportsAuditResult(result: ImportsAuditResult): number;
|
|
44
|
-
/**
|
|
45
|
-
* Human-readable import-policy report.
|
|
46
|
-
*
|
|
47
|
-
* @since 0.10.0
|
|
48
|
-
*/
|
|
49
|
-
export declare function presentImportsAuditResult(result: ImportsAuditResult): void;
|
|
50
|
-
/**
|
|
51
|
-
* Machine-readable import-policy summary for `--json`.
|
|
52
|
-
*
|
|
53
|
-
* @since 0.10.0
|
|
54
|
-
*/
|
|
55
|
-
export declare function formatImportsAuditJsonOutput(result: ImportsAuditResult, rootDir: string): string;
|
|
56
|
-
/**
|
|
57
|
-
* Exit `1` when any non-allowlisted divider still breaks the convention.
|
|
58
|
-
*
|
|
59
|
-
* @since 0.6.0
|
|
60
|
-
*/
|
|
61
|
-
export declare function exitCodeForCommentAuditResult(result: CommentAuditResult): number;
|
|
62
|
-
/**
|
|
63
|
-
* Human-readable comment-divider report.
|
|
64
|
-
*
|
|
65
|
-
* @since 0.6.0
|
|
66
|
-
*/
|
|
67
|
-
export declare function presentCommentAuditResult(result: CommentAuditResult): void;
|
|
68
|
-
/**
|
|
69
|
-
* Machine-readable comment-divider summary for `--json`.
|
|
70
|
-
*
|
|
71
|
-
* @since 0.6.0
|
|
72
|
-
*/
|
|
73
|
-
export declare function formatCommentAuditJsonOutput(result: CommentAuditResult, rootDir: string): string;
|
|
74
|
-
/**
|
|
75
|
-
* Exit `1` when any non-allowlisted display-name violation remains.
|
|
76
|
-
*
|
|
77
|
-
* @since 0.9.0
|
|
78
|
-
*/
|
|
79
|
-
export declare function exitCodeForDisplayNameAuditResult(result: DisplayNameAuditResult): number;
|
|
80
|
-
/**
|
|
81
|
-
* Human-readable display-name report.
|
|
82
|
-
*
|
|
83
|
-
* @since 0.9.0
|
|
84
|
-
*/
|
|
85
|
-
export declare function presentDisplayNameAuditResult(result: DisplayNameAuditResult): void;
|
|
86
|
-
/**
|
|
87
|
-
* Machine-readable display-name summary for `--json`.
|
|
88
|
-
*
|
|
89
|
-
* @since 0.9.0
|
|
90
|
-
*/
|
|
91
|
-
export declare function formatDisplayNameAuditJsonOutput(result: DisplayNameAuditResult, rootDir: string): string;
|