@tahminator/pipeline 1.0.78-beta.1e2228eb → 1.0.78-beta.2a7182af

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
@@ -234,8 +234,6 @@ The publisher generates `go.mod` using the deepest shared directory of the gener
234
234
 
235
235
  Go publishing requires `go` and `zip` on PATH. It stages generated packages without changing the original output, runs `go mod init` and `go mod tidy` to generate dependency metadata, and uploads `.mod` and `.zip` artifacts to the hosted `go` repository at `<backend.url>/go/go`. It does not lint, build, or test generated code. Dependency resolution may require network access. Versions may include a leading `v`; v2+ modules require the corresponding major-version module path suffix.
236
236
 
237
- Java generation is pinned to the compiler release matching `protobufJavaVersion` (default runtime `4.32.1`, Buf Java plugin `v32.1`). The same runtime version is used in both Maven and Gradle metadata. Overrides must be exact stable versions, not ranges, and the corresponding plugin must exist in the Buf registry.
238
-
239
237
  ### `NPMClient`
240
238
 
241
239
  Interface with NPM registry in order to publish packages to `npmjs.com`
@@ -3,8 +3,8 @@ import { mkdir, mkdtemp, readdir, rename, rm, writeFile, } from "node:fs/promise
3
3
  import { tmpdir } from "node:os";
4
4
  import path from "node:path";
5
5
  import { ProtobufTargetLanguage, } from "../types";
6
- import { DEFAULT_PROTOBUF_JAVA_VERSION } from "../versions";
7
6
  import { ArtifactKeeperGoPublisher } from "./go";
7
+ const DEFAULT_PROTOBUF_JAVA_VERSION = "4.32.1";
8
8
  const DEFAULT_PROST_VERSION = "0.14";
9
9
  export class ArtifactKeeperProtobufCompilerBackend {
10
10
  config;
@@ -67,12 +67,7 @@ export class ArtifactKeeperProtobufCompilerBackend {
67
67
  writeFile(path.join(generatedDirectory, "Cargo.toml"), this.createCargoToml(options)),
68
68
  writeFile(path.join(generatedDirectory, "src", "lib.rs"), this.createRustLibrary(generatedFiles)),
69
69
  ]);
70
- await $.env({
71
- ...process.env,
72
- CARGO_REGISTRIES_CARGO_INDEX: this.cargoIndexUrl,
73
- CARGO_REGISTRIES_CARGO_TOKEN: this.config.token,
74
- CARGO_REGISTRIES_CARGO_CREDENTIAL_PROVIDER: "cargo:token",
75
- }) `cargo publish --registry cargo`.cwd(generatedDirectory);
70
+ await $ `cargo publish --registry cargo --token ${this.config.token} --config ${`registries.cargo.index=${this.cargoIndexUrl}`}`.cwd(generatedDirectory);
76
71
  }
