@olwiba/dx 0.0.9
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/LICENSE +21 -0
- package/README.md +144 -0
- package/dist/ascii/index.d.ts +64 -0
- package/dist/ascii/index.js +1315 -0
- package/dist/ascii/index.js.map +1 -0
- package/dist/ascii-gif.d.ts +21 -0
- package/dist/ascii-gif.js +1536 -0
- package/dist/ascii-gif.js.map +1 -0
- package/dist/cli.js +1756 -0
- package/dist/eslint.d.ts +9 -0
- package/dist/eslint.js +90 -0
- package/dist/eslint.js.map +1 -0
- package/dist/fonts-DdHWzA4X.d.ts +7 -0
- package/dist/generate-previews.d.ts +28 -0
- package/dist/generate-previews.js +130 -0
- package/dist/generate-previews.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +1428 -0
- package/dist/index.js.map +1 -0
- package/dist/skills.d.ts +16 -0
- package/dist/skills.js +3 -0
- package/dist/skills.js.map +1 -0
- package/package.json +101 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Olwiba
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: light)" srcset="./public/olwibaDX--light.gif" />
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="./public/olwibaDX.gif" />
|
|
5
|
+
<img src="./public/olwibaDX.gif" alt="olwibaDX" style="width: 100%;" />
|
|
6
|
+
</picture>
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<strong>Developer experience tooling for the Olwiba ecosystem.</strong>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<a href="https://github.com/Olwiba/olwibaDX/issues/new?template=bug_report.md">🪲 Report a bug</a> ·
|
|
15
|
+
<a href="https://github.com/Olwiba/olwibaDX/issues/new?template=feature_request.md">✨ Feature request</a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="https://github.com/sponsors/Olwiba"><img src="https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub&color=22c55e" alt="Sponsor" /></a>
|
|
20
|
+
<a href="LICENSE"><img src="https://img.shields.io/github/license/Olwiba/olwibaDX?label=license&logo=github" alt="License" /></a>
|
|
21
|
+
<a href="https://github.com/Olwiba/olwibaDX/issues"><img src="https://img.shields.io/github/issues/Olwiba/olwibaDX" alt="Issues" /></a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
## What This Is
|
|
25
|
+
|
|
26
|
+
`@olwiba/dx` is a collection of tools focused on delivering the best developer experience when building projects.
|
|
27
|
+
|
|
28
|
+
A lot of what's in here reflects personal preference. Small build-time tooling and helpers I've used in my projects.
|
|
29
|
+
This package grows as the ecosystem grows, so expect new features over time.
|
|
30
|
+
|
|
31
|
+
Feel free to request additions or leverage what's already added as you see fit.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
bun add -d @olwiba/dx
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Features
|
|
40
|
+
|
|
41
|
+
### Dev Banners
|
|
42
|
+
|
|
43
|
+
Coloured ASCII banners printed on Vite dev server start and tsup build success. Makes it instantly obvious which project is running in your terminal.
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
// vite.config.ts
|
|
47
|
+
import { createDevBannerPlugin } from "@olwiba/dx";
|
|
48
|
+
|
|
49
|
+
export default defineConfig({
|
|
50
|
+
plugins: [
|
|
51
|
+
createDevBannerPlugin({
|
|
52
|
+
segments: [
|
|
53
|
+
{ text: "my" },
|
|
54
|
+
{ text: "App", colorHex: "#22D3EE" },
|
|
55
|
+
],
|
|
56
|
+
}),
|
|
57
|
+
],
|
|
58
|
+
});
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
For tsup, swap `createDevBannerPlugin` for `createTsupBannerHook` and pass it to `onSuccess`. For a one-shot print, call `printBanner` directly.
|
|
62
|
+
|
|
63
|
+
### ASCII Text
|
|
64
|
+
|
|
65
|
+
Figlet renderer with a bundled DOS Rebel font. Powers the `<AsciiText>` component in `@olwiba/cn`.
|
|
66
|
+
|
|
67
|
+
```ts
|
|
68
|
+
import { renderAscii } from "@olwiba/dx/ascii";
|
|
69
|
+
|
|
70
|
+
const art = renderAscii("hello", { font: "dosrebel" });
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### ASCII GIF Generator
|
|
74
|
+
|
|
75
|
+
Render an animated ASCII GIF from any text. This is what produced the README banner you see at the top of this file.
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
bunx @olwiba/dx ascii-gif \
|
|
79
|
+
--text "olwibaDX" \
|
|
80
|
+
--accent "DX" \
|
|
81
|
+
--out ./public/olwibaDX.gif
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Preview Generator
|
|
85
|
+
|
|
86
|
+
Puppeteer-based screenshot tool used to pre-render the isometric preview tiles on docs sites.
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
import { generatePreviews } from "@olwiba/dx";
|
|
90
|
+
|
|
91
|
+
await generatePreviews({
|
|
92
|
+
url: "http://localhost:3000/preview",
|
|
93
|
+
outputDir: "./public/previews",
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### ESLint Config
|
|
98
|
+
|
|
99
|
+
Opinionated lint rules shared across the ecosystem.
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
// eslint.config.js
|
|
103
|
+
import olwibaConfig from "@olwiba/dx/eslint";
|
|
104
|
+
|
|
105
|
+
export default [...olwibaConfig];
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Skills
|
|
109
|
+
|
|
110
|
+
Installable Claude/Amp skills manifest for working in Olwiba projects.
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
bunx @olwiba/dx skills install
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Tech Stack
|
|
117
|
+
|
|
118
|
+
- [TypeScript](https://www.typescriptlang.org)
|
|
119
|
+
- [tsup](https://tsup.egoist.dev)
|
|
120
|
+
- [Vite](https://vite.dev)
|
|
121
|
+
- [Puppeteer](https://pptr.dev)
|
|
122
|
+
- [figlet](https://github.com/patorjk/figlet.js)
|
|
123
|
+
- [chalk](https://github.com/chalk/chalk)
|
|
124
|
+
|
|
125
|
+
## Ecosystem
|
|
126
|
+
|
|
127
|
+
- [`@olwiba/cn`](https://github.com/Olwiba/olwibaCN) — shadcn-style component primitives
|
|
128
|
+
- _More coming soon!_
|
|
129
|
+
|
|
130
|
+
## Contributing
|
|
131
|
+
|
|
132
|
+
Bug reports, pull requests & feature requests are welcome.
|
|
133
|
+
Open an issue first for anything beyond a small fix.
|
|
134
|
+
|
|
135
|
+
<br/>
|
|
136
|
+
<br/>
|
|
137
|
+
|
|
138
|
+
<p align="center">
|
|
139
|
+
Built with 💖 by <a href="https://github.com/Olwiba">Olwiba</a>
|
|
140
|
+
</p>
|
|
141
|
+
|
|
142
|
+
<p align="center">
|
|
143
|
+
<a href="https://buymeacoffee.com/olwiba"><img src="https://img.shields.io/badge/Buy%20Me%20A%20Coffee-FFDD00?logo=buymeacoffee&logoColor=black" alt="Buy Me A Coffee" /></a>
|
|
144
|
+
</p>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export { A as AsciiFontName, a as asciiFonts, g as getAsciiFont } from '../fonts-DdHWzA4X.js';
|
|
2
|
+
|
|
3
|
+
interface FigletFont {
|
|
4
|
+
height: number;
|
|
5
|
+
baseline: number;
|
|
6
|
+
hardblank: string;
|
|
7
|
+
chars: Map<number, string[]>;
|
|
8
|
+
}
|
|
9
|
+
declare function parseFigletFont(raw: string): FigletFont;
|
|
10
|
+
|
|
11
|
+
interface AsciiCell {
|
|
12
|
+
ch: "â–ˆ" | "â–‘";
|
|
13
|
+
col: number;
|
|
14
|
+
row: number;
|
|
15
|
+
}
|
|
16
|
+
interface AsciiTextLayout {
|
|
17
|
+
cells: AsciiCell[];
|
|
18
|
+
cols: number;
|
|
19
|
+
rows: number;
|
|
20
|
+
}
|
|
21
|
+
declare function composeAsciiText(font: FigletFont, text: string): AsciiTextLayout;
|
|
22
|
+
declare function getAsciiAccentColumns(font: FigletFont, text: string, accent: string): Set<number>;
|
|
23
|
+
|
|
24
|
+
declare const ASCII_CHAR_WIDTH = 7.5;
|
|
25
|
+
declare const ASCII_CHAR_HEIGHT = 15;
|
|
26
|
+
interface AsciiWave {
|
|
27
|
+
cx: number;
|
|
28
|
+
cy: number;
|
|
29
|
+
t: number;
|
|
30
|
+
}
|
|
31
|
+
interface AsciiPointer {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
active: boolean;
|
|
35
|
+
}
|
|
36
|
+
interface AsciiFrameState {
|
|
37
|
+
time?: number;
|
|
38
|
+
phase?: number;
|
|
39
|
+
pointer?: AsciiPointer;
|
|
40
|
+
waves?: AsciiWave[];
|
|
41
|
+
}
|
|
42
|
+
interface AsciiRenderOptions extends AsciiFrameState {
|
|
43
|
+
accentColumns?: ReadonlySet<number>;
|
|
44
|
+
color: string;
|
|
45
|
+
accentColor?: string;
|
|
46
|
+
charWidth?: number;
|
|
47
|
+
charHeight?: number;
|
|
48
|
+
}
|
|
49
|
+
interface AsciiFrameContext {
|
|
50
|
+
clearRect(x: number, y: number, width: number, height: number): void;
|
|
51
|
+
fillRect(x: number, y: number, width: number, height: number): void;
|
|
52
|
+
globalAlpha: number;
|
|
53
|
+
fillStyle: string;
|
|
54
|
+
}
|
|
55
|
+
declare function getAsciiCanvasSize(layout: AsciiTextLayout, charWidth?: number, charHeight?: number): {
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
58
|
+
};
|
|
59
|
+
declare function getAsciiCellIntensity(cell: AsciiCell, options: AsciiFrameState): number;
|
|
60
|
+
declare function renderAsciiFrameToContext(ctx: AsciiFrameContext, layout: AsciiTextLayout, options: AsciiRenderOptions): void;
|
|
61
|
+
|
|
62
|
+
declare const dosrebelFont: string;
|
|
63
|
+
|
|
64
|
+
export { ASCII_CHAR_HEIGHT, ASCII_CHAR_WIDTH, type AsciiCell, type AsciiFrameContext, type AsciiFrameState, type AsciiPointer, type AsciiRenderOptions, type AsciiTextLayout, type AsciiWave, type FigletFont, composeAsciiText, dosrebelFont, getAsciiAccentColumns, getAsciiCanvasSize, getAsciiCellIntensity, parseFigletFont, renderAsciiFrameToContext };
|