Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules/
index.d.ts
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# changelog

## 0.1.1

- Feat: add typings.

## 0.1.0

- Feat: add transform - `plugin-rax-component-to-component`
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@appworks/codemod",
"description": "AppWorks codemod scripts",
"version": "0.1.0",
"version": "0.1.1",
"keywords": [
"appworks",
"codemod",
Expand All @@ -17,6 +17,7 @@
"transforms/"
],
"main": "src/index.js",
"typings": "src/index.d.ts",
"publishConfig": {
"access": "public"
},
Expand Down
15 changes: 15 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export interface IResult {
transform: string; // transform key, see `Included Transforms`
title: string; // transform description title
title_en: string;
message: string; // transform description message
message_en: string;
severity: 0 | 1 | 2; // 0: advice 1: warning 2: error
mode: "run" | "check"; // mode, see API
docs: string; // docs url
output: string; // jscodeshift CLI output
npm_deprecate?: string; // same as https://docs.npmjs.com/cli/v7/commands/npm-deprecate/
}

export function check(cwd: string, files: string[]): Promise<IResult[]>;
export function run(cwd: string, files: string[], transform: string): Promise<IResult>;