Skip to content

Commit 614a1e8

Browse files
committed
feat: 迁移
1 parent a40bb4a commit 614a1e8

File tree

15 files changed

+677
-791
lines changed

15 files changed

+677
-791
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: release
2+
on:
3+
push:
4+
# 监听 main 分支的 push 事件
5+
branches:
6+
- main
7+
# 赋予 release-please-action 权限
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
jobs:
12+
# 设置 release-please 任务
13+
release-please:
14+
# 设置任务运行环境为 ubuntu-latest
15+
runs-on: ubuntu-latest
16+
steps:
17+
# 使用 release-please-action 动作来自动创建发布 PR
18+
- uses: googleapis/release-please-action@v4
19+
id: release
20+
with:
21+
# 设置发布类型为 node
22+
release-type: node
23+
24+
- name: 检出代码
25+
uses: actions/checkout@v4
26+
if: ${{ steps.release.outputs.release_created }}
27+
28+
- name: 设置 pnpm
29+
uses: pnpm/action-setup@v2
30+
with:
31+
version: 9
32+
run_install: true
33+
34+
- name: 编译
35+
run: pnpm run build
36+
if: ${{ steps.release.outputs.release_created }}
37+
38+
- name: 发布
39+
run: pnpm run pub
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
if: ${{ steps.release.outputs.release_created }}

examples/fork/index.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import * as os from 'node:os';
2-
import * as pty from '../../lib/index.js';
1+
import * as os from 'node:os'
2+
import * as pty from '../../dist/index.js'
33

4-
const isWindows = os.platform() === 'win32';
5-
const shell = isWindows ? 'powershell.exe' : 'bash';
4+
const isWindows = os.platform() === 'win32'
5+
const shell = isWindows ? 'powershell.exe' : 'bash'
66

77
const ptyProcess = pty.spawn(shell, [], {
88
name: 'xterm-256color',
@@ -11,18 +11,18 @@ const ptyProcess = pty.spawn(shell, [], {
1111
cwd: isWindows ? process.env.USERPROFILE : process.env.HOME,
1212
env: Object.assign({ TEST: "Environment vars work" }, process.env),
1313
useConpty: true,
14-
useConptyDll: true
15-
});
14+
useConptyDll: false
15+
})
1616

17-
ptyProcess.onData(data => process.stdout.write(data));
17+
ptyProcess.onData(data => process.stdout.write(data))
1818

19-
ptyProcess.write(isWindows ? 'dir\r' : 'ls\r');
19+
ptyProcess.write(isWindows ? 'dir\r' : 'ls\r')
2020

2121
setTimeout(() => {
22-
ptyProcess.resize(30, 19);
23-
ptyProcess.write(isWindows ? '$Env:TEST\r' : 'echo $TEST\r');
24-
}, 2000);
22+
ptyProcess.resize(30, 19)
23+
ptyProcess.write(isWindows ? '$Env:TEST\r' : 'echo $TEST\r')
24+
}, 2000)
2525

26-
process.on('exit', () => ptyProcess.kill());
26+
process.on('exit', () => ptyProcess.kill())
2727

28-
setTimeout(() => process.exit(), 4000);
28+
setTimeout(() => process.exit(), 4000)

examples/killDeepTree/index.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
var os = require('os');
2-
var pty = require('../..');
1+
import { platform } from 'os'
2+
import { spawn } from '../../dist/index.js'
33

4-
var shell = os.platform() === 'win32' ? 'powershell.exe' : 'bash';
4+
var shell = platform() === 'win32' ? 'powershell.exe' : 'bash'
55

6-
var ptyProcess = pty.spawn(shell, [], {
6+
var ptyProcess = spawn(shell, [], {
77
name: 'xterm-color',
88
cols: 80,
99
rows: 30,
1010
cwd: __dirname,
1111
env: process.env
12-
});
12+
})
1313

14-
ptyProcess.onData((data) => process.stdout.write(data));
14+
ptyProcess.onData((data) => process.stdout.write(data))
1515

16-
ptyProcess.write('start notepad\r');
17-
ptyProcess.write('npm start\r');
16+
ptyProcess.write('start notepad\r')
17+
ptyProcess.write('npm start\r')
1818

1919
// Kill the tree at the end
2020
setTimeout(() => {
21-
console.log('Killing pty');
22-
ptyProcess.kill();
23-
}, 10000);
21+
console.log('Killing pty')
22+
ptyProcess.kill()
23+
}, 10000)

notes/0.10.1-pre.5.md

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

notes/0.11.8-beta.1.md

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

notes/0.11.8-beta.2.md

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

0 commit comments

Comments
 (0)