dependfix 0.0.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -78
- package/dist/bin.d.mts +1 -0
- package/dist/bin.mjs +14 -0
- package/dist/bin.mjs.map +1 -0
- package/dist/index.d.mts +1458 -7
- package/dist/index.mjs +17 -38
- package/dist/index.mjs.map +1 -1
- package/dist/runner.mjs +7402 -0
- package/dist/runner.mjs.map +1 -0
- package/package.json +55 -67
- package/dist/index.cjs +0 -35
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -12
package/dist/index.mjs
CHANGED
|
@@ -1,48 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { $ as RUNTIME_MODES, A as getBranchPrStatus, B as matchesRepoExclude, C as computeFixFingerprint, D as extractFingerprintFromBranch, E as deleteRemoteBranch, F as fetchDependabotAlerts, G as mapGitHubError, H as matchesRepoInclude, I as discoverRepositories, J as argsDef, K as computeRetryDelayMs, L as mergeRepositories, M as listDependfixBranches, N as pushBranch, O as findDependfixOpenPR, P as stageAndCommit, Q as ENV_PREFIX, R as MAX_GLOB_PATTERN_LENGTH, S as computeFixAndPrPlan, T as createPullRequest, U as matchesTopicsExclude, V as matchesRepoGlob, W as repoGlobToRegExp, X as ALERT_SOURCES, Y as parseCliArgs, Z as DEFAULT_RUNTIME_CONFIG, _ as parseMajorVersion, a as DependfixApp, at as classifyLockfileFailure, b as upgradeDependency, c as applyVersionedOverrides, ct as isValidPnpmVersion, d as ensurePnpmOverrides, dt as readReposFile, et as SEVERITY_THRESHOLDS, f as extractPrefix, ft as resolveRepoList, g as overrideTransitiveDependency, h as isNonSemverDeclaration, i as createPipeline, it as resolveRuntimeConfig, j as isConfirmAnswer, k as generatePRBody, l as compareSemver, lt as repairLockfile, m as isCrossMajorFixRequired, n as runCli, nt as readEnv, o as runVerification, ot as computeLockfileDiff, p as findDependencyVersion, q as createGitHubClient, r as runDependfixMain, rt as readEnvConfig, s as sanitizeOutput, st as extractLockfileVersion, t as dependfixCommand, tt as inferRepoFromGitRemote, u as detectPnpmMajor, ut as resolvePnpmVersion, v as readLockfileVersion, w as createFixBranch, x as closePullRequest, y as readLockfileVersions, z as filterExplicitRepositories } from "./runner.mjs";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import { toAppError } from "@dependfix/core";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
var __require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
5
|
+
export * from "@dependfix/core"
|
|
7
6
|
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region node_modules/.pnpm/tsdown@0.22.3_tsx@4.23.1_typescript@6.0.3/node_modules/tsdown/esm-shims.js
|
|
10
|
-
const getFilename = () => fileURLToPath(import.meta.url);
|
|
11
|
-
const getDirname = () => path.dirname(getFilename());
|
|
12
|
-
const __dirname = /* @__PURE__ */ getDirname();
|
|
13
|
-
const __filename = /* @__PURE__ */ getFilename();
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region src/env.ts
|
|
17
|
-
const __PROD__ = process.env.NODE_ENV === "production";
|
|
18
|
-
const __DEV__ = process.env.NODE_ENV === "development";
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
7
|
//#region src/index.ts
|
|
22
8
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @author CaoMeiYouRen
|
|
26
|
-
* @date 2020-11-28
|
|
27
|
-
* @export
|
|
9
|
+
* 简化调用的入口(内部数据处理,非 CLI 使用)。
|
|
28
10
|
*/
|
|
29
|
-
function
|
|
30
|
-
|
|
31
|
-
if (__DEV__) console.log("Hello development");
|
|
32
|
-
console.log("你好,世界!");
|
|
11
|
+
function main(args = process.argv.slice(2)) {
|
|
12
|
+
return runCli(args);
|
|
33
13
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
console.log("require(\"os\"):", !!os);
|
|
39
|
-
} catch (e) {
|
|
40
|
-
console.log("require is not available:", e);
|
|
14
|
+
function isExecutedAsEntryPoint() {
|
|
15
|
+
const entry = process.argv[1];
|
|
16
|
+
if (!entry) return false;
|
|
17
|
+
return import.meta.url === pathToFileURL(entry).href;
|
|
41
18
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
console.
|
|
19
|
+
if (isExecutedAsEntryPoint()) runDependfixMain().catch((error) => {
|
|
20
|
+
const appError = toAppError(error, "CLI_EXECUTION_FAILED");
|
|
21
|
+
console.error(appError.message);
|
|
22
|
+
process.exitCode = 1;
|
|
23
|
+
});
|
|
45
24
|
|
|
46
25
|
//#endregion
|
|
47
|
-
export {
|
|
26
|
+
export { ALERT_SOURCES, DEFAULT_RUNTIME_CONFIG, DependfixApp, ENV_PREFIX, MAX_GLOB_PATTERN_LENGTH, RUNTIME_MODES, SEVERITY_THRESHOLDS, applyVersionedOverrides, argsDef, classifyLockfileFailure, closePullRequest, compareSemver, computeFixAndPrPlan, computeFixFingerprint, computeLockfileDiff, computeRetryDelayMs, createFixBranch, createGitHubClient, createPipeline, createPullRequest, deleteRemoteBranch, dependfixCommand, detectPnpmMajor, discoverRepositories, ensurePnpmOverrides, extractFingerprintFromBranch, extractLockfileVersion, extractPrefix, fetchDependabotAlerts, filterExplicitRepositories, findDependencyVersion, findDependfixOpenPR, generatePRBody, getBranchPrStatus, inferRepoFromGitRemote, isConfirmAnswer, isCrossMajorFixRequired, isNonSemverDeclaration, isValidPnpmVersion, listDependfixBranches, main, mapGitHubError, matchesRepoExclude, matchesRepoGlob, matchesRepoInclude, matchesTopicsExclude, mergeRepositories, overrideTransitiveDependency, parseCliArgs, parseMajorVersion, pushBranch, readEnv, readEnvConfig, readLockfileVersion, readLockfileVersions, readReposFile, repairLockfile, repoGlobToRegExp, resolvePnpmVersion, resolveRepoList, resolveRuntimeConfig, runCli, runDependfixMain, runVerification, sanitizeOutput, stageAndCommit, upgradeDependency };
|
|
48
27
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { pathToFileURL } from 'node:url'\nimport { toAppError } from '@dependfix/core'\nimport { runCli, runDependfixMain, type CliRunResult } from './cli/runner'\n\nexport * from '@dependfix/core'\nexport * from './app'\nexport * from './cli'\nexport * from './cli/runner'\nexport * from './config'\nexport * from './fixers/dependency'\nexport * from './fixers/pnpm'\nexport * from './github'\nexport * from './runners'\n// 平台化管线抽象(独立平台前置):local 与 platform 共用编排核心\nexport { createPipeline } from './app/pipeline'\nexport type { Pipeline, PipelineDeps, PipelineLogger, PipelineParseResult } from './app/pipeline'\n\n/**\n * 简化调用的入口(内部数据处理,非 CLI 使用)。\n */\nexport function main(args: string[] = process.argv.slice(2)): CliRunResult {\n return runCli(args)\n}\n\nfunction isExecutedAsEntryPoint(): boolean {\n const entry = process.argv[1]\n\n if (!entry) {\n return false\n }\n\n return import.meta.url === pathToFileURL(entry).href\n}\n\nif (isExecutedAsEntryPoint()) {\n // 优先使用 citty 接管(自动 --help、子命令等)\n void runDependfixMain().catch((error: unknown) => {\n const appError = toAppError(error, 'CLI_EXECUTION_FAILED')\n console.error(appError.message)\n process.exitCode = 1\n })\n}\n"],"mappings":";;;;;;;;;;AAoBA,SAAgB,KAAK,OAAiB,QAAQ,KAAK,MAAM,CAAC,GAAiB;CACvE,OAAO,OAAO,IAAI;AACtB;AAEA,SAAS,yBAAkC;CACvC,MAAM,QAAQ,QAAQ,KAAK;CAE3B,IAAI,CAAC,OACD,OAAO;CAGX,OAAO,YAAY,QAAQ,cAAc,KAAK,CAAC,CAAC;AACpD;AAEA,IAAI,uBAAuB,GAEvB,AAAK,iBAAiB,CAAC,CAAC,OAAO,UAAmB;CAC9C,MAAM,WAAW,WAAW,OAAO,sBAAsB;CACzD,QAAQ,MAAM,SAAS,OAAO;CAC9B,QAAQ,WAAW;AACvB,CAAC"}
|