-
Notifications
You must be signed in to change notification settings - Fork 89
refactor: typescript implement #148
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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,5 @@ | ||
| ## TODO | ||
|
|
||
| - [ ] site:增加 alias 至当前源码,并删除 react-diff-view 的依赖。 | ||
|
|
||
| - [ ] 更新 docs,可能有部分开发的文档需要更新 |
This file contains hidden or 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 hidden or 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,18 +1,19 @@ | ||
| module.exports = { | ||
| verbose: true, | ||
| testURL: 'http://localhost/', | ||
| setupFilesAfterEnv: ['<rootDir>src/__test__/setup.js'], | ||
| setupFilesAfterEnv: ['<rootDir>src/__tests__/setup.ts'], | ||
| moduleNameMapper: { | ||
| '\\.(css|less)$': 'identity-obj-proxy' | ||
| '\\.(css|less)$': 'identity-obj-proxy', | ||
| }, | ||
| collectCoverage: true, | ||
| coverageDirectory: 'coverage', | ||
| coverageThreshold: { | ||
| global: { | ||
| branches: 67, | ||
| functions: 85, | ||
| lines: 85, | ||
| lines: 84, | ||
| statements: 85, | ||
| }, | ||
| }, | ||
| testMatch: ['<rootDir>src/**/__tests__/**/*.test.{js,jsx,ts,tsx}'], | ||
| }; |
This file contains hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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,6 +1,8 @@ | ||
| yarn | ||
| yarn clean | ||
| export NODE_ENV=production | ||
| node rollup.js | ||
| node node_modules/.bin/postcss -o style/index.css src/styles/index.css | ||
| node scripts/fix-css.js style/index.css | ||
| rm -rf cjs/ && tsc | ||
| rm -rf es/ && tsc --project tsconfig.es.json | ||
| postcss -o cjs/style/index.css src/styles/index.css | ||
| node scripts/fix-css.js cjs/style/index.css | ||
| postcss -o es/style/index.css src/styles/index.css | ||
| node scripts/fix-css.js es/style/index.css | ||
This file contains hidden or 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,31 @@ | ||
| { | ||
| "name": "site", | ||
| "version": "1.0.0", | ||
| "description": "", | ||
| "main": "index.js", | ||
| "scripts": { | ||
| "build": "skr build --clean", | ||
| "start": "skr dev" | ||
| }, | ||
| "dependencies": { | ||
| "antd": "^4.16.13", | ||
| "diff-match-patch": "^1.0.5", | ||
| "gitdiff-parser": "^0.2.2", | ||
| "prism-color-variables": "^1.0.0", | ||
| "react": "^17.0.2", | ||
| "react-diff-view": "^2.4.8", | ||
| "react-dom": "^17.0.2", | ||
| "refractor": "^3.5.0", | ||
| "sha1": "^1.1.1", | ||
| "styled-components": "^5.3.3", | ||
| "unidiff": "^1.0.2" | ||
| }, | ||
| "devDependencies": { | ||
| "@reskript/cli": "^2.2.2", | ||
| "@reskript/cli-build": "^2.2.2", | ||
| "@reskript/cli-dev": "^2.2.2", | ||
| "core-js": "^3.19.0" | ||
| }, | ||
| "author": "", | ||
| "license": "ISC" | ||
| } |
This file contains hidden or 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,14 @@ | ||
| // const path = require('path'); | ||
|
|
||
| exports.build = { | ||
| appTitle: 'Online Diff', | ||
| // 无法编译 alias 下的 ts 代码,先用 npm 版本跑通 | ||
| // finalize: webpackConfig => { | ||
| // webpackConfig.resolve.alias['react-diff-view'] = path.resolve(__dirname, '..', 'cjs'); | ||
| // return webpackConfig; | ||
| // }, | ||
| }; | ||
|
|
||
| exports.devServer = { | ||
| port: 9031, | ||
| }; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
site/components/DiffView/Tokenize.worker.js → ...rc/components/DiffView/Tokenize.worker.js
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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 hidden or 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,39 @@ | ||
| //@component-background: var(--antd-component-background); | ||
| //@background-color-base: var(--antd-background-color-base); | ||
| //@heading-color: var(--antd-heading-color); | ||
| //@text-color: var(--antd-text-color); | ||
| //@text-color-secondary: var(--antd-text-color-secondary); | ||
| //@text-color-inverse: var(--antd-text-color-inverse); | ||
| //@icon-color-hover: var(--antd-icon-color-hover); | ||
| //@heading-color-dark: var(--antd-heading-color-dark); | ||
| //@text-color-dark: var(--antd-text-color-dark); | ||
| //@text-color-secondary-dark: var(--antd-text-color-secondary-dark); | ||
| //@item-active-bg: var(--antd-item-active-bg); | ||
| //@item-hover-bg: var(--antd-item-hover-bg); | ||
| //@border-color-base: var(--antd-border-color-base); | ||
| //@border-color-split: var(--antd-border-color-split); | ||
| //@background-color-light: var(--antd-background-color-light); | ||
| //@disabled-color: var(--antd-disabled-color); | ||
| //@disabled-bg: var(--antd-disabled-bg); | ||
| //@disabled-color-dark: var(--antd-disabled-color-dark); | ||
| //@btn-default-bg: var(--antd-btn-default-bg); | ||
| //@checkbox-check-color: var(--antd-checkbox-check-color); | ||
| //@input-bg: var(--antd-input-bg); | ||
| //@input-number-handler-active-bg: var(--antd-input-number-handler-active-bg); | ||
| //@table-selected-row-bg: var(--antd-table-selected-row-bg); | ||
| //@table-expanded-row-bg: var(--antd-table-expanded-row-bg); | ||
| //@tree-directory-selected-color: var(--antd-tree-directory-selected-color); | ||
| //@table-row-hover-bg: var(--antd-table-row-hover-bg); | ||
| //@popover-bg: var(--antd-popover-bg); | ||
| //@shadow-color: var(--antd-shadow-color); | ||
| //@btn-shadow: var(--antd-btn-shadow); | ||
| //@btn-primary-shadow: var(--antd-btn-primary-shadow); | ||
| //@btn-text-shadow: var(--antd-btn-text-shadow); | ||
| //@alert-success-border-color: var(--antd-alert-success-border-color); | ||
| //@alert-success-bg-color: var(--antd-alert-success-bg-color); | ||
| //@alert-info-border-color: var(--antd-alert-info-border-color); | ||
| //@alert-info-bg-color: var(--antd-alert-info-bg-color); | ||
| //@alert-warning-border-color: var(--antd-alert-warning-border-color); | ||
| //@alert-warning-bg-color: var(--antd-alert-warning-bg-color); | ||
| //@alert-error-border-color: var(--antd-alert-error-border-color); | ||
| //@alert-error-bg-color: var(--antd-alert-error-bg-color); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
恐怕我们不能现在就改成
tsc编译。之前版本是一个bundle,它可以直接用于<script>引入等方式,而tsc的产物并不是打包的,这会是一个BREAKINGThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你觉得应该怎么处理?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
在这个大版本中,乖乖保留原来的
rollup构建吧,下个大版本改为tscThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rollup 怎么生成 d.ts 啊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
版本控制可以交给你,我这个能发个 3.0-alpha.0 就好?
我想你后续对 3.0 也有很多构想吧。你可以在这个基础上搞。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
让
tsc生成定义,然后用rollup生成bundle,这样行不?入口是index.js -> index.d.ts,能对上应该就没问题Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可能的问题