@pnpm/releasing.commands 1100.7.0 → 1100.8.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.
Files changed (97) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/lib/change/index.d.ts +42 -0
  3. package/lib/change/index.js +250 -0
  4. package/lib/deploy/createDeployFiles.d.ts +26 -0
  5. package/lib/deploy/createDeployFiles.js +255 -0
  6. package/lib/deploy/deploy.d.ts +12 -0
  7. package/lib/deploy/deploy.js +398 -0
  8. package/lib/deploy/deployHook.d.ts +2 -0
  9. package/lib/deploy/deployHook.js +15 -0
  10. package/lib/deploy/index.d.ts +2 -0
  11. package/lib/deploy/index.js +3 -0
  12. package/lib/index.d.ts +7 -0
  13. package/lib/lane/index.d.ts +24 -0
  14. package/lib/lane/index.js +157 -0
  15. package/lib/pack-app/index.d.ts +2 -0
  16. package/lib/pack-app/index.js +3 -0
  17. package/lib/pack-app/packApp.d.ts +22 -0
  18. package/lib/pack-app/packApp.js +558 -0
  19. package/lib/publish/FailedToPublishError.d.ts +22 -0
  20. package/lib/publish/FailedToPublishError.js +40 -0
  21. package/lib/publish/batchPublish.d.ts +20 -0
  22. package/lib/publish/batchPublish.js +201 -0
  23. package/lib/publish/displayError.d.ts +1 -0
  24. package/lib/publish/displayError.js +23 -0
  25. package/lib/publish/executeTokenHelper.d.ts +4 -0
  26. package/lib/publish/executeTokenHelper.js +17 -0
  27. package/lib/publish/extractManifestFromPacked.d.ts +19 -0
  28. package/lib/publish/extractManifestFromPacked.js +110 -0
  29. package/lib/publish/index.d.ts +3 -0
  30. package/lib/publish/index.js +4 -0
  31. package/lib/publish/oidc/authToken.d.ts +73 -0
  32. package/lib/publish/oidc/authToken.js +97 -0
  33. package/lib/publish/oidc/idToken.d.ts +76 -0
  34. package/lib/publish/oidc/idToken.js +90 -0
  35. package/lib/publish/oidc/provenance.d.ts +73 -0
  36. package/lib/publish/oidc/provenance.js +91 -0
  37. package/lib/publish/otp.d.ts +38 -0
  38. package/lib/publish/otp.js +41 -0
  39. package/lib/publish/otpEnv.d.ts +7 -0
  40. package/lib/publish/otpEnv.js +5 -0
  41. package/lib/publish/pack.d.ts +34 -0
  42. package/lib/publish/pack.js +425 -0
  43. package/lib/publish/previousChangelog.d.ts +25 -0
  44. package/lib/publish/previousChangelog.js +194 -0
  45. package/lib/publish/publish.d.ts +40 -0
  46. package/lib/publish/publish.js +256 -0
  47. package/lib/publish/publishPackedPkg.d.ts +79 -0
  48. package/lib/publish/publishPackedPkg.js +298 -0
  49. package/lib/publish/recursivePublish.d.ts +18 -0
  50. package/lib/publish/recursivePublish.js +135 -0
  51. package/lib/publish/registryConfigKeys.d.ts +30 -0
  52. package/lib/publish/registryConfigKeys.js +50 -0
  53. package/lib/publish/utils/shared-context.d.ts +7 -0
  54. package/lib/publish/utils/shared-context.js +20 -0
  55. package/lib/publishedNames.d.ts +18 -0
  56. package/lib/publishedNames.js +29 -0
  57. package/lib/resolveUnpublishedDirs.d.ts +18 -0
  58. package/lib/resolveUnpublishedDirs.js +20 -0
  59. package/lib/stage/approve.d.ts +2 -0
  60. package/lib/stage/approve.js +14 -0
  61. package/lib/stage/context.d.ts +14 -0
  62. package/lib/stage/context.js +25 -0
  63. package/lib/stage/download.d.ts +2 -0
  64. package/lib/stage/download.js +32 -0
  65. package/lib/stage/errors.d.ts +15 -0
  66. package/lib/stage/errors.js +17 -0
  67. package/lib/stage/help.d.ts +1 -0
  68. package/lib/stage/help.js +84 -0
  69. package/lib/stage/index.d.ts +13 -0
  70. package/lib/stage/index.js +57 -0
  71. package/lib/stage/list.d.ts +2 -0
  72. package/lib/stage/list.js +49 -0
  73. package/lib/stage/parsing.d.ts +6 -0
  74. package/lib/stage/parsing.js +27 -0
  75. package/lib/stage/publish.d.ts +7 -0
  76. package/lib/stage/publish.js +38 -0
  77. package/lib/stage/reject.d.ts +2 -0
  78. package/lib/stage/reject.js +16 -0
  79. package/lib/stage/rendering.d.ts +11 -0
  80. package/lib/stage/rendering.js +50 -0
  81. package/lib/stage/request.d.ts +29 -0
  82. package/lib/stage/request.js +110 -0
  83. package/lib/stage/types.d.ts +38 -0
  84. package/lib/stage/types.js +3 -0
  85. package/lib/stage/view.d.ts +2 -0
  86. package/lib/stage/view.js +14 -0
  87. package/lib/tarball/index.d.ts +2 -0
  88. package/lib/tarball/index.js +3 -0
  89. package/lib/tarball/publishSummary.d.ts +47 -0
  90. package/lib/tarball/publishSummary.js +36 -0
  91. package/lib/tarball/safeTarballFilename.d.ts +8 -0
  92. package/lib/tarball/safeTarballFilename.js +21 -0
  93. package/lib/tarball/summarizeTarball.d.ts +12 -0
  94. package/lib/tarball/summarizeTarball.js +84 -0
  95. package/lib/version/index.d.ts +35 -0
  96. package/lib/version/index.js +364 -0
  97. package/package.json +49 -49
