开源项目中/ dist目录的含义是什么? [英] What is the meaning of the /dist directory in open source projects?

查看:3039
本文介绍了开源项目中/ dist目录的含义是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自从我第一次在许多开源项目中看到一个 dist / 目录时,通常在GitHub上,我一直在想这是什么意思。 (我是外国人,英文不是母语)



dist vendor , lib src ,以及我们经常看到的许多其他文件夹名称,I有时想知道我该如何命名我自己的文件夹。



如果我错了,请纠正我!


  • src:包含*来源**。有时,只有纯粹的源代码,有时是缩小版本,取决于项目。

  • vendor:包含其他依赖项,如其他开源项目。 > lib:很好的问题,它实际上非常接近 vendor ,这取决于项目中我们可以看到一个或另一个或两个...

  • dist:根据我所看到的,它包含生产文件,如果我们要使用,我们应该使用这个文件。



为什么开放源代码很混乱?难道不可能更清楚地做事吗?至少每种语言,因为一些语言使用特定的名称。

解决方案

主要问题的答案...

/ dist :distribution,编译的代码/库。



构建系统和语言的文件夹结构不同。这里有一些标准的约定......




  • src / :sourcefiles编译代码/库。
  • dist / :distribution。 $ b
  • lib / :外部依赖关系(直接包含时)。
  • test / :项目的测试脚本,mock等。
  • vendor / :依赖关系通常通过依赖关系管理。

  • bin / :安装时添加到PATH中的文件。

    档案:


    • README.md :请首先阅读。
    • -permission /rel =noreferrer> rights 。
    • CONTRIBUTING.md 如何协助该项目。



    具体(这些可以永远持续下去):


    • 包。 json :描述库和依赖项(如果是一个JS包)。
    • composer.json :与但是对于通过composer的PHP包。

    • .travis.yml :Travis CI环境的配置文件。


    Since I first saw a dist/ directory in many open source projects, usually on GitHub, I've been wondering what it means. (I'm a foreigner, no native in english)

    With dist, vendor, lib, src, and many other folder names that we see quite often, I sometimes wonder how I should name my own folders.

    Correct me if I'm wrong!

    • src: Contains the *sources**. Sometimes only the pure sources, sometimes with the minified version, depends on the project.
    • vendor: Contains other dependencies, like other open source projects.
    • lib: Good question, it's really close to vendor actually, depending on the project we can see one or another or both...
    • dist: From what I saw, it contains the "production" files, the one we should use if we want to use the library.

    Why is open source so confusing? Isn't it possible to do things more clearly? At least per language because some languages use specific names.

    解决方案

    Answer to main question...

    /dist: "distribution", the compiled code/library.

    Folder structure differs for build systems and language. Here are some standard conventions...

    • src/: "source" files to build and develop the project.
    • dist/: "distribution", the compiled code/library.
    • lib/: external dependencies (when included directly).
    • test/: the project's tests scripts, mocks, etc.
    • vendor/: dependencies are usually put here via dependency management.
    • bin/: files that get added to your PATH when installed.

    Files:

    • README.md: always read this first.
    • LICENSE.md: any rights given to you regarding the project.
    • CONTRIBUTING.md: how to help out with the project.

    Specific (these could go on forever):

    • package.json: describes library and dependencies (if a JS package).
    • composer.json: same as above but for PHP packages via composer.
    • .travis.yml: config file for the Travis CI environment.

    这篇关于开源项目中/ dist目录的含义是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