Skip to content

Commit

Permalink
feat: add notification of generation and copied files,
Browse files Browse the repository at this point in the history
as well as formatting of generated files
  • Loading branch information
mineejo committed Dec 12, 2023
1 parent 2213e9d commit d8a8d17
Show file tree
Hide file tree
Showing 125 changed files with 385 additions and 271 deletions.
11 changes: 10 additions & 1 deletion _wrapper/wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,18 @@ try {
let text: string = new TextDecoder().decode(data);

// Unreliable, but it works to overwrite paths of recreated files.
text = text.replace(/(\.\.\/)+/mg, ROOT_DIR);
text = text.replace(/(\.\.\/)+/mg, ROOT_DIR).replace(
thisFileCopyright,
`${thisFileCopyright}\n\n` + `${WARNING}\n\n`,
);

data = new TextEncoder().encode(text);

if (fileInBlacklist(entry.name)) continue;
fileExports.push(`export * from ".${sep}${join(dir, entry.name)}";`);
await Deno.writeFile(join(ROOT_DIR, dir, entry.name), data);

new Deno.Command(`deno fmt ${join(ROOT_DIR, dir, entry.name)}`);
}
}
} catch (error) {
Expand Down Expand Up @@ -185,6 +191,7 @@ try {
if (fileInBlacklist(file)) continue;
fileExports.push(`export * from ".${sep}${file}";`);
await Deno.writeFile(join(ROOT_DIR, file), data);
new Deno.Command(`deno fmt ${join(ROOT_DIR, file)}`);
}
} catch (error) {
console.error(error);
Expand All @@ -199,6 +206,8 @@ try {
`${thisFileCopyright}\n\n` + `${WARNING}\n\n` + fileExports.join("\n"),
),
);

new Deno.Command(`deno fmt ${join(ROOT_DIR, INDEX_FILE)}`);
} catch (error) {
console.error(error);
}
5 changes: 5 additions & 0 deletions ansi16/ansi16_to_ansi8.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// Copyright 2023 mineejo. All rights reserved. MIT license.

// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts



import { Ansi16, Ansi8 } from "../color_formats.ts";
import { clamp } from "../util.ts";

Expand Down
4 changes: 2 additions & 2 deletions ansi256/ansi256_to_ansi16.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts

import { Ansi16, Ansi256 } from "../color_formats.ts";
import { Ansi256, Ansi16 } from "../color_formats.ts";
import { ansi256ToRgb } from "./ansi256_to_rgb.ts";
import { rgbToAnsi16 } from "../rgb/rgb_to_ansi16.ts";

