semantic-release-pub 0.10.10 → 0.10.11

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/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- export { verifyConditions } from "./verifyConditions.js";
2
1
  export { prepare } from "./prepare.js";
3
2
  export { publish } from "./publish.js";
3
+ export { verifyConditions } from "./verifyConditions.js";
package/dist/publish.js CHANGED
@@ -1,3 +1,4 @@
1
+ import SemanticReleaseError from "@semantic-release/error";
1
2
  import { execa } from "execa";
2
3
  import { getConfig, getGithubIdentityToken, getGoogleIdentityToken, getPubspec, } from "./utils.js";
3
4
  const SEMANTIC_RELEASE_PUB_TOKEN = "SEMANTIC_RELEASE_PUB_TOKEN";
@@ -25,6 +26,9 @@ const getPubToken = async (useGithubOidc, logger) => {
25
26
  }
26
27
  logger.log("Using Google identity token to publish to pub.dev");
27
28
  const { GOOGLE_SERVICE_ACCOUNT_KEY } = process.env;
29
+ if (!GOOGLE_SERVICE_ACCOUNT_KEY) {
30
+ throw new SemanticReleaseError("Environment variable not found: GOOGLE_SERVICE_ACCOUNT_KEY");
31
+ }
28
32
  return await getGoogleIdentityToken(GOOGLE_SERVICE_ACCOUNT_KEY);
29
33
  };
30
34
  const setPubToken = async (cli, idToken) => {
package/dist/utils.js CHANGED
@@ -17,7 +17,11 @@ export const getConfig = (config) => {
17
17
  };
18
18
  export const getGoogleIdentityToken = async (serviceAccountStr) => {
19
19
  const serviceAccountJson = getServiceAccount(serviceAccountStr);
20
- const jwtClient = new JWT(serviceAccountJson.client_email, undefined, serviceAccountJson.private_key, PUB_DEV_AUDIENCE);
20
+ const jwtClient = new JWT({
21
+ email: serviceAccountJson.client_email,
22
+ key: serviceAccountJson.private_key,
23
+ scopes: PUB_DEV_AUDIENCE,
24
+ });
21
25
  const creds = await jwtClient.authorize();
22
26
  if (!creds.id_token) {
23
27
  throw new SemanticReleaseError("Failed to retrieve identity token from Google");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-release-pub",
3
- "version": "0.10.10",
3
+ "version": "0.10.11",
4
4
  "description": "semantic-release plugin to publish a Dart or Flutter package",
5
5
  "main": "dist/index.js",
6
6
  "author": "zeshuaro@gmail.com",
@@ -25,7 +25,7 @@
25
25
  "scripts": {
26
26
  "build": "tsc",
27
27
  "test": "vitest run tests --coverage",
28
- "lint": "biome check src tests",
28
+ "lint": "biome check src tests && tsc --noEmit && tsc -p tsconfig.test.json",
29
29
  "lint:write": "biome check src tests --write"
30
30
  },
31
31
  "engines": {
@@ -35,24 +35,28 @@
35
35
  "@actions/core": "^1.11.1",
36
36
  "@semantic-release/error": "^4.0.0",
37
37
  "execa": "^9.6.0",
38
- "google-auth-library": "^9.15.1",
38
+ "google-auth-library": "^10.1.0",
39
39
  "yaml": "^2.8.0",
40
- "zod": "^3.25.62"
40
+ "zod": "^3.25.67"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@biomejs/biome": "1.9.4",
44
44
  "@semantic-release/changelog": "6.0.3",
45
45
  "@semantic-release/git": "10.0.1",
46
+ "@tsconfig/node-ts": "^23.6.1",
47
+ "@tsconfig/node22": "^22.0.2",
48
+ "@tsconfig/recommended": "^1.0.10",
49
+ "@tsconfig/strictest": "^2.0.5",
46
50
  "@types/common-tags": "1.8.4",
47
51
  "@types/semantic-release": "20.0.6",
48
52
  "@types/semantic-release__error": "3.0.3",
49
53
  "@types/signale": "1.4.7",
50
- "@vitest/coverage-v8": "3.2.3",
54
+ "@vitest/coverage-v8": "3.2.4",
51
55
  "common-tags": "1.8.2",
52
56
  "conventional-changelog-conventionalcommits": "9.0.0",
53
57
  "semantic-release": "24.2.5",
54
58
  "typescript": "5.8.3",
55
- "vitest": "3.2.3",
59
+ "vitest": "3.2.4",
56
60
  "vitest-mock-extended": "3.1.0"
57
61
  }
58
62
  }
package/dist/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export { verifyConditions } from "./verifyConditions.js";
2
- export { PluginConfig } from "./types.js";
3
- export { prepare } from "./prepare.js";
4
- export { publish } from "./publish.js";
package/dist/prepare.d.ts DELETED
@@ -1,3 +0,0 @@
1
- import type { PrepareContext } from "semantic-release";
2
- import type { PluginConfig } from "./types.js";
3
- export declare const prepare: (pluginConfig: PluginConfig, { nextRelease: { version }, logger }: PrepareContext) => Promise<void>;
package/dist/publish.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import type { PublishContext } from "semantic-release";
2
- import type { PluginConfig } from "./types.js";
3
- export declare const publish: (pluginConfig: PluginConfig, { nextRelease: { version }, logger }: PublishContext) => Promise<{
4
- name: string;
5
- url: string;
6
- }>;
package/dist/schemas.d.ts DELETED
@@ -1,23 +0,0 @@
1
- import { z } from "zod";
2
- export declare const ServiceAccount: z.ZodObject<{
3
- client_email: z.ZodString;
4
- private_key: z.ZodString;
5
- }, "strip", z.ZodTypeAny, {
6
- client_email?: string;
7
- private_key?: string;
8
- }, {
9
- client_email?: string;
10
- private_key?: string;
11
- }>;
12
- export type ServiceAccount = z.infer<typeof ServiceAccount>;
13
- export declare const Pubspec: z.ZodObject<{
14
- name: z.ZodString;
15
- version: z.ZodString;
16
- }, "strip", z.ZodTypeAny, {
17
- name?: string;
18
- version?: string;
19
- }, {
20
- name?: string;
21
- version?: string;
22
- }>;
23
- export type Pubspec = z.infer<typeof Pubspec>;
package/dist/types.d.ts DELETED
@@ -1,6 +0,0 @@
1
- export type PluginConfig = {
2
- cli: "dart" | "flutter";
3
- publishPub: boolean;
4
- updateBuildNumber: boolean;
5
- useGithubOidc: boolean;
6
- };
package/dist/utils.d.ts DELETED
@@ -1,14 +0,0 @@
1
- import type { PluginConfig } from "./types.js";
2
- export declare const PUBSPEC_PATH = "pubspec.yaml";
3
- export declare const getConfig: (config: PluginConfig) => PluginConfig;
4
- export declare const getGoogleIdentityToken: (serviceAccountStr: string) => Promise<string>;
5
- export declare const getGithubIdentityToken: () => Promise<string>;
6
- export declare const getPubspecString: () => string;
7
- export declare const getPubspecFromString: (data: string) => {
8
- name?: string;
9
- version?: string;
10
- };
11
- export declare const getPubspec: () => {
12
- name?: string;
13
- version?: string;
14
- };
@@ -1,3 +0,0 @@
1
- import type { VerifyConditionsContext } from "semantic-release";
2
- import type { PluginConfig } from "./types.js";
3
- export declare const verifyConditions: (pluginConfig: PluginConfig, { logger }: VerifyConditionsContext) => Promise<void>;