-
Notifications
You must be signed in to change notification settings - Fork 65
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
File Helper V2.8 #199
File Helper V2.8 #199
Conversation
feat(block):zip相关积木 feat(block):按照读取方式打开上次打开的文件
pref(code):将dom加载jszip改为直接加载
pref(code):使用npm添加jszip组件
fix(code):忘删debug了
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.
如果你是 webpack 或者别的 js 代码打包工具的话,有几个需要注意的。
- tempExt 是仅用于测试的入口,tempExt 的定义,不要写入到你的扩展 class 文件中。
你可以将 tempExt 单独写到一个文件,作为你扩展的注册入口文件。 - 静态资源文件,比如 扩展icon 和 封面,也请提供独立的文件或者模块。(带包后内联到压缩代码中,我无法单独复制出来,上传 CDN)
- 提供单独的 info 文件,里面扩展的基本信息(就是 tempExt 中填写的内容,可以和 tempExt为同一个文件)
pref(code):优化了目录结构
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.
既然你都告诉 webpack 了,那 jszip 要不要试试用 npm 来安装。
然后学习下 @kukemc ,把 package.json 搞标准点。
这样你就学会前端的基础项目工作流了,你写其他前端代码也可以用了。
pref(file):优化文件目录结构
使用 bundler 的项目不应将整个项目都提交到扩展仓库,请在 GitHub 上另开仓库,提交编译后的产物,并在 pr 中链接原仓库(如 lpp)。 |
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.
修改意见如上。
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.
看起来这个扩展里面包含了
zip 文件处理
文本文件处理
我建议将他们分开,这样可以显著降低单个扩展的复杂度
如果他们有公用的工具方法,你也可以把他抽象出来成为单独的 util ,这样代码组织度也会更好
分开应该怎么处理,是让两个扩展都有打开文件下载文件等一样的积木还是需要先加载文件助手才能加载zip扩展作为其前置? |
pref(code):使用npm添加jszip组件
feat(block):zip相关积木
feat(block):按照读取方式打开上次打开的文件