create-aiproj 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/bin/proj +17 -0
- package/package.json +40 -0
- package/scripts/install.js +97 -0
package/bin/proj
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const path = require('path');
|
|
5
|
+
|
|
6
|
+
const isWindows = process.platform === 'win32';
|
|
7
|
+
const binName = isWindows ? 'proj.exe' : 'proj';
|
|
8
|
+
const binPath = path.join(__dirname, binName);
|
|
9
|
+
|
|
10
|
+
const child = spawn(binPath, process.argv.slice(2), {
|
|
11
|
+
stdio: 'inherit',
|
|
12
|
+
shell: isWindows
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
child.on('close', (code) => {
|
|
16
|
+
process.exit(code);
|
|
17
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-aiproj",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Project tracking and context management for AI-assisted development",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cli",
|
|
7
|
+
"project-management",
|
|
8
|
+
"ai",
|
|
9
|
+
"context",
|
|
10
|
+
"tracking"
|
|
11
|
+
],
|
|
12
|
+
"author": "John Deaton <john@victorysightsound.com>",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/victorysightsound/aiproject.git"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://github.com/victorysightsound/aiproject",
|
|
19
|
+
"bugs": {
|
|
20
|
+
"url": "https://github.com/victorysightsound/aiproject/issues"
|
|
21
|
+
},
|
|
22
|
+
"bin": {
|
|
23
|
+
"proj": "bin/proj"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"postinstall": "node scripts/install.js"
|
|
27
|
+
},
|
|
28
|
+
"os": [
|
|
29
|
+
"darwin",
|
|
30
|
+
"linux",
|
|
31
|
+
"win32"
|
|
32
|
+
],
|
|
33
|
+
"cpu": [
|
|
34
|
+
"x64",
|
|
35
|
+
"arm64"
|
|
36
|
+
],
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=14"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const https = require('https');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const { execSync } = require('child_process');
|
|
7
|
+
const zlib = require('zlib');
|
|
8
|
+
|
|
9
|
+
const VERSION = '1.0.0';
|
|
10
|
+
const REPO = 'victorysightsound/aiproject';
|
|
11
|
+
|
|
12
|
+
function getPlatformTarget() {
|
|
13
|
+
const platform = process.platform;
|
|
14
|
+
const arch = process.arch;
|
|
15
|
+
|
|
16
|
+
const targets = {
|
|
17
|
+
'darwin-x64': 'x86_64-apple-darwin',
|
|
18
|
+
'darwin-arm64': 'aarch64-apple-darwin',
|
|
19
|
+
'linux-x64': 'x86_64-unknown-linux-gnu',
|
|
20
|
+
'linux-arm64': 'aarch64-unknown-linux-gnu',
|
|
21
|
+
'win32-x64': 'x86_64-pc-windows-msvc',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const key = `${platform}-${arch}`;
|
|
25
|
+
const target = targets[key];
|
|
26
|
+
|
|
27
|
+
if (!target) {
|
|
28
|
+
console.error(`Unsupported platform: ${key}`);
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return target;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function download(url) {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
https.get(url, (response) => {
|
|
38
|
+
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
39
|
+
download(response.headers.location).then(resolve).catch(reject);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (response.statusCode !== 200) {
|
|
44
|
+
reject(new Error(`Failed to download: ${response.statusCode}`));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const chunks = [];
|
|
49
|
+
response.on('data', (chunk) => chunks.push(chunk));
|
|
50
|
+
response.on('end', () => resolve(Buffer.concat(chunks)));
|
|
51
|
+
response.on('error', reject);
|
|
52
|
+
}).on('error', reject);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function install() {
|
|
57
|
+
const target = getPlatformTarget();
|
|
58
|
+
const isWindows = process.platform === 'win32';
|
|
59
|
+
const ext = isWindows ? 'zip' : 'tar.gz';
|
|
60
|
+
const url = `https://github.com/${REPO}/releases/download/v${VERSION}/proj-${target}.${ext}`;
|
|
61
|
+
|
|
62
|
+
console.log(`Downloading proj for ${target}...`);
|
|
63
|
+
|
|
64
|
+
const binDir = path.join(__dirname, '..', 'bin');
|
|
65
|
+
const binPath = path.join(binDir, isWindows ? 'proj.exe' : 'proj');
|
|
66
|
+
|
|
67
|
+
if (!fs.existsSync(binDir)) {
|
|
68
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
try {
|
|
72
|
+
const data = await download(url);
|
|
73
|
+
|
|
74
|
+
if (isWindows) {
|
|
75
|
+
// For Windows, we'd need to handle zip extraction
|
|
76
|
+
// For simplicity, write a placeholder
|
|
77
|
+
console.log('Windows installation requires manual binary placement');
|
|
78
|
+
} else {
|
|
79
|
+
// Extract tar.gz
|
|
80
|
+
const tempTar = path.join(binDir, 'temp.tar');
|
|
81
|
+
const decompressed = zlib.gunzipSync(data);
|
|
82
|
+
fs.writeFileSync(tempTar, decompressed);
|
|
83
|
+
execSync(`tar -xf "${tempTar}" -C "${binDir}"`, { stdio: 'inherit' });
|
|
84
|
+
fs.unlinkSync(tempTar);
|
|
85
|
+
fs.chmodSync(binPath, 0o755);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
console.log('proj installed successfully!');
|
|
89
|
+
} catch (err) {
|
|
90
|
+
console.error('Failed to install proj:', err.message);
|
|
91
|
+
console.error('You may need to install manually from:');
|
|
92
|
+
console.error(` https://github.com/${REPO}/releases`);
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
install();
|