gitspace 0.2.0-rc.1 → 0.2.0-rc.2
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/gssh +19 -3
- package/npm/darwin-arm64/bin/gssh +0 -0
- package/npm/darwin-arm64/package.json +1 -1
- package/package.json +5 -5
- package/scripts/build.ts +14 -0
- package/src/index.ts +2 -13
package/bin/gssh
CHANGED
|
@@ -12,7 +12,23 @@
|
|
|
12
12
|
|
|
13
13
|
set -e
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
# Resolve symlinks to find the real script location
|
|
16
|
+
resolve_symlink() {
|
|
17
|
+
file="$1"
|
|
18
|
+
while [ -L "$file" ]; do
|
|
19
|
+
dir="$(cd "$(dirname "$file")" && pwd)"
|
|
20
|
+
file="$(readlink "$file")"
|
|
21
|
+
# Handle relative symlinks
|
|
22
|
+
case "$file" in
|
|
23
|
+
/*) ;;
|
|
24
|
+
*) file="$dir/$file" ;;
|
|
25
|
+
esac
|
|
26
|
+
done
|
|
27
|
+
echo "$file"
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
REAL_SCRIPT="$(resolve_symlink "$0")"
|
|
31
|
+
SCRIPT_DIR="$(cd "$(dirname "$REAL_SCRIPT")" && pwd)"
|
|
16
32
|
ROOT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
17
33
|
|
|
18
34
|
# Get platform identifier
|
|
@@ -50,8 +66,8 @@ if [ -n "$PLATFORM" ]; then
|
|
|
50
66
|
done
|
|
51
67
|
fi
|
|
52
68
|
|
|
53
|
-
# 3. Fall back to bun for development
|
|
54
|
-
if command -v bun >/dev/null 2>&1; then
|
|
69
|
+
# 3. Fall back to bun for development (only if src/index.ts exists)
|
|
70
|
+
if [ -f "$ROOT_DIR/src/index.ts" ] && command -v bun >/dev/null 2>&1; then
|
|
55
71
|
exec bun "$ROOT_DIR/src/index.ts" "$@"
|
|
56
72
|
fi
|
|
57
73
|
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gitspace",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.2",
|
|
4
4
|
"description": "CLI for managing GitHub workspaces with git worktrees and secure remote terminal access",
|
|
5
5
|
"bin": {
|
|
6
6
|
"gssh": "./bin/gssh"
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"relay": "bun src/relay/index.ts"
|
|
18
18
|
},
|
|
19
19
|
"optionalDependencies": {
|
|
20
|
-
"@gitspace/darwin-arm64": "0.2.0-rc.
|
|
21
|
-
"@gitspace/darwin-x64": "0.2.0-rc.
|
|
22
|
-
"@gitspace/linux-x64": "0.2.0-rc.
|
|
23
|
-
"@gitspace/linux-arm64": "0.2.0-rc.
|
|
20
|
+
"@gitspace/darwin-arm64": "0.2.0-rc.2",
|
|
21
|
+
"@gitspace/darwin-x64": "0.2.0-rc.2",
|
|
22
|
+
"@gitspace/linux-x64": "0.2.0-rc.2",
|
|
23
|
+
"@gitspace/linux-arm64": "0.2.0-rc.2"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
26
|
"cli",
|
package/scripts/build.ts
CHANGED
|
@@ -23,6 +23,7 @@ import { readFileSync, writeFileSync, mkdirSync, copyFileSync, chmodSync } from
|
|
|
23
23
|
const ROOT = join(import.meta.dir, "..");
|
|
24
24
|
const WEB_DIST = join(ROOT, "src/web/dist");
|
|
25
25
|
const EMBEDDED_ASSETS_PATH = join(ROOT, "src/relay/embedded-assets.generated.js");
|
|
26
|
+
const VERSION_PATH = join(ROOT, "src/version.generated.ts");
|
|
26
27
|
const DIST_DIR = join(ROOT, "dist");
|
|
27
28
|
const NPM_DIR = join(ROOT, "npm");
|
|
28
29
|
|
|
@@ -41,6 +42,18 @@ const TARGETS = {
|
|
|
41
42
|
|
|
42
43
|
type TargetKey = keyof typeof TARGETS;
|
|
43
44
|
|
|
45
|
+
/** Generate version file with current version */
|
|
46
|
+
function generateVersionFile() {
|
|
47
|
+
const code = `/**
|
|
48
|
+
* AUTO-GENERATED - DO NOT EDIT
|
|
49
|
+
* Generated by: bun scripts/build.ts
|
|
50
|
+
*/
|
|
51
|
+
export const VERSION = '${VERSION}';
|
|
52
|
+
`;
|
|
53
|
+
writeFileSync(VERSION_PATH, code);
|
|
54
|
+
console.log(`✓ Generated version file (${VERSION})`);
|
|
55
|
+
}
|
|
56
|
+
|
|
44
57
|
/** Restore stub file before web build */
|
|
45
58
|
function restoreStub() {
|
|
46
59
|
const stub = `/**
|
|
@@ -232,6 +245,7 @@ async function main() {
|
|
|
232
245
|
|
|
233
246
|
console.log(`🚀 GitSpace CLI Build v${VERSION}\n`);
|
|
234
247
|
|
|
248
|
+
generateVersionFile();
|
|
235
249
|
await buildWeb();
|
|
236
250
|
await generateEmbeddedAssets();
|
|
237
251
|
|
package/src/index.ts
CHANGED
|
@@ -6,9 +6,8 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { Command } from 'commander'
|
|
9
|
-
import { readFileSync } from 'fs'
|
|
10
|
-
import { join } from 'path'
|
|
11
9
|
import { isFirstTimeSetup, initializeSpaces } from './core/config.js'
|
|
10
|
+
import { VERSION } from './version.generated.js'
|
|
12
11
|
import { logger } from './utils/logger.js'
|
|
13
12
|
import { SpacesError } from './types/errors.js'
|
|
14
13
|
import { addProject, addWorkspace } from './commands/add.js'
|
|
@@ -31,21 +30,11 @@ import { showStatus } from './commands/status.js'
|
|
|
31
30
|
|
|
32
31
|
const program = new Command()
|
|
33
32
|
|
|
34
|
-
// Read version from package.json
|
|
35
|
-
let version = '0.0.0'
|
|
36
|
-
try {
|
|
37
|
-
const pkgPath = join(import.meta.dir, '../package.json')
|
|
38
|
-
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'))
|
|
39
|
-
version = pkg.version
|
|
40
|
-
} catch {
|
|
41
|
-
// Fallback for compiled binary
|
|
42
|
-
}
|
|
43
|
-
|
|
44
33
|
// Package info
|
|
45
34
|
program
|
|
46
35
|
.name('gssh')
|
|
47
36
|
.description('GitSpace CLI - Manage GitHub workspaces with secure remote terminal access')
|
|
48
|
-
.version(
|
|
37
|
+
.version(VERSION)
|
|
49
38
|
|
|
50
39
|
// First-time setup check
|
|
51
40
|
async function checkFirstTimeSetup(): Promise<void> {
|