-
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: rewrite core in typescript (#536)
* improve declaration file * type check parseAttributes.js * type check parseFrontmatter.js * type check parseFrontmatter.js * convert saber-log to typescript * compile saber * convert assetsAttribute.js to typescript * migrate to eslint * some fixes * convert BrowserApi to typescript * conevrt Transformers to typescript * convert Compiler to ts * convert WebpackUtils to typescript * convert index.js to typescript with a lot of todos and ts-ignore * type-check website/saber-config.js * generate typedoc * fix path to babel preset * remove TODOs related to Saber * remove TODOs related to hooks * remove TODOs related to renderer remove custom renderer support (since we won't be able to add react support anytime soon) * fix path to saber cli * make website a workspace to simplify commands * use the transform method * remove more TODOs * remove ts-ignore for api.config * disable @typescript-eslint/triple-slash-reference for now * no ts-ignore * resolve lint errors * fix jest config * exclude dist
- Loading branch information
Showing
129 changed files
with
2,743 additions
and
2,183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ public | |
.DS_Store | ||
examples/*/yarn.lock | ||
examples/*/package-lock.json | ||
packages/*/types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"eslint.validate": ["javascript", "javascriptreact", "typescript"], | ||
"eslint.enable": true, | ||
"eslint.workingDirectories": [ | ||
{ | ||
"directory": "packages/saber", | ||
"changeProcessCWD": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"packages": ["packages/*", "other-packages/*"], | ||
"version": "independent" | ||
"version": "independent", | ||
"npmClient": "yarn" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
module.exports = { | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
warnOnUnsupportedTypeScriptVersion: false, | ||
sourceType: 'module', | ||
jsx: false, | ||
project: 'tsconfig.json' | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
'plugin:prettier/recommended' | ||
], | ||
env: { | ||
node: true, | ||
jest: true, | ||
es2017: true | ||
}, | ||
rules: { | ||
// Enable this rule when all files are migated to TS | ||
'@typescript-eslint/no-var-requires': 'off', | ||
'@typescript-eslint/camelcase': 'off', | ||
// Enable this rule later, it explodes the terminal | ||
'@typescript-eslint/explicit-function-return-type': 'off', | ||
'@typescript-eslint/member-delimiter-style': [ | ||
'error', | ||
{ | ||
multiline: { | ||
delimiter: 'none', | ||
requireLast: false | ||
}, | ||
singleline: { | ||
delimiter: 'semi', | ||
requireLast: false | ||
} | ||
} | ||
], | ||
'@typescript-eslint/prefer-includes': 'off' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"name": "eslint-config-saber", | ||
"version": "0.0.0", | ||
"description": "ESLint config for core Saber repos", | ||
"man": "index.js", | ||
"files": [ | ||
"index.js" | ||
], | ||
"license": "MIT", | ||
"dependencies": { | ||
"@typescript-eslint/eslint-plugin": "^2.6.0", | ||
"@typescript-eslint/parser": "^2.6.0", | ||
"eslint-config-prettier": "6.3.0", | ||
"eslint-plugin-prettier": "3.1.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
{ | ||
"name": "saber-log", | ||
"version": "0.3.0", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"index.js", | ||
"colors.js" | ||
"dist" | ||
], | ||
"license": "MIT" | ||
"license": "MIT", | ||
"scripts": { | ||
"prepublishOnly": "yarn build", | ||
"build": "rollup -c" | ||
}, | ||
"devDependencies": { | ||
"rollup": "^1.26.0", | ||
"rollup-plugin-typescript2": "^0.24.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
export default { | ||
input: 'src/index.ts', | ||
output: { | ||
file: 'dist/index.js', | ||
format: 'cjs' | ||
}, | ||
plugins: [ | ||
require('rollup-plugin-typescript2')({ | ||
tsconfigOverride: { | ||
compilerOptions: { | ||
declaration: true | ||
} | ||
} | ||
}) | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"include": ["src"], | ||
"compilerOptions": { | ||
"module": "esnext" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
"files": [ | ||
"lib" | ||
], | ||
"xo": false, | ||
"peerDependencies": { | ||
"saber": ">=0.7.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
"files": [ | ||
"lib" | ||
], | ||
"xo": false, | ||
"dependencies": { | ||
"feed": "^4.0.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
"files": [ | ||
"lib" | ||
], | ||
"xo": false, | ||
"dependencies": { | ||
"execa": "^2.0.3" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
"files": [ | ||
"lib" | ||
], | ||
"xo": false, | ||
"dependencies": { | ||
"url-join": "^4.0.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
"files": [ | ||
"lib" | ||
], | ||
"xo": false, | ||
"dependencies": { | ||
"url-join": "^4.0.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ | |
"files": [ | ||
"lib" | ||
], | ||
"xo": false, | ||
"peerDependencies": { | ||
"saber": ">=0.7.0" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ | |
"files": [ | ||
"lib" | ||
], | ||
"xo": false, | ||
"dependencies": { | ||
"extract-sfc-blocks": "^0.0.2" | ||
}, | ||
|
Oops, something went wrong.