@tahminator/pipeline 1.0.104-beta.ge434d50a → 1.0.104
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 +0 -12
- package/dist/postgres/client.d.ts +0 -2
- package/dist/postgres/client.js +1 -14
- package/dist/postgres/types.d.ts +0 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -552,15 +552,6 @@ With `INSTALL_PNPM: "true"`, set `PNPM_CACHE: "true"` to cache the pnpm store. `
|
|
|
552
552
|
INSTALL_MIGRATE: "true"
|
|
553
553
|
```
|
|
554
554
|
|
|
555
|
-
`INSTALL_GOLANGCI_LINT: "true"` installs the [golangci-lint](https://golangci-lint.run) linux-amd64 release binary to `/usr/local/bin`. Pin the version with `GOLANGCI_LINT_VERSION` (default `2.15.0`, without the `v` prefix).
|
|
556
|
-
|
|
557
|
-
```yaml
|
|
558
|
-
- uses: tahminator/pipeline/actions/setup@<version>
|
|
559
|
-
with:
|
|
560
|
-
INSTALL_GOLANGCI_LINT: "true"
|
|
561
|
-
GOLANGCI_LINT_VERSION: "2.15.0"
|
|
562
|
-
```
|
|
563
|
-
|
|
564
555
|
### `NPMClient`
|
|
565
556
|
|
|
566
557
|
Interface with NPM registry in order to publish packages to `npmjs.com`
|
|
@@ -774,15 +765,12 @@ Spin up a disposable local Postgres instance via Docker. Useful for running migr
|
|
|
774
765
|
|
|
775
766
|
Each call to `create()` gets a unique container name and a Docker-assigned host port, so multiple instances can coexist without conflict.
|
|
776
767
|
|
|
777
|
-
The container runs `postgres:16-alpine` by default. Pass `version` to choose another image, either a major (`18`) or a major.minor (`"18.1"`); versions below 16 are rejected.
|
|
778
|
-
|
|
779
768
|
```ts
|
|
780
769
|
import { $ } from "bun";
|
|
781
770
|
|
|
782
771
|
async function main() {
|
|
783
772
|
await using pgClient = await LocalPostgresClient.create({
|
|
784
773
|
database: "instalock-server-acceptance",
|
|
785
|
-
version: 18,
|
|
786
774
|
});
|
|
787
775
|
|
|
788
776
|
// get credentials
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { PostgresInternalState, PostgresState } from "./types";
|
|
2
2
|
export declare class LocalPostgresClient {
|
|
3
3
|
private readonly iState;
|
|
4
|
-
private static readonly MIN_VERSION;
|
|
5
4
|
private constructor();
|
|
6
5
|
/**
|
|
7
6
|
* Spin up a local Postgres instance via Docker.
|
|
@@ -30,7 +29,6 @@ export declare class LocalPostgresClient {
|
|
|
30
29
|
* ```
|
|
31
30
|
*/
|
|
32
31
|
static create(state: PostgresState): Promise<LocalPostgresClient>;
|
|
33
|
-
private static resolveVersion;
|
|
34
32
|
private static launch;
|
|
35
33
|
private static waitUntilReady;
|
|
36
34
|
get state(): PostgresInternalState;
|
package/dist/postgres/client.js
CHANGED
|
@@ -2,7 +2,6 @@ import { $, randomUUIDv7 } from "bun";
|
|
|
2
2
|
import { Utils } from "../utils";
|
|
3
3
|
export class LocalPostgresClient {
|
|
4
4
|
iState;
|
|
5
|
-
static MIN_VERSION = 16;
|
|
6
5
|
constructor(iState) {
|
|
7
6
|
this.iState = iState;
|
|
8
7
|
}
|
|
@@ -35,7 +34,6 @@ export class LocalPostgresClient {
|
|
|
35
34
|
static async create(state) {
|
|
36
35
|
const iState = {
|
|
37
36
|
...state,
|
|
38
|
-
version: this.resolveVersion(state.version),
|
|
39
37
|
user: "postgres",
|
|
40
38
|
password: "postgres",
|
|
41
39
|
port: 5432,
|
|
@@ -47,17 +45,6 @@ export class LocalPostgresClient {
|
|
|
47
45
|
await this.waitUntilReady(iState);
|
|
48
46
|
return new this(iState);
|
|
49
47
|
}
|
|
50
|
-
static resolveVersion(version) {
|
|
51
|
-
if (version === undefined) {
|
|
52
|
-
return String(this.MIN_VERSION);
|
|
53
|
-
}
|
|
54
|
-
const resolved = String(version);
|
|
55
|
-
const match = resolved.match(/^(\d+)(\.\d+)?$/);
|
|
56
|
-
if (!match || Number(match[1]) < this.MIN_VERSION) {
|
|
57
|
-
throw new Error(`Unsupported Postgres version "${resolved}": expected a major or major.minor version of ${this.MIN_VERSION} or newer.`);
|
|
58
|
-
}
|
|
59
|
-
return resolved;
|
|
60
|
-
}
|
|
61
48
|
static async launch(iState) {
|
|
62
49
|
await $ `docker run -d \
|
|
63
50
|
--name ${iState.dockerName} \
|
|
@@ -65,7 +52,7 @@ export class LocalPostgresClient {
|
|
|
65
52
|
-e POSTGRES_PASSWORD=${iState.password} \
|
|
66
53
|
-e POSTGRES_DB=${iState.database} \
|
|
67
54
|
-p 5432 \
|
|
68
|
-
mirror.gcr.io/library/postgres
|
|
55
|
+
mirror.gcr.io/library/postgres:16-alpine`;
|
|
69
56
|
const raw = (await $ `docker port ${iState.dockerName} 5432/tcp`.text()).trim();
|
|
70
57
|
const match = raw.match(/:(\d+)/);
|
|
71
58
|
if (!match) {
|
package/dist/postgres/types.d.ts
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
export interface PostgresState {
|
|
2
2
|
database: string;
|
|
3
|
-
/**
|
|
4
|
-
* Postgres image version, either a major (`18`) or a major.minor (`"18.1"`).
|
|
5
|
-
* Must be 16 or newer. Defaults to 16.
|
|
6
|
-
*/
|
|
7
|
-
version?: number | string;
|
|
8
3
|
}
|
|
9
4
|
export interface PostgresInternalState extends PostgresState {
|
|
10
|
-
version: string;
|
|
11
5
|
port: number;
|
|
12
6
|
host: string;
|
|
13
7
|
user: string;
|
package/package.json
CHANGED