FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
angular-cli/tools/package_json_release_filter.jq at v21.2.24 · angular/angular-cli · GitHub
angular
angular-cli
Repository navigation
Code
Issues
216
(216)
Pull requests
31
(31)
Actions
Security and quality
6
(6)
Insights
Expand file tree
Breadcrumbs
angular-cli
/
tools
/
package_json_release_filter.jq
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (30 loc) · 1.62 KB
Breadcrumbs
angular-cli
/
tools
/
package_json_release_filter.jq
Copy path
File metadata and controls
37 lines (30 loc) · 1.62 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
33
34
35
36
37
# Copyright Google LLC. 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.dev/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"
],
.pnpm
,
.dependenciesMeta
)
)
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"
}}
# Remove all `workspace:` pnpm prefixes. Afterwards we can conveniently rely on
# substitutions from the stamp values. Note that we are doing it this way because
# substitutions can apply to multiple files, and `workspace:` can't be reliably replaced.
|
walk
(
if
type
==
"string"
and
startswith
(
"workspace:"
)
then
sub
(
"workspace:"
;
""
)
else
.
end
)
Back
|
FazBrowse Home
|
New Git URL