debian-mirror-gitlab/doc/development/new_fe_guide/dependencies.md

39 lines
1.3 KiB
Markdown
Raw Normal View History

2021-01-29 00:20:46 +05:30
---
stage: none
group: unassigned
2021-02-22 17:27:13 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2021-01-29 00:20:46 +05:30
---
2018-03-27 19:54:05 +05:30
# Dependencies
2019-12-04 20:38:33 +05:30
## Adding Dependencies
2018-11-08 19:23:39 +05:30
GitLab uses `yarn` to manage dependencies. These dependencies are defined in
two groups within `package.json`, `dependencies` and `devDependencies`. For
our purposes, we consider anything that is required to compile our production
assets a "production" dependency. That is, anything required to run the
`webpack` script with `NODE_ENV=production`. Tools like `eslint`, `karma`, and
various plugins and tools used in development are considered `devDependencies`.
This distinction is used by omnibus to determine which dependencies it requires
when building GitLab.
Exceptions are made for some tools that we require in the
`gitlab:assets:compile` CI job such as `webpack-bundle-analyzer` to analyze our
production assets post-compile.
2019-10-12 21:52:04 +05:30
To add or upgrade a dependency, run:
2020-03-13 15:44:24 +05:30
```shell
2019-10-12 21:52:04 +05:30
yarn add <your dependency here>
```
This may introduce duplicate dependencies. To de-duplicate `yarn.lock`, run:
2020-03-13 15:44:24 +05:30
```shell
2019-10-12 21:52:04 +05:30
node_modules/.bin/yarn-deduplicate --list --strategy fewer yarn.lock && yarn install
```
2018-11-08 19:23:39 +05:30
---
> TODO: Add Dependencies