@codefast/cli 0.11.0 → 0.13.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 +87 -0
- package/README.md +152 -56
- package/dist/arrange/command.js +24 -25
- 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 +5 -5
- package/dist/arrange/domain/ast/targets.d.ts +2 -2
- package/dist/arrange/domain/ast/targets.js +9 -9
- package/dist/arrange/domain/ast/translator.d.ts +1 -1
- package/dist/arrange/domain/ast/translator.js +43 -29
- 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 +1 -1
- package/dist/arrange/group/output.d.ts +1 -1
- package/dist/arrange/group/output.js +1 -1
- package/dist/arrange/group/suggest.d.ts +2 -2
- package/dist/arrange/group/suggest.js +2 -2
- package/dist/arrange/inspect/cli-result.d.ts +1 -1
- package/dist/arrange/inspect/domain/analyze-service.d.ts +2 -2
- package/dist/arrange/inspect/domain/analyze-service.js +7 -7
- package/dist/arrange/inspect/output.d.ts +1 -1
- package/dist/arrange/inspect/output.js +2 -2
- package/dist/arrange/inspect/run.d.ts +4 -4
- package/dist/arrange/inspect/run.js +6 -6
- package/dist/arrange/prepare.d.ts +4 -4
- package/dist/arrange/prepare.js +5 -5
- package/dist/arrange/regroup/cli-result.d.ts +1 -1
- package/dist/arrange/regroup/cli-result.js +1 -1
- package/dist/arrange/regroup/output.d.ts +2 -2
- package/dist/arrange/regroup/output.js +2 -2
- package/dist/arrange/regroup/process-file.d.ts +2 -2
- package/dist/arrange/regroup/process-file.js +3 -3
- package/dist/arrange/regroup/run.d.ts +5 -5
- package/dist/arrange/regroup/run.js +4 -4
- package/dist/arrange/resolve-target.d.ts +1 -1
- package/dist/arrange/resolve-target.js +2 -2
- package/dist/arrange/scan-target.d.ts +1 -1
- package/dist/arrange/scan-target.js +3 -3
- package/dist/arrange/simplify/cli-result.d.ts +1 -1
- package/dist/arrange/simplify/fold-targets.d.ts +3 -3
- package/dist/arrange/simplify/fold-targets.js +3 -3
- package/dist/arrange/simplify/output.d.ts +1 -1
- package/dist/arrange/simplify/output.js +1 -1
- package/dist/arrange/simplify/process-file.d.ts +4 -4
- package/dist/arrange/simplify/process-file.js +5 -5
- package/dist/arrange/simplify/run.d.ts +4 -4
- package/dist/arrange/simplify/run.js +4 -4
- package/dist/arrange/simplify/variant-classname-probe.js +1 -1
- package/dist/arrange/source-parse.d.ts +1 -1
- package/dist/arrange/source-parse.js +3 -3
- package/dist/audit/assertions/cli-result.d.ts +13 -0
- package/dist/audit/assertions/cli-result.js +22 -0
- package/dist/audit/assertions/cli-schema.d.ts +18 -0
- package/dist/audit/assertions/cli-schema.js +12 -0
- package/dist/audit/assertions/domain/double-assertion.d.ts +20 -0
- package/dist/audit/assertions/domain/double-assertion.js +122 -0
- package/dist/audit/assertions/output.d.ts +7 -0
- package/dist/audit/assertions/output.js +21 -0
- package/dist/audit/assertions/prepare.d.ts +16 -0
- package/dist/audit/assertions/prepare.js +12 -0
- package/dist/audit/assertions/run.d.ts +14 -0
- package/dist/audit/assertions/run.js +40 -0
- package/dist/audit/command.js +89 -28
- package/dist/audit/comments/cli-result.d.ts +1 -1
- package/dist/audit/comments/cli-result.js +1 -1
- package/dist/audit/comments/output.d.ts +1 -1
- package/dist/audit/comments/output.js +1 -1
- package/dist/audit/comments/prepare.d.ts +4 -4
- package/dist/audit/comments/prepare.js +1 -1
- package/dist/audit/comments/run.d.ts +4 -4
- package/dist/audit/comments/run.js +9 -9
- package/dist/audit/constants/cli-result.d.ts +13 -0
- package/dist/audit/constants/cli-result.js +22 -0
- package/dist/audit/constants/cli-schema.d.ts +18 -0
- package/dist/audit/constants/cli-schema.js +12 -0
- package/dist/audit/constants/domain/constants.d.ts +8 -0
- package/dist/audit/constants/domain/constants.js +66 -0
- package/dist/audit/constants/output.d.ts +7 -0
- package/dist/audit/constants/output.js +21 -0
- package/dist/audit/constants/prepare.d.ts +16 -0
- package/dist/audit/constants/prepare.js +37 -0
- package/dist/audit/constants/run.d.ts +14 -0
- package/dist/audit/constants/run.js +64 -0
- package/dist/audit/display-names/cli-result.d.ts +1 -1
- package/dist/audit/display-names/cli-result.js +1 -1
- package/dist/audit/display-names/domain/display-names.d.ts +1 -1
- package/dist/audit/display-names/domain/display-names.js +1 -9
- package/dist/audit/display-names/output.d.ts +1 -1
- package/dist/audit/display-names/output.js +1 -1
- package/dist/audit/display-names/prepare.d.ts +4 -4
- package/dist/audit/display-names/prepare.js +1 -1
- package/dist/audit/display-names/run.d.ts +4 -4
- package/dist/audit/display-names/run.js +5 -5
- package/dist/audit/domain/types.d.ts +128 -0
- package/dist/audit/imports/cli-result.d.ts +1 -1
- package/dist/audit/imports/cli-result.js +1 -1
- package/dist/audit/imports/domain/import-policy.d.ts +1 -1
- package/dist/audit/imports/domain/import-policy.js +4 -18
- package/dist/audit/imports/output.d.ts +1 -1
- package/dist/audit/imports/output.js +1 -1
- package/dist/audit/imports/prepare.d.ts +4 -4
- package/dist/audit/imports/prepare.js +1 -1
- package/dist/audit/imports/run.d.ts +4 -4
- package/dist/audit/imports/run.js +6 -6
- package/dist/audit/links/cli-result.d.ts +1 -1
- package/dist/audit/links/cli-result.js +1 -1
- package/dist/audit/links/domain/markdown-links.d.ts +3 -3
- package/dist/audit/links/domain/markdown-links.js +22 -8
- package/dist/audit/links/output.d.ts +1 -1
- package/dist/audit/links/output.js +1 -1
- package/dist/audit/links/prepare.d.ts +4 -4
- package/dist/audit/links/prepare.js +1 -1
- package/dist/audit/links/run.d.ts +4 -4
- package/dist/audit/links/run.js +4 -4
- package/dist/audit/prepare.d.ts +4 -4
- package/dist/audit/prepare.js +4 -4
- package/dist/audit/publish/cli-result.d.ts +13 -0
- package/dist/audit/publish/cli-result.js +25 -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/domain/stylesheet-sources.d.ts +22 -0
- package/dist/audit/publish/domain/stylesheet-sources.js +64 -0
- package/dist/audit/publish/output.d.ts +7 -0
- package/dist/audit/publish/output.js +33 -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 +15 -0
- package/dist/audit/publish/run.js +91 -0
- package/dist/audit/publish/shipped-files.d.ts +21 -0
- package/dist/audit/publish/shipped-files.js +36 -0
- package/dist/audit/rtl/cli-result.d.ts +1 -1
- package/dist/audit/rtl/cli-result.js +1 -1
- package/dist/audit/rtl/domain/audit-file.d.ts +1 -1
- package/dist/audit/rtl/domain/audit-file.js +2 -2
- package/dist/audit/rtl/domain/tokenize.d.ts +1 -1
- package/dist/audit/rtl/output.d.ts +1 -1
- package/dist/audit/rtl/output.js +1 -1
- package/dist/audit/rtl/prepare.d.ts +4 -4
- package/dist/audit/rtl/prepare.js +5 -5
- package/dist/audit/rtl/run.d.ts +4 -4
- package/dist/audit/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 +4 -5
- package/dist/core/cli/command-pipeline.js +7 -7
- package/dist/core/cli/format-error.d.ts +1 -1
- package/dist/core/cli/resolve-root.d.ts +3 -3
- package/dist/core/cli/resolve-root.js +3 -3
- package/dist/core/cli/result-handle.d.ts +2 -2
- package/dist/core/cli/result-handle.js +4 -4
- package/dist/core/config/define-config.d.ts +1 -1
- package/dist/core/config/loader.d.ts +2 -2
- package/dist/core/config/loader.js +2 -2
- package/dist/core/config/schema.d.ts +5 -0
- package/dist/core/config/schema.js +2 -0
- package/dist/core/config/warnings.js +1 -1
- package/dist/core/config.d.ts +4 -4
- package/dist/core/config.js +4 -4
- package/dist/core/filesystem/filesystem.d.ts +3 -4
- package/dist/core/filesystem/node.d.ts +1 -1
- package/dist/core/filesystem/node.js +1 -7
- package/dist/core/oxc-node.d.ts +32 -0
- package/dist/core/oxc-node.js +25 -0
- package/dist/core/schema-parse.d.ts +2 -2
- package/dist/core/schema-parse.js +2 -2
- package/dist/core/source-position.d.ts +15 -0
- package/dist/core/source-position.js +26 -0
- package/dist/core/workspace/markdown-walk.d.ts +1 -1
- package/dist/core/workspace/markdown-walk.js +1 -1
- package/dist/core/workspace/package-version.d.ts +1 -1
- package/dist/core/workspace/package-version.js +2 -2
- package/dist/core/workspace/resolver.d.ts +1 -1
- package/dist/core/workspace/resolver.js +5 -5
- package/dist/core/workspace/source-walk.d.ts +1 -1
- package/dist/core/workspace/source-walk.js +1 -1
- package/dist/core/workspace/typescript-walk.d.ts +1 -1
- package/dist/core/workspace/typescript-walk.js +1 -1
- package/dist/core/workspace/walk-files.d.ts +1 -1
- 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 +1 -1
- package/dist/mirror/command.js +7 -7
- package/dist/mirror/dist-filesystem-node.d.ts +2 -2
- package/dist/mirror/dist-filesystem-node.js +5 -15
- package/dist/mirror/domain/exports.d.ts +2 -2
- package/dist/mirror/domain/exports.js +1 -1
- package/dist/mirror/domain/types.d.ts +2 -2
- package/dist/mirror/output.d.ts +1 -1
- package/dist/mirror/output.js +2 -2
- package/dist/mirror/package-path.d.ts +3 -3
- package/dist/mirror/package-path.js +3 -3
- package/dist/mirror/prepare.d.ts +5 -5
- package/dist/mirror/prepare.js +4 -4
- package/dist/mirror/run.d.ts +6 -6
- package/dist/mirror/run.js +7 -7
- package/dist/mirror/supplement-exports.d.ts +1 -1
- package/dist/mirror/supplement-exports.js +2 -2
- package/dist/mirror/sync-workspace-package.d.ts +3 -3
- package/dist/mirror/sync-workspace-package.js +11 -14
- package/dist/mirror/write-exports.d.ts +2 -2
- 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/command.js +9 -9
- 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 +3 -3
- package/dist/pack-slim/prepare.js +2 -2
- package/dist/pack-slim/run.d.ts +5 -5
- package/dist/pack-slim/run.js +6 -6
- 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 +1 -1
- package/dist/tag/cli-result.js +1 -1
- package/dist/tag/cli-schema.d.ts +1 -1
- package/dist/tag/command.js +7 -7
- package/dist/tag/domain/skip-filter.d.ts +1 -1
- package/dist/tag/domain/skip-filter.js +1 -1
- package/dist/tag/domain/types.d.ts +1 -1
- package/dist/tag/domain/version-summary.d.ts +5 -2
- package/dist/tag/output.d.ts +1 -1
- package/dist/tag/output.js +1 -1
- package/dist/tag/prepare.d.ts +4 -4
- package/dist/tag/prepare.js +4 -4
- package/dist/tag/run.d.ts +4 -4
- package/dist/tag/run.js +7 -7
- package/dist/tag/target/candidates.d.ts +2 -2
- package/dist/tag/target/candidates.js +2 -2
- package/dist/tag/target/resolve-path.d.ts +1 -1
- package/dist/tag/target/runner.d.ts +2 -2
- package/dist/tag/target/runner.js +3 -3
- package/dist/tag/writer/since-writer.d.ts +2 -2
- package/dist/tag/writer/since-writer.js +3 -5
- package/dist/tag/writer/version-resolver.d.ts +1 -1
- package/dist/tag/writer/version-resolver.js +1 -1
- package/package.json +7 -7
- package/dist/mirror/domain/dirent-guard.d.ts +0 -10
- package/dist/mirror/domain/dirent-guard.js +0 -15
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PackSlimPackageStats, PackSlimProgressListener, PackSlimRunStats } from "
|
|
1
|
+
import type { PackSlimPackageStats, PackSlimProgressListener, PackSlimRunStats } from "#pack-slim/domain/types";
|
|
2
2
|
/**
|
|
3
3
|
* A progress listener that renders pack-slim run events as human-readable CLI lines.
|
|
4
4
|
*
|
package/dist/pack-slim/output.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { AppError } from "
|
|
2
|
-
import type { Filesystem } from "
|
|
3
|
-
import type { Result } from "
|
|
1
|
+
import type { AppError } from "#core/errors";
|
|
2
|
+
import type { Filesystem } from "#core/filesystem/filesystem";
|
|
3
|
+
import type { Result } from "#core/result";
|
|
4
4
|
/**
|
|
5
5
|
* The repo root and package filter a pack-slim run starts from.
|
|
6
6
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveProjectRootResult } from "
|
|
2
|
-
import { ok } from "
|
|
1
|
+
import { resolveProjectRootResult } from "#core/cli/resolve-root";
|
|
2
|
+
import { ok } from "#core/result";
|
|
3
3
|
/**
|
|
4
4
|
* Resolves the repo root and optional package filter into the prelude a pack-slim run starts from.
|
|
5
5
|
*
|
package/dist/pack-slim/run.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { AppError } from "
|
|
2
|
-
import type { Filesystem } from "
|
|
3
|
-
import type { Result } from "
|
|
4
|
-
import type { PackSlimRunRequest } from "
|
|
5
|
-
import type { PackSlimProgressListener, PackSlimRunStats } from "
|
|
1
|
+
import { AppError } from "#core/errors";
|
|
2
|
+
import type { Filesystem } from "#core/filesystem/filesystem";
|
|
3
|
+
import type { Result } from "#core/result";
|
|
4
|
+
import type { PackSlimRunRequest } from "#pack-slim/cli-schema";
|
|
5
|
+
import type { PackSlimProgressListener, PackSlimRunStats } from "#pack-slim/domain/types";
|
|
6
6
|
/**
|
|
7
7
|
* A pack-slim run request paired with an optional progress listener.
|
|
8
8
|
*
|
package/dist/pack-slim/run.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { AppError, messageFrom } from "
|
|
3
|
-
import { err, ok } from "
|
|
4
|
-
import { listWorkspacePackageDirectories } from "
|
|
5
|
-
import { distDirName, packageJsonFileName } from "
|
|
6
|
-
import { isMapAnnotatedFile, isSourceMapFile, slimPublishManifest, stripSourceMappingComment, } from "
|
|
2
|
+
import { AppError, messageFrom } from "#core/errors";
|
|
3
|
+
import { err, ok } from "#core/result";
|
|
4
|
+
import { listWorkspacePackageDirectories } from "#core/workspace/resolver";
|
|
5
|
+
import { distDirName, packageJsonFileName } from "#core/workspace/well-known-files";
|
|
6
|
+
import { isMapAnnotatedFile, isSourceMapFile, slimPublishManifest, stripSourceMappingComment, } from "#pack-slim/domain/transform";
|
|
7
7
|
/**
|
|
8
8
|
* Slims every published package's manifest and build output for publish and returns the aggregate stats.
|
|
9
9
|
*
|
|
@@ -115,7 +115,7 @@ async function pruneDist(fs, distDir, write, pkgStats) {
|
|
|
115
115
|
if (!fs.existsSync(distDir)) {
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
|
-
const entries =
|
|
118
|
+
const entries = await fs.readdirEntries(distDir, { recursive: true });
|
|
119
119
|
for (const entry of entries) {
|
|
120
120
|
if (!entry.isFile()) {
|
|
121
121
|
continue;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { execFileSync } from "node:child_process";
|
|
2
|
-
import { AppError, messageFrom } from "
|
|
3
|
-
import { err, ok } from "
|
|
2
|
+
import { AppError, messageFrom } from "#core/errors";
|
|
3
|
+
import { err, ok } from "#core/result";
|
|
4
4
|
/**
|
|
5
5
|
* Whether git's tracked-only porcelain output reports any uncommitted change.
|
|
6
6
|
*
|
package/dist/tag/cli-result.d.ts
CHANGED
package/dist/tag/cli-result.js
CHANGED
package/dist/tag/cli-schema.d.ts
CHANGED
package/dist/tag/command.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { applyCommandPipeline } from "
|
|
3
|
-
import { nodeFilesystem } from "
|
|
4
|
-
import { exitCodeForTagResult, formatTagJsonOutput } from "
|
|
5
|
-
import { tagRunRequestSchema } from "
|
|
6
|
-
import { presentTagResult, TagProgressPresenter } from "
|
|
7
|
-
import { prepareTag } from "
|
|
8
|
-
import { runTag } from "
|
|
2
|
+
import { applyCommandPipeline } from "#core/cli/command-pipeline";
|
|
3
|
+
import { nodeFilesystem } from "#core/filesystem/node";
|
|
4
|
+
import { exitCodeForTagResult, formatTagJsonOutput } from "#tag/cli-result";
|
|
5
|
+
import { tagRunRequestSchema } from "#tag/cli-schema";
|
|
6
|
+
import { presentTagResult, TagProgressPresenter } from "#tag/output";
|
|
7
|
+
import { prepareTag } from "#tag/prepare";
|
|
8
|
+
import { runTag } from "#tag/run";
|
|
9
9
|
const tagPipeline = {
|
|
10
10
|
positional: { name: "[target]", help: "Directory or file to tag (default: auto-discover workspace packages)" },
|
|
11
11
|
schema: tagRunRequestSchema,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TagTargetCandidate } from "
|
|
1
|
+
import type { TagTargetCandidate } from "#tag/domain/types";
|
|
2
2
|
/**
|
|
3
3
|
* Partitions tag target candidates into those to tag and those to skip, matching each candidate's
|
|
4
4
|
* package name against `skipPackages` as glob patterns.
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import type { TagTargetExecutionResult } from "#/tag/domain/types";
|
|
2
1
|
/**
|
|
3
2
|
* Collects the distinct, non-empty package versions stamped across a run's target results.
|
|
4
3
|
*
|
|
5
4
|
* @since 0.11.0
|
|
6
5
|
*/
|
|
7
|
-
export declare function extractDistinctVersions(targetResults:
|
|
6
|
+
export declare function extractDistinctVersions(targetResults: ReadonlyArray<{
|
|
7
|
+
readonly result: {
|
|
8
|
+
readonly version: string;
|
|
9
|
+
} | null;
|
|
10
|
+
}>): Set<string>;
|
|
8
11
|
/**
|
|
9
12
|
* Summarizes a set of versions as `"none"`, the single version, or `"mixed"`.
|
|
10
13
|
*
|
package/dist/tag/output.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TagProgressListener, TagResolvedTarget, TagResult, TagTargetExecutionResult } from "
|
|
1
|
+
import type { TagProgressListener, TagResolvedTarget, TagResult, TagTargetExecutionResult } from "#tag/domain/types";
|
|
2
2
|
/**
|
|
3
3
|
* A progress listener that prints a line as each tag target starts and completes.
|
|
4
4
|
*
|
package/dist/tag/output.js
CHANGED
package/dist/tag/prepare.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { AppError } from "
|
|
2
|
-
import type { Filesystem } from "
|
|
3
|
-
import type { Result } from "
|
|
4
|
-
import type { TagCommandPrelude } from "
|
|
1
|
+
import type { AppError } from "#core/errors";
|
|
2
|
+
import type { Filesystem } from "#core/filesystem/filesystem";
|
|
3
|
+
import type { Result } from "#core/result";
|
|
4
|
+
import type { TagCommandPrelude } from "#tag/domain/types";
|
|
5
5
|
/**
|
|
6
6
|
* Resolves the repo root, config, and optional target path into the prelude a tag run starts from.
|
|
7
7
|
*
|
package/dist/tag/prepare.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { loadCodefastConfig } from "
|
|
2
|
-
import { ok } from "
|
|
3
|
-
import { resolveProjectRoot } from "
|
|
4
|
-
import { resolveProvidedTagTargetPath } from "
|
|
1
|
+
import { loadCodefastConfig } from "#core/config";
|
|
2
|
+
import { ok } from "#core/result";
|
|
3
|
+
import { resolveProjectRoot } from "#core/workspace/resolver";
|
|
4
|
+
import { resolveProvidedTagTargetPath } from "#tag/target/resolve-path";
|
|
5
5
|
/**
|
|
6
6
|
* Resolves the repo root, config, and optional target path into the prelude a tag run starts from.
|
|
7
7
|
*
|
package/dist/tag/run.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AppError } from "
|
|
2
|
-
import type { Filesystem } from "
|
|
3
|
-
import type { Result } from "
|
|
4
|
-
import type { TagExecutionInput, TagResult } from "
|
|
1
|
+
import { AppError } from "#core/errors";
|
|
2
|
+
import type { Filesystem } from "#core/filesystem/filesystem";
|
|
3
|
+
import type { Result } from "#core/result";
|
|
4
|
+
import type { TagExecutionInput, TagResult } from "#tag/domain/types";
|
|
5
5
|
/**
|
|
6
6
|
* Applies `@since` tags across the selected targets and returns the aggregate result.
|
|
7
7
|
*
|
package/dist/tag/run.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { AppError } from "
|
|
3
|
-
import { messageFrom } from "
|
|
4
|
-
import { err, ok } from "
|
|
5
|
-
import { filterSkippedCandidates } from "
|
|
6
|
-
import { extractDistinctVersions, summarizeVersions } from "
|
|
7
|
-
import { resolveTagTargetCandidates } from "
|
|
8
|
-
import { runTagOnTarget } from "
|
|
2
|
+
import { AppError } from "#core/errors";
|
|
3
|
+
import { messageFrom } from "#core/errors";
|
|
4
|
+
import { err, ok } from "#core/result";
|
|
5
|
+
import { filterSkippedCandidates } from "#tag/domain/skip-filter";
|
|
6
|
+
import { extractDistinctVersions, summarizeVersions } from "#tag/domain/version-summary";
|
|
7
|
+
import { resolveTagTargetCandidates } from "#tag/target/candidates";
|
|
8
|
+
import { runTagOnTarget } from "#tag/target/runner";
|
|
9
9
|
/**
|
|
10
10
|
* Applies `@since` tags across the selected targets and returns the aggregate result.
|
|
11
11
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Filesystem } from "
|
|
2
|
-
import type { TagTargetCandidate } from "
|
|
1
|
+
import type { Filesystem } from "#core/filesystem/filesystem";
|
|
2
|
+
import type { TagTargetCandidate } from "#tag/domain/types";
|
|
3
3
|
/**
|
|
4
4
|
* Resolves the candidate targets for a tag run: the explicit target, or the discovered workspace packages.
|
|
5
5
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import { listWorkspacePackageDirectories } from "
|
|
4
|
-
import { packageJsonFileName } from "
|
|
3
|
+
import { listWorkspacePackageDirectories } from "#core/workspace/resolver";
|
|
4
|
+
import { packageJsonFileName } from "#core/workspace/well-known-files";
|
|
5
5
|
const packageJsonNameSchema = z.looseObject({
|
|
6
6
|
name: z.string().min(1).optional(),
|
|
7
7
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Filesystem } from "
|
|
2
|
-
import type { TagRunOptions, TagRunResult } from "
|
|
1
|
+
import type { Filesystem } from "#core/filesystem/filesystem";
|
|
2
|
+
import type { TagRunOptions, TagRunResult } from "#tag/domain/types";
|
|
3
3
|
/**
|
|
4
4
|
* Stamps `@since` tags across one target's TypeScript files and returns the run result.
|
|
5
5
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { walkTsxFiles } from "
|
|
3
|
-
import { TagSinceWriter } from "
|
|
4
|
-
import { resolveNearestPackageVersion } from "
|
|
2
|
+
import { walkTsxFiles } from "#core/workspace/typescript-walk";
|
|
3
|
+
import { TagSinceWriter } from "#tag/writer/since-writer";
|
|
4
|
+
import { resolveNearestPackageVersion } from "#tag/writer/version-resolver";
|
|
5
5
|
/**
|
|
6
6
|
* Stamps `@since` tags across one target's TypeScript files and returns the run result.
|
|
7
7
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Filesystem } from "
|
|
2
|
-
import type { TagFileResult } from "
|
|
1
|
+
import type { Filesystem } from "#core/filesystem/filesystem";
|
|
2
|
+
import type { TagFileResult } from "#tag/domain/types";
|
|
3
3
|
/**
|
|
4
4
|
* The writer that adds missing `@since` tags to a file's exported declarations.
|
|
5
5
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { parseSync } from "oxc-parser";
|
|
2
|
-
import {
|
|
2
|
+
import { isOxcNode, programStatements } from "#core/oxc-node";
|
|
3
|
+
import { applyEditsDescending, indentOfLineContaining } from "#core/source-text-edit";
|
|
3
4
|
/**
|
|
4
5
|
* Top-level statement kinds that carry a `@since` tag: function, class, interface,
|
|
5
6
|
* type alias, enum, and variable declaration.
|
|
@@ -12,9 +13,6 @@ const TAGGABLE_DECLARATION_TYPES = new Set([
|
|
|
12
13
|
"TSEnumDeclaration",
|
|
13
14
|
"VariableDeclaration",
|
|
14
15
|
]);
|
|
15
|
-
function isOxcNode(value) {
|
|
16
|
-
return typeof value === "object" && value !== null && typeof value.type === "string";
|
|
17
|
-
}
|
|
18
16
|
function identifierName(node) {
|
|
19
17
|
if (isOxcNode(node) && node.type === "Identifier" && typeof node.name === "string") {
|
|
20
18
|
return node.name;
|
|
@@ -35,7 +33,7 @@ export class TagSinceWriter {
|
|
|
35
33
|
applySinceTagsToFile(filePath, version, write) {
|
|
36
34
|
const sourceText = this.fs.readFileSync(filePath, "utf8");
|
|
37
35
|
const { program, comments } = parseSync(filePath, sourceText);
|
|
38
|
-
const statements = program
|
|
36
|
+
const statements = programStatements(program);
|
|
39
37
|
const jsDocComments = comments.filter((comment) => comment.type === "Block" && comment.value.startsWith("*"));
|
|
40
38
|
const edits = [];
|
|
41
39
|
for (const declaration of this.collectExportedDeclarations(statements)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codefast/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Developer CLI for the Codefast monorepo (arrange, audit, mirror, pack-slim, tag)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"module": "./dist/index.js",
|
|
36
36
|
"types": "./dist/index.d.ts",
|
|
37
37
|
"imports": {
|
|
38
|
-
"
|
|
38
|
+
"#*": {
|
|
39
39
|
"types": "./dist/*.d.ts",
|
|
40
40
|
"default": "./dist/*.js"
|
|
41
41
|
}
|
|
@@ -51,16 +51,16 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@microsoft/tsdoc": "^0.
|
|
54
|
+
"@microsoft/tsdoc": "^0.17.0",
|
|
55
55
|
"commander": "^15.0.0",
|
|
56
56
|
"jiti": "^2.7.0",
|
|
57
|
-
"oxc-parser": "^0.
|
|
57
|
+
"oxc-parser": "^0.151.0",
|
|
58
58
|
"picomatch": "^4.0.7",
|
|
59
|
-
"yaml": "^2.9.
|
|
60
|
-
"zod": "^4.6.
|
|
59
|
+
"yaml": "^2.9.1",
|
|
60
|
+
"zod": "^4.6.5"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"typescript": "
|
|
63
|
+
"typescript": ">=7.0.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependenciesMeta": {
|
|
66
66
|
"typescript": {
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { DirectoryEntry } from "#/core/filesystem/filesystem";
|
|
2
|
-
/**
|
|
3
|
-
* Narrow `fs.promises.readdir` overload result to `Dirent[]` when `withFileTypes: true`.
|
|
4
|
-
* Accepts both historical checks (`isFile` / `isDirectory`) in one guard.
|
|
5
|
-
* Returning `true` for an empty array is intentional: callers treat empty lists
|
|
6
|
-
* the same regardless of the element type, so `[]` is safely accepted as `Dirent[]`.
|
|
7
|
-
*
|
|
8
|
-
* @since 0.3.16-canary.0
|
|
9
|
-
*/
|
|
10
|
-
export declare function isDirentList(x: Array<string> | Array<DirectoryEntry>): x is Array<DirectoryEntry>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Narrow `fs.promises.readdir` overload result to `Dirent[]` when `withFileTypes: true`.
|
|
3
|
-
* Accepts both historical checks (`isFile` / `isDirectory`) in one guard.
|
|
4
|
-
* Returning `true` for an empty array is intentional: callers treat empty lists
|
|
5
|
-
* the same regardless of the element type, so `[]` is safely accepted as `Dirent[]`.
|
|
6
|
-
*
|
|
7
|
-
* @since 0.3.16-canary.0
|
|
8
|
-
*/
|
|
9
|
-
export function isDirentList(x) {
|
|
10
|
-
if (x.length === 0) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
const first = x[0];
|
|
14
|
-
return typeof first === "object" && first !== null && "isFile" in first && "isDirectory" in first;
|
|
15
|
-
}
|