
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
generator-zl-wiki-init
Advanced tools
Yeoman 帮助我们创建项目,提供更好的工具来使我们的项目更多样化。详细参见: Yeoman
// 全局安装 Yeoman 框架
cnpm install -g yo
cnpm install -g generator-zl-wiki-init
// 创建一个用于开发的目录 zl-wiki-init-test
zl-wiki-init-test > yo zl-wiki-init
zl-wiki-init-test > dir //查看目录
app
|-- index.js 主入口文件
|-- templates 用于构建的模板(目录和文件)
README.md 描述文件
package.json 包描述文件
{
"name": "generator-zl-wiki-init",
"keywords": ["yeoman-generator"],
}
name 名称必须以 generator- 开头 keywords 中必须含有 yeoman-generator 关键词
'use strict';
var path = require('path');
var generators = require('yeoman-generator');
// 定制控制台日志的输入样式,可以非常的个性化
// https://github.com/chalk/chalk
var chalk = require('chalk');
// 生成创建文件夹
// https://github.com/substack/node-mkdirp
var mkdirp = require('mkdirp');
// 使用 generators.Base.extend 扩展
module.exports = generators.Base.extend({
// 构造器
constructor: function() {
generators.Base.apply(this, arguments);
},
// 初始化
initializing: function() {
this.pkg = require('../package.json');
},
// 处理用户输入
prompting: {
},
// 创建目录和文件
writing: {
buildEnv: function() {
// 将 templates 中的内容复制到 当前位置
this.fs.copy(this.templatePath('.'), this.destinationPath('.'));
},
assetsDirs: function() {
// 创建 output 文件夹
// mkdirp.sync('output');
}
},
// 安装默认依赖
install: function() {
}
});
generator-zl-wiki-init> cnpm link
generator-zl-wiki-init-test> yo zl-wiki-init
注意事项:
开发阶段,使用 cnpm link 将模块暴露在全局目录 node_modules 下
只需使用其中的一种即可.
1. npm link
C:\Users\xxx\AppData\Roaming\npm\node_modules\generator-zl-wiki-init -> E:\sync\fis3\generator-zl-wiki-init
2. cnpm link
C:\Program Files\nodejs\node_modules\generator-zl-wiki-init -> E:\sync\fis3\generator-zl-wiki-init
结束后, 使用 npm unlink 或 cnpm unlink 解除
git init
git remote add origin git@git.oschina.net:icode2017/generator-zl-wiki-init.git
因为本地采用了淘宝的 NPM,因此在 npm login 时是登录到 http://registry.npm.taobao.org/
在发布之前,应当将 npm 的 registry 临时改为 http://registry.npmjs.org
npm config set registry http://registry.npmjs.org
npm login
Username: 输入你在npmjs.org上注册的用户名
Password:
Email:(this IS public):
npm publish .
如果没有 npmjs.org 上的用户, 请移步到 http://www.npmjs.org 上注册
FAQs
基于 Yeoman 的 MDwiki 初始化脚手架
The npm package generator-zl-wiki-init receives a total of 0 weekly downloads. As such, generator-zl-wiki-init popularity was classified as not popular.
We found that generator-zl-wiki-init demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.