Skip to content
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

fis3开发API,无readJson(path)方法,应该是readJSON(path),写错 #1139

Open
wants to merge 44 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
af5d55a
Dev (#737)
zdy350 Jun 2, 2017
07906c0
Dev (#1137)
hefangshi Jun 2, 2017
f41a541
[UPDATE] fix README.md syntax
Jul 14, 2017
eac4dfd
Merge pull request #1154 from xiangshouding/master
2betop Jul 14, 2017
d549bd9
version + 1
2betop Jul 25, 2017
9c0ca78
Merge pull request #1153 from fex-team/dev
2betop Aug 17, 2017
f005cc9
Update util.js
2betop Sep 4, 2017
50da17f
添加 .pcss 到文本后缀
2betop Sep 4, 2017
549a354
升级 command-release 插件
2betop Oct 9, 2017
2dd83e7
[UPDATE] update png-compress and cssscripts plugin
oxUnd Nov 7, 2017
581eefb
[UPDATE] release 3.4.38
oxUnd Nov 7, 2017
5e02923
[UPDATE] update README.md
oxUnd Nov 7, 2017
91402b6
修改 deploy 注意事项
2betop Nov 9, 2017
7c8e039
Merge branch 'master' of github.com:fex-team/fis3
2betop Nov 9, 2017
30118ba
注释掉下载相关用例
2betop Nov 9, 2017
038ba59
Update debug.md
2betop Nov 9, 2017
9e5d83c
Update README.md
oxUnd Nov 13, 2017
6f31e14
更新 fis3-command-release
2betop Dec 18, 2017
ac39989
修改set与get路径处理不同导致存取值不同的差异问题
Jun 5, 2018
26b1485
Merge pull request #1259 from StopllL/fis3-1
2betop Jun 6, 2018
3234241
修正文档
313224646 Jun 11, 2018
2c006ab
Merge pull request #1260 from q2500819/fis3-fs
2betop Jun 11, 2018
16819d7
fix upload error
poppopret Aug 4, 2018
bf092d5
Merge pull request #1269 from PopPopRet/master
2betop Aug 6, 2018
eadc96b
useCompile 应该是由源文件后缀决定而不是产出文件后缀
2betop Sep 4, 2018
bf86169
支持node服务配置自定义证书
2betop Nov 13, 2018
2efea46
升级 fis3 inspect
2betop Dec 21, 2018
f4de2a6
Update package.json
oxUnd Jan 11, 2019
4670014
[UPDATE] update image process plugin
oxUnd Jan 11, 2019
7327d6c
[UPDATE] [email protected]
oxUnd Jan 11, 2019
5209274
升级 watch 模块
2betop Dec 27, 2019
3ee08e9
先还原代码,新版本对 node 要求很高
2betop May 12, 2020
d6ead5b
去掉 csssprite 依赖
2betop Feb 2, 2021
15008cc
png compress 默认也不安装
2betop Feb 2, 2021
b22cfe0
[UPDATE] Delete useless files
oxUnd Aug 13, 2021
a75f442
升级依赖
2betop Aug 13, 2021
8c75cb5
升级 tar
2betop Aug 13, 2021
48c3dd3
升级 tar
2betop Aug 13, 2021
1bddbdb
用 beta 版本用最新的 release 包
2betop Oct 13, 2021
2a59d19
升级 fis3-deploy-http-push 固定 colors 版本
2betop Jan 10, 2022
ae54044
fix: 修复在正则中的 \// 被认为是注释而跳过编译的问题
2betop Mar 21, 2022
de08a82
fix: 修复node>=14高版本无法支持传入undefined issues#1320
bugkiwi Nov 22, 2023
1abf4ca
Merge pull request #1339 from bugkiwi/master
2betop Nov 22, 2023
3a5407c
bump: release 3.5.0-beta.4
2betop Nov 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 4 additions & 28 deletions ISSUE_TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
<!--
感谢反馈问题:)为了降低沟通成本,让我们更快的响应您的问题,请审阅您的 Issue 是否符合以下几点

1. 已经在 fis3 与 fis 的历史 Issue 中寻找过相关问题,并没有找到相关的问题,或者历史问题无法解决您的问题。
Issue 地址是 https://github.com/fex-team/fis/issues 与 https://github.com/fex-team/fis3/issues
2. 问题描述时请使用正确的Markdown格式包裹 html、js、css内容,例如


```html
<h1>请勿在此处填写你的问题</h1>
```

```javascript
// 请勿在此处填写你的问题
```

```css
/* 请勿在此处填写你的问题 */
```

3. 如果可以提供复现DEMO,您的问题会被更快的解决
4. 请按照下列格式填写一些基础信息
-->

* **操作系统**:
* **Node版本**: <node --version>
* **FIS版本**: <fis3 --version>
* **解决方案**: <fis3-smarty/fis3-jello/yog2>
* **Node版本**:
* **FIS版本**:
* **解决方案**:
* **依赖插件**:

<!-- 请在下方填写您的问题 -->

15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,30 @@
![](https://img.shields.io/npm/v/fis3.svg) ![](https://img.shields.io/npm/dm/fis3.svg)
[![Build Status](https://travis-ci.org/fex-team/fis3.svg?branch=master)](https://travis-ci.org/fex-team/fis3)
[![Coverage Status](https://coveralls.io/repos/fex-team/fis3/badge.svg?branch=master&service=github)](https://coveralls.io/github/fex-team/fis3?branch=master)
[![](https://david-dm.org/fex-team/fis3/status.svg)](https://david-dm.org/fex-team/fis3)

FIS3 面向**前端**的**工程构建系统**。解决前端工程中性能优化、资源加载(异步、同步、按需、预加载、依赖管理、合并、内嵌)、模块化开发、自动化工具、开发规范、代码部署等问题。

> 如果对FIS先有些了解,但理解不深的,可试着带着这句话去看文档 <br>
> FIS3 会在配置文件中给文件添加相应属性,用于控制文件的编译、合并等各种操作;文件属性包括基本属性和插件属性,[详细请参考](https://github.com/fex-team/fis3/blob/master/doc/docs/api/config-props.md#文件属性)

```
```bash
npm install -g fis3
```

**如果 Node 版本低于 4.x 请安装旧版本**

```bash
npm install -g [email protected]
```

## 文档

快速入门、配置、插件开发以及原理等文档 [doc/docs/INDEX.md](doc/docs/INDEX.md)

## 例子

```
```bash
mkdir my-proj
cd my-proj
fis3 init
Expand Down Expand Up @@ -73,12 +80,12 @@ https://github.com/fex-team/fis3-demo

## 常用插件

###优化类(插件属性:optimizer)
### 优化类(插件属性:optimizer)
- [fis-optimizer-uglify-js](https://www.npmjs.com/package/fis-optimizer-uglify-js) UglifyJS2 压缩插件
- [fis-optimizer-clean-css](https://www.npmjs.com/package/fis-optimizer-clean-css) CleanCss 压缩插件
- [fis-optimizer-png-compressor](https://www.npmjs.com/package/fis-optimizer-png-compressor) PNG 压缩插件

###预处理类(插件属性:parser)
### 预处理类(插件属性:parser)
- [fis-parser-less](https://www.npmjs.com/package/fis-parser-less) less 解析插件
- [fis-parser-node-sass](https://www.npmjs.com/package/fis-parser-node-sass) sass / scss 解析插件
- [fis-parser-handlebars](https://www.npmjs.com/package/fis-parser-handlebars) handlebars 解析插件
3 changes: 3 additions & 0 deletions doc/docs/beginning/debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ fis3 release -wL

当我们开发项目后,需要发布到测试机(联调机),一般可以通过如 SMB、FTP 等上传代码。FIS3 默认支持使用 HTTP 上传代码,首先需要在测试机部署上传接收脚本(或者服务),这个脚本非常简单,现在给出了 [php 的实现版本](https://github.com/fex-team/fis-command-release/blob/master/tools/receiver.php),可以把它放到测试机上某个 Web 服务根目录,并且配置一个 url 能访问到即可。

> 注意:**此代码存在很大的安全隐患,没有做任何安全考虑,请不要部署到线上服务。**
> 百度内部请使用:http://agroup.baidu.com/fis/md/article/196978

> 示例脚本是 php 脚本,测试机 Web 需要支持 PHP 的解析 <br />
> 如果需要其他语言实现,请参考这个 php 脚本实现,如果嫌麻烦,我们提供了一个 node 版本的[接收端](https://github.com/fex-team/receiver)

Expand Down
4 changes: 2 additions & 2 deletions doc/docs/pack.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ fis.match('::package', {
// main.js 的所有同步依赖加入队列
'/static/hello/src/main.js:deps',

// 将 main.js 所以异步依赖加入队列
// 将 main.js 的所有异步依赖加入队列
'/static/hello/src/main.js:asyncs',

// 移除 comp.js 所有同步依赖
// 移除 comp.js 的所有同步依赖
'!/static/hello/src/comp.js:deps'
],

Expand Down
2 changes: 1 addition & 1 deletion doc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"license": "MIT",
"dependencies": {
"fis3-postpackager-loader": "^1.0.17",
"highlight.js": "^8.6.0",
"highlight.js": ">=9.18.2",
"marked": "^0.3.3"
}
}
2 changes: 1 addition & 1 deletion lib/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ function analyseComment(comment, callback) {
* @memberOf fis.compile
*/
function extJs(content, callback, file) {
var reg = /"(?:[^\\"\r\n\f]|\\[\s\S])*"|'(?:[^\\'\n\r\f]|\\[\s\S])*'|(\/\/[^\r\n\f]+|\/\*[\s\S]*?(?:\*\/|$))|\b(__inline|__uri|__require|__id|__moduleId|__hash)\s*\(\s*("(?:[^\\"\r\n\f]|\\[\s\S])*"|'(?:[^\\'\n\r\f]|\\[\s\S])*')\s*\)/g;
var reg = /"(?:[^\\"\r\n\f]|\\[\s\S])*"|'(?:[^\\'\n\r\f]|\\[\s\S])*'|((?<!\\)\/\/[^\r\n\f]+|\/\*[\s\S]*?(?:\*\/|$))|\b(__inline|__uri|__require|__id|__moduleId|__hash)\s*\(\s*("(?:[^\\"\r\n\f]|\\[\s\S])*"|'(?:[^\\'\n\r\f]|\\[\s\S])*')\s*\)/g;
callback = callback || function(m, comment, type, value) {
if (type) {
switch (type) {
Expand Down
3 changes: 2 additions & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ var Config = Object.derive(/** @lends fis.config.Config.prototype */{
},
_get: function(path) {
var result = this.data;
(path || '').split('.').forEach(function(key) {
path = String(path || '').trim();
path.split('.').forEach(function(key) {
if (key && (typeof result !== 'undefined')) {
result = result[key];
}
Expand Down
4 changes: 2 additions & 2 deletions lib/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ var File = Object.derive(function() {
this._likes = {};
this.defineLikes();

if (_.isTextFile(rExt)) {
if (_.isTextFile(ext)) {
this._isImage = false;
this._isText = true;
this.charset = null;
Expand Down Expand Up @@ -266,7 +266,7 @@ var File = Object.derive(function() {
this.isJsonLike = true;
break;
}
} else if (_.isImageFile(rExt)) {
} else if (_.isImageFile(ext)) {
// this.useDomain = true;
// this.useHash = rExt !== '.ico';
} else {
Expand Down
8 changes: 6 additions & 2 deletions lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var TEXT_FILE_EXTS = [
'text', 'xhtml', 'html', 'md',
'conf', 'po', 'config', 'tmpl',
'coffee', 'less', 'sass', 'jsp',
'scss', 'manifest', 'bak', 'asp',
'scss', 'pcss', 'manifest', 'bak', 'asp',
'tmp', 'haml', 'jade', 'aspx',
'ashx', 'java', 'py', 'c', 'cpp',
'h', 'cshtml', 'asax', 'master',
Expand Down Expand Up @@ -68,6 +68,7 @@ var TEXT_FILE_EXTS = [
'sass': 'text/css',
'scss': 'text/css',
'styl': 'text/css',
'pcss': 'text/css',
'manifest': 'text/cache-manifest',
//image
'svg': 'image/svg+xml',
Expand Down Expand Up @@ -729,7 +730,7 @@ _.write = function(path, data, charset, append) {
if (append) {
fs.appendFileSync(path, data, null);
} else {
fs.writeFileSync(path, data, null);
fs.writeFileSync(path, data || '', null);
}
};

Expand Down Expand Up @@ -1267,6 +1268,9 @@ _.upload = function(url, opt, data, content, subpath, callback) {
callback(err.message || err);
});
});
req.on('error', function(err) {
callback(err.message || err);
});
collect.forEach(function(d) {
req.write(d);
});
Expand Down
20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fis3",
"version": "3.4.33",
"version": "3.5.0-beta.4",
"description": "fis 3.0",
"main": "index.js",
"bin": {
Expand All @@ -12,22 +12,20 @@
"glob": "5.0.3",
"iconv-lite": "0.2.10",
"liftoff": "2.2.1",
"lodash": "4.12.0",
"minimatch": "2.0.4",
"minimist": "1.1.1",
"tar": "2.2.1",
"lodash": "4.17.21",
"minimatch": "3.0.4",
"minimist": "1.2.3",
"tar": "4.4.15",
"fis-command-install": "0.2.17",
"fis-lolcat": "1.0.1",
"fis-optimizer-clean-css": "0.0.9",
"fis-optimizer-png-compressor": "0.1.6",
"fis-optimizer-uglify-js": "0.2.2",
"fis-spriter-csssprites": "0.3.11",
"fis3-command-init": "1.0.14",
"fis3-command-inspect": "1.0.3",
"fis3-command-release": "1.3.13",
"fis3-command-inspect": "~1.0.6",
"fis3-command-release": "1.3.19",
"fis3-command-server": "0.0.9",
"fis3-server-node": "0.1.1",
"fis3-deploy-http-push": "2.0.6",
"fis3-server-node": "0.1.3",
"fis3-deploy-http-push": "2.0.8",
"fis3-deploy-encoding": "1.0.0",
"fis3-deploy-local-deliver": "1.0.0",
"fis3-hook-components": "1.0.4",
Expand Down

This file was deleted.

Loading