Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert project to TypeScript #52

Merged
merged 203 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
c010903
fix: eslint-prettier error
ComradeVanti Oct 16, 2023
df4e122
deps: install typescript
ComradeVanti Oct 16, 2023
9f49b38
misc: ignore builds
ComradeVanti Oct 16, 2023
b981987
feat: convert to typescript
ComradeVanti Oct 16, 2023
7aece47
fix: eslint-prettier error
ComradeVanti Oct 16, 2023
9ca868f
fix: eslint errors in typescript-files
ComradeVanti Oct 18, 2023
2d03393
misc: apply eslint rules
ComradeVanti Oct 18, 2023
0db8ba7
chore(deps): bump mkdirp
ComradeVanti Oct 18, 2023
2d34593
chore: fix eslint end-of-line error
ComradeVanti Oct 18, 2023
c326276
feat: ambient typings for js module
ComradeVanti Oct 18, 2023
9eb4b9b
refactor: move file
ComradeVanti Oct 19, 2023
7926eac
refactor: add basic type for NpmClient
ComradeVanti Oct 19, 2023
2038996
refactor: declare global types
ComradeVanti Oct 19, 2023
4804895
refactor: improve ambient type declarations
ComradeVanti Oct 23, 2023
ddd5c2e
conf: bump target es version
ComradeVanti Oct 23, 2023
d5c6929
deps: downgrade node types
ComradeVanti Oct 23, 2023
9947cfa
refactor: add correct response type
ComradeVanti Oct 23, 2023
3253326
feat: typecheck errors
ComradeVanti Oct 23, 2023
4e7fe2d
misc: add shared idea files
ComradeVanti Oct 23, 2023
0edcc59
refactor: clean up imports
ComradeVanti Oct 23, 2023
b3033a6
refactor: make variables constant
ComradeVanti Oct 23, 2023
180e732
misc: remove outdated ts-ignores
ComradeVanti Oct 23, 2023
547879c
refactor: handle potential null
ComradeVanti Oct 23, 2023
76638bd
fix: add better type for upm auth
ComradeVanti Oct 23, 2023
fbebfde
refactor: fix type warning
ComradeVanti Oct 23, 2023
8f8ad11
fix: type parameter
ComradeVanti Oct 23, 2023
a3c5ab6
misc: delete outdates jsdoc comment
ComradeVanti Oct 23, 2023
3314861
fix: unhandled null values
ComradeVanti Oct 23, 2023
e6ced3b
fix: type error
ComradeVanti Oct 23, 2023
18f2f7e
refactor: use existing type
ComradeVanti Oct 23, 2023
b21e91b
fix: add missing import
ComradeVanti Oct 23, 2023
09846fc
fix: remove extraneous declare
ComradeVanti Oct 23, 2023
6bc923b
fix: type error
ComradeVanti Oct 23, 2023
64bfdc3
fix: remove extraneous ts-ignore
ComradeVanti Oct 23, 2023
c7b5ee1
fix: type error
ComradeVanti Oct 23, 2023
9c733f8
fix: type error
ComradeVanti Oct 23, 2023
6370c75
misc: remove extraneous ts-ignores
ComradeVanti Oct 23, 2023
e00f4cb
fix: type error
ComradeVanti Oct 23, 2023
94eacc6
refactor: prevent value conversion
ComradeVanti Oct 23, 2023
aa814d9
misc: handle undefined
ComradeVanti Oct 23, 2023
951755b
refactor: shorten and fix type error
ComradeVanti Oct 23, 2023
fd463f0
fix: type error
ComradeVanti Oct 23, 2023
4d45333
fix: potential undefined error
ComradeVanti Oct 23, 2023
6185479
fix: extraneous parameter
ComradeVanti Oct 23, 2023
1caa52b
fix: editing readonly list
ComradeVanti Oct 23, 2023
327b290
fix: type errors
ComradeVanti Oct 24, 2023
c3d1ad5
refactor: simplify property access
ComradeVanti Oct 24, 2023
dc1e931
fix: handle undefined
ComradeVanti Oct 24, 2023
9108970
fix: handle undefined
ComradeVanti Oct 24, 2023
dd0cc5c
fix: handle null
ComradeVanti Oct 24, 2023
8b63a92
fix: type errors
ComradeVanti Oct 24, 2023
1084bd9
fix: getLatestVersion should return undefined
ComradeVanti Oct 24, 2023
3eb242c
refactor: remove outdated logic
ComradeVanti Oct 24, 2023
bcd0dde
fix: handle undefined
ComradeVanti Oct 24, 2023
bc08acc
fix: fix type error
ComradeVanti Oct 24, 2023
dc79145
refactor: assert undefined
ComradeVanti Oct 24, 2023
8937e2d
refactor: remove unused imports
ComradeVanti Oct 24, 2023
920fd52
fix: unhandled undefined
ComradeVanti Oct 24, 2023
379b0a4
fix: handle undefined
ComradeVanti Oct 24, 2023
f9ae663
refactor: simplify ifs
ComradeVanti Oct 24, 2023
539f953
refactor: inline return
ComradeVanti Oct 24, 2023
9215dc9
fix: incorrectly registering errors
ComradeVanti Oct 24, 2023
0ee7466
misc: add build npm script
ComradeVanti Oct 24, 2023
0e08924
misc: reformat file
ComradeVanti Oct 24, 2023
164c256
fix: undefined error
ComradeVanti Oct 24, 2023
a4765e9
conf: generate sourcemaps
ComradeVanti Oct 24, 2023
91aa003
Revert "refactor: simplify ifs"
ComradeVanti Oct 24, 2023
2b84c6b
fix: incorrect type for env properties
ComradeVanti Oct 24, 2023
8027f16
fix: invalid type assertion
ComradeVanti Oct 24, 2023
ef79f70
refactor: change type
ComradeVanti Oct 24, 2023
b08bcf2
refactor: rename type
ComradeVanti Oct 24, 2023
8758094
refactor: rename type
ComradeVanti Oct 24, 2023
84d1e1f
refactor: simplify package name type
ComradeVanti Oct 24, 2023
70e8873
refactor: make property optional
ComradeVanti Oct 24, 2023
ebfa04b
refactor: extract utility function
ComradeVanti Oct 24, 2023
b54c937
refactor: rename type
ComradeVanti Oct 25, 2023
ead4616
refactor: remove extraneous if
ComradeVanti Oct 25, 2023
996aa41
refactor: rename module
ComradeVanti Oct 25, 2023
151334b
refactor: extract and rename function
ComradeVanti Oct 25, 2023
5f44032
misc: convert tests to typescript
ComradeVanti Oct 25, 2023
22464a0
refactor: optimize test imports
ComradeVanti Oct 25, 2023
2bedd37
refactor: convert type declarations to exports
ComradeVanti Oct 25, 2023
5971aea
refactor: make properties optional
ComradeVanti Oct 25, 2023
fe0bfd8
fix: type errors in test utils
ComradeVanti Oct 25, 2023
d0226b6
misc: reformat files
ComradeVanti Oct 25, 2023
af5f9a0
refactor: make properties optional
ComradeVanti Oct 25, 2023
550666b
fix: inspector type errors in tests
ComradeVanti Oct 25, 2023
b19628c
refactor: remove unused constants
ComradeVanti Oct 25, 2023
01ee62a
refactor: remove unnecessary await
ComradeVanti Oct 25, 2023
a94c468
refactor: make properties optional
ComradeVanti Oct 25, 2023
edb8b51
refactor: fix null and undefined warnings in test
ComradeVanti Oct 25, 2023
b87bea4
misc: drop outdated test
ComradeVanti Oct 25, 2023
0f0e15e
feat: fix type error
ComradeVanti Oct 25, 2023
33a2674
fix: null error
ComradeVanti Oct 25, 2023
d55c9ce
conf: simplify test script
ComradeVanti Oct 26, 2023
f88bc8b
misc: change bin structure
ComradeVanti Oct 26, 2023
633c051
misc: add missing typescript dependency
ComradeVanti Oct 26, 2023
14f8ba5
chore: fix eslint-prettier error (#50)
ComradeVanti Oct 29, 2023
3e758be
deps: install typescript
ComradeVanti Oct 16, 2023
007411f
misc: ignore builds
ComradeVanti Oct 16, 2023
9c27c92
feat: convert to typescript
ComradeVanti Oct 16, 2023
d57b4c4
fix: eslint errors in typescript-files
ComradeVanti Oct 18, 2023
bceda11
misc: apply eslint rules
ComradeVanti Oct 18, 2023
a656fe3
chore(deps): bump mkdirp
ComradeVanti Oct 18, 2023
309a8e0
chore: fix eslint end-of-line error
ComradeVanti Oct 18, 2023
36ffc7d
feat: ambient typings for js module
ComradeVanti Oct 18, 2023
e51bd54
refactor: move file
ComradeVanti Oct 19, 2023
f0b5113
refactor: add basic type for NpmClient
ComradeVanti Oct 19, 2023
1241259
refactor: declare global types
ComradeVanti Oct 19, 2023
272dbad
refactor: improve ambient type declarations
ComradeVanti Oct 23, 2023
4391cca
conf: bump target es version
ComradeVanti Oct 23, 2023
ec983a2
deps: downgrade node types
ComradeVanti Oct 23, 2023
3fb5972
refactor: add correct response type
ComradeVanti Oct 23, 2023
f2d7fde
feat: typecheck errors
ComradeVanti Oct 23, 2023
0d33f43
misc: add shared idea files
ComradeVanti Oct 23, 2023
971a81d
refactor: clean up imports
ComradeVanti Oct 23, 2023
8706d1b
refactor: make variables constant
ComradeVanti Oct 23, 2023
de82992
misc: remove outdated ts-ignores
ComradeVanti Oct 23, 2023
c511fd1
refactor: handle potential null
ComradeVanti Oct 23, 2023
54019f1
fix: add better type for upm auth
ComradeVanti Oct 23, 2023
ea10e4f
refactor: fix type warning
ComradeVanti Oct 23, 2023
6e6a461
fix: type parameter
ComradeVanti Oct 23, 2023
a4f01ed
misc: delete outdates jsdoc comment
ComradeVanti Oct 23, 2023
36f1a2e
fix: unhandled null values
ComradeVanti Oct 23, 2023
a9e27e3
fix: type error
ComradeVanti Oct 23, 2023
4254991
refactor: use existing type
ComradeVanti Oct 23, 2023
bcabfb7
fix: add missing import
ComradeVanti Oct 23, 2023
96de2d7
fix: remove extraneous declare
ComradeVanti Oct 23, 2023
316ac87
fix: type error
ComradeVanti Oct 23, 2023
32b29d2
fix: remove extraneous ts-ignore
ComradeVanti Oct 23, 2023
8e2c57d
fix: type error
ComradeVanti Oct 23, 2023
6940783
fix: type error
ComradeVanti Oct 23, 2023
a5d135e
misc: remove extraneous ts-ignores
ComradeVanti Oct 23, 2023
e0e975c
fix: type error
ComradeVanti Oct 23, 2023
6b510c3
refactor: prevent value conversion
ComradeVanti Oct 23, 2023
4b195b8
misc: handle undefined
ComradeVanti Oct 23, 2023
1a86f87
refactor: shorten and fix type error
ComradeVanti Oct 23, 2023
abc12c8
fix: type error
ComradeVanti Oct 23, 2023
18c00ca
fix: potential undefined error
ComradeVanti Oct 23, 2023
cbcbb14
fix: extraneous parameter
ComradeVanti Oct 23, 2023
0fc0ac5
fix: editing readonly list
ComradeVanti Oct 23, 2023
db97f15
fix: type errors
ComradeVanti Oct 24, 2023
543ac4f
refactor: simplify property access
ComradeVanti Oct 24, 2023
812e876
fix: handle undefined
ComradeVanti Oct 24, 2023
901b1c3
fix: handle undefined
ComradeVanti Oct 24, 2023
96c66dc
fix: handle null
ComradeVanti Oct 24, 2023
d7206e1
fix: type errors
ComradeVanti Oct 24, 2023
a87c231
fix: getLatestVersion should return undefined
ComradeVanti Oct 24, 2023
c88ebb1
refactor: remove outdated logic
ComradeVanti Oct 24, 2023
f59a117
fix: handle undefined
ComradeVanti Oct 24, 2023
0ecec41
fix: fix type error
ComradeVanti Oct 24, 2023
58bb9bd
refactor: assert undefined
ComradeVanti Oct 24, 2023
d23f7b4
refactor: remove unused imports
ComradeVanti Oct 24, 2023
76d8dc5
fix: unhandled undefined
ComradeVanti Oct 24, 2023
7edf934
fix: handle undefined
ComradeVanti Oct 24, 2023
88e6e03
refactor: simplify ifs
ComradeVanti Oct 24, 2023
6981ba5
refactor: inline return
ComradeVanti Oct 24, 2023
652e8e7
fix: incorrectly registering errors
ComradeVanti Oct 24, 2023
1db7a89
misc: add build npm script
ComradeVanti Oct 24, 2023
ee1bfcf
misc: reformat file
ComradeVanti Oct 24, 2023
7446e8b
fix: undefined error
ComradeVanti Oct 24, 2023
df53553
conf: generate sourcemaps
ComradeVanti Oct 24, 2023
4d2c06a
Revert "refactor: simplify ifs"
ComradeVanti Oct 24, 2023
59d5ef8
fix: incorrect type for env properties
ComradeVanti Oct 24, 2023
b32e2e6
fix: invalid type assertion
ComradeVanti Oct 24, 2023
12e3a89
refactor: change type
ComradeVanti Oct 24, 2023
f54fa14
refactor: rename type
ComradeVanti Oct 24, 2023
0050689
refactor: rename type
ComradeVanti Oct 24, 2023
0995041
refactor: simplify package name type
ComradeVanti Oct 24, 2023
b838371
refactor: make property optional
ComradeVanti Oct 24, 2023
cf4b9c6
refactor: extract utility function
ComradeVanti Oct 24, 2023
d96f6d7
refactor: rename type
ComradeVanti Oct 25, 2023
39c783a
refactor: remove extraneous if
ComradeVanti Oct 25, 2023
dfa36df
refactor: rename module
ComradeVanti Oct 25, 2023
49fafd0
refactor: extract and rename function
ComradeVanti Oct 25, 2023
a8c88ac
misc: convert tests to typescript
ComradeVanti Oct 25, 2023
3be98ac
refactor: optimize test imports
ComradeVanti Oct 25, 2023
694be3a
refactor: convert type declarations to exports
ComradeVanti Oct 25, 2023
4b90ae1
refactor: make properties optional
ComradeVanti Oct 25, 2023
725e908
fix: type errors in test utils
ComradeVanti Oct 25, 2023
1527d96
misc: reformat files
ComradeVanti Oct 25, 2023
e39ad48
refactor: make properties optional
ComradeVanti Oct 25, 2023
6bb385d
fix: inspector type errors in tests
ComradeVanti Oct 25, 2023
f04b78b
refactor: remove unused constants
ComradeVanti Oct 25, 2023
477cec9
refactor: remove unnecessary await
ComradeVanti Oct 25, 2023
39b8295
refactor: make properties optional
ComradeVanti Oct 25, 2023
53d3034
refactor: fix null and undefined warnings in test
ComradeVanti Oct 25, 2023
34d6abc
misc: drop outdated test
ComradeVanti Oct 25, 2023
2432319
feat: fix type error
ComradeVanti Oct 25, 2023
8e4b8ee
fix: null error
ComradeVanti Oct 25, 2023
0e46162
conf: simplify test script
ComradeVanti Oct 26, 2023
1c04b52
misc: change bin structure
ComradeVanti Oct 26, 2023
a0039c3
misc: add missing typescript dependency
ComradeVanti Oct 26, 2023
436804d
Merge branch 'ts' of https://github.com/ComradeVanti/openupm-cli into ts
ComradeVanti Oct 30, 2023
74bbd92
Merge branch 'ts' into test
ComradeVanti Oct 30, 2023
d53b70b
Bump node version
ComradeVanti Oct 31, 2023
3c32160
misc: better build structure
ComradeVanti Oct 31, 2023
5903497
misc: add CI TS build step
ComradeVanti Oct 31, 2023
1fae8e1
misc: remove unused dependencies
ComradeVanti Oct 31, 2023
a62fb61
misc: regenerate package lock
ComradeVanti Oct 31, 2023
1a360dc
chore: update .node-version to 16
favoyang Nov 1, 2023
baa87eb
chore: update .npmignore
favoyang Nov 1, 2023
4415ada
fix: add the npm clean script to run before build
favoyang Nov 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
module.exports = {
root: true,
env: {
node: true
node: true,
},
extends: [
"eslint:recommended",
"plugin:vue/recommended",
"prettier/vue",
"plugin:prettier/recommended"
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended",
],
rules: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off"
}
}
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
"prettier/prettier": [
"error",
{
endOfLine: "auto",
},
],
},
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
};
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
* text=auto
bin/openupm text eol=lf
bin/openupm-cn text eol=lf
lib/index.ts text eol=lf
lib/index.ts-cn text eol=lf
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
node-version: [16.x]
name: CI - node ${{ matrix.node-version }}
steps:
- uses: actions/checkout@v3
Expand All @@ -19,13 +19,15 @@ jobs:
run: npm ci
- name: npm run test
run: npm run test

release:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- name: Build
run: npm run build
- name: Release
uses: cycjimmy/semantic-release-action@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ typings/
# next.js build output
.next
.vscode/settings.json

# builds

/lib
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/openupm-cli.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
16
12 changes: 11 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,14 @@
.gitattributes
.eslintrc.js
test/
.vscode/
.vscode/
src/
!lib/
.github/
.idea/
.nvmrc
.node-version
.releaserc.json
tsconfig.json
*.tgz
*.tar.gz
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14
v16
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The command-line tool installs the 3rd-party registry as a scoped registry and m

## Installation

- Requires [nodejs 14.18 or above](https://nodejs.org/en/download/).
- Requires [nodejs 16 or above](https://nodejs.org/en/download/).
- Install via npm:

```
Expand Down Expand Up @@ -74,7 +74,7 @@ internal/modules/cjs/loader.js:818
Error: Cannot find module 'node:net'
```

Please install [nodejs 14.18 or above](https://nodejs.org/en/download/).
Please install [nodejs 16 or above](https://nodejs.org/en/download/).

## China region

Expand Down
4 changes: 2 additions & 2 deletions README.zh-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ openupm-cli基于Unity对带作用域的软件仓库(scoped registry)的支

## 安装

- 请先自行安装[nodejs 14.18或以上版本](https://nodejs.org/en/download/).
- 请先自行安装[nodejs 16或以上版本](https://nodejs.org/en/download/).
- 通过npm安装:

```
Expand Down Expand Up @@ -74,7 +74,7 @@ internal/modules/cjs/loader.js:818
Error: Cannot find module 'node:net'
```

请安装[nodejs 14.18或以上版本](https://nodejs.org/en/download/)。
请安装[nodejs 16或以上版本](https://nodejs.org/en/download/)。


## 中国区
Expand Down
3 changes: 0 additions & 3 deletions bin/openupm

This file was deleted.

Empty file removed index.js
Empty file.
23 changes: 0 additions & 23 deletions lib/client.js

This file was deleted.

35 changes: 0 additions & 35 deletions lib/cmd-deps.js

This file was deleted.

99 changes: 0 additions & 99 deletions lib/cmd-search.js

This file was deleted.

13 changes: 0 additions & 13 deletions lib/error-handler.js

This file was deleted.

Loading