Skip to content

Commit ca3b4c7

Browse files
authored
feat: add typings (#2)
1 parent 64e0816 commit ca3b4c7

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
node_modules/
2+
index.d.ts

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# changelog
22

3+
## 0.1.1
4+
5+
- Feat: add typings.
6+
37
## 0.1.0
48

59
- Feat: add transform - `plugin-rax-component-to-component`

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@appworks/codemod",
33
"description": "AppWorks codemod scripts",
4-
"version": "0.1.0",
4+
"version": "0.1.1",
55
"keywords": [
66
"appworks",
77
"codemod",
@@ -17,6 +17,7 @@
1717
"transforms/"
1818
],
1919
"main": "src/index.js",
20+
"typings": "src/index.d.ts",
2021
"publishConfig": {
2122
"access": "public"
2223
},

src/index.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
export interface IResult {
2+
transform: string; // transform key, see `Included Transforms`
3+
title: string; // transform description title
4+
title_en: string;
5+
message: string; // transform description message
6+
message_en: string;
7+
severity: 0 | 1 | 2; // 0: advice 1: warning 2: error
8+
mode: "run" | "check"; // mode, see API
9+
docs: string; // docs url
10+
output: string; // jscodeshift CLI output
11+
npm_deprecate?: string; // same as https://docs.npmjs.com/cli/v7/commands/npm-deprecate/
12+
}
13+
14+
export function check(cwd: string, files: string[]): Promise<IResult[]>;
15+
export function run(cwd: string, files: string[], transform: string): Promise<IResult>;

0 commit comments

Comments
 (0)