Giter Club home page Giter Club logo

athena's People

Contributors

adamchuan avatar cnt1992 avatar honlyhuang avatar littly avatar luckyadam avatar manjiz avatar panxinwu avatar secbone avatar simbachen avatar waileung avatar wengeek avatar youing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

athena's Issues

建议 widget 中可以在 json 中设置默认值

目前 widget 的 json 文件有一个 data 字段,但是好像还没有什么作用。

是否考虑可以在 data 中设置组件需要的默认值,调用组件时,把预设值的默认值与传入的参数进行合并,然后提供给组件使用。 :)

// widget.html
<h4><%= hello %> <%= name %>!</h4>

// widget.json
{
    ...
    data: {
         "hello": "hello",
         "name": "world"
    }
}


//main.html
<%= widget.load('widget', {name: "adam"}) %>     // <h4>hello adam!</h4>

shtml 文件及本地sinclude 的问题

目前新建的page 只能是html,手动把它后缀改成shtml 编译时也不会被解析,希望改进下,使得新建page 时类型可选shtml 文件,以及本地服务器增加处理sinclude 语句的能力,以方便本地开发调试。

无法初始化应用

版本:[email protected]
出错命令:ath app
出错信息
Allo xxxx! 我要开始创建项目了哟~
need help? go and open issue: https://github.com/o2team/athena/issues/new
undefined:1

^
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse ()
at Request._callback (/usr/local/lib/node_modules/athena-html/lib/create/base.js:232:25)
at Request.self.callback (/usr/local/lib/node_modules/athena-html/node_modules/request/request.js:187:22)
at Request.emit (events.js:182:13)
at Request. (/usr/local/lib/node_modules/athena-html/node_modules/request/request.js:1126:10)
at Request.emit (events.js:182:13)
at IncomingMessage. (/usr/local/lib/node_modules/athena-html/node_modules/request/request.js:1046:12)
at Object.onceWrapper (events.js:273:13)
at IncomingMessage.emit (events.js:187:15)
at endReadableNT (_stream_readable.js:1094:12)

compass 合成雪碧图时引用不存在文件

当引用雪碧图中不存在的文件的时候,会报:

error schoolopen/dist/_/static/sass/page.scss (/Library/Ruby/Gems/2.0.0/gems/compass-core-1.0.3/lib/compass/core/sass_extensions/functions/image_size.rb:31:in `get_size_for_png': undefined method `unpack' for nil:NilClass)

当把这个文件补上以后,依然报错,并且不能正常生成雪碧图 ( 0 bytes )

目前解决方案是,把原来的雪碧图删除,重新生成

看有没有别的方案可以自动 fix

是否可以去掉对 athena-png-native 模块的依赖

我这边运行 serve 的时候发现抛出了一个错误,发现是 athena-png-native 模块最后一行抛出的,详情

然后看了一下 athena 的引用,发现这个模块只有在这里 被引入过,并没有使用

所以这里是不是可以去掉这个依赖模块?

增加对 node v7.x 的支持

[20:07:46] 开始编译模块live_cia!
[20:07:46] 开始扫描live_cia模块所有文件!
undefined
Error: Can't load the addon. Issue to: https://github.com/xiangshouding/node-pngquant-native/issues
    at Object.<anonymous> (/usr/local/lib/node_modules/athena-html/node_modules/athena-png-native/node-pngquant-native/binding.js:66:7)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/athena-html/node_modules/athena-png-native/node-pngquant-native/index.js:1:77)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
[20:07:46] 预览live_cia模块...

貌似是 node-pngquant-native 这个库的问题,没有往下追...

更好的watch

watch到目录的改动,最好让做所有的命令操作时不需要中断watch

模板变量未定义的问题

如果模板里用到了一个未传入的变量,如 <%= username || 'visitor' %> ,会报 ReferenceError: username is not defined 的错误,望修复,谢谢!

按需引入插件如何配置

使用 element ui的时候,需要实现按需引入
需要修改 .babelrc ,和增加 babel-plugin-component 插件

这个需要如何配置,按照文档没有看明白

可以兼容react吗

这套开发流程可以兼容react吗?我觉得这种做法对项目侵入性比较大,有没有轻巧的,可以对接其他项目的,比如react vue

一些建议

感谢凹凸团队开源这么好用的前端流程工具谢谢!这里有一些使用建议:构建模块的时候,控制台会有一些中文提示,建议改成英文的,嘿嘿,毕竟咱们也是一个国际化的团队,嘿嘿。提示文字是够可以简单严肃一点,每次使用的时候都会笑场,囧。。。一些薄见,还请海涵。谢谢!

