Giter VIP home page Giter VIP logo

Comments (11)

lifesinger avatar lifesinger commented on July 19, 2024

package.json 里没有 wrapping 信息

或者我们可以要求:package.json + transport.json ? transport 里仅包含 wrapping 信息。

from spm.

yyfrankyy avatar yyfrankyy commented on July 19, 2024

对,现在Wrapping规范,还就缺乏wrapping的模板定义。这个模板还真得依赖各种wrapping moduling的实现。

前面package.json部分,却大都是殊途同归。只不过在node方面考虑了更多的平台依赖,比如cpu架构,os信息,系统包依赖(比如openssl)

from spm.

lifesinger avatar lifesinger commented on July 19, 2024

wrapping 是 transport 的一种。

那我们就分拆成 package.json 和 transport.json 好了,呵呵。transport.json 里:

/**
 * @package.json http://path/to/package.json
 * @tags dom,event,library,ui library
 *
 * @src http://a.tbcdn.cn/s/kissy/1.2.0/kissy.js
 * @min http://a.tbcdn.cn/s/kissy/1.2.0/kissy-min.js
 */
define(function(require, exports, module) {

   /*{{code}}*/

  module.exports = KISSY;
});

from spm.

lifesinger avatar lifesinger commented on July 19, 2024

没有提供 package.json 的,本地建一个,同时 transport.json 里:

@package.json ./package.json

from spm.

yyfrankyy avatar yyfrankyy commented on July 19, 2024

packages里有这种配置,用来声明一些模块的本地路径,相当于我们的@src@min

"directories": {
    "lib": "src/lib",
    "bin": "local/binaries",
    "jars": "java" 
}

如果指定本地目录,则从本地读取?

from spm.

lifesinger avatar lifesinger commented on July 19, 2024

我们给 package.json 增加一个?

"source code": {
"uncompressed": "http://...",
"minified": "http://..."
}

这样?

问题是,既有的 package.json 里,都无这些信息。对于没有的,还是得定一种格式,写在 transport.json 里。

from spm.

lifesinger avatar lifesinger commented on July 19, 2024

或者,去除 transport.json, 直接 package.json 里增加:

"transport": function() {
define(function(...) {
...
/{{code}}/
...
});
}

问题还是,这是我们定义的,麻烦。

from spm.

yyfrankyy avatar yyfrankyy commented on July 19, 2024

src跟min看来都是需要的,即对应已经build过的东西。

设想一个场景:jquery目前他的库里build目录是没有打包好的,即有一些库不会在源码库里保存他build好的文件,而transport.js 又需要他指定build好的src跟min,那他的transport.js 就没办法跟着自己的仓库一直维护着了。

怎么表示都还好,我的意思是,或者有些库可以不提供http/https,而是提供本地的路径?

from spm.

yyfrankyy avatar yyfrankyy commented on July 19, 2024

wrapping部分额外提供独立模板应该问题不大的,以后如果要对kissy做wrapping,只需要提供不同的模板就好了,同样requirejs好像也是有wrapping的成分在内,只要是wrapping都可以复用配置(即package.json),提供不同的wrapping模板。

from spm.

lifesinger avatar lifesinger commented on July 19, 2024

嗯,我明白了。

@src ./local/path/ 就好

是本地路径就抓本地的,呵呵。小心 win32:

C:\path\to...

根目录:/xx/tt/

还有相对路径

from spm.

yyfrankyy avatar yyfrankyy commented on July 19, 2024

直接port给了系统支持,不再做多余的地址解析操作。见下文。

https://github.com/seajs/spm/commit/551abd31644b4292c74c2728c3d3b2a9a3755c2d#diff-2

from spm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.