export function ansi256ToAnsi16(...components: Ansi256): Ansi16 {
return rgbToAnsi16(...ansi256ToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion ansi256/ansi256_to_cmy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToCmy } from "../rgb/rgb_to_cmy.ts";

export function ansi256ToCmy(...components: Ansi256): Cmy {
return rgbToCmy(...ansi256ToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion ansi256/ansi256_to_cmyk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToCmyk } from "../rgb/rgb_to_cmyk.ts";

export function ansi256ToCmyk(...components: Ansi256): Cmyk {
return rgbToCmyk(...ansi256ToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion ansi256/ansi256_to_hex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHex } from "../rgb/rgb_to_hex.ts";

export function ansi256ToHex(...components: Ansi256): Hex {
return rgbToHex(...ansi256ToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion ansi256/ansi256_to_hsb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHsb } from "../rgb/rgb_to_hsb.ts";

export function ansi256ToHsb(...components: Ansi256): Hsb {
return rgbToHsb(...ansi256ToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion ansi256/ansi256_to_hsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHsl } from "../rgb/rgb_to_hsl.ts";

export function ansi256ToHsl(...components: Ansi256): Hsl {
return rgbToHsl(...ansi256ToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion ansi256/ansi256_to_hsv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHsv } from "../rgb/rgb_to_hsv.ts";

export function ansi256ToHsv(...components: Ansi256): Hsv {
return rgbToHsv(...ansi256ToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion ansi256/ansi256_to_lab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToLab } from "../rgb/rgb_to_lab.ts";

export function ansi256ToLab(...components: Ansi256): Lab {
return rgbToLab(...ansi256ToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion ansi256/ansi256_to_name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToName } from "../rgb/rgb_to_name.ts";

export function ansi256ToName(...components: Ansi256): Name {
return rgbToName(...ansi256ToRgb(...components));
}
}
5 changes: 5 additions & 0 deletions ansi256/ansi256_to_rgb.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// Copyright 2023 mineejo. All rights reserved. MIT license.

// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts



import { Ansi256, Rgb } from "../color_formats.ts";
import { clamp } from "../util.ts";

Expand Down
2 changes: 1 addition & 1 deletion ansi256/ansi256_to_xyz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToXyz } from "../rgb/rgb_to_xyz.ts";

export function ansi256ToXyz(...components: Ansi256): Xyz {
return rgbToXyz(...ansi256ToRgb(...components));
}
}
4 changes: 2 additions & 2 deletions cmy/cmy_to_ansi16.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts

import { Ansi16, Cmy } from "../color_formats.ts";
import { Cmy, Ansi16 } from "../color_formats.ts";
import { cmyToRgb } from "./cmy_to_rgb.ts";
import { rgbToAnsi16 } from "../rgb/rgb_to_ansi16.ts";

export function cmyToAnsi16(...components: Cmy): Ansi16 {
return rgbToAnsi16(...cmyToRgb(...components));
}
}
4 changes: 2 additions & 2 deletions cmy/cmy_to_ansi256.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts

import { Ansi256, Cmy } from "../color_formats.ts";
import { Cmy, Ansi256 } from "../color_formats.ts";
import { cmyToRgb } from "./cmy_to_rgb.ts";
import { rgbToAnsi256 } from "../rgb/rgb_to_ansi256.ts";

export function cmyToAnsi256(...components: Cmy): Ansi256 {
return rgbToAnsi256(...cmyToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmy/cmy_to_cmyk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToCmyk } from "../rgb/rgb_to_cmyk.ts";

export function cmyToCmyk(...components: Cmy): Cmyk {
return rgbToCmyk(...cmyToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmy/cmy_to_hex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHex } from "../rgb/rgb_to_hex.ts";

export function cmyToHex(...components: Cmy): Hex {
return rgbToHex(...cmyToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmy/cmy_to_hsb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHsb } from "../rgb/rgb_to_hsb.ts";

export function cmyToHsb(...components: Cmy): Hsb {
return rgbToHsb(...cmyToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmy/cmy_to_hsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHsl } from "../rgb/rgb_to_hsl.ts";

export function cmyToHsl(...components: Cmy): Hsl {
return rgbToHsl(...cmyToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmy/cmy_to_hsv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHsv } from "../rgb/rgb_to_hsv.ts";

export function cmyToHsv(...components: Cmy): Hsv {
return rgbToHsv(...cmyToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmy/cmy_to_lab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToLab } from "../rgb/rgb_to_lab.ts";

export function cmyToLab(...components: Cmy): Lab {
return rgbToLab(...cmyToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmy/cmy_to_name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToName } from "../rgb/rgb_to_name.ts";

export function cmyToName(...components: Cmy): Name {
return rgbToName(...cmyToRgb(...components));
}
}
5 changes: 5 additions & 0 deletions cmy/cmy_to_rgb.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// Copyright 2023 mineejo. All rights reserved. MIT license.

// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts



import { Cmy, Rgb } from "../color_formats.ts";
import { percent } from "../util.ts";

Expand Down
2 changes: 1 addition & 1 deletion cmy/cmy_to_xyz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToXyz } from "../rgb/rgb_to_xyz.ts";

export function cmyToXyz(...components: Cmy): Xyz {
return rgbToXyz(...cmyToRgb(...components));
}
}
4 changes: 2 additions & 2 deletions cmyk/cmyk_to_ansi16.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts

import { Ansi16, Cmyk } from "../color_formats.ts";
import { Cmyk, Ansi16 } from "../color_formats.ts";
import { cmykToRgb } from "./cmyk_to_rgb.ts";
import { rgbToAnsi16 } from "../rgb/rgb_to_ansi16.ts";

export function cmykToAnsi16(...components: Cmyk): Ansi16 {
return rgbToAnsi16(...cmykToRgb(...components));
}
}
4 changes: 2 additions & 2 deletions cmyk/cmyk_to_ansi256.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts

import { Ansi256, Cmyk } from "../color_formats.ts";
import { Cmyk, Ansi256 } from "../color_formats.ts";
import { cmykToRgb } from "./cmyk_to_rgb.ts";
import { rgbToAnsi256 } from "../rgb/rgb_to_ansi256.ts";

export function cmykToAnsi256(...components: Cmyk): Ansi256 {
return rgbToAnsi256(...cmykToRgb(...components));
}
}
4 changes: 2 additions & 2 deletions cmyk/cmyk_to_cmy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts

import { Cmy, Cmyk } from "../color_formats.ts";
import { Cmyk, Cmy } from "../color_formats.ts";
import { cmykToRgb } from "./cmyk_to_rgb.ts";
import { rgbToCmy } from "../rgb/rgb_to_cmy.ts";

export function cmykToCmy(...components: Cmyk): Cmy {
return rgbToCmy(...cmykToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmyk/cmyk_to_hex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHex } from "../rgb/rgb_to_hex.ts";

export function cmykToHex(...components: Cmyk): Hex {
return rgbToHex(...cmykToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmyk/cmyk_to_hsb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHsb } from "../rgb/rgb_to_hsb.ts";

export function cmykToHsb(...components: Cmyk): Hsb {
return rgbToHsb(...cmykToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmyk/cmyk_to_hsl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHsl } from "../rgb/rgb_to_hsl.ts";

export function cmykToHsl(...components: Cmyk): Hsl {
return rgbToHsl(...cmykToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmyk/cmyk_to_hsv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHsv } from "../rgb/rgb_to_hsv.ts";

export function cmykToHsv(...components: Cmyk): Hsv {
return rgbToHsv(...cmykToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmyk/cmyk_to_lab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToLab } from "../rgb/rgb_to_lab.ts";

export function cmykToLab(...components: Cmyk): Lab {
return rgbToLab(...cmykToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion cmyk/cmyk_to_name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToName } from "../rgb/rgb_to_name.ts";

export function cmykToName(...components: Cmyk): Name {
return rgbToName(...cmykToRgb(...components));
}
}
5 changes: 5 additions & 0 deletions cmyk/cmyk_to_rgb.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// Copyright 2023 mineejo. All rights reserved. MIT license.

// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts



import { Cmyk, Rgb } from "../color_formats.ts";
import { percent } from "../util.ts";

Expand Down
2 changes: 1 addition & 1 deletion cmyk/cmyk_to_xyz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToXyz } from "../rgb/rgb_to_xyz.ts";

export function cmykToXyz(...components: Cmyk): Xyz {
return rgbToXyz(...cmykToRgb(...components));
}
}
4 changes: 2 additions & 2 deletions hex/hex_to_ansi16.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts

import { Ansi16, Hex } from "../color_formats.ts";
import { Hex, Ansi16 } from "../color_formats.ts";
import { hexToRgb } from "./hex_to_rgb.ts";
import { rgbToAnsi16 } from "../rgb/rgb_to_ansi16.ts";

export function hexToAnsi16(...components: Hex): Ansi16 {
return rgbToAnsi16(...hexToRgb(...components));
}
}
4 changes: 2 additions & 2 deletions hex/hex_to_ansi256.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts

import { Ansi256, Hex } from "../color_formats.ts";
import { Hex, Ansi256 } from "../color_formats.ts";
import { hexToRgb } from "./hex_to_rgb.ts";
import { rgbToAnsi256 } from "../rgb/rgb_to_ansi256.ts";

export function hexToAnsi256(...components: Hex): Ansi256 {
return rgbToAnsi256(...hexToRgb(...components));
}
}
4 changes: 2 additions & 2 deletions hex/hex_to_cmy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts

import { Cmy, Hex } from "../color_formats.ts";
import { Hex, Cmy } from "../color_formats.ts";
import { hexToRgb } from "./hex_to_rgb.ts";
import { rgbToCmy } from "../rgb/rgb_to_cmy.ts";

export function hexToCmy(...components: Hex): Cmy {
return rgbToCmy(...hexToRgb(...components));
}
}
4 changes: 2 additions & 2 deletions hex/hex_to_cmyk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
// File generated automatically!
// Generation script: /color_convert/_wrapper/wrapper.ts

import { Cmyk, Hex } from "../color_formats.ts";
import { Hex, Cmyk } from "../color_formats.ts";
import { hexToRgb } from "./hex_to_rgb.ts";
import { rgbToCmyk } from "../rgb/rgb_to_cmyk.ts";

export function hexToCmyk(...components: Hex): Cmyk {
return rgbToCmyk(...hexToRgb(...components));
}
}
2 changes: 1 addition & 1 deletion hex/hex_to_hsb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ import { rgbToHsb } from "../rgb/rgb_to_hsb.ts";

export function hexToHsb(...components: Hex): Hsb {
return rgbToHsb(...hexToRgb(...components));
}
}
Loading

0 comments on commit d8a8d17

Please sign in to comment.