Skip to content

Commit 9637d69

Browse files
authored
Merge pull request #2 from Cristians953/alpha
Refactor CLI Core
2 parents d3bf0c4 + 76bbe4a commit 9637d69

50 files changed

Lines changed: 959 additions & 379 deletions

Some content is hidden

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

.babelrc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
[
44
"@babel/preset-env",
55
{
6-
"exclude": [
7-
"transform-regenerator"
8-
]
6+
"exclude": ["transform-regenerator"]
97
}
10-
]
8+
],
9+
"@babel/preset-typescript"
10+
],
11+
"plugins": [
12+
"@babel/plugin-proposal-class-properties"
1113
]
12-
}
14+
}

.eslintrc.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
env:
22
browser: true
33
es6: true
4+
parser: '@typescript-eslint/parser'
5+
parserOptions:
6+
ecmaVersion: 2020
7+
sourceType: module
8+
project: './tsconfig.json'
49
extends:
5-
- airbnb-base
10+
- airbnb-typescript/base
611
- prettier
7-
#parser: babel
12+
plugins:
13+
- '@typescript-eslint'
814
globals:
915
Atomics: readonly
1016
SharedArrayBuffer: readonly
11-
parserOptions:
12-
ecmaVersion: 11
13-
sourceType: module
1417
rules:
1518
no-console: off
1619
import/prefer-default-export: off

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
node_modules
22
lib
3-
.idea
3+
.idea
4+
/example/
5+
.vscode

package-lock.json

Lines changed: 182 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"react-codegen": "lib/bin.js"
88
},
99
"scripts": {
10-
"prepublish": "babel src --out-dir lib --copy-files",
11-
"watch": "babel --watch src --out-dir lib --source-maps inline --copy-files",
12-
"lint": "eslint src --ext .js"
10+
"prepublish": "npm run build",
11+
"build": "babel src --out-dir lib --copy-files --extensions \".ts\"",
12+
"watch": "npm run build -- --watch --source-maps inline",
13+
"lint": "eslint src --ext .ts"
1314
},
1415
"husky": {
1516
"hooks": {
@@ -20,9 +21,9 @@
2021
"dependencies": {
2122
"@babel/generator": "^7.10.1",
2223
"@babel/parser": "^7.10.1",
23-
"@babel/template": "^7.10.1",
2424
"@babel/traverse": "^7.10.1",
2525
"@babel/types": "^7.10.1",
26+
"@babel/template": "^7.10.1",
2627
"chalk": "^4.0.0",
2728
"console-clear": "^1.1.1",
2829
"cosmiconfig": "^6.0.0",
@@ -39,17 +40,25 @@
3940
"devDependencies": {
4041
"@babel/cli": "^7.10.1",
4142
"@babel/core": "^7.10.1",
43+
"@babel/plugin-proposal-class-properties": "^7.10.1",
4244
"@babel/preset-env": "^7.10.1",
45+
"@babel/preset-typescript": "^7.10.1",
46+
"@types/babel-generator": "^6.25.3",
4347
"@types/babel-traverse": "^6.25.5",
4448
"@types/babel-types": "^7.0.7",
49+
"@types/babel__generator": "^7.6.1",
4550
"@types/fs-extra": "^9.0.1",
4651
"@types/inquirer": "^6.5.0",
4752
"@types/yargs": "^15.0.5",
53+
"@typescript-eslint/eslint-plugin": "^3.1.0",
54+
"@typescript-eslint/parser": "^3.1.0",
4855
"eslint": "^6.8.0",
4956
"eslint-config-airbnb-base": "^14.1.0",
57+
"eslint-config-airbnb-typescript": "^8.0.2",
5058
"eslint-config-prettier": "^6.11.0",
5159
"eslint-plugin-import": "^2.20.2",
52-
"husky": "^4.2.5"
60+
"husky": "^4.2.5",
61+
"typescript": "^3.9.5"
5362
},
5463
"keywords": [
5564
"react",
File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import path from 'path';
22

3-
import { getAppRoot, getConfig } from '../utils';
4-
import { getStylesExtension } from '../utils/getStylesExtension';
3+
import { getAppRoot, getConfig, getStylesExtension } from '../utils';
4+
import { StyleFormats } from '../types/types';
55

6-
export const STYLE_FORMATS = ['CSS', 'SCSS', 'SASS', 'Less', 'Stylus'];
6+
export const STYLE_FORMATS: StyleFormats[] = ['CSS', 'SCSS', 'SASS', 'Less', 'Stylus'];
77
export const APP_ROOT = getAppRoot();
88
export const ROOT = path.dirname(require.main.filename);
99
export const CONFIG = getConfig();

0 commit comments

Comments
 (0)