Skip to content

Conversation

@popomore
Copy link
Member

@popomore popomore commented Nov 4, 2014

Parser isn't suitable for this case, parse is a process, not a instance.
Parse function will match a local file from a url, containing any other attribute like wrap, pkg and so on.
The match will pass to many rules, break when matched, rule can be customize also

Closes #11

Parser isn't suitable for this case, parse is a process, not a instance.
Parse function will match a local file from a url, containing any other attribute like wrap, pkg and so on.
The match will pass to many rules, break when matched, rule can be customize also

Closes #11
@popomore
Copy link
Member Author

popomore commented Nov 4, 2014

Don't Merge

@coveralls
Copy link

Coverage Status

Coverage decreased (-4.66%) when pulling 307e39f on refactor-parser into 7e73dae on master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) when pulling 7934b35 on refactor-parser into 7e73dae on master.

@popomore
Copy link
Member Author

popomore commented Nov 5, 2014

这个用例被我删了,不知道有没有缺 https://github.com/spmjs/serve-spm/blob/0.6.0/test/parser.js

@popomore
Copy link
Member Author

popomore commented Nov 5, 2014

改好了

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#13

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) when pulling 0add271 on refactor-parser into 7e73dae on master.

lib/util.js Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里优先使用 spm_modules 吧。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

いいよ!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@sorrycc
Copy link
Member

sorrycc commented Nov 7, 2014

standalone 的逻辑还有点问题:

  1. util.isStandalone 里取 pkg.spm 应该用 pkg.origin.spm,不然取不到
  2. standalone 还要判断是否为输出文件,只给输出文件做 standalonify 处理
  3. 传给 standalonify 的 url 是 object,需传字符串,不然会输出 [object object]

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) when pulling eb289cd on refactor-parser into 7e73dae on master.

1. url should be string not object
2. get spm property from pkg.origin.spm
3. standalone should ignore that is not entry
@popomore
Copy link
Member Author

已更新

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.77%) when pulling 757ec96 on refactor-parser into 7e73dae on master.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的 id 被强制转成小写了? 比如 require('vendor/backbone.localStorage.js'),输出的是 define('vendor/backbone.localstorage.js', ...,导致匹配不上。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是这里有问题 https://github.com/spmjs/serve-spm/blob/0.6.0/lib/express.js#L33

那我先把 lowerCase 去掉

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.77%) when pulling 70c85b6 on refactor-parser into 7e73dae on master.

@popomore
Copy link
Member Author

已改

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.77%) when pulling 8f7a4eb on refactor-parser into 7e73dae on master.

sorrycc added a commit that referenced this pull request Nov 14, 2014
refactor(parser) abstract parser
@sorrycc sorrycc merged commit 648f15c into master Nov 14, 2014
@sorrycc sorrycc mentioned this pull request Nov 14, 2014
@popomore
Copy link
Member Author

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

映射规则可自定义

4 participants