forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage_json_release_filter.jq
More file actions
32 lines (26 loc) · 1.25 KB
/
package_json_release_filter.jq
File metadata and controls
32 lines (26 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Copyright Google Inc. All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.io/license
#
# This filter combines a subproject package.json with the root package.json
# and performs substitutions to prepare it for release. It should be called
# with the --slurp argument and be passed the root pacakge.json followed by
# the subproject package.json.
#
# See jq docs for filter syntax: https://stedolan.github.io/jq/manual/.
.[0] as $root
| .[1] as $proj
# Get the fields from root package.json that should override the project
# package.json, i.e., every field except the following
| ($root
| del(.bin, .description, .dependencies, .name, .main, .peerDependencies, .optionalDependencies, .typings, .version, .private, .workspaces, .resolutions, .scripts, .["ng-update"])
) as $root_overrides
# Use the project package.json as a base and override other fields from root
| $proj + $root_overrides
# Combine keywords from both
| .keywords = ($root.keywords + $proj.keywords | unique)
# Remove devDependencies
| del(.devDependencies)
# Add engines; versions substituted via pkg_npm
+ {"engines": {"node": "0.0.0-ENGINES-NODE", "npm": "0.0.0-ENGINES-NPM", "yarn": "0.0.0-ENGINES-YARN"}}