Merge branch master into feature/jvilimek/score-card-plugin-integration

Signed-off-by: Jan Vilimek <jvilimek@users.noreply.github.com>
This commit is contained in:
Jan Vilimek
2022-09-29 18:30:28 +02:00
472 changed files with 11634 additions and 5050 deletions
+11
View File
@@ -1,5 +1,16 @@
# @backstage/app-defaults
## 1.0.7-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.11.2-next.0
- @backstage/core-app-api@1.1.1-next.0
- @backstage/core-plugin-api@1.0.7-next.0
- @backstage/theme@0.2.16
- @backstage/plugin-permission-react@0.4.6-next.0
## 1.0.6
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/app-defaults",
"description": "Provides the default wiring of a Backstage App",
"version": "1.0.6",
"version": "1.0.7-next.0",
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
+62
View File
@@ -1,5 +1,67 @@
# example-app
## 0.2.76-next.0
### Patch Changes
- Updated dependencies
- @backstage/plugin-org@0.5.10-next.0
- @backstage/catalog-model@1.1.2-next.0
- @backstage/core-components@0.11.2-next.0
- @backstage/cli@0.20.0-next.0
- @backstage/plugin-kubernetes@0.7.3-next.0
- @backstage/plugin-scaffolder@1.7.0-next.0
- @backstage/plugin-api-docs@0.8.10-next.0
- @backstage/plugin-user-settings@0.5.0-next.0
- @backstage/plugin-cost-insights@0.11.32-next.0
- @backstage/plugin-airbrake@0.3.10-next.0
- @backstage/plugin-azure-devops@0.2.1-next.0
- @backstage/plugin-badges@0.2.34-next.0
- @backstage/plugin-catalog-graph@0.2.22-next.0
- @backstage/plugin-catalog-import@0.8.13-next.0
- @backstage/plugin-catalog-react@1.1.5-next.0
- @backstage/plugin-circleci@0.3.10-next.0
- @backstage/plugin-cloudbuild@0.3.10-next.0
- @backstage/plugin-code-coverage@0.2.3-next.0
- @backstage/plugin-dynatrace@0.2.1-next.0
- @backstage/plugin-explore@0.3.41-next.0
- @backstage/plugin-github-actions@0.5.10-next.0
- @backstage/plugin-gocd@0.1.16-next.0
- @backstage/plugin-home@0.4.26-next.0
- @backstage/plugin-jenkins@0.7.9-next.0
- @backstage/plugin-kafka@0.3.10-next.0
- @backstage/plugin-lighthouse@0.3.10-next.0
- @backstage/plugin-newrelic-dashboard@0.2.3-next.0
- @backstage/plugin-pagerduty@0.5.3-next.0
- @backstage/plugin-playlist@0.1.1-next.0
- @backstage/plugin-rollbar@0.4.10-next.0
- @backstage/plugin-search@1.0.3-next.0
- @backstage/plugin-sentry@0.4.3-next.0
- @backstage/plugin-tech-insights@0.3.1-next.0
- @backstage/plugin-techdocs@1.3.3-next.0
- @backstage/plugin-techdocs-react@1.0.5-next.0
- @backstage/plugin-todo@0.2.12-next.0
- @backstage/app-defaults@1.0.7-next.0
- @backstage/integration-react@1.1.5-next.0
- @backstage/plugin-apache-airflow@0.2.3-next.0
- @backstage/plugin-gcalendar@0.3.6-next.0
- @backstage/plugin-gcp-projects@0.3.29-next.0
- @backstage/plugin-graphiql@0.2.42-next.0
- @backstage/plugin-newrelic@0.3.28-next.0
- @backstage/plugin-search-react@1.1.1-next.0
- @backstage/plugin-shortcuts@0.3.2-next.0
- @backstage/plugin-stack-overflow@0.1.6-next.0
- @backstage/plugin-tech-radar@0.5.17-next.0
- @backstage/plugin-techdocs-module-addons-contrib@1.0.5-next.0
- @backstage/config@1.0.3-next.0
- @backstage/core-app-api@1.1.1-next.0
- @backstage/core-plugin-api@1.0.7-next.0
- @backstage/theme@0.2.16
- @backstage/plugin-catalog-common@1.0.7-next.0
- @backstage/plugin-permission-react@0.4.6-next.0
- @backstage/plugin-search-common@1.0.2-next.0
- @internal/plugin-catalog-customized@0.0.3-next.0
## 0.2.75
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "example-app",
"version": "0.2.75",
"version": "0.2.76-next.0",
"private": true,
"backstage": {
"role": "frontend"
+1
View File
@@ -137,6 +137,7 @@ const app = createApp({
});
bind(scaffolderPlugin.externalRoutes, {
registerComponent: catalogImportPlugin.routes.importPage,
viewTechDoc: techdocsPlugin.routes.docRoot,
});
bind(orgPlugin.externalRoutes, {
catalogIndex: catalogPlugin.routes.catalogIndex,
+13
View File
@@ -1,5 +1,18 @@
# @backstage/backend-app-api
## 0.2.2-next.0
### Patch Changes
- 0027a749cd: Added possibility to configure index plugin of the HTTP router service.
- 45857bffae: Properly export `rootLoggerFactory`.
- Updated dependencies
- @backstage/backend-plugin-api@0.1.3-next.0
- @backstage/backend-common@0.15.2-next.0
- @backstage/backend-tasks@0.3.6-next.0
- @backstage/plugin-permission-node@0.6.6-next.0
- @backstage/errors@1.1.2-next.0
## 0.2.1
### Patch Changes
+9 -1
View File
@@ -58,9 +58,14 @@ export const discoveryFactory: (
// @public (undocumented)
export const httpRouterFactory: (
options?: undefined,
options?: HttpRouterFactoryOptions | undefined,
) => ServiceFactory<HttpRouterService>;
// @public (undocumented)
export type HttpRouterFactoryOptions = {
indexPlugin?: string;
};
// @public (undocumented)
export const loggerFactory: (options?: undefined) => ServiceFactory<Logger>;
@@ -69,6 +74,9 @@ export const permissionsFactory: (
options?: undefined,
) => ServiceFactory<PermissionAuthorizer | PermissionEvaluator>;
// @public (undocumented)
export const rootLoggerFactory: (options?: undefined) => ServiceFactory<Logger>;
// @public (undocumented)
export const schedulerFactory: (
options?: undefined,
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-app-api",
"description": "Core API used by Backstage backend apps",
"version": "0.2.1",
"version": "0.2.2-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"publishConfig": {
@@ -24,6 +24,16 @@ import Router from 'express-promise-router';
import { Handler } from 'express';
import { createServiceBuilder } from '@backstage/backend-common';
/**
* @public
*/
export type HttpRouterFactoryOptions = {
/**
* The plugin ID used for the index route. Defaults to 'app'
*/
indexPlugin?: string;
};
/** @public */
export const httpRouterFactory = createServiceFactory({
service: httpRouterServiceRef,
@@ -31,21 +41,28 @@ export const httpRouterFactory = createServiceFactory({
config: configServiceRef,
plugin: pluginMetadataServiceRef,
},
async factory({ config }) {
async factory({ config }, options?: HttpRouterFactoryOptions) {
const defaultPluginId = options?.indexPlugin ?? 'app';
const apiRouter = Router();
const rootRouter = Router();
const service = createServiceBuilder(module)
.loadConfig(config)
.addRouter('/api', apiRouter)
.addRouter('', rootRouter);
await service.start();
return async ({ plugin }) => {
const pluginId = plugin.getId();
const path = pluginId ? `/api/${pluginId}` : '';
return {
use(handler: Handler) {
rootRouter.use(path, handler);
if (pluginId === defaultPluginId) {
rootRouter.use(handler);
} else {
apiRouter.use(`/${pluginId}`, handler);
}
},
};
};
@@ -19,8 +19,10 @@ export { configFactory } from './configService';
export { databaseFactory } from './databaseService';
export { discoveryFactory } from './discoveryService';
export { loggerFactory } from './loggerService';
export { rootLoggerFactory } from './rootLoggerService';
export { permissionsFactory } from './permissionsService';
export { schedulerFactory } from './schedulerService';
export { tokenManagerFactory } from './tokenManagerService';
export { urlReaderFactory } from './urlReaderService';
export { httpRouterFactory } from './httpRouterService';
export type { HttpRouterFactoryOptions } from './httpRouterService';
@@ -39,7 +39,7 @@ class BackstageLogger implements Logger {
}
/** @public */
export const loggerFactory = createServiceFactory({
export const rootLoggerFactory = createServiceFactory({
service: rootLoggerServiceRef,
deps: {},
async factory() {
+12
View File
@@ -1,5 +1,17 @@
# @backstage/backend-common
## 0.15.2-next.0
### Patch Changes
- Updated dependencies
- @backstage/cli-common@0.1.10
- @backstage/config@1.0.3-next.0
- @backstage/config-loader@1.1.5-next.0
- @backstage/errors@1.1.2-next.0
- @backstage/integration@1.3.2-next.0
- @backstage/types@1.0.0
## 0.15.1
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-common",
"description": "Common functionality library for Backstage backends",
"version": "0.15.1",
"version": "0.15.2-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"publishConfig": {
+9
View File
@@ -1,5 +1,14 @@
# @backstage/backend-defaults
## 0.1.2-next.0
### Patch Changes
- 96d288a02d: Added root logger service to the set of default services.
- Updated dependencies
- @backstage/backend-app-api@0.2.2-next.0
- @backstage/backend-plugin-api@0.1.3-next.0
## 0.1.1
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-defaults",
"description": "Backend defaults used by Backstage backend apps",
"version": "0.1.1",
"version": "0.1.2-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"publishConfig": {
@@ -24,6 +24,7 @@ import {
httpRouterFactory,
loggerFactory,
permissionsFactory,
rootLoggerFactory,
schedulerFactory,
tokenManagerFactory,
urlReaderFactory,
@@ -36,6 +37,7 @@ export const defaultServiceFactories = [
databaseFactory,
discoveryFactory,
loggerFactory,
rootLoggerFactory,
permissionsFactory,
schedulerFactory,
tokenManagerFactory,
+10
View File
@@ -1,5 +1,15 @@
# example-backend-next
## 0.0.4-next.0
### Patch Changes
- Updated dependencies
- @backstage/plugin-scaffolder-backend@1.7.0-next.0
- @backstage/backend-defaults@0.1.2-next.0
- @backstage/plugin-catalog-backend@1.4.1-next.0
- @backstage/plugin-app-backend@0.3.37-next.0
## 0.0.3
### Patch Changes
+2 -1
View File
@@ -1,6 +1,6 @@
{
"name": "example-backend-next",
"version": "0.0.3",
"version": "0.0.4-next.0",
"main": "dist/index.cjs.js",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -26,6 +26,7 @@
},
"dependencies": {
"@backstage/backend-defaults": "workspace:^",
"@backstage/plugin-app-backend": "workspace:^",
"@backstage/plugin-catalog-backend": "workspace:^",
"@backstage/plugin-scaffolder-backend": "workspace:^"
},
+2
View File
@@ -17,9 +17,11 @@
import { catalogPlugin } from '@backstage/plugin-catalog-backend';
import { scaffolderCatalogModule } from '@backstage/plugin-scaffolder-backend';
import { createBackend } from '@backstage/backend-defaults';
import { appPlugin } from '@backstage/plugin-app-backend';
const backend = createBackend();
backend.add(catalogPlugin());
backend.add(scaffolderCatalogModule());
backend.add(appPlugin({ appPackageName: 'example-app' }));
backend.start();
+11
View File
@@ -1,5 +1,16 @@
# @backstage/backend-plugin-api
## 0.1.3-next.0
### Patch Changes
- 28377dc89f: Allow interfaces to be used for inferred option types.
- Updated dependencies
- @backstage/backend-common@0.15.2-next.0
- @backstage/backend-tasks@0.3.6-next.0
- @backstage/config@1.0.3-next.0
- @backstage/plugin-permission-common@0.6.5-next.0
## 0.1.2
### Patch Changes
+7 -18
View File
@@ -73,11 +73,7 @@ export const configServiceRef: ServiceRef<Config, 'root'>;
// @public (undocumented)
export function createBackendModule<
TOptions extends
| {
[name: string]: unknown;
}
| undefined = undefined,
TOptions extends object | undefined = undefined,
>(
config: BackendModuleConfig<TOptions>,
): undefined extends TOptions
@@ -86,14 +82,11 @@ export function createBackendModule<
// @public (undocumented)
export function createBackendPlugin<
TOptions extends
| {
[name: string]: unknown;
}
| undefined = undefined,
>(
config: BackendPluginConfig<TOptions>,
): undefined extends TOptions
TOptions extends object | undefined = undefined,
>(config: {
id: string;
register(reg: BackendRegistrationPoints, options: TOptions): void;
}): undefined extends TOptions
? (options?: TOptions) => BackendFeature
: (options: TOptions) => BackendFeature;
@@ -110,11 +103,7 @@ export function createServiceFactory<
TDeps extends {
[name in string]: ServiceRef<unknown>;
},
TOpts extends
| {
[name in string]: unknown;
}
| undefined = undefined,
TOpts extends object | undefined = undefined,
>(config: {
service: ServiceRef<TService, TScope>;
deps: TDeps;
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-plugin-api",
"description": "Core API used by Backstage backend plugins",
"version": "0.1.2",
"version": "0.1.3-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"publishConfig": {
@@ -58,6 +58,8 @@ describe('createServiceFactory', () => {
metaFactory({});
metaFactory({ x: 1 });
// @ts-expect-error
metaFactory({ x: 1, y: 2 });
// @ts-expect-error
metaFactory(null);
metaFactory(undefined);
metaFactory();
@@ -80,10 +82,145 @@ describe('createServiceFactory', () => {
metaFactory({});
metaFactory({ x: 1 });
// @ts-expect-error
metaFactory({ x: 1, y: 2 });
// @ts-expect-error
metaFactory(null);
// @ts-expect-error
metaFactory(undefined);
// @ts-expect-error
metaFactory();
});
it('should create a meta factory with optional options as interface', () => {
interface TestOptions {
x: number;
}
const ref = createServiceRef<string>({ id: 'x' });
const metaFactory = createServiceFactory({
service: ref,
deps: {},
async factory(_deps, _opts?: TestOptions) {
return async () => 'x';
},
});
expect(metaFactory).toEqual(expect.any(Function));
// @ts-expect-error
metaFactory('string');
// @ts-expect-error
metaFactory({});
metaFactory({ x: 1 });
// @ts-expect-error
metaFactory({ x: 1, y: 2 });
// @ts-expect-error
metaFactory(null);
metaFactory(undefined);
metaFactory();
});
it('should create a meta factory with required options as interface', () => {
interface TestOptions {
x: number;
}
const ref = createServiceRef<string>({ id: 'x' });
const metaFactory = createServiceFactory({
service: ref,
deps: {},
async factory(_deps, _opts: TestOptions) {
return async () => 'x';
},
});
expect(metaFactory).toEqual(expect.any(Function));
// @ts-expect-error
metaFactory('string');
// @ts-expect-error
metaFactory({});
metaFactory({ x: 1 });
// @ts-expect-error
metaFactory({ x: 1, y: 2 });
// @ts-expect-error
metaFactory(null);
// @ts-expect-error
metaFactory(undefined);
// @ts-expect-error
metaFactory();
});
it('should only allow objects as options', () => {
const ref = createServiceRef<string>({ id: 'x' });
const metaFactory = createServiceFactory({
service: ref,
deps: {},
// @ts-expect-error
async factory(_deps, _opts: string) {
return async () => 'x';
},
});
expect(metaFactory).toEqual(expect.any(Function));
createServiceFactory({
service: ref,
deps: {},
// @ts-expect-error
async factory(_deps, _opts: number) {
return async () => 'x';
},
});
createServiceFactory({
service: ref,
deps: {},
// @ts-expect-error
async factory(_deps, _opts: symbol) {
return async () => 'x';
},
});
createServiceFactory({
service: ref,
deps: {},
// @ts-expect-error
async factory(_deps, _opts: bigint) {
return async () => 'x';
},
});
createServiceFactory({
service: ref,
deps: {},
// @ts-expect-error
async factory(_deps, _opts: 'string') {
return async () => 'x';
},
});
createServiceFactory({
service: ref,
deps: {},
// @ts-expect-error
async factory(_deps, _opts: Array) {
return async () => 'x';
},
});
createServiceFactory({
service: ref,
deps: {},
// @ts-expect-error
async factory(_deps, _opts: Map) {
return async () => 'x';
},
});
createServiceFactory({
service: ref,
deps: {},
// @ts-expect-error
async factory(_deps, _opts: Set) {
return async () => 'x';
},
});
createServiceFactory({
service: ref,
deps: {},
// @ts-expect-error
async factory(_deps, _opts: null) {
return async () => 'x';
},
});
});
});
@@ -133,7 +133,7 @@ export function createServiceFactory<
TScope extends 'root' | 'plugin',
TImpl extends TService,
TDeps extends { [name in string]: ServiceRef<unknown> },
TOpts extends { [name in string]: unknown } | undefined = undefined,
TOpts extends object | undefined = undefined,
>(config: {
service: ServiceRef<TService, TScope>;
deps: TDeps;
@@ -31,7 +31,7 @@ describe('createExtensionPoint', () => {
});
describe('createBackendPlugin', () => {
it('should create an BackendPlugin', () => {
it('should create a BackendPlugin', () => {
const plugin = createBackendPlugin({
id: 'x',
register(_reg, _options: { a: string }) {},
@@ -68,10 +68,42 @@ describe('createBackendPlugin', () => {
// @ts-expect-error
expect(plugin({})).toBeDefined();
});
it('should create a BackendPlugin with options as interface', () => {
interface TestOptions {
a: string;
}
const plugin = createBackendPlugin({
id: 'x',
register(_reg, _options: TestOptions) {},
});
expect(plugin).toBeDefined();
expect(plugin({ a: 'a' })).toBeDefined();
expect(plugin({ a: 'a' }).id).toBe('x');
// @ts-expect-error
expect(plugin()).toBeDefined();
// @ts-expect-error
expect(plugin({ b: 'b' })).toBeDefined();
});
it('should create plugins with optional options as interface', () => {
interface TestOptions {
a: string;
}
const plugin = createBackendPlugin({
id: 'x',
register(_reg, _options?: TestOptions) {},
});
expect(plugin).toBeDefined();
expect(plugin({ a: 'a' })).toBeDefined();
expect(plugin()).toBeDefined();
// @ts-expect-error
expect(plugin({ b: 'b' })).toBeDefined();
});
});
describe('createBackendModule', () => {
it('should create an BackendModule', () => {
it('should create a BackendModule', () => {
const mod = createBackendModule({
pluginId: 'x',
moduleId: 'y',
@@ -111,4 +143,38 @@ describe('createBackendModule', () => {
// @ts-expect-error
expect(mod({})).toBeDefined();
});
it('should create a BackendModule as interface', () => {
interface TestOptions {
a: string;
}
const mod = createBackendModule({
pluginId: 'x',
moduleId: 'y',
register(_reg, _options: TestOptions) {},
});
expect(mod).toBeDefined();
expect(mod({ a: 'a' })).toBeDefined();
expect(mod({ a: 'a' }).id).toBe('x.y');
// @ts-expect-error
expect(mod()).toBeDefined();
// @ts-expect-error
expect(mod({ b: 'b' })).toBeDefined();
});
it('should create modules with optional options as interface', () => {
interface TestOptions {
a: string;
}
const mod = createBackendModule({
pluginId: 'x',
moduleId: 'y',
register(_reg, _options?: TestOptions) {},
});
expect(mod).toBeDefined();
expect(mod({ a: 'a' })).toBeDefined();
expect(mod()).toBeDefined();
// @ts-expect-error
expect(mod({ b: 'b' })).toBeDefined();
});
});
@@ -44,10 +44,11 @@ export interface BackendPluginConfig<TOptions> {
/** @public */
export function createBackendPlugin<
TOptions extends { [name: string]: unknown } | undefined = undefined,
>(
config: BackendPluginConfig<TOptions>,
): undefined extends TOptions
TOptions extends object | undefined = undefined,
>(config: {
id: string;
register(reg: BackendRegistrationPoints, options: TOptions): void;
}): undefined extends TOptions
? (options?: TOptions) => BackendFeature
: (options: TOptions) => BackendFeature {
return (options?: TOptions) => ({
@@ -70,7 +71,7 @@ export interface BackendModuleConfig<TOptions> {
/** @public */
export function createBackendModule<
TOptions extends { [name: string]: unknown } | undefined = undefined,
TOptions extends object | undefined = undefined,
>(
config: BackendModuleConfig<TOptions>,
): undefined extends TOptions
+10
View File
@@ -1,5 +1,15 @@
# @backstage/backend-tasks
## 0.3.6-next.0
### Patch Changes
- Updated dependencies
- @backstage/backend-common@0.15.2-next.0
- @backstage/config@1.0.3-next.0
- @backstage/errors@1.1.2-next.0
- @backstage/types@1.0.0
## 0.3.5
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-tasks",
"description": "Common distributed task management library for Backstage backends",
"version": "0.3.5",
"version": "0.3.6-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"publishConfig": {
+13
View File
@@ -1,5 +1,18 @@
# @backstage/backend-test-utils
## 0.1.29-next.0
### Patch Changes
- 72549952d1: Fixed handling of root scoped services in `startTestBackend`.
- e91e8e9c55: Increased test database max connection pool size to reduce the risk of resource exhaustion.
- Updated dependencies
- @backstage/backend-app-api@0.2.2-next.0
- @backstage/backend-plugin-api@0.1.3-next.0
- @backstage/cli@0.20.0-next.0
- @backstage/backend-common@0.15.2-next.0
- @backstage/config@1.0.3-next.0
## 0.1.28
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/backend-test-utils",
"description": "Test helpers library for Backstage backends",
"version": "0.1.28",
"version": "0.1.29-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"publishConfig": {
@@ -63,10 +63,18 @@ export async function startTestBackend<
if (Array.isArray(serviceDef)) {
// if type is ExtensionPoint?
// do something differently?
const [ref, impl] = serviceDef;
if (ref.scope === 'plugin') {
return createServiceFactory({
service: ref,
deps: {},
factory: async () => async () => impl,
});
}
return createServiceFactory({
service: serviceDef[0],
service: ref,
deps: {},
factory: async () => async () => serviceDef[1],
factory: async () => impl,
});
}
return serviceDef as ServiceFactory;
+42
View File
@@ -1,5 +1,47 @@
# example-backend
## 0.2.76-next.0
### Patch Changes
- Updated dependencies
- @backstage/catalog-model@1.1.2-next.0
- @backstage/plugin-scaffolder-backend@1.7.0-next.0
- @backstage/plugin-auth-backend@0.17.0-next.0
- @backstage/plugin-catalog-backend@1.4.1-next.0
- @backstage/plugin-jenkins-backend@0.1.27-next.0
- @backstage/plugin-app-backend@0.3.37-next.0
- @backstage/plugin-tech-insights-node@0.3.5-next.0
- example-app@0.2.76-next.0
- @backstage/catalog-client@1.1.1-next.0
- @backstage/plugin-badges-backend@0.1.31-next.0
- @backstage/plugin-code-coverage-backend@0.2.3-next.0
- @backstage/plugin-kafka-backend@0.2.30-next.0
- @backstage/plugin-kubernetes-backend@0.7.3-next.0
- @backstage/plugin-playlist-backend@0.1.1-next.0
- @backstage/plugin-tech-insights-backend@0.5.3-next.0
- @backstage/plugin-techdocs-backend@1.3.1-next.0
- @backstage/plugin-todo-backend@0.1.34-next.0
- @backstage/backend-common@0.15.2-next.0
- @backstage/backend-tasks@0.3.6-next.0
- @backstage/plugin-auth-node@0.2.6-next.0
- @backstage/plugin-permission-node@0.6.6-next.0
- @backstage/plugin-rollbar-backend@0.1.34-next.0
- @backstage/plugin-search-backend-module-pg@0.4.1-next.0
- @backstage/plugin-scaffolder-backend-module-rails@0.4.5-next.0
- @backstage/config@1.0.3-next.0
- @backstage/integration@1.3.2-next.0
- @backstage/plugin-azure-devops-backend@0.3.16-next.0
- @backstage/plugin-graphql-backend@0.1.27-next.0
- @backstage/plugin-permission-backend@0.5.12-next.0
- @backstage/plugin-permission-common@0.6.5-next.0
- @backstage/plugin-proxy-backend@0.2.31-next.0
- @backstage/plugin-search-backend@1.0.3-next.0
- @backstage/plugin-search-backend-module-elasticsearch@1.0.3-next.0
- @backstage/plugin-search-backend-node@1.0.3-next.0
- @backstage/plugin-search-common@1.0.2-next.0
- @backstage/plugin-tech-insights-backend-module-jsonfc@0.1.21-next.0
## 0.2.75
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "example-backend",
"version": "0.2.75",
"version": "0.2.76-next.0",
"main": "dist/index.cjs.js",
"types": "src/index.ts",
"license": "Apache-2.0",
+8
View File
@@ -1,5 +1,13 @@
# @backstage/catalog-client
## 1.1.1-next.0
### Patch Changes
- Updated dependencies
- @backstage/catalog-model@1.1.2-next.0
- @backstage/errors@1.1.2-next.0
## 1.1.0
### Minor Changes
+2 -2
View File
@@ -68,7 +68,7 @@ export interface CatalogApi {
): Promise<void>;
validateEntity(
entity: Entity,
location: string,
locationRef: string,
options?: CatalogRequestOptions,
): Promise<ValidateEntityResponse>;
}
@@ -130,7 +130,7 @@ export class CatalogClient implements CatalogApi {
): Promise<void>;
validateEntity(
entity: Entity,
location: string,
locationRef: string,
options?: CatalogRequestOptions,
): Promise<ValidateEntityResponse>;
}
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/catalog-client",
"description": "An isomorphic client for the catalog backend",
"version": "1.1.0",
"version": "1.1.1-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -322,7 +322,7 @@ describe('CatalogClient', () => {
name: '',
},
},
'http://example.com',
'url:http://example.com',
),
).toMatchObject({
valid: false,
@@ -350,7 +350,7 @@ describe('CatalogClient', () => {
name: 'good',
},
},
'http://example.com',
'url:http://example.com',
),
).toMatchObject({
valid: true,
@@ -373,7 +373,7 @@ describe('CatalogClient', () => {
name: 'good',
},
},
'http://example.com',
'url:http://example.com',
),
).rejects.toThrow(/Request failed with 500 Error/);
});
+2 -2
View File
@@ -359,7 +359,7 @@ export class CatalogClient implements CatalogApi {
*/
async validateEntity(
entity: Entity,
location: string,
locationRef: string,
options?: CatalogRequestOptions,
): Promise<ValidateEntityResponse> {
const response = await this.fetchApi.fetch(
@@ -370,7 +370,7 @@ export class CatalogClient implements CatalogApi {
...(options?.token && { Authorization: `Bearer ${options?.token}` }),
},
method: 'POST',
body: JSON.stringify({ entity, location }),
body: JSON.stringify({ entity, location: locationRef }),
},
);
+2 -2
View File
@@ -405,11 +405,11 @@ export interface CatalogApi {
* Validate entity and its location.
*
* @param entity - Entity to validate
* @param location - URL location of the entity
* @param locationRef - Location ref in format `url:http://example.com/file`
*/
validateEntity(
entity: Entity,
location: string,
locationRef: string,
options?: CatalogRequestOptions,
): Promise<ValidateEntityResponse>;
}
+10
View File
@@ -1,5 +1,15 @@
# @backstage/catalog-model
## 1.1.2-next.0
### Patch Changes
- 6f3b8d0962: Defer `ajv` compilation of schema validators to improve module-import performance
- Updated dependencies
- @backstage/config@1.0.3-next.0
- @backstage/errors@1.1.2-next.0
- @backstage/types@1.0.0
## 1.1.1
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/catalog-model",
"description": "Types and validators that help describe the model of a Backstage Catalog",
"version": "1.1.1",
"version": "1.1.2-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+36
View File
@@ -1,5 +1,41 @@
# @backstage/cli
## 0.20.0-next.0
### Minor Changes
- f368ad7279: **BREAKING**: Bumped `jest`, `jest-runtime`, and `jest-environment-jsdom` to v29. This is up from v27, so check out both the [v28](https://jestjs.io/docs/28.x/upgrading-to-jest28) and [v29](https://jestjs.io/docs/upgrading-to-jest29) (later [here](https://jestjs.io/docs/29.x/upgrading-to-jest29)) migration guides.
Particular changes that where encountered in the main Backstage repo are:
- The updated snapshot format.
- `jest.useFakeTimers('legacy')` is now `jest.useFakeTimers({ legacyFakeTimers: true })`.
- Error objects collected by `withLogCollector` from `@backstage/test-utils` are now objects with a `detail` property rather than a string.
### Patch Changes
- 3e309107ca: Updated fallback versions of dependencies in all templates.
- 292a088807: Added a new `repo test` command.
- ba63cae41c: Updated lockfile parsing to have better support for Yarn 3.
- 2dddb32fea: Switched the Jest transform for YAML files to use a custom one available at `@backstage/cli/config/jestYamlTransform.js`.
- a541a3a78a: Switch to upfront resolution of `swc-loader` in Webpack config.
- cfb3598410: Removed `tsx` and `jsx` as supported extensions in backend packages. For most
repos, this will not have any effect. But if you inadvertently had added some
`tsx`/`jsx` files to your backend package, you may now start to see `code: 'MODULE_NOT_FOUND'` errors when launching the backend locally. The reason for
this is that the offending files get ignored during transpilation. Hence, the
importing file can no longer find anything to import.
The fix is to rename any `.tsx` files in your backend packages to `.ts` instead,
or `.jsx` to `.js`.
- Updated dependencies
- @backstage/cli-common@0.1.10
- @backstage/config@1.0.3-next.0
- @backstage/config-loader@1.1.5-next.0
- @backstage/errors@1.1.2-next.0
- @backstage/release-manifests@0.0.6
- @backstage/types@1.0.0
## 0.19.0
### Minor Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/cli",
"description": "CLI for developing Backstage plugins and apps",
"version": "0.19.0",
"version": "0.20.0-next.0",
"publishConfig": {
"access": "public"
},
+3 -3
View File
@@ -55,7 +55,7 @@ export const transforms = (options: TransformOptions): Transforms => {
exclude: /node_modules/,
use: [
{
loader: 'swc-loader',
loader: require.resolve('swc-loader'),
options: {
jsc: {
target: 'es2019',
@@ -81,7 +81,7 @@ export const transforms = (options: TransformOptions): Transforms => {
exclude: /node_modules/,
use: [
{
loader: 'swc-loader',
loader: require.resolve('swc-loader'),
options: {
jsc: {
target: 'es2019',
@@ -112,7 +112,7 @@ export const transforms = (options: TransformOptions): Transforms => {
test: [/\.icon\.svg$/],
use: [
{
loader: 'swc-loader',
loader: require.resolve('swc-loader'),
options: {
jsc: {
target: 'es2019',
+7
View File
@@ -1,5 +1,12 @@
# @backstage/codemods
## 0.1.40-next.0
### Patch Changes
- Updated dependencies
- @backstage/cli-common@0.1.10
## 0.1.39
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/codemods",
"description": "A collection of codemods for Backstage projects",
"version": "0.1.39",
"version": "0.1.40-next.0",
"publishConfig": {
"access": "public",
"main": "dist/index.cjs.js"
+10
View File
@@ -1,5 +1,15 @@
# @backstage/config-loader
## 1.1.5-next.0
### Patch Changes
- Updated dependencies
- @backstage/cli-common@0.1.10
- @backstage/config@1.0.3-next.0
- @backstage/errors@1.1.2-next.0
- @backstage/types@1.0.0
## 1.1.4
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/config-loader",
"description": "Config loading functionality used by Backstage backend, and CLI",
"version": "1.1.4",
"version": "1.1.5-next.0",
"publishConfig": {
"access": "public",
"main": "dist/index.cjs.js",
+7
View File
@@ -1,5 +1,12 @@
# @backstage/config
## 1.0.3-next.0
### Patch Changes
- Updated dependencies
- @backstage/types@1.0.0
## 1.0.2
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/config",
"description": "Config API used by Backstage core, backend, and CLI",
"version": "1.0.2",
"version": "1.0.3-next.0",
"publishConfig": {
"access": "public",
"main": "dist/index.cjs.js",
+10
View File
@@ -1,5 +1,15 @@
# @backstage/core-app-api
## 1.1.1-next.0
### Patch Changes
- Updated dependencies
- @backstage/config@1.0.3-next.0
- @backstage/core-plugin-api@1.0.7-next.0
- @backstage/types@1.0.0
- @backstage/version-bridge@1.0.1
## 1.1.0
### Minor Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/core-app-api",
"description": "Core app API used by Backstage apps",
"version": "1.1.0",
"version": "1.1.1-next.0",
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
+12
View File
@@ -1,5 +1,17 @@
# @backstage/core-components
## 0.11.2-next.0
### Patch Changes
- 882101cd9b: Deep-import LightAsync component to improve module-import speed
- Updated dependencies
- @backstage/config@1.0.3-next.0
- @backstage/core-plugin-api@1.0.7-next.0
- @backstage/errors@1.1.2-next.0
- @backstage/theme@0.2.16
- @backstage/version-bridge@1.0.1
## 0.11.1
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/core-components",
"description": "Core components used by Backstage plugins and apps",
"version": "0.11.1",
"version": "0.11.2-next.0",
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
@@ -18,7 +18,8 @@ import React from 'react';
import { useTheme } from '@material-ui/core/styles';
import { BackstageTheme } from '@backstage/theme';
import { CopyTextButton } from '../CopyTextButton';
import { LightAsync } from 'react-syntax-highlighter';
import type {} from 'react-syntax-highlighter';
import { default as LightAsync } from 'react-syntax-highlighter/dist/esm/light-async';
import dark from 'react-syntax-highlighter/dist/esm/styles/hljs/dark';
import docco from 'react-syntax-highlighter/dist/esm/styles/hljs/docco';
+9
View File
@@ -1,5 +1,14 @@
# @backstage/core-plugin-api
## 1.0.7-next.0
### Patch Changes
- Updated dependencies
- @backstage/config@1.0.3-next.0
- @backstage/types@1.0.0
- @backstage/version-bridge@1.0.1
## 1.0.6
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/core-plugin-api",
"description": "Core API used by Backstage plugins",
"version": "1.0.6",
"version": "1.0.7-next.0",
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
+29
View File
@@ -1,5 +1,34 @@
# @backstage/create-app
## 0.4.32-next.0
### Patch Changes
- 58c2264325: Newly created Backstage repositories now use the stable version 6 of
`react-router`, just like the main repo does. Please let us know if you find any
issues with this.
Migrating to the stable version of `react-router` is optional for the time
being. But if you want to do the same for your existing repository, please
follow [this
guide](https://backstage.io/docs/tutorials/react-router-stable-migration).
- e05e0f021b: Update versions of packages used in the create-app template, to match those in the main repo
- 52f25858a8: Added `*.session.sql` Visual Studio Code database functionality files to `.gitignore` in the default template. This is optional but potentially helpful if your developers use Visual Studio Code; you can add a line with that exact value to your own root `.gitignore` if you want the same.
- 6d00e80146: Updated the root `test` scripts to use `backstage-cli repo test`.
To apply this change to an existing app, make the following change to the root `package.json`:
```diff
- "test": "backstage-cli test",
- "test:all": "lerna run test -- --coverage",
+ "test": "backstage-cli repo test",
+ "test:all": "backstage-cli repo test --coverage",
```
- Updated dependencies
- @backstage/cli-common@0.1.10
## 0.4.31
### Patch Changes
+3 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/create-app",
"description": "A CLI that helps you create your own Backstage app",
"version": "0.4.31",
"version": "0.4.32-next.0",
"publishConfig": {
"access": "public"
},
@@ -34,6 +34,7 @@
"dependencies": {
"@backstage/cli-common": "workspace:^",
"chalk": "^4.0.0",
"command-exists": "^1.2.9",
"commander": "^9.1.0",
"fs-extra": "10.1.0",
"handlebars": "^4.7.3",
@@ -43,6 +44,7 @@
},
"devDependencies": {
"@backstage/cli": "workspace:^",
"@types/command-exists": "^1.2.0",
"@types/fs-extra": "^9.0.1",
"@types/inquirer": "^8.1.3",
"@types/node": "^16.11.26",
+17 -1
View File
@@ -32,6 +32,8 @@ const promptMock = jest.spyOn(inquirer, 'prompt');
const checkPathExistsMock = jest.spyOn(tasks, 'checkPathExistsTask');
const templatingMock = jest.spyOn(tasks, 'templatingTask');
const checkAppExistsMock = jest.spyOn(tasks, 'checkAppExistsTask');
const initGitRepositoryMock = jest.spyOn(tasks, 'initGitRepository');
const readGitConfig = jest.spyOn(tasks, 'readGitConfig');
const createTemporaryAppFolderMock = jest.spyOn(
tasks,
'createTemporaryAppFolderTask',
@@ -47,7 +49,7 @@ describe('command entrypoint', () => {
});
});
afterAll(() => {
afterEach(() => {
mockFs.restore();
});
@@ -56,6 +58,11 @@ describe('command entrypoint', () => {
name: 'MyApp',
dbType: 'PostgreSQL',
});
readGitConfig.mockResolvedValue({
name: 'git-user',
email: 'git-email',
defaultBranch: 'git-default-branch',
});
});
afterEach(() => {
@@ -67,6 +74,7 @@ describe('command entrypoint', () => {
await createApp(cmd);
expect(checkAppExistsMock).toHaveBeenCalled();
expect(createTemporaryAppFolderMock).toHaveBeenCalled();
expect(initGitRepositoryMock).toHaveBeenCalled();
expect(templatingMock).toHaveBeenCalled();
expect(moveAppMock).toHaveBeenCalled();
expect(buildAppMock).toHaveBeenCalled();
@@ -76,6 +84,7 @@ describe('command entrypoint', () => {
const cmd = { path: 'myDirectory' } as unknown as Command;
await createApp(cmd);
expect(checkPathExistsMock).toHaveBeenCalled();
expect(initGitRepositoryMock).toHaveBeenCalled();
expect(templatingMock).toHaveBeenCalled();
expect(buildAppMock).toHaveBeenCalled();
});
@@ -85,4 +94,11 @@ describe('command entrypoint', () => {
await createApp(cmd);
expect(buildAppMock).not.toHaveBeenCalled();
});
it('should not call `initGitRepository` when `gitConfig` is undefined', async () => {
const cmd = {} as unknown as Command;
readGitConfig.mockResolvedValue({});
await createApp(cmd);
expect(initGitRepositoryMock).not.toHaveBeenCalled();
});
});
+19 -2
View File
@@ -28,8 +28,12 @@ import {
createTemporaryAppFolderTask,
moveAppTask,
templatingTask,
initGitRepository,
readGitConfig,
} from './lib/tasks';
const DEFAULT_BRANCH = 'master';
export default async (opts: OptionValues): Promise<void> => {
/* eslint-disable-next-line no-restricted-syntax */
const paths = findPaths(__dirname);
@@ -73,6 +77,8 @@ export default async (opts: OptionValues): Promise<void> => {
Task.log('Creating the app...');
try {
const gitConfig = await readGitConfig();
if (opts.path) {
// Template directly to specified path
@@ -80,7 +86,10 @@ export default async (opts: OptionValues): Promise<void> => {
await checkPathExistsTask(appDir);
Task.section('Preparing files');
await templatingTask(templateDir, opts.path, answers);
await templatingTask(templateDir, opts.path, {
...answers,
defaultBranch: gitConfig?.defaultBranch ?? DEFAULT_BRANCH,
});
} else {
// Template to temporary location, and then move files
@@ -91,12 +100,20 @@ export default async (opts: OptionValues): Promise<void> => {
await createTemporaryAppFolderTask(tempDir);
Task.section('Preparing files');
await templatingTask(templateDir, tempDir, answers);
await templatingTask(templateDir, tempDir, {
...answers,
defaultBranch: gitConfig?.defaultBranch ?? DEFAULT_BRANCH,
});
Task.section('Moving to final location');
await moveAppTask(tempDir, appDir, answers.name);
}
if (gitConfig?.name && gitConfig?.email) {
Task.section('Initializing git repository');
await initGitRepository(appDir);
}
if (!opts.skipInstall) {
Task.section('Building the app');
await buildAppTask(appDir);
+116 -7
View File
@@ -17,7 +17,8 @@
import fs from 'fs-extra';
import mockFs from 'mock-fs';
import child_process from 'child_process';
import path from 'path';
import path, { resolve as resolvePath } from 'path';
import os from 'os';
import {
Task,
buildAppTask,
@@ -26,8 +27,12 @@ import {
createTemporaryAppFolderTask,
moveAppTask,
templatingTask,
initGitRepository,
readGitConfig,
} from './tasks';
const commandExists = jest.fn();
jest.spyOn(Task, 'log').mockReturnValue(undefined);
jest.spyOn(Task, 'error').mockReturnValue(undefined);
jest.spyOn(Task, 'section').mockReturnValue(undefined);
@@ -36,6 +41,12 @@ jest
.mockImplementation((_a, _b, taskFunc) => taskFunc());
jest.mock('child_process');
jest.mock(
'command-exists',
() =>
(...args: any[]) =>
commandExists(...args),
);
// By mocking this the filesystem mocks won't mess with reading all of the package.jsons
jest.mock('./versions', () => ({
@@ -87,6 +98,14 @@ jest.mock('./versions', () => ({
}));
describe('tasks', () => {
const mockExec = child_process.exec as unknown as jest.MockedFunction<
(
command: string,
options: any,
callback: (error: null, stdout: any, stderr: any) => void,
) => void
>;
beforeEach(() => {
mockFs({
'projects/my-module.ts': '',
@@ -100,6 +119,7 @@ describe('tasks', () => {
});
afterEach(() => {
mockExec.mockRestore();
mockFs.restore();
});
@@ -174,12 +194,6 @@ describe('tasks', () => {
describe('buildAppTask', () => {
it('should change to `appDir` and run `yarn install` and `yarn tsc`', async () => {
const mockChdir = jest.spyOn(process, 'chdir');
const mockExec = child_process.exec as unknown as jest.MockedFunction<
(
command: string,
callback: (error: null, stdout: string, stderr: string) => void,
) => void
>;
// requires callback implementation to support `promisify` wrapper
// https://stackoverflow.com/a/60579617/10044859
@@ -273,4 +287,99 @@ describe('tasks', () => {
).toContain('sqlite3"');
});
});
describe('readGitConfig', () => {
const tmpDir = resolvePath(os.tmpdir(), 'git-temp-dir');
it('should return git config if git package is installed and git credentials are set', async () => {
mockExec.mockImplementation((_command, _options, callback) => {
callback(null, { stdout: 'main' }, 'standard error');
});
commandExists.mockResolvedValue(true);
const gitConfig = await readGitConfig();
expect(gitConfig).toBeTruthy();
expect(gitConfig).toEqual({
name: 'main',
email: 'main',
defaultBranch: 'main',
});
expect(mockExec).toHaveBeenCalledWith(
'git config user.name',
{ cwd: tmpDir },
expect.any(Function),
);
expect(mockExec).toHaveBeenCalledWith(
'git config user.email',
{ cwd: tmpDir },
expect.any(Function),
);
expect(mockExec).toHaveBeenCalledWith(
'git init',
{ cwd: tmpDir },
expect.any(Function),
);
expect(mockExec).toHaveBeenCalledWith(
'git commit --allow-empty -m "Initial commit"',
{ cwd: tmpDir },
expect.any(Function),
);
});
it('should return false if git package is not installed', async () => {
commandExists.mockResolvedValue(false);
const gitConfig = await readGitConfig();
expect(gitConfig).toEqual({});
});
it('should return false if git package is installed but git credentials are not set', async () => {
mockExec.mockImplementation((_command, _options, callback) => {
callback(null, { stdout: null }, 'standard error');
});
commandExists.mockResolvedValue(true);
const gitConfig = await readGitConfig();
expect(gitConfig).toEqual({});
expect(mockExec).toHaveBeenCalledWith(
'git config user.name',
{ cwd: tmpDir },
expect.any(Function),
);
expect(mockExec).toHaveBeenCalledWith(
'git config user.email',
{ cwd: tmpDir },
expect.any(Function),
);
});
});
describe('initGitRepository', () => {
it('should initialize a git repository at the given path', async () => {
const destinationDir = 'tmp/mockApp/';
mockExec.mockImplementation((_command, callback) => {
callback(null, { stdout: 'main' }, 'standard error');
});
await initGitRepository(destinationDir);
expect(mockExec).toHaveBeenCalledTimes(2);
expect(mockExec).toHaveBeenNthCalledWith(
1,
'git init',
expect.any(Function),
);
expect(mockExec).toHaveBeenNthCalledWith(
2,
'git commit --allow-empty -m "Initial commit"',
expect.any(Function),
);
});
});
});
+82
View File
@@ -28,10 +28,18 @@ import {
import { exec as execCb } from 'child_process';
import { packageVersions } from './versions';
import { promisify } from 'util';
import commandExists from 'command-exists';
import os from 'os';
const TASK_NAME_MAX_LENGTH = 14;
const exec = promisify(execCb);
export type GitConfig = {
name?: string;
email?: string;
defaultBranch?: string;
};
export class Task {
static log(name: string = '') {
process.stdout.write(`${chalk.green(name)}\n`);
@@ -236,3 +244,77 @@ export async function moveAppTask(
});
});
}
/**
* Read git configs by creating a temp folder and initializing a repo
*
* @throws if `exec` fails
*/
export async function readGitConfig(): Promise<GitConfig> {
const tempDir = resolvePath(os.tmpdir(), 'git-temp-dir');
const runCmd = (cmd: string) =>
exec(cmd, { cwd: tempDir }).catch(error => {
process.stdout.write(error.stderr);
process.stdout.write(error.stdout);
throw new Error(`Could not execute command ${chalk.cyan(cmd)}`);
});
const isGitAvailable = await commandExists('git').catch(() => false);
if (!isGitAvailable) return {};
try {
await fs.mkdir(tempDir);
const [gitUsername, gitEmail] = await Promise.all([
runCmd('git config user.name'),
runCmd('git config user.email'),
]);
const gitCredentials = Boolean(
gitUsername.stdout?.trim() && gitEmail.stdout?.trim(),
);
if (!gitCredentials) return {};
await runCmd('git init');
await runCmd('git commit --allow-empty -m "Initial commit"');
const gitDefaultBranch = await runCmd(
'git branch --format="%(refname:short)"',
);
return {
name: gitUsername.stdout?.trim(),
email: gitEmail.stdout?.trim(),
defaultBranch: gitDefaultBranch.stdout?.trim(),
};
} catch (error) {
throw new Error(`Failed to read git config, ${error}`);
} finally {
await fs.rm(tempDir, { recursive: true });
}
}
/**
* Initializes a git repository in the destination folder
*
* @param dir - source path to initialize git repository in
* @throws if `exec` fails
*/
export async function initGitRepository(dir: string) {
const runCmd = (cmd: string) =>
exec(cmd).catch(error => {
process.stdout.write(error.stderr);
process.stdout.write(error.stdout);
throw new Error(`Could not execute command ${chalk.cyan(cmd)}`);
});
await Task.forItem('init', 'git repository', async () => {
process.chdir(dir);
await runCmd('git init');
await runCmd('git commit --allow-empty -m "Initial commit"');
});
}
@@ -46,3 +46,6 @@ site
# Sensitive credentials
*-credentials.yaml
# vscode database functionality support files
*.session.sql
@@ -16,7 +16,7 @@
"clean": "backstage-cli repo clean",
"test": "backstage-cli repo test",
"test:all": "backstage-cli repo test --coverage",
"lint": "backstage-cli repo lint --since origin/master",
"lint": "backstage-cli repo lint --since origin/{{defaultBranch}}",
"lint:all": "backstage-cli repo lint",
"prettier:check": "prettier --check .",
"create-plugin": "backstage-cli create-plugin --scope internal",
+15
View File
@@ -1,5 +1,20 @@
# @backstage/dev-utils
## 1.0.7-next.0
### Patch Changes
- Updated dependencies
- @backstage/catalog-model@1.1.2-next.0
- @backstage/core-components@0.11.2-next.0
- @backstage/test-utils@1.2.1-next.0
- @backstage/plugin-catalog-react@1.1.5-next.0
- @backstage/app-defaults@1.0.7-next.0
- @backstage/integration-react@1.1.5-next.0
- @backstage/core-app-api@1.1.1-next.0
- @backstage/core-plugin-api@1.0.7-next.0
- @backstage/theme@0.2.16
## 1.0.6
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/dev-utils",
"description": "Utilities for developing Backstage plugins.",
"version": "1.0.6",
"version": "1.0.7-next.0",
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
+7
View File
@@ -1,5 +1,12 @@
# @backstage/errors
## 1.1.2-next.0
### Patch Changes
- Updated dependencies
- @backstage/types@1.0.0
## 1.1.1
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/errors",
"description": "Common utilities for error handling within Backstage",
"version": "1.1.1",
"version": "1.1.2-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+11
View File
@@ -1,5 +1,16 @@
# @backstage/integration-react
## 1.1.5-next.0
### Patch Changes
- Updated dependencies
- @backstage/core-components@0.11.2-next.0
- @backstage/config@1.0.3-next.0
- @backstage/core-plugin-api@1.0.7-next.0
- @backstage/integration@1.3.2-next.0
- @backstage/theme@0.2.16
## 1.1.4
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/integration-react",
"description": "Frontend package for managing integrations towards external systems",
"version": "1.1.4",
"version": "1.1.5-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
+8
View File
@@ -1,5 +1,13 @@
# @backstage/integration
## 1.3.2-next.0
### Patch Changes
- Updated dependencies
- @backstage/config@1.0.3-next.0
- @backstage/errors@1.1.2-next.0
## 1.3.1
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/integration",
"description": "Helpers for managing integrations towards external systems",
"version": "1.3.1",
"version": "1.3.2-next.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -1,5 +1,24 @@
# techdocs-cli-embedded-app
## 0.2.75-next.0
### Patch Changes
- Updated dependencies
- @backstage/catalog-model@1.1.2-next.0
- @backstage/core-components@0.11.2-next.0
- @backstage/cli@0.20.0-next.0
- @backstage/test-utils@1.2.1-next.0
- @backstage/plugin-catalog@1.5.2-next.0
- @backstage/plugin-techdocs@1.3.3-next.0
- @backstage/plugin-techdocs-react@1.0.5-next.0
- @backstage/app-defaults@1.0.7-next.0
- @backstage/integration-react@1.1.5-next.0
- @backstage/config@1.0.3-next.0
- @backstage/core-app-api@1.1.1-next.0
- @backstage/core-plugin-api@1.0.7-next.0
- @backstage/theme@0.2.16
## 0.2.74
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "techdocs-cli-embedded-app",
"version": "0.2.74",
"version": "0.2.75-next.0",
"private": true,
"backstage": {
"role": "frontend"
+21
View File
@@ -1,5 +1,26 @@
# @techdocs/cli
## 1.2.2-next.0
### Patch Changes
- 0b2a30dead: fixing techdocs-cli Docker client creation
Docker client does not need to be created when --no-docker
option is provided.
If you had DOCKER_CERT_PATH environment variable defined
the Docker client was looking for certificates
and breaking techdocs-cli generate command even with --no-docker
option.
- Updated dependencies
- @backstage/catalog-model@1.1.2-next.0
- @backstage/plugin-techdocs-node@1.4.1-next.0
- @backstage/backend-common@0.15.2-next.0
- @backstage/cli-common@0.1.10
- @backstage/config@1.0.3-next.0
## 1.2.1
### Patch Changes
@@ -89,6 +89,23 @@ describe('end-to-end', () => {
expect(proc.exit).toEqual(0);
});
it('can generate with DOCKER_* TLS variables and --no-docker option', async () => {
const env = {
DOCKER_HOST: 'tcp://localhost:2376',
DOCKER_TLS_CERTDIR: '/certs',
DOCKER_TLS_VERIFY: '1',
DOCKER_CERT_PATH: '/certs/client',
...process.env,
};
const proc = await executeCommand(entryPoint, ['generate', '--no-docker'], {
cwd,
timeout,
env,
});
expect(proc.stdout).toContain('Successfully generated docs');
expect(proc.exit).toEqual(0);
});
it('can serve in mkdocs', async () => {
const proc = await executeCommand(
entryPoint,
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@techdocs/cli",
"description": "Utility CLI for managing TechDocs sites in Backstage.",
"version": "1.2.1",
"version": "1.2.2-next.0",
"publishConfig": {
"access": "public"
},
@@ -22,7 +22,10 @@ import {
TechdocsGenerator,
ParsedLocationAnnotation,
} from '@backstage/plugin-techdocs-node';
import { DockerContainerRunner } from '@backstage/backend-common';
import {
ContainerRunner,
DockerContainerRunner,
} from '@backstage/backend-common';
import { ConfigReader } from '@backstage/config';
import {
convertTechDocsRefToLocationAnnotation,
@@ -66,8 +69,12 @@ export default async function generate(opts: OptionValues) {
});
// Docker client (conditionally) used by the generators, based on techdocs.generators config.
const dockerClient = new Docker();
const containerRunner = new DockerContainerRunner({ dockerClient });
let containerRunner: ContainerRunner | undefined;
if (opts.docker) {
const dockerClient = new Docker();
containerRunner = new DockerContainerRunner({ dockerClient });
}
let parsedLocationAnnotation = {} as ParsedLocationAnnotation;
if (opts.techdocsRef) {
+14
View File
@@ -1,5 +1,19 @@
# @backstage/test-utils
## 1.2.1-next.0
### Patch Changes
- e05e0f021b: Align on the version of `@material-ui/icons` used, to `^4.9.1` like other packages in the main repo
- Updated dependencies
- @backstage/config@1.0.3-next.0
- @backstage/core-app-api@1.1.1-next.0
- @backstage/core-plugin-api@1.0.7-next.0
- @backstage/theme@0.2.16
- @backstage/types@1.0.0
- @backstage/plugin-permission-common@0.6.5-next.0
- @backstage/plugin-permission-react@0.4.6-next.0
## 1.2.0
### Minor Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/test-utils",
"description": "Utilities to test Backstage plugins and apps.",
"version": "1.2.0",
"version": "1.2.1-next.0",
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",