Open
Conversation
bgdsh
reviewed
Aug 9, 2018
| "watch": "jest --watchAll" | ||
| "lint": "tslint -t codeFrame 'src/**/*.ts' 'test/**/*.ts'", | ||
| "prebuild": "rimraf dist", | ||
| "build": "tsc --module commonjs && rollup -c rollup.config.ts && typedoc --out docs --target es6 --theme minimal --mode file src", |
Owner
Author
There was a problem hiding this comment.
好的, 配置的我还没弄, 这个从https://github.com/alexjoverm/typescript-library-starter 这里抄来的
回头好好整理一下。
| meta: object | ||
| } | ||
|
|
||
| interface IBlogModule { |
Owner
Author
There was a problem hiding this comment.
是我没用对 我在Index里 应该规定接口, 而不是直接引用类。
|
|
||
| build(blogs: IBlog[]): void { | ||
| const rootPath = getRootPath() | ||
| saveToFile(path.join(rootPath, this.fileName), JSON.stringify(blogs)) |
src/utils/files.ts
Outdated
| ) => { | ||
| const itemPath = path.join(pathLike as string, name) | ||
| if (checkIsDirectory(itemPath)) { | ||
| return allItems.concat(getDirFileInfo(itemPath, root) as string[]) |
Owner
Author
There was a problem hiding this comment.
这因为有个reduce, 我把reduce单独拆出去,这样就不用使用 两种类型了。
| public readonly size: number | ||
| public readonly meta: object | ||
|
|
||
| constructor(fileInfo: IFileInfo) { |
There was a problem hiding this comment.
这里看起来不是太好拓展,建议写一个IBlogOptions接口,fileInfo是其中的一个成员。
| public readonly createdAt: Date | ||
| public readonly updatedAt: Date | ||
| public readonly size: number | ||
| public readonly meta: object |
Owner
Author
There was a problem hiding this comment.
meta是这个样子的, 是github markdown上边的一段yaml, 里面写什么字段我并不知道, 或者说用户写什么他自己清楚,他自己会用就可以了。
https://github.com/ole3021/gh-blogs/blame/refactor-typescript/test/fixture/about.md#L4
这个我也不知道怎么办, 在测试的时候 编辑器还会报错。
https://github.com/ole3021/gh-blogs/blob/refactor-typescript/test/unit/blogs.spec.ts#L24
Owner
Author
|
mvc呗?扔到一个目录里?有什么代码可以参考一下。 |
|
这句话啥意思? |
Repository owner
deleted a comment from
liuzhebaba
Feb 23, 2024
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.