Skip to content

Commit 3d5aa28

Browse files
committed
✨ [feat] Refactor repository for better structure
Refactors the repository to improve organization and maintainability. - ⚡ [perf] Improves performance and simplifies project structure by reorganizing directories and updating file paths - Moves scripts to a dedicated `scripts/` directory - Relocates examples to `docs/examples/` for better documentation organization - Moves ANSI art source files to `assets/ansi-files/` - Updates file paths in configuration files, documentation, and scripts to reflect the new structure - Updates documentation to guide users on new script locations Signed-off-by: Nick2bad4u <20943337+Nick2bad4u@users.noreply.github.com>
1 parent 7d63dcf commit 3d5aa28

57 files changed

Lines changed: 467 additions & 357 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,16 @@ By participating in this project, you agree to maintain a respectful and inclusi
9191

9292
```powershell
9393
# Module smoke tests (includes ScriptAnalyzer)
94-
pwsh -NoProfile -Command "& .\Test-Module.ps1"
94+
pwsh -NoProfile -Command "& .\scripts\Test-Module.ps1"
9595
9696
# Full unit tests
9797
Invoke-Pester -Path ./Tests
9898
9999
# Lint (treat warnings as failures)
100-
pwsh -NoProfile -Command "& .\Lint-Module.ps1" -IncludeTests -TreatWarningsAsErrors
100+
pwsh -NoProfile -Command "& .\scripts\Lint-Module.ps1" -IncludeTests -TreatWarningsAsErrors
101101
102102
# (Optional) Auto-fix ScriptAnalyzer violations when available
103-
pwsh -NoProfile -Command "& .\Lint-Module.ps1" -Fix
103+
pwsh -NoProfile -Command "& .\scripts\Lint-Module.ps1" -Fix
104104
```
105105

106106
6. **Commit your changes**

ColorScripts-Enhanced/ColorScripts-Enhanced.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
RootModule = 'ColorScripts-Enhanced.psm1'
1212

1313
# Version number of this module.
14-
ModuleVersion = '2025.10.13.1840'
14+
ModuleVersion = '2025.10.13.1914'
1515

1616
# Supported PSEditions
1717
CompatiblePSEditions = @('Desktop', 'Core')
@@ -171,7 +171,7 @@ Full documentation: https://github.com/Nick2bad4u/ps-color-scripts-enhanced
171171

172172
# ReleaseNotes of this module
173173
ReleaseNotes = @'
174-
Version 2025.10.13.1840:
174+
Version 2025.10.13.1914:
175175
- Enhanced caching system with OS-wide cache in AppData
176176
- 6-19x performance improvement
177177
- Cache stored in centralized location

ColorScripts-Enhanced/README-Gallery.md

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ Clear-ColorScriptCache -All
6464

6565
## All Commands
6666

67-
| Command | Alias | Description |
68-
|---------|-------|-------------|
69-
| `Show-ColorScript` | `scs` | Display a colorscript (random or by name) |
70-
| `Get-ColorScriptList` | - | List all available colorscripts with metadata |
71-
| `Build-ColorScriptCache` | - | Pre-generate cache files for faster loading |
72-
| `Clear-ColorScriptCache` | - | Remove cache files |
73-
| `Add-ColorScriptProfile` | - | Add module import to your PowerShell profile |
74-
| `Get-ColorScriptConfiguration` | - | View current configuration settings |
75-
| `Set-ColorScriptConfiguration` | - | Update and persist configuration |
76-
| `Reset-ColorScriptConfiguration` | - | Restore default configuration |
77-
| `Export-ColorScriptMetadata` | - | Export script metadata as JSON |
78-
| `New-ColorScript` | - | Create a new colorscript template |
67+
| Command | Alias | Description |
68+
| -------------------------------- | ----- | --------------------------------------------- |
69+
| `Show-ColorScript` | `scs` | Display a colorscript (random or by name) |
70+
| `Get-ColorScriptList` | - | List all available colorscripts with metadata |
71+
| `Build-ColorScriptCache` | - | Pre-generate cache files for faster loading |
72+
| `Clear-ColorScriptCache` | - | Remove cache files |
73+
| `Add-ColorScriptProfile` | - | Add module import to your PowerShell profile |
74+
| `Get-ColorScriptConfiguration` | - | View current configuration settings |
75+
| `Set-ColorScriptConfiguration` | - | Update and persist configuration |
76+
| `Reset-ColorScriptConfiguration` | - | Restore default configuration |
77+
| `Export-ColorScriptMetadata` | - | Export script metadata as JSON |
78+
| `New-ColorScript` | - | Create a new colorscript template |
7979