@@ -0,0 +1,90 @@
1
+ import { PnpmError } from '@pnpm/error';
2
+ import { displayError } from '../displayError.js';
3
+ import { SHARED_CONTEXT } from '../utils/shared-context.js';
4
+ /**
5
+ * Retrieve an `idToken` from the CI environment.
6
+ *
7
+ * @throws instances of subclasses of {@link IdTokenError} which can be converted into warnings and skipped.
8
+ *
9
+ * @see https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect for GitHub Actions OIDC.
10
+ * @see https://github.com/npm/cli/blob/7d900c46/lib/utils/oidc.js#L37-L110 for npm's implementation
11
+ * @see https://github.com/yarnpkg/berry/blob/bafbef55/packages/plugin-npm/sources/npmHttpUtils.ts#L594-L624 for yarn's implementation
12
+ */
13
+ export async function getIdToken({ context: { Date, ciInfo: { GITHUB_ACTIONS }, fetch, globalInfo, process: { env }, } = SHARED_CONTEXT, options, registry, }) {
14
+ // `NPM_ID_TOKEN` is the canonical CI-agnostic injection point for an OIDC ID token.
15
+ // Any CI provider with its own OIDC mechanism (GitLab natively, CircleCI's
16
+ // `CIRCLE_OIDC_TOKEN_V2`, Buildkite, etc.) can forward its token here and trusted
17
+ // publishing will work — we don't need to recognize the provider ourselves.
18
+ if (env?.NPM_ID_TOKEN)
19
+ return env.NPM_ID_TOKEN;
20
+ // Without an explicit token, the only flow we can drive ourselves is GitHub Actions'
21
+ // request-token endpoint. Anywhere else (other CIs without `NPM_ID_TOKEN`, local dev)
22
+ // falls through silently and the publish caller falls back to a static `_authToken`.
23
+ if (!GITHUB_ACTIONS)
24
+ return undefined;
25
+ if (!env?.ACTIONS_ID_TOKEN_REQUEST_TOKEN || !env?.ACTIONS_ID_TOKEN_REQUEST_URL) {
26
+ throw new IdTokenGitHubWorkflowIncorrectPermissionsError();
27
+ }
28
+ const parsedRegistry = new URL(registry);
29
+ const audience = `npm:${parsedRegistry.hostname}`;
30
+ const url = new URL(env.ACTIONS_ID_TOKEN_REQUEST_URL);
31
+ url.searchParams.append('audience', audience);
32
+ const startTime = Date.now();
33
+ const response = await fetch(url.href, {
34
+ headers: {
35
+ Accept: 'application/json',
36
+ Authorization: `Bearer ${env.ACTIONS_ID_TOKEN_REQUEST_TOKEN}`,
37
+ },
38
+ method: 'GET',
39
+ retry: {
40
+ factor: options?.fetchRetryFactor,
41
+ maxTimeout: options?.fetchRetryMaxtimeout,
42
+ minTimeout: options?.fetchRetryMintimeout,
43
+ retries: options?.fetchRetries,
44
+ },
45
+ timeout: options?.fetchTimeout,
46
+ });
47
+ const elapsedTime = Date.now() - startTime;
48
+ globalInfo(`GET ${url.href} ${response.status} ${elapsedTime}ms`);
49
+ if (!response.ok) {
50
+ throw new IdTokenGitHubInvalidResponseError();
51
+ }
52
+ let json;
53
+ try {
54
+ json = await response.json();
55
+ }
56
+ catch (error) {
57
+ throw new IdTokenGitHubJsonInterruptedError(error);
58
+ }
59
+ if (!json || typeof json !== 'object' || !('value' in json) || typeof json.value !== 'string') {
60
+ throw new IdTokenGitHubJsonInvalidValueError(json);
61
+ }
62
+ return json.value;
63
+ }
64
+ export class IdTokenError extends PnpmError {
65
+ }
66
+ export class IdTokenGitHubWorkflowIncorrectPermissionsError extends IdTokenError {
67
+ constructor() {
68
+ super('ID_TOKEN_GITHUB_WORKFLOW_INCORRECT_PERMISSIONS', 'Incorrect permissions for idToken within GitHub Workflows');
69
+ }
70
+ }
71
+ export class IdTokenGitHubInvalidResponseError extends IdTokenError {
72
+ constructor() {
73
+ super('ID_TOKEN_GITHUB_INVALID_RESPONSE', 'Failed to fetch idToken from GitHub: received an invalid response');
74
+ }
75
+ }
76
+ export class IdTokenGitHubJsonInterruptedError extends IdTokenError {
77
+ errorSource;
78
+ constructor(error) {
79
+ super('ID_TOKEN_GITHUB_JSON_INTERRUPTED_ERROR', `Fetching of idToken JSON interrupted: ${displayError(error)}`);
80
+ this.errorSource = error;
81
+ }
82
+ }
83
+ export class IdTokenGitHubJsonInvalidValueError extends IdTokenError {
84
+ jsonResponse;
85
+ constructor(jsonResponse) {
86
+ super('ID_TOKEN_GITHUB_JSON_INVALID_VALUE', 'Failed to fetch idToken from GitHub: missing or invalid value');
87
+ this.jsonResponse = jsonResponse;
88
+ }
89
+ }
90
+ //# sourceMappingURL=idToken.js.map
@@ -0,0 +1,73 @@
1
+ import { PnpmError } from '@pnpm/error';
2
+ import type { PublishPackedPkgOptions } from '../publishPackedPkg.js';
3
+ export interface ProvenanceCIInfo {
4
+ GITHUB_ACTIONS?: boolean;
5
+ GITLAB?: boolean;
6
+ }
7
+ export interface ProvenanceEnv extends NodeJS.ProcessEnv {
8
+ SIGSTORE_ID_TOKEN?: string;
9
+ }
10
+ export interface ProvenanceFetchOptions {
11
+ headers: {
12
+ Accept: 'application/json';
13
+ Authorization: `Bearer ${string}`;
14
+ };
15
+ method: 'GET';
16
+ retry?: {
17
+ factor?: number;
18
+ maxTimeout?: number;
19
+ minTimeout?: number;
20
+ randomize?: boolean;
21
+ retries?: number;
22
+ };
23
+ timeout?: number;
24
+ }
25
+ export interface ProvenanceFetchResponse {
26
+ readonly json: (this: this) => Promise<unknown>;
27
+ readonly ok: boolean;
28
+ readonly status: number;
29
+ }
30
+ export interface ProvenanceContext {
31
+ ciInfo: ProvenanceCIInfo;
32
+ fetch: (url: URL, options: ProvenanceFetchOptions) => Promise<ProvenanceFetchResponse>;
33
+ process: {
34
+ env?: ProvenanceEnv;
35
+ };
36
+ }
37
+ export type ProvenanceOptions = Pick<PublishPackedPkgOptions, 'fetchRetries' | 'fetchRetryFactor' | 'fetchRetryMaxtimeout' | 'fetchRetryMintimeout' | 'fetchTimeout'>;
38
+ export interface ProvenanceParams {
39
+ authToken: string;
40
+ context?: ProvenanceContext;
41
+ idToken: string;
42
+ options?: ProvenanceOptions;
43
+ packageName: string;
44
+ registry: string;
45
+ }
46
+ /**
47
+ * Determine `provenance` for a package from the CI context and the visibility of the package.
48
+ *
49
+ * @throws instances of subclasses of {@link ProvenanceError} which can be converted into warnings and skipped.
50
+ *
51
+ * @see https://github.com/npm/cli/blob/7d900c46/lib/utils/oidc.js#L145-L164 for npm's implementation.
52
+ */
53
+ export declare function determineProvenance({ authToken, idToken, options, packageName, registry, context: { ciInfo: { GITHUB_ACTIONS, GITLAB }, fetch, process: { env }, }, }: ProvenanceParams): Promise<boolean | undefined>;
54
+ export declare abstract class ProvenanceError extends PnpmError {
55
+ }
56
+ export declare class ProvenanceMalformedIdTokenError extends ProvenanceError {
57
+ readonly idToken: string;
58
+ constructor(idToken: string);
59
+ }
60
+ export declare class ProvenanceInsufficientInformationError extends ProvenanceError {
61
+ constructor();
62
+ }
63
+ export declare class ProvenanceFailedToFetchVisibilityError extends ProvenanceError {
64
+ readonly errorResponse?: {
65
+ code?: string;
66
+ message?: string;
67
+ };
68
+ readonly packageName: string;
69
+ readonly registry: string;
70
+ readonly status: number;
71
+ constructor(errorResponse: ProvenanceFailedToFetchVisibilityError['errorResponse'], status: number, packageName: string, registry: string);
72
+ static createErrorFromFetchResponse(response: ProvenanceFetchResponse, packageName: string, registry: string): Promise<ProvenanceFailedToFetchVisibilityError>;
73
+ }
@@ -0,0 +1,91 @@
1
+ import { PnpmError, redactUrlCredentials } from '@pnpm/error';
2
+ import npa from '@pnpm/npm-package-arg';
3
+ import { SHARED_CONTEXT } from '../utils/shared-context.js';
4
+ /**
5
+ * Determine `provenance` for a package from the CI context and the visibility of the package.
6
+ *
7
+ * @throws instances of subclasses of {@link ProvenanceError} which can be converted into warnings and skipped.
8
+ *
9
+ * @see https://github.com/npm/cli/blob/7d900c46/lib/utils/oidc.js#L145-L164 for npm's implementation.
10
+ */
11
+ export async function determineProvenance({ authToken, idToken, options, packageName, registry, context: { ciInfo: { GITHUB_ACTIONS, GITLAB }, fetch, process: { env }, } = SHARED_CONTEXT, }) {
12
+ const [headerB64, payloadB64] = idToken.split('.');
13
+ if (!headerB64 || !payloadB64) {
14
+ throw new ProvenanceMalformedIdTokenError(idToken);
15
+ }
16
+ const payloadJson = Buffer.from(payloadB64, 'base64url').toString('utf8');
17
+ const payload = JSON.parse(payloadJson);
18
+ if ((!GITHUB_ACTIONS || payload.repository_visibility !== 'public') &&
19
+ (!GITLAB || payload.project_visibility !== 'public' || !env?.SIGSTORE_ID_TOKEN)) {
20
+ throw new ProvenanceInsufficientInformationError();
21
+ }
22
+ const visibilityUrl = new URL(`/-/package/${npa(packageName).escapedName}/visibility`, registry);
23
+ const response = await fetch(visibilityUrl, {
24
+ headers: {
25
+ Accept: 'application/json',
26
+ Authorization: `Bearer ${authToken}`,
27
+ },
28
+ method: 'GET',
29
+ retry: {
30
+ factor: options?.fetchRetryFactor,
31
+ maxTimeout: options?.fetchRetryMaxtimeout,
32
+ minTimeout: options?.fetchRetryMintimeout,
33
+ retries: options?.fetchRetries,
34
+ },
35
+ timeout: options?.fetchTimeout,
36
+ });
37
+ if (!response.ok) {
38
+ throw await ProvenanceFailedToFetchVisibilityError.createErrorFromFetchResponse(response, packageName, registry);
39
+ }
40
+ const visibility = await response.json();
41
+ if (visibility?.public)
42
+ return true;
43
+ return undefined;
44
+ }
45
+ export class ProvenanceError extends PnpmError {
46
+ }
47
+ export class ProvenanceMalformedIdTokenError extends ProvenanceError {
48
+ idToken;
49
+ constructor(idToken) {
50
+ super('PROVENANCE_MALFORMED_ID_TOKEN', 'The received idToken is not a valid JWT');
51
+ this.idToken = idToken;
52
+ }
53
+ }
54
+ export class ProvenanceInsufficientInformationError extends ProvenanceError {
55
+ constructor() {
56
+ super('PROVENANCE_INSUFFICIENT_INFORMATION', 'The environment does not provide enough information to determine visibility');
57
+ }
58
+ }
59
+ export class ProvenanceFailedToFetchVisibilityError extends ProvenanceError {
60
+ errorResponse;
61
+ packageName;
62
+ registry;
63
+ status;
64
+ constructor(errorResponse, status, packageName, registry) {
65
+ let message = 'an unknown error';
66
+ if (errorResponse?.code && errorResponse?.message) {
67
+ message = `${errorResponse.code}: ${errorResponse.message}`;
68
+ }
69
+ else if (errorResponse?.code) {
70
+ message = errorResponse.code;
71
+ }
72
+ else if (errorResponse?.message) {
73
+ message = errorResponse.message;
74
+ }
75
+ const redactedRegistry = redactUrlCredentials(registry);
76
+ super('PROVENANCE_FAILED_TO_FETCH_VISIBILITY', `Failed to fetch visibility for package ${packageName} from registry ${redactedRegistry} due to ${message} (status code ${status})`);
77
+ this.errorResponse = errorResponse;
78
+ this.status = status;
79
+ this.packageName = packageName;
80
+ this.registry = redactedRegistry;
81
+ }
82
+ static async createErrorFromFetchResponse(response, packageName, registry) {
83
+ let errorResponse;
84
+ try {
85
+ errorResponse = await response.json();
86
+ }
87
+ catch { }
88
+ return new ProvenanceFailedToFetchVisibilityError(errorResponse, response.status, packageName, registry);
89
+ }
90
+ }
91
+ //# sourceMappingURL=provenance.js.map
@@ -0,0 +1,38 @@
1
+ import { type OtpContext as BaseOtpContext } from '@pnpm/network.web-auth';
2
+ import type { ExportedManifest } from '@pnpm/releasing.exportable-manifest';
3
+ import type { PublishOptions } from 'libnpmpublish';
4
+ export type PublishOptionsWithDefaultAccess = Omit<PublishOptions, 'access'> & {
5
+ access?: PublishOptions['access'] | null;
6
+ };
7
+ export interface OtpPublishResponse {
8
+ readonly ok: boolean;
9
+ readonly status: number;
10
+ readonly statusText: string;
11
+ readonly text: () => Promise<string>;
12
+ /** Set by the registry only when the publish was staged (i.e. `stage: true` was sent). */
13
+ readonly stageId?: string;
14
+ }
15
+ export type OtpPublishFn = (manifest: ExportedManifest, tarballData: Buffer, options: PublishOptionsWithDefaultAccess) => Promise<OtpPublishResponse>;
16
+ export interface OtpContext extends BaseOtpContext {
17
+ publish: OtpPublishFn;
18
+ }
19
+ export interface OtpParams {
20
+ context?: OtpContext;
21
+ manifest: ExportedManifest;
22
+ publishOptions: PublishOptionsWithDefaultAccess;
23
+ tarballData: Buffer;
24
+ }
25
+ /**
26
+ * Publish a package, handling OTP challenges:
27
+ * - Web based authentication flow (authUrl/doneUrl in error body with doneUrl polling)
28
+ * - Classic OTP prompt (manual code entry)
29
+ *
30
+ * The caller is responsible for supplying a {@link OtpContext.fetch} that
31
+ * honors the desired network configuration (proxy, TLS, etc.); see
32
+ * https://github.com/pnpm/pnpm/issues/11561 for why this matters during the
33
+ * web-based authentication flow.
34
+ *
35
+ * @see https://github.com/npm/cli/blob/7d900c46/lib/utils/otplease.js for npm's implementation.
36
+ * @see https://github.com/npm/npm-profile/blob/main/lib/index.js for the webauth polling flow.
37
+ */
38
+ export declare function publishWithOtpHandling({ context, manifest, publishOptions, tarballData, }: OtpParams): Promise<OtpPublishResponse>;
@@ -0,0 +1,41 @@
1
+ import { withOtpHandling, } from '@pnpm/network.web-auth';
2
+ import { SHARED_CONTEXT } from './utils/shared-context.js';
3
+ /**
4
+ * Publish a package, handling OTP challenges:
5
+ * - Web based authentication flow (authUrl/doneUrl in error body with doneUrl polling)
6
+ * - Classic OTP prompt (manual code entry)
7
+ *
8
+ * The caller is responsible for supplying a {@link OtpContext.fetch} that
9
+ * honors the desired network configuration (proxy, TLS, etc.); see
10
+ * https://github.com/pnpm/pnpm/issues/11561 for why this matters during the
11
+ * web-based authentication flow.
12
+ *
13
+ * @see https://github.com/npm/cli/blob/7d900c46/lib/utils/otplease.js for npm's implementation.
14
+ * @see https://github.com/npm/npm-profile/blob/main/lib/index.js for the webauth polling flow.
15
+ */
16
+ export async function publishWithOtpHandling({ context = SHARED_CONTEXT, manifest, publishOptions, tarballData, }) {
17
+ const { publish } = context;
18
+ const fetchOptions = {
19
+ method: 'GET',
20
+ retry: {
21
+ factor: publishOptions.fetchRetryFactor,
22
+ maxTimeout: publishOptions.fetchRetryMaxtimeout,
23
+ minTimeout: publishOptions.fetchRetryMintimeout,
24
+ retries: publishOptions.fetchRetries,
25
+ },
26
+ timeout: publishOptions.timeout,
27
+ };
28
+ return withOtpHandling({
29
+ context,
30
+ fetchOptions,
31
+ // withOtpHandling first calls this with no otp, then retries with the otp
32
+ // it obtained from an OTP challenge. On the first attempt we fall back to
33
+ // the configured --otp (publishOptions.otp) so it is actually sent; a retry
34
+ // otp takes precedence over it. When both are undefined, passing
35
+ // otp: undefined is safe because libnpmpublish treats undefined the same as
36
+ // absent (unlike HTTP headers, where undefined gets coerced to the string
37
+ // "undefined").
38
+ operation: otp => publish(manifest, tarballData, { ...publishOptions, otp: otp ?? publishOptions.otp }),
39
+ });
40
+ }
41
+ //# sourceMappingURL=otp.js.map
@@ -0,0 +1,7 @@
1
+ declare const ENV_KEY = "PNPM_CONFIG_OTP";
2
+ type EnvBase = Partial<Readonly<Record<string, string>>> & Partial<Readonly<Record<typeof ENV_KEY, string>>>;
3
+ interface OptionsBase {
4
+ readonly otp?: string;
5
+ }
6
+ export declare const optionsWithOtpEnv: <Options extends OptionsBase>(opts: Options, { [ENV_KEY]: otp }: EnvBase) => Options;
7
+ export {};
@@ -0,0 +1,5 @@
1
+ const ENV_KEY = 'PNPM_CONFIG_OTP';
2
+ export const optionsWithOtpEnv = (opts, { [ENV_KEY]: otp }) => Boolean(opts.otp) || !otp // empty string is considered "not defined" here
3
+ ? opts
4
+ : { ...opts, otp };
5
+ //# sourceMappingURL=otpEnv.js.map
@@ -0,0 +1,34 @@
1
+ import { type Config, type ConfigContext, type UniversalOptions } from '@pnpm/config.reader';
2
+ import { type ExportedManifest } from '@pnpm/releasing.exportable-manifest';
3
+ export declare function rcOptionsTypes(): Record<string, unknown>;
4
+ export declare function cliOptionsTypes(): Record<string, unknown>;
5
+ export declare const commandNames: string[];
6
+ export declare function help(): string;
7
+ export type PackOptions = Pick<UniversalOptions, 'dir'> & Pick<Config, 'catalogs' | 'ignoreScripts' | 'embedReadme' | 'packGzipLevel' | 'nodeLinker' | 'skipManifestObfuscation' | 'userAgent'> & Partial<Pick<Config, 'extraBinPaths' | 'extraEnv' | 'recursive' | 'workspaceConcurrency' | 'workspaceDir' | 'versioning' | 'registries' | 'configByUri' | 'fetchRetries' | 'fetchRetryFactor' | 'fetchRetryMaxtimeout' | 'fetchRetryMintimeout' | 'fetchTimeout' | 'ca' | 'cert' | 'key' | 'strictSsl' | 'httpProxy' | 'httpsProxy' | 'noProxy' | 'localAddress'>> & Partial<Pick<ConfigContext, 'hooks' | 'selectedProjectsGraph' | 'allProjectsGraph' | 'prodAllProjectsGraph' | 'prodOnlySelectedProjectDirs'>> & {
8
+ argv: {
9
+ original: string[];
10
+ };
11
+ dryRun?: boolean;
12
+ engineStrict?: boolean;
13
+ packDestination?: string;
14
+ out?: string;
15
+ json?: boolean;
16
+ unicode?: boolean;
17
+ };
18
+ export interface PackResultJson {
19
+ name: string;
20
+ version: string;
21
+ filename: string;
22
+ files: Array<{
23
+ path: string;
24
+ }>;
25
+ }
26
+ export declare function handler(opts: PackOptions): Promise<string>;
27
+ export declare function api(opts: PackOptions): Promise<PackResult>;
28
+ export interface PackResult {
29
+ publishedManifest: ExportedManifest;
30
+ contents: string[];
31
+ tarballPath: string;
32
+ /** Total uncompressed size of all files in the tarball, in bytes. */
33
+ unpackedSize: number;
34
+ }