-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add required config for greenkeeper integration
- Loading branch information
1 parent
181e1f1
commit 05323e3
Showing
3 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env node | ||
// Copyright IBM Corp. 2018. All Rights Reserved. | ||
// Node module: loopback-next | ||
// This file is licensed under the MIT License. | ||
// License text available at https://opensource.org/licenses/MIT | ||
|
||
/** | ||
* This is an internal script to update `greenkeeper.json` with lerna packages. | ||
*/ | ||
'use strict'; | ||
|
||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
const Project = require('@lerna/project'); | ||
|
||
async function updateGreenKeeperJson() { | ||
const project = new Project(process.cwd()); | ||
const packages = await project.getPackages(); | ||
const rootPath = project.rootPath; | ||
const packageJsonPaths = packages.map(p => | ||
path.relative(rootPath, p.manifestLocation), | ||
); | ||
const greenKeeperJson = { | ||
groups: { | ||
default: { | ||
packages: ['package.json'], | ||
}, | ||
}, | ||
}; | ||
|
||
for (const p of packageJsonPaths) { | ||
greenKeeperJson.groups.default.packages.push(p); | ||
} | ||
|
||
if (process.argv[2] === '-f') { | ||
const greenKeeperJsonFile = path.join(rootPath, 'greenkeeper.json'); | ||
writeJsonFile(greenKeeperJsonFile, greenKeeperJson); | ||
} else { | ||
console.log(JSON.stringify(greenKeeperJson, null, 2)); | ||
} | ||
} | ||
|
||
if (require.main === module) updateGreenKeeperJson(); | ||
|
||
function writeJsonFile(filePath, data) { | ||
fs.writeFileSync(filePath, JSON.stringify(data, null, 2) + '\n', 'utf-8'); | ||
console.log('%s has been updated.', filePath); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"groups": { | ||
"default": { | ||
"packages": [ | ||
"package.json", | ||
"benchmark/package.json", | ||
"docs/package.json", | ||
"examples/hello-world/package.json", | ||
"examples/log-extension/package.json", | ||
"examples/rpc-server/package.json", | ||
"examples/soap-calculator/package.json", | ||
"examples/todo-list/package.json", | ||
"examples/todo/package.json", | ||
"packages/authentication/package.json", | ||
"packages/boot/package.json", | ||
"packages/build/package.json", | ||
"packages/cli/package.json", | ||
"packages/context/package.json", | ||
"packages/core/package.json", | ||
"packages/http-caching-proxy/package.json", | ||
"packages/http-server/package.json", | ||
"packages/metadata/package.json", | ||
"packages/openapi-spec-builder/package.json", | ||
"packages/openapi-v3-types/package.json", | ||
"packages/openapi-v3/package.json", | ||
"packages/repository-json-schema/package.json", | ||
"packages/repository/package.json", | ||
"packages/rest-explorer/package.json", | ||
"packages/rest/package.json", | ||
"packages/service-proxy/package.json", | ||
"packages/testlab/package.json", | ||
"packages/tslint-config/package.json", | ||
"sandbox/example/package.json" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters