pubm 0.2.12 → 0.3.4
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 +191 -21
- package/README.md +126 -63
- package/bin/cli.js +53 -8346
- package/dist/changeset/bump-utils.d.ts +3 -0
- package/dist/changeset/changelog.d.ts +11 -0
- package/dist/changeset/index.d.ts +8 -0
- package/dist/changeset/migrate.d.ts +7 -0
- package/dist/changeset/parser.d.ts +11 -0
- package/dist/changeset/reader.d.ts +2 -0
- package/dist/changeset/status.d.ts +12 -0
- package/dist/changeset/version.d.ts +7 -0
- package/dist/changeset/writer.d.ts +4 -0
- package/dist/commands/add.d.ts +2 -0
- package/dist/commands/changesets.d.ts +2 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/migrate.d.ts +2 -0
- package/dist/commands/pre.d.ts +2 -0
- package/dist/commands/secrets.d.ts +2 -0
- package/dist/commands/snapshot.d.ts +2 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/sync.d.ts +10 -0
- package/dist/commands/update.d.ts +2 -0
- package/dist/commands/version-cmd.d.ts +6 -0
- package/dist/config/defaults.d.ts +2 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/loader.d.ts +2 -0
- package/dist/config/types.d.ts +47 -0
- package/dist/ecosystem/ecosystem.d.ts +12 -0
- package/dist/ecosystem/index.d.ts +6 -0
- package/dist/ecosystem/js.d.ts +13 -0
- package/dist/ecosystem/rust.d.ts +21 -0
- package/dist/error.d.ts +7 -0
- package/dist/git.d.ts +32 -0
- package/dist/index.cjs +24057 -4019
- package/dist/index.d.ts +20 -281
- package/dist/index.js +23969 -3935
- package/dist/monorepo/dependency-graph.d.ts +17 -0
- package/dist/monorepo/discover.d.ts +15 -0
- package/dist/monorepo/groups.d.ts +17 -0
- package/dist/monorepo/index.d.ts +4 -0
- package/dist/monorepo/workspace.d.ts +5 -0
- package/dist/options.d.ts +3 -0
- package/dist/plugin/index.d.ts +2 -0
- package/dist/plugin/runner.d.ts +14 -0
- package/dist/plugin/types.d.ts +47 -0
- package/dist/plugins/external-version-sync/index.d.ts +4 -0
- package/dist/plugins/external-version-sync/sync.d.ts +2 -0
- package/dist/plugins/external-version-sync/types.d.ts +14 -0
- package/dist/prerelease/index.d.ts +2 -0
- package/dist/prerelease/pre.d.ts +11 -0
- package/dist/prerelease/snapshot.d.ts +8 -0
- package/dist/registry/crates.d.ts +17 -0
- package/dist/registry/custom-registry.d.ts +5 -0
- package/dist/registry/index.d.ts +3 -0
- package/dist/registry/jsr.d.ts +36 -0
- package/dist/registry/npm.d.ts +25 -0
- package/dist/registry/registry.d.ts +20 -0
- package/dist/tasks/crates.d.ts +6 -0
- package/dist/tasks/custom-registry.d.ts +0 -0
- package/dist/tasks/dry-run-publish.d.ts +6 -0
- package/dist/tasks/github-release.d.ts +19 -0
- package/dist/tasks/jsr.d.ts +9 -0
- package/dist/tasks/npm.d.ts +4 -0
- package/dist/tasks/preflight.d.ts +3 -0
- package/dist/tasks/prerequisites-check.d.ts +3 -0
- package/dist/tasks/required-conditions-check.d.ts +3 -0
- package/dist/tasks/required-missing-information.d.ts +7 -0
- package/dist/tasks/runner.d.ts +10 -0
- package/dist/types/jsr-api.d.ts +91 -0
- package/dist/types/jsr-json.d.ts +10 -0
- package/dist/types/options.d.ts +115 -0
- package/dist/types/package-json.d.ts +84 -0
- package/dist/utils/cli.d.ts +2 -0
- package/dist/utils/crate-graph.d.ts +1 -0
- package/dist/utils/db.d.ts +6 -0
- package/dist/utils/engine-version.d.ts +2 -0
- package/dist/utils/exec.d.ts +23 -0
- package/dist/utils/listr.d.ts +2 -0
- package/dist/utils/notify-new-version.d.ts +1 -0
- package/dist/utils/open-url.d.ts +1 -0
- package/dist/utils/package-manager.d.ts +3 -0
- package/dist/utils/package-name.d.ts +4 -0
- package/dist/utils/package.d.ts +23 -0
- package/dist/utils/registries.d.ts +8 -0
- package/dist/utils/rollback.d.ts +6 -0
- package/dist/utils/runtime.d.ts +3 -0
- package/dist/utils/secure-store.d.ts +6 -0
- package/dist/utils/spawn-interactive.d.ts +10 -0
- package/dist/utils/token.d.ts +12 -0
- package/dist/validate/entry-points.d.ts +5 -0
- package/dist/validate/extraneous-files.d.ts +5 -0
- package/dist/validate/index.d.ts +2 -0
- package/package.json +30 -23
- package/postinstall.cjs +42 -0
- package/dist/index.d.cts +0 -291
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
interface Dependency {
|
|
2
|
+
[k: string]: string;
|
|
3
|
+
}
|
|
4
|
+
type Person = {
|
|
5
|
+
name: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
} & Record<string, unknown>;
|
|
9
|
+
export type PackageExportsEntryObject = {
|
|
10
|
+
require?: PackageExportsEntry | PackageExportsFallback;
|
|
11
|
+
import?: PackageExportsEntry | PackageExportsFallback;
|
|
12
|
+
node?: PackageExportsEntry | PackageExportsFallback;
|
|
13
|
+
default?: PackageExportsEntry | PackageExportsFallback;
|
|
14
|
+
types?: PackageExportsEntry | PackageExportsFallback;
|
|
15
|
+
};
|
|
16
|
+
type PackageExportsEntry = PackageExportsEntryPath | PackageExportsEntryObject;
|
|
17
|
+
type PackageExportsEntryPath = string | null;
|
|
18
|
+
type PackageExportsFallback = PackageExportsEntry[];
|
|
19
|
+
export type Engine = "node" | "git" | "npm" | "pnpm" | "yarn";
|
|
20
|
+
export interface PackageJson {
|
|
21
|
+
name: string;
|
|
22
|
+
version: string;
|
|
23
|
+
description?: string;
|
|
24
|
+
keywords?: string[];
|
|
25
|
+
homepage?: string;
|
|
26
|
+
bugs?: {
|
|
27
|
+
url?: string;
|
|
28
|
+
email?: string;
|
|
29
|
+
[k: string]: unknown;
|
|
30
|
+
} | string;
|
|
31
|
+
license?: string;
|
|
32
|
+
author?: Person;
|
|
33
|
+
contributors?: Person[];
|
|
34
|
+
maintainers?: Person[];
|
|
35
|
+
files?: string[];
|
|
36
|
+
main?: string;
|
|
37
|
+
exports?: string | ({
|
|
38
|
+
"."?: PackageExportsEntry | PackageExportsFallback;
|
|
39
|
+
} & Record<string, PackageExportsEntry | PackageExportsFallback>);
|
|
40
|
+
bin?: string | {
|
|
41
|
+
[k: string]: string;
|
|
42
|
+
};
|
|
43
|
+
type?: "commonjs" | "module";
|
|
44
|
+
types?: string;
|
|
45
|
+
typings?: string;
|
|
46
|
+
typesVersions?: {
|
|
47
|
+
[k: string]: {
|
|
48
|
+
"*"?: string[];
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
repository?: {
|
|
52
|
+
type?: string;
|
|
53
|
+
url?: string;
|
|
54
|
+
directory?: string;
|
|
55
|
+
[k: string]: unknown;
|
|
56
|
+
} | string;
|
|
57
|
+
scripts?: Record<string, string>;
|
|
58
|
+
config?: {
|
|
59
|
+
[k: string]: unknown;
|
|
60
|
+
};
|
|
61
|
+
dependencies?: Dependency;
|
|
62
|
+
devDependencies?: Dependency;
|
|
63
|
+
optionalDependencies?: Dependency;
|
|
64
|
+
peerDependencies?: Dependency;
|
|
65
|
+
packageManager?: string;
|
|
66
|
+
engines?: Record<Engine, string>;
|
|
67
|
+
preferGlobal?: boolean;
|
|
68
|
+
private?: boolean | ("false" | "true");
|
|
69
|
+
publishConfig?: {
|
|
70
|
+
access?: "public" | "restricted";
|
|
71
|
+
tag?: string;
|
|
72
|
+
registry?: string;
|
|
73
|
+
[k: string]: unknown;
|
|
74
|
+
};
|
|
75
|
+
dist?: {
|
|
76
|
+
shasum?: string;
|
|
77
|
+
tarball?: string;
|
|
78
|
+
[k: string]: unknown;
|
|
79
|
+
};
|
|
80
|
+
readme?: string;
|
|
81
|
+
module?: string;
|
|
82
|
+
[k: string]: unknown;
|
|
83
|
+
}
|
|
84
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function sortCratesByDependencyOrder(cratePaths: string[]): Promise<string[]>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class NonZeroExitError extends Error {
|
|
2
|
+
output: {
|
|
3
|
+
stdout: string;
|
|
4
|
+
stderr: string;
|
|
5
|
+
};
|
|
6
|
+
constructor(command: string, exitCode: number, output: {
|
|
7
|
+
stdout: string;
|
|
8
|
+
stderr: string;
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
export interface ExecOptions {
|
|
12
|
+
throwOnError?: boolean;
|
|
13
|
+
nodeOptions?: {
|
|
14
|
+
env?: Record<string, string | undefined>;
|
|
15
|
+
cwd?: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface ExecResult {
|
|
19
|
+
stdout: string;
|
|
20
|
+
stderr: string;
|
|
21
|
+
exitCode: number;
|
|
22
|
+
}
|
|
23
|
+
export declare function exec(command: string, args?: string[], options?: ExecOptions): Promise<ExecResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function notifyNewVersion(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function openUrl(url: string): Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function isScopedPackage(packageName: string): boolean;
|
|
2
|
+
export declare function getScope(packageName: string): string | null;
|
|
3
|
+
export declare function getScopeAndName(packageName: string): [string, string];
|
|
4
|
+
export declare function isValidPackageName(packageName: string): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { PackageConfig } from "../config/types.js";
|
|
2
|
+
import type { JsrJson } from "../types/jsr-json.js";
|
|
3
|
+
import type { PackageJson } from "../types/package-json.js";
|
|
4
|
+
export declare function patchCachedJsrJson(contents: Partial<JsrJson>, { cwd }?: {
|
|
5
|
+
cwd?: string | undefined;
|
|
6
|
+
}): void;
|
|
7
|
+
export declare function findOutFile(file: string, { cwd }?: {
|
|
8
|
+
cwd?: string | undefined;
|
|
9
|
+
}): Promise<string | null>;
|
|
10
|
+
export declare function getPackageJson({ cwd, fallbackJsr, }?: {
|
|
11
|
+
cwd?: string | undefined;
|
|
12
|
+
fallbackJsr?: boolean | undefined;
|
|
13
|
+
}): Promise<PackageJson>;
|
|
14
|
+
export declare function getJsrJson({ cwd, fallbackPackage, }?: {
|
|
15
|
+
cwd?: string | undefined;
|
|
16
|
+
fallbackPackage?: boolean | undefined;
|
|
17
|
+
}): Promise<JsrJson>;
|
|
18
|
+
export declare function packageJsonToJsrJson(packageJson: PackageJson): Promise<JsrJson>;
|
|
19
|
+
export declare function jsrJsonToPackageJson(jsrJson: JsrJson): PackageJson;
|
|
20
|
+
export declare function version({ cwd }?: {
|
|
21
|
+
cwd?: string | undefined;
|
|
22
|
+
}): Promise<string>;
|
|
23
|
+
export declare function replaceVersion(version: string, packages?: PackageConfig[]): Promise<string[]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PackageConfig } from "../config/types.js";
|
|
2
|
+
import type { RegistryType } from "../types/options.js";
|
|
3
|
+
interface RegistrySource {
|
|
4
|
+
packages?: PackageConfig[];
|
|
5
|
+
registries: RegistryType[];
|
|
6
|
+
}
|
|
7
|
+
export declare function collectRegistries(ctx: RegistrySource): RegistryType[];
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type Rollback<Ctx extends {}> = (ctx: Ctx) => Promise<unknown>;
|
|
2
|
+
export declare function addRollback<Ctx extends {}>(rollback: Rollback<Ctx>, context: Ctx): void;
|
|
3
|
+
export declare function rollbackLog(message: string): void;
|
|
4
|
+
export declare function rollbackError(message: string): void;
|
|
5
|
+
export declare function rollback(): Promise<void>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface InteractiveChild {
|
|
2
|
+
stdout: ReadableStream<Uint8Array>;
|
|
3
|
+
stderr: ReadableStream<Uint8Array>;
|
|
4
|
+
stdin: {
|
|
5
|
+
write(data: string | ArrayBufferView | ArrayBuffer): number;
|
|
6
|
+
flush(): number | Promise<number>;
|
|
7
|
+
};
|
|
8
|
+
exited: Promise<number>;
|
|
9
|
+
}
|
|
10
|
+
export declare function spawnInteractive(command: string[]): InteractiveChild;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface TokenEntry {
|
|
2
|
+
envVar: string;
|
|
3
|
+
dbKey: string;
|
|
4
|
+
ghSecretName: string;
|
|
5
|
+
promptLabel: string;
|
|
6
|
+
tokenUrl: string;
|
|
7
|
+
tokenUrlLabel: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const TOKEN_CONFIG: Record<string, TokenEntry>;
|
|
10
|
+
export declare function loadTokens(registries: string[]): Record<string, string>;
|
|
11
|
+
export declare const loadTokensFromDb: typeof loadTokens;
|
|
12
|
+
export declare function injectTokensToEnv(tokens: Record<string, string>): () => void;
|
package/package.json
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pubm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.4",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=18",
|
|
6
6
|
"git": ">=2.11.0"
|
|
7
7
|
},
|
|
8
8
|
"description": "publish manager for multiple registry (jsr, npm and private registries)",
|
|
9
9
|
"type": "module",
|
|
10
|
+
"workspaces": [
|
|
11
|
+
"npm/@pubm/*"
|
|
12
|
+
],
|
|
13
|
+
"bin": {
|
|
14
|
+
"pubm": "./bin/cli.js"
|
|
15
|
+
},
|
|
10
16
|
"author": "Yein Sung <syi778800@gmail.com>",
|
|
11
17
|
"types": "./dist/index.d.ts",
|
|
12
18
|
"main": "./dist/index.cjs",
|
|
13
19
|
"module": "./dist/index.js",
|
|
14
|
-
"bin": {
|
|
15
|
-
"pubm": "bin/cli.js"
|
|
16
|
-
},
|
|
17
20
|
"files": [
|
|
18
|
-
"
|
|
19
|
-
"
|
|
21
|
+
"bin/",
|
|
22
|
+
"dist/",
|
|
23
|
+
"postinstall.cjs"
|
|
20
24
|
],
|
|
21
25
|
"exports": {
|
|
22
26
|
".": {
|
|
@@ -26,20 +30,22 @@
|
|
|
26
30
|
}
|
|
27
31
|
},
|
|
28
32
|
"scripts": {
|
|
29
|
-
"
|
|
30
|
-
"
|
|
33
|
+
"build": "bun run build.ts",
|
|
34
|
+
"postinstall": "node ./postinstall.cjs",
|
|
31
35
|
"check": "biome check",
|
|
32
|
-
"format": "
|
|
36
|
+
"format": "bun check --write",
|
|
33
37
|
"typecheck": "tsc --noEmit",
|
|
34
38
|
"test": "vitest --run",
|
|
35
39
|
"coverage": "vitest --run --coverage",
|
|
36
|
-
"release": "
|
|
37
|
-
"ci:release": "
|
|
40
|
+
"release": "bun run build && bun src/cli.ts --preflight",
|
|
41
|
+
"ci:release": "bun src/cli.ts --ci",
|
|
42
|
+
"dev:site": "cd website && pnpm dev",
|
|
43
|
+
"build:site": "cd website && pnpm build",
|
|
44
|
+
"preview:site": "cd website && pnpm preview"
|
|
38
45
|
},
|
|
39
46
|
"dependencies": {
|
|
40
47
|
"@listr2/prompt-adapter-enquirer": "^2.0.12",
|
|
41
|
-
"
|
|
42
|
-
"cac": "^6.7.14",
|
|
48
|
+
"commander": "^14.0.3",
|
|
43
49
|
"enquirer": "^2.4.1",
|
|
44
50
|
"jiti": "^2.6.1",
|
|
45
51
|
"listr2": "^8.2.5",
|
|
@@ -47,28 +53,31 @@
|
|
|
47
53
|
"semver": "^7.6.3",
|
|
48
54
|
"smol-toml": "^1.6.0",
|
|
49
55
|
"std-env": "^3.7.0",
|
|
50
|
-
"tinyexec": "^0.3.0",
|
|
51
56
|
"update-kit": "^0.1.1",
|
|
52
57
|
"yaml": "^2.8.2"
|
|
53
58
|
},
|
|
54
59
|
"devDependencies": {
|
|
55
60
|
"@biomejs/biome": "2.4.4",
|
|
61
|
+
"@types/bun": "^1.3.10",
|
|
56
62
|
"@types/micromatch": "^4.0.10",
|
|
57
63
|
"@types/node": "^22.7.4",
|
|
58
|
-
"@types/npm": "^7.19.3",
|
|
59
|
-
"@types/npmcli__promise-spawn": "^6.0.3",
|
|
60
64
|
"@types/semver": "^7.5.8",
|
|
61
65
|
"@vitest/coverage-v8": "^2.1.1",
|
|
62
66
|
"jsr": "^0.13.2",
|
|
63
|
-
"tsup": "^8.3.0",
|
|
64
67
|
"typescript": "^5.6.2",
|
|
65
68
|
"vitest": "^2.1.1"
|
|
66
69
|
},
|
|
67
|
-
"
|
|
70
|
+
"optionalDependencies": {
|
|
71
|
+
"@pubm/darwin-arm64": "0.2.12",
|
|
72
|
+
"@pubm/darwin-x64": "0.2.12",
|
|
73
|
+
"@pubm/linux-arm64": "0.2.12",
|
|
74
|
+
"@pubm/linux-x64": "0.2.12",
|
|
75
|
+
"@pubm/windows-x64": "0.2.12"
|
|
76
|
+
},
|
|
77
|
+
"license": "Apache-2.0",
|
|
68
78
|
"publishConfig": {
|
|
69
79
|
"access": "public"
|
|
70
80
|
},
|
|
71
|
-
"packageManager": "pnpm@9.11.0",
|
|
72
81
|
"repository": {
|
|
73
82
|
"type": "git",
|
|
74
83
|
"url": "git+https://github.com/syi0808/pubm.git"
|
|
@@ -86,9 +95,7 @@
|
|
|
86
95
|
"private registry",
|
|
87
96
|
"multiple publish"
|
|
88
97
|
],
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"listr2": "patches/listr2.patch"
|
|
92
|
-
}
|
|
98
|
+
"patchedDependencies": {
|
|
99
|
+
"listr2@8.2.5": "patches/listr2.patch"
|
|
93
100
|
}
|
|
94
101
|
}
|
package/postinstall.cjs
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const os = require("os");
|
|
6
|
+
|
|
7
|
+
function main() {
|
|
8
|
+
const platformMap = { darwin: "darwin", linux: "linux", win32: "windows" };
|
|
9
|
+
const archMap = { x64: "x64", arm64: "arm64" };
|
|
10
|
+
|
|
11
|
+
const platform = platformMap[os.platform()] || os.platform();
|
|
12
|
+
const arch = archMap[os.arch()] || os.arch();
|
|
13
|
+
const packageName = "@pubm/" + platform + "-" + arch;
|
|
14
|
+
const binaryName = platform === "windows" ? "pubm.exe" : "pubm";
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const packageJsonPath = require.resolve(packageName + "/package.json");
|
|
18
|
+
const binaryPath = path.join(
|
|
19
|
+
path.dirname(packageJsonPath),
|
|
20
|
+
"bin",
|
|
21
|
+
binaryName,
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
if (!fs.existsSync(binaryPath)) {
|
|
25
|
+
console.error("pubm: binary not found at " + binaryPath);
|
|
26
|
+
process.exit(1);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log("pubm: platform binary verified (" + packageName + ")");
|
|
30
|
+
} catch {
|
|
31
|
+
console.error(
|
|
32
|
+
"pubm: could not find platform binary package. You may need to install it manually for your platform (" +
|
|
33
|
+
os.platform() +
|
|
34
|
+
"-" +
|
|
35
|
+
os.arch() +
|
|
36
|
+
").",
|
|
37
|
+
);
|
|
38
|
+
process.exit(0);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
main();
|