FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
angular-google-maps/scripts/create-package-json.js at master · didowscode/angular-google-maps · GitHub
didowscode
/
angular-google-maps
Public
forked from
sebholstein/angular-google-maps
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
angular-google-maps
/
scripts
/
create-package-json.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (29 loc) · 1.16 KB
Breadcrumbs
angular-google-maps
/
scripts
/
create-package-json.js
Copy path
File metadata and controls
38 lines (29 loc) · 1.16 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
38
/**
* Creates a package.json for the release NPM package structure.
*/
const
fs
=
require
(
'fs'
)
;
const
path
=
require
(
'path'
)
;
const
packages
=
require
(
'./packages'
)
;
const
rootPkgJson
=
JSON
.
parse
(
fs
.
readFileSync
(
'./package.json'
,
'utf8'
)
)
;
packages
.
forEach
(
function
(
pkgName
)
{
let
basePkgJson
;
if
(
fs
.
existsSync
(
`./packages/
${
pkgName
}
/package.tpl.json`
)
)
{
basePkgJson
=
JSON
.
parse
(
fs
.
readFileSync
(
`./packages/
${
pkgName
}
/package.tpl.json`
,
'utf8'
)
)
;
}
else
{
basePkgJson
=
JSON
.
parse
(
fs
.
readFileSync
(
'./package.json'
,
'utf8'
)
)
;
}
// define the package name
basePkgJson
.
name
=
`@agm/
${
pkgName
}
`
// update version
basePkgJson
.
version
=
rootPkgJson
.
version
;
// remove scripts
delete
basePkgJson
.
scripts
;
// remove devDependencies (as there are important for the sourcecode only)
delete
basePkgJson
.
devDependencies
;
// remove the private option
delete
basePkgJson
.
private
;
// remove dependencies for safety reasons as we use peerDependencies
basePkgJson
.
dependencies
=
{
}
;
const
filepath
=
path
.
join
(
__dirname
,
`../dist/packages/
${
pkgName
}
/package.json`
)
;
fs
.
writeFileSync
(
filepath
,
JSON
.
stringify
(
basePkgJson
,
null
,
2
)
,
'utf-8'
)
;
}
)
;
Back
|
FazBrowse Home
|
New Git URL