backend-common: switch to using get-packages for listing monorepo packages

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-01-07 13:21:04 +01:00
parent e9a5faf1f6
commit 859fc51f55
3 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -36,7 +36,7 @@
"@backstage/integration": "^0.7.0",
"@backstage/types": "^0.1.1",
"@google-cloud/storage": "^5.8.0",
"@lerna/project": "^4.0.0",
"@manypkg/get-packages": "^1.1.3",
"@octokit/rest": "^18.5.3",
"@types/cors": "^2.8.6",
"@types/dockerode": "^3.3.0",
+3 -4
View File
@@ -27,6 +27,7 @@ import {
} from '@backstage/config-loader';
import { AppConfig, Config, ConfigReader } from '@backstage/config';
import { JsonValue } from '@backstage/types';
import { getPackages } from '@manypkg/get-packages';
import { isValidUrl } from './urls';
@@ -194,11 +195,9 @@ export async function loadBackendConfig(options: {
// TODO(hhogg): This is fetching _all_ of the packages of the monorepo
// in order to find the secrets for redactions, however we only care about
// the backend ones, we need to find a way to exclude the frontend packages.
const { Project } = require('@lerna/project');
const project = new Project(paths.targetDir);
const packages = await project.getPackages();
const { packages } = await getPackages(paths.targetDir);
const schema = await loadConfigSchema({
dependencies: packages.map((p: any) => p.name),
dependencies: packages.map(p => p.packageJson.name),
});
const config = new ObservableConfigProxy(options.logger);
+1 -1
View File
@@ -4300,7 +4300,7 @@
npmlog "^4.1.2"
upath "^2.0.1"
"@lerna/project@4.0.0", "@lerna/project@^4.0.0":
"@lerna/project@4.0.0":
version "4.0.0"
resolved "https://registry.npmjs.org/@lerna/project/-/project-4.0.0.tgz#ff84893935833533a74deff30c0e64ddb7f0ba6b"
integrity sha512-o0MlVbDkD5qRPkFKlBZsXZjoNTWPyuL58564nSfZJ6JYNmgAptnWPB2dQlAc7HWRZkmnC2fCkEdoU+jioPavbg==