@wistantkode/dotfiles 1.5.0 → 1.7.0
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/CHANGELOG.md +24 -0
- package/CONTRIBUTING.md +51 -0
- package/README.md +61 -48
- package/SECURITY.md +39 -0
- package/assets/logo.png +0 -0
- package/cli/cli.mjs +217 -0
- package/github.sh +47 -79
- package/package.json +2 -2
- package/assets/dotfiles.png +0 -0
- package/assets/memoji.png +0 -0
- package/assets/wistant-logo.png +0 -0
- package/bin/cli.mjs +0 -103
package/CHANGELOG.md
CHANGED
|
@@ -2,9 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.7.0] - 2026-04-05 - [High-Fidelity Orchestration & Logic Refinement]
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **High-Fidelity UI**: Block progress bars (`█`) and CYAN/YELLOW color accents for a premium feel.
|
|
10
|
+
- **Branded Signature**: Integrated an interactive authorship and source information table.
|
|
11
|
+
- **Enhanced Orchestration**: Two-stage directory confirmation and state-aware audit feedback.
|
|
12
|
+
- **Protocol Governance**: Logic refinement for `.protocols/` folder selection with architectural recommendations.
|
|
13
|
+
|
|
14
|
+
## [1.6.0] - 2026-04-05 - [Vellum & Void Integrity]
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- **Formal Governance**: Integrated professional `CONTRIBUTING.md` and `SECURITY.md` root-level guides, transitioning from internal metaphors to standard engineering contracts.
|
|
19
|
+
- **Community Infrastructure**: Added a dedicated Community section with a high-fidelity contributor avatar grid and refined attribution.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **Architectural Mapping**: Migrated the CLI entry point from `bin/` to `cli/` to align with modern package distribution standards.
|
|
24
|
+
- **Technical Sanitization**: Purged all metaphorical terminology (Rodin, Socratic, Audit) from public-facing documentation in favor of professional engineering nomenclature.
|
|
25
|
+
- **Visual Engineering**: Redesigned the `README.md` signature header and updated the technical verification workflow diagram (Mermaid).
|
|
26
|
+
- **Hardening**: Refined the implementation of Zero-Trust principles in the root security policy.
|
|
27
|
+
|
|
5
28
|
## [1.5.0] - 2026-04-05 - [Iron Gate & Neon Dash]
|
|
6
29
|
|
|
7
30
|
### Added
|
|
31
|
+
|
|
8
32
|
- **Protocol Hardening**: Integrated strict "Zero-Initiative" and "Separation of Concerns" rules into `RODIN.md` and `COMMIT.md`. AI is now formally forbidden from touching release artifacts outside of Release mode.
|
|
9
33
|
- **Elite UI Overhaul**: Complete refactor of `github.sh` and `bin/cli.mjs` with premium 256-color aesthetics, box-drawing tables, and animated progress bars.
|
|
10
34
|
- **Enhanced Gatekeeping**: `github.sh` now performs a silent tag-delta audit and forces manual confirmation on production branches.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Contributing to Dotfiles Infrastructure
|
|
2
|
+
|
|
3
|
+
This repository is governed by strict **Architectural Validation**. To maintain technical excellence, every contribution must align with our core engineering baseline. Precision and structural integrity are non-negotiable.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## ⚡ Technical Pillars
|
|
8
|
+
|
|
9
|
+
### 1. Atomic Integrity
|
|
10
|
+
|
|
11
|
+
We maintain a linear, pure history. PRs must represent a single, isolated logical intention.
|
|
12
|
+
|
|
13
|
+
- **Manual Staging**: The use of `git add .` is prohibited. Every staging must be targeted (`git add <file>`).
|
|
14
|
+
- **No Hybrid Commits**: Do not mix refactoring (`refactor`) with functional additions (`feat`) in the same commit.
|
|
15
|
+
- **Separation of Powers**: Release manifests (`package.json`, `CHANGELOG.md`) and Git Tags are strictly reserved for the **Release Protocol**. They must never be part of a standard code commit.
|
|
16
|
+
|
|
17
|
+
### 2. Architectural Governance
|
|
18
|
+
|
|
19
|
+
Your interaction with the codebase is a technical review, not a service.
|
|
20
|
+
|
|
21
|
+
- **Critical Assessment**: Contributors (Human or AI) must provide technical justification for every change. Blind validation is a protocol failure.
|
|
22
|
+
- **Zero-Initiative**: Decision-making is limited to the explicit scope of the requested task. Unauthorized modification of non-cited components is forbidden.
|
|
23
|
+
- **Impact-Based SemVer**: Versioning must be mathematically justified by the code impact analyzed during the release phase.
|
|
24
|
+
|
|
25
|
+
### 3. AI-Pairing Standards
|
|
26
|
+
|
|
27
|
+
We recognize AI as a technical peer. Contributions co-authored by an agent must:
|
|
28
|
+
|
|
29
|
+
- Maintain a direct, technical, and objective tone.
|
|
30
|
+
- Be verified by the **Architect (Human)** at every execution gate.
|
|
31
|
+
- **The Verification Barrier**: The agent must prompt for human confirmation of the versioning logic before final execution.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Development Lifecycle
|
|
36
|
+
|
|
37
|
+
### Phase 1: Code Implementation
|
|
38
|
+
|
|
39
|
+
Follow the **Commit Convention**. Use strict prefixes (`feat`, `fix`, `refactor`, `style`, `ui`, `docs`).
|
|
40
|
+
|
|
41
|
+
### Phase 2: Infrastructure Deployment
|
|
42
|
+
|
|
43
|
+
Deployment follows the **Architectural Release** flow. Every release must be sealed with a unique identifier: `vX.Y.Z - [MOTTO]`.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 👥 Maintenance
|
|
48
|
+
|
|
49
|
+
Managed by **Wistant** — Lead Architect.
|
|
50
|
+
|
|
51
|
+
---
|
package/README.md
CHANGED
|
@@ -1,64 +1,61 @@
|
|
|
1
|
-
# [@wistantkode/dotfiles](https://www.npmjs.com/package/@wistantkode/dotfiles)
|
|
2
|
-
|
|
3
1
|
<div align="center">
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<img src="./assets/memoji.png" alt="Memoji" width="120" />
|
|
11
|
-
</td>
|
|
12
|
-
<td align="center" valign="middle">
|
|
13
|
-
<img src="./assets/dotfiles.png" alt="Dotfiles Logo" width="100" />
|
|
14
|
-
</td>
|
|
15
|
-
</tr>
|
|
16
|
-
</table>
|
|
17
|
-
<br />
|
|
18
|
-
<p><b>Precision AI-Pairing Infrastructure & Architectural Protocols</b></p>
|
|
19
|
-
|
|
2
|
+
<img src="./assets/logo.png" alt="Dotfiles Logo" width="240" />
|
|
3
|
+
|
|
4
|
+
# Precision Dotfiles Infrastructure
|
|
5
|
+
|
|
6
|
+
[ Automated Orchestration • AI-Driven Logic • System Governance • CLI Distribution ]
|
|
7
|
+
|
|
20
8
|
<p>
|
|
9
|
+
<a href="https://pnpm.io">
|
|
10
|
+
<img src="https://img.shields.io/badge/pnpm-4AB6FA?style=for-the-badge&logo=pnpm&logoColor=white" alt="pnpm" />
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript">
|
|
13
|
+
<img src="https://img.shields.io/badge/JavaScript-F7DF1E?style=for-the-badge&logo=javascript&logoColor=black" alt="javascript" />
|
|
14
|
+
</a>
|
|
21
15
|
<a href="https://www.npmjs.com/package/@wistantkode/dotfiles">
|
|
22
|
-
|
|
16
|
+
<img src="https://img.shields.io/badge/npm-CB3837?style=for-the-badge&logo=npm&logoColor=white" alt="npm" />
|
|
23
17
|
</a>
|
|
24
|
-
<a href="https://
|
|
25
|
-
|
|
18
|
+
<a href="https://github.com/wistant/dotfiles/actions">
|
|
19
|
+
<img src="https://img.shields.io/badge/GitHub_Actions-2088FF?style=for-the-badge&logo=github-actions&logoColor=white" alt="github actions" />
|
|
26
20
|
</a>
|
|
27
|
-
<a href="
|
|
28
|
-
|
|
21
|
+
<a href="https://github.com/wistant/dotfiles/releases">
|
|
22
|
+
<img src="https://img.shields.io/badge/Release-v1.7.0-blue?style=for-the-badge&logo=github" alt="GitHub release" />
|
|
29
23
|
</a>
|
|
30
24
|
</p>
|
|
25
|
+
|
|
31
26
|
</div>
|
|
32
27
|
|
|
33
28
|
---
|
|
34
29
|
|
|
35
|
-
##
|
|
36
|
-
|
|
37
|
-
This is more than a dotfiles collection; it is a **System of Governance** for AI-driven development workflows. By treating your environment as **Versioned Infrastructure**, you establish the necessary guardrails to ensure that AI-pair-programming remains precise, atomic, and secure.
|
|
38
|
-
|
|
39
|
-
### The System Advantage
|
|
40
|
-
|
|
41
|
-
- **AI-Driven Logic**: The system is designed to "pilot" your AI assistant. It provides the architectural context and socratic protocols (`.protocols/`) required for high-end decision making.
|
|
42
|
-
- **Atomic Reliability**: Every modification is routed through a verification cycle that prevents history pollution and mixed intentions.
|
|
43
|
-
- **Universal Staging**: Powered by **pnpm**, **JavaScript (ESM)**, and **Shell orchestration**, the entire ecosystem is instantly deployable via `npx` or `pnpm dlx`.
|
|
44
|
-
|
|
45
|
-
---
|
|
30
|
+
## Architectural Orchestration
|
|
46
31
|
|
|
47
|
-
|
|
32
|
+
This repository is not just a collection of configs; it is a **Living Governance System**. Every interaction between the Architect and the AI is filtered through a rigorous protocol stack.
|
|
48
33
|
|
|
49
34
|
```mermaid
|
|
50
|
-
graph
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
35
|
+
graph LR
|
|
36
|
+
subgraph "Engineering & Governance"
|
|
37
|
+
SE[Software Engineer] --> PR[Protocols & Registry]
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
subgraph "Automation Core"
|
|
41
|
+
PR --> CLI[CLI Orchestrator]
|
|
42
|
+
PR --> SYNC[Sync Engine]
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
subgraph "Deployment Lifecycle"
|
|
46
|
+
CLI --> OS[System Deployment]
|
|
47
|
+
SYNC --> GIT[Git Integrity]
|
|
48
|
+
GIT --> NPM[NPM Distribution]
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
style SE fill:#fff,stroke:#333,stroke-width:2px
|
|
52
|
+
style NPM fill:#000,stroke:#fff,stroke-width:2px,color:#fff
|
|
56
53
|
```
|
|
57
54
|
|
|
58
55
|
### Core Automation Tools
|
|
59
56
|
|
|
60
57
|
1. **Interactive Sync (`github.sh`)**: A specialized gatekeeper that performs a "Tag Delta" audit, ensuring local versions and remote states are synchronized before any projection.
|
|
61
|
-
2. **System Protocols**: A library of hidden guides that force the AI to maintain professional standards (Atomic commits,
|
|
58
|
+
2. **System Protocols**: A library of hidden guides that force the AI to maintain professional standards (Atomic commits, Protocol releases, Security first).
|
|
62
59
|
3. **Automated Distribution**: GitHub Actions handle the security auditing and global NPM publication upon Every GitHub Release.
|
|
63
60
|
|
|
64
61
|
---
|
|
@@ -72,6 +69,7 @@ pnpm dlx @wistantkode/dotfiles
|
|
|
72
69
|
```
|
|
73
70
|
|
|
74
71
|
### Included Assets
|
|
72
|
+
|
|
75
73
|
- **Professional `.gitignore`**: PRODUCTION-READY baseline for all modern stacks.
|
|
76
74
|
- **Security & Integrity**: Injected `.protocols/` folder for immediate AI alignment.
|
|
77
75
|
- **Universal License**: Apache 2.0 baseline for all technical distributions.
|
|
@@ -82,21 +80,36 @@ pnpm dlx @wistantkode/dotfiles
|
|
|
82
80
|
|
|
83
81
|
| Standard | Role | Reference |
|
|
84
82
|
| :--- | :--- | :--- |
|
|
85
|
-
| **Audit Philosophy** |
|
|
83
|
+
| **Audit Philosophy** | Protocol auditing and architectural integrity. | [RODIN.md](./protocols/RODIN.md) |
|
|
86
84
|
| **Commit Protocol** | Strict atomic formatting and zero-entropy staging. | [COMMIT.md](./protocols/COMMIT.md) |
|
|
87
|
-
| **Release Flow** |
|
|
85
|
+
| **Release Flow** | Technical versioning and manual sealing logic. | [RELEASE.md](./protocols/RELEASE.md) |
|
|
88
86
|
| **Security First** | Vulnerability audits and secret scanning protocols. | [SECURITY.md](./protocols/SECURITY.md) |
|
|
89
87
|
|
|
90
88
|
> See [_INDEX.md](./protocols/_INDEX.md) for the full library of orchestration protocols.
|
|
91
89
|
|
|
92
90
|
---
|
|
93
91
|
|
|
92
|
+
## Contributors
|
|
93
|
+
|
|
94
|
+
The project is currently orchestrated by its lead software engineer. New contributions are welcome to expand the baseline.
|
|
95
|
+
|
|
96
|
+
<p align="left">
|
|
97
|
+
<a href="https://github.com/wistant">
|
|
98
|
+
<img src="https://github.com/wistant.png?size=100" width="50" height="50" alt="wistant" title="Wistant"/>
|
|
99
|
+
</a>
|
|
100
|
+
</p>
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Community
|
|
105
|
+
|
|
106
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines on how to join the **contributors** and submit PRs.
|
|
107
|
+
AI/vibe-coded PRs welcome! 🤖
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
94
111
|
## License
|
|
95
112
|
|
|
96
113
|
Copyright © 2026 **Wistant**. Distributed under the **Apache License 2.0**.
|
|
97
114
|
|
|
98
115
|
---
|
|
99
|
-
|
|
100
|
-
<div align="center">
|
|
101
|
-
<p>Engineered for professional AI-Pairing by <b>@wistantkode</b></p>
|
|
102
|
-
</div>
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
This repository follows a **Zero-Trust** security model. We prioritize the integrity of the infrastructure and the protection of sensitive architectural data.
|
|
4
|
+
|
|
5
|
+
## Supported Versions
|
|
6
|
+
|
|
7
|
+
We only provide security updates for the current major version.
|
|
8
|
+
|
|
9
|
+
| Version | Supported |
|
|
10
|
+
| ------- | ------------------ |
|
|
11
|
+
| v1.x | :white_check_mark: |
|
|
12
|
+
| < v1.0 | :x: |
|
|
13
|
+
|
|
14
|
+
## Reporting a Vulnerability
|
|
15
|
+
|
|
16
|
+
If you discover a security vulnerability, please do NOT open a public issue. We take security seriously and prefer a coordinated disclosure.
|
|
17
|
+
|
|
18
|
+
Please report vulnerabilities directly to the maintainer:
|
|
19
|
+
- **Contact**: [@wistant](https://github.com/wistant)
|
|
20
|
+
- **Encryption**: If possible, encrypt your report using a secure channel.
|
|
21
|
+
|
|
22
|
+
## Our Security Principles
|
|
23
|
+
|
|
24
|
+
### 1. Silent Guardian Audit
|
|
25
|
+
Every interaction with the codebase (commits, refactors, releases) triggers a scan for:
|
|
26
|
+
- Exposed secrets (tokens, API keys, private keys).
|
|
27
|
+
- Context leaks (internal paths, IPs, machine names).
|
|
28
|
+
- Insecure API logic or missing sanitization.
|
|
29
|
+
|
|
30
|
+
### 2. Dependency Integrity
|
|
31
|
+
We use strictly audited dependencies.
|
|
32
|
+
- All packages are scanned via `pnpm audit`.
|
|
33
|
+
- Critical CVEs in core libraries results in an immediate suspension of the release flow until resolved.
|
|
34
|
+
|
|
35
|
+
### 3. Isolation by Design
|
|
36
|
+
Sensitive configuration files and release manifests are strictly isolated from the standard development cycle to prevent accidental leakage.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
**Architectural Integrity • Security First • @wistant dotfiles baseline**
|
package/assets/logo.png
ADDED
|
Binary file
|
package/cli/cli.mjs
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* ═══════════════════════════════════════════════════════════════════════
|
|
5
|
+
* DOTFILES INSTALLER · Elite Orchestration · @wistantkode/dotfiles
|
|
6
|
+
* ════════════════════════════════════════───────────────────────════════
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { copyFile, mkdir, readdir, lstat } from 'node:fs/promises';
|
|
10
|
+
import { join, dirname } from 'node:path';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
import { createInterface } from 'node:readline/promises';
|
|
13
|
+
|
|
14
|
+
// ── UI Configuration (256-color) ──────────────────────────────────────
|
|
15
|
+
const RESET = '\x1b[0m';
|
|
16
|
+
const BOLD = '\x1b[1m';
|
|
17
|
+
const DIM = '\x1b[2m';
|
|
18
|
+
const CYAN = '\x1b[38;5;117m';
|
|
19
|
+
const GREEN = '\x1b[38;5;114m';
|
|
20
|
+
const YELLOW = '\x1b[38;5;221m';
|
|
21
|
+
const RED = '\x1b[38;5;203m';
|
|
22
|
+
const GRAY = '\x1b[38;5;244m';
|
|
23
|
+
const WHITE = '\x1b[38;5;255m';
|
|
24
|
+
const DGRAY = '\x1b[38;5;238m';
|
|
25
|
+
const BLUE = '\x1b[38;5;75m';
|
|
26
|
+
|
|
27
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
28
|
+
const pkgRoot = join(__dirname, '..');
|
|
29
|
+
|
|
30
|
+
// ── Layout Components ─────────────────────────────────────────────────
|
|
31
|
+
|
|
32
|
+
const _rep = (n, char = ' ') => char.repeat(Math.max(0, n));
|
|
33
|
+
const sep = () => console.log(`${DGRAY}${_rep(64, '─')}${RESET}`);
|
|
34
|
+
|
|
35
|
+
const renderLogo = () => {
|
|
36
|
+
// Ultra-High-Fidelity "Full Block" Style
|
|
37
|
+
console.log(`\n ${CYAN}██████╗ ██████╗ ████████╗███████╗██╗██╗ ███████╗███████╗`);
|
|
38
|
+
console.log(` ${CYAN}██╔══██╗██╔═══██╗╚══██╔══╝██╔════╝██║██║ ██╔════╝██╔════╝`);
|
|
39
|
+
console.log(` ${CYAN}██║ ██║██║ ██║ ██║ █████╗ ██║██║ █████╗ ███████╗`);
|
|
40
|
+
console.log(` ${CYAN}██║ ██║██║ ██║ ██║ ██╔══╝ ██║██║ ██╔══╝ ╚════██║`);
|
|
41
|
+
console.log(` ${CYAN}██████╔╝╚██████╔╝ ██║ ██║ ██║███████╗███████╗███████║`);
|
|
42
|
+
console.log(` ${CYAN}╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝${RESET}`);
|
|
43
|
+
console.log(`\n ${GRAY}${BOLD}[ PRECISION AI ORCHESTRATION ]${RESET}\n`);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const progress = async (label) => {
|
|
47
|
+
process.stdout.write(` ${GRAY}[${RESET}`);
|
|
48
|
+
for (let i = 0; i < 28; i++) {
|
|
49
|
+
process.stdout.write(`${CYAN}█${RESET}`);
|
|
50
|
+
await new Promise(r => setTimeout(r, 10));
|
|
51
|
+
}
|
|
52
|
+
process.stdout.write(`${GRAY}]${RESET} ${GREEN}${label}${RESET}\n`);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const renderSignature = () => {
|
|
56
|
+
const width = 44;
|
|
57
|
+
const stripAnsi = (str) => str.replace(/\x1b\[[0-9;]*m/g, '');
|
|
58
|
+
const pad = (text, len) => text + _rep(len - stripAnsi(text).length);
|
|
59
|
+
|
|
60
|
+
console.log(`\n ${WHITE}${BOLD}SOURCE & AUTHORSHIP${RESET}`);
|
|
61
|
+
console.log(` ${DGRAY}┌${_rep(width, '──')}┐${RESET}`);
|
|
62
|
+
|
|
63
|
+
const label = (txt, col) => `${col}${BOLD}${txt}${RESET}`;
|
|
64
|
+
|
|
65
|
+
console.log(` ${DGRAY}│${RESET} ${pad(`${label('REPOSITORY', BLUE)} ${BOLD}https://github.com/wistant/dotfiles${RESET}`, width + 17)} ${DGRAY}│${RESET}`);
|
|
66
|
+
console.log(` ${DGRAY}├${_rep(width, '──')}┤${RESET}`);
|
|
67
|
+
console.log(` ${DGRAY}│${RESET} ${pad(`${label('ARCHITECT ', WHITE)} ${BOLD}Wistant${RESET} ${GRAY}(DevOps Architect)${RESET}`, width + 28)} ${DGRAY}│${RESET}`);
|
|
68
|
+
console.log(` ${DGRAY}│${RESET} ${pad(`${label('GITHUB ', BLUE)} ${GRAY}https://github.com/wistant${RESET}`, width + 26)} ${DGRAY}│${RESET}`);
|
|
69
|
+
console.log(` ${DGRAY}└${_rep(width, '──')}┘${RESET}\n`);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// ── Interactive Logic ─────────────────────────────────────────────────
|
|
73
|
+
|
|
74
|
+
const rl = createInterface({
|
|
75
|
+
input: process.stdin,
|
|
76
|
+
output: process.stdout
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
const ask = async (question, defaultYes = true) => {
|
|
80
|
+
const options = defaultYes ? ' (Y/n)' : ' (y/N)';
|
|
81
|
+
const answer = await rl.question(` ${YELLOW}${BOLD}?${RESET} ${question}${GRAY}${options}${RESET} `);
|
|
82
|
+
if (!answer) return defaultYes;
|
|
83
|
+
return answer.toLowerCase().startsWith('y');
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
async function checkDirectory(dir) {
|
|
87
|
+
try {
|
|
88
|
+
const files = await readdir(dir);
|
|
89
|
+
// Ignore common development/system noise
|
|
90
|
+
const filtered = files.filter(f => !['.git', 'node_modules', '.DS_Store', 'package-lock.json', 'pnpm-lock.yaml'].includes(f));
|
|
91
|
+
return filtered.length > 0;
|
|
92
|
+
} catch {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// ── Core Engine ───────────────────────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
async function copyRecursive(src, dest, onFile) {
|
|
100
|
+
const stat = await lstat(src);
|
|
101
|
+
if (stat.isDirectory()) {
|
|
102
|
+
await mkdir(dest, { recursive: true });
|
|
103
|
+
const children = await readdir(src);
|
|
104
|
+
for (const child of children) {
|
|
105
|
+
await copyRecursive(join(src, child), join(dest, child), onFile);
|
|
106
|
+
}
|
|
107
|
+
} else {
|
|
108
|
+
await copyFile(src, dest);
|
|
109
|
+
if (onFile) onFile(dest);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
async function run() {
|
|
114
|
+
process.stdout.write('\x1Bc'); // Clear screen
|
|
115
|
+
renderLogo();
|
|
116
|
+
sep();
|
|
117
|
+
|
|
118
|
+
const targetDir = process.cwd();
|
|
119
|
+
console.log(`\n ${GRAY}System Target:${RESET} ${WHITE}${BOLD}${targetDir}${RESET}`);
|
|
120
|
+
|
|
121
|
+
const proceedTarget = await ask('Initiate deployment in this directory?', true);
|
|
122
|
+
if (!proceedTarget) {
|
|
123
|
+
console.log(`\n ${RED}Deployment cancelled by user.${RESET}\n`);
|
|
124
|
+
rl.close();
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
// Phase 1: Directory Audit
|
|
129
|
+
const isEmpty = !(await checkDirectory(targetDir));
|
|
130
|
+
if (isEmpty) {
|
|
131
|
+
console.log(` ${GREEN}${BOLD}✔ TARGET DIRECTORY IS CLEAN${RESET}`);
|
|
132
|
+
} else {
|
|
133
|
+
console.log(` ${YELLOW}${BOLD}⚠ TARGET DIRECTORY IS NOT EMPTY${RESET}`);
|
|
134
|
+
const proceed = await ask('Deployment may overwrite existing files. Force installation?', false);
|
|
135
|
+
if (!proceed) {
|
|
136
|
+
console.log(`\n ${RED}Deployment cancelled by user.${RESET}\n`);
|
|
137
|
+
rl.close();
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Phase 2: Protocol Selection
|
|
143
|
+
let protocolDest = '.protocols';
|
|
144
|
+
console.log(`\n ${CYAN}${BOLD}i GOVERNANCE PLACEMENT${RESET}`);
|
|
145
|
+
const useDotDir = await ask('Deploy protocols to .protocols/ folder? (Recommended)', true);
|
|
146
|
+
if (!useDotDir) {
|
|
147
|
+
protocolDest = 'protocols';
|
|
148
|
+
console.log(` ${DIM}Protocols will be deployed to 'protocols/' (Visibility Mode).${RESET}`);
|
|
149
|
+
} else {
|
|
150
|
+
console.log(` ${DIM}Protocols will be deployed to '.protocols/' (Architecture Standard).${RESET}`);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const ASSETS = [
|
|
154
|
+
{ src: 'gitignore', dest: '.gitignore', label: 'Ignore patterns' },
|
|
155
|
+
{ src: 'LICENSE', dest: 'LICENSE', label: 'License' },
|
|
156
|
+
{ src: 'protocols', dest: protocolDest, label: 'Governance protocols', isDir: true }
|
|
157
|
+
];
|
|
158
|
+
|
|
159
|
+
sep();
|
|
160
|
+
console.log(`\n ${BOLD}▶ Ready to initiate deployment sequence...${RESET}`);
|
|
161
|
+
const confirm = await ask('Apply changes to your system?', true);
|
|
162
|
+
if (!confirm) {
|
|
163
|
+
console.log(`\n ${RED}Deployment aborted.${RESET}\n`);
|
|
164
|
+
rl.close();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
console.log('');
|
|
169
|
+
await progress('Validating package integrity');
|
|
170
|
+
|
|
171
|
+
const deployedFiles = [];
|
|
172
|
+
|
|
173
|
+
for (const asset of ASSETS) {
|
|
174
|
+
try {
|
|
175
|
+
const srcPath = join(pkgRoot, asset.src);
|
|
176
|
+
const destPath = join(targetDir, asset.dest);
|
|
177
|
+
|
|
178
|
+
if (asset.isDir) {
|
|
179
|
+
await copyRecursive(srcPath, destPath, (f) => {
|
|
180
|
+
deployedFiles.push(f.replace(targetDir, ''));
|
|
181
|
+
});
|
|
182
|
+
} else {
|
|
183
|
+
await copyFile(srcPath, destPath);
|
|
184
|
+
deployedFiles.push('/' + asset.dest);
|
|
185
|
+
}
|
|
186
|
+
} catch (err) {
|
|
187
|
+
console.error(` ${RED}✘${RESET} Failed to deploy ${asset.src}: ${err.message}`);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
await progress('Finalizing system orchestration');
|
|
192
|
+
|
|
193
|
+
// Detailed Audit Logs
|
|
194
|
+
console.log(`\n ${BOLD}DEPLOYMENT AUDIT${RESET}`);
|
|
195
|
+
console.log(` ${DGRAY}${_rep(45, '─')}${RESET}`);
|
|
196
|
+
for (const file of deployedFiles.sort()) {
|
|
197
|
+
console.log(` ${GREEN}✔${RESET} ${GRAY}${file}${RESET}`);
|
|
198
|
+
}
|
|
199
|
+
console.log(` ${DGRAY}${_rep(45, '─')}${RESET}`);
|
|
200
|
+
|
|
201
|
+
console.log(`\n ${GREEN}${BOLD}✔ INFRASTRUCTURE DEPLOYED SUCCESSFULLY.${RESET}`);
|
|
202
|
+
console.log(` ${GRAY}Your environment is now optimized for professional AI pairing.${RESET}`);
|
|
203
|
+
|
|
204
|
+
renderSignature();
|
|
205
|
+
|
|
206
|
+
console.log(` ${DIM}Thank you for choosing high-end architectural standards.${RESET}\n`);
|
|
207
|
+
sep();
|
|
208
|
+
console.log('');
|
|
209
|
+
|
|
210
|
+
rl.close();
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
run().catch(err => {
|
|
214
|
+
console.error(`\n ${RED}${BOLD}✗ FATAL ERROR${RESET} ${err.message}\n`);
|
|
215
|
+
if (rl) rl.close();
|
|
216
|
+
process.exit(1);
|
|
217
|
+
});
|
package/github.sh
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# ═══════════════════════════════════════════════════════════════════════
|
|
4
4
|
# GITHUB SYNC · Integrity Gate · @wistantkode/dotfiles
|
|
5
|
-
#
|
|
5
|
+
# ════════════════════════════════════════───────────────────────════════
|
|
6
6
|
|
|
7
|
-
# ── Color palette (256-color)
|
|
7
|
+
# ── Color palette (Minimalist 256-color) ──────────────────────────────
|
|
8
8
|
RESET='\033[0m'; BOLD='\033[1m'; DIM='\033[2m'
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
WHITE='\033[38;5;255m'; GRAY='\033[38;5;244m'; DGRAY='\033[38;5;238m'
|
|
10
|
+
RED='\033[38;5;203m'; GREEN='\033[38;5;114m'; YELLOW='\033[38;5;221m'
|
|
11
|
+
BLUE='\033[38;5;75m'; CYAN='\033[38;5;117m'
|
|
12
12
|
|
|
13
13
|
# ── Table dimensions ──────────────────────────────────────────────────
|
|
14
14
|
HASH_W=8 # hash column display width
|
|
@@ -16,13 +16,21 @@ MSG_W=52 # message column display width
|
|
|
16
16
|
|
|
17
17
|
# ── Layout helpers ────────────────────────────────────────────────────
|
|
18
18
|
_rep() { printf "%${1}s" | tr ' ' "${2}"; }
|
|
19
|
-
_sep() { echo -e "${DGRAY}$(_rep
|
|
20
|
-
|
|
19
|
+
_sep() { echo -e "${DGRAY}$(_rep 66 '─')${RESET}"; }
|
|
20
|
+
|
|
21
|
+
_logo() {
|
|
22
|
+
echo -e "\n ${WHITE}██████╗ ██╗████████╗██╗ ██╗██╗ ██╗██████╗ "
|
|
23
|
+
echo -e " ${WHITE}██╔════╝ ██║╚══██╔══╝██║ ██║██║ ██║██╔══██╗"
|
|
24
|
+
echo -e " ${WHITE}██║ ███╗██║ ██║ ███████║██║ ██║██████╔╝"
|
|
25
|
+
echo -e " ${WHITE}██║ ██║██║ ██║ ██╔══██║██║ ██║██╔══██╗"
|
|
26
|
+
echo -e " ${WHITE}╚██████╔╝██║ ██║ ██║ ██║╚██████╔╝██████╔╝"
|
|
27
|
+
echo -e " ${WHITE} ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ${RESET}"
|
|
28
|
+
echo -e "\n ${GRAY}${BOLD}[ GITHUB AUTOMATION SYNC ]${RESET}\n"
|
|
29
|
+
}
|
|
21
30
|
|
|
22
31
|
_header() {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
echo -e "${DGRAY} ├$(_rep $((HASH_W+2)) '─')┼$(_rep $((MSG_W+2)) '─')┤${RESET}"
|
|
32
|
+
printf " ${BOLD}${GRAY}%-${HASH_W}s %-${MSG_W}s${RESET}\n" "HASH" "COMMIT MESSAGE"
|
|
33
|
+
_sep
|
|
26
34
|
}
|
|
27
35
|
|
|
28
36
|
_row() {
|
|
@@ -31,23 +39,17 @@ _row() {
|
|
|
31
39
|
local raw="$2"
|
|
32
40
|
[ ${#raw} -gt $((MSG_W-1)) ] && raw="${raw:0:$((MSG_W-3))}..."
|
|
33
41
|
msg=$(printf "%-${MSG_W}s" "$raw")
|
|
34
|
-
printf "
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
_footer() {
|
|
38
|
-
echo -e "${DGRAY} ╰$(_rep $((HASH_W+2)) '─')┴$(_rep $((MSG_W+2)) '─')╯${RESET}"
|
|
42
|
+
printf " ${BLUE}%s${RESET} ${WHITE}%s${RESET}\n" "$hash" "$msg"
|
|
39
43
|
}
|
|
40
44
|
|
|
41
|
-
# ── Progress bar animation ────────────────────────────────────────────
|
|
42
45
|
_progress() {
|
|
43
46
|
local label="$1"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
sleep 0.018
|
|
47
|
+
printf " ${GRAY}%-28s ${RESET}" "$label"
|
|
48
|
+
for ((i=1; i<=20; i++)); do
|
|
49
|
+
printf "${WHITE}·${RESET}"
|
|
50
|
+
sleep 0.015
|
|
49
51
|
done
|
|
50
|
-
printf "${
|
|
52
|
+
printf " ${GREEN}✔${RESET}\n"
|
|
51
53
|
}
|
|
52
54
|
|
|
53
55
|
# ── Core utilities ────────────────────────────────────────────────────
|
|
@@ -61,7 +63,7 @@ abort() {
|
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
ask() {
|
|
64
|
-
echo -ne "\n ${
|
|
66
|
+
echo -ne "\n ${WHITE}${BOLD}?${RESET} $1 ${GRAY}(y/N)${RESET} "
|
|
65
67
|
read -r _r
|
|
66
68
|
[[ "$_r" =~ ^([yY][eE][sS]|[yY])$ ]]
|
|
67
69
|
}
|
|
@@ -86,23 +88,20 @@ LOCAL_ONLY_TAGS=$(
|
|
|
86
88
|
TAG_COUNT=0
|
|
87
89
|
[ -n "$LOCAL_ONLY_TAGS" ] && TAG_COUNT=$(echo "$LOCAL_ONLY_TAGS" | grep -c .)
|
|
88
90
|
PUSH_TAGS=""
|
|
89
|
-
[ "$TAG_COUNT" -gt 0 ] && PUSH_TAGS="--tags"
|
|
91
|
+
[ "$TAG_COUNT" -gt 0 ] && PUSH_TAGS="--follow-tags"
|
|
90
92
|
|
|
91
93
|
case "$CURRENT_BRANCH" in
|
|
92
94
|
main|master) BLABEL="${RED}${BOLD}⬡ PRODUCTION${RESET}" ;;
|
|
93
|
-
dev|develop) BLABEL="${YELLOW}◈ INTEGRATION${RESET}" ;;
|
|
94
|
-
feat/*) BLABEL="${GREEN}◈ FEATURE${RESET}" ;;
|
|
95
|
-
fix/*) BLABEL="${CYAN}◈ BUGFIX${RESET}" ;;
|
|
96
|
-
refactor/*) BLABEL="${BLUE}◈ REFACTOR${RESET}" ;;
|
|
97
95
|
*) BLABEL="${GRAY}◈ BRANCH${RESET}" ;;
|
|
98
96
|
esac
|
|
99
97
|
|
|
100
98
|
# ── Phase 1 · Working tree check ─────────────────────────────────────
|
|
101
99
|
clear
|
|
100
|
+
_logo
|
|
101
|
+
_sep
|
|
102
102
|
echo ""
|
|
103
|
-
echo -e " ${WHITE}${BOLD}◆
|
|
103
|
+
echo -e " ${WHITE}${BOLD}◆ INTEGRITY GATE${RESET} ${DGRAY}· Software Engineer${RESET}"
|
|
104
104
|
echo ""
|
|
105
|
-
_sep
|
|
106
105
|
|
|
107
106
|
if ! git diff-index --quiet HEAD -- 2>/dev/null; then
|
|
108
107
|
echo ""
|
|
@@ -113,10 +112,9 @@ if ! git diff-index --quiet HEAD -- 2>/dev/null; then
|
|
|
113
112
|
fi
|
|
114
113
|
|
|
115
114
|
# ── Phase 2 · Summary panel ───────────────────────────────────────────
|
|
116
|
-
|
|
117
|
-
printf " ${GRAY}%-
|
|
118
|
-
printf " ${GRAY}%-
|
|
119
|
-
printf " ${GRAY}%-14s${RESET} ${BOLD}%s${RESET} to publish\n" "Tags" "$TAG_COUNT"
|
|
115
|
+
printf " ${GRAY}%-12s${RESET} ${WHITE}${BOLD}%s${RESET} %b\n" "Branch" "$CURRENT_BRANCH" "$BLABEL"
|
|
116
|
+
printf " ${GRAY}%-12s${RESET} ${WHITE}%s${RESET} commit(s) ahead\n" "Ahead" "$COMMIT_COUNT"
|
|
117
|
+
printf " ${GRAY}%-12s${RESET} ${WHITE}%s${RESET} to publish\n" "Tags" "$TAG_COUNT"
|
|
120
118
|
echo ""
|
|
121
119
|
_sep
|
|
122
120
|
|
|
@@ -129,7 +127,7 @@ if [ "$COMMIT_COUNT" -gt 0 ]; then
|
|
|
129
127
|
m=$(echo "$line" | cut -d' ' -f2-)
|
|
130
128
|
_row "$h" "$m"
|
|
131
129
|
done <<< "$COMMITS_RAW"
|
|
132
|
-
|
|
130
|
+
_sep
|
|
133
131
|
fi
|
|
134
132
|
|
|
135
133
|
# Tags list
|
|
@@ -137,70 +135,40 @@ if [ "$TAG_COUNT" -gt 0 ]; then
|
|
|
137
135
|
echo ""
|
|
138
136
|
echo -e " ${GRAY}Unpublished tags:${RESET}"
|
|
139
137
|
while IFS= read -r tag; do
|
|
140
|
-
echo -e " ${GREEN}
|
|
138
|
+
echo -e " ${GREEN}✔${RESET} ${WHITE}${BOLD}$tag${RESET}"
|
|
141
139
|
done <<< "$LOCAL_ONLY_TAGS"
|
|
140
|
+
_sep
|
|
142
141
|
fi
|
|
143
142
|
|
|
143
|
+
# ── Phase 3 · Final confirmation ──────────────────────────────────────
|
|
144
144
|
echo ""
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
case "$CURRENT_BRANCH" in
|
|
150
|
-
main|master)
|
|
151
|
-
echo -e " ${RED}${BOLD}⚠ PRODUCTION BRANCH${RESET}"
|
|
152
|
-
echo -e " ${DIM}Every push to this branch triggers the public release pipeline.${RESET}"
|
|
153
|
-
ask "You are on ${BOLD}${CURRENT_BRANCH}${RESET}. Proceed to final review?" \
|
|
154
|
-
|| abort "Cancelled by operator."
|
|
155
|
-
;;
|
|
156
|
-
dev|develop)
|
|
157
|
-
echo -e " ${YELLOW}${BOLD}◈ INTEGRATION BRANCH${RESET}"
|
|
158
|
-
ask "Push to ${BOLD}${REMOTE}${RESET}?" || abort "Cancelled by operator."
|
|
159
|
-
;;
|
|
160
|
-
*)
|
|
161
|
-
ask "Push ${BOLD}${CURRENT_BRANCH}${RESET} to remote?" || abort "Cancelled by operator."
|
|
162
|
-
;;
|
|
163
|
-
esac
|
|
164
|
-
|
|
165
|
-
# ── Phase 4 · Final confirmation ──────────────────────────────────────
|
|
166
|
-
echo ""
|
|
167
|
-
_sep
|
|
145
|
+
SUMMARY="${WHITE}${BOLD}${COMMIT_COUNT}${RESET} commit(s)"
|
|
146
|
+
[ "$TAG_COUNT" -gt 0 ] && SUMMARY+=" ${DGRAY}+${RESET} ${WHITE}${BOLD}${TAG_COUNT}${RESET} tag(s)"
|
|
147
|
+
printf " ${GRAY}%-12s${RESET} %b\n" "Will push" "$SUMMARY"
|
|
148
|
+
printf " ${GRAY}%-12s${RESET} ${BLUE}%s${RESET}\n" "Target" "$REMOTE"
|
|
168
149
|
echo ""
|
|
169
|
-
SUMMARY="${BOLD}${COMMIT_COUNT}${RESET} commit(s)"
|
|
170
|
-
[ "$TAG_COUNT" -gt 0 ] && SUMMARY+=" ${DGRAY}+${RESET} ${BOLD}${TAG_COUNT}${RESET} tag(s)"
|
|
171
|
-
printf " ${GRAY}%-14s${RESET} %b\n" "Will push" "$SUMMARY"
|
|
172
|
-
printf " ${GRAY}%-14s${RESET} ${BOLD}%s${RESET}\n" "Target" "$REMOTE"
|
|
173
|
-
echo ""
|
|
174
|
-
echo -e " ${DIM}SSH key passphrase will be required by git if not cached.${RESET}"
|
|
175
150
|
|
|
176
|
-
ask "
|
|
177
|
-
|| abort "Final gate: push cancelled."
|
|
151
|
+
ask "Confirm push to remote?" || abort "Gate: push cancelled."
|
|
178
152
|
|
|
179
|
-
# ── Phase
|
|
153
|
+
# ── Phase 4 · Projection ──────────────────────────────────────────────
|
|
180
154
|
echo ""
|
|
181
155
|
_sep
|
|
182
156
|
echo ""
|
|
183
|
-
_progress "Initializing
|
|
184
|
-
_progress "Verifying
|
|
185
|
-
_progress "
|
|
186
|
-
echo ""
|
|
187
|
-
echo -e " ${DGRAY}$(_rep 64 '─')${RESET}"
|
|
188
|
-
echo -e " ${BOLD}▶ git push${RESET} ${DGRAY}(passphrase prompt appears below if required)${RESET}"
|
|
189
|
-
echo -e " ${DGRAY}$(_rep 64 '─')${RESET}"
|
|
157
|
+
_progress "Initializing sync"
|
|
158
|
+
_progress "Verifying state"
|
|
159
|
+
_progress "Final handoff"
|
|
190
160
|
echo ""
|
|
191
161
|
|
|
192
162
|
if git push --quiet $PUSH_TAGS; then
|
|
193
163
|
echo ""
|
|
194
164
|
_sep
|
|
195
165
|
echo ""
|
|
196
|
-
echo -e " ${GREEN}${BOLD}✔ SUCCESS${RESET} Infrastructure synchronized
|
|
197
|
-
[ "$TAG_COUNT" -gt 0 ] && \
|
|
198
|
-
echo -e " ${GRAY}Tags published. GitHub Actions pipeline may now be triggered.${RESET}"
|
|
166
|
+
echo -e " ${GREEN}${BOLD}✔ SUCCESS${RESET} Infrastructure synchronized."
|
|
199
167
|
echo ""
|
|
200
168
|
_sep
|
|
201
169
|
else
|
|
202
170
|
echo ""
|
|
203
|
-
abort "Git push failed. Check
|
|
171
|
+
abort "Git push failed. Check connectivity."
|
|
204
172
|
fi
|
|
205
173
|
|
|
206
174
|
echo ""
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wistantkode/dotfiles",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "High-End Linux Infrastructure & AI-Driven Orchestration Protocols",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": {
|
|
8
|
-
"dotfiles": "
|
|
8
|
+
"dotfiles": "cli/cli.mjs"
|
|
9
9
|
},
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
package/assets/dotfiles.png
DELETED
|
Binary file
|
package/assets/memoji.png
DELETED
|
Binary file
|
package/assets/wistant-logo.png
DELETED
|
Binary file
|
package/bin/cli.mjs
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { copyFile, mkdir, readdir, lstat } from 'node:fs/promises';
|
|
4
|
-
import { join, dirname } from 'node:path';
|
|
5
|
-
import { fileURLToPath } from 'node:url';
|
|
6
|
-
|
|
7
|
-
// ── UI Configuration (256-color) ──────────────────────────────────────
|
|
8
|
-
const RESET = '\x1b[0m';
|
|
9
|
-
const BOLD = '\x1b[1m';
|
|
10
|
-
const DIM = '\x1b[2m';
|
|
11
|
-
const CYAN = '\x1b[38;5;117m';
|
|
12
|
-
const GREEN = '\x1b[38;5;114m';
|
|
13
|
-
const YELLOW = '\x1b[38;5;221m';
|
|
14
|
-
const RED = '\x1b[38;5;203m';
|
|
15
|
-
const GRAY = '\x1b[38;5;244m';
|
|
16
|
-
const WHITE = '\x1b[38;5;255m';
|
|
17
|
-
const DGRAY = '\x1b[38;5;238m';
|
|
18
|
-
|
|
19
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
20
|
-
const pkgRoot = join(__dirname, '..');
|
|
21
|
-
|
|
22
|
-
const FILES_TO_INSTALL = [
|
|
23
|
-
'gitignore',
|
|
24
|
-
'LICENSE'
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
const DIRECTORIES_TO_INSTALL = [
|
|
28
|
-
'protocols'
|
|
29
|
-
];
|
|
30
|
-
|
|
31
|
-
// ── Utilities ─────────────────────────────────────────────────────────
|
|
32
|
-
|
|
33
|
-
const sep = () => console.log(`${DGRAY}${'─'.repeat(60)}${RESET}`);
|
|
34
|
-
|
|
35
|
-
const progress = async (label) => {
|
|
36
|
-
process.stdout.write(` ${GRAY}[${RESET}`);
|
|
37
|
-
for (let i = 0; i < 24; i++) {
|
|
38
|
-
process.stdout.write(`${CYAN}█${RESET}`);
|
|
39
|
-
await new Promise(r => setTimeout(r, 15));
|
|
40
|
-
}
|
|
41
|
-
process.stdout.write(`${GRAY}]${RESET} ${GREEN}${label}${RESET}\n`);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
async function copyRecursive(src, dest) {
|
|
45
|
-
const stat = await lstat(src);
|
|
46
|
-
if (stat.isDirectory()) {
|
|
47
|
-
await mkdir(dest, { recursive: true });
|
|
48
|
-
const children = await readdir(src);
|
|
49
|
-
for (const child of children) {
|
|
50
|
-
await copyRecursive(join(src, child), join(dest, child));
|
|
51
|
-
}
|
|
52
|
-
} else {
|
|
53
|
-
await copyFile(src, dest);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
async function run() {
|
|
58
|
-
console.clear();
|
|
59
|
-
console.log(`\n ${WHITE}${BOLD}◆ DOTFILES INSTALLER${RESET} ${DGRAY}· @wistantkode/dotfiles${RESET}\n`);
|
|
60
|
-
sep();
|
|
61
|
-
|
|
62
|
-
const targetDir = process.cwd();
|
|
63
|
-
console.log(`\n ${GRAY}Target Directory:${RESET} ${CYAN}${BOLD}${targetDir}${RESET}\n`);
|
|
64
|
-
|
|
65
|
-
sep();
|
|
66
|
-
console.log(`\n ${BOLD}▶ Initiating deployment...${RESET}\n`);
|
|
67
|
-
|
|
68
|
-
await progress('Verifying package integrity...');
|
|
69
|
-
|
|
70
|
-
// Files deployment
|
|
71
|
-
for (const file of FILES_TO_INSTALL) {
|
|
72
|
-
try {
|
|
73
|
-
const destName = file === 'gitignore' ? '.gitignore' : file;
|
|
74
|
-
await copyFile(join(pkgRoot, file), join(targetDir, destName));
|
|
75
|
-
console.log(` ${GREEN}✔${RESET} Deployed ${BOLD}${destName}${RESET}`);
|
|
76
|
-
} catch (err) {
|
|
77
|
-
console.error(` ${RED}✘${RESET} Failed to deploy ${file}: ${err.message}`);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Directories deployment
|
|
82
|
-
for (const dir of DIRECTORIES_TO_INSTALL) {
|
|
83
|
-
try {
|
|
84
|
-
const destName = dir === 'protocols' ? '.protocols' : dir;
|
|
85
|
-
await copyRecursive(join(pkgRoot, dir), join(targetDir, destName));
|
|
86
|
-
console.log(` ${GREEN}✔${RESET} Deployed ${BOLD}${destName}/${RESET}`);
|
|
87
|
-
} catch (err) {
|
|
88
|
-
console.error(` ${RED}✘${RESET} Failed to deploy ${dir}: ${err.message}`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
await progress('Finalizing configuration...');
|
|
93
|
-
|
|
94
|
-
console.log(`\n ${GREEN}${BOLD}✔ SUCCESS${RESET} Infrastructure deployed successfully.`);
|
|
95
|
-
console.log(` ${GRAY}Your environment is now orchestrated by @wistantkode protocols.${RESET}\n`);
|
|
96
|
-
sep();
|
|
97
|
-
console.log('');
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
run().catch(err => {
|
|
101
|
-
console.error(`\n ${RED}${BOLD}✗ FATAL ERROR${RESET} ${err.message}\n`);
|
|
102
|
-
process.exit(1);
|
|
103
|
-
});
|