npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

simple-coder-cli

v0.3.40

Published

tool to generate code and framework

Downloads

115

Readme

环境配置

  1. 安装node,npm版本3以上。
  2. 把npm指向公司地址,命令行 2.1 npm config set registry http://npm.dev.sh.ctripcorp.com:8001/ 2.2这个是组件原始上传npm库 npm config set registry http://registry.npmjs.org/

3.在根目录运行 npm install

项目结构

  • android,ios,web下分别时项目运行在安卓、苹果、网页平台下的配置文件。
  • frontend 目录下是前端业务代码,其中js,reactjs子目录下是分别用js,reactjs实现的代码. 其中js/reactjs 目录下有4个子目录: 1.dev-server 开发测试用 2.release 打包发布用。 3.resources自动生成的前端代码 4.dist 打包后代码位置,在此位置代码可以用dev-server的nodejs服务进行测试展示。 --server目录下为服务端代码(含网站框架)其下有java/nodejs等子目录,分别为各种语言实现的soa 服务器及网站框架。目前仅支持java spring-boot框架。

--modules目录为业务定义位置,内部对各业务实体进行了定义。用simple-coder npm 插件可以根据这里的实体定义,进行自动生成服务器soa接口代码,数据库代码,及前端js代码,reactjs代码。

项目使用:

  • 首先在项目目录处安装npm 插件:npm install (因为reactjs es6 插件有bug,所有工程所需插件都在此处安装) -- 全局安装simple-coder: npm install -g simple-coder-cli

  • 在modules 里定义所需的实体类.

  • 进行代码自动生成: 1.自动生成js代码:simple-coder -g js 2.自动生成reactjs代码simple-coder -g rj 3.自动生成soa 的java代码 simple-coder -g server-java

    本项目本身已根据modules中的缺省几个实体定义,自动生成过一次代码,已有4个模块。

  • 打包测试(以js代码为例): 1.生成前端js代码及对应后端服务器代码 $:simple-coder -g js $:simple-coder -g server-java

    2.进入frontend\js\release\目录 3.打包:gulp 4.进入frontend\js\dev-server\目录 5 运行静态资源服务器 node www.js 6.进入java IDE(例入Eclipse/MyEclipse)打开导入(maven) server\java\simpleserver 项目,然后运行soa服务端代码 7.浏览器中打开 http://localhost:5389/admin/product/ 即可测试。

注:如果测试空白页,或者不熟悉java 的SOA服务器代码,可以在打包时加入参数gulp --host=http://api.zhangyongqiao.com:8080 使用远端公网上的服务器接口进行测试。

项目打包

样例:

FAQ

  • Q:在编译reactjs 项目时,如果编译报错“Module build failed: Error: Couldn't find preset "es2015" relative to directory ” A:这是因为babel所用的,es2015这个组件不能正常编译组件所在项目以外目录的源代码,也就是说源代码必须是node_modules的同级目录,或者当前目录的子目录。解决办法: 在工程根目录下,安装项目所需要的NPM组件。(当然包含es2015).