Giter VIP home page Giter VIP logo

alibaba / dawn Goto Github PK

View Code? Open in Web Editor NEW
1.1K 50.0 130.0 17.84 MB

:sunrise: Dawn is a lightweight task management and build tool for front-end and nodejs.

Home Page: https://alibaba.github.io/dawn/

License: MIT License

JavaScript 89.16% HTML 0.05% Shell 0.01% TypeScript 10.70% Less 0.01% SCSS 0.02% Smarty 0.02% CSS 0.03%
build-tool build front-end dawn dawn-cli task pack pipeline middleware construction

dawn's Introduction

Dawn
Dawn

Lightweight task management and build tool.

LICENSE npm version CI npm downloads

npm i @dawnjs/cli -g

README in English

Dawn 取「黎明、破晓」之意,原为「阿里云·业务运营团队」内部的前端构建和工程化工具,现已完全开源。它通过 pipelinemiddleware 将开发过程抽象为相对固定的阶段和有限的操作,简化并统一了开发人员的日常构建与开发相关的工作。

特点

  • 采用中间件技术,封装常用功能,易于扩展,方便重用
  • 支持 pipeline 让多个 task 协同完成构建任务
  • 简单、一致的命令行接口,易于开发人员使用
  • 支持基于「中心服务」管理中间件和工程模板
  • 支持搭建私有中心服务,并统一下发构建规则,易于团队统一管理

安装

$ npm install @dawnjs/cli -g

使用

# 1. 创建 & 初始化
$ dn init -t front

# 2. 开发 & 实时编译
$ dn dev

# 3. 语法检查 & 测试
$ dn test

# 4. 构建 & 打包
$ dn build

示例(.dawn.yml 或 .dawn 目录)

