Skip to content

Commit d02ed0b

Browse files
committed
Merge branch 'pty'
2 parents b74552a + 614a1e8 commit d02ed0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+4571
-358
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
end_of_line = lf
9+
10+
[*.ts]
11+
max_line_length = 100

.eslintrc.js

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
module.exports = {
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"project": "src/tsconfig.json",
10+
"sourceType": "module"
11+
},
12+
"ignorePatterns": [
13+
"**/typings/*.d.ts",
14+
"scripts/**/*"
15+
],
16+
"plugins": [
17+
"@typescript-eslint"
18+
],
19+
"rules": {
20+
"@typescript-eslint/array-type": [
21+
"error",
22+
{
23+
"default": "array-simple",
24+
"readonly": "generic"
25+
}
26+
],
27+
"@typescript-eslint/consistent-type-definitions": "error",
28+
"@typescript-eslint/explicit-function-return-type": [
29+
"error",
30+
{
31+
"allowExpressions": true
32+
}
33+
],
34+
"@typescript-eslint/indent": [
35+
"error",
36+
2
37+
],
38+
"@typescript-eslint/member-delimiter-style": [
39+
"error",
40+
{
41+
"multiline": {
42+
"delimiter": "semi",
43+
"requireLast": true
44+
},
45+
"singleline": {
46+
"delimiter": "comma",
47+
"requireLast": false
48+
}
49+
}
50+
],
51+
"@typescript-eslint/naming-convention": [
52+
"error",
53+
{ "selector": "default", "format": ["camelCase"] },
54+
// variableLike
55+
{ "selector": "variable", "format": ["camelCase", "UPPER_CASE"] },
56+
{ "selector": "variable", "filter": "^I.+Service$", "format": ["PascalCase"], "prefix": ["I"] },
57+
// memberLike
58+
{ "selector": "memberLike", "modifiers": ["private"], "format": ["camelCase"], "leadingUnderscore": "require" },
59+
{ "selector": "memberLike", "modifiers": ["protected"], "format": ["camelCase"], "leadingUnderscore": "require" },
60+
{ "selector": "enumMember", "format": ["UPPER_CASE"] },
61+
// memberLike - Allow enum-like objects to use UPPER_CASE
62+
{ "selector": "property", "modifiers": ["public"], "format": ["camelCase", "UPPER_CASE"] },
63+
{ "selector": "method", "modifiers": ["public"], "format": ["camelCase", "UPPER_CASE"] },
64+
// typeLike
65+
{ "selector": "typeLike", "format": ["PascalCase"] },
66+
{ "selector": "interface", "format": ["PascalCase"], "prefix": ["I"] },
67+
// class
68+
{ "selector": "class", "format": ["PascalCase"] },
69+
],
70+
"@typescript-eslint/prefer-namespace-keyword": "error",
71+
"@typescript-eslint/quotes": [
72+
"error",
73+
"single",
74+
{ "allowTemplateLiterals": true }
75+
],
76+
"@typescript-eslint/semi": [
77+
"error",
78+
"always"
79+
],
80+
"@typescript-eslint/type-annotation-spacing": "error",
81+
"comma-dangle": [
82+
"error",
83+
{
84+
"objects": "never",
85+
"arrays": "never",
86+
"functions": "never"
87+
}
88+
],
89+
"curly": [
90+
"error",
91+
"multi-line"
92+
],
93+
"eol-last": "error",
94+
"eqeqeq": [
95+
"error",
96+
"always"
97+
],
98+
"keyword-spacing": "error",
99+
"new-parens": "error",
100+
"no-duplicate-imports": "error",
101+
"no-else-return": [
102+
"error",
103+
{
104+
allowElseIf: false
105+
}
106+
],
107+
"no-eval": "error",
108+
"no-irregular-whitespace": "error",
109+
"no-restricted-imports": [
110+
"error",
111+
{
112+
"patterns": [
113+
".*\\/out\\/.*"
114+
]
115+
}
116+
],
117+
"no-trailing-spaces": "error",
118+
"no-unsafe-finally": "error",
119+
"no-var": "error",
120+
"one-var": [
121+
"error",
122+
"never"
123+
],
124+
"prefer-const": "error",
125+
"spaced-comment": [
126+
"error",
127+
"always",
128+
{
129+
"markers": ["/"],
130+
"exceptions": ["-"]
131+
}
132+
]
133+
}
134+
};

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.github/workflows/release.yml

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,23 @@ jobs:
2020
with:
2121
# 设置发布类型为 node
2222
release-type: node
23-
# 检出代码
24-
- uses: actions/checkout@v4
23+
24+
- name: 检出代码
25+
uses: actions/checkout@v4
2526
if: ${{ steps.release.outputs.release_created }}
26-
# 设置 Node.js 环境
27-
- uses: actions/setup-node@v4
27+
28+
- name: 设置 pnpm
29+
uses: pnpm/action-setup@v2
2830
with:
29-
# 设置 Node.js 版本
30-
node-version: 20
31-
# 设置 npm 源
32-
registry-url: "https://registry.npmjs.org"
33-
# 安装依赖
34-
- run: npm install
31+
version: 9
32+
run_install: true
33+
34+
- name: 编译
35+
run: pnpm run build
3536
if: ${{ steps.release.outputs.release_created }}
36-
# 下载编译完成的pty
37-
- run: npm run download
38-
if: ${{ steps.release.outputs.release_created }}
39-
# 构建输出
40-
- run: npm run build
41-
if: ${{ steps.release.outputs.release_created }}
42-
# 增加install script
43-
- run: npm pkg set "scripts.install"="node lib/scripts/main.js"
44-
if: ${{ steps.release.outputs.release_created }}
45-
# 删除开发依赖
46-
- run: npm pkg delete devDependencies
47-
if: ${{ steps.release.outputs.release_created }}
48-
# 发布到 npm
49-
- run: npm run pub
37+
38+
- name: 发布
39+
run: pnpm run pub
5040
env:
5141
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5242
if: ${{ steps.release.outputs.release_created }}

