Skip to content

Commit f29a2a1

Browse files
committed
Prepare distrubuyion and build workflow
1 parent a1d2635 commit f29a2a1

9 files changed

Lines changed: 114 additions & 63 deletions

File tree

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 20
17+
cache: npm
18+
- run: npm ci
19+
- run: npm run lint
20+
- run: npm run format:check
21+
22+
test:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-node@v4
27+
with:
28+
node-version: 20
29+
cache: npm
30+
- run: npm ci
31+
- run: npm run test:coverage
32+
- uses: actions/upload-artifact@v4
33+
if: always()
34+
with:
35+
name: coverage
36+
path: coverage/
37+
38+
build:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: actions/setup-node@v4
43+
with:
44+
node-version: 20
45+
cache: npm
46+
- run: npm ci
47+
- run: npm run build
48+
- uses: actions/upload-artifact@v4
49+
with:
50+
name: dist
51+
path: packages/*/dist/

.github/workflows/release.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: 20
19+
cache: npm
20+
registry-url: https://registry.npmjs.org
21+
22+
- run: npm ci
23+
- run: npm run lint
24+
- run: npm run format:check
25+
- run: npm run test
26+
- run: npm run build
27+
28+
- name: Publish to npm
29+
run: npm publish --workspaces --access public
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
32+
33+
- name: Create GitHub Release
34+
uses: softprops/action-gh-release@v2
35+
with:
36+
generate_release_notes: true

.gitlab-ci.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

packages/cli/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
{
22
"name": "@clux/cli",
33
"version": "0.1.0",
4-
"private": true,
54
"license": "MIT",
65
"main": "dist/index.js",
76
"bin": {
87
"clux": "dist/index.js"
98
},
9+
"files": ["dist"],
10+
"repository": {
11+
"type": "git",
12+
"url": "https://github.com/michalsikora/clux.git",
13+
"directory": "packages/cli"
14+
},
1015
"scripts": {
1116
"build": "tsc",
1217
"watch": "tsc --watch",
1318
"start": "node dist/index.js"
1419
},
1520
"dependencies": {
16-
"@clux/core": "*",
21+
"@clux/core": "0.1.0",
1722
"commander": "^13.0.0",
1823
"chalk": "^4.1.2",
1924
"cli-table3": "^0.6.5",

packages/cli/src/commands/claude.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ describe('buildSessionName', () => {
3333
});
3434

3535
it('generates name from path when no name provided', () => {
36-
expect(buildSessionName(undefined, '/home/user/projects/clux')).toBe('claude_h-u-projects-clux');
36+
expect(buildSessionName(undefined, '/home/user/projects/clux')).toBe(
37+
'claude_h-u-projects-clux',
38+
);
3739
});
3840

3941
it('generates name for short paths', () => {

packages/cli/src/commands/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function registerCreateCommand(program: Command, manager: TmuxSessionMana
1010
.description('Create a new tmux session')
1111
.option('-p, --path <path>', 'Project working directory', process.cwd())
1212
.option('-c, --command <cmd>', 'Command to run in main pane (e.g. "claude")')
13-
.option('-l, --layout <layout>', 'Pane layout', 'tiled')
13+
.option('-l, --layout <layout>', 'Pane layout', 'tiled')
1414
.option('-d, --description <text>', 'Session description')
1515
.option('-t, --tags <tags>', 'Comma-separated tags')
1616
.action(async (name: string, opts) => {

packages/core/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
{
22
"name": "@clux/core",
33
"version": "0.1.0",
4-
"private": true,
54
"license": "MIT",
65
"main": "dist/index.js",
76
"types": "dist/index.d.ts",
7+
"files": ["dist"],
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/michalsikora/clux.git",
11+
"directory": "packages/core"
12+
},
813
"scripts": {
914
"build": "tsc",
1015
"watch": "tsc --watch"

packages/core/src/TmuxControlClient.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,9 @@ export class TmuxControlClient extends EventEmitter {
5151
await this.refreshPaneMap();
5252

5353
return new Promise<void>((resolve, reject) => {
54-
this.proc = spawn(
55-
'tmux',
56-
['-C', 'attach-session', '-t', this.sessionName, '-r'],
57-
{ stdio: ['pipe', 'pipe', 'pipe'] },
58-
);
54+
this.proc = spawn('tmux', ['-C', 'attach-session', '-t', this.sessionName, '-r'], {
55+
stdio: ['pipe', 'pipe', 'pipe'],
56+
});
5957

6058
let settled = false;
6159

packages/web/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
{
22
"name": "@clux/web",
33
"version": "0.1.0",
4-
"private": true,
54
"license": "MIT",
65
"main": "dist/server.js",
6+
"files": ["dist"],
7+
"repository": {
8+
"type": "git",
9+
"url": "https://github.com/michalsikora/clux.git",
10+
"directory": "packages/web"
11+
},
712
"scripts": {
813
"build": "tsc",
914
"dev": "node dist/server.js",
1015
"watch": "tsc --watch"
1116
},
1217
"dependencies": {
13-
"@clux/core": "*",
18+
"@clux/core": "0.1.0",
1419
"express": "^4.21.0",
1520
"ws": "^8.18.0"
1621
},

0 commit comments

Comments
 (0)