@codecov/bundler-plugin-core
Advanced tools
Comparing version 0.0.1-beta.12 to 1.0.0
@@ -5,2 +5,4 @@ import { UnpluginOptions, UnpluginContextMeta } from 'unplugin'; | ||
type NormalizedOptions = z.infer<ReturnType<typeof optionsSchemaFactory>> & Options; | ||
type ValidGitService = z.infer<typeof ValidGitServiceSchema>; | ||
declare const ValidGitServiceSchema: z.ZodUnion<[z.ZodLiteral<"github">, z.ZodLiteral<"gitlab">, z.ZodLiteral<"bitbucket">, z.ZodLiteral<"github_enterprise">, z.ZodLiteral<"gitlab_enterprise">, z.ZodLiteral<"bitbucket_server">]>; | ||
declare const optionsSchemaFactory: (options: Options) => z.ZodObject<{ | ||
@@ -36,2 +38,23 @@ apiUrl: z.ZodDefault<z.ZodString>; | ||
debug: z.ZodDefault<z.ZodBoolean>; | ||
/** | ||
* Using an enum here, as custom error messages for union types seem to be broken currently. | ||
* | ||
* Issue: https://github.com/colinhacks/zod/issues/3675 | ||
*/ | ||
gitService: z.ZodOptional<z.ZodEnum<["github", "gitlab", "bitbucket", "github_enterprise", "gitlab_enterprise", "bitbucket_server"]>>; | ||
oidc: z.ZodOptional<z.ZodObject<{ | ||
useGitHubOIDC: z.ZodDefault<z.ZodBoolean>; | ||
/** | ||
* Following along with how we handle this in our GH Action. | ||
* | ||
* See: https://github.com/codecov/codecov-action/blob/main/src/buildExec.ts#L53-L58 | ||
*/ | ||
gitHubOIDCTokenAudience: z.ZodDefault<z.ZodOptional<z.ZodString>>; | ||
}, "strip", z.ZodTypeAny, { | ||
useGitHubOIDC: boolean; | ||
gitHubOIDCTokenAudience: string; | ||
}, { | ||
useGitHubOIDC?: boolean | undefined; | ||
gitHubOIDCTokenAudience?: string | undefined; | ||
}>>; | ||
}, "strip", z.ZodTypeAny, { | ||
@@ -53,2 +76,7 @@ retryCount: number; | ||
} | undefined; | ||
gitService?: "github" | "gitlab" | "bitbucket" | "github_enterprise" | "gitlab_enterprise" | "bitbucket_server" | undefined; | ||
oidc?: { | ||
useGitHubOIDC: boolean; | ||
gitHubOIDCTokenAudience: string; | ||
} | undefined; | ||
}, { | ||
@@ -70,2 +98,7 @@ bundleName: string; | ||
debug?: boolean | undefined; | ||
gitService?: "github" | "gitlab" | "bitbucket" | "github_enterprise" | "gitlab_enterprise" | "bitbucket_server" | undefined; | ||
oidc?: { | ||
useGitHubOIDC?: boolean | undefined; | ||
gitHubOIDCTokenAudience?: string | undefined; | ||
} | undefined; | ||
}>; | ||
@@ -112,3 +145,8 @@ interface NormalizedOptionsFailure { | ||
uploadToken?: string; | ||
oidc?: { | ||
useGitHubOIDC: boolean; | ||
gitHubOIDCTokenAudience: string; | ||
}; | ||
debug: boolean; | ||
gitService?: ValidGitService; | ||
originalBundleName: string; | ||
@@ -174,13 +212,8 @@ branch?: string; | ||
} | ||
/** Configuration ptions for the Codcove bundler plugin. */ | ||
interface ExtendedBAUploadArgs<TArgs extends object> extends BundleAnalysisUploadPluginArgs { | ||
options: TArgs; | ||
} | ||
/** Configuration options for the Codecov bundler plugin. */ | ||
interface Options { | ||
/** | ||
* The upload token to use for uploading the bundle analysis information. | ||
* | ||
* This value can either be an global upload token or a repo token. | ||
* - The global upload token can be found under the organization settings page. | ||
* - The repo token can be found under the repo settings page under the general tab. | ||
*/ | ||
uploadToken?: string; | ||
/** | ||
* The api url used to fetch the upload url. | ||
@@ -190,2 +223,4 @@ * | ||
* | ||
* Example: `apiUrl: 'https://api.codecov.io'` | ||
* | ||
* Defaults to `https://api.codecov.io`. | ||
@@ -195,2 +230,31 @@ */ | ||
/** | ||
* Override value for git service used for tokenless uploads. Using tokenless uploads is only | ||
* supported for public repositories. | ||
* | ||
* Note: If an `uploadToken` is provided you do not need to provide a `gitService`. | ||
* | ||
* The value must be one of the following: | ||
* - `github` | ||
* - `gitlab` | ||
* - `bitbucket` | ||
* - `github_enterprise` | ||
* - `gitlab_enterprise` | ||
* - `bitbucket_server` | ||
* | ||
* Example `gitService: 'github'` | ||
*/ | ||
gitService?: ValidGitService; | ||
/** | ||
* The upload token to use for uploading the bundle analysis information. | ||
* | ||
* This field is **required** for uploading bundle analysis information in private repositories. | ||
* Alternatively if you're using GitHub Actions and have configured OIDC authentication you can | ||
* omit this field, and enable the `oidc.useGitHubOIDC` option. | ||
* | ||
* This value can either be a global upload token or a repo token. | ||
* - The global upload token can be found under the organization settings page. | ||
* - The repo token can be found under the repo settings page under the general tab. | ||
*/ | ||
uploadToken?: string; | ||
/** | ||
* The amount of times the upload function will retry to upload bundle analysis information. | ||
@@ -202,8 +266,2 @@ * | ||
/** | ||
* When enabled information will not be uploaded to Codecov. | ||
* | ||
* Defaults to `false` | ||
*/ | ||
dryRun?: boolean; | ||
/** | ||
* The name for the bundle being built. | ||
@@ -215,3 +273,3 @@ * | ||
* | ||
* Example: `@codecov/rollup-plugin` | ||
* Example: `bundleName: '@codecov/rollup-plugin'` | ||
*/ | ||
@@ -222,2 +280,4 @@ bundleName?: string; | ||
* | ||
* Example: `enableBundleAnalysis: true` | ||
* | ||
* Defaults to `false` | ||
@@ -230,2 +290,33 @@ */ | ||
debug?: boolean; | ||
/** | ||
* When enabled information will not be uploaded to Codecov. | ||
* | ||
* Example: `dryRun: true` | ||
* | ||
* Defaults to `false` | ||
*/ | ||
dryRun?: boolean; | ||
/** Options for OIDC authentication. */ | ||
oidc?: { | ||
/** | ||
* When using GitHub Actions this option can be enabled to use OIDC authentication, which | ||
* removes the requirement for an upload token. | ||
* | ||
* [OpenID Connect | ||
* (OIDC)](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect) | ||
* is **required** to be configured in order to use GitHub OIDC. | ||
* | ||
* Defaults to `false` | ||
*/ | ||
useGitHubOIDC: boolean; | ||
/** | ||
* The OIDC audience to use for authentication. | ||
* | ||
* If you're using a self hosted version of Codecov, you will need to provide the audience for | ||
* the OIDC token. | ||
* | ||
* Defaults to `https://codecov.io` | ||
*/ | ||
gitHubOIDCTokenAudience?: string; | ||
}; | ||
} | ||
@@ -236,2 +327,6 @@ type BundleAnalysisUploadPlugin = (args: BundleAnalysisUploadPluginArgs) => UnpluginOptions & { | ||
}; | ||
type ExtendedBAUploadPlugin<TArgs extends object> = (args: ExtendedBAUploadArgs<TArgs>) => UnpluginOptions & { | ||
pluginVersion: string; | ||
version: string; | ||
}; | ||
/** A set of overrides that are passed to Codecov. */ | ||
@@ -282,2 +377,2 @@ interface UploadOverrides { | ||
export { type Asset, type BundleAnalysisUploadPlugin, type Chunk, type Module, type Options, Output, type ProviderUtilInputs, type UploadOverrides, checkNodeVersion, createRollupAsset, getCompressedSize, handleErrors, normalizeOptions, normalizePath, red }; | ||
export { type Asset, type BundleAnalysisUploadPlugin, type BundleAnalysisUploadPluginArgs, type Chunk, type ExtendedBAUploadArgs, type ExtendedBAUploadPlugin, type Module, type Options, Output, type ProviderUtilInputs, type UploadOverrides, checkNodeVersion, createRollupAsset, getCompressedSize, handleErrors, normalizeOptions, normalizePath, red }; |
{ | ||
"name": "@codecov/bundler-plugin-core", | ||
"version": "0.0.1-beta.12", | ||
"version": "1.0.0", | ||
"description": "Official Codecov Bundler Plugin Core", | ||
@@ -27,2 +27,4 @@ "author": "Codecov", | ||
"dependencies": { | ||
"@actions/core": "^1.10.1", | ||
"@actions/github": "^6.0.0", | ||
"chalk": "4.1.2", | ||
@@ -34,2 +36,3 @@ "semver": "^7.5.4", | ||
"devDependencies": { | ||
"@octokit/webhooks-definitions": "^3.67.3", | ||
"@types/node": "^20.11.15", | ||
@@ -36,0 +39,0 @@ "@types/semver": "^7.5.6", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
436698
694
2
6
14
+ Added@actions/core@^1.10.1
+ Added@actions/github@^6.0.0
+ Added@actions/core@1.11.1(transitive)
+ Added@actions/exec@1.1.1(transitive)
+ Added@actions/github@6.0.0(transitive)
+ Added@actions/http-client@2.2.3(transitive)
+ Added@actions/io@1.1.3(transitive)
+ Added@fastify/busboy@2.1.1(transitive)
+ Added@octokit/auth-token@4.0.0(transitive)
+ Added@octokit/core@5.2.0(transitive)
+ Added@octokit/endpoint@9.0.5(transitive)
+ Added@octokit/graphql@7.1.0(transitive)
+ Added@octokit/openapi-types@20.0.022.2.0(transitive)
+ Added@octokit/plugin-paginate-rest@9.2.1(transitive)
+ Added@octokit/plugin-rest-endpoint-methods@10.4.1(transitive)
+ Added@octokit/request@8.4.0(transitive)
+ Added@octokit/request-error@5.1.0(transitive)
+ Added@octokit/types@12.6.013.6.2(transitive)
+ Addedbefore-after-hook@2.2.3(transitive)
+ Addeddeprecation@2.3.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedtunnel@0.0.6(transitive)
+ Addedundici@5.28.4(transitive)
+ Addeduniversal-user-agent@6.0.1(transitive)
+ Addedwrappy@1.0.2(transitive)