|
|
|
@@ -14,14 +14,9 @@
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import fs from 'fs-extra';
|
|
|
|
|
import semver from 'semver';
|
|
|
|
|
import { findOwnPaths } from '@backstage/cli-common';
|
|
|
|
|
import { Lockfile } from '@backstage/cli-node';
|
|
|
|
|
|
|
|
|
|
/* eslint-disable-next-line no-restricted-syntax */
|
|
|
|
|
const ownPaths = findOwnPaths(__dirname);
|
|
|
|
|
|
|
|
|
|
/* eslint-disable @backstage/no-relative-monorepo-imports */
|
|
|
|
|
/*
|
|
|
|
|
This is a list of all packages used by the templates. If dependencies are added or removed,
|
|
|
|
@@ -35,28 +30,28 @@ This does not create an actual dependency on these packages and does not bring i
|
|
|
|
|
Rollup will extract the value of the version field in each package at build time without
|
|
|
|
|
leaving any imports in place.
|
|
|
|
|
*/
|
|
|
|
|
import { version as backendPluginApi } from '../../../../packages/backend-plugin-api/package.json';
|
|
|
|
|
import { version as backendTestUtils } from '../../../../packages/backend-test-utils/package.json';
|
|
|
|
|
import { version as catalogClient } from '../../../../packages/catalog-client/package.json';
|
|
|
|
|
import { version as cli } from '../../../../packages/cli/package.json';
|
|
|
|
|
import { version as config } from '../../../../packages/config/package.json';
|
|
|
|
|
import { version as coreAppApi } from '../../../../packages/core-app-api/package.json';
|
|
|
|
|
import { version as coreComponents } from '../../../../packages/core-components/package.json';
|
|
|
|
|
import { version as corePluginApi } from '../../../../packages/core-plugin-api/package.json';
|
|
|
|
|
import { version as devUtils } from '../../../../packages/dev-utils/package.json';
|
|
|
|
|
import { version as errors } from '../../../../packages/errors/package.json';
|
|
|
|
|
import { version as frontendDefaults } from '../../../../packages/frontend-defaults/package.json';
|
|
|
|
|
import { version as frontendPluginApi } from '../../../../packages/frontend-plugin-api/package.json';
|
|
|
|
|
import { version as frontendTestUtils } from '../../../../packages/frontend-test-utils/package.json';
|
|
|
|
|
import { version as testUtils } from '../../../../packages/test-utils/package.json';
|
|
|
|
|
import { version as scaffolderNode } from '../../../../plugins/scaffolder-node/package.json';
|
|
|
|
|
import { version as scaffolderNodeTestUtils } from '../../../../plugins/scaffolder-node-test-utils/package.json';
|
|
|
|
|
import { version as authBackend } from '../../../../plugins/auth-backend/package.json';
|
|
|
|
|
import { version as authBackendModuleGuestProvider } from '../../../../plugins/auth-backend-module-guest-provider/package.json';
|
|
|
|
|
import { version as catalogNode } from '../../../../plugins/catalog-node/package.json';
|
|
|
|
|
import { version as theme } from '../../../../packages/theme/package.json';
|
|
|
|
|
import { version as types } from '../../../../packages/types/package.json';
|
|
|
|
|
import { version as backendDefaults } from '../../../../packages/backend-defaults/package.json';
|
|
|
|
|
import { version as backendPluginApi } from '../../../../../../packages/backend-plugin-api/package.json';
|
|
|
|
|
import { version as backendTestUtils } from '../../../../../../packages/backend-test-utils/package.json';
|
|
|
|
|
import { version as catalogClient } from '../../../../../../packages/catalog-client/package.json';
|
|
|
|
|
import { version as cli } from '../../../../../../packages/cli/package.json';
|
|
|
|
|
import { version as config } from '../../../../../../packages/config/package.json';
|
|
|
|
|
import { version as coreAppApi } from '../../../../../../packages/core-app-api/package.json';
|
|
|
|
|
import { version as coreComponents } from '../../../../../../packages/core-components/package.json';
|
|
|
|
|
import { version as corePluginApi } from '../../../../../../packages/core-plugin-api/package.json';
|
|
|
|
|
import { version as devUtils } from '../../../../../../packages/dev-utils/package.json';
|
|
|
|
|
import { version as errors } from '../../../../../../packages/errors/package.json';
|
|
|
|
|
import { version as frontendDefaults } from '../../../../../../packages/frontend-defaults/package.json';
|
|
|
|
|
import { version as frontendPluginApi } from '../../../../../../packages/frontend-plugin-api/package.json';
|
|
|
|
|
import { version as frontendTestUtils } from '../../../../../../packages/frontend-test-utils/package.json';
|
|
|
|
|
import { version as testUtils } from '../../../../../../packages/test-utils/package.json';
|
|
|
|
|
import { version as scaffolderNode } from '../../../../../../plugins/scaffolder-node/package.json';
|
|
|
|
|
import { version as scaffolderNodeTestUtils } from '../../../../../../plugins/scaffolder-node-test-utils/package.json';
|
|
|
|
|
import { version as authBackend } from '../../../../../../plugins/auth-backend/package.json';
|
|
|
|
|
import { version as authBackendModuleGuestProvider } from '../../../../../../plugins/auth-backend-module-guest-provider/package.json';
|
|
|
|
|
import { version as catalogNode } from '../../../../../../plugins/catalog-node/package.json';
|
|
|
|
|
import { version as theme } from '../../../../../../packages/theme/package.json';
|
|
|
|
|
import { version as types } from '../../../../../../packages/types/package.json';
|
|
|
|
|
import { version as backendDefaults } from '../../../../../../packages/backend-defaults/package.json';
|
|
|
|
|
|
|
|
|
|
export const packageVersions: Record<string, string> = {
|
|
|
|
|
'@backstage/backend-defaults': backendDefaults,
|
|
|
|
@@ -84,14 +79,6 @@ export const packageVersions: Record<string, string> = {
|
|
|
|
|
'@backstage/plugin-catalog-node': catalogNode,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export function findVersion() {
|
|
|
|
|
const pkgContent = fs.readFileSync(ownPaths.resolve('package.json'), 'utf8');
|
|
|
|
|
return JSON.parse(pkgContent).version;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const version = findVersion();
|
|
|
|
|
export const isDev = fs.pathExistsSync(ownPaths.resolve('src'));
|
|
|
|
|
|
|
|
|
|
export function createPackageVersionProvider(
|
|
|
|
|
lockfile?: Lockfile,
|
|
|
|
|
options?: {
|