Giter VIP home page Giter VIP logo

Comments (5)

iamk123 avatar iamk123 commented on June 2, 2024

npm run publish:lib是啥意思呀?请问

from blog.

jiayisheji avatar jiayisheji commented on June 2, 2024

npm run publish:lib是啥意思呀?请问

是 npm scripts,它要做的事情就是:

思考一下我们需要什么哪些操作?
版本日志 根据simple-ui提交记录 生成CHANGELOG.md文件
把dist/simple-ui文件拷贝到simple-ui-builds里面
修改版本号 把package.json里的version+1,这里需要做个配置,不然会一直累加
自动提交本地文件 git add .
自动写提交日志 git commit -m "release: cut the vxx.xx.xx release"
不需要拉代码,没有git pull一说,
自动提交代码并打tag git push --follow-tags origin master
扩展功能:需不需要去通知使用者更新。
这里需要写脚本来支持,我们先放在一边,后面慢慢来说明。

from blog.

iamk123 avatar iamk123 commented on June 2, 2024
  1. 您好,npm run publish:lib这些我都手动操作了,我想问的是simple-ui-builds是要新建一个angular项目吗??如果是的话我将simple-ui打包后,应该拷贝到simple-ui-builds哪个地方呢? 如果只是一个文件夹,我拷贝到该目录push到gitlab后,在别的项目中通过npm git+引入会失败,应该是没有package.json导致的

  2. 我现在的情况是创建了一个名为simple-ui-builds的angular项目,将simple-ui打包后拷贝到该目录的根目录下,然后push到gitlab中,在别的项目中通过npm git+引入进来了,但不知道该如何使用,不知这样是否操作正确

from blog.

jiayisheji avatar jiayisheji commented on June 2, 2024

simple-ui-builds 是一个发布项目,一般对外开发都是发布到npm里面,就没有这个项目,对内如果不想另外搭建私有npm,就需要有个发布项目来存储,我把 simple-ui 编译好了,发布到 simple-ui-builds 项目里,这样就可以公司内部通过 npm git+引入使用了。

  • simple-ui 组件库
  • simple-ui-builds 组件发布库
  • angular-demo 开发库

simple-ui 使用 npm run publish:lib 把打包好的 dist 目录文件拷贝到 simple-ui-builds 里,在 angular-demo 就可以 npm git+ install,这样就和平常使用 npm 包一样了。

给你举几个例子:

angular 官方的表单模块:

我当时也是参考这个命名的。

from blog.

iamk123 avatar iamk123 commented on June 2, 2024

simple-ui-builds 是一个发布项目,一般对外开发都是发布到npm里面,就没有这个项目,对内如果不想另外搭建私有npm,就需要有个发布项目来存储,我把 simple-ui 编译好了,发布到 simple-ui-builds 项目里,这样就可以公司内部通过 npm git+引入使用了。

  • simple-ui 组件库
  • simple-ui-builds 组件发布库
  • angular-demo 开发库

simple-ui 使用 npm run publish:lib 把打包好的 dist 目录文件拷贝到 simple-ui-builds 里,在 angular-demo 就可以 npm git+ install,这样就和平常使用 npm 包一样了。

给你举几个例子:

angular 官方的表单模块:

我当时也是参考这个命名的。

非常感谢,已经通了!

from blog.

Related Issues (20)

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.