.gitignore

Lines changed: 15 additions & 177 deletions
Original file line numberDiff line numberDiff line change
@@ -1,180 +1,18 @@
1-
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
2-
3-
# Logs
4-
5-
logs
6-
_.log
7-
npm-debug.log_
8-
yarn-debug.log*
9-
yarn-error.log*
10-
lerna-debug.log*
11-
.pnpm-debug.log*
12-
13-
# Caches
14-
15-
.cache
16-
17-
# Diagnostic reports (https://nodejs.org/api/report.html)
18-
19-
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
20-
21-
# Runtime data
22-
23-
pids
24-
_.pid
25-
_.seed
26-
*.pid.lock
27-
28-
# Directory for instrumented libs generated by jscoverage/JSCover
29-
30-
lib-cov
31-
32-
# Coverage directory used by tools like istanbul
33-
34-
coverage
35-
*.lcov
36-
37-
# nyc test coverage
38-
39-
.nyc_output
40-
41-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
42-
43-
.grunt
44-
45-
# Bower dependency directory (https://bower.io/)
46-
47-
bower_components
48-
49-
# node-waf configuration
50-
1+
build/
512
.lock-wscript
52-
53-
# Compiled binary addons (https://nodejs.org/api/addons.html)
54-
55-
build/Release
56-
57-
# Dependency directories
58-
3+
out/
4+
Makefile.gyp
5+
*.Makefile
6+
*.target.gyp.mk
597
node_modules/
60-
jspm_packages/
61-
62-
# Snowpack dependency directory (https://snowpack.dev/)
63-
64-
web_modules/
65-
66-
# TypeScript cache
67-
68-
*.tsbuildinfo
69-
70-
# Optional npm cache directory
71-
72-
.npm
73-
74-
# Optional eslint cache
75-
76-
.eslintcache
77-
78-
# Optional stylelint cache
79-
80-
.stylelintcache
81-
82-
# Microbundle cache
83-
84-
.rpt2_cache/
85-
.rts2_cache_cjs/
86-
.rts2_cache_es/
87-
.rts2_cache_umd/
88-
89-
# Optional REPL history
90-
91-
.node_repl_history
92-
93-
# Output of 'npm pack'
94-
95-
*.tgz
96-
97-
# Yarn Integrity file
98-
99-
.yarn-integrity
100-
101-
# dotenv environment variable files
102-
103-
.env
104-
.env.development.local
105-
.env.test.local
106-
.env.production.local
107-
.env.local
108-
109-
# parcel-bundler cache (https://parceljs.org/)
110-
111-
.parcel-cache
112-
113-
# Next.js build output
114-
115-
.next
116-
out
117-
118-
# Nuxt.js build / generate output
119-
120-
.nuxt
121-
dist
122-
123-
# Gatsby files
124-
125-
# Comment in the public line in if your project uses Gatsby and not Next.js
126-
127-
# https://nextjs.org/blog/next-9-1#public-directory-support
128-
129-
# public
130-
131-
# vuepress build output
132-
133-
.vuepress/dist
134-
135-
# vuepress v2.x temp and cache directory
136-
137-
.temp
138-
139-
# Docusaurus cache and generated files
140-
141-
.docusaurus
142-
143-
# Serverless directories
144-
145-
.serverless/
146-
147-
# FuseBox cache
148-
149-
.fusebox/
150-
151-
# DynamoDB Local files
152-
153-
.dynamodb/
154-
155-
# TernJS port file
156-
157-
.tern-port
158-
159-
# Stores VSCode versions used for testing VSCode extensions
160-
161-
.vscode-test
162-
163-
# yarn v2
164-
165-
.yarn/cache
166-
.yarn/unplugged
167-
.yarn/build-state.yml
168-
.yarn/install-state.gz
169-
.pnp.*
170-
171-
# IntelliJ based IDEs
8+
builderror.log
9+
lib/
10+
npm-debug.log
11+
fixtures/space folder/
12+
.vscode/settings.json
13+
14+
prebuilds
15+
.vscode/ipch/
17216
.idea
173-
174-
# Finder (MacOS) folder config
175-
.DS_Store
176-
lib
177-
dist
178-
pnpm-lock.yaml
179-
package-lock.json
180-
build
17+
yarn.lock
18+
/dist

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.test.js
2+
*.test.ts

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
unsafe-perm=true
2+
package-lock=true

0 commit comments

Comments
 (0)