@paklo/core 0.11.1 → 0.12.1

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/README.md CHANGED
@@ -1,16 +1,9 @@
1
1
  # Paklo Core
2
2
 
3
- The shared toolkit for Paklo, ensuring consistent integrations with Azure DevOps, GitHub, Dependabot primitives, logging, HTTP helpers, and shared utilities.
3
+ > **⚠️ Internal Package - Not for Direct Use**
4
4
 
5
- ## Internal Surface Area
5
+ This package contains shared utilities used internally by Paklo components. It is not a public API and may change without notice.
6
6
 
7
- - This package is not a public API. Names, exports, and behaviors may change at any time as we evolve the architecture.
8
- - Use it only from within this monorepo. External consumers should rely on higher-level packages such as `@paklo/cli`.
9
- - When contributing, prefer adding well-tested, isolated helpers so they can be reused by downstream packages.
7
+ **Do not use this package directly.** Use `@paklo/cli` or the Azure DevOps extension instead.
10
8
 
11
- ## Development
12
-
13
- - `pnpm dev` — watch mode via `tsdown`
14
- - `pnpm test` — run the Vitest suite (fixtures live under `packages/core/fixtures`)
15
- - `pnpm lint` — run Biome checks
16
- - `pnpm build` — build distributable artifacts
9
+ For contribution guidelines, see [Contributing](https://www.paklo.app/docs/contributing).
@@ -1,18 +1,18 @@
1
- import { Jt as DependabotPersistedPr, W as DependabotUpdatePullRequest, Wn as VariableFinderFn, f as DependabotCreatePullRequest, yn as DependabotConfig } from "../index-t1Aj_PJX.mjs";
1
+ import { Jt as DependabotPersistedPr, W as DependabotUpdatePullRequest, Wn as VariableFinderFn, f as DependabotCreatePullRequest, yn as DependabotConfig } from "../index-rsiHDQ5U.mjs";
2
2
  import "../index-BfwWezjJ.mjs";
3
3
  import { z } from "zod";
4
4
  import { KyInstance } from "ky";
5
5
 
6
6
  //#region src/azure/url-parts.d.ts
7
7
  type AzureDevOpsOrganizationUrl = {
8
- /** URL of the organisation. This may lack the project name */
8
+ /** URL of the organization. This may lack the project name */
9
9
  value: URL;
10
- /** Organisation URL hostname */
10
+ /** Organization URL hostname */
11
11
  hostname: string;
12
- /** Organisation API endpoint URL */
12
+ /** Organization API endpoint URL */
13
13
  'api-endpoint': string;
14
- /** Organisation name/slug */
15
- organisation: string;
14
+ /** Organization name/slug */
15
+ organization: string;
16
16
  /** Virtual directory if present (on-premises only) */
17
17
  'virtual-directory'?: string;
18
18
  /**
@@ -38,23 +38,23 @@ type AzureDevOpsRepositoryUrl = AzureDevOpsProjectUrl & {
38
38
  'repository-slug': string;
39
39
  };
40
40
  declare function extractOrganizationUrl({
41
- organisationUrl
41
+ organizationUrl
42
42
  }: {
43
- organisationUrl: string;
43
+ organizationUrl: string;
44
44
  }): AzureDevOpsOrganizationUrl;
45
45
  declare function extractProjectUrl({
46
- organisationUrl,
46
+ organizationUrl,
47
47
  project
48
48
  }: {
49
- organisationUrl: string;
49
+ organizationUrl: string;
50
50
  project: string;
51
51
  }): AzureDevOpsProjectUrl;
52
52
  declare function extractRepositoryUrl({
53
- organisationUrl,
53
+ organizationUrl,
54
54
  project,
55
55
  repository
56
56
  }: {
57
- organisationUrl: string;
57
+ organizationUrl: string;
58
58
  project: string;
59
59
  repository: string;
60
60
  }): AzureDevOpsRepositoryUrl;
@@ -1,6 +1,6 @@
1
1
  import { n as logger } from "../logger-3Qfh9NUj.mjs";
2
2
  import { B as parseDependabotConfig, E as CONFIG_FILE_PATHS_AZURE, _ as DependabotPersistedPrSchema } from "../job-ClEevC5P.mjs";
3
- import { n as getDependencyNames, o as normalizeBranchName, s as normalizeFilePath, t as areEqual } from "../dependabot-DbKUmEV3.mjs";
3
+ import { n as getDependencyNames, o as normalizeBranchName, s as normalizeFilePath, t as areEqual } from "../dependabot-DAdoJJp4.mjs";
4
4
  import { z } from "zod";
5
5
  import ky, { isHTTPError } from "ky";
6
6
  import * as path from "node:path";
@@ -256,7 +256,7 @@ var AzureDevOpsClient = class AzureDevOpsClient {
256
256
  pullRequests;
257
257
  subscriptions;
258
258
  constructor(url, accessToken, debug = false) {
259
- this.organizationSlug = url.organisation;
259
+ this.organizationSlug = url.organization;
260
260
  const organizationUrl = url.value.toString().replace(/\/$/, "");
261
261
  this.organizationUrl = organizationUrl;
262
262
  const mainClientOptions = AzureDevOpsClient.createClientOptions(accessToken, debug, { prefixUrl: organizationUrl });
@@ -1220,40 +1220,40 @@ const AzdoEventSchema = z.object({
1220
1220
 
1221
1221
  //#endregion
1222
1222
  //#region src/azure/url-parts.ts
1223
- function extractOrganizationUrl({ organisationUrl }) {
1224
- const value = new URL(organisationUrl);
1223
+ function extractOrganizationUrl({ organizationUrl }) {
1224
+ const value = new URL(organizationUrl);
1225
1225
  const protocol = value.protocol.slice(0, -1);
1226
1226
  let { hostname } = value;
1227
1227
  if (/^(?<prefix>\S+)\.visualstudio\.com$/iu.test(hostname)) hostname = "dev.azure.com";
1228
- const organisation = extractOrganisation(organisationUrl);
1228
+ const organization = extractOrganization(organizationUrl);
1229
1229
  const virtualDirectory = extractVirtualDirectory(value);
1230
1230
  const apiEndpoint = `${protocol}://${hostname}${value.port ? `:${value.port}` : ""}/${virtualDirectory ? `${virtualDirectory}/` : ""}`;
1231
- const identityApiUrl = hostname === "dev.azure.com" || hostname.endsWith(".visualstudio.com") ? new URL(`https://vssps.dev.azure.com/${organisation}/`) : value;
1231
+ const identityApiUrl = hostname === "dev.azure.com" || hostname.endsWith(".visualstudio.com") ? new URL(`https://vssps.dev.azure.com/${organization}/`) : value;
1232
1232
  return {
1233
1233
  value,
1234
1234
  hostname,
1235
1235
  "api-endpoint": apiEndpoint,
1236
- organisation,
1236
+ organization,
1237
1237
  "virtual-directory": virtualDirectory,
1238
1238
  "identity-api-url": identityApiUrl
1239
1239
  };
1240
1240
  }
1241
- function extractProjectUrl({ organisationUrl, project }) {
1242
- const extracted = extractOrganizationUrl({ organisationUrl });
1241
+ function extractProjectUrl({ organizationUrl, project }) {
1242
+ const extracted = extractOrganizationUrl({ organizationUrl });
1243
1243
  const decodedProject = decodeURIComponent(project);
1244
1244
  return {
1245
1245
  ...extracted,
1246
1246
  project: decodedProject
1247
1247
  };
1248
1248
  }
1249
- function extractRepositoryUrl({ organisationUrl, project, repository }) {
1249
+ function extractRepositoryUrl({ organizationUrl, project, repository }) {
1250
1250
  const extracted = extractProjectUrl({
1251
- organisationUrl,
1251
+ organizationUrl,
1252
1252
  project
1253
1253
  });
1254
- const { organisation, "virtual-directory": virtualDirectory, project: decodedProject } = extracted;
1254
+ const { organization, "virtual-directory": virtualDirectory, project: decodedProject } = extracted;
1255
1255
  const decodedRepository = decodeURIComponent(repository);
1256
- const repoSlug = `${virtualDirectory ? `${virtualDirectory}/` : ""}${organisation}/${encodeURI(decodedProject)}/_git/${encodeURI(decodedRepository)}`;
1256
+ const repoSlug = `${virtualDirectory ? `${virtualDirectory}/` : ""}${organization}/${encodeURI(decodedProject)}/_git/${encodeURI(decodedRepository)}`;
1257
1257
  return {
1258
1258
  ...extracted,
1259
1259
  repository: decodedRepository,
@@ -1261,32 +1261,32 @@ function extractRepositoryUrl({ organisationUrl, project, repository }) {
1261
1261
  };
1262
1262
  }
1263
1263
  /**
1264
- * Extract organisation name from organisation URL
1264
+ * Extract organization name from organization URL
1265
1265
  *
1266
- * @param organisationUrl
1266
+ * @param organizationUrl
1267
1267
  *
1268
- * @returns organisation name
1268
+ * @returns organization name
1269
1269
  */
1270
- function extractOrganisation(organisationUrl) {
1271
- const { hostname, pathname } = new URL(organisationUrl);
1270
+ function extractOrganization(organizationUrl) {
1271
+ const { hostname, pathname } = new URL(organizationUrl);
1272
1272
  if (hostname.endsWith(".visualstudio.com")) return hostname.split(".")[0];
1273
1273
  const pathSegments = pathname.split("/").filter((segment) => segment !== "");
1274
1274
  if (pathSegments.length >= 2 && hostname !== "dev.azure.com") return pathSegments[1];
1275
1275
  if (pathSegments.length >= 1) return pathSegments[0];
1276
- throw new Error(`Error parsing organisation from organisation url: '${organisationUrl}'.`);
1276
+ throw new Error(`Error parsing organization from organization url: '${organizationUrl}'.`);
1277
1277
  }
1278
1278
  /**
1279
- * Extract virtual directory from organisation URL
1279
+ * Extract virtual directory from organization URL
1280
1280
  *
1281
1281
  * Virtual Directories are sometimes used in on-premises
1282
- * @param organisationUrl
1282
+ * @param organizationUrl
1283
1283
  *
1284
1284
  * @returns virtual directory
1285
1285
  *
1286
1286
  * @example URLs typically are like this:`https://server.domain.com/tfs/x/` and `tfs` is the virtual directory
1287
1287
  */
1288
- function extractVirtualDirectory(organisationUrl) {
1289
- const path$1 = organisationUrl.pathname.split("/");
1288
+ function extractVirtualDirectory(organizationUrl) {
1289
+ const path$1 = organizationUrl.pathname.split("/");
1290
1290
  return path$1.length === 4 ? path$1[1] : void 0;
1291
1291
  }
1292
1292