# 启动开发服务
dev:
  - name: '@dawnjs/dn-middleware-webpack'
    env: development
    entry: ./src/*.js
    template: ./assets/*.html
    serverOpts:
      port: 8001

# 直接构建
buid:
  - name: '@dawnjs/dn-middleware-webpack'
    env: production
    entry: ./src/*.js
    template: ./assets/*.html

文档

其它

dawn's People

Contributors

answershuto avatar cnwangjie avatar djknight1 avatar geneking avatar guochen-whu avatar houfeng avatar jeasonstudio avatar kundan28 avatar naifen00 avatar ql434 avatar soulwu avatar ssbabysong avatar xdlrt avatar yq314 avatar zzwzzhao 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

dawn's Issues

为何dn-middleware-webpack中间件配置watch为false时,才去设置env

1. Information

OS & version Node version Dawn version
macOS 10.13.5 v8.11.1 0.12.1

2. Problem

if (!opts.watch) {
    if (opts.env) {
      wpConfig.plugins.push(new webpack.DefinePlugin({
        'process.env': {
          NODE_ENV: JSON.stringify(opts.env)//production
        }
      }));
    }

目前配置env的时候,就不能设置watch为true,开发过程就无法热重载了

3. Recurrence

0.9.2包里面,有过期提示,有计划更新吗

1. Information

OS & version Node version Dawn version
mac 10.13 9.3.0 0.9.2

2. Problem

DeprecationWarning: Calling an asynchronous function without callback is deprecated

3. Recurrence

peerDependencies link [email protected] in /Users/drank/project/dnPro/node_modules/_react-dom@0.14.9@react-dom unmet with /Users/drank/project/dnPro/node_modules/react(15.6.2)
deprecate [email protected] › babel-preset-es2015@^6.24.1 ???? Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
deprecate [email protected][email protected][email protected] › coffee-script@^1.10.0 CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
Recently updated (since 2017-12-22): 3 packages (detail see file /Users/drank/project/dnPro/node_modules/.recently_updates.txt)
Today:
[email protected][email protected][email protected][email protected](3.3.3) (03:38:50)
✔ All packages installed (709 packages installed from npm registry, used 19s, speed 1.11MB/s, json 653(10.39MB), tarball 10.66MB)
[19:09:48] Done
[19:09:51] 开始构建...
[19:09:56] 实时编译: 1514545796770
[19:09:56] Installing 'server' ...
✔ Installed 1 packages
✔ Linked 90 latest versions
✔ Run 0 scripts
Recently updated (since 2017-12-22): 1 packages (detail see file /Users/drank/project/dnPro/node_modules/.recently_updates.txt)
✔ All packages installed (69 packages installed from npm registry, used 3s, speed 427.26kB/s, json 91(1.14MB), tarball 286.09kB)
[19:10:02] Done
[19:10:03] 启动开发服务器...
[19:10:03] The server on "localhost:49762" started
[19:10:03] Installing 'browser-sync' ...
✔ Installed 1 packages
✔ Linked 120 latest versions
✔ Run 1 scripts
Recently updated (since 2017-12-22): 2 packages (detail see file /Users/drank/project/dnPro/node_modules/.recently_updates.txt)
Today:
[email protected][email protected][email protected][email protected] › engine.io-parser@~2.1.0(2.1.2) (06:06:26)
✔ All packages installed (87 packages installed from npm registry, used 24s, speed 299.01kB/s, json 121(1.95MB), tarball 5MB)
[19:10:28] Done
[Browsersync] Access URLs:

      UI: http://localhost:5001

UI External: http://192.168.0.154:5001

[Browsersync] Watching files...
(node:84861) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.

了解一下为什么node版本必须是v7以上

我本地装的node是v6.11.x,即LTS的版本。。

然后要跑这个工具,必须用nvm。。

想了解的是,只是生成模板代码用到了v7,跑代码(即服务启动,打包)不需要v7,还是说都要v7?

lint相关规则实际使用调优建议

  1. 建议把__html加入到@typescript-eslint/naming-convention的例外中
    image

  2. react/prop-types规则建议关闭,目前这条规则无法识别TS中SFC类型定义
    image

如何配置webpack跨域proxy?

1. Information

OS & version Node version Dawn version
your-version your-version your-version

2. Problem

pipe.yml

_20180326144622

wp.conf.js

_20180326150919

提示 “/get” Not Found (404)

3. Recurrence

The steps of problem recurrence

dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用

1. Information

dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用dn 0.15 是不是和0.12 不兼容,我把dn 升级到0.15后,我的项目dn无法使用

OS & version Node version Dawn version
your-version your-version your-version

2. Problem

Describe your problems in as much detail as possible

3. Recurrence

The steps of problem recurrence

能否把cnpm调配成yarn?

我想通过dll把打包共用模块,并且用npm包管理起来相应的版本,这时候cnpm安装的把不知道为什么在dll引入依赖的时候无法找到正确的依赖,但是npm和yarn就不存在这样的问题?

copy中间件的问题

使用copy中间件:

- name: copy
  files:
    ./build/lib/(0).js: ./lib/*.js

结果如下:

copy: D:\tests\three\lib\three.min.js -> D:\tests\three\build\lib\three.js

其中min不见了?

dn init 失败

1. Information

OS & version Node version Dawn version
10.14.6 (18G6020) v12.14.0 1.9.2

2. Problem

image
dn init 失败
不能正常初始化项目

3. Recurrence

npm install -g dawn
dn init
WechatIMG8

wendow报错,能支持window吗?

1. Information

OS & version Node version Dawn version
your-version your-version your-version

2. Problem

image

3. Recurrence

The steps of problem recurrence

init 不成功

看到了 dawn 的介绍,想试用一下,结果没有 init 成功。
image

dawn 版本:0.6.1

我的 node 版本:v8.2.1,npm: 5.3.0

安装失败

if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\...
.\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
gyp: deps\winpty\winpty.gyp not found (cwd: C:\Users\Administrator\AppData\Roaming\npm\node_modules\dawn\node_modules\pty.js) while loading dependencies of binding.gyp while trying to lo
ad binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:336:16)
gyp ERR! stack at emitTwo (events.js:125:13)
gyp ERR! stack at ChildProcess.emit (events.js:213:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Administrator\AppData\Roaming\npm\node_modules\dawn\node_modules\pty.js
gyp ERR! node -v v8.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\dawn\node_modules\pty.js):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: node-gyp rebuild
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

Babel upgrade

1. Information

Dawn version

1.8.5

2. Problem

Babel version is old, how to upgrade it

dn init 不成功

dn init的时候一直再init template中,debug显示如下信息:
{ Error: unexpected end of file
at Gunzip.zlibOnError (zlib.js:152:15)
errno: -5, code: 'Z_BUF_ERROR' }

image

The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (1605870103558)

1. Information

OS & version Node version Dawn version
win10 v14.8.0 1.9.0

2. Problem

when i run dn init, and then it was wrong.

运行dn init,然后就报错了。

3. Recurrence

The steps of problem recurrence

> npm install dawn -g

> mkdir demo-dn

> cd demo-dn

> dn init

[19:01:43] The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. 
Received type number (1605870103558)

dn init error

when i build execute the command dn init , i get the error response as blow :

/usr/local/lib/node_modules/dawn/node_modules/[email protected]@console3/lib/index.js:39
let self = this;
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:413:25)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/usr/local/lib/node_modules/dawn/bin/cli.js:8:17)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)

这个项目特色是什么?

目前有基础架构都很成熟了,但是我从本github中看不出这个项目的特色,或者说优势在哪?

文档里对如何使用自定义middleware的描述不够清楚

问题

Describe your problems in as much detail as possible

我尝试使用在项目里自定义middleware,参考文档如下:

执行 dn run demo,控制台将会执次打印 1 2 3,每个中间件的配置选项有两个「保留的名称」

name: 用于指定中间件 package 名称,可以是完整的名称 dn-middleware-xxx 也可以是省略前缀的 xxx
location: 用于指定中间件入口文件的位置,一般用于本地调试,或内置在模板中不想独立发布的中间件

于是我写出如下配置

demo:
  - location: ./middleware/webpack-ssr

执行后提示报错

[18:43:34] Invalid pipeline config

后来我尝试将location改成name

demo:
  - name: ./middleware/webpack-ssr

随后便可以了

建议

这里的文档描述可以再详细一点,具体讲解下自定义middleware的过程 :)

是不是已经停止维护了?

1. Information

OS & version Node version Dawn version
your-version your-version your-version

2. Problem

Describe your problems in as much detail as possible

3. Recurrence

The steps of problem recurrence

文档的链接挂掉了

1. Information

reademe里面的文档链接异常

2. Problem

文档的链接挂掉了,点击之后404

3. Recurrence

点击readme里面的文档相关链接

dawn怎么不支持模块热更新?

1. Information

OS & version Node version Dawn version
your-version your-version your-version

2. Problem

Describe your problems in as much detail as possible

3. Recurrence

The steps of problem recurrence

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.