77
72
  async moveJavaSources(generatedDirectory) {
78
73
  const sourceDirectory = path.join(generatedDirectory, "src", "main", "java");
@@ -198,7 +193,6 @@ edition = "2021"
198
193
 
199
194
  [dependencies]
200
195
  prost = "${prostVersion}"
201
- prost-types = "${prostVersion}"
202
196
  `;
203
197
  }
204
198
  createRustLibrary(generatedFiles) {
@@ -239,6 +233,6 @@ prost-types = "${prostVersion}"
239
233
  return `${this.artifactKeeperUrl}/maven/maven/`;
240
234
  }
241
235
  get cargoIndexUrl() {
242
- return `sparse+${this.artifactKeeperUrl}/cargo/cargo/`;
236
+ return `${this.artifactKeeperUrl}/cargo/cargo/index`;
243
237
  }
244
238
  }
@@ -8,7 +8,7 @@ import { createProtobufCompilerBackendStrategy } from "./backend";
8
8
  import { GoProtobufTargetLanguageStrategy, JavaProtobufTargetLanguageStrategy, RustProtobufTargetLanguageStrategy, } from "./strategy";
9
9
  import { ProtobufTargetLanguage, } from "./types";
10
10
  const TARGET_LANGUAGE_STRATEGY_FACTORIES = {
11
- [ProtobufTargetLanguage.JAVA]: (targets) => new JavaProtobufTargetLanguageStrategy(targets[ProtobufTargetLanguage.JAVA]?.protobufJavaVersion),
11
+ [ProtobufTargetLanguage.JAVA]: () => new JavaProtobufTargetLanguageStrategy(),
12
12
  [ProtobufTargetLanguage.GO]: () => new GoProtobufTargetLanguageStrategy(),
13
13
  [ProtobufTargetLanguage.RUST]: () => new RustProtobufTargetLanguageStrategy(),
14
14
  };
@@ -80,7 +80,7 @@ export class ProtobufCompilerClient {
80
80
  return this.getConfiguredTargetLanguages(targetLanguages).map(([language, options]) => ({
81
81
  language,
82
82
  options,
83
- strategy: TARGET_LANGUAGE_STRATEGY_FACTORIES[language](targetLanguages),
83
+ strategy: TARGET_LANGUAGE_STRATEGY_FACTORIES[language](),
84
84
  }));
85
85
  }
86
86
  getConfiguredTargetLanguages(targetLanguages) {
@@ -1,6 +1,5 @@
1
1
  import type { IProtobufTargetLanguageStrategy } from "./types";
2
2
  export declare class JavaProtobufTargetLanguageStrategy implements IProtobufTargetLanguageStrategy {
3
3
  readonly outputDirectoryName = "java";
4
- readonly remotePlugin: string;
5
- constructor(runtimeVersion?: string);
4
+ readonly remotePlugin = "buf.build/protocolbuffers/java";
6
5
  }
@@ -1,8 +1,4 @@
1
- import { DEFAULT_PROTOBUF_JAVA_VERSION, javaGeneratorVersion, } from "../versions";
2
1
  export class JavaProtobufTargetLanguageStrategy {
3
2
  outputDirectoryName = "java";
4
- remotePlugin;
5
- constructor(runtimeVersion = DEFAULT_PROTOBUF_JAVA_VERSION) {
6
- this.remotePlugin = `buf.build/protocolbuffers/java:v${javaGeneratorVersion(runtimeVersion)}`;
7
- }
3
+ remotePlugin = "buf.build/protocolbuffers/java";
8
4
  }
@@ -22,7 +22,6 @@ export interface ProtobufJavaTargetLanguageOptions {
22
22
  artifactId: string;
23
23
  version: string;
24
24
  buildTool?: "maven" | "gradle";
25
- /** Exact stable Java runtime version; also pins the matching Buf generator. Defaults to 4.32.1. */
26
25
  protobufJavaVersion?: string;
27
26
  }
28
27
  export interface ProtobufRustTargetLanguageOptions {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "type": "module",
4
4
  "author": "Tahmid Ahmed",
5
5
  "description": "A collection of Bun shell scripts that can be re-used in various CICD pipelines.",
6
- "version": "1.0.78-beta.1e2228eb",
6
+ "version": "1.0.78-beta.2a7182af",
7
7
  "repository": {
8
8
  "url": "git+https://github.com/tahminator/pipeline.git"
9
9
  },
@@ -1,3 +0,0 @@
1
- export declare const DEFAULT_PROTOBUF_JAVA_VERSION = "4.32.1";
2
- /** Java runtime releases include a language major absent from modern protoc tags. */
3
- export declare function javaGeneratorVersion(runtimeVersion: string): string;
@@ -1,13 +0,0 @@
1
- export const DEFAULT_PROTOBUF_JAVA_VERSION = "4.32.1";
2
- /** Java runtime releases include a language major absent from modern protoc tags. */
3
- export function javaGeneratorVersion(runtimeVersion) {
4
- const match = /^(3|4)\.(\d+)\.(\d+)$/.exec(runtimeVersion);
5
- if (!match) {
6
- throw new Error("protobufJavaVersion must be an exact stable 3.x or 4.x version.");
7
- }
8
- const [, major, minor, patch] = match;
9
- // Before protoc 21, compiler and Java runtime used the same 3.x version.
10
- return major === "3" && Number(minor) < 21 ?
11
- runtimeVersion
12
- : `${minor}.${patch}`;
13
- }