8080
## Configuration
8181

@@ -115,20 +115,6 @@ Get-Help Show-ColorScript -Parameter Name
115115
Get-Help about_ColorScripts-Enhanced
116116
```
117117

118-
## Script Categories
119-
120-
Browse colorscripts by category:
121-
122-
- **Geometric** - Fractals, patterns, sacred geometry (mandelbrot-zoom, sierpinski-carpet)
123-
- **Nature** - Space, weather, organic forms (galaxy-spiral, aurora-bands, crystal-drift)
124-
- **Artistic** - Creative designs (kaleidoscope, rainbow-waves, psychedelic-vortex)
125-
- **Gaming** - Retro game art (doom-original, pacman, space-invaders)
126-
- **System** - Terminal tests (colortest, nerd-font-test, terminal-benchmark)
127-
- **Logos** - OS and software logos (arch, debian, ubuntu, windows)
128-
- **Patterns** - Repeating designs (bars, gradient-bars, hex-blocks)
129-
- **Mathematical** - Math-based art (fourier-epicycles, newton-basins)
130-
- **Physics** - Simulations (nbody-gravity, boids-flock, langton-ant)
131-
132118
## Performance
133119

134120
Experience dramatic speed improvements:

ColorScripts-Enhanced/README.md

Lines changed: 49 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ A high-performance PowerShell module for displaying beautiful ANSI colorscripts
3131

3232
## Features
3333

34-
**<!-- COLOR_SCRIPT_COUNT_PLUS -->245+<!-- /COLOR_SCRIPT_COUNT_PLUS --> Beautiful Colorscripts** - Extensive collection of ANSI art
34+
**<!-- COLOR_SCRIPT_COUNT_PLUS -->245+<!-- /COLOR_SCRIPT_COUNT_PLUS --> Beautiful Colorscripts** - Extensive collection of ANSI art
3535

3636
**Intelligent Caching** - 6-19x performance improvement (5-20ms load times)
3737

@@ -70,11 +70,11 @@ Show-ColorScript
7070

7171
We test every change across Windows, macOS, and Linux. See the full matrix in [docs/POWERSHELL-VERSIONS.md](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/blob/main/docs/POWERSHELL-VERSIONS.md).
7272

73-
Platform | PowerShell 5.1 | PowerShell 7.x
74-
-------- | ------------------------------- | ---------------------------------------------
75-
Windows | ✅ Unit tests, module validation | ✅ Unit tests, ScriptAnalyzer, help validation
76-
macOS | ❌ Not available | ✅ Unit tests, ScriptAnalyzer
77-
Linux | ❌ Not available | ✅ Unit tests, ScriptAnalyzer
73+
| Platform | PowerShell 5.1 | PowerShell 7.x |
74+
| -------- | -------------------------------- | ---------------------------------------------- |
75+
| Windows | ✅ Unit tests, module validation | ✅ Unit tests, ScriptAnalyzer, help validation |
76+
| macOS | ❌ Not available | ✅ Unit tests, ScriptAnalyzer |
77+
| Linux | ❌ Not available | ✅ Unit tests, ScriptAnalyzer |
7878

7979
> We intentionally run ScriptAnalyzer only on PowerShell 7.x because the 5.1 engine applies different rules that conflict with modern cross-platform patterns.
8080
@@ -330,19 +330,19 @@ Show-ColorScript -Name "bars" -NoCache
330330

331331
## Commands
332332

333-
Command | Alias | Description
334-
-------------------------------- | ----- | ----------------------------------------------------------------------------------
335-
`Show-ColorScript` | `scs` | Display a colorscript
336-
`Get-ColorScriptList` | - | List all available colorscripts
337-
`Build-ColorScriptCache` | - | Pre-generate cache files
338-
`Clear-ColorScriptCache` | - | Remove cache files
339-
`Add-ColorScriptProfile` | - | Append module startup snippet to your profile
340-
`Get-ColorScriptConfiguration` | - | Inspect persisted defaults (cache path, startup behaviour)
341-
`Set-ColorScriptConfiguration` | - | Update configuration values and immediately persist them
342-
`Reset-ColorScriptConfiguration` | - | Restore configuration to factory defaults
343-
`Export-ColorScriptMetadata` | - | Export metadata and cache info as JSON for external tooling
344-
`New-ColorScript` | - | Scaffold a new colorscript skeleton with metadata guidance
345-
`Install.ps1` | - | Optional local installer with `-AddToProfile`, `-SkipStartupScript`, `-BuildCache`
333+
| Command | Alias | Description |
334+
| -------------------------------- | ----- | ---------------------------------------------------------------------------------- |
335+
| `Show-ColorScript` | `scs` | Display a colorscript |
336+
| `Get-ColorScriptList` | - | List all available colorscripts |
337+
| `Build-ColorScriptCache` | - | Pre-generate cache files |
338+
| `Clear-ColorScriptCache` | - | Remove cache files |
339+
| `Add-ColorScriptProfile` | - | Append module startup snippet to your profile |
340+
| `Get-ColorScriptConfiguration` | - | Inspect persisted defaults (cache path, startup behaviour) |
341+
| `Set-ColorScriptConfiguration` | - | Update configuration values and immediately persist them |
342+
| `Reset-ColorScriptConfiguration` | - | Restore configuration to factory defaults |
343+
| `Export-ColorScriptMetadata` | - | Export metadata and cache info as JSON for external tooling |
344+
| `New-ColorScript` | - | Scaffold a new colorscript skeleton with metadata guidance |
345+
| `Install.ps1` | - | Optional local installer with `-AddToProfile`, `-SkipStartupScript`, `-BuildCache` |
346346

347347
### Getting Help
348348

@@ -370,7 +370,7 @@ Get-Help about_ColorScripts-Enhanced
370370
- [Quick Start & Reference](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/blob/main/docs/QUICK_REFERENCE.md)
371371
- [ANSI Color Guide](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/blob/main/docs/ANSI-COLOR-GUIDE.md)
372372
- [ANSI Conversion Guide](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/blob/main/docs/ANSI-CONVERSION-GUIDE.md)
373-
- [ANSI Conversion Examples](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/blob/main/examples/ansi-conversion/README.md)
373+
- [ANSI Conversion Examples](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/blob/main/docs/examples/ansi-conversion/README.md)
374374
- [Module Summary](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/blob/main/docs/MODULE_SUMMARY.md)
375375
- [Development Guide](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/blob/main/docs/Development.md)
376376
- [Publishing Guide](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/blob/main/docs/Publishing.md)
@@ -382,38 +382,38 @@ Get-Help about_ColorScripts-Enhanced
382382

383383
## Testing
384384

385-
- Smoke tests (includes ScriptAnalyzer): `pwsh -NoProfile -Command "& .\Test-Module.ps1"`
385+
- Smoke tests (includes ScriptAnalyzer): `pwsh -NoProfile -Command "& .\scripts\Test-Module.ps1"`
386386
- Full test suite: `Invoke-Pester -Path ./Tests`
387387
- Continuous integration: [`test.yml`](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/blob/main/.github/workflows/test.yml) runs on Windows PowerShell 5.1, PowerShell 7.x across Windows/Linux/macOS, includes a PowerShell 7.5 preview container smoke test, and validates markdown links.
388388

389389
## Linting
390390

391-
- Linting (module only): `pwsh -NoProfile -Command "& .\Lint-Module.ps1"`
392-
- Linting (treat warnings as errors and include tests): `pwsh -NoProfile -Command "& .\Lint-Module.ps1" -IncludeTests -TreatWarningsAsErrors`
393-
- Lint auto-fix (apply ScriptAnalyzer fixes, then re-run lint): `pwsh -NoProfile -Command "& .\Lint-Module.ps1" -Fix`
391+
- Linting (module only): `pwsh -NoProfile -Command "& .\scripts\Lint-Module.ps1"`
392+
- Linting (treat warnings as errors and include tests): `pwsh -NoProfile -Command "& .\scripts\Lint-Module.ps1" -IncludeTests -TreatWarningsAsErrors`
393+
- Lint auto-fix (apply ScriptAnalyzer fixes, then re-run lint): `pwsh -NoProfile -Command "& .\scripts\Lint-Module.ps1" -Fix`
394394

395395
## npm Scripts
396396

397397
> **Note:** The following npm scripts are for development and repository maintenance only. End-users do not need Node.js or npm to use the PowerShell module.
398398
399-
Command | Description
400-
--------------------------------------------------- | ----------------------------------------------------------------------------
401-
`npm run build` | Build the module manifest and refresh documentation counts.
402-
`npm run lint` | Run ScriptAnalyzer against the module.
403-
`npm run lint:strict` | Run lint with tests included and warnings treated as errors.
404-
`npm run lint:fix` | Apply ScriptAnalyzer fixes where possible, then rerun lint.
405-
`npm test` | Execute the smoke-test harness (`Test-Module.ps1`).
406-
`npm run test:pester` | Run the full Pester suite in `./Tests`.
407-
`npm run docs:update-counts` | Synchronize script-count markers across all docs.
408-
`npm run package:metadata -- --PackagePath <nupkg>` | Inject README/license/icon metadata into a generated package before pushing.
409-
`npm run scripts:convert -- <ansi-file>` | Convert an ANSI file into a colorscript (Node-based converter).
410-
`npm run scripts:split -- <file> [options]` | Split a tall ANSI or PowerShell script into multiple chunks.
411-
`npm run scripts:test-all` | Execute every colorscript via `Test-AllColorScripts.ps1`.
412-
`npm run release:notes` | Generate unreleased notes (stripped header) for gallery publishing.
413-
`npm run release:notes:latest` | Generate the most recent tagged release notes.
414-
`npm run release:verify` | Validate CHANGELOG.md against the module manifest and git-cliff.
415-
`npm run markdown:check` | Run `markdown-link-check` across all repository docs.
416-
`npm run verify` | Run strict linting, markdown checks, and both smoke + Pester tests.
399+
| Command | Description |
400+
| --------------------------------------------------- | ---------------------------------------------------------------------------- |
401+
| `npm run build` | Build the module manifest and refresh documentation counts. |
402+
| `npm run lint` | Run ScriptAnalyzer against the module. |
403+
| `npm run lint:strict` | Run lint with tests included and warnings treated as errors. |
404+
| `npm run lint:fix` | Apply ScriptAnalyzer fixes where possible, then rerun lint. |
405+
| `npm test` | Execute the smoke-test harness (`Test-Module.ps1`). |
406+
| `npm run test:pester` | Run the full Pester suite in `./Tests`. |
407+
| `npm run docs:update-counts` | Synchronize script-count markers across all docs. |
408+
| `npm run package:metadata -- --PackagePath <nupkg>` | Inject README/license/icon metadata into a generated package before pushing. |
409+
| `npm run scripts:convert -- <ansi-file>` | Convert an ANSI file into a colorscript (Node-based converter). |
410+
| `npm run scripts:split -- <file> [options]` | Split a tall ANSI or PowerShell script into multiple chunks. |
411+
| `npm run scripts:test-all` | Execute every colorscript via `Test-AllColorScripts.ps1`. |
412+
| `npm run release:notes` | Generate unreleased notes (stripped header) for gallery publishing. |
413+
| `npm run release:notes:latest` | Generate the most recent tagged release notes. |
414+
| `npm run release:verify` | Validate CHANGELOG.md against the module manifest and git-cliff. |
415+
| `npm run markdown:check` | Run `markdown-link-check` across all repository docs. |
416+
| `npm run verify` | Run strict linting, markdown checks, and both smoke + Pester tests. |
417417

418418
## Release Process
419419

@@ -447,11 +447,11 @@ Please review [CONTRIBUTING.md](https://github.com/Nick2bad4u/ps-color-scripts-e
447447

448448
### Example Performance Gains
449449

450-
Script | Without Cache | With Cache | Speedup
451-
--------------- | ------------- | ---------- | -------
452-
bars | 31ms | 5ms | **6x**
453-
gradient-bars | 65ms | 8ms | **8x**
454-
mandelbrot-zoom | 365ms | 19ms | **19x**
450+
| Script | Without Cache | With Cache | Speedup |
451+
| --------------- | ------------- | ---------- | ------- |
452+
| bars | 31ms | 5ms | **6x** |
453+
| gradient-bars | 65ms | 8ms | **8x** |
454+
| mandelbrot-zoom | 365ms | 19ms | **19x** |
455455

456456
## Cache System
457457

@@ -556,7 +556,7 @@ The repository ships several helpers for working with ANSI art, release notes, a
556556
- `scripts/Generate-ReleaseNotes.ps1` wraps `git-cliff` so you can build PowerShell Gallery release notes or tag summaries in one command.
557557
- `scripts/Validate-Changelog.ps1` checks that `CHANGELOG.md` matches the manifest version and the latest `git-cliff` output.
558558
- `scripts/Invoke-MarkdownLinkCheck.ps1` runs `markdown-link-check` across every markdown file using the bundled configuration.
559-
- `examples/ansi-conversion/` contains turnkey PowerShell scripts that demonstrate the Node and PowerShell conversion utilities end-to-end.
559+
- `docs/examples/ansi-conversion/` contains turnkey PowerShell scripts that demonstrate the Node and PowerShell conversion utilities end-to-end.
560560

561561
### Split Super-Tall ANSI Art
562562

@@ -639,13 +639,11 @@ Show-ColorScript -Name nerd-font-test
639639

640640
- **PowerShell:** 5.1 or higher (PowerShell 7+ recommended)
641641
- **Operating System:**
642-
643642
- Windows 10/11
644643
- macOS 10.13+
645644
- Linux (Ubuntu, Debian, Fedora, etc.)
646645

647646
- **Terminal:** ANSI-capable terminal
648-
649647
- Windows: Windows Terminal, VS Code Terminal, ConEmu
650648
- macOS: Terminal.app, iTerm2, VS Code Terminal
651649
- Linux: GNOME Terminal, Konsole, xterm, VS Code Terminal
@@ -720,7 +718,7 @@ See [CHANGELOG.md](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/blob/
720718

721719
For support options, response targets, and contact channels, review the [Support Policy](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/blob/main/docs/SUPPORT.md). Bug reports and feature ideas live in the [issue tracker](https://github.com/Nick2bad4u/ps-color-scripts-enhanced/issues).
722720

723-
--------------------------------------------------------------------------------
721+
---
724722

725723
**Enjoy the colors and scripts!** 🌈✨
726724

@@ -737,4 +735,3 @@ For support options, response targets, and contact channels, review the [Support
737735
- [r/ANSIart](https://www.reddit.com/r/ANSIart/)
738736

739737
- [Sixteen Colors Facebook](https://www.facebook.com/sixteencolors/)
740-

0 commit comments

Comments
 (0)