Skip to content

Commit d2322a9

Browse files
authored
🔥 Remove enogu/tiny (#7)
1 parent 509a97a commit d2322a9

8 files changed

+35
-224
lines changed

‎build_npm.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { emptyDir } from "@std/fs";
77

88
// setup
99
const outDir = "npm";
10-
const fileList = ["colors", "tiny"];
10+
const fileList = ["colors"];
1111

1212
const entryPoints = fileList.map((file) => `${outDir}/${file}.ts`);
1313

@@ -32,11 +32,6 @@ const packageJson = {
3232
import: "./esm/colors.mjs",
3333
require: "./cjs/colors.cjs",
3434
},
35-
"./tiny": {
36-
types: "./types/tiny.d.ts",
37-
import: "./esm/tiny.mjs",
38-
require: "./cjs/tiny.cjs",
39-
},
4035
},
4136
devDependencies: {},
4237
};

‎deno.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"build:npm": "deno run --allow-env --allow-sys --allow-run --allow-write=npm --allow-read build_npm.ts"
55
},
66
"exclude": ["npm"],
7-
"workspaces": ["./src"],
7+
"workspace": ["./src"],
88
"imports": {
99
"@david/dts-minify": "jsr:@david/dts-minify@^0.3.3",
1010
"@std/assert": "jsr:@std/assert@^0.224.0",

‎deno.lock

+16-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/README.md

-22
Original file line numberDiff line numberDiff line change
@@ -33,25 +33,3 @@ console.log(red("Hello, world!"));
3333
- Support `NO_COLOR` environment variable
3434
- Comaptible with any JavaScript runtime, including Deno, Node.js and Bun
3535
- Available from multiple JavaScript registries(npm, jsr and deno.land/x)
36-
37-
## Benchmarks
38-
39-
**enogu** is faster than other similar libraries.
40-
41-
```bash
42-
/bench/complex_bench.ts
43-
benchmark time (avg) iter/s (min … max) p75 p99 p995
44-
---------------------------------------------------------------- -----------------------------
45-
deno/std 1.59 µs/iter 628,433.8 (1.56 µs … 1.65 µs) 1.6 µs 1.65 µs 1.65 µs
46-
chalk 280.4 ns/iter 3,566,397.1 (269.48 ns … 357.42 ns) 282.9 ns 340.04 ns 357.42 ns
47-
picocolors 65.8 ns/iter 15,197,757.4 (61.56 ns … 141.08 ns) 63.8 ns 117.19 ns 119.7 ns
48-
enogu 50.87 ns/iter 19,657,336.8 (40.48 ns … 165.85 ns) 50.13 ns 133.06 ns 137.79 ns
49-
50-
/bench/simple_bench.ts
51-
benchmark time (avg) iter/s (min … max) p75 p99 p995
52-
---------------------------------------------------------------- -----------------------------
53-
deno/std 342.76 ns/iter 2,917,524.4 (312.85 ns … 498.98 ns) 358.01 ns 450.82 ns 498.98 ns
54-
chalk 54.04 ns/iter 18,503,399.2 (49.87 ns … 97.89 ns) 57.02 ns 71.23 ns 85.35 ns
55-
picocolors 27.69 ns/iter 36,119,744.9 (25.89 ns … 144.71 ns) 27.07 ns 56.17 ns 63.5 ns
56-
enogu 5 ns/iter 200,175,100.8 (4.69 ns … 9.01 ns) 5.01 ns 6.22 ns 7.37 ns
57-
```

‎src/colors.ts

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* @module
77
*/
88

9-
// dnt-shim-ignore
109
// deno-lint-ignore no-explicit-any
1110
const { Deno, process } = globalThis as any;
1211
const noColor = typeof Deno?.noColor === "boolean"

‎src/deno.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "@ryu/enogu",
33
"version": "0.4.1",
44
"exports": {
5-
".": "./colors.ts",
6-
"./tiny": "./tiny.ts"
5+
".": "./colors.ts"
76
}
87
}

‎src/tiny.ts

-183
This file was deleted.

‎test/colors_test.ts

+16-4
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,28 @@ test("bgGray", () => {
145145
});
146146

147147
test("bgBrightBlack", () => {
148-
assertEquals(c.bgBrightBlack("enogu is colors"), "enogu is colors");
148+
assertEquals(
149+
c.bgBrightBlack("enogu is colors"),
150+
"enogu is colors",
151+
);
149152
});
150153

151154
test("bgBrightRed", () => {
152155
assertEquals(c.bgBrightRed("enogu is colors"), "enogu is colors");
153156
});
154157

155158
test("bgBrightGreen", () => {
156-
assertEquals(c.bgBrightGreen("enogu is colors"), "enogu is colors");
159+
assertEquals(
160+
c.bgBrightGreen("enogu is colors"),
161+
"enogu is colors",
162+
);
157163
});
158164

159165
test("bgBrightYellow", () => {
160-
assertEquals(c.bgBrightYellow("enogu is colors"), "enogu is colors");
166+
assertEquals(
167+
c.bgBrightYellow("enogu is colors"),
168+
"enogu is colors",
169+
);
161170
});
162171

163172
test("bgBrightBlue", () => {
@@ -176,7 +185,10 @@ test("bgBrightCyan", () => {
176185
});
177186

178187
test("bgBrightWhite", () => {
179-
assertEquals(c.bgBrightWhite("enogu is colors"), "enogu is colors");
188+
assertEquals(
189+
c.bgBrightWhite("enogu is colors"),
190+
"enogu is colors",
191+
);
180192
});
181193

182194
test("single color", () => {

0 commit comments

Comments
 (0)