dksetup 1.0.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/ASCII Animations/3dwalk.json +1 -0
- package/ASCII Animations/3dwalk.md +157 -0
- package/ASCII Animations/ring aniamtion.html +115 -0
- package/cli-tools/claude.ts +27 -0
- package/cli-tools/cli-template.ts +30 -0
- package/cli-tools/droi.ts +27 -0
- package/cli-tools/droid-agent.ts +27 -0
- package/cli-tools/droid-factory.ts +27 -0
- package/cli-tools/gemini.ts +28 -0
- package/cli-tools/gh.ts +35 -0
- package/cli-tools/glm.ts +27 -0
- package/cli-tools/kimi.ts +27 -0
- package/cli-tools/opencode.ts +27 -0
- package/editors/antigravity.ts +24 -0
- package/editors/opencode-desktop.ts +23 -0
- package/editors/vscode/extensions.ts +23 -0
- package/editors/vscode/installer.ts +35 -0
- package/editors/zed.ts +29 -0
- package/index.ts +223 -0
- package/installers/animator.ts +115 -0
- package/installers/blender.ts +48 -0
- package/installers/git.ts +35 -0
- package/installers/installer.ts +13 -0
- package/installers/npm.ts +28 -0
- package/installers/powertoys.ts +38 -0
- package/languages/cpp.ts +44 -0
- package/languages/nodejs.ts +34 -0
- package/languages/python.ts +35 -0
- package/languages/typescript.ts +27 -0
- package/package.json +32 -0
- package/plan.md +53 -0
- package/test-banner.ts +38 -0
- package/test-ora.ts +16 -0
- package/test.ts +3 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Extracts animation frames from the provided HTML/JS file dynamically.
|
|
6
|
+
* @param filePath Path to the animation file
|
|
7
|
+
* @returns Array of string frames
|
|
8
|
+
*/
|
|
9
|
+
export function getAnimationFrames(filePath: string): string[] {
|
|
10
|
+
try {
|
|
11
|
+
const fullPath = path.resolve(filePath);
|
|
12
|
+
if (!fs.existsSync(fullPath)) {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const content = fs.readFileSync(fullPath, 'utf8');
|
|
17
|
+
const frames: string[] = [];
|
|
18
|
+
|
|
19
|
+
// Simple string splitting to avoid regex ReDoS
|
|
20
|
+
const parts = content.split('n[');
|
|
21
|
+
for (let i = 1; i < parts.length; i++) {
|
|
22
|
+
const p = parts[i];
|
|
23
|
+
const startStr = "] = '";
|
|
24
|
+
const startIdx = p.indexOf(startStr);
|
|
25
|
+
if (startIdx > -1) {
|
|
26
|
+
const body = p.substring(startIdx + startStr.length);
|
|
27
|
+
const endIdx = body.indexOf("';");
|
|
28
|
+
|
|
29
|
+
if (endIdx > -1) {
|
|
30
|
+
// Extract the string and replace literal \\n with actual newlines
|
|
31
|
+
let frame = body.substring(0, endIdx);
|
|
32
|
+
frame = frame.replace(/\\n/g, '\n');
|
|
33
|
+
// Add some spacing or trim if necessary, but keep original for now
|
|
34
|
+
frames.push(frame);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Second pass: Crop the frames to the minimum bounding box
|
|
40
|
+
let minLeadingSpaces = Infinity;
|
|
41
|
+
let minTrailingSpaces = Infinity;
|
|
42
|
+
let firstNonEmptyLine = Infinity;
|
|
43
|
+
let lastNonEmptyLine = -1;
|
|
44
|
+
|
|
45
|
+
const parsedFrames = frames.map(f => f.split('\n'));
|
|
46
|
+
const frameHeight = parsedFrames[0]?.length || 0;
|
|
47
|
+
|
|
48
|
+
for (const lines of parsedFrames) {
|
|
49
|
+
for (let r = 0; r < lines.length; r++) {
|
|
50
|
+
const line = lines[r];
|
|
51
|
+
if (line.trim().length === 0) continue;
|
|
52
|
+
|
|
53
|
+
firstNonEmptyLine = Math.min(firstNonEmptyLine, r);
|
|
54
|
+
lastNonEmptyLine = Math.max(lastNonEmptyLine, r);
|
|
55
|
+
|
|
56
|
+
const leading = line.match(/^ */)?.[0].length || 0;
|
|
57
|
+
const trailing = line.match(/ *$/)?.[0].length || 0;
|
|
58
|
+
|
|
59
|
+
minLeadingSpaces = Math.min(minLeadingSpaces, leading);
|
|
60
|
+
minTrailingSpaces = Math.min(minTrailingSpaces, trailing);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const croppedFrames: string[] = [];
|
|
65
|
+
for (const lines of parsedFrames) {
|
|
66
|
+
const croppedLines = [];
|
|
67
|
+
for (let r = firstNonEmptyLine; r <= lastNonEmptyLine; r++) {
|
|
68
|
+
const line = lines[r] || '';
|
|
69
|
+
// Remove the minimum leading spaces, and trim the end
|
|
70
|
+
croppedLines.push(line.substring(Math.min(minLeadingSpaces, line.length)).trimEnd());
|
|
71
|
+
}
|
|
72
|
+
croppedFrames.push(croppedLines.join('\n'));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// User requested smaller size, re-adding downscaling to maximum 25x12
|
|
76
|
+
const MAX_WIDTH = 25;
|
|
77
|
+
const MAX_HEIGHT = 12;
|
|
78
|
+
|
|
79
|
+
const scaledFrames: string[] = [];
|
|
80
|
+
for (const frame of croppedFrames) {
|
|
81
|
+
const lines = frame.split('\n');
|
|
82
|
+
const height = lines.length;
|
|
83
|
+
const width = Math.max(...lines.map(l => l.length));
|
|
84
|
+
|
|
85
|
+
if (height > MAX_HEIGHT || width > MAX_WIDTH) {
|
|
86
|
+
const scaleY = height / MAX_HEIGHT;
|
|
87
|
+
const scaleX = width / MAX_WIDTH;
|
|
88
|
+
const scale = Math.max(scaleX, scaleY);
|
|
89
|
+
|
|
90
|
+
const newHeight = Math.floor(height / scale);
|
|
91
|
+
const newWidth = Math.floor(width / scale);
|
|
92
|
+
|
|
93
|
+
const scaledLines = [];
|
|
94
|
+
for (let y = 0; y < newHeight; y++) {
|
|
95
|
+
let newLine = '';
|
|
96
|
+
for (let x = 0; x < newWidth; x++) {
|
|
97
|
+
const origY = Math.floor(y * scale);
|
|
98
|
+
const origX = Math.floor(x * scale);
|
|
99
|
+
const origChar = lines[origY]?.[origX] || ' ';
|
|
100
|
+
newLine += origChar;
|
|
101
|
+
}
|
|
102
|
+
scaledLines.push(newLine);
|
|
103
|
+
}
|
|
104
|
+
scaledFrames.push(scaledLines.join('\n'));
|
|
105
|
+
} else {
|
|
106
|
+
scaledFrames.push(frame);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return scaledFrames;
|
|
111
|
+
} catch (e) {
|
|
112
|
+
console.error("Animator error:", e);
|
|
113
|
+
return [];
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Installer } from './installer.js';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import * as os from 'os';
|
|
5
|
+
|
|
6
|
+
export const BlenderInstaller: Installer = {
|
|
7
|
+
name: 'Blender',
|
|
8
|
+
description: 'Free and open source 3D creation suite',
|
|
9
|
+
check: async () => {
|
|
10
|
+
const platform = os.platform();
|
|
11
|
+
try {
|
|
12
|
+
if (platform === 'win32') {
|
|
13
|
+
// Checking via winget or checking Program Files
|
|
14
|
+
execSync('winget list -e --id BlenderFoundation.Blender', { stdio: 'ignore' });
|
|
15
|
+
return true;
|
|
16
|
+
} else if (platform === 'darwin') {
|
|
17
|
+
execSync('ls /Applications/Blender.app', { stdio: 'ignore' });
|
|
18
|
+
return true;
|
|
19
|
+
} else {
|
|
20
|
+
execSync('blender --version', { stdio: 'ignore' });
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
} catch {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
install: async () => {
|
|
28
|
+
const platform = os.platform();
|
|
29
|
+
console.log(chalk.cyan(`Installing or Updating ${chalk.bold('Blender')}...`));
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
if (platform === 'win32') {
|
|
33
|
+
console.log(chalk.gray('> winget install --id BlenderFoundation.Blender -e --source winget --accept-package-agreements --accept-source-agreements'));
|
|
34
|
+
// Remove the comment below to actually run the command
|
|
35
|
+
execSync('winget install --id BlenderFoundation.Blender -e --source winget --accept-package-agreements --accept-source-agreements', { stdio: 'inherit' });
|
|
36
|
+
} else if (platform === 'darwin') {
|
|
37
|
+
console.log(chalk.gray('> brew install --cask blender'));
|
|
38
|
+
execSync('brew install --cask blender', { stdio: 'inherit' });
|
|
39
|
+
} else if (platform === 'linux') {
|
|
40
|
+
console.log(chalk.gray('> sudo snap install blender --classic'));
|
|
41
|
+
execSync('sudo snap install blender --classic', { stdio: 'inherit' });
|
|
42
|
+
}
|
|
43
|
+
console.log(chalk.green('✔ Blender installed/updated successfully!'));
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.log(chalk.red('✖ Failed to install or update Blender. It might already be running or require admin privileges.'));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Installer } from './installer.js';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import * as os from 'os';
|
|
5
|
+
|
|
6
|
+
export const GitInstaller: Installer = {
|
|
7
|
+
name: 'Git',
|
|
8
|
+
description: 'Distributed version control system',
|
|
9
|
+
check: async () => {
|
|
10
|
+
try {
|
|
11
|
+
execSync('git --version', { stdio: 'ignore' });
|
|
12
|
+
return true;
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
install: async () => {
|
|
18
|
+
const platform = os.platform();
|
|
19
|
+
console.log(chalk.cyan(`Installing ${chalk.bold('Git')}...`));
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
if (platform === 'win32') {
|
|
23
|
+
console.log(chalk.gray('> winget install --id Git.Git -e --source winget'));
|
|
24
|
+
// execSync('winget install --id Git.Git -e --source winget', { stdio: 'inherit' });
|
|
25
|
+
} else if (platform === 'darwin') {
|
|
26
|
+
console.log(chalk.gray('> brew install git'));
|
|
27
|
+
} else if (platform === 'linux') {
|
|
28
|
+
console.log(chalk.gray('> sudo apt-get install git'));
|
|
29
|
+
}
|
|
30
|
+
console.log(chalk.green('✔ Git installed successfully!'));
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.log(chalk.red('✖ Failed to install Git.'));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface Installer {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
/**
|
|
5
|
+
* Checks if the software is already installed.
|
|
6
|
+
* Returns true if installed, false otherwise.
|
|
7
|
+
*/
|
|
8
|
+
check: () => Promise<boolean>;
|
|
9
|
+
/**
|
|
10
|
+
* Runs the installation process for the software.
|
|
11
|
+
*/
|
|
12
|
+
install: () => Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Installer } from './installer.js';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
|
|
5
|
+
export const NpmInstaller: Installer = {
|
|
6
|
+
name: 'npm',
|
|
7
|
+
description: 'Node Package Manager',
|
|
8
|
+
check: async () => {
|
|
9
|
+
try {
|
|
10
|
+
execSync('npm --version', { stdio: 'ignore' });
|
|
11
|
+
return true;
|
|
12
|
+
} catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
install: async () => {
|
|
17
|
+
console.log(chalk.cyan(`Installing or Updating ${chalk.bold('npm')}...`));
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
console.log(chalk.gray('> npm install -g npm'));
|
|
21
|
+
// Remove the comment below to actually run the command if desired
|
|
22
|
+
// execSync('npm install -g npm', { stdio: 'inherit' });
|
|
23
|
+
console.log(chalk.green('✔ npm installed/updated successfully!'));
|
|
24
|
+
} catch (error) {
|
|
25
|
+
console.log(chalk.red('✖ Failed to install or update npm. Make sure Node.js is installed first.'));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Installer } from './installer.js';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import * as os from 'os';
|
|
5
|
+
|
|
6
|
+
export const PowerToysInstaller: Installer = {
|
|
7
|
+
name: 'PowerToys',
|
|
8
|
+
description: 'Microsoft PowerToys utility set',
|
|
9
|
+
check: async () => {
|
|
10
|
+
const platform = os.platform();
|
|
11
|
+
if (platform !== 'win32') return true; // Pretend installed/not applicable on non-Windows
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
// Check if PowerToys is installed using winget
|
|
15
|
+
execSync('winget list -e --id Microsoft.PowerToys', { stdio: 'ignore' });
|
|
16
|
+
return true;
|
|
17
|
+
} catch {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
install: async () => {
|
|
22
|
+
const platform = os.platform();
|
|
23
|
+
if (platform !== 'win32') {
|
|
24
|
+
console.log(chalk.yellow('⚠ PowerToys is only available on Windows. Skipping.'));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
console.log(chalk.cyan(`Installing ${chalk.bold('PowerToys')}...`));
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
console.log(chalk.gray('> winget install Microsoft.PowerToys --source winget'));
|
|
32
|
+
// execSync('winget install Microsoft.PowerToys --source winget', { stdio: 'inherit' });
|
|
33
|
+
console.log(chalk.green('✔ PowerToys installed successfully!'));
|
|
34
|
+
} catch (error) {
|
|
35
|
+
console.log(chalk.red('✖ Failed to install PowerToys.'));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
};
|
package/languages/cpp.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Installer } from '../installers/installer.js';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import * as os from 'os';
|
|
5
|
+
|
|
6
|
+
export const CppInstaller: Installer = {
|
|
7
|
+
name: 'C/C++ Compiler',
|
|
8
|
+
description: 'C/C++ development tools',
|
|
9
|
+
check: async () => {
|
|
10
|
+
const platform = os.platform();
|
|
11
|
+
try {
|
|
12
|
+
if (platform === 'win32') {
|
|
13
|
+
// simple check for clang, gcc or cl
|
|
14
|
+
try { execSync('gcc --version', { stdio: 'ignore' }); return true; } catch { }
|
|
15
|
+
try { execSync('clang --version', { stdio: 'ignore' }); return true; } catch { }
|
|
16
|
+
try { execSync('cl', { stdio: 'ignore' }); return true; } catch { }
|
|
17
|
+
return false;
|
|
18
|
+
} else {
|
|
19
|
+
execSync('gcc --version', { stdio: 'ignore' });
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
} catch {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
install: async () => {
|
|
27
|
+
const platform = os.platform();
|
|
28
|
+
console.log(chalk.cyan(`Installing ${chalk.bold('C/C++ Compiler')}...`));
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
if (platform === 'win32') {
|
|
32
|
+
console.log(chalk.gray('> winget install LLVM.LLVM'));
|
|
33
|
+
// execSync('winget install LLVM.LLVM', { stdio: 'inherit' });
|
|
34
|
+
} else if (platform === 'darwin') {
|
|
35
|
+
console.log(chalk.gray('> xcode-select --install'));
|
|
36
|
+
} else if (platform === 'linux') {
|
|
37
|
+
console.log(chalk.gray('> sudo apt-get install -y build-essential'));
|
|
38
|
+
}
|
|
39
|
+
console.log(chalk.green('✔ C/C++ Compiler installed successfully!'));
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.log(chalk.red('✖ Failed to install C/C++ Compiler.'));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Installer } from '../installers/installer.js';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import * as os from 'os';
|
|
5
|
+
|
|
6
|
+
export const NodeInstaller: Installer = {
|
|
7
|
+
name: 'Node.js',
|
|
8
|
+
description: 'JavaScript runtime built on Chrome\'s V8 JavaScript engine',
|
|
9
|
+
check: async () => {
|
|
10
|
+
try {
|
|
11
|
+
execSync('node --version', { stdio: 'ignore' });
|
|
12
|
+
return true;
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
install: async () => {
|
|
18
|
+
const platform = os.platform();
|
|
19
|
+
console.log(chalk.cyan(`Installing ${chalk.bold('Node.js')}...`));
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
if (platform === 'win32') {
|
|
23
|
+
console.log(chalk.gray('> winget install OpenJS.NodeJS'));
|
|
24
|
+
} else if (platform === 'darwin') {
|
|
25
|
+
console.log(chalk.gray('> brew install node'));
|
|
26
|
+
} else if (platform === 'linux') {
|
|
27
|
+
console.log(chalk.gray('> curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs'));
|
|
28
|
+
}
|
|
29
|
+
console.log(chalk.green('✔ Node.js installed successfully!'));
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.log(chalk.red('✖ Failed to install Node.js.'));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Installer } from '../installers/installer.js';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
import * as os from 'os';
|
|
5
|
+
|
|
6
|
+
export const PythonInstaller: Installer = {
|
|
7
|
+
name: 'Python',
|
|
8
|
+
description: 'Python programming language',
|
|
9
|
+
check: async () => {
|
|
10
|
+
try {
|
|
11
|
+
execSync('python --version', { stdio: 'ignore' });
|
|
12
|
+
return true;
|
|
13
|
+
} catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
install: async () => {
|
|
18
|
+
const platform = os.platform();
|
|
19
|
+
console.log(chalk.cyan(`Installing ${chalk.bold('Python')}...`));
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
if (platform === 'win32') {
|
|
23
|
+
console.log(chalk.gray('> winget install --id Python.Python.3.12 -e --source winget'));
|
|
24
|
+
// execSync('winget install --id Python.Python.3.12 -e --source winget', { stdio: 'inherit' });
|
|
25
|
+
} else if (platform === 'darwin') {
|
|
26
|
+
console.log(chalk.gray('> brew install python'));
|
|
27
|
+
} else if (platform === 'linux') {
|
|
28
|
+
console.log(chalk.gray('> sudo apt-get install -y python3 python3-pip'));
|
|
29
|
+
}
|
|
30
|
+
console.log(chalk.green('✔ Python installed successfully!'));
|
|
31
|
+
} catch (error) {
|
|
32
|
+
console.log(chalk.red('✖ Failed to install Python.'));
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Installer } from '../installers/installer.js';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { execSync } from 'child_process';
|
|
4
|
+
|
|
5
|
+
export const TypeScriptInstaller: Installer = {
|
|
6
|
+
name: 'TypeScript',
|
|
7
|
+
description: 'TypeScript language (global install)',
|
|
8
|
+
check: async () => {
|
|
9
|
+
try {
|
|
10
|
+
execSync('tsc --version', { stdio: 'ignore' });
|
|
11
|
+
return true;
|
|
12
|
+
} catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
install: async () => {
|
|
17
|
+
console.log(chalk.cyan(`Installing ${chalk.bold('TypeScript')}...`));
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
console.log(chalk.gray('> npm install -g typescript ts-node'));
|
|
21
|
+
// execSync('npm install -g typescript ts-node', { stdio: 'inherit' });
|
|
22
|
+
console.log(chalk.green('✔ TypeScript installed successfully!'));
|
|
23
|
+
} catch (error) {
|
|
24
|
+
console.log(chalk.red('✖ Failed to install TypeScript. Ensure Node.js and npm are installed.'));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dksetup",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A CLI toolkit for DK-CLI.",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"dksetup": "index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
+
},
|
|
12
|
+
"keywords": [],
|
|
13
|
+
"author": "Dannan <your-email@example.com>",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"type": "commonjs",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"chalk": "^5.6.2",
|
|
18
|
+
"chalk-animation": "^2.0.3",
|
|
19
|
+
"commander": "^14.0.3",
|
|
20
|
+
"enquirer": "^2.4.1",
|
|
21
|
+
"gradient-string": "^3.0.0",
|
|
22
|
+
"ora": "^9.3.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/chalk-animation": "^1.6.3",
|
|
26
|
+
"@types/gradient-string": "^1.1.6",
|
|
27
|
+
"@types/node": "^25.3.0",
|
|
28
|
+
"ts-node": "^10.9.2",
|
|
29
|
+
"tsx": "^4.21.0",
|
|
30
|
+
"typescript": "^5.9.3"
|
|
31
|
+
}
|
|
32
|
+
}
|
package/plan.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
## Outline: Full Environment Setup (Cross-Platform CLI Tool)
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
Enable users to set up a ready-to-use development environment on any OS (Windows, macOS, Linux) with a single command or guided menu.
|
|
5
|
+
|
|
6
|
+
## Outline Steps
|
|
7
|
+
## UI/UX Requirements
|
|
8
|
+
- Each section should present a fancy, interactive CLI dashboard (using libraries like enquirer/inquirer/blessed).
|
|
9
|
+
- Use toggles, checkboxes, and dynamic menus for all options (install, skip, configure, etc.).
|
|
10
|
+
- Users can enable/disable any tool, package, or feature per section.
|
|
11
|
+
- Dashboard should update in real time as users make selections.
|
|
12
|
+
- Integrate dependencies between sections (e.g., if a theme is selected, apply it to VS Code and shell if possible).
|
|
13
|
+
- Show a summary of selected actions before proceeding.
|
|
14
|
+
- Allow users to go back and change selections at any step.
|
|
15
|
+
|
|
16
|
+
1. **OS Detection**
|
|
17
|
+
- Detect the user's operating system.
|
|
18
|
+
- Branch logic for Windows, macOS, Linux.
|
|
19
|
+
|
|
20
|
+
2. **Pre-Checks**
|
|
21
|
+
- If installed via npm, skip npm/node check.
|
|
22
|
+
- If installed via PowerShell/cmd/bash script, check for Node.js, npm/yarn/pnpm, and Git.
|
|
23
|
+
- Offer to install missing prerequisites (with user consent).
|
|
24
|
+
|
|
25
|
+
3. **Package Manager Setup**
|
|
26
|
+
- For each OS, install or configure the preferred package manager (e.g., Homebrew for macOS, Chocolatey/Scoop/Winget for Windows, apt/yum/dnf/pacman for Linux).
|
|
27
|
+
|
|
28
|
+
4. **Dev Tools Bundle**
|
|
29
|
+
- Bundle core dev tools as a group: VS Code, Node.js, npm, Git, Python, etc.
|
|
30
|
+
- Present as a single step with option to install all or skip.
|
|
31
|
+
- If skipped, proceed to next section.
|
|
32
|
+
|
|
33
|
+
5. **Utilities & Extras**
|
|
34
|
+
- Present optional utilities (e.g., Blender, PowerToys, Windhawk, terminal enhancements).
|
|
35
|
+
- Allow user to select which utilities to install or skip.
|
|
36
|
+
|
|
37
|
+
6. **Shell & Theme Setup**
|
|
38
|
+
- Offer to install and configure a shell (e.g., zsh, oh-my-zsh, PowerShell modules).
|
|
39
|
+
- Optionally apply themes, fonts, and prompt enhancements.
|
|
40
|
+
|
|
41
|
+
7. **Editor Extensions**
|
|
42
|
+
- Offer to install VS Code extensions and settings.
|
|
43
|
+
|
|
44
|
+
8. **Dotfiles & Configs**
|
|
45
|
+
- Optionally clone and apply user dotfiles or provide sensible defaults.
|
|
46
|
+
|
|
47
|
+
9. **Finalization**
|
|
48
|
+
- Print summary of actions taken.
|
|
49
|
+
- Offer to reboot/reload shell if needed.
|
|
50
|
+
- Provide next steps or quickstart tips.
|
|
51
|
+
|
|
52
|
+
## Notes
|
|
53
|
+
|
package/test-banner.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getAnimationFrames } from './installers/animator.js';
|
|
2
|
+
import gradient from 'gradient-string';
|
|
3
|
+
|
|
4
|
+
async function test() {
|
|
5
|
+
const frames = getAnimationFrames('ASCII Animations/ring aniamtion.html');
|
|
6
|
+
|
|
7
|
+
console.clear();
|
|
8
|
+
const bannerText = [
|
|
9
|
+
"██████╗ ██╗ ██╗ ██████╗██╗ ██╗",
|
|
10
|
+
"██╔══██╗██║ ██╔╝ ██╔════╝██║ ██║",
|
|
11
|
+
"██║ ██║█████╔╝ ██║ ██║ ██║",
|
|
12
|
+
"██║ ██║██╔═██╗ ██║ ██║ ██║",
|
|
13
|
+
"██████╔╝██║ ██╗██╗╚██████╗███████╗██║",
|
|
14
|
+
"╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═════╝╚══════╝╚═╝"
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
if (frames.length > 0) {
|
|
18
|
+
for (let i = 0; i < 40; i++) {
|
|
19
|
+
const frameIdx = i % frames.length;
|
|
20
|
+
const Math = global.Math;
|
|
21
|
+
const frameLines = frames[frameIdx].split('\n');
|
|
22
|
+
const height = Math.max(bannerText.length, frameLines.length);
|
|
23
|
+
const combinedLines = [];
|
|
24
|
+
for (let line = 0; line < height; line++) {
|
|
25
|
+
const bLine = bannerText[line] || '';
|
|
26
|
+
const fLine = frameLines[line] || '';
|
|
27
|
+
combinedLines.push(bLine.padEnd(42, ' ') + fLine);
|
|
28
|
+
}
|
|
29
|
+
process.stdout.write('\x1b[0;0H');
|
|
30
|
+
console.log(gradient.rainbow(combinedLines.join('\n')));
|
|
31
|
+
await new Promise(r => setTimeout(r, 60));
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
console.log("no frames");
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
test();
|
package/test-ora.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import ora from 'ora';
|
|
2
|
+
import { getAnimationFrames } from './installers/animator.js';
|
|
3
|
+
|
|
4
|
+
const frames = getAnimationFrames('ASCII Animations/ring aniamtion.html');
|
|
5
|
+
|
|
6
|
+
const spinner = ora({
|
|
7
|
+
text: 'Installing...',
|
|
8
|
+
spinner: {
|
|
9
|
+
interval: 30,
|
|
10
|
+
frames: frames
|
|
11
|
+
}
|
|
12
|
+
}).start();
|
|
13
|
+
|
|
14
|
+
setTimeout(() => {
|
|
15
|
+
spinner.succeed('Installed!');
|
|
16
|
+
}, 4000);
|
package/test.ts
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"forceConsistentCasingInFileNames": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"outDir": "./dist"
|
|
11
|
+
},
|
|
12
|
+
"include": [
|
|
13
|
+
"**/*.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|