IMG标签src 图片资源定位问题

使用NERVJS 框架
在JSX中IMG标签引入图片,图片无法预览,好像是没有引用的问题,在CSS中应用的背景图片就可以访问的到?
请问这种要怎么解决或者要怎么写
image
image

雪碧图生成问题

sass雪碧图合并函数:

// 雪碧图合并
// $name:[雪碧图名称]
// $img:[图标文件名]
// $rem:[单位]rem/px
// $rootvalue:[如果是rem需要指定一个rootvale值]
// 使用:@include as('halo', 'icon_halo'); 或 @include as('halo', 'icon_halo', rem);
@mixin as($name:sprite,$img:'',$rem: 'px', $rootvalue: 20){
    @if($rem!='rem'){
        $rem: 'px';
    }
    @if($rem=='rem'){
        $rem: 'rem=#{$rootvalue}';
    }
    @if(''!=$img){
        background: url(images/#{$img}@2x.png?__sprite=#{$name}&__#{$rem});
    }
}

我们通过这样调用

        @include as("icon", "p1_btn", "rem");
        @include as("icon", "p1_btn", "px");

生成出来的雪碧图,只会选择一种单位,而我需要两种单位

        @include as("page", "p1_btn", "rem");
        @include as("icon", "p1_btn", "px");

生成出来的雪碧图,只会选择其中一个,且只选择一种单位,而我需要是要两张雪碧图,两种单位

组件归属问题

组件在创建时是基于module创建的,但是在打包合并的时候,却是基于页面去区分的。

也就是公共组件会在不同页面里被重复引用并且分别打包,有点迷

是否应该把公共组件打包到static里面去?

全局的Less文件怎么处理

在不同的模块和组件中的less文件需要引入gb/static/目录下全局的common.less,但是当前在less中引入common.less的话,路径只在当前的模块路径下面寻找,应该怎么配置才能让gb/static/less/目录下的全局的less生效

Serve命令执行到styles后退出,无报错

问题描述

执行ath s后,log最后如下:

[14:14:11] 开始tuan模块任务styles!
[14:14:12] gulp-postcss: buy.css

然后无错误退出,在其它机器上正常使用

环境

node: 10.3.0 (nvm管理)
npm:6.1.0
athena-html:1.4.14

定位

  1. 打日志发现是lib/build/task/styles.js文件第69行代码
    把自定义包装pipe的代码去掉后,正常使用

.pipe($.if(isServe, athenaMate.plumber())) // 删除这行正常,进一步排查这个函数

  1. 这个函数的作用是返回包装后的through2.obj();
    对应文件是lib/build/athena_mate/athena_plumber.js
    删除第66行代码后正常,具体见下方评论。

疑问

我的疑问是在93行中,每次执行pipe2的时候已经会重新patchPipe了,这里为什么在pathPipe函数中还要监听重新patch一次?

字体压缩不生效,且提示找不到路径

module-conf.js

    fontcompress : {
      enable: true
    },

project/index.less

 @font-face {
    font-family: 'benmoxueyuan';
    src: url('benmoxuaeyuan.ttf');
    font-weight: normal;
    font-style: normal;
}
    .main {
      font-family: 'benmoxueyuan';
      width: 100%;
      margin-top: 50px;
      font-size: 25px;
    }

module-conf.js compress 缺省值补全

目前版本,compress 选项已经默认在 module-conf.js 上显示了。不过,原来的 transform 压缩问题仍未得到解决。麻烦在下一个版本使用以下配置:

compress: {
css: {
mergeRules: false,
mergeIdents: false,
reduceIdents: false,
discardUnused: false,
minifySelectors: false,
reduceTransforms: false
},
js: {
mangle:{except : ['require', 'exports', 'seajs', 'module']}
}
},

athena在webstorm中的文件复制 bug

athena 开启server模式的时候 通过webstorm复制文件到对应的page目录 会导致假死 而且进程杀不掉..只能重启电脑才能继续开发
win7,nodejs:8.11.4


更正: 好像不仅仅是webstorm的复制 我通过win7的资源管理器去复制图片文件,然后使用webstorm的sync刷新一下webstorm目录 接着这个Athena直接死掉 nodejs也关闭不掉。。

增加?__inline扩展功能到字体上面

目前?__inline功能主要是针对图片的,可以尝试扩展,对xx.ttf、xx.svg等字体文件直接转换为base64,从而解决跨域,减少请求的问题

babel转换过滤bug|PC|athena1.4.3

我在写业务时会引入几个库如:

  <%= getJS('tweenjs-0.6.2.min.js') %>
  <%= getJS('preloadjs-0.6.2.min.js') %>
  <%= getJS('easeljs-0.8.2.min.js') %>
  <%= getJS('soundjs-0.6.2.min.js') %>
  <%= getJS('zepto.min.js') %>
  <%= getJS('zepto.animation.js') %>
  <%= getJS() %>

因为我不想库文件被转换了所以在配置时排除

useBabel: {
      enable: true,
      jsxPragma: 'Nerv.createElement', // jsx转换支持,默认为 React.createElement
      exclude: [ // 排除掉不需要转义的文件
        'static/js/easeljs-0.8.2.min.js',
        'static/js/preloadjs-0.6.2.min.js',
        'static/js/soundjs-0.6.2.min.js',
        'static/js/tweenjs-0.6.2.min.js',
        'static/js/zepto.animation.js',
        'static/js/zepto.min.js',
      ]
    },

然后用 ath s 启动服务,但当我修改业务代码,保存后发现以上库文件都会报错,
应该是被babel修改了。

sass 监听更新问题

当页面引用自建的 main.scss 文件,在 main.scss 改动时,页面会刷新并载入新样式,
但是当在 main.scss 文件中 import 另外一个自建样式文件,如 other.scss,当修改 other.scss 文件时,页面有刷新,但是并没有编译载入新的样式,而是需要在 main.scss 改变时才重新编译出新样式

能否考虑扩展一下雪碧图的功能

athena 的雪碧图片能否扩展一下或是出些新的API。目前有两个场景用不了:js(canvas)的素材雪碧图; css中非background的雪碧图(专指mask)

css hash 更新问题

build 生成的 css 文件计算 hash 时没有计算图片资源的文件名中的 hash,导致更新图片后,图片 hash 改变,但是 css 文件 hash 并没有更新

static静态资源名称中带多个点时无法被引用

static的资源名字中带多个点的不能被引用到,改成下划线就行了,比如:<%= getJS('zepto.detect.js', 'gb') %> 没有引进来,当把文件名以及static-conf.js中的配置名字都改成下划线形式 zepto_detect.js 就正常了

自动生成雪碧图css的功能

处理icons时,一般都是切图、写sass,遇到icon(最近的一个项目130个icon)比较多的情况下比较花时间去写这部分sass,不知道雅典娜能不能提供自动合并_icons.scss的功能,通过@import引入自动合并好的样式文件。比如:images/icons/aaa.png,images/icons/bbb.png,images/icons/bbb_disabled.png,自动监控文件增删,自动合并为_icons.scss :

$icons: sprite-map("icons/*.png", $spacing:10px); 
.aaa { 
    display: inline-block; 
    @include s2b($icons, "aaa"); 
} 
.bbb { 
    display: inline-block; 
    @include s2b($icons, "bbb"); 
    &_disabled { 
        @include s2b($icons, "bbb_disabled"); 
    } 
}

这样就省略了“手写雪碧图css”的步骤。
这些icon的css不包含其他属性,如果需要其他属性还要在另外的css文件里写。
当然这些sass是用compass的sprite-map,用“__sprite”也是可以的

athena 会考虑添加 webp 格式转换功能吗?

最近使用 athena 的 合并雪碧图功能,突然爱上了这个功能。在想,athena 如果可以把 webp 转换的功能也加上去就好了。可以使用 ?__webp 的参数功能来实现。

例如:

img{background-image: url(1.png?__webp);}

雅典娜帮我自动把 1.png 转化成 1.webp,然后再把上面的代码转生成:

img{background-image: url(1.png);}
.webp img{background-image: url(1.webp);}

这样子我可以结合 js 做 webp 支持判断,如果支持在 html 的 root 节点上添加一个 webp的类名。

添加组件继承功能

添加的自定义组件可以继承已有组件,并进行自定义,或者在组件中添加钩子,可以自定义组件部分内容

关于资源定位 __uri 的疑问

https://github.com/o2team/athena#资源定位

这里提到了使用 __uri 可以自动化将资源引用链接替换成配置好的目标地址。我的理解是引用 __uri(1.jpg) 后,athena 会自动帮我把引用的hash化后的资源 1_xxxxxxxx.jpg。然而,我的实际操作结果是,__uri后的图片是 1.jpg,也就是 __uri 没起到作用?

------我是在js中使用 __uri()。html的<%= __uri() %> 还未尚试

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.