Giter VIP home page Giter VIP logo

spm-init's People

Contributors

afc163 avatar lepture avatar popomore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spm-init's Issues

init windows 路径的问题

来自 #5

C:\Users\popomore\tmp>grunt-init C:\Users\popomore\.grunt-init\arale
Running "init:C:\Users\popomore\.grunt-init\arale" (init) task
Loading "C" init template...ERROR

grunt-init 的问题 gruntjs/grunt-init#46,看看能否用其他方式修复

错别字?

$spm init
  Choosing "cmd" as defaute template.

增加模板管理

安装模板

spm-init --install aralejs/template-arale

支持 github

更新模板

spm-init --upgrade arale

如果不是 git 的则忽略

更新索引

spm-init --update

显示可用的模板

spm-init --list

重新审视现有 init 功能

大多数包管理工具的 init 都只有初始化包这一个功能,调用方式如下:

$ npm init
$ git init
$ bower init

而 spm init 的调用方式非常奇怪,需要手动指定一个 theme。

$ spm init arale

目前的 theme 有 aralealicecmdsite、'spmplugin',其中 aralealice 是常用的,其他几乎没人会用到。

早些时候由于这种区别,我从 arale 主题的基础上修改新建了一个 theme 叫 cmd,作为 spm init 的默认主题。也就是说用户可以直接:

$ spm init

就可以初始化一个可以发布到 spmjs.org 的模块(这点很重要!)了。


想了想,认为 spm init 还是应该像其他工具看齐,只保留一个默认模块,不再传递主题,这样比较合适。

梳理了下现有的主题:

  • spmplugin 没什么用,可以删除
  • arale 默认主题的基础,但是这个名称无须保留
  • cmd 之前在 arale 的基础上修改而来,去掉了很多支付宝内部的定制,但是经过前一段 spm-doc 等插件的完善,现在两者基本可以统一了
  • alice 实际上是 arale 的子集,可以合并
  • site 几乎没人用,可以通过改变目录结构,和 arale 进行合并

所以综合上述,可以只保留一个主题作为整个 spmjs.org 生态圈的默认模块模板,用于保存源码、构建、发布、文档部署。仓库可以建立在 spmjs/template 下,在现有的 arale 基础上修改即可。

用户可以直接使用 spm init 来建立所有的模块,并且可以很方便的发布文档到 spmjs.org 。

windows下使用spm init 问题

  1. 默认的模版路径不配置会报异常
    QQ 20130408112047
  2. 添加init配置以后,还是报异常
    [init]
    template = C:\Users\20201122.spm\init
    QQ 20130408112231

用户体验问题

[?] Do you need to make any changes to the above before continuing? (y/N) y

最后一个感觉反人类,直觉认为 y 是不需要修改,完成。而 N 才是需要修改。

另外,其实这个选项没什么必要,因为到这里了已经大部分完成,在这里修改会要全部再来一遍。建议最后一行提示需要修改请编辑 package.json

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.