Code Monkey home page Code Monkey logo

cortex's Introduction

cortex

NPM version Build Status

Cortex is a package manager for the web with a bunch of full-stack frontend solutions to make your websites better, including:

TL;DR

  • Frontend package management with much better version control;
  • Compatible backend solutions for JAVA and node.js (will open to public soon);
  • Development environment for your entire workflow;
  • CI solutions to support multiple testing environment simultaneously;
  • Global registry service;
  • CDN solutions.

With Cortex, we write web modules exactly the same as we do with node.js, with no Module/Wrappings, no AMD, etc.

Cortex is designed and maintained for large websites and collaborative development and is also convenient for small projects.

We have a nice small book on gitbook.io: The Handbook of Cortex

Installation

First, node is required (>= 0.10.0), then run the following command in your command line:

$ npm install -g cortex

Getting Started

Read this Getting-Started Guide to get a general view.

mkdir hello
cd hello
cortex init
cortex build
open index.html # Hello World! Everything you need is commented in the source code!

For more details about cortex, just visit our online gitbook: The Handbook of Cortex.

Over 1 Years in Production

Cortex is not a project only with specifications, and not a project we are just watching.

Over 1 years in production, ALL mobile websites and hybrid applications of dianping.com are using cortex.

Related

License

The MIT license.

Naming

The modular world is much like the nerve system. JavaScript packages interact with others by passing runtime objects as well as neuron cells processes and transmits chemical signals to others.

So, cortex is a neuron manager. That's it.

neuron

cortex's People

Contributors

chinesedfan avatar elrrrrrrr avatar ltebean avatar mangix avatar supersheep avatar villadora avatar ywang1724 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

cortex's Issues

Install Dependencies from NPM Server

本地目录方案

workspace /
    module A/                   
    module B/

~/
    .cortex/
        modules/
            按照模块名与版本,存储 npm 的原始文件

要点

模块的依赖从 npm server 拉取到本地


有任何问题,可以在下面评论

Package Validator

将本地的 Package 与 NPM server 中的稳定包进行比较,若:

Returns

V指定包 ∈ NPM

问题

是否将 cache 做到这里

Cortex global profile

  1. cortex 全局设置
  2. 多账户设置,从而能够支持多个 npm 源,多个不同的 namespace
  3. 迁移所有相关模块

封装内部 npm

封装 npm,供 cortex 来调用

要求和期望

  1. 不会印象到原本的 npm 命令
  2. 封装的方案不会由于并发的原因对其他系统造成影响

npm wrapper server 讨论

为业务提供获取模块信息(版本号,依赖)的API服务。

  1. 获取某个模块的版本列表、最新版本
  2. 获取模块的依赖

2013-05-06 会议纪要

任务分工

详情见各 issue assignee请各位同学认领 task 后预估时间(直接评论)

Sprint 1 时间

预计在本月 23 日之前,包括

  • 开发
  • 部署脚本
  • 测试
  • 文档

大家加油,争取提前搞定~

有关工作方式

see #22

少量项目细节

已在各 issue 中补充

多人结对编程

定为本周 3 下午,详情见 calendar

About Naming!

关于新项目的取名,是否还叫 Cortex ?

只是觉得,这个名字,不太好画 logo = =

Neuro-* 模块迁移认领集中贴

以下模块还无人认领

neuro-json,最简单的一个模块,而且不用写 UT,可以用来熟悉
neuro-class,重要的模块,很多模块会被它 block 住
neuro-dom,比较复杂
neuro-ajax
neuro-jsonp
neuro-ua

其他的模块目前还没有建项目,认领的同学可以自己建项目,然后在下面评论说明

说明

  1. clone 之后,先运行 ctx init 命令
  2. 若项目中还没有模块文件,可能之前还没有从 neuron 项目中拆分出来,老代码见:https://github.com/kaelzhang/neuron/tree/neuron-2.0pre
  3. 目前项目还以 neuro- 命名开头,并且代码中也需要写类似 require('neuro-lang') 的代码。在下一个迭代中,会解决这个问题,ctx 会支持 prefix。

认领方式

  1. 部分同学已经加入到 collaborators 名单中了,也可以 fork,看各位的喜好。
  2. 直接在 master 分支上修改提交,然后向 npm 中提交 0.1.0 版本
  3. 要认领可以直接评论说明

Dependency Installer

安装指定 Package 的依赖

这个模块还需要讨论:

  1. 当依赖的版本比 NPM Server 更高,处理的方式

Grunt Task: Module-Wrapping

对于如下 package.json 的片段

"name": "mypackage",
"version": "0.1.0",
"dependencies": {
    "a": "0.0.1",
    "b": "0.0.2",
    "c": "0.0.3" 
},
"main": "main.js"

若一个文件包含

var a = require("a");

若这个文件为 main.js,则生成如下的 wrapping

define("[email protected]", ["[email protected]", "[email protected]", "[email protected]"], function(require, exports, module){
    // origin code...
});

若这个文件为 abc.js,则生成如下 wrapping

define("[email protected]/abc", ["[email protected]", "[email protected]", "[email protected]"], function(require, exports, module){
    // origin code...
});

stdPath在windows下的错误行为

由于windows下,获取到的home路径为
C:/blahblahblah,不是以/开头的,所以REG_IS_NODE_REQUIRE_PATH匹配不成功,会在前面加上./造成行为错误。
修一个呗。

Issue 及 label 说明

有关项目报告和工作方式

常规 issue

对于需要修改项目代码的 issue,请在提交 comment 中注明

-m 'fixes #<issue-number>'

这样可以将变更集与 issue 关联,有助于更方便的 code review。

建议及 task 补充

有任何建议,或者补充的 Task,任何人都可以提交,并应用对应 Label

调研类 Issue

调研类的 issue,完成后直接将参考资料或结论以评论到加到对应 issue 后面,并 close

提问及讨论

讨论方式不限,最后回答者或者责任人归纳结论后即可 close

讨论下ignore的做法

目前ctx package的时候,若应用了 publish-imitate 这个 filter,会把根目录下的对应文件拷贝到该次打包的目录中。这样,如果该目录中包含了.svn,.git这样的文件也会一并拷过去。

要做 ignore 的话只有在这一步最合适了。我的想法是,在 package.json 里添加一个 ignore 数组,写法同 gitignore,形式就是一个字符串数组。开始的处理方式可以就简单的看文件名或文件夹名是否包含指定字符串,若包含则不拷贝。

另外的,原来拷贝文件夹的方法直接是一句 fsMore.copyDir,是否可以把ignore数组作为数组传过去,然后在那边处理,这个地方Kael过一下。

Cortex watch (multi-watcher)

  • ctx watch command:添加一个项目到 watcher 列表
  • 添加到 watcher 列表的时候,需要执行 ctx validate;并在 package.json 改变时重新验证
  • 添加到 watcher 列表中的项目,当内容改变时,需要执行 ctx build

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.