@tahminator/pipeline 1.0.7 → 1.0.8

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.
@@ -1,5 +1,5 @@
1
1
  import { $ } from "bun";
2
- import { cyan } from "../utils/colors";
2
+ import { Utils } from "../utils";
3
3
  export class DockerClient {
4
4
  username;
5
5
  constructor(username) {
@@ -46,7 +46,7 @@ export class DockerClient {
46
46
  throw new Error("You must provide atleast one tag.");
47
47
  }
48
48
  console.log("Building image with following tags:");
49
- tags.forEach((tag) => console.log(cyan(tag)));
49
+ tags.forEach((tag) => console.log(Utils.Colors.cyan(tag)));
50
50
  try {
51
51
  await $ `docker buildx create --use --name ${dockerRepository}-builder`;
52
52
  }
@@ -0,0 +1,9 @@
1
+ import { Colors } from "./colors";
2
+ import { getEnvVariables } from "./env";
3
+ import { generateShortId } from "./short";
4
+ export declare class Utils {
5
+ static Colors: typeof Colors;
6
+ static getEnvVariables(...args: Parameters<typeof getEnvVariables>): Promise<Record<string, string>>;
7
+ static generateShortId(...args: Parameters<typeof generateShortId>): string;
8
+ static updateAllPackageJsonsWithVersion(version: string): Promise<void>;
9
+ }
@@ -0,0 +1,26 @@
1
+ import { $ } from "bun";
2
+ import { Colors } from "./colors";
3
+ import { getEnvVariables } from "./env";
4
+ import { generateShortId } from "./short";
5
+ export class Utils {
6
+ // hoist
7
+ static Colors = Colors;
8
+ static getEnvVariables(...args) {
9
+ return getEnvVariables(...args);
10
+ }
11
+ static generateShortId(...args) {
12
+ return generateShortId(...args);
13
+ }
14
+ static async updateAllPackageJsonsWithVersion(version) {
15
+ const files = (await $ `find . -name "package.json" -not -path "*/node_modules/*"`.text())
16
+ .trim()
17
+ .split("\n");
18
+ for (const fileLocation of files) {
19
+ const file = Bun.file(fileLocation);
20
+ const pkg = await file.json();
21
+ pkg.version = version;
22
+ await Bun.write(fileLocation, JSON.stringify(pkg, null, 2) + "\n");
23
+ console.log(`Successfully updated version in ${fileLocation} to ${version}`);
24
+ }
25
+ }
26
+ }
@@ -1,22 +1,47 @@
1
- export declare function black(s: string): string;
2
- export declare function red(s: string): string;
3
- export declare function green(s: string): string;
4
- export declare function yellow(s: string): string;
5
- export declare function blue(s: string): string;
6
- export declare function magenta(s: string): string;
7
- export declare function cyan(s: string): string;
8
- export declare function white(s: string): string;
9
- export declare function gray(s: string): string;
10
- export declare function brightRed(s: string): string;
11
- export declare function brightGreen(s: string): string;
12
- export declare function brightYellow(s: string): string;
13
- export declare function brightBlue(s: string): string;
14
- export declare function brightMagenta(s: string): string;
15
- export declare function brightCyan(s: string): string;
16
- export declare function brightWhite(s: string): string;
17
- export declare function pink(s: string): string;
18
- export declare function orange(s: string): string;
19
- export declare function bold(s: string): string;
20
- export declare function dim(s: string): string;
21
- export declare function italic(s: string): string;
22
- export declare function underline(s: string): string;
1
+ export declare class Colors {
2
+ private static readonly BLACK;
3
+ private static readonly RED;
4
+ private static readonly GREEN;
5
+ private static readonly YELLOW;
6
+ private static readonly BLUE;
7
+ private static readonly MAGENTA;
8
+ private static readonly CYAN;
9
+ private static readonly WHITE;
10
+ private static readonly GRAY;
11
+ private static readonly BRIGHT_RED;
12
+ private static readonly BRIGHT_GREEN;
13
+ private static readonly BRIGHT_YELLOW;
14
+ private static readonly BRIGHT_BLUE;
15
+ private static readonly BRIGHT_MAGENTA;
16
+ private static readonly BRIGHT_CYAN;
17
+ private static readonly BRIGHT_WHITE;
18
+ private static readonly PINK;
19
+ private static readonly ORANGE;
20
+ private static readonly RESET;
21
+ private static readonly BOLD;
22
+ private static readonly DIM;
23
+ private static readonly ITALIC;
24
+ private static readonly UNDERLINE;
25
+ static black(s: string): string;
26
+ static red(s: string): string;
27
+ static green(s: string): string;
28
+ static yellow(s: string): string;
29
+ static blue(s: string): string;
30
+ static magenta(s: string): string;
31
+ static cyan(s: string): string;
32
+ static white(s: string): string;
33
+ static gray(s: string): string;
34
+ static brightRed(s: string): string;
35
+ static brightGreen(s: string): string;
36
+ static brightYellow(s: string): string;
37
+ static brightBlue(s: string): string;
38
+ static brightMagenta(s: string): string;
39
+ static brightCyan(s: string): string;
40
+ static brightWhite(s: string): string;
41
+ static pink(s: string): string;
42
+ static orange(s: string): string;
43
+ static bold(s: string): string;
44
+ static dim(s: string): string;
45
+ static italic(s: string): string;
46
+ static underline(s: string): string;
47
+ }
@@ -1,89 +1,91 @@
1
- export function black(s) {
2
- return `${BLACK}${s}${RESET}`;
1
+ export class Colors {
2
+ static BLACK = "\x1b[30m";
3
+ static RED = "\x1b[31m";
4
+ static GREEN = "\x1b[32m";
5
+ static YELLOW = "\x1b[33m";
6
+ static BLUE = "\x1b[34m";
7
+ static MAGENTA = "\x1b[35m";
8
+ static CYAN = "\x1b[36m";
9
+ static WHITE = "\x1b[37m";
10
+ static GRAY = "\x1b[90m";
11
+ static BRIGHT_RED = "\x1b[91m";
12
+ static BRIGHT_GREEN = "\x1b[92m";
13
+ static BRIGHT_YELLOW = "\x1b[93m";
14
+ static BRIGHT_BLUE = "\x1b[94m";
15
+ static BRIGHT_MAGENTA = "\x1b[95m";
16
+ static BRIGHT_CYAN = "\x1b[96m";
17
+ static BRIGHT_WHITE = "\x1b[97m";
18
+ static PINK = "\x1b[38;5;213m";
19
+ static ORANGE = "\x1b[38;5;214m";
20
+ static RESET = "\x1b[0m";
21
+ static BOLD = "\x1b[1m";
22
+ static DIM = "\x1b[2m";
23
+ static ITALIC = "\x1b[3m";
24
+ static UNDERLINE = "\x1b[4m";
25
+ static black(s) {
26
+ return `${Colors.BLACK}${s}${Colors.RESET}`;
27
+ }
28
+ static red(s) {
29
+ return `${Colors.RED}${s}${Colors.RESET}`;
30
+ }
31
+ static green(s) {
32
+ return `${Colors.GREEN}${s}${Colors.RESET}`;
33
+ }
34
+ static yellow(s) {
35
+ return `${Colors.YELLOW}${s}${Colors.RESET}`;
36
+ }
37
+ static blue(s) {
38
+ return `${Colors.BLUE}${s}${Colors.RESET}`;
39
+ }
40
+ static magenta(s) {
41
+ return `${Colors.MAGENTA}${s}${Colors.RESET}`;
42
+ }
43
+ static cyan(s) {
44
+ return `${Colors.CYAN}${s}${Colors.RESET}`;
45
+ }
46
+ static white(s) {
47
+ return `${Colors.WHITE}${s}${Colors.RESET}`;
48
+ }
49
+ static gray(s) {
50
+ return `${Colors.GRAY}${s}${Colors.RESET}`;
51
+ }
52
+ static brightRed(s) {
53
+ return `${Colors.BRIGHT_RED}${s}${Colors.RESET}`;
54
+ }
55
+ static brightGreen(s) {
56
+ return `${Colors.BRIGHT_GREEN}${s}${Colors.RESET}`;
57
+ }
58
+ static brightYellow(s) {
59
+ return `${Colors.BRIGHT_YELLOW}${s}${Colors.RESET}`;
60
+ }
61
+ static brightBlue(s) {
62
+ return `${Colors.BRIGHT_BLUE}${s}${Colors.RESET}`;
63
+ }
64
+ static brightMagenta(s) {
65
+ return `${Colors.BRIGHT_MAGENTA}${s}${Colors.RESET}`;
66
+ }
67
+ static brightCyan(s) {
68
+ return `${Colors.BRIGHT_CYAN}${s}${Colors.RESET}`;
69
+ }
70
+ static brightWhite(s) {
71
+ return `${Colors.BRIGHT_WHITE}${s}${Colors.RESET}`;
72
+ }
73
+ static pink(s) {
74
+ return `${Colors.PINK}${s}${Colors.RESET}`;
75
+ }
76
+ static orange(s) {
77
+ return `${Colors.ORANGE}${s}${Colors.RESET}`;
78
+ }
79
+ static bold(s) {
80
+ return `${Colors.BOLD}${s}${Colors.RESET}`;
81
+ }
82
+ static dim(s) {
83
+ return `${Colors.DIM}${s}${Colors.RESET}`;
84
+ }
85
+ static italic(s) {
86
+ return `${Colors.ITALIC}${s}${Colors.RESET}`;
87
+ }
88
+ static underline(s) {
89
+ return `${Colors.UNDERLINE}${s}${Colors.RESET}`;
90
+ }
3
91
  }
4
- export function red(s) {
5
- return `${RED}${s}${RESET}`;
6
- }
7
- export function green(s) {
8
- return `${GREEN}${s}${RESET}`;
9
- }
10
- export function yellow(s) {
11
- return `${YELLOW}${s}${RESET}`;
12
- }
13
- export function blue(s) {
14
- return `${BLUE}${s}${RESET}`;
15
- }
16
- export function magenta(s) {
17
- return `${MAGENTA}${s}${RESET}`;
18
- }
19
- export function cyan(s) {
20
- return `${CYAN}${s}${RESET}`;
21
- }
22
- export function white(s) {
23
- return `${WHITE}${s}${RESET}`;
24
- }
25
- export function gray(s) {
26
- return `${GRAY}${s}${RESET}`;
27
- }
28
- export function brightRed(s) {
29
- return `${BRIGHT_RED}${s}${RESET}`;
30
- }
31
- export function brightGreen(s) {
32
- return `${BRIGHT_GREEN}${s}${RESET}`;
33
- }
34
- export function brightYellow(s) {
35
- return `${BRIGHT_YELLOW}${s}${RESET}`;
36
- }
37
- export function brightBlue(s) {
38
- return `${BRIGHT_BLUE}${s}${RESET}`;
39
- }
40
- export function brightMagenta(s) {
41
- return `${BRIGHT_MAGENTA}${s}${RESET}`;
42
- }
43
- export function brightCyan(s) {
44
- return `${BRIGHT_CYAN}${s}${RESET}`;
45
- }
46
- export function brightWhite(s) {
47
- return `${BRIGHT_WHITE}${s}${RESET}`;
48
- }
49
- export function pink(s) {
50
- return `${PINK}${s}${RESET}`;
51
- }
52
- export function orange(s) {
53
- return `${ORANGE}${s}${RESET}`;
54
- }
55
- export function bold(s) {
56
- return `${BOLD}${s}${RESET}`;
57
- }
58
- export function dim(s) {
59
- return `${DIM}${s}${RESET}`;
60
- }
61
- export function italic(s) {
62
- return `${ITALIC}${s}${RESET}`;
63
- }
64
- export function underline(s) {
65
- return `${UNDERLINE}${s}${RESET}`;
66
- }
67
- const BLACK = "\x1b[30m";
68
- const RED = "\x1b[31m";
69
- const GREEN = "\x1b[32m";
70
- const YELLOW = "\x1b[33m";
71
- const BLUE = "\x1b[34m";
72
- const MAGENTA = "\x1b[35m";
73
- const CYAN = "\x1b[36m";
74
- const WHITE = "\x1b[37m";
75
- const GRAY = "\x1b[90m";
76
- const BRIGHT_RED = "\x1b[91m";
77
- const BRIGHT_GREEN = "\x1b[92m";
78
- const BRIGHT_YELLOW = "\x1b[93m";
79
- const BRIGHT_BLUE = "\x1b[94m";
80
- const BRIGHT_MAGENTA = "\x1b[95m";
81
- const BRIGHT_CYAN = "\x1b[96m";
82
- const BRIGHT_WHITE = "\x1b[97m";
83
- const PINK = "\x1b[38;5;213m";
84
- const ORANGE = "\x1b[38;5;214m";
85
- const RESET = "\x1b[0m";
86
- const BOLD = "\x1b[1m";
87
- const DIM = "\x1b[2m";
88
- const ITALIC = "\x1b[3m";
89
- const UNDERLINE = "\x1b[4m";
@@ -1,6 +1 @@
1
- import { getEnvVariables } from "./env";
2
- import { generateShortId } from "./short";
3
- export declare class Utils {
4
- static getEnvVariables(...args: Parameters<typeof getEnvVariables>): Promise<Record<string, string>>;
5
- static generateShortId(...args: Parameters<typeof generateShortId>): string;
6
- }
1
+ export * from "./client";
@@ -1,10 +1 @@
1
- import { getEnvVariables } from "./env";
2
- import { generateShortId } from "./short";
3
- export class Utils {
4
- static getEnvVariables(...args) {
5
- return getEnvVariables(...args);
6
- }
7
- static generateShortId(...args) {
8
- return generateShortId(...args);
9
- }
10
- }
1
+ export * from "./client";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tahminator/pipeline",
3
3
  "type": "module",
4
- "version": "1.0.7",
4
+ "version": "1.0.8",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",