@mui/internal-code-infra 0.0.3-canary.6 → 0.0.3-canary.61

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 (99) hide show
  1. package/README.md +55 -0
  2. package/build/babel-config.d.mts +40 -0
  3. package/build/brokenLinksChecker/index.d.mts +138 -0
  4. package/build/cli/cmdArgosPush.d.mts +13 -0
  5. package/build/cli/cmdBuild.d.mts +56 -0
  6. package/build/cli/cmdCopyFiles.d.mts +20 -0
  7. package/build/cli/cmdExtractErrorCodes.d.mts +3 -0
  8. package/build/cli/cmdGithubAuth.d.mts +6 -0
  9. package/build/cli/cmdListWorkspaces.d.mts +18 -0
  10. package/build/cli/cmdPublish.d.mts +27 -0
  11. package/build/cli/cmdPublishCanary.d.mts +30 -0
  12. package/build/cli/cmdPublishNewPackage.d.mts +8 -0
  13. package/build/cli/cmdSetVersionOverrides.d.mts +9 -0
  14. package/build/cli/cmdValidateBuiltTypes.d.mts +2 -0
  15. package/build/cli/index.d.mts +1 -0
  16. package/build/eslint/baseConfig.d.mts +10 -0
  17. package/build/eslint/docsConfig.d.mts +4 -0
  18. package/build/eslint/extensions.d.mts +8 -0
  19. package/build/eslint/index.d.mts +4 -0
  20. package/build/eslint/jsonConfig.d.mts +4 -0
  21. package/build/eslint/material-ui/config.d.mts +8 -0
  22. package/build/eslint/material-ui/index.d.mts +2 -0
  23. package/build/eslint/material-ui/rules/disallow-active-element-as-key-event-target.d.mts +5 -0
  24. package/build/eslint/material-ui/rules/disallow-react-api-in-server-components.d.mts +2 -0
  25. package/build/eslint/material-ui/rules/docgen-ignore-before-comment.d.mts +2 -0
  26. package/build/eslint/material-ui/rules/mui-name-matches-component-name.d.mts +5 -0
  27. package/build/eslint/material-ui/rules/no-empty-box.d.mts +5 -0
  28. package/build/eslint/material-ui/rules/no-restricted-resolved-imports.d.mts +12 -0
  29. package/build/eslint/material-ui/rules/no-styled-box.d.mts +5 -0
  30. package/build/eslint/material-ui/rules/rules-of-use-theme-variants.d.mts +9 -0
  31. package/build/eslint/material-ui/rules/straight-quotes.d.mts +5 -0
  32. package/build/eslint/testConfig.d.mts +14 -0
  33. package/build/markdownlint/duplicate-h1.d.mts +27 -0
  34. package/build/markdownlint/git-diff.d.mts +8 -0
  35. package/build/markdownlint/index.d.mts +56 -0
  36. package/build/markdownlint/straight-quotes.d.mts +8 -0
  37. package/build/markdownlint/table-alignment.d.mts +8 -0
  38. package/build/markdownlint/terminal-language.d.mts +8 -0
  39. package/build/prettier.d.mts +20 -0
  40. package/build/stylelint/index.d.mts +32 -0
  41. package/build/utils/babel.d.mts +71 -0
  42. package/build/utils/build.d.mts +50 -0
  43. package/build/utils/changelog.d.mts +64 -0
  44. package/build/utils/credentials.d.mts +17 -0
  45. package/build/utils/extractErrorCodes.d.mts +19 -0
  46. package/build/utils/git.d.mts +26 -0
  47. package/build/utils/github.d.mts +41 -0
  48. package/build/utils/pnpm.d.mts +238 -0
  49. package/build/utils/typescript.d.mts +35 -0
  50. package/package.json +92 -42
  51. package/src/babel-config.mjs +52 -8
  52. package/src/brokenLinksChecker/__fixtures__/static-site/broken-links.html +20 -0
  53. package/src/brokenLinksChecker/__fixtures__/static-site/broken-targets.html +22 -0
  54. package/src/brokenLinksChecker/__fixtures__/static-site/example.md +9 -0
  55. package/src/brokenLinksChecker/__fixtures__/static-site/external-links.html +21 -0
  56. package/src/brokenLinksChecker/__fixtures__/static-site/ignored-page.html +17 -0
  57. package/src/brokenLinksChecker/__fixtures__/static-site/index.html +26 -0
  58. package/src/brokenLinksChecker/__fixtures__/static-site/known-targets.json +5 -0
  59. package/src/brokenLinksChecker/__fixtures__/static-site/nested/page.html +19 -0
  60. package/src/brokenLinksChecker/__fixtures__/static-site/orphaned-page.html +20 -0
  61. package/src/brokenLinksChecker/__fixtures__/static-site/page-with-api-links.html +20 -0
  62. package/src/brokenLinksChecker/__fixtures__/static-site/page-with-custom-targets.html +24 -0
  63. package/src/brokenLinksChecker/__fixtures__/static-site/page-with-ignored-content.html +28 -0
  64. package/src/brokenLinksChecker/__fixtures__/static-site/page-with-known-target-links.html +19 -0
  65. package/src/brokenLinksChecker/__fixtures__/static-site/valid.html +20 -0
  66. package/src/brokenLinksChecker/__fixtures__/static-site/with-anchors.html +31 -0
  67. package/src/brokenLinksChecker/index.mjs +641 -0
  68. package/src/brokenLinksChecker/index.test.ts +178 -0
  69. package/src/cli/cmdArgosPush.mjs +13 -2
  70. package/src/cli/cmdBuild.mjs +228 -31
  71. package/src/cli/cmdGithubAuth.mjs +36 -0
  72. package/src/cli/cmdListWorkspaces.mjs +2 -2
  73. package/src/cli/cmdPublish.mjs +203 -49
  74. package/src/cli/cmdPublishCanary.mjs +404 -46
  75. package/src/cli/cmdPublishNewPackage.mjs +86 -0
  76. package/src/cli/cmdSetVersionOverrides.mjs +17 -1
  77. package/src/cli/cmdValidateBuiltTypes.mjs +49 -0
  78. package/src/cli/index.mjs +6 -2
  79. package/src/cli/packageJson.d.ts +729 -0
  80. package/src/eslint/baseConfig.mjs +96 -78
  81. package/src/eslint/docsConfig.mjs +26 -13
  82. package/src/eslint/extensions.mjs +8 -8
  83. package/src/eslint/jsonConfig.mjs +40 -0
  84. package/src/eslint/material-ui/config.mjs +8 -9
  85. package/src/eslint/material-ui/rules/mui-name-matches-component-name.mjs +4 -2
  86. package/src/eslint/material-ui/rules/rules-of-use-theme-variants.mjs +2 -1
  87. package/src/eslint/testConfig.mjs +72 -66
  88. package/src/stylelint/index.mjs +46 -0
  89. package/src/untyped-plugins.d.ts +13 -0
  90. package/src/{cli → utils}/babel.mjs +10 -3
  91. package/src/utils/build.mjs +27 -1
  92. package/src/utils/changelog.mjs +157 -0
  93. package/src/utils/credentials.mjs +71 -0
  94. package/src/utils/extractErrorCodes.mjs +2 -2
  95. package/src/utils/git.mjs +67 -0
  96. package/src/utils/github.mjs +263 -0
  97. package/src/{cli → utils}/pnpm.mjs +23 -13
  98. package/src/{cli → utils}/typescript.mjs +13 -7
  99. package/src/cli/cmdJsonLint.mjs +0 -69
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Create a base configuration for markdownlint.
3
+ * @param {Object} options
4
+ * @param {(typeof straightQuotes)[]} [options.rules] - An array of custom rules to include.
5
+ * @param {string[]} [options.ignores] - An array of glob patterns to ignore.
6
+ * @returns
7
+ */
8
+ export function createBaseConfig(options?: {
9
+ rules?: {
10
+ names: string[];
11
+ description: string;
12
+ tags: string[];
13
+ function: (params: import("./duplicate-h1.mjs").MdParams, onError: import("./duplicate-h1.mjs").OnError) => void;
14
+ }[] | undefined;
15
+ ignores?: string[] | undefined;
16
+ }): {
17
+ config: {
18
+ default: boolean;
19
+ MD004: boolean;
20
+ MD009: {
21
+ br_spaces: number;
22
+ strict: boolean;
23
+ list_item_empty_lines: boolean;
24
+ };
25
+ MD013: boolean;
26
+ MD014: boolean;
27
+ MD024: {
28
+ siblings_only: boolean;
29
+ };
30
+ MD025: {
31
+ level: number;
32
+ front_matter_title: string;
33
+ };
34
+ MD033: boolean;
35
+ MD034: boolean;
36
+ MD028: boolean;
37
+ MD029: boolean;
38
+ MD031: boolean;
39
+ MD036: boolean;
40
+ MD051: boolean;
41
+ MD052: boolean;
42
+ MD059: boolean;
43
+ straightQuotes: boolean;
44
+ gitDiff: boolean;
45
+ tableAlignment: boolean;
46
+ terminalLanguage: boolean;
47
+ duplicateH1: boolean;
48
+ };
49
+ customRules: {
50
+ names: string[];
51
+ description: string;
52
+ tags: string[];
53
+ function: (params: import("./duplicate-h1.mjs").MdParams, onError: import("./duplicate-h1.mjs").OnError) => void;
54
+ }[];
55
+ ignores: string[];
56
+ };
@@ -0,0 +1,8 @@
1
+ declare namespace _default {
2
+ export let names: string[];
3
+ export let description: string;
4
+ export let tags: string[];
5
+ export function _function(params: import("./duplicate-h1.mjs").MdParams, onError: import("./duplicate-h1.mjs").OnError): void;
6
+ export { _function as function };
7
+ }
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare namespace _default {
2
+ export let names: string[];
3
+ export let description: string;
4
+ export let tags: string[];
5
+ export function _function(params: import("./duplicate-h1.mjs").MdParams, onError: import("./duplicate-h1.mjs").OnError): void;
6
+ export { _function as function };
7
+ }
8
+ export default _default;
@@ -0,0 +1,8 @@
1
+ declare namespace _default {
2
+ export let names: string[];
3
+ export let description: string;
4
+ export let tags: string[];
5
+ export function _function(params: import("./duplicate-h1.mjs").MdParams, onError: import("./duplicate-h1.mjs").OnError): void;
6
+ export { _function as function };
7
+ }
8
+ export default _default;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @param {Object} [options={}]
3
+ * @param {Override[]} [options.overrides]
4
+ * @returns {import('prettier').Config}
5
+ */
6
+ export function createBaseConfig(options?: {
7
+ overrides?: {
8
+ files: string | string[];
9
+ excludeFiles?: string | string[];
10
+ options?: import("prettier").Options;
11
+ }[] | undefined;
12
+ }): import("prettier").Config;
13
+ /**
14
+ * @typedef {Exclude<import('prettier').Config['overrides'], undefined>[number]} Override
15
+ */
16
+ /**
17
+ * @type {Override[]}
18
+ */
19
+ export const docsOverrides: Override[];
20
+ export type Override = Exclude<import("prettier").Config["overrides"], undefined>[number];
@@ -0,0 +1,32 @@
1
+ declare const _default: {
2
+ extends: (string | string[]) | undefined;
3
+ rules: {
4
+ 'no-descending-specificity': null;
5
+ 'alpha-value-notation': null;
6
+ 'custom-property-pattern': null;
7
+ 'media-feature-range-notation': null;
8
+ 'no-empty-source': null;
9
+ 'selector-class-pattern': null;
10
+ 'string-no-newline': null;
11
+ 'value-keyword-case': null;
12
+ 'import-notation': null;
13
+ 'at-rule-empty-line-before': null;
14
+ 'comment-empty-line-before': null;
15
+ 'custom-property-empty-line-before': null;
16
+ 'declaration-empty-line-before': null;
17
+ 'rule-empty-line-before': null;
18
+ 'at-rule-no-unknown': (boolean | {
19
+ ignoreAtRules: string[];
20
+ })[];
21
+ 'property-no-vendor-prefix': null;
22
+ 'property-no-deprecated': null;
23
+ 'declaration-property-value-keyword-no-deprecated': null;
24
+ 'color-hex-length': null;
25
+ 'declaration-block-no-redundant-longhand-properties': null;
26
+ };
27
+ overrides: {
28
+ files: string[];
29
+ customSyntax: any;
30
+ }[];
31
+ };
32
+ export default _default;
@@ -0,0 +1,71 @@
1
+ /**
2
+ * @param {string} pkgVersion
3
+ * @returns {Record<string, string>} An object containing version-related environment variables.
4
+ */
5
+ export function getVersionEnvVariables(pkgVersion: string): Record<string, string>;
6
+ /**
7
+ * Copies CommonJS files from one directory to another.
8
+ * @param {Object} param0
9
+ * @param {string} param0.from - The source directory.
10
+ * @param {string} param0.to - The destination directory.
11
+ * @returns {Promise<void>}
12
+ */
13
+ export function cjsCopy({ from, to }: {
14
+ from: string;
15
+ to: string;
16
+ }): Promise<void>;
17
+ /**
18
+ * @typedef {Object} ErrorCodeMetadata
19
+ * @property {string} outputPath - The path where the error code file should be written.
20
+ * @property {'annotate' | 'throw' | 'write'} [missingError] - How to handle missing error codes.
21
+ * @property {string} [runtimeModule] - The runtime module to replace the errors with.
22
+ */
23
+ /**
24
+ * @param {Object} options
25
+ * @param {boolean} [options.verbose=false] - Whether to enable verbose logging.
26
+ * @param {boolean} [options.optimizeClsx=false] - Whether to enable clsx call optimization transform.
27
+ * @param {boolean} [options.removePropTypes=true] - Whether to enable removal of React prop types.
28
+ * @param {Object} [options.reactCompiler] - Whether to use the React compiler.
29
+ * @param {string} [options.reactCompiler.reactVersion] - The React version to use with the React compiler.
30
+ * @param {string[]} [options.ignores] - The globs to be ignored by Babel.
31
+ * @param {string} options.cwd - The package root directory.
32
+ * @param {string} options.pkgVersion - The package version.
33
+ * @param {string} options.sourceDir - The source directory to build from.
34
+ * @param {string} options.outDir - The output directory for the build.
35
+ * @param {string} options.outExtension - The output file extension for the build.
36
+ * @param {boolean} options.hasLargeFiles - Whether the build includes large files.
37
+ * @param {import('./build.mjs').BundleType} options.bundle - The bundles to build.
38
+ * @param {string} options.babelRuntimeVersion - The version of @babel/runtime to use.
39
+ * @returns {Promise<void>}
40
+ */
41
+ export function babelBuild({ cwd, sourceDir, outDir, babelRuntimeVersion, hasLargeFiles, bundle, pkgVersion, outExtension, optimizeClsx, removePropTypes, verbose, ignores, reactCompiler, }: {
42
+ verbose?: boolean | undefined;
43
+ optimizeClsx?: boolean | undefined;
44
+ removePropTypes?: boolean | undefined;
45
+ reactCompiler?: {
46
+ reactVersion?: string | undefined;
47
+ } | undefined;
48
+ ignores?: string[] | undefined;
49
+ cwd: string;
50
+ pkgVersion: string;
51
+ sourceDir: string;
52
+ outDir: string;
53
+ outExtension: string;
54
+ hasLargeFiles: boolean;
55
+ bundle: import("./build.mjs").BundleType;
56
+ babelRuntimeVersion: string;
57
+ }): Promise<void>;
58
+ export type ErrorCodeMetadata = {
59
+ /**
60
+ * - The path where the error code file should be written.
61
+ */
62
+ outputPath: string;
63
+ /**
64
+ * - How to handle missing error codes.
65
+ */
66
+ missingError?: "throw" | "annotate" | "write" | undefined;
67
+ /**
68
+ * - The runtime module to replace the errors with.
69
+ */
70
+ runtimeModule?: string | undefined;
71
+ };
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @param {BundleType} bundle
3
+ */
4
+ export function getOutExtension(bundle: BundleType, isType?: boolean): ".mjs" | ".js" | ".d.ts" | ".d.mts";
5
+ /**
6
+ * Validates the package.json before building.
7
+ * @param {Record<string, any>} packageJson
8
+ * @param {Object} [options]
9
+ * @param {boolean} [options.skipMainCheck=false] - Whether to skip checking for main field in package.json.
10
+ * @param {boolean} [options.enableReactCompiler=false] - Whether to enable React compiler checks.
11
+ */
12
+ export function validatePkgJson(packageJson: Record<string, any>, options?: {
13
+ skipMainCheck?: boolean | undefined;
14
+ enableReactCompiler?: boolean | undefined;
15
+ }): void;
16
+ /**
17
+ * Marks the start and end of a function execution for performance measurement.
18
+ * Uses the Performance API to create marks and measure the duration.
19
+ * @function
20
+ * @template {() => Promise<any>} F
21
+ * @param {string} label
22
+ * @param {() => ReturnType<F>} fn
23
+ * @returns {Promise<ReturnType<F>>}
24
+ */
25
+ export function markFn<F extends () => Promise<any>>(label: string, fn: () => ReturnType<F>): Promise<ReturnType<F>>;
26
+ /**
27
+ * @param {string} label
28
+ */
29
+ export function measureFn(label: string): PerformanceMeasure;
30
+ /**
31
+ * A utility to map a function over an array of items in a worker pool.
32
+ *
33
+ * This function will create a pool of workers and distribute the items to be processed among them.
34
+ * Each worker will process items sequentially, but multiple workers will run in parallel.
35
+ *
36
+ * @function
37
+ * @template T
38
+ * @template R
39
+ * @param {T[]} items
40
+ * @param {(item: T) => Promise<R>} mapper
41
+ * @param {number} concurrency
42
+ * @returns {Promise<(R|Error)[]>}
43
+ */
44
+ export function mapConcurrently<T, R>(items: T[], mapper: (item: T) => Promise<R>, concurrency: number): Promise<(R | Error)[]>;
45
+ /**
46
+ * @typedef {'esm' | 'cjs'} BundleType
47
+ */
48
+ export const isMjsBuild: boolean;
49
+ export const BASE_IGNORES: string[];
50
+ export type BundleType = "esm" | "cjs";
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @typedef {import('@octokit/rest').Octokit} OctokitType
3
+ */
4
+ /**
5
+ * @typedef {'team' | 'first_timer' | 'contributor'} AuthorAssociation
6
+ */
7
+ /**
8
+ * @typedef {Object} FetchedCommitDetails
9
+ * @property {string} sha
10
+ * @property {string} message
11
+ * @property {string[]} labels
12
+ * @property {number} prNumber
13
+ * @property {string} html_url
14
+ * @property {{login: string; association: AuthorAssociation} | null} author
15
+ */
16
+ /**
17
+ * @typedef {Object} FetchCommitsOptions
18
+ * @property {string} repo
19
+ * @property {string} lastRelease
20
+ * @property {string} release
21
+ * @property {string} [org='mui'] - GitHub organization name, defaults to 'mui'
22
+ */
23
+ /**
24
+ * @param {Object} opts
25
+ * @param {string} opts.cwd
26
+ * @param {boolean} [opts.fetchAll=true] Whether to fetch all tags from all remotes before finding the latest tag.
27
+ * @returns {Promise<string>}
28
+ */
29
+ export function findLatestTaggedVersion(opts: {
30
+ cwd: string;
31
+ fetchAll?: boolean | undefined;
32
+ }): Promise<string>;
33
+ /**
34
+ * Fetches commits between two refs (lastRelease..release) including PR details.
35
+ * Automatically handles GitHub OAuth authentication if none provided.
36
+ *
37
+ * @param {FetchCommitsOptions & {octokit?: OctokitType}} opts
38
+ * @returns {Promise<FetchedCommitDetails[]>}
39
+ */
40
+ export function fetchCommitsBetweenRefs(opts: FetchCommitsOptions & {
41
+ octokit?: OctokitType;
42
+ }): Promise<FetchedCommitDetails[]>;
43
+ export type OctokitType = import("@octokit/rest").Octokit;
44
+ export type AuthorAssociation = "team" | "first_timer" | "contributor";
45
+ export type FetchedCommitDetails = {
46
+ sha: string;
47
+ message: string;
48
+ labels: string[];
49
+ prNumber: number;
50
+ html_url: string;
51
+ author: {
52
+ login: string;
53
+ association: AuthorAssociation;
54
+ } | null;
55
+ };
56
+ export type FetchCommitsOptions = {
57
+ repo: string;
58
+ lastRelease: string;
59
+ release: string;
60
+ /**
61
+ * - GitHub organization name, defaults to 'mui'
62
+ */
63
+ org?: string | undefined;
64
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @param {string} key
3
+ * @returns {Promise<string | undefined>}
4
+ */
5
+ export function getPassword(key: string): Promise<string | undefined>;
6
+ /**
7
+ * @param {string} key
8
+ * @param {string} password
9
+ * @returns {Promise<void>}
10
+ */
11
+ export function setPassword(key: string, password: string): Promise<void>;
12
+ /**
13
+ * @param {string} key
14
+ * @returns {Promise<void>}
15
+ */
16
+ export function deleteKey(key: string): Promise<void>;
17
+ export const KEYRING_SERVICE: "mui-code-infra";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Extracts error codes from all workspace packages.
3
+ * @param {Args} args
4
+ */
5
+ export default function extractErrorCodes(args: Args): Promise<void>;
6
+ export type Args = {
7
+ /**
8
+ * - The output path to write the extracted error codes.
9
+ */
10
+ errorCodesPath: string;
11
+ /**
12
+ * - List of package names to skip. By default, all workspace packages are considered.
13
+ */
14
+ skip?: string[] | undefined;
15
+ /**
16
+ * - The detection strategy to use when extracting error codes.
17
+ */
18
+ detection?: import("@mui/internal-babel-plugin-minify-errors").Options["detection"];
19
+ };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @typedef {Object} RepoInfo
3
+ * @property {string} owner - Repository owner
4
+ * @property {string} repo - Repository name
5
+ */
6
+ /**
7
+ * Get current repository info from git remote
8
+ * @param {string[]} [remotes=['upstream', 'origin']] - Remote name(s) to check (default: ['upstream', 'origin'])
9
+ * @returns {Promise<RepoInfo>} Repository owner and name
10
+ */
11
+ export function getRepositoryInfo(remotes?: string[]): Promise<RepoInfo>;
12
+ /**
13
+ * Get current git SHA
14
+ * @returns {Promise<string>} Current git commit SHA
15
+ */
16
+ export function getCurrentGitSha(): Promise<string>;
17
+ export type RepoInfo = {
18
+ /**
19
+ * - Repository owner
20
+ */
21
+ owner: string;
22
+ /**
23
+ * - Repository name
24
+ */
25
+ repo: string;
26
+ };
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @typedef {Object} GitHubAppAuthenticationWithRefreshToken
3
+ * @property {string} token - The access token
4
+ * @property {string} [expiresAt] - ISO string when the access token expires
5
+ * @property {string} [refreshToken] - The refresh token
6
+ * @property {string} [refreshTokenExpiresAt] - ISO string when the refresh token expires
7
+ */
8
+ export function persistentAuthStrategy(): {
9
+ hook: (request: import("@octokit/types").RequestInterface, route: import("@octokit/types").Route, parameters: import("@octokit/types").RequestParameters) => Promise<import("@octokit/types").OctokitResponse<any, number>>;
10
+ };
11
+ /**
12
+ * @param {Object} [options]
13
+ * @param {boolean} [options.log=false] - Whether to log progress to console
14
+ * @returns {Promise<string>} Valid GitHub access token
15
+ */
16
+ export function endToEndGhAuthGetToken({ log }?: {
17
+ log?: boolean | undefined;
18
+ }): Promise<string>;
19
+ /**
20
+ * Clears stored GitHub authentication tokens
21
+ * @returns {Promise<void>}
22
+ */
23
+ export function clearGitHubAuth(): Promise<void>;
24
+ export type GitHubAppAuthenticationWithRefreshToken = {
25
+ /**
26
+ * - The access token
27
+ */
28
+ token: string;
29
+ /**
30
+ * - ISO string when the access token expires
31
+ */
32
+ expiresAt?: string | undefined;
33
+ /**
34
+ * - The refresh token
35
+ */
36
+ refreshToken?: string | undefined;
37
+ /**
38
+ * - ISO string when the refresh token expires
39
+ */
40
+ refreshTokenExpiresAt?: string | undefined;
41
+ };
@@ -0,0 +1,238 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Get workspace packages with optional filtering
4
+ *
5
+ * @overload
6
+ * @param {{ publicOnly: true } & GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
7
+ * @returns {Promise<PublicPackage[]>} Array of packages
8
+ *
9
+ * @overload
10
+ * @param {{ nonPublishedOnly: true } & GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
11
+ * @returns {Promise<PublicPackage[]>} Array of packages
12
+ *
13
+ * @overload
14
+ * @param {{ publicOnly?: false | undefined } & GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
15
+ * @returns {Promise<PrivatePackage[]>} Array of packages
16
+ *
17
+ * @overload
18
+ * @param {GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
19
+ * @returns {Promise<(PrivatePackage | PublicPackage)[]>} Array of packages
20
+ *
21
+ * @param {GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
22
+ * @returns {Promise<(PrivatePackage | PublicPackage)[]>} Array of packages
23
+ */
24
+ export function getWorkspacePackages(options?: ({
25
+ publicOnly: true;
26
+ } & GetWorkspacePackagesOptions) | undefined): Promise<PublicPackage[]>;
27
+ /**
28
+ * Get workspace packages with optional filtering
29
+ *
30
+ * @overload
31
+ * @param {{ publicOnly: true } & GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
32
+ * @returns {Promise<PublicPackage[]>} Array of packages
33
+ *
34
+ * @overload
35
+ * @param {{ nonPublishedOnly: true } & GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
36
+ * @returns {Promise<PublicPackage[]>} Array of packages
37
+ *
38
+ * @overload
39
+ * @param {{ publicOnly?: false | undefined } & GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
40
+ * @returns {Promise<PrivatePackage[]>} Array of packages
41
+ *
42
+ * @overload
43
+ * @param {GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
44
+ * @returns {Promise<(PrivatePackage | PublicPackage)[]>} Array of packages
45
+ *
46
+ * @param {GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
47
+ * @returns {Promise<(PrivatePackage | PublicPackage)[]>} Array of packages
48
+ */
49
+ export function getWorkspacePackages(options?: ({
50
+ nonPublishedOnly: true;
51
+ } & GetWorkspacePackagesOptions) | undefined): Promise<PublicPackage[]>;
52
+ /**
53
+ * Get workspace packages with optional filtering
54
+ *
55
+ * @overload
56
+ * @param {{ publicOnly: true } & GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
57
+ * @returns {Promise<PublicPackage[]>} Array of packages
58
+ *
59
+ * @overload
60
+ * @param {{ nonPublishedOnly: true } & GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
61
+ * @returns {Promise<PublicPackage[]>} Array of packages
62
+ *
63
+ * @overload
64
+ * @param {{ publicOnly?: false | undefined } & GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
65
+ * @returns {Promise<PrivatePackage[]>} Array of packages
66
+ *
67
+ * @overload
68
+ * @param {GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
69
+ * @returns {Promise<(PrivatePackage | PublicPackage)[]>} Array of packages
70
+ *
71
+ * @param {GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
72
+ * @returns {Promise<(PrivatePackage | PublicPackage)[]>} Array of packages
73
+ */
74
+ export function getWorkspacePackages(options?: ({
75
+ publicOnly?: false | undefined;
76
+ } & GetWorkspacePackagesOptions) | undefined): Promise<PrivatePackage[]>;
77
+ /**
78
+ * Get workspace packages with optional filtering
79
+ *
80
+ * @overload
81
+ * @param {{ publicOnly: true } & GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
82
+ * @returns {Promise<PublicPackage[]>} Array of packages
83
+ *
84
+ * @overload
85
+ * @param {{ nonPublishedOnly: true } & GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
86
+ * @returns {Promise<PublicPackage[]>} Array of packages
87
+ *
88
+ * @overload
89
+ * @param {{ publicOnly?: false | undefined } & GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
90
+ * @returns {Promise<PrivatePackage[]>} Array of packages
91
+ *
92
+ * @overload
93
+ * @param {GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
94
+ * @returns {Promise<(PrivatePackage | PublicPackage)[]>} Array of packages
95
+ *
96
+ * @param {GetWorkspacePackagesOptions} [options={}] - Options for filtering packages
97
+ * @returns {Promise<(PrivatePackage | PublicPackage)[]>} Array of packages
98
+ */
99
+ export function getWorkspacePackages(options?: GetWorkspacePackagesOptions | undefined): Promise<(PrivatePackage | PublicPackage)[]>;
100
+ /**
101
+ * Get package version info from registry
102
+ * @param {string} packageName - Name of the package
103
+ * @param {string} baseVersion - Base version to check
104
+ * @returns {Promise<VersionInfo>} Version information
105
+ */
106
+ export function getPackageVersionInfo(packageName: string, baseVersion: string): Promise<VersionInfo>;
107
+ /**
108
+ * Publish packages with the given options
109
+ * @param {PublicPackage[]} packages - Packages to publish
110
+ * @param {PublishOptions} [options={}] - Publishing options
111
+ * @returns {Promise<void>}
112
+ */
113
+ export function publishPackages(packages: PublicPackage[], options?: PublishOptions): Promise<void>;
114
+ /**
115
+ * Read package.json from a directory
116
+ * @param {string} packagePath - Path to package directory
117
+ * @returns {Promise<import('../cli/packageJson').PackageJson>} Parsed package.json content
118
+ */
119
+ export function readPackageJson(packagePath: string): Promise<import("../cli/packageJson").PackageJson>;
120
+ /**
121
+ * Write package.json to a directory
122
+ * @param {string} packagePath - Path to package directory
123
+ * @param {Object} packageJson - Package.json object to write
124
+ * @returns {Promise<void>}
125
+ */
126
+ export function writePackageJson(packagePath: string, packageJson: Object): Promise<void>;
127
+ /**
128
+ * Resolve a package@version specifier to an exact version
129
+ * @param {string} packageSpec - Package specifier in format "package@version"
130
+ * @returns {Promise<string>} Exact version string
131
+ */
132
+ export function resolveVersion(packageSpec: string): Promise<string>;
133
+ /**
134
+ * Find the version of a dependency for a specific package@version
135
+ * @param {string} packageSpec - Package specifier in format "package@version"
136
+ * @param {string} dependency - Dependency name to look up
137
+ * @returns {Promise<string>} Exact version string of the dependency
138
+ */
139
+ export function findDependencyVersionFromSpec(packageSpec: string, dependency: string): Promise<string>;
140
+ /**
141
+ * Get the maximum semver version between two versions
142
+ * @param {string} a
143
+ * @param {string} b
144
+ * @returns {string} The maximum semver version
145
+ */
146
+ export function semverMax(a: string, b: string): string;
147
+ export type PrivatePackage = {
148
+ /**
149
+ * - Package name
150
+ */
151
+ name?: string | undefined;
152
+ /**
153
+ * - Package version
154
+ */
155
+ version?: string | undefined;
156
+ /**
157
+ * - Package directory path
158
+ */
159
+ path: string;
160
+ /**
161
+ * - Whether the package is private
162
+ */
163
+ isPrivate: true;
164
+ };
165
+ export type PublicPackage = {
166
+ /**
167
+ * - Package name
168
+ */
169
+ name: string;
170
+ /**
171
+ * - Package version
172
+ */
173
+ version: string;
174
+ /**
175
+ * - Package directory path
176
+ */
177
+ path: string;
178
+ /**
179
+ * - Whether the package is private
180
+ */
181
+ isPrivate: false;
182
+ };
183
+ export type VersionInfo = {
184
+ /**
185
+ * - Whether current version exists on npm
186
+ */
187
+ currentVersionExists: boolean;
188
+ /**
189
+ * - Latest canary version if available
190
+ */
191
+ latestCanaryVersion: string | null;
192
+ };
193
+ export type PublishOptions = {
194
+ /**
195
+ * - Whether to run in dry-run mode
196
+ */
197
+ dryRun?: boolean | undefined;
198
+ /**
199
+ * - Whether to skip git checks
200
+ */
201
+ noGitChecks?: boolean | undefined;
202
+ /**
203
+ * - NPM dist tag to publish to
204
+ */
205
+ tag?: string | undefined;
206
+ };
207
+ export type PnpmListResultItem = {
208
+ /**
209
+ * - Package name
210
+ */
211
+ name?: string | undefined;
212
+ /**
213
+ * - Package version
214
+ */
215
+ version?: string | undefined;
216
+ /**
217
+ * - Package directory path
218
+ */
219
+ path: string;
220
+ /**
221
+ * - Whether the package is private
222
+ */
223
+ private: boolean;
224
+ };
225
+ export type GetWorkspacePackagesOptions = {
226
+ /**
227
+ * - Git reference to filter changes since
228
+ */
229
+ sinceRef?: string | null | undefined;
230
+ /**
231
+ * - Whether to filter to only public packages
232
+ */
233
+ publicOnly?: boolean | undefined;
234
+ /**
235
+ * - Whether to filter to only non-published packages. It by default means public packages yet to be published.
236
+ */
237
+ nonPublishedOnly?: boolean | undefined;
238
+ };