From 84a8788794d0d9cf223f5e3572e1852297a79807 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 3 Mar 2022 13:20:36 +0100 Subject: [PATCH 1/6] Move packages/techdocs-common -> plugins/techdocs-node Signed-off-by: Eric Peterson --- {packages/techdocs-common => plugins/techdocs-node}/.eslintrc.js | 0 {packages/techdocs-common => plugins/techdocs-node}/CHANGELOG.md | 0 {packages/techdocs-common => plugins/techdocs-node}/README.md | 0 .../techdocs-node}/__mocks__/@azure/identity.ts | 0 .../techdocs-node}/__mocks__/@azure/storage-blob.ts | 0 .../techdocs-node}/__mocks__/@google-cloud/storage.ts | 0 .../techdocs-node}/__mocks__/@trendyol-js/openstack-swift-sdk.ts | 0 .../techdocs-node}/__mocks__/aws-sdk.ts | 0 {packages/techdocs-common => plugins/techdocs-node}/api-report.md | 0 {packages/techdocs-common => plugins/techdocs-node}/package.json | 0 .../techdocs-common => plugins/techdocs-node}/src/helpers.test.ts | 0 .../techdocs-common => plugins/techdocs-node}/src/helpers.ts | 0 {packages/techdocs-common => plugins/techdocs-node}/src/index.ts | 0 .../techdocs-common => plugins/techdocs-node}/src/setupTests.ts | 0 .../techdocs-node}/src/stages/generate/__fixtures__/mkdocs.yml | 0 .../src/stages/generate/__fixtures__/mkdocs_invalid_doc_dir.yml | 0 .../src/stages/generate/__fixtures__/mkdocs_invalid_doc_dir2.yml | 0 .../src/stages/generate/__fixtures__/mkdocs_valid_doc_dir.yml | 0 .../generate/__fixtures__/mkdocs_with_additional_plugins.yml | 0 .../src/stages/generate/__fixtures__/mkdocs_with_comments.yml | 0 .../src/stages/generate/__fixtures__/mkdocs_with_edit_uri.yml | 0 .../src/stages/generate/__fixtures__/mkdocs_with_extensions.yml | 0 .../src/stages/generate/__fixtures__/mkdocs_with_repo_url.yml | 0 .../stages/generate/__fixtures__/mkdocs_with_techdocs_plugin.yml | 0 .../src/stages/generate/__fixtures__/mkdocs_without_plugins.yml | 0 .../techdocs-node}/src/stages/generate/generators.test.ts | 0 .../techdocs-node}/src/stages/generate/generators.ts | 0 .../techdocs-node}/src/stages/generate/helpers.test.ts | 0 .../techdocs-node}/src/stages/generate/helpers.ts | 0 .../techdocs-node}/src/stages/generate/index.ts | 0 .../techdocs-node}/src/stages/generate/mkDocsPatchers.ts | 0 .../techdocs-node}/src/stages/generate/techdocs.test.ts | 0 .../techdocs-node}/src/stages/generate/techdocs.ts | 0 .../techdocs-node}/src/stages/generate/types.ts | 0 .../techdocs-common => plugins/techdocs-node}/src/stages/index.ts | 0 .../techdocs-node}/src/stages/prepare/dir.test.ts | 0 .../techdocs-node}/src/stages/prepare/dir.ts | 0 .../techdocs-node}/src/stages/prepare/index.ts | 0 .../techdocs-node}/src/stages/prepare/preparers.ts | 0 .../techdocs-node}/src/stages/prepare/types.ts | 0 .../techdocs-node}/src/stages/prepare/url.ts | 0 .../techdocs-node}/src/stages/publish/awsS3.test.ts | 0 .../techdocs-node}/src/stages/publish/awsS3.ts | 0 .../techdocs-node}/src/stages/publish/azureBlobStorage.test.ts | 0 .../techdocs-node}/src/stages/publish/azureBlobStorage.ts | 0 .../techdocs-node}/src/stages/publish/googleStorage.test.ts | 0 .../techdocs-node}/src/stages/publish/googleStorage.ts | 0 .../techdocs-node}/src/stages/publish/helpers.test.ts | 0 .../techdocs-node}/src/stages/publish/helpers.ts | 0 .../techdocs-node}/src/stages/publish/index.ts | 0 .../techdocs-node}/src/stages/publish/local.test.ts | 0 .../techdocs-node}/src/stages/publish/local.ts | 0 .../src/stages/publish/migrations/GoogleMigration.ts | 0 .../techdocs-node}/src/stages/publish/migrations/index.ts | 0 .../techdocs-node}/src/stages/publish/openStackSwift.test.ts | 0 .../techdocs-node}/src/stages/publish/openStackSwift.ts | 0 .../techdocs-node}/src/stages/publish/publish.test.ts | 0 .../techdocs-node}/src/stages/publish/publish.ts | 0 .../techdocs-node}/src/stages/publish/types.ts | 0 .../techdocs-node}/src/techdocsTypes.ts | 0 .../techdocs-node}/src/testUtils/StorageFilesMock.ts | 0 .../techdocs-node}/src/testUtils/types.ts | 0 62 files changed, 0 insertions(+), 0 deletions(-) rename {packages/techdocs-common => plugins/techdocs-node}/.eslintrc.js (100%) rename {packages/techdocs-common => plugins/techdocs-node}/CHANGELOG.md (100%) rename {packages/techdocs-common => plugins/techdocs-node}/README.md (100%) rename {packages/techdocs-common => plugins/techdocs-node}/__mocks__/@azure/identity.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/__mocks__/@azure/storage-blob.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/__mocks__/@google-cloud/storage.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/__mocks__/@trendyol-js/openstack-swift-sdk.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/__mocks__/aws-sdk.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/api-report.md (100%) rename {packages/techdocs-common => plugins/techdocs-node}/package.json (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/helpers.test.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/helpers.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/index.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/setupTests.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/__fixtures__/mkdocs.yml (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/__fixtures__/mkdocs_invalid_doc_dir.yml (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/__fixtures__/mkdocs_invalid_doc_dir2.yml (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/__fixtures__/mkdocs_valid_doc_dir.yml (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/__fixtures__/mkdocs_with_additional_plugins.yml (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/__fixtures__/mkdocs_with_comments.yml (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/__fixtures__/mkdocs_with_edit_uri.yml (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/__fixtures__/mkdocs_with_extensions.yml (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/__fixtures__/mkdocs_with_repo_url.yml (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/__fixtures__/mkdocs_with_techdocs_plugin.yml (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/__fixtures__/mkdocs_without_plugins.yml (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/generators.test.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/generators.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/helpers.test.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/helpers.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/index.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/mkDocsPatchers.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/techdocs.test.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/techdocs.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/generate/types.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/index.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/prepare/dir.test.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/prepare/dir.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/prepare/index.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/prepare/preparers.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/prepare/types.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/prepare/url.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/awsS3.test.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/awsS3.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/azureBlobStorage.test.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/azureBlobStorage.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/googleStorage.test.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/googleStorage.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/helpers.test.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/helpers.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/index.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/local.test.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/local.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/migrations/GoogleMigration.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/migrations/index.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/openStackSwift.test.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/openStackSwift.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/publish.test.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/publish.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/stages/publish/types.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/techdocsTypes.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/testUtils/StorageFilesMock.ts (100%) rename {packages/techdocs-common => plugins/techdocs-node}/src/testUtils/types.ts (100%) diff --git a/packages/techdocs-common/.eslintrc.js b/plugins/techdocs-node/.eslintrc.js similarity index 100% rename from packages/techdocs-common/.eslintrc.js rename to plugins/techdocs-node/.eslintrc.js diff --git a/packages/techdocs-common/CHANGELOG.md b/plugins/techdocs-node/CHANGELOG.md similarity index 100% rename from packages/techdocs-common/CHANGELOG.md rename to plugins/techdocs-node/CHANGELOG.md diff --git a/packages/techdocs-common/README.md b/plugins/techdocs-node/README.md similarity index 100% rename from packages/techdocs-common/README.md rename to plugins/techdocs-node/README.md diff --git a/packages/techdocs-common/__mocks__/@azure/identity.ts b/plugins/techdocs-node/__mocks__/@azure/identity.ts similarity index 100% rename from packages/techdocs-common/__mocks__/@azure/identity.ts rename to plugins/techdocs-node/__mocks__/@azure/identity.ts diff --git a/packages/techdocs-common/__mocks__/@azure/storage-blob.ts b/plugins/techdocs-node/__mocks__/@azure/storage-blob.ts similarity index 100% rename from packages/techdocs-common/__mocks__/@azure/storage-blob.ts rename to plugins/techdocs-node/__mocks__/@azure/storage-blob.ts diff --git a/packages/techdocs-common/__mocks__/@google-cloud/storage.ts b/plugins/techdocs-node/__mocks__/@google-cloud/storage.ts similarity index 100% rename from packages/techdocs-common/__mocks__/@google-cloud/storage.ts rename to plugins/techdocs-node/__mocks__/@google-cloud/storage.ts diff --git a/packages/techdocs-common/__mocks__/@trendyol-js/openstack-swift-sdk.ts b/plugins/techdocs-node/__mocks__/@trendyol-js/openstack-swift-sdk.ts similarity index 100% rename from packages/techdocs-common/__mocks__/@trendyol-js/openstack-swift-sdk.ts rename to plugins/techdocs-node/__mocks__/@trendyol-js/openstack-swift-sdk.ts diff --git a/packages/techdocs-common/__mocks__/aws-sdk.ts b/plugins/techdocs-node/__mocks__/aws-sdk.ts similarity index 100% rename from packages/techdocs-common/__mocks__/aws-sdk.ts rename to plugins/techdocs-node/__mocks__/aws-sdk.ts diff --git a/packages/techdocs-common/api-report.md b/plugins/techdocs-node/api-report.md similarity index 100% rename from packages/techdocs-common/api-report.md rename to plugins/techdocs-node/api-report.md diff --git a/packages/techdocs-common/package.json b/plugins/techdocs-node/package.json similarity index 100% rename from packages/techdocs-common/package.json rename to plugins/techdocs-node/package.json diff --git a/packages/techdocs-common/src/helpers.test.ts b/plugins/techdocs-node/src/helpers.test.ts similarity index 100% rename from packages/techdocs-common/src/helpers.test.ts rename to plugins/techdocs-node/src/helpers.test.ts diff --git a/packages/techdocs-common/src/helpers.ts b/plugins/techdocs-node/src/helpers.ts similarity index 100% rename from packages/techdocs-common/src/helpers.ts rename to plugins/techdocs-node/src/helpers.ts diff --git a/packages/techdocs-common/src/index.ts b/plugins/techdocs-node/src/index.ts similarity index 100% rename from packages/techdocs-common/src/index.ts rename to plugins/techdocs-node/src/index.ts diff --git a/packages/techdocs-common/src/setupTests.ts b/plugins/techdocs-node/src/setupTests.ts similarity index 100% rename from packages/techdocs-common/src/setupTests.ts rename to plugins/techdocs-node/src/setupTests.ts diff --git a/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs.yml b/plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs.yml similarity index 100% rename from packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs.yml rename to plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs.yml diff --git a/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_invalid_doc_dir.yml b/plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_invalid_doc_dir.yml similarity index 100% rename from packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_invalid_doc_dir.yml rename to plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_invalid_doc_dir.yml diff --git a/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_invalid_doc_dir2.yml b/plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_invalid_doc_dir2.yml similarity index 100% rename from packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_invalid_doc_dir2.yml rename to plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_invalid_doc_dir2.yml diff --git a/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_valid_doc_dir.yml b/plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_valid_doc_dir.yml similarity index 100% rename from packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_valid_doc_dir.yml rename to plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_valid_doc_dir.yml diff --git a/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_with_additional_plugins.yml b/plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_with_additional_plugins.yml similarity index 100% rename from packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_with_additional_plugins.yml rename to plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_with_additional_plugins.yml diff --git a/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_with_comments.yml b/plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_with_comments.yml similarity index 100% rename from packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_with_comments.yml rename to plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_with_comments.yml diff --git a/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_with_edit_uri.yml b/plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_with_edit_uri.yml similarity index 100% rename from packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_with_edit_uri.yml rename to plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_with_edit_uri.yml diff --git a/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_with_extensions.yml b/plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_with_extensions.yml similarity index 100% rename from packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_with_extensions.yml rename to plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_with_extensions.yml diff --git a/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_with_repo_url.yml b/plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_with_repo_url.yml similarity index 100% rename from packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_with_repo_url.yml rename to plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_with_repo_url.yml diff --git a/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_with_techdocs_plugin.yml b/plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_with_techdocs_plugin.yml similarity index 100% rename from packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_with_techdocs_plugin.yml rename to plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_with_techdocs_plugin.yml diff --git a/packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_without_plugins.yml b/plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_without_plugins.yml similarity index 100% rename from packages/techdocs-common/src/stages/generate/__fixtures__/mkdocs_without_plugins.yml rename to plugins/techdocs-node/src/stages/generate/__fixtures__/mkdocs_without_plugins.yml diff --git a/packages/techdocs-common/src/stages/generate/generators.test.ts b/plugins/techdocs-node/src/stages/generate/generators.test.ts similarity index 100% rename from packages/techdocs-common/src/stages/generate/generators.test.ts rename to plugins/techdocs-node/src/stages/generate/generators.test.ts diff --git a/packages/techdocs-common/src/stages/generate/generators.ts b/plugins/techdocs-node/src/stages/generate/generators.ts similarity index 100% rename from packages/techdocs-common/src/stages/generate/generators.ts rename to plugins/techdocs-node/src/stages/generate/generators.ts diff --git a/packages/techdocs-common/src/stages/generate/helpers.test.ts b/plugins/techdocs-node/src/stages/generate/helpers.test.ts similarity index 100% rename from packages/techdocs-common/src/stages/generate/helpers.test.ts rename to plugins/techdocs-node/src/stages/generate/helpers.test.ts diff --git a/packages/techdocs-common/src/stages/generate/helpers.ts b/plugins/techdocs-node/src/stages/generate/helpers.ts similarity index 100% rename from packages/techdocs-common/src/stages/generate/helpers.ts rename to plugins/techdocs-node/src/stages/generate/helpers.ts diff --git a/packages/techdocs-common/src/stages/generate/index.ts b/plugins/techdocs-node/src/stages/generate/index.ts similarity index 100% rename from packages/techdocs-common/src/stages/generate/index.ts rename to plugins/techdocs-node/src/stages/generate/index.ts diff --git a/packages/techdocs-common/src/stages/generate/mkDocsPatchers.ts b/plugins/techdocs-node/src/stages/generate/mkDocsPatchers.ts similarity index 100% rename from packages/techdocs-common/src/stages/generate/mkDocsPatchers.ts rename to plugins/techdocs-node/src/stages/generate/mkDocsPatchers.ts diff --git a/packages/techdocs-common/src/stages/generate/techdocs.test.ts b/plugins/techdocs-node/src/stages/generate/techdocs.test.ts similarity index 100% rename from packages/techdocs-common/src/stages/generate/techdocs.test.ts rename to plugins/techdocs-node/src/stages/generate/techdocs.test.ts diff --git a/packages/techdocs-common/src/stages/generate/techdocs.ts b/plugins/techdocs-node/src/stages/generate/techdocs.ts similarity index 100% rename from packages/techdocs-common/src/stages/generate/techdocs.ts rename to plugins/techdocs-node/src/stages/generate/techdocs.ts diff --git a/packages/techdocs-common/src/stages/generate/types.ts b/plugins/techdocs-node/src/stages/generate/types.ts similarity index 100% rename from packages/techdocs-common/src/stages/generate/types.ts rename to plugins/techdocs-node/src/stages/generate/types.ts diff --git a/packages/techdocs-common/src/stages/index.ts b/plugins/techdocs-node/src/stages/index.ts similarity index 100% rename from packages/techdocs-common/src/stages/index.ts rename to plugins/techdocs-node/src/stages/index.ts diff --git a/packages/techdocs-common/src/stages/prepare/dir.test.ts b/plugins/techdocs-node/src/stages/prepare/dir.test.ts similarity index 100% rename from packages/techdocs-common/src/stages/prepare/dir.test.ts rename to plugins/techdocs-node/src/stages/prepare/dir.test.ts diff --git a/packages/techdocs-common/src/stages/prepare/dir.ts b/plugins/techdocs-node/src/stages/prepare/dir.ts similarity index 100% rename from packages/techdocs-common/src/stages/prepare/dir.ts rename to plugins/techdocs-node/src/stages/prepare/dir.ts diff --git a/packages/techdocs-common/src/stages/prepare/index.ts b/plugins/techdocs-node/src/stages/prepare/index.ts similarity index 100% rename from packages/techdocs-common/src/stages/prepare/index.ts rename to plugins/techdocs-node/src/stages/prepare/index.ts diff --git a/packages/techdocs-common/src/stages/prepare/preparers.ts b/plugins/techdocs-node/src/stages/prepare/preparers.ts similarity index 100% rename from packages/techdocs-common/src/stages/prepare/preparers.ts rename to plugins/techdocs-node/src/stages/prepare/preparers.ts diff --git a/packages/techdocs-common/src/stages/prepare/types.ts b/plugins/techdocs-node/src/stages/prepare/types.ts similarity index 100% rename from packages/techdocs-common/src/stages/prepare/types.ts rename to plugins/techdocs-node/src/stages/prepare/types.ts diff --git a/packages/techdocs-common/src/stages/prepare/url.ts b/plugins/techdocs-node/src/stages/prepare/url.ts similarity index 100% rename from packages/techdocs-common/src/stages/prepare/url.ts rename to plugins/techdocs-node/src/stages/prepare/url.ts diff --git a/packages/techdocs-common/src/stages/publish/awsS3.test.ts b/plugins/techdocs-node/src/stages/publish/awsS3.test.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/awsS3.test.ts rename to plugins/techdocs-node/src/stages/publish/awsS3.test.ts diff --git a/packages/techdocs-common/src/stages/publish/awsS3.ts b/plugins/techdocs-node/src/stages/publish/awsS3.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/awsS3.ts rename to plugins/techdocs-node/src/stages/publish/awsS3.ts diff --git a/packages/techdocs-common/src/stages/publish/azureBlobStorage.test.ts b/plugins/techdocs-node/src/stages/publish/azureBlobStorage.test.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/azureBlobStorage.test.ts rename to plugins/techdocs-node/src/stages/publish/azureBlobStorage.test.ts diff --git a/packages/techdocs-common/src/stages/publish/azureBlobStorage.ts b/plugins/techdocs-node/src/stages/publish/azureBlobStorage.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/azureBlobStorage.ts rename to plugins/techdocs-node/src/stages/publish/azureBlobStorage.ts diff --git a/packages/techdocs-common/src/stages/publish/googleStorage.test.ts b/plugins/techdocs-node/src/stages/publish/googleStorage.test.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/googleStorage.test.ts rename to plugins/techdocs-node/src/stages/publish/googleStorage.test.ts diff --git a/packages/techdocs-common/src/stages/publish/googleStorage.ts b/plugins/techdocs-node/src/stages/publish/googleStorage.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/googleStorage.ts rename to plugins/techdocs-node/src/stages/publish/googleStorage.ts diff --git a/packages/techdocs-common/src/stages/publish/helpers.test.ts b/plugins/techdocs-node/src/stages/publish/helpers.test.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/helpers.test.ts rename to plugins/techdocs-node/src/stages/publish/helpers.test.ts diff --git a/packages/techdocs-common/src/stages/publish/helpers.ts b/plugins/techdocs-node/src/stages/publish/helpers.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/helpers.ts rename to plugins/techdocs-node/src/stages/publish/helpers.ts diff --git a/packages/techdocs-common/src/stages/publish/index.ts b/plugins/techdocs-node/src/stages/publish/index.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/index.ts rename to plugins/techdocs-node/src/stages/publish/index.ts diff --git a/packages/techdocs-common/src/stages/publish/local.test.ts b/plugins/techdocs-node/src/stages/publish/local.test.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/local.test.ts rename to plugins/techdocs-node/src/stages/publish/local.test.ts diff --git a/packages/techdocs-common/src/stages/publish/local.ts b/plugins/techdocs-node/src/stages/publish/local.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/local.ts rename to plugins/techdocs-node/src/stages/publish/local.ts diff --git a/packages/techdocs-common/src/stages/publish/migrations/GoogleMigration.ts b/plugins/techdocs-node/src/stages/publish/migrations/GoogleMigration.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/migrations/GoogleMigration.ts rename to plugins/techdocs-node/src/stages/publish/migrations/GoogleMigration.ts diff --git a/packages/techdocs-common/src/stages/publish/migrations/index.ts b/plugins/techdocs-node/src/stages/publish/migrations/index.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/migrations/index.ts rename to plugins/techdocs-node/src/stages/publish/migrations/index.ts diff --git a/packages/techdocs-common/src/stages/publish/openStackSwift.test.ts b/plugins/techdocs-node/src/stages/publish/openStackSwift.test.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/openStackSwift.test.ts rename to plugins/techdocs-node/src/stages/publish/openStackSwift.test.ts diff --git a/packages/techdocs-common/src/stages/publish/openStackSwift.ts b/plugins/techdocs-node/src/stages/publish/openStackSwift.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/openStackSwift.ts rename to plugins/techdocs-node/src/stages/publish/openStackSwift.ts diff --git a/packages/techdocs-common/src/stages/publish/publish.test.ts b/plugins/techdocs-node/src/stages/publish/publish.test.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/publish.test.ts rename to plugins/techdocs-node/src/stages/publish/publish.test.ts diff --git a/packages/techdocs-common/src/stages/publish/publish.ts b/plugins/techdocs-node/src/stages/publish/publish.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/publish.ts rename to plugins/techdocs-node/src/stages/publish/publish.ts diff --git a/packages/techdocs-common/src/stages/publish/types.ts b/plugins/techdocs-node/src/stages/publish/types.ts similarity index 100% rename from packages/techdocs-common/src/stages/publish/types.ts rename to plugins/techdocs-node/src/stages/publish/types.ts diff --git a/packages/techdocs-common/src/techdocsTypes.ts b/plugins/techdocs-node/src/techdocsTypes.ts similarity index 100% rename from packages/techdocs-common/src/techdocsTypes.ts rename to plugins/techdocs-node/src/techdocsTypes.ts diff --git a/packages/techdocs-common/src/testUtils/StorageFilesMock.ts b/plugins/techdocs-node/src/testUtils/StorageFilesMock.ts similarity index 100% rename from packages/techdocs-common/src/testUtils/StorageFilesMock.ts rename to plugins/techdocs-node/src/testUtils/StorageFilesMock.ts diff --git a/packages/techdocs-common/src/testUtils/types.ts b/plugins/techdocs-node/src/testUtils/types.ts similarity index 100% rename from packages/techdocs-common/src/testUtils/types.ts rename to plugins/techdocs-node/src/testUtils/types.ts From 91bf1e6c1ac760e7b0fa7da869bbb5d586eb6063 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 3 Mar 2022 13:33:47 +0100 Subject: [PATCH 2/6] Use @backstage/plugin-techdocs-node instead of @backstage/techdocs-common Signed-off-by: Eric Peterson --- .changeset/techdocs-node-one.md | 6 ++++++ .github/CODEOWNERS | 2 +- docs/features/techdocs/cli.md | 2 +- docs/getting-started/project-structure.md | 4 ++-- packages/techdocs-cli/package.json | 2 +- .../techdocs-cli/src/commands/generate/generate.ts | 6 +++--- packages/techdocs-cli/src/commands/index.ts | 2 +- packages/techdocs-cli/src/commands/migrate/migrate.ts | 2 +- packages/techdocs-cli/src/commands/publish/publish.ts | 2 +- packages/techdocs-cli/src/lib/utility.ts | 2 +- plugins/techdocs-backend/README.md | 2 +- plugins/techdocs-backend/api-report.md | 10 +++++----- plugins/techdocs-backend/package.json | 2 +- plugins/techdocs-backend/src/DocsBuilder/builder.ts | 2 +- plugins/techdocs-backend/src/index.ts | 6 +++--- .../src/search/DefaultTechDocsCollator.ts | 2 +- .../src/search/DefaultTechDocsCollatorFactory.ts | 2 +- .../src/service/DocsSynchronizer.test.ts | 2 +- .../techdocs-backend/src/service/DocsSynchronizer.ts | 2 +- plugins/techdocs-backend/src/service/router.test.ts | 2 +- plugins/techdocs-backend/src/service/router.ts | 2 +- .../techdocs-backend/src/service/standaloneServer.ts | 2 +- plugins/techdocs-node/CHANGELOG.md | 2 +- plugins/techdocs-node/README.md | 10 +++++----- plugins/techdocs-node/api-report.md | 2 +- plugins/techdocs-node/package.json | 6 +++--- plugins/techdocs-node/src/stages/generate/techdocs.ts | 2 +- plugins/techdocs-node/src/stages/publish/awsS3.test.ts | 2 +- .../src/stages/publish/azureBlobStorage.test.ts | 2 +- .../src/stages/publish/googleStorage.test.ts | 2 +- plugins/techdocs-node/src/stages/publish/local.ts | 2 +- .../src/stages/publish/openStackSwift.test.ts | 2 +- plugins/techdocs-node/src/stages/publish/types.ts | 2 +- scripts/api-extractor.ts | 1 + 34 files changed, 54 insertions(+), 47 deletions(-) create mode 100644 .changeset/techdocs-node-one.md diff --git a/.changeset/techdocs-node-one.md b/.changeset/techdocs-node-one.md new file mode 100644 index 0000000000..706c708c4a --- /dev/null +++ b/.changeset/techdocs-node-one.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-techdocs-backend': patch +'@techdocs/cli': patch +--- + +Use `@backstage/plugin-techdocs-node` package instead of `@backstage/techdocs-common`. diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 1a0f827fb1..44c61f9348 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -46,7 +46,7 @@ /plugins/search-* @backstage/reviewers @backstage/techdocs-core /plugins/sonarqube @backstage/reviewers @backstage/sda-se-reviewers /plugins/techdocs @backstage/reviewers @backstage/techdocs-core -/plugins/techdocs-backend @backstage/reviewers @backstage/techdocs-core +/plugins/techdocs-* @backstage/reviewers @backstage/techdocs-core /tech-insights-backend @backstage/reviewers @xantier @iain-b /tech-insights-backend-module-jsonfc @backstage/reviewers @xantier @iain-b /tech-insights-tech-insights-common @backstage/reviewers @xantier @iain-b diff --git a/docs/features/techdocs/cli.md b/docs/features/techdocs/cli.md index 2a11e1181a..6efb83549e 100644 --- a/docs/features/techdocs/cli.md +++ b/docs/features/techdocs/cli.md @@ -97,7 +97,7 @@ techdocs-cli generate Alias: `techdocs-cli build` The generate command uses the -[`@backstage/techdocs-common`](https://github.com/backstage/backstage/tree/master/packages/techdocs-common) +[`@backstage/plugin-techdocs-node`](https://github.com/backstage/backstage/tree/master/plugins/techdocs-node) package from Backstage for consistency. A Backstage app can also generate and publish TechDocs sites if `techdocs.builder` is set to `'local'` in `app-config.yaml`. See diff --git a/docs/getting-started/project-structure.md b/docs/getting-started/project-structure.md index 6c49c798d0..b67e847272 100644 --- a/docs/getting-started/project-structure.md +++ b/docs/getting-started/project-structure.md @@ -160,8 +160,8 @@ are separated out into their own folder, see further down. reusable React components. Stories are within the core package, and are published in the [Backstage Storybook](https://backstage.io/storybook). -- [`techdocs-common/`](https://github.com/backstage/backstage/tree/master/packages/techdocs-common) - - Common functionalities for TechDocs, to be shared between +- [`techdocs-node/`](https://github.com/backstage/backstage/tree/master/plugins/techdocs-node) - + Common node.js functionalities for TechDocs, to be shared between [techdocs-backend](https://github.com/backstage/backstage/tree/master/plugins/techdocs-backend) plugin and [techdocs-cli](https://github.com/backstage/techdocs-cli). diff --git a/packages/techdocs-cli/package.json b/packages/techdocs-cli/package.json index 32eb70602c..e6cfab0916 100644 --- a/packages/techdocs-cli/package.json +++ b/packages/techdocs-cli/package.json @@ -66,7 +66,7 @@ "@backstage/catalog-model": "^0.12.0", "@backstage/cli-common": "^0.1.8", "@backstage/config": "^0.1.15", - "@backstage/techdocs-common": "^0.11.11", + "@backstage/plugin-techdocs-node": "^0.11.11", "@types/dockerode": "^3.3.0", "commander": "^6.1.0", "dockerode": "^3.3.1", diff --git a/packages/techdocs-cli/src/commands/generate/generate.ts b/packages/techdocs-cli/src/commands/generate/generate.ts index 0f5213df34..98529698ca 100644 --- a/packages/techdocs-cli/src/commands/generate/generate.ts +++ b/packages/techdocs-cli/src/commands/generate/generate.ts @@ -21,7 +21,7 @@ import Docker from 'dockerode'; import { TechdocsGenerator, ParsedLocationAnnotation, -} from '@backstage/techdocs-common'; +} from '@backstage/plugin-techdocs-node'; import { DockerContainerRunner } from '@backstage/backend-common'; import { ConfigReader } from '@backstage/config'; import { @@ -31,7 +31,7 @@ import { import { stdout } from 'process'; export default async function generate(cmd: Command) { - // Use techdocs-common package to generate docs. Keep consistency between Backstage and CI generating docs. + // Use techdocs-node package to generate docs. Keep consistency between Backstage and CI generating docs. // Docs can be prepared using actions/checkout or git clone, or similar paradigms on CI. The TechDocs CI workflow // will run on the CI pipeline containing the documentation files. @@ -78,7 +78,7 @@ export default async function generate(cmd: Command) { } } - // Generate docs using @backstage/techdocs-common + // Generate docs using @backstage/plugin-techdocs-node const techdocsGenerator = await TechdocsGenerator.fromConfig(config, { logger, containerRunner, diff --git a/packages/techdocs-cli/src/commands/index.ts b/packages/techdocs-cli/src/commands/index.ts index 6f1d9847e1..6ad62c5668 100644 --- a/packages/techdocs-cli/src/commands/index.ts +++ b/packages/techdocs-cli/src/commands/index.ts @@ -15,7 +15,7 @@ */ import { CommanderStatic } from 'commander'; -import { TechdocsGenerator } from '@backstage/techdocs-common'; +import { TechdocsGenerator } from '@backstage/plugin-techdocs-node'; const defaultDockerImage = TechdocsGenerator.defaultDockerImage; diff --git a/packages/techdocs-cli/src/commands/migrate/migrate.ts b/packages/techdocs-cli/src/commands/migrate/migrate.ts index 1cd8fca65b..067bf1f173 100644 --- a/packages/techdocs-cli/src/commands/migrate/migrate.ts +++ b/packages/techdocs-cli/src/commands/migrate/migrate.ts @@ -15,7 +15,7 @@ */ import { SingleHostDiscovery } from '@backstage/backend-common'; -import { Publisher } from '@backstage/techdocs-common'; +import { Publisher } from '@backstage/plugin-techdocs-node'; import { Command } from 'commander'; import { createLogger } from '../../lib/utility'; import { PublisherConfig } from '../../lib/PublisherConfig'; diff --git a/packages/techdocs-cli/src/commands/publish/publish.ts b/packages/techdocs-cli/src/commands/publish/publish.ts index 11a47d4a71..c84180b032 100644 --- a/packages/techdocs-cli/src/commands/publish/publish.ts +++ b/packages/techdocs-cli/src/commands/publish/publish.ts @@ -18,7 +18,7 @@ import { resolve } from 'path'; import { Command } from 'commander'; import { createLogger } from '../../lib/utility'; import { SingleHostDiscovery } from '@backstage/backend-common'; -import { Publisher } from '@backstage/techdocs-common'; +import { Publisher } from '@backstage/plugin-techdocs-node'; import { Entity } from '@backstage/catalog-model'; import { PublisherConfig } from '../../lib/PublisherConfig'; diff --git a/packages/techdocs-cli/src/lib/utility.ts b/packages/techdocs-cli/src/lib/utility.ts index 87dbbfd08d..3f91f3c82d 100644 --- a/packages/techdocs-cli/src/lib/utility.ts +++ b/packages/techdocs-cli/src/lib/utility.ts @@ -16,7 +16,7 @@ import { RemoteProtocol, ParsedLocationAnnotation, -} from '@backstage/techdocs-common'; +} from '@backstage/plugin-techdocs-node'; import * as winston from 'winston'; export const convertTechDocsRefToLocationAnnotation = ( diff --git a/plugins/techdocs-backend/README.md b/plugins/techdocs-backend/README.md index 57bc477f12..a1d7d22855 100644 --- a/plugins/techdocs-backend/README.md +++ b/plugins/techdocs-backend/README.md @@ -21,7 +21,7 @@ yarn start This provides serving and building of documentation for any entity. To configure various storage providers and building options, see http://backstage.io/docs/features/techdocs/configuration. -The techdocs-backend re-exports the [techdocs-common](https://github.com/backstage/backstage/tree/master/packages/techdocs-common) package which has the features to prepare, generate and publish docs. +The techdocs-backend re-exports the [techdocs-node](https://github.com/backstage/backstage/tree/master/plugins/techdocs-node) package which has the features to prepare, generate and publish docs. The Publishers are also used to fetch the static documentation files and render them in TechDocs. ## Links diff --git a/plugins/techdocs-backend/api-report.md b/plugins/techdocs-backend/api-report.md index 155f096614..acce0b4981 100644 --- a/plugins/techdocs-backend/api-report.md +++ b/plugins/techdocs-backend/api-report.md @@ -10,16 +10,16 @@ import { Config } from '@backstage/config'; import { DocumentCollatorFactory } from '@backstage/search-common'; import { Entity } from '@backstage/catalog-model'; import express from 'express'; -import { GeneratorBuilder } from '@backstage/techdocs-common'; +import { GeneratorBuilder } from '@backstage/plugin-techdocs-node'; import { Knex } from 'knex'; import { Logger as Logger_2 } from 'winston'; import { Permission } from '@backstage/plugin-permission-common'; import { PluginCacheManager } from '@backstage/backend-common'; import { PluginEndpointDiscovery } from '@backstage/backend-common'; -import { PreparerBuilder } from '@backstage/techdocs-common'; -import { PublisherBase } from '@backstage/techdocs-common'; +import { PreparerBuilder } from '@backstage/plugin-techdocs-node'; +import { PublisherBase } from '@backstage/plugin-techdocs-node'; import { Readable } from 'stream'; -import { TechDocsDocument } from '@backstage/techdocs-common'; +import { TechDocsDocument } from '@backstage/plugin-techdocs-node'; import { TokenManager } from '@backstage/backend-common'; // @public @@ -123,5 +123,5 @@ export type TechDocsCollatorOptions = { export { TechDocsDocument }; -export * from '@backstage/techdocs-common'; +export * from '@backstage/plugin-techdocs-node'; ``` diff --git a/plugins/techdocs-backend/package.json b/plugins/techdocs-backend/package.json index 81aa19a937..aea75b1c3d 100644 --- a/plugins/techdocs-backend/package.json +++ b/plugins/techdocs-backend/package.json @@ -41,8 +41,8 @@ "@backstage/errors": "^0.2.2", "@backstage/integration": "^0.8.0", "@backstage/plugin-catalog-common": "^0.2.0", + "@backstage/plugin-techdocs-node": "^0.11.11", "@backstage/search-common": "^0.3.0", - "@backstage/techdocs-common": "^0.11.11", "@types/express": "^4.17.6", "dockerode": "^3.3.1", "express": "^4.17.1", diff --git a/plugins/techdocs-backend/src/DocsBuilder/builder.ts b/plugins/techdocs-backend/src/DocsBuilder/builder.ts index 05e9c0ce52..09eee1fc12 100644 --- a/plugins/techdocs-backend/src/DocsBuilder/builder.ts +++ b/plugins/techdocs-backend/src/DocsBuilder/builder.ts @@ -29,7 +29,7 @@ import { PreparerBuilder, PublisherBase, UrlPreparer, -} from '@backstage/techdocs-common'; +} from '@backstage/plugin-techdocs-node'; import fs from 'fs-extra'; import os from 'os'; import path from 'path'; diff --git a/plugins/techdocs-backend/src/index.ts b/plugins/techdocs-backend/src/index.ts index 570da95092..dc5d87d1b3 100644 --- a/plugins/techdocs-backend/src/index.ts +++ b/plugins/techdocs-backend/src/index.ts @@ -39,8 +39,8 @@ export type { } from './search'; /** - * @deprecated Use directly from @backstage/techdocs-common + * @deprecated Use directly from @backstage/plugin-techdocs-node */ -export type { TechDocsDocument } from '@backstage/techdocs-common'; +export type { TechDocsDocument } from '@backstage/plugin-techdocs-node'; -export * from '@backstage/techdocs-common'; +export * from '@backstage/plugin-techdocs-node'; diff --git a/plugins/techdocs-backend/src/search/DefaultTechDocsCollator.ts b/plugins/techdocs-backend/src/search/DefaultTechDocsCollator.ts index d36e1c0ae5..7529eaca66 100644 --- a/plugins/techdocs-backend/src/search/DefaultTechDocsCollator.ts +++ b/plugins/techdocs-backend/src/search/DefaultTechDocsCollator.ts @@ -35,7 +35,7 @@ import { CatalogClient, CATALOG_FILTER_EXISTS, } from '@backstage/catalog-client'; -import { TechDocsDocument } from '@backstage/techdocs-common'; +import { TechDocsDocument } from '@backstage/plugin-techdocs-node'; interface MkSearchIndexDoc { title: string; diff --git a/plugins/techdocs-backend/src/search/DefaultTechDocsCollatorFactory.ts b/plugins/techdocs-backend/src/search/DefaultTechDocsCollatorFactory.ts index 181f032b54..7ba76350e4 100644 --- a/plugins/techdocs-backend/src/search/DefaultTechDocsCollatorFactory.ts +++ b/plugins/techdocs-backend/src/search/DefaultTechDocsCollatorFactory.ts @@ -32,7 +32,7 @@ import { import { Config } from '@backstage/config'; import { catalogEntityReadPermission } from '@backstage/plugin-catalog-common'; import { DocumentCollatorFactory } from '@backstage/search-common'; -import { TechDocsDocument } from '@backstage/techdocs-common'; +import { TechDocsDocument } from '@backstage/plugin-techdocs-node'; import unescape from 'lodash/unescape'; import fetch from 'node-fetch'; import pLimit from 'p-limit'; diff --git a/plugins/techdocs-backend/src/service/DocsSynchronizer.test.ts b/plugins/techdocs-backend/src/service/DocsSynchronizer.test.ts index 1830dbfcf0..05dfb5bdcc 100644 --- a/plugins/techdocs-backend/src/service/DocsSynchronizer.test.ts +++ b/plugins/techdocs-backend/src/service/DocsSynchronizer.test.ts @@ -24,7 +24,7 @@ import { GeneratorBuilder, PreparerBuilder, PublisherBase, -} from '@backstage/techdocs-common'; +} from '@backstage/plugin-techdocs-node'; import { TechDocsCache } from '../cache'; import { DocsBuilder, shouldCheckForUpdate } from '../DocsBuilder'; import { DocsSynchronizer, DocsSynchronizerSyncOpts } from './DocsSynchronizer'; diff --git a/plugins/techdocs-backend/src/service/DocsSynchronizer.ts b/plugins/techdocs-backend/src/service/DocsSynchronizer.ts index 2979d2efe4..090efc4639 100644 --- a/plugins/techdocs-backend/src/service/DocsSynchronizer.ts +++ b/plugins/techdocs-backend/src/service/DocsSynchronizer.ts @@ -23,7 +23,7 @@ import { GeneratorBuilder, PreparerBuilder, PublisherBase, -} from '@backstage/techdocs-common'; +} from '@backstage/plugin-techdocs-node'; import fetch from 'node-fetch'; import { PassThrough } from 'stream'; import * as winston from 'winston'; diff --git a/plugins/techdocs-backend/src/service/router.test.ts b/plugins/techdocs-backend/src/service/router.test.ts index c7cda203bb..2e707c9513 100644 --- a/plugins/techdocs-backend/src/service/router.test.ts +++ b/plugins/techdocs-backend/src/service/router.test.ts @@ -26,7 +26,7 @@ import { GeneratorBuilder, PreparerBuilder, PublisherBase, -} from '@backstage/techdocs-common'; +} from '@backstage/plugin-techdocs-node'; import express, { Response } from 'express'; import request from 'supertest'; import { DocsSynchronizer, DocsSynchronizerSyncOpts } from './DocsSynchronizer'; diff --git a/plugins/techdocs-backend/src/service/router.ts b/plugins/techdocs-backend/src/service/router.ts index 73f212d049..9ebad9411d 100644 --- a/plugins/techdocs-backend/src/service/router.ts +++ b/plugins/techdocs-backend/src/service/router.ts @@ -26,7 +26,7 @@ import { getLocationForEntity, PreparerBuilder, PublisherBase, -} from '@backstage/techdocs-common'; +} from '@backstage/plugin-techdocs-node'; import express, { Response } from 'express'; import Router from 'express-promise-router'; import { Knex } from 'knex'; diff --git a/plugins/techdocs-backend/src/service/standaloneServer.ts b/plugins/techdocs-backend/src/service/standaloneServer.ts index eeb85bfad0..4ab4c084e0 100644 --- a/plugins/techdocs-backend/src/service/standaloneServer.ts +++ b/plugins/techdocs-backend/src/service/standaloneServer.ts @@ -28,7 +28,7 @@ import { Preparers, Publisher, TechdocsGenerator, -} from '@backstage/techdocs-common'; +} from '@backstage/plugin-techdocs-node'; import Docker from 'dockerode'; import { Server } from 'http'; import { Logger } from 'winston'; diff --git a/plugins/techdocs-node/CHANGELOG.md b/plugins/techdocs-node/CHANGELOG.md index f41c944a89..77f240314b 100644 --- a/plugins/techdocs-node/CHANGELOG.md +++ b/plugins/techdocs-node/CHANGELOG.md @@ -1,4 +1,4 @@ -# @backstage/techdocs-common +# @backstage/plugin-techdocs-node ## 0.11.11 diff --git a/plugins/techdocs-node/README.md b/plugins/techdocs-node/README.md index bbaac85e9b..7bf2e5ba9d 100644 --- a/plugins/techdocs-node/README.md +++ b/plugins/techdocs-node/README.md @@ -1,15 +1,15 @@ -# @backstage/techdocs-common +# @backstage/plugin-techdocs-node -Common functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli +Common node.js functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli This package is used by `techdocs-backend` to serve docs from different types of publishers (Google GCS, Local, etc.). It is also used to build docs and publish them to storage, by both `techdocs-backend` and `techdocs-cli`. ## Usage -Create a preparer instance from the [preparers available](/packages/techdocs-common/src/stages/prepare) at which takes an Entity instance. -Run the [docs generator](/packages/techdocs-common/src/stages/generate) on the prepared directory. -Publish the generated directory files to a [storage](/packages/techdocs-common/src/stages/publish) of your choice. +Create a preparer instance from the [preparers available](/plugins/techdocs-node/src/stages/prepare) at which takes an Entity instance. +Run the [docs generator](/plugins/techdocs-node/src/stages/generate) on the prepared directory. +Publish the generated directory files to a [storage](/plugins/techdocs-node/src/stages/publish) of your choice. Example: diff --git a/plugins/techdocs-node/api-report.md b/plugins/techdocs-node/api-report.md index 13d610f66b..9ec1aafb09 100644 --- a/plugins/techdocs-node/api-report.md +++ b/plugins/techdocs-node/api-report.md @@ -1,4 +1,4 @@ -## API Report File for "@backstage/techdocs-common" +## API Report File for "@backstage/plugin-techdocs-node" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). diff --git a/plugins/techdocs-node/package.json b/plugins/techdocs-node/package.json index 04e13065c8..7cbf49f954 100644 --- a/plugins/techdocs-node/package.json +++ b/plugins/techdocs-node/package.json @@ -1,6 +1,6 @@ { - "name": "@backstage/techdocs-common", - "description": "Common functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli", + "name": "@backstage/plugin-techdocs-node", + "description": "Common node.js functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli", "version": "0.11.11", "main": "src/index.ts", "types": "src/index.ts", @@ -17,7 +17,7 @@ "repository": { "type": "git", "url": "https://github.com/backstage/backstage", - "directory": "packages/techdocs-common" + "directory": "plugins/techdocs-node" }, "keywords": [ "techdocs", diff --git a/plugins/techdocs-node/src/stages/generate/techdocs.ts b/plugins/techdocs-node/src/stages/generate/techdocs.ts index b46f52f99a..fd05c3bf8b 100644 --- a/plugins/techdocs-node/src/stages/generate/techdocs.ts +++ b/plugins/techdocs-node/src/stages/generate/techdocs.ts @@ -51,7 +51,7 @@ import { ForwardedError } from '@backstage/errors'; export class TechdocsGenerator implements GeneratorBase { /** * The default docker image (and version) used to generate content. Public - * and static so that techdocs-common consumers can use the same version. + * and static so that techdocs-node consumers can use the same version. */ public static readonly defaultDockerImage = 'spotify/techdocs:v0.3.7'; private readonly logger: Logger; diff --git a/plugins/techdocs-node/src/stages/publish/awsS3.test.ts b/plugins/techdocs-node/src/stages/publish/awsS3.test.ts index 357df73c8c..326e587a83 100644 --- a/plugins/techdocs-node/src/stages/publish/awsS3.test.ts +++ b/plugins/techdocs-node/src/stages/publish/awsS3.test.ts @@ -24,7 +24,7 @@ import path from 'path'; import fs from 'fs-extra'; import { AwsS3Publish } from './awsS3'; -// NOTE: /packages/techdocs-common/__mocks__ is being used to mock aws-sdk client library +// NOTE: /plugins/techdocs-node/__mocks__ is being used to mock aws-sdk client library const rootDir = (global as any).rootDir; // Set by setupTests.ts diff --git a/plugins/techdocs-node/src/stages/publish/azureBlobStorage.test.ts b/plugins/techdocs-node/src/stages/publish/azureBlobStorage.test.ts index f1b660555e..3e5e420e4b 100644 --- a/plugins/techdocs-node/src/stages/publish/azureBlobStorage.test.ts +++ b/plugins/techdocs-node/src/stages/publish/azureBlobStorage.test.ts @@ -24,7 +24,7 @@ import path from 'path'; import fs from 'fs-extra'; import { AzureBlobStoragePublish } from './azureBlobStorage'; -// NOTE: /packages/techdocs-common/__mocks__ is being used to mock Azure client library +// NOTE: /plugins/techdocs-node/__mocks__ is being used to mock Azure client library const rootDir = (global as any).rootDir; // Set by setupTests.ts diff --git a/plugins/techdocs-node/src/stages/publish/googleStorage.test.ts b/plugins/techdocs-node/src/stages/publish/googleStorage.test.ts index 87a38402d0..6dac092cec 100644 --- a/plugins/techdocs-node/src/stages/publish/googleStorage.test.ts +++ b/plugins/techdocs-node/src/stages/publish/googleStorage.test.ts @@ -24,7 +24,7 @@ import path from 'path'; import fs from 'fs-extra'; import { GoogleGCSPublish } from './googleStorage'; -// NOTE: /packages/techdocs-common/__mocks__ is being used to mock Google Cloud Storage client library +// NOTE: /plugins/techdocs-node/__mocks__ is being used to mock Google Cloud Storage client library const rootDir = (global as any).rootDir; // Set by setupTests.ts diff --git a/plugins/techdocs-node/src/stages/publish/local.ts b/plugins/techdocs-node/src/stages/publish/local.ts index af9bb30d46..4539d389df 100644 --- a/plugins/techdocs-node/src/stages/publish/local.ts +++ b/plugins/techdocs-node/src/stages/publish/local.ts @@ -49,7 +49,7 @@ try { ); } catch (err) { // This will most probably never be used. - // The try/catch is introduced so that techdocs-cli can import @backstage/techdocs-common + // The try/catch is introduced so that techdocs-cli can import @backstage/plugin-techdocs-node // on CI/CD without installing techdocs backend plugin. staticDocsDir = os.tmpdir(); } diff --git a/plugins/techdocs-node/src/stages/publish/openStackSwift.test.ts b/plugins/techdocs-node/src/stages/publish/openStackSwift.test.ts index da0a60343f..aeb4e120f5 100644 --- a/plugins/techdocs-node/src/stages/publish/openStackSwift.test.ts +++ b/plugins/techdocs-node/src/stages/publish/openStackSwift.test.ts @@ -29,7 +29,7 @@ import path from 'path'; import { OpenStackSwiftPublish } from './openStackSwift'; import { PublisherBase, TechDocsMetadata } from './types'; -// NOTE: /packages/techdocs-common/__mocks__ is being used to mock @trendyol-js/openstack-swift-sdk client library +// NOTE: /plugins/techdocs-node/__mocks__ is being used to mock @trendyol-js/openstack-swift-sdk client library const createMockEntity = (annotations = {}): Entity => { return { diff --git a/plugins/techdocs-node/src/stages/publish/types.ts b/plugins/techdocs-node/src/stages/publish/types.ts index 86772c25f4..ff5b9acade 100644 --- a/plugins/techdocs-node/src/stages/publish/types.ts +++ b/plugins/techdocs-node/src/stages/publish/types.ts @@ -153,7 +153,7 @@ export interface PublisherBase { * `techdocs-cli` version `{0.x.y}` and `techdocs-backend` version `{0.x.y}`. * * Implementation of this method is unnecessary in publishers introduced - * after version `{0.x.y}` of `techdocs-common`. + * after version `{0.x.y}` of `techdocs-node`. */ migrateDocsCase?(migrateRequest: MigrateRequest): Promise; } diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index afe2c1a1bb..d37fa51c60 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -238,6 +238,7 @@ const NO_WARNING_PACKAGES = [ 'plugins/scaffolder-common', 'plugins/search-backend-node', 'plugins/techdocs-backend', + 'plugins/techdocs-node', 'plugins/tech-insights', 'plugins/tech-insights-backend', 'plugins/tech-insights-backend-module-jsonfc', From cea6f10b9703df5e177f4fadb6e3aa0c3914500c Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 3 Mar 2022 14:05:19 +0100 Subject: [PATCH 3/6] Recreate a shell of @backstage/techdocs-common for smooth deprecation process Signed-off-by: Eric Peterson --- .changeset/techdocs-byta-namnet.md | 5 + .changeset/techdocs-empty-office.md | 7 + packages/techdocs-common/.eslintrc.js | 3 + packages/techdocs-common/CHANGELOG.md | 1065 ++++++++++++++++++++++++ packages/techdocs-common/README.md | 53 ++ packages/techdocs-common/api-report.md | 9 + packages/techdocs-common/package.json | 51 ++ packages/techdocs-common/src/index.ts | 17 + 8 files changed, 1210 insertions(+) create mode 100644 .changeset/techdocs-byta-namnet.md create mode 100644 .changeset/techdocs-empty-office.md create mode 100644 packages/techdocs-common/.eslintrc.js create mode 100644 packages/techdocs-common/CHANGELOG.md create mode 100644 packages/techdocs-common/README.md create mode 100644 packages/techdocs-common/api-report.md create mode 100644 packages/techdocs-common/package.json create mode 100644 packages/techdocs-common/src/index.ts diff --git a/.changeset/techdocs-byta-namnet.md b/.changeset/techdocs-byta-namnet.md new file mode 100644 index 0000000000..f77849513b --- /dev/null +++ b/.changeset/techdocs-byta-namnet.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs-node': patch +--- + +Renamed `@backstage/techdocs-common` to `@backstage/plugin-techdocs-node`. diff --git a/.changeset/techdocs-empty-office.md b/.changeset/techdocs-empty-office.md new file mode 100644 index 0000000000..082521be35 --- /dev/null +++ b/.changeset/techdocs-empty-office.md @@ -0,0 +1,7 @@ +--- +'@backstage/techdocs-common': patch +--- + +**DEPRECATION** + +The `@backstage/techdocs-common` package is being renamed `@backstage/plugin-techdocs-node`. We may continue to publish changes to `@backstage/techdocs-common` for a time, but will stop doing so in the near future. If you depend on this package, you should update your dependencies to point at the renamed package. diff --git a/packages/techdocs-common/.eslintrc.js b/packages/techdocs-common/.eslintrc.js new file mode 100644 index 0000000000..16a033dbc6 --- /dev/null +++ b/packages/techdocs-common/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: [require.resolve('@backstage/cli/config/eslint.backend')], +}; diff --git a/packages/techdocs-common/CHANGELOG.md b/packages/techdocs-common/CHANGELOG.md new file mode 100644 index 0000000000..f41c944a89 --- /dev/null +++ b/packages/techdocs-common/CHANGELOG.md @@ -0,0 +1,1065 @@ +# @backstage/techdocs-common + +## 0.11.11 + +### Patch Changes + +- 955be6bc7d: adds passing projectID to the Storage client +- ff0a16fb1a: Modify techdocs builder to automatically append techdocs-core plugin to mkdocs.yaml file if it is missing. Adds an optional configuration item if this plugin needs to be omitted. +- Updated dependencies + - @backstage/catalog-model@0.12.0 + - @backstage/backend-common@0.12.0 + - @backstage/integration@0.8.0 + - @backstage/search-common@0.3.0 + +## 0.11.10 + +### Patch Changes + +- 209fd128e6: Updated usage of `github:` location types in docs to use `url:` instead. +- 13ef228d03: Clean up the API interface for TechDocs common library. +- Updated dependencies + - @backstage/backend-common@0.11.0 + - @backstage/catalog-model@0.11.0 + - @backstage/integration@0.7.5 + +## 0.11.9 + +### Patch Changes + +- Fix for the previous release with missing type declarations. +- Updated dependencies + - @backstage/backend-common@0.10.9 + - @backstage/catalog-model@0.10.1 + - @backstage/config@0.1.15 + - @backstage/errors@0.2.2 + - @backstage/integration@0.7.4 + - @backstage/search-common@0.2.4 + +## 0.11.8 + +### Patch Changes + +- c77c5c7eb6: Added `backstage.role` to `package.json` +- 216725b434: Updated to use new names for `parseLocationRef` and `stringifyLocationRef` +- 7aeb491394: Replace use of deprecated `ENTITY_DEFAULT_NAMESPACE` constant with `DEFAULT_NAMESPACE`. +- Updated dependencies + - @backstage/backend-common@0.10.8 + - @backstage/errors@0.2.1 + - @backstage/integration@0.7.3 + - @backstage/catalog-model@0.10.0 + - @backstage/config@0.1.14 + - @backstage/search-common@0.2.3 + +## 0.11.7 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.10.7 + +## 0.11.7-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.10.7-next.0 + +## 0.11.6 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.10.6 + +## 0.11.6-next.0 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.10.6-next.0 + +## 0.11.5 + +### Patch Changes + +- ff93fbeeec: Fix interpolated string for "Failed to generate docs from ..." +- Updated dependencies + - @backstage/search-common@0.2.2 + - @backstage/backend-common@0.10.5 + +## 0.11.4 + +### Patch Changes + +- 47277c0d8c: Updated the default version of the `@spotify/techdocs` container used when `techdocs.generator.runIn` is `docker` to `v0.3.6`, which includes an update to `mkdocs-monorepo-plugin` that allows glob-based wildcard includes. +- Updated dependencies + - @backstage/integration@0.7.2 + - @backstage/backend-common@0.10.4 + - @backstage/config@0.1.13 + - @backstage/catalog-model@0.9.10 + +## 0.11.4-next.0 + +### Patch Changes + +- 47277c0d8c: Updated the default version of the `@spotify/techdocs` container used when `techdocs.generator.runIn` is `docker` to `v0.3.6`, which includes an update to `mkdocs-monorepo-plugin` that allows glob-based wildcard includes. +- Updated dependencies + - @backstage/backend-common@0.10.4-next.0 + - @backstage/config@0.1.13-next.0 + - @backstage/catalog-model@0.9.10-next.0 + - @backstage/integration@0.7.2-next.0 + +## 0.11.3 + +### Patch Changes + +- 5333451def: Cleaned up API exports +- Updated dependencies + - @backstage/config@0.1.12 + - @backstage/integration@0.7.1 + - @backstage/backend-common@0.10.3 + - @backstage/errors@0.2.0 + - @backstage/catalog-model@0.9.9 + +## 0.11.2 + +### Patch Changes + +- c2c8768771: Bump `@azure/identity` from `^1.5.0` to `^2.0.1`. +- Updated dependencies + - @backstage/backend-common@0.10.1 + - @backstage/integration@0.7.0 + +## 0.11.1 + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.10.0 + +## 0.11.0 + +### Minor Changes + +- 1bada775a9: Added the ability for the TechDocs Backend to (optionally) leverage a cache + store to improve performance when reading files from a cloud storage provider. + +### Patch Changes + +- dcd1a0c3f4: Minor improvement to the API reports, by not unpacking arguments directly +- Updated dependencies + - @backstage/backend-common@0.9.13 + +## 0.10.8 + +### Patch Changes + +- bab752e2b3: Change default port of backend from 7000 to 7007. + + This is due to the AirPlay Receiver process occupying port 7000 and preventing local Backstage instances on MacOS to start. + + You can change the port back to 7000 or any other value by providing an `app-config.yaml` with the following values: + + ``` + backend: + listen: 0.0.0.0:7123 + baseUrl: http://localhost:7123 + ``` + + More information can be found here: https://backstage.io/docs/conf/writing + +- Updated dependencies + - @backstage/errors@0.1.5 + - @backstage/backend-common@0.9.11 + +## 0.10.7 + +### Patch Changes + +- 0b60a051c9: Added OpenStack Swift case migration support. +- 9e64a7ac1e: Allow amazon web services s3 buckets to pass an server side encryption configuration so they can publish to encrypted buckets +- Updated dependencies + - @backstage/catalog-model@0.9.7 + - @backstage/backend-common@0.9.10 + +## 0.10.6 + +### Patch Changes + +- a2d4389587: 1. Techdocs publisher constructors now use parameter objects when being + instantiated + + 2. Internal refactor of `LocalPublish` publisher to use `fromConfig` for + creation to be aligned with other publishers; this does not impact + `LocalPublish` usage. + + ```diff + - const publisher = new LocalPublish(config, logger, discovery); + + const publisher = LocalPublish.fromConfig(config, logger, discovery); + ``` + +- 6129c89a47: Default TechDocs container used at docs generation-time is now [v0.3.5](https://github.com/backstage/techdocs-container/releases/tag/v0.3.5). +- f3c7eec64b: Updated to properly join URL segments under any OS for both AWS S3 and GCP +- Updated dependencies + - @backstage/backend-common@0.9.9 + +## 0.10.5 + +### Patch Changes + +- d207f6ee9e: Support optional bucketRootPath configuration parameter in S3 and GCS publishers +- Updated dependencies + - @backstage/config@0.1.11 + - @backstage/errors@0.1.4 + - @backstage/integration@0.6.9 + - @backstage/backend-common@0.9.8 + - @backstage/catalog-model@0.9.6 + - @backstage/search-common@0.2.1 + +## 0.10.4 + +### Patch Changes + +- 87f5b9db13: Use docs/README.md or README.md as fallback if docs/index.md is missing +- 36e67d2f24: Internal updates to apply more strict checks to throw errors. +- Updated dependencies + - @backstage/backend-common@0.9.7 + - @backstage/errors@0.1.3 + - @backstage/catalog-model@0.9.5 + +## 0.10.3 + +### Patch Changes + +- 156421c59a: Sets the default techdocs docker image to the [latest released version - v0.3.3](https://github.com/backstage/techdocs-container/releases/tag/v0.3.3). +- Updated dependencies + - @backstage/catalog-model@0.9.4 + - @backstage/backend-common@0.9.6 + - @backstage/integration@0.6.7 + +## 0.10.2 + +### Patch Changes + +- 1c75e8bf98: Add more context to techdocs log lines when files are not found along with + ensuring that the routers return 404 with a descriptive message. +- e92f0f728b: Locks the version of the default docker image used to generate TechDocs. As of + this changelog entry, it is v0.3.2! +- Updated dependencies + - @backstage/backend-common@0.9.5 + - @backstage/integration@0.6.6 + +## 0.10.1 + +### Patch Changes + +- 96fef17a18: Upgrade git-parse-url to v11.6.0 +- Updated dependencies + - @backstage/backend-common@0.9.3 + - @backstage/integration@0.6.4 + +## 0.10.0 + +### Minor Changes + +- 8b0f6f860: Set the correct `edit_uri` or `repo_url` for documentation pages that are hosted on GitHub and GitLab. + + The constructor of the `TechDocsGenerator` changed. + Prefer the use of `TechdocsGenerator.fromConfig(…)` instead: + + ```diff + - const techdocsGenerator = new TechdocsGenerator({ + + const techdocsGenerator = TechdocsGenerator.fromConfig(config, { + logger, + containerRunner, + - config, + }); + ``` + +### Patch Changes + +- 30ed662a3: Adding in-context search to TechDocs Reader component. Using existing search-backend to query for indexed search results scoped into a specific entity's techdocs. Needs TechDocsCollator enabled on the backend to work. + + Adding extra information to indexed tech docs documents for search. + +- 3624616e7: "Local" (out-of-the-box) publisher explicitly follows lower-case entity triplet + logic. +- 67ba7e088: Only write the updated `mkdocs.yml` file if the content was updated. + + This keeps local files unchanged if the `dir` annotation is used in combination with the `file` location. + +- 8eab6be6a: Force using `posix` path for cloud storage +- Updated dependencies + - @backstage/integration@0.6.3 + - @backstage/search-common@0.2.0 + - @backstage/catalog-model@0.9.1 + - @backstage/backend-common@0.9.1 + +## 0.9.0 + +### Minor Changes + +- 58452cdb7: OpenStack Swift Client changed with Trendyol's OpenStack Swift SDK. + + ## Migration from old OpenStack Swift Configuration + + Let's assume we have the old OpenStack Swift configuration here. + + ```yaml + techdocs: + publisher: + type: 'openStackSwift' + openStackSwift: + containerName: 'name-of-techdocs-storage-bucket' + credentials: + username: ${OPENSTACK_SWIFT_STORAGE_USERNAME} + password: ${OPENSTACK_SWIFT_STORAGE_PASSWORD} + authUrl: ${OPENSTACK_SWIFT_STORAGE_AUTH_URL} + keystoneAuthVersion: ${OPENSTACK_SWIFT_STORAGE_AUTH_VERSION} + domainId: ${OPENSTACK_SWIFT_STORAGE_DOMAIN_ID} + domainName: ${OPENSTACK_SWIFT_STORAGE_DOMAIN_NAME} + region: ${OPENSTACK_SWIFT_STORAGE_REGION} + ``` + + ##### Step 1: Change the credential keys + + Since the new SDK uses _Application Credentials_ to authenticate OpenStack, we + need to change the keys `credentials.username` to `credentials.id`, + `credentials.password` to `credentials.secret` and use Application Credential ID + and secret here. For more detail about credentials look + [here](https://docs.openstack.org/api-ref/identity/v3/?expanded=password-authentication-with-unscoped-authorization-detail,authenticating-with-an-application-credential-detail#authenticating-with-an-application-credential). + + ##### Step 2: Remove the unused keys + + Since the new SDK doesn't use the old way authentication, we don't need the keys + `openStackSwift.keystoneAuthVersion`, `openStackSwift.domainId`, + `openStackSwift.domainName` and `openStackSwift.region`. So you can remove them. + + ##### Step 3: Add Swift URL + + The new SDK needs the OpenStack Swift connection URL for connecting the Swift. + So you need to add a new key called `openStackSwift.swiftUrl` and give the + OpenStack Swift url here. Example url should look like that: + `https://example.com:6780/swift/v1` + + ##### That's it! + + Your new configuration should look like that! + + ```yaml + techdocs: + publisher: + type: 'openStackSwift' + openStackSwift: + containerName: 'name-of-techdocs-storage-bucket' + credentials: + id: ${OPENSTACK_SWIFT_STORAGE_APPLICATION_CREDENTIALS_ID} + secret: ${OPENSTACK_SWIFT_STORAGE_APPLICATION_CREDENTIALS_SECRET} + authUrl: ${OPENSTACK_SWIFT_STORAGE_AUTH_URL} + swiftUrl: ${OPENSTACK_SWIFT_STORAGE_SWIFT_URL} + ``` + +- c772d9a84: TechDocs sites can now be accessed using paths containing entity triplets of + any case (e.g. `/docs/namespace/KIND/name` or `/docs/namespace/kind/name`). + + If you do not use an external storage provider for serving TechDocs, this is a + transparent change and no action is required from you. + + If you _do_ use an external storage provider for serving TechDocs (one of\* GCS, + AWS S3, or Azure Blob Storage), you must run a migration command against your + storage provider before updating. + + [A migration guide is available here](https://backstage.io/docs/features/techdocs/how-to-guides#how-to-migrate-from-techdocs-alpha-to-beta). + + - (\*) We're seeking help from the community to bring OpenStack Swift support + [to feature parity](https://github.com/backstage/backstage/issues/6763) with the above. + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.9.0 + - @backstage/integration@0.6.2 + - @backstage/config@0.1.8 + +## 0.8.1 + +### Patch Changes + +- bc405be6e: Stale TechDocs content (files that had previously been published but which have + since been removed) is now removed from storage at publish-time. This is now + supported by the following publishers: + + - Google GCS + - AWS S3 + - Azure Blob Storage + + You may need to apply a greater level of permissions (e.g. the ability to + delete objects in your storage provider) to any credentials/accounts used by + the TechDocs CLI or TechDocs backend in order for this change to take effect. + + For more details, see [#6132][issue-ref]. + + [issue-ref]: https://github.com/backstage/backstage/issues/6132 + +- Updated dependencies + - @backstage/integration@0.6.0 + - @backstage/backend-common@0.8.9 + +## 0.8.0 + +### Minor Changes + +- 48ea3d25b: TechDocs has dropped all support for the long-ago deprecated git-based common + prepares as well as all corresponding values in `backstage.io/techdocs-ref` + annotations. + + Entities whose `backstage.io/techdocs-ref` annotation values still begin with + `github:`, `gitlab:`, `bitbucket:`, or `azure/api:` will no longer be generated + by TechDocs. Be sure to update these values so that they align with their + expected format and your usage of TechDocs. + + For details, see [this explainer on TechDocs ref annotation values][how]. + + [how]: https://backstage.io/docs/features/techdocs/how-to-guides#how-to-understand-techdocs-ref-annotation-values + +### Patch Changes + +- Updated dependencies + - @backstage/backend-common@0.8.8 + - @backstage/config@0.1.6 + - @backstage/integration@0.5.9 + +## 0.7.1 + +### Patch Changes + +- 59a5fa319: Migrated files are now printed when `techdocs-cli migrate` is run with the + `--verbose` flag set. +- 54356336e: TechDocs generator stage now supports `mkdocs.yaml` file, in addition to `.yml` + depending on whichever is present at the time of generation. (Assumes the + latest `spotify/techdocs` container, running mkdocs `v1.2.2` or greater). + +## 0.7.0 + +### Minor Changes + +- d32d01e5b: Improve the annotation `backstage.io/techdocs-ref: dir:` that links to a path that is relative to the source of the annotated entity. + This annotation works with the basic and the recommended flow, however, it will be most useful with the basic approach. + + This change remove the deprecation of the `dir` reference and provides first-class support for it. + In addition, this change removes the support of the deprecated `github`, `gitlab`, and `azure/api` locations from the `dir` reference preparer. + + #### Example Usage + + The annotation is convenient if the documentation is stored in the same location, i.e. the same git repository, as the `catalog-info.yaml`. + While it is still supported to add full URLs such as `backstage.io/techdocs-ref: url:https://...` for custom setups, documentation is mostly stored in the same repository as the entity definition. + By automatically resolving the target relative to the registration location of the entity, the configuration overhead for this default setup is minimized. + Since it leverages the `@backstage/integrations` package for the URL resolution, this is compatible with every supported source. + + Consider the following examples: + + 1. "I have a repository with a single `catalog-info.yaml` and a TechDocs page in the root folder!" + + ``` + https://github.com/backstage/example/tree/main/ + |- catalog-info.yaml + | > apiVersion: backstage.io/v1alpha1 + | > kind: Component + | > metadata: + | > name: example + | > annotations: + | > backstage.io/techdocs-ref: dir:. # -> same folder + | > spec: {} + |- docs/ + |- mkdocs.yml + ``` + + 2. "I have a repository with a single `catalog-info.yaml` and my TechDocs page in located in a folder!" + + ``` + https://bitbucket.org/my-owner/my-project/src/master/ + |- catalog-info.yaml + | > apiVersion: backstage.io/v1alpha1 + | > kind: Component + | > metadata: + | > name: example + | > annotations: + | > backstage.io/techdocs-ref: dir:./some-folder # -> subfolder + | > spec: {} + |- some-folder/ + |- docs/ + |- mkdocs.yml + ``` + + 3. "I have a mono repository that hosts multiple components!" + + ``` + https://dev.azure.com/organization/project/_git/repository + |- my-1st-module/ + |- catalog-info.yaml + | > apiVersion: backstage.io/v1alpha1 + | > kind: Component + | > metadata: + | > name: my-1st-module + | > annotations: + | > backstage.io/techdocs-ref: dir:. # -> same folder + | > spec: {} + |- docs/ + |- mkdocs.yml + |- my-2nd-module/ + |- catalog-info.yaml + | > apiVersion: backstage.io/v1alpha1 + | > kind: Component + | > metadata: + | > name: my-2nd-module + | > annotations: + | > backstage.io/techdocs-ref: dir:. # -> same folder + | > spec: {} + |- docs/ + |- mkdocs.yml + |- catalog-info.yaml + | > apiVersion: backstage.io/v1alpha1 + | > kind: Location + | > metadata: + | > name: example + | > spec: + | > targets: + | > - ./*/catalog-info.yaml + ``` + +### Patch Changes + +- 6e5aed1c9: Fix validation of mkdocs.yml docs_dir +- 250984333: Add link to https://backstage.io/docs/features/techdocs/configuration in the log warning message about updating techdocs.generate key. +- Updated dependencies + - @backstage/backend-common@0.8.7 + +## 0.6.8 + +### Patch Changes + +- d5eaab91d: Adds custom docker image support to the techdocs generator. This change adds a new `techdocs.generator` configuration key and deprecates the existing `techdocs.generators.techdocs` key. + + ```yaml + techdocs: + # recommended, going forward: + generator: + runIn: 'docker' # or 'local' + # New optional settings + dockerImage: my-org/techdocs # use a custom docker image + pullImage: false # disable automatic pulling of image (e.g. if custom docker login is required) + # legacy (deprecated): + generators: + techdocs: 'docker' # or 'local' + ``` + +- c18e8eb91: Provide optional `logger: Logger` and `logStream: Writable` arguments to the `GeneratorBase#run(...)` command. + They receive all log messages that are emitted during the generator run. +- ae84b20cf: Revert the upgrade to `fs-extra@10.0.0` as that seemed to have broken all installs inexplicably. +- Updated dependencies + - @backstage/backend-common@0.8.6 + +## 0.6.7 + +### Patch Changes + +- 683308ecf: Fix openStack swift publisher encoding issue. Remove utf8 forced encoding on binary files +- 6841e0113: fix minor version of git-url-parse as 11.5.x introduced a bug for Bitbucket Server +- Updated dependencies + - @backstage/integration@0.5.8 + - @backstage/catalog-model@0.9.0 + - @backstage/backend-common@0.8.5 + +## 0.6.6 + +### Patch Changes + +- ab5cc376f: Use new utilities from `@backstage/backend-common` for safely resolving child paths +- b47fc34bc: Update "service catalog" references to "software catalog" +- Updated dependencies + - @backstage/backend-common@0.8.4 + - @backstage/integration@0.5.7 + +## 0.6.5 + +### Patch Changes + +- c17c0fcf9: Adding additional checks on tech docs to prevent folder traversal via mkdocs.yml docs_dir value. +- Updated dependencies + - @backstage/catalog-model@0.8.4 + +## 0.6.4 + +### Patch Changes + +- aad98c544: Fixes multiple XSS and sanitization bypass vulnerabilities in TechDocs. +- 090594755: Support parsing `mkdocs.yml` files that are using custom yaml tags like + `!!python/name:materialx.emoji.twemoji`. +- Updated dependencies [ebe802bc4] +- Updated dependencies [49d7ec169] + - @backstage/catalog-model@0.8.1 + - @backstage/integration@0.5.5 + +## 0.6.3 + +### Patch Changes + +- 8cefadca0: Adding validation to mkdocs.yml parsing to prevent directory tree traversing +- Updated dependencies [0fd4ea443] +- Updated dependencies [add62a455] +- Updated dependencies [704875e26] + - @backstage/integration@0.5.4 + - @backstage/catalog-model@0.8.0 + +## 0.6.2 + +### Patch Changes + +- 65e6c4541: Remove circular dependencies +- Updated dependencies [f7f7783a3] +- Updated dependencies [c7dad9218] +- Updated dependencies [65e6c4541] +- Updated dependencies [68fdbf014] +- Updated dependencies [5001de908] + - @backstage/catalog-model@0.7.10 + - @backstage/backend-common@0.8.1 + - @backstage/integration@0.5.3 + +## 0.6.1 + +### Patch Changes + +- e04f1ccfb: Fixed a bug that prevented loading static assets from GCS, S3, Azure, and OpenStackSwift whose keys contain spaces or other special characters. +- Updated dependencies [22fd8ce2a] +- Updated dependencies [10c008a3a] +- Updated dependencies [f9fb4a205] +- Updated dependencies [16be1d093] + - @backstage/backend-common@0.8.0 + - @backstage/catalog-model@0.7.9 + +## 0.6.0 + +### Minor Changes + +- e0bfd3d44: Migrate the package to use the `ContainerRunner` interface instead of `runDockerContainer(…)`. + It also no longer provides the `ContainerRunner` as an input to the `GeneratorBase#run(…)` function, but expects it as a constructor parameter instead. + + If you use the `TechdocsGenerator` you need to update the usage: + + ```diff + + const containerRunner = new DockerContainerRunner({ dockerClient }); + + - const generator = new TechdocsGenerator(logger, config); + + const techdocsGenerator = new TechdocsGenerator({ + + logger, + + containerRunner, + + config, + + }); + + await this.generator.run({ + inputDir: preparedDir, + outputDir, + - dockerClient: this.dockerClient, + parsedLocationAnnotation, + etag: newEtag, + }); + ``` + +### Patch Changes + +- e9e56b01a: Adding optional config to enable S3-like API for tech-docs using s3ForcePathStyle option. + This allows providers like LocalStack, Minio and Wasabi (+possibly others) to be used to host tech docs. +- Updated dependencies [e0bfd3d44] +- Updated dependencies [38ca05168] +- Updated dependencies [d8b81fd28] + - @backstage/backend-common@0.7.0 + - @backstage/integration@0.5.2 + - @backstage/catalog-model@0.7.8 + - @backstage/config@0.1.5 + +## 0.5.1 + +### Patch Changes + +- f4af06ebe: Gracefully handle HTTP request failures in download method of AzureBlobStorage publisher. + +## 0.5.0 + +### Minor Changes + +- bc9d62f4f: Move the sanity checks of the publisher configurations to a dedicated `PublisherBase#getReadiness()` method instead of throwing an error when doing `Publisher.fromConfig(...)`. + You should include the check when your backend to get early feedback about a potential misconfiguration: + + ```diff + // packages/backend/src/plugins/techdocs.ts + + export default async function createPlugin({ + logger, + config, + discovery, + reader, + }: PluginEnvironment): Promise { + // ... + + const publisher = await Publisher.fromConfig(config, { + logger, + discovery, + }) + + + // checks if the publisher is working and logs the result + + await publisher.getReadiness(); + + // Docker client (conditionally) used by the generators, based on techdocs.generators config. + const dockerClient = new Docker(); + + // ... + } + ``` + + If you want to crash your application on invalid configurations, you can throw an `Error` to preserve the old behavior. + Please be aware that this is not the recommended for the use in a Backstage backend but might be helpful in CLI tools such as the `techdocs-cli`. + + ```ts + const publisher = await Publisher.fromConfig(config, { + logger, + discovery, + }); + + const ready = await publisher.getReadiness(); + if (!ready.isAvailable) { + throw new Error('Invalid TechDocs publisher configuration'); + } + ``` + +### Patch Changes + +- Updated dependencies [bb5055aee] +- Updated dependencies [5d0740563] + - @backstage/catalog-model@0.7.7 + +## 0.4.5 + +### Patch Changes + +- 8686eb38c: Use errors from `@backstage/errors` +- 424742dc1: Applies only if you use TechDocs local builder instead of building on CI/CD i.e. if `techdocs.builder` in your `app-config.yaml` is set to `'local'` + + Improvements + + 1. Do not check for updates in the repository if a check has been made in the last 60 seconds. This is to prevent the annoying check for update on every page switch or load. + 2. No need to maintain an in-memory etag storage, and use the one stored in `techdocs_metadata.json` file alongside generated docs. + + New feature + + 1. You can now use a mix of basic and recommended setup i.e. `techdocs.builder` is `'local'` but using an external cloud storage instead of local storage. Previously, in this setup, the docs would never get updated. + +- Updated dependencies [8686eb38c] +- Updated dependencies [0434853a5] +- Updated dependencies [8686eb38c] + - @backstage/backend-common@0.6.0 + - @backstage/config@0.1.4 + +## 0.4.4 + +### Patch Changes + +- d7245b733: Remove runDockerContainer, and start using the utility function provided by @backstage/backend-common +- 0b42fff22: Make use of parseLocationReference/stringifyLocationReference +- 2ef5bc7ea: Implement proper AWS Credentials precedence with assume-role and explicit credentials +- aa095e469: OpenStack Swift publisher added for tech-docs. +- bc46435f5: - Improve deprecation warning messaging in logs. + - Replace temp folder path from git provider domain(`source`) to full git host name (`resource`). (See: https://github.com/IonicaBizau/git-url-parse#giturlparseurl) +- a501128db: Refactor log messaging to improve clarity +- ca4a904f6: Add an optional configuration option for setting the url endpoint for AWS S3 publisher: `techdocs.publisher.awsS3.endpoint` +- Updated dependencies [277644e09] +- Updated dependencies [52f613030] +- Updated dependencies [d7245b733] +- Updated dependencies [0b42fff22] +- Updated dependencies [905cbfc96] +- Updated dependencies [761698831] +- Updated dependencies [d4e77ec5f] + - @backstage/integration@0.5.1 + - @backstage/backend-common@0.5.6 + - @backstage/catalog-model@0.7.4 + +## 0.4.3 + +### Patch Changes + +- f43192207: remove usage of res.send() for res.json() and res.end() to ensure content types are more consistently application/json on backend responses and error cases +- 61299519f: Remove read-store-upload loop when uploading S3 objects for TechDocs +- Updated dependencies [12d8f27a6] +- Updated dependencies [497859088] +- Updated dependencies [8adb48df4] + - @backstage/catalog-model@0.7.3 + - @backstage/backend-common@0.5.5 + +## 0.4.2 + +### Patch Changes + +- 2499f6cde: Add support for assuming role in AWS integrations +- 1e4ddd71d: Fix AWS, GCS and Azure publisher to work on Windows. +- Updated dependencies [bad21a085] +- Updated dependencies [a1f5e6545] + - @backstage/catalog-model@0.7.2 + - @backstage/config@0.1.3 + +## 0.4.1 + +### Patch Changes + +- fb28da212: Switched to using `'x-access-token'` for authenticating Git over HTTPS towards GitHub. +- 26e143e60: After TechDocs generate step, insert build timestamp to techdocs_metadata.json +- c6655413d: Improved error reporting in AzureBlobStorage to surface errors when fetching metadata and uploading files fails. +- 44414239f: Pass user and group ID when invoking docker container. When TechDocs invokes Docker, docker could be run as a `root` user which results in generation of files by applications run by non-root user (e.g. TechDocs) will not have access to modify. This PR passes in current user and group ID to docker so that the file permissions of the generated files and folders are correct. +- b0a41c707: Add etag of the prepared file tree to techdocs_metadata.json in the storage +- Updated dependencies [16fb1d03a] +- Updated dependencies [491f3a0ec] +- Updated dependencies [491f3a0ec] +- Updated dependencies [434b4e81a] +- Updated dependencies [fb28da212] + - @backstage/backend-common@0.5.4 + - @backstage/integration@0.5.0 + +## 0.4.0 + +### Minor Changes + +- 08142b256: URL Preparer will now use proper etag based caching introduced in https://github.com/backstage/backstage/pull/4120. Previously, builds used to be cached for 30 minutes. + +### Patch Changes + +- 77ad0003a: Revert AWS SDK version to v2 +- 08142b256: TechDocs will throw warning in backend logs when legacy git preparer or dir preparer is used to preparer docs. Migrate to URL Preparer by updating `backstage.io/techdocs-ref` annotation to be prefixed with `url:`. + Detailed docs are here https://backstage.io/docs/features/techdocs/how-to-guides#how-to-use-url-reader-in-techdocs-prepare-step + See benefits and reason for doing so https://github.com/backstage/backstage/issues/4409 +- Updated dependencies [ffffea8e6] +- Updated dependencies [82b2c11b6] +- Updated dependencies [965e200c6] +- Updated dependencies [ffffea8e6] +- Updated dependencies [5a5163519] + - @backstage/backend-common@0.5.3 + - @backstage/integration@0.4.0 + +## 0.3.7 + +### Patch Changes + +- c777df180: 1. Added option to use Azure Blob Storage as a choice to store the static generated files for TechDocs. +- e44925723: `techdocs.requestUrl` and `techdocs.storageUrl` are now optional configs and the discovery API will be used to get the URL where techdocs plugin is hosted. +- f0320190d: dir preparer will use URL Reader in its implementation. +- Updated dependencies [c4abcdb60] +- Updated dependencies [2430ee7c2] +- Updated dependencies [6e612ce25] +- Updated dependencies [025e122c3] +- Updated dependencies [064c513e1] +- Updated dependencies [7881f2117] +- Updated dependencies [3149bfe63] +- Updated dependencies [2e62aea6f] +- Updated dependencies [11cb5ef94] + - @backstage/integration@0.3.2 + - @backstage/backend-common@0.5.2 + - @backstage/catalog-model@0.7.1 + +## 0.3.6 + +### Patch Changes + +- 9dd057662: Upgrade [git-url-parse](https://www.npmjs.com/package/git-url-parse) to [v11.4.4](https://github.com/IonicaBizau/git-url-parse/pull/125) which fixes parsing an Azure DevOps branch ref. +- db2328c88: Add rate limiter for concurrent execution of file uploads in AWS and Google publishers +- Updated dependencies [26a3a6cf0] +- Updated dependencies [664dd08c9] +- Updated dependencies [6800da78d] +- Updated dependencies [9dd057662] + - @backstage/backend-common@0.5.1 + - @backstage/integration@0.3.1 + +## 0.3.5 + +### Patch Changes + +- 53c9c51f2: TechDocs backend now streams files through from Google Cloud Storage to the browser, improving memory usage. +- a5e27d5c1: Create type for TechDocsMetadata (#3716) + + This change introduces a new type (TechDocsMetadata) in packages/techdocs-common. This type is then introduced in the endpoint response in techdocs-backend and in the api interface in techdocs (frontend). + +- Updated dependencies [def2307f3] +- Updated dependencies [0b135e7e0] +- Updated dependencies [294a70cab] +- Updated dependencies [fa8ba330a] +- Updated dependencies [0ea032763] +- Updated dependencies [5345a1f98] +- Updated dependencies [ed6baab66] +- Updated dependencies [09a370426] +- Updated dependencies [a93f42213] + - @backstage/catalog-model@0.7.0 + - @backstage/backend-common@0.5.0 + - @backstage/integration@0.3.0 + +## 0.3.4 + +### Patch Changes + +- a594a7257: @backstage/techdocs-common can now be imported in an environment without @backstage/plugin-techdocs-backend being installed. + +## 0.3.3 + +### Patch Changes + +- 68ad5af51: Improve techdocs-common Generator API for it to be used by techdocs-cli. TechDocs generator.run function now takes + an input AND an output directory. Most probably you use techdocs-common via plugin-techdocs-backend, and so there + is no breaking change for you. + But if you use techdocs-common separately, you need to create an output directory and pass into the generator. +- 371f67ecd: fix to-string breakage of binary files +- f1e74777a: Fix bug where binary files (`png`, etc.) could not load when using AWS or GCS publisher. +- dbe4450c3: Google Cloud authentication in TechDocs has been improved. + + 1. `techdocs.publisher.googleGcs.credentials` is now optional. If it is missing, `GOOGLE_APPLICATION_CREDENTIALS` + environment variable (and some other methods) will be used to authenticate. + Read more here https://cloud.google.com/docs/authentication/production + + 2. `techdocs.publisher.googleGcs.projectId` is no longer used. You can remove it from your `app-config.yaml`. + +- 5826d0973: AWS SDK version bump for TechDocs. +- b3b9445df: AWS S3 authentication in TechDocs has been improved. + + 1. `techdocs.publisher.awsS3.bucketName` is now the only required config. `techdocs.publisher.awsS3.credentials` and `techdocs.publisher.awsS3.region` are optional. + + 2. If `techdocs.publisher.awsS3.credentials` and `techdocs.publisher.awsS3.region` are missing, the AWS environment variables `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_REGION` will be used. There are more better ways of setting up AWS authentication. Read the guide at https://backstage.io/docs/features/techdocs/using-cloud-storage + +- Updated dependencies [466354aaa] +- Updated dependencies [f3b064e1c] +- Updated dependencies [abbee6fff] +- Updated dependencies [147fadcb9] + - @backstage/integration@0.2.0 + - @backstage/catalog-model@0.6.1 + - @backstage/backend-common@0.4.3 + +## 0.3.2 + +### Patch Changes + +- 7ec525481: 1. Added option to use AWS S3 as a choice to store the static generated files for TechDocs. +- f8ba88ded: Fix for `integration.github.apiBaseUrl` configuration not properly overriding apiBaseUrl used by techdocs +- 00042e73c: Moving the Git actions to isomorphic-git instead of the node binding version of nodegit +- Updated dependencies [5ecd50f8a] +- Updated dependencies [00042e73c] +- Updated dependencies [0829ff126] +- Updated dependencies [036a84373] + - @backstage/backend-common@0.4.2 + - @backstage/integration@0.1.5 + +## 0.3.1 + +### Patch Changes + +- 8804e8981: Using @backstage/integration package for GitHub/GitLab/Azure tokens and request options. + + Most probably you do not have to make any changes in the app because of this change. + However, if you are using the `DirectoryPreparer` or `CommonGitPreparer` exported by + `@backstage/techdocs-common` package, you now need to add pass in a `config` (from `@backstage/config`) + instance as argument. + + ``` + + const directoryPreparer = new DirectoryPreparer(logger); + const commonGitPreparer = new CommonGitPreparer(logger); + + const directoryPreparer = new DirectoryPreparer(config, logger); + const commonGitPreparer = new CommonGitPreparer(config, logger); + ``` + +## 0.3.0 + +### Minor Changes + +- a8573e53b: techdocs-backend: Simplified file, removing individual preparers and generators. + techdocs-backend: UrlReader is now available to use in preparers. + + In your Backstage app, `packages/backend/plugins/techdocs.ts` file has now been simplified, + to remove registering individual preparers and generators. + + Please update the file when upgrading the version of `@backstage/plugin-techdocs-backend` package. + + ```typescript + const preparers = await Preparers.fromConfig(config, { + logger, + reader, + }); + + const generators = await Generators.fromConfig(config, { + logger, + }); + + const publisher = await Publisher.fromConfig(config, { + logger, + discovery, + }); + ``` + + You should be able to remove unnecessary imports, and just do + + ```typescript + import { + createRouter, + Preparers, + Generators, + Publisher, + } from '@backstage/plugin-techdocs-backend'; + ``` + +## 0.2.0 + +### Minor Changes + +- dae4f3983: _Breaking changes_ + + 1. Added option to use Google Cloud Storage as a choice to store the static generated files for TechDocs. + It can be configured using `techdocs.publisher.type` option in `app-config.yaml`. + Step-by-step guide to configure GCS is available here https://backstage.io/docs/features/techdocs/using-cloud-storage + Set `techdocs.publisher.type` to `'local'` if you want to continue using local filesystem to store TechDocs files. + + 2. `techdocs.builder` is now required and can be set to `'local'` or `'external'`. (Set it to `'local'` for now, since CI/CD build + workflow for TechDocs will be available soon (in few weeks)). + If builder is set to 'local' and you open a TechDocs page, `techdocs-backend` will try to generate the docs, publish to storage and + show the generated docs afterwords. + If builder is set to `'external'`, `techdocs-backend` will only fetch the docs and will NOT try to generate and publish. In this case of `'external'`, + we assume that docs are being built in the CI/CD pipeline of the repository. + TechDocs will not assume a default value for `techdocs.builder`. It is better to explicitly define it in the `app-config.yaml`. + + 3. When configuring TechDocs in your backend, there is a difference in how a new publisher is created. + + ``` + --- const publisher = new LocalPublish(logger, discovery); + +++ const publisher = Publisher.fromConfig(config, logger, discovery); + ``` + + Based on the config `techdocs.publisher.type`, the publisher could be either Local publisher or Google Cloud Storage publisher. + + 4. `techdocs.storageUrl` is now a required config. Should be `http://localhost:7007/api/techdocs/static/docs` in most setups. + + 5. Parts of `@backstage/plugin-techdocs-backend` have been moved to a new package `@backstage/techdocs-common` to generate docs. Also to publish docs + to-and-fro between TechDocs and a storage (either local or external). However, a Backstage app does NOT need to import the `techdocs-common` package - + app should only import `@backstage/plugin-techdocs` and `@backstage/plugin-techdocs-backend`. + + _Patch changes_ + + 1. See all of TechDocs config options and its documentation https://backstage.io/docs/features/techdocs/configuration + + 2. Logic about serving static files and metadata retrieval have been abstracted away from the router in `techdocs-backend` to the instance of publisher. + + 3. Removed Material UI Spinner from TechDocs header. Spinners cause unnecessary UX distraction. + Case 1 (when docs are built and are to be served): Spinners appear for a split second before the name of site shows up. This unnecessarily distracts eyes because spinners increase the size of the Header. A dot (.) would do fine. Definitely more can be done. + Case 2 (when docs are being generated): There is already a linear progress bar (which is recommended in Storybook). + +### Patch Changes + +- Updated dependencies [c911061b7] +- Updated dependencies [1d1c2860f] +- Updated dependencies [0e6298f7e] +- Updated dependencies [4eafdec4a] +- Updated dependencies [ac3560b42] + - @backstage/catalog-model@0.6.0 + - @backstage/backend-common@0.4.1 diff --git a/packages/techdocs-common/README.md b/packages/techdocs-common/README.md new file mode 100644 index 0000000000..452b09b60b --- /dev/null +++ b/packages/techdocs-common/README.md @@ -0,0 +1,53 @@ +# @backstage/techdocs-common + +**WARNING**: This package is moving to `@backstage/plugin-techdocs-node`. +Please update any dependencies you may have, as this package will no longer be +published or updated in the near future. + +Common node.js functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli + +This package is used by `techdocs-backend` to serve docs from different types of publishers (Google GCS, Local, etc.). +It is also used to build docs and publish them to storage, by both `techdocs-backend` and `techdocs-cli`. + +## Usage + +Create a preparer instance from the [preparers available](/plugins/techdocs-node/src/stages/prepare) at which takes an Entity instance. +Run the [docs generator](/plugins/techdocs-node/src/stages/generate) on the prepared directory. +Publish the generated directory files to a [storage](/plugins/techdocs-node/src/stages/publish) of your choice. + +Example: + +```js +async () => { + const preparedDir = await preparer.prepare(entity); + + const parsedLocationAnnotation = getLocationForEntity(entity); + const { resultDir } = await generator.run({ + directory: preparedDir, + dockerClient: dockerClient, + parsedLocationAnnotation, + }); + + await publisher.publish({ + entity: entity, + directory: resultDir, + }); +}; +``` + +## Features + +Currently the build process is split up in these three stages. + +- Preparers +- Generators +- Publishers + +Preparers read your entity data and creates a working directory with your documentation source code. For example if you have set your `backstage.io/techdocs-ref` to `url:https://github.com/backstage/backstage.git` it will clone that repository to a temp folder and pass that on to the generator. + +Generators takes the prepared source and runs the `techdocs-container` on it. It then passes on the output folder of that build to the publisher. + +Publishers gets a folder path from the generator and publish it to your storage solution. Read documentation to know more about configuring storage solutions. +http://backstage.io/docs/features/techdocs/configuration + +Any of these can be extended. We want to extend our support to most of the storage providers (Publishers) and source code host providers (Preparers). diff --git a/packages/techdocs-common/api-report.md b/packages/techdocs-common/api-report.md new file mode 100644 index 0000000000..62851bbd68 --- /dev/null +++ b/packages/techdocs-common/api-report.md @@ -0,0 +1,9 @@ +## API Report File for "@backstage/techdocs-common" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +export * from '@backstage/plugin-techdocs-node'; + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/techdocs-common/package.json b/packages/techdocs-common/package.json new file mode 100644 index 0000000000..1d37974f29 --- /dev/null +++ b/packages/techdocs-common/package.json @@ -0,0 +1,51 @@ +{ + "name": "@backstage/techdocs-common", + "description": "Common node.js functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli", + "version": "0.11.11", + "main": "src/index.ts", + "types": "src/index.ts", + "private": false, + "publishConfig": { + "access": "public", + "main": "dist/index.cjs.js", + "types": "dist/index.d.ts" + }, + "backstage": { + "role": "node-library" + }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "packages/techdocs-common" + }, + "keywords": [ + "techdocs", + "backstage" + ], + "license": "Apache-2.0", + "files": [ + "dist" + ], + "scripts": { + "build": "backstage-cli package build", + "lint": "backstage-cli package lint", + "test": "backstage-cli package test", + "prepack": "backstage-cli package prepack", + "postpack": "backstage-cli package postpack", + "clean": "backstage-cli package clean", + "start": "backstage-cli package start" + }, + "bugs": { + "url": "https://github.com/backstage/backstage/issues" + }, + "dependencies": { + "@backstage/plugin-techdocs-node": "^0.11.11" + }, + "devDependencies": {}, + "jest": { + "roots": [ + ".." + ] + } +} diff --git a/packages/techdocs-common/src/index.ts b/packages/techdocs-common/src/index.ts new file mode 100644 index 0000000000..a881eef5ea --- /dev/null +++ b/packages/techdocs-common/src/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2020 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from '@backstage/plugin-techdocs-node'; From 6921edc6a04798bdeafb4afe9f928c3083fb7f80 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 3 Mar 2022 16:14:32 +0100 Subject: [PATCH 4/6] Move packages/search-common -> plugins/search-common Signed-off-by: Eric Peterson --- {packages => plugins}/search-common/.eslintrc.js | 0 {packages => plugins}/search-common/CHANGELOG.md | 0 {packages => plugins}/search-common/README.md | 0 {packages => plugins}/search-common/api-report.md | 0 {packages => plugins}/search-common/package.json | 0 {packages => plugins}/search-common/src/index.test.ts | 0 {packages => plugins}/search-common/src/index.ts | 0 {packages => plugins}/search-common/src/types.ts | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename {packages => plugins}/search-common/.eslintrc.js (100%) rename {packages => plugins}/search-common/CHANGELOG.md (100%) rename {packages => plugins}/search-common/README.md (100%) rename {packages => plugins}/search-common/api-report.md (100%) rename {packages => plugins}/search-common/package.json (100%) rename {packages => plugins}/search-common/src/index.test.ts (100%) rename {packages => plugins}/search-common/src/index.ts (100%) rename {packages => plugins}/search-common/src/types.ts (100%) diff --git a/packages/search-common/.eslintrc.js b/plugins/search-common/.eslintrc.js similarity index 100% rename from packages/search-common/.eslintrc.js rename to plugins/search-common/.eslintrc.js diff --git a/packages/search-common/CHANGELOG.md b/plugins/search-common/CHANGELOG.md similarity index 100% rename from packages/search-common/CHANGELOG.md rename to plugins/search-common/CHANGELOG.md diff --git a/packages/search-common/README.md b/plugins/search-common/README.md similarity index 100% rename from packages/search-common/README.md rename to plugins/search-common/README.md diff --git a/packages/search-common/api-report.md b/plugins/search-common/api-report.md similarity index 100% rename from packages/search-common/api-report.md rename to plugins/search-common/api-report.md diff --git a/packages/search-common/package.json b/plugins/search-common/package.json similarity index 100% rename from packages/search-common/package.json rename to plugins/search-common/package.json diff --git a/packages/search-common/src/index.test.ts b/plugins/search-common/src/index.test.ts similarity index 100% rename from packages/search-common/src/index.test.ts rename to plugins/search-common/src/index.test.ts diff --git a/packages/search-common/src/index.ts b/plugins/search-common/src/index.ts similarity index 100% rename from packages/search-common/src/index.ts rename to plugins/search-common/src/index.ts diff --git a/packages/search-common/src/types.ts b/plugins/search-common/src/types.ts similarity index 100% rename from packages/search-common/src/types.ts rename to plugins/search-common/src/types.ts From 3e54f6c436dba323a468b08811d41a15172d63e5 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 3 Mar 2022 17:02:37 +0100 Subject: [PATCH 5/6] Use @backstage/plugin-search-common instead of @backstage/search-common Signed-off-by: Eric Peterson --- .changeset/search-wellington-paranormal.md | 13 +++++++++++++ docs/features/search/README.md | 2 +- docs/features/search/how-to-guides.md | 2 +- packages/app/package.json | 2 +- plugins/catalog-backend/api-report.md | 2 +- plugins/catalog-backend/package.json | 2 +- .../src/search/DefaultCatalogCollatorFactory.ts | 2 +- plugins/catalog/api-report.md | 2 +- plugins/catalog/package.json | 2 +- .../CatalogSearchResultListItem.tsx | 2 +- .../api-report.md | 8 ++++---- .../package.json | 2 +- .../src/engines/ElasticSearchSearchEngine.ts | 2 +- .../engines/ElasticSearchSearchEngineIndexer.ts | 2 +- plugins/search-backend-module-pg/api-report.md | 6 +++--- plugins/search-backend-module-pg/package.json | 2 +- .../src/PgSearchEngine/PgSearchEngine.ts | 2 +- .../src/PgSearchEngine/PgSearchEngineIndexer.ts | 2 +- .../src/database/DatabaseDocumentStore.test.ts | 2 +- .../src/database/DatabaseDocumentStore.ts | 2 +- .../src/database/types.ts | 2 +- plugins/search-backend-node/api-report.md | 16 ++++++++-------- plugins/search-backend-node/package.json | 2 +- .../search-backend-node/src/IndexBuilder.test.ts | 2 +- plugins/search-backend-node/src/IndexBuilder.ts | 2 +- .../src/engines/LunrSearchEngine.test.ts | 5 ++++- .../src/engines/LunrSearchEngine.ts | 2 +- .../src/engines/LunrSearchEngineIndexer.ts | 2 +- plugins/search-backend-node/src/index.ts | 4 ++-- .../indexing/BatchSearchEngineIndexer.test.ts | 2 +- .../src/indexing/BatchSearchEngineIndexer.ts | 2 +- .../src/indexing/DecoratorBase.test.ts | 2 +- .../src/indexing/DecoratorBase.ts | 2 +- .../src/test-utils/TestPipeline.ts | 2 +- plugins/search-backend-node/src/types.ts | 2 +- plugins/search-backend/api-report.md | 2 +- plugins/search-backend/package.json | 2 +- .../src/service/AuthorizedSearchEngine.test.ts | 2 +- .../src/service/AuthorizedSearchEngine.ts | 2 +- plugins/search-backend/src/service/router.ts | 5 ++++- plugins/search-common/CHANGELOG.md | 2 +- plugins/search-common/README.md | 2 +- plugins/search-common/api-report.md | 2 +- plugins/search-common/package.json | 4 ++-- plugins/search/api-report.md | 8 ++++---- plugins/search/package.json | 2 +- plugins/search/src/apis.ts | 2 +- .../DefaultResultListItem.tsx | 2 +- .../components/SearchContext/SearchContext.tsx | 2 +- .../SearchContextForStorybook.stories.tsx | 2 +- .../src/components/SearchResult/SearchResult.tsx | 2 +- plugins/techdocs-backend/api-report.md | 2 +- plugins/techdocs-backend/package.json | 2 +- .../src/search/DefaultTechDocsCollatorFactory.ts | 2 +- plugins/techdocs-node/api-report.md | 2 +- plugins/techdocs-node/package.json | 2 +- plugins/techdocs-node/src/techdocsTypes.ts | 2 +- scripts/api-extractor.ts | 1 + yarn.lock | 2 +- 59 files changed, 94 insertions(+), 74 deletions(-) create mode 100644 .changeset/search-wellington-paranormal.md diff --git a/.changeset/search-wellington-paranormal.md b/.changeset/search-wellington-paranormal.md new file mode 100644 index 0000000000..7cd1ead2e8 --- /dev/null +++ b/.changeset/search-wellington-paranormal.md @@ -0,0 +1,13 @@ +--- +'@backstage/plugin-catalog-backend': patch +'@backstage/plugin-catalog': patch +'@backstage/plugin-search-backend-module-elasticsearch': patch +'@backstage/plugin-search-backend-module-pg': patch +'@backstage/plugin-search-backend-node': patch +'@backstage/plugin-search-backend': patch +'@backstage/plugin-search': patch +'@backstage/plugin-techdocs-backend': patch +'@backstage/plugin-techdocs-node': patch +--- + +Use `@backstage/plugin-search-common` package instead of `@backstage/search-common`. diff --git a/docs/features/search/README.md b/docs/features/search/README.md index 0856451882..f5533927fa 100644 --- a/docs/features/search/README.md +++ b/docs/features/search/README.md @@ -128,7 +128,7 @@ plugins integrated to search. | Frontend Plugin | @backstage/plugin-search | | Backend Plugin | @backstage/plugin-search-backend | | Indexer Plugin | @backstage/plugin-search-backend-node | -| Common Code | @backstage/search-common | +| Common Code | @backstage/plugin-search-common | ## Get Involved diff --git a/docs/features/search/how-to-guides.md b/docs/features/search/how-to-guides.md index ac36d64673..f1d06f38f5 100644 --- a/docs/features/search/how-to-guides.md +++ b/docs/features/search/how-to-guides.md @@ -365,7 +365,7 @@ implement the factory method that instantiates the stream: ```ts import { BatchSearchEngineIndexer } from '@backstage/plugin-search-backend-node'; -import { SearchEngine } from '@backstage/search-common'; +import { SearchEngine } from '@backstage/plugin-search-common'; export class YourSearchEngineIndexer extends BatchSearchEngineIndexer { constructor({ type }: { type: string }) { // Customize the number of documents passed to the index method per batch. diff --git a/packages/app/package.json b/packages/app/package.json index d272b88e52..45cde6df52 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -46,13 +46,13 @@ "@backstage/plugin-rollbar": "^0.4.1", "@backstage/plugin-scaffolder": "^0.14.0", "@backstage/plugin-search": "^0.7.2", + "@backstage/plugin-search-common": "^0.3.0", "@backstage/plugin-sentry": "^0.3.39", "@backstage/plugin-shortcuts": "^0.2.2", "@backstage/plugin-tech-radar": "^0.5.8", "@backstage/plugin-techdocs": "^0.15.0", "@backstage/plugin-todo": "^0.2.3", "@backstage/plugin-user-settings": "^0.4.0", - "@backstage/search-common": "^0.3.0", "@backstage/plugin-tech-insights": "^0.1.11", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.12.2", diff --git a/plugins/catalog-backend/api-report.md b/plugins/catalog-backend/api-report.md index 0d9f306009..09f3e4b9d9 100644 --- a/plugins/catalog-backend/api-report.md +++ b/plugins/catalog-backend/api-report.md @@ -12,7 +12,7 @@ import { CompoundEntityRef } from '@backstage/catalog-model'; import { ConditionalPolicyDecision } from '@backstage/plugin-permission-node'; import { Conditions } from '@backstage/plugin-permission-node'; import { Config } from '@backstage/config'; -import { DocumentCollatorFactory } from '@backstage/search-common'; +import { DocumentCollatorFactory } from '@backstage/plugin-search-common'; import { Entity } from '@backstage/catalog-model'; import { EntityPolicy } from '@backstage/catalog-model'; import express from 'express'; diff --git a/plugins/catalog-backend/package.json b/plugins/catalog-backend/package.json index a1404189f8..9b8e6347a5 100644 --- a/plugins/catalog-backend/package.json +++ b/plugins/catalog-backend/package.json @@ -44,7 +44,7 @@ "@backstage/plugin-permission-common": "^0.5.2", "@backstage/plugin-permission-node": "^0.5.3", "@backstage/plugin-scaffolder-common": "^0.2.3", - "@backstage/search-common": "^0.3.0", + "@backstage/plugin-search-common": "^0.3.0", "@backstage/types": "^0.1.3", "@octokit/graphql": "^4.5.8", "@types/express": "^4.17.6", diff --git a/plugins/catalog-backend/src/search/DefaultCatalogCollatorFactory.ts b/plugins/catalog-backend/src/search/DefaultCatalogCollatorFactory.ts index 440a8c8ebb..4d28559c82 100644 --- a/plugins/catalog-backend/src/search/DefaultCatalogCollatorFactory.ts +++ b/plugins/catalog-backend/src/search/DefaultCatalogCollatorFactory.ts @@ -29,7 +29,7 @@ import { UserEntity, } from '@backstage/catalog-model'; import { Config } from '@backstage/config'; -import { DocumentCollatorFactory } from '@backstage/search-common'; +import { DocumentCollatorFactory } from '@backstage/plugin-search-common'; import { catalogEntityReadPermission, CatalogEntityDocument, diff --git a/plugins/catalog/api-report.md b/plugins/catalog/api-report.md index 97a36ad020..4dd5e7c32e 100644 --- a/plugins/catalog/api-report.md +++ b/plugins/catalog/api-report.md @@ -11,7 +11,7 @@ import { CompoundEntityRef } from '@backstage/catalog-model'; import { Entity } from '@backstage/catalog-model'; import { ExternalRouteRef } from '@backstage/core-plugin-api'; import { IconComponent } from '@backstage/core-plugin-api'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { InfoCardVariants } from '@backstage/core-components'; import { Observable } from '@backstage/types'; import { Overrides } from '@material-ui/core/styles/overrides'; diff --git a/plugins/catalog/package.json b/plugins/catalog/package.json index 0a8a4af58c..07477316fa 100644 --- a/plugins/catalog/package.json +++ b/plugins/catalog/package.json @@ -42,7 +42,7 @@ "@backstage/integration-react": "^0.1.24", "@backstage/plugin-catalog-common": "^0.2.0", "@backstage/plugin-catalog-react": "^0.8.0", - "@backstage/search-common": "^0.3.0", + "@backstage/plugin-search-common": "^0.3.0", "@backstage/theme": "^0.2.15", "@backstage/types": "^0.1.2", "@material-ui/core": "^4.12.2", diff --git a/plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx b/plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx index 54cfe43364..422841b134 100644 --- a/plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx +++ b/plugins/catalog/src/components/CatalogSearchResultListItem/CatalogSearchResultListItem.tsx @@ -24,7 +24,7 @@ import { makeStyles, } from '@material-ui/core'; import { Link } from '@backstage/core-components'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; const useStyles = makeStyles({ flexContainer: { diff --git a/plugins/search-backend-module-elasticsearch/api-report.md b/plugins/search-backend-module-elasticsearch/api-report.md index d4edcc6b25..50e5a61a14 100644 --- a/plugins/search-backend-module-elasticsearch/api-report.md +++ b/plugins/search-backend-module-elasticsearch/api-report.md @@ -9,11 +9,11 @@ import { BatchSearchEngineIndexer } from '@backstage/plugin-search-backend-node' import { Client } from '@elastic/elasticsearch'; import { Config } from '@backstage/config'; import type { ConnectionOptions } from 'tls'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { Logger as Logger_2 } from 'winston'; -import { SearchEngine } from '@backstage/search-common'; -import { SearchQuery } from '@backstage/search-common'; -import { SearchResultSet } from '@backstage/search-common'; +import { SearchEngine } from '@backstage/plugin-search-common'; +import { SearchQuery } from '@backstage/plugin-search-common'; +import { SearchResultSet } from '@backstage/plugin-search-common'; // Warning: (ae-missing-release-tag) "ElasticSearchClientOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // Warning: (ae-unresolved-link) The @link reference could not be resolved: The package "@backstage/plugin-search-backend-module-elasticsearch" does not have an export "ElasticSearchEngine" diff --git a/plugins/search-backend-module-elasticsearch/package.json b/plugins/search-backend-module-elasticsearch/package.json index f49c86f41f..b5d20038e8 100644 --- a/plugins/search-backend-module-elasticsearch/package.json +++ b/plugins/search-backend-module-elasticsearch/package.json @@ -24,8 +24,8 @@ }, "dependencies": { "@backstage/config": "^0.1.15", - "@backstage/search-common": "^0.3.0", "@backstage/plugin-search-backend-node": "^0.5.0", + "@backstage/plugin-search-common": "^0.3.0", "@elastic/elasticsearch": "7.13.0", "@acuris/aws-es-connection": "^2.2.0", "aws-sdk": "^2.948.0", diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts index c16567fee0..f2ed5ed2b0 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngine.ts @@ -24,7 +24,7 @@ import { SearchEngine, SearchQuery, SearchResultSet, -} from '@backstage/search-common'; +} from '@backstage/plugin-search-common'; import { Client } from '@elastic/elasticsearch'; import esb from 'elastic-builder'; import { isEmpty, isNaN as nan, isNumber } from 'lodash'; diff --git a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts index 2e4996cd2f..cb3674ddd1 100644 --- a/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts +++ b/plugins/search-backend-module-elasticsearch/src/engines/ElasticSearchSearchEngineIndexer.ts @@ -15,7 +15,7 @@ */ import { BatchSearchEngineIndexer } from '@backstage/plugin-search-backend-node'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { Client } from '@elastic/elasticsearch'; import { Readable } from 'stream'; import { Logger } from 'winston'; diff --git a/plugins/search-backend-module-pg/api-report.md b/plugins/search-backend-module-pg/api-report.md index ba8fde5f17..39847a4935 100644 --- a/plugins/search-backend-module-pg/api-report.md +++ b/plugins/search-backend-module-pg/api-report.md @@ -4,12 +4,12 @@ ```ts import { BatchSearchEngineIndexer } from '@backstage/plugin-search-backend-node'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { Knex } from 'knex'; import { PluginDatabaseManager } from '@backstage/backend-common'; import { SearchEngine } from '@backstage/plugin-search-backend-node'; -import { SearchQuery } from '@backstage/search-common'; -import { SearchResultSet } from '@backstage/search-common'; +import { SearchQuery } from '@backstage/plugin-search-common'; +import { SearchResultSet } from '@backstage/plugin-search-common'; // Warning: (ae-missing-release-tag) "ConcretePgSearchQuery" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/plugins/search-backend-module-pg/package.json b/plugins/search-backend-module-pg/package.json index fb95dff540..505bb53d09 100644 --- a/plugins/search-backend-module-pg/package.json +++ b/plugins/search-backend-module-pg/package.json @@ -24,8 +24,8 @@ }, "dependencies": { "@backstage/backend-common": "^0.12.0", - "@backstage/search-common": "^0.3.0", "@backstage/plugin-search-backend-node": "^0.5.0", + "@backstage/plugin-search-common": "^0.3.0", "lodash": "^4.17.21", "knex": "^1.0.2" }, diff --git a/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngine.ts b/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngine.ts index ac42007401..8f75112837 100644 --- a/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngine.ts +++ b/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngine.ts @@ -15,7 +15,7 @@ */ import { PluginDatabaseManager } from '@backstage/backend-common'; import { SearchEngine } from '@backstage/plugin-search-backend-node'; -import { SearchQuery, SearchResultSet } from '@backstage/search-common'; +import { SearchQuery, SearchResultSet } from '@backstage/plugin-search-common'; import { PgSearchEngineIndexer } from './PgSearchEngineIndexer'; import { DatabaseDocumentStore, diff --git a/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngineIndexer.ts b/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngineIndexer.ts index 53d040cb87..fa27509a69 100644 --- a/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngineIndexer.ts +++ b/plugins/search-backend-module-pg/src/PgSearchEngine/PgSearchEngineIndexer.ts @@ -15,7 +15,7 @@ */ import { BatchSearchEngineIndexer } from '@backstage/plugin-search-backend-node'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { Knex } from 'knex'; import { DatabaseStore } from '../database'; diff --git a/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.test.ts b/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.test.ts index 71c012ec00..b973c2e14f 100644 --- a/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.test.ts +++ b/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { TestDatabaseId, TestDatabases } from '@backstage/backend-test-utils'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { DatabaseDocumentStore } from './DatabaseDocumentStore'; describe('DatabaseDocumentStore', () => { diff --git a/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.ts b/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.ts index 0d3ee63ca4..33b2d0c0d6 100644 --- a/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.ts +++ b/plugins/search-backend-module-pg/src/database/DatabaseDocumentStore.ts @@ -14,7 +14,7 @@ * limitations under the License. */ import { resolvePackagePath } from '@backstage/backend-common'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { Knex } from 'knex'; import { DatabaseStore, diff --git a/plugins/search-backend-module-pg/src/database/types.ts b/plugins/search-backend-module-pg/src/database/types.ts index 0a0dc35682..7e87658745 100644 --- a/plugins/search-backend-module-pg/src/database/types.ts +++ b/plugins/search-backend-module-pg/src/database/types.ts @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { Knex } from 'knex'; export interface PgSearchQuery { diff --git a/plugins/search-backend-node/api-report.md b/plugins/search-backend-node/api-report.md index 37945c8902..44e2d0c92d 100644 --- a/plugins/search-backend-node/api-report.md +++ b/plugins/search-backend-node/api-report.md @@ -5,17 +5,17 @@ ```ts /// -import { DocumentCollatorFactory } from '@backstage/search-common'; -import { DocumentDecoratorFactory } from '@backstage/search-common'; -import { DocumentTypeInfo } from '@backstage/search-common'; -import { IndexableDocument } from '@backstage/search-common'; +import { DocumentCollatorFactory } from '@backstage/plugin-search-common'; +import { DocumentDecoratorFactory } from '@backstage/plugin-search-common'; +import { DocumentTypeInfo } from '@backstage/plugin-search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { Logger as Logger_2 } from 'winston'; import { default as lunr_2 } from 'lunr'; -import { QueryTranslator } from '@backstage/search-common'; +import { QueryTranslator } from '@backstage/plugin-search-common'; import { Readable } from 'stream'; -import { SearchEngine } from '@backstage/search-common'; -import { SearchQuery } from '@backstage/search-common'; -import { SearchResultSet } from '@backstage/search-common'; +import { SearchEngine } from '@backstage/plugin-search-common'; +import { SearchQuery } from '@backstage/plugin-search-common'; +import { SearchResultSet } from '@backstage/plugin-search-common'; import { Transform } from 'stream'; import { Writable } from 'stream'; diff --git a/plugins/search-backend-node/package.json b/plugins/search-backend-node/package.json index dc8d1046b1..793bfdf74a 100644 --- a/plugins/search-backend-node/package.json +++ b/plugins/search-backend-node/package.json @@ -24,7 +24,7 @@ }, "dependencies": { "@backstage/errors": "^0.2.2", - "@backstage/search-common": "^0.3.0", + "@backstage/plugin-search-common": "^0.3.0", "@types/lunr": "^2.3.3", "lodash": "^4.17.21", "lunr": "^2.3.9", diff --git a/plugins/search-backend-node/src/IndexBuilder.test.ts b/plugins/search-backend-node/src/IndexBuilder.test.ts index 95a2e1d439..6a32343205 100644 --- a/plugins/search-backend-node/src/IndexBuilder.test.ts +++ b/plugins/search-backend-node/src/IndexBuilder.test.ts @@ -18,7 +18,7 @@ import { getVoidLogger } from '@backstage/backend-common'; import { DocumentCollatorFactory, DocumentDecoratorFactory, -} from '@backstage/search-common'; +} from '@backstage/plugin-search-common'; import { Readable, Transform } from 'stream'; import { IndexBuilder } from './IndexBuilder'; import { LunrSearchEngine, SearchEngine } from './index'; diff --git a/plugins/search-backend-node/src/IndexBuilder.ts b/plugins/search-backend-node/src/IndexBuilder.ts index e0a059e303..6be4489127 100644 --- a/plugins/search-backend-node/src/IndexBuilder.ts +++ b/plugins/search-backend-node/src/IndexBuilder.ts @@ -19,7 +19,7 @@ import { DocumentDecoratorFactory, DocumentTypeInfo, SearchEngine, -} from '@backstage/search-common'; +} from '@backstage/plugin-search-common'; import { Transform, pipeline } from 'stream'; import { Logger } from 'winston'; import { Scheduler } from './index'; diff --git a/plugins/search-backend-node/src/engines/LunrSearchEngine.test.ts b/plugins/search-backend-node/src/engines/LunrSearchEngine.test.ts index 88a3ba9a24..46aaf47c60 100644 --- a/plugins/search-backend-node/src/engines/LunrSearchEngine.test.ts +++ b/plugins/search-backend-node/src/engines/LunrSearchEngine.test.ts @@ -16,7 +16,10 @@ import { getVoidLogger } from '@backstage/backend-common'; import lunr from 'lunr'; -import { IndexableDocument, SearchEngine } from '@backstage/search-common'; +import { + IndexableDocument, + SearchEngine, +} from '@backstage/plugin-search-common'; import { ConcreteLunrQuery, LunrSearchEngine, diff --git a/plugins/search-backend-node/src/engines/LunrSearchEngine.ts b/plugins/search-backend-node/src/engines/LunrSearchEngine.ts index 394cfffac8..b642647466 100644 --- a/plugins/search-backend-node/src/engines/LunrSearchEngine.ts +++ b/plugins/search-backend-node/src/engines/LunrSearchEngine.ts @@ -20,7 +20,7 @@ import { SearchResultSet, QueryTranslator, SearchEngine, -} from '@backstage/search-common'; +} from '@backstage/plugin-search-common'; import lunr from 'lunr'; import { Logger } from 'winston'; import { LunrSearchEngineIndexer } from './LunrSearchEngineIndexer'; diff --git a/plugins/search-backend-node/src/engines/LunrSearchEngineIndexer.ts b/plugins/search-backend-node/src/engines/LunrSearchEngineIndexer.ts index 01c95f07d4..49afafea64 100644 --- a/plugins/search-backend-node/src/engines/LunrSearchEngineIndexer.ts +++ b/plugins/search-backend-node/src/engines/LunrSearchEngineIndexer.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import lunr from 'lunr'; import { BatchSearchEngineIndexer } from '../indexing'; diff --git a/plugins/search-backend-node/src/index.ts b/plugins/search-backend-node/src/index.ts index 2edab1b01d..e84c5d6a4d 100644 --- a/plugins/search-backend-node/src/index.ts +++ b/plugins/search-backend-node/src/index.ts @@ -37,6 +37,6 @@ export * from './indexing'; export * from './test-utils'; /** - * @deprecated Import from @backstage/search-common instead + * @deprecated Import from @backstage/plugin-search-common instead */ -export type { SearchEngine } from '@backstage/search-common'; +export type { SearchEngine } from '@backstage/plugin-search-common'; diff --git a/plugins/search-backend-node/src/indexing/BatchSearchEngineIndexer.test.ts b/plugins/search-backend-node/src/indexing/BatchSearchEngineIndexer.test.ts index b692ce3aff..b4c9ff9e46 100644 --- a/plugins/search-backend-node/src/indexing/BatchSearchEngineIndexer.test.ts +++ b/plugins/search-backend-node/src/indexing/BatchSearchEngineIndexer.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { BatchSearchEngineIndexer } from './BatchSearchEngineIndexer'; import { TestPipeline } from '../test-utils'; diff --git a/plugins/search-backend-node/src/indexing/BatchSearchEngineIndexer.ts b/plugins/search-backend-node/src/indexing/BatchSearchEngineIndexer.ts index b368dd8184..6070a577ed 100644 --- a/plugins/search-backend-node/src/indexing/BatchSearchEngineIndexer.ts +++ b/plugins/search-backend-node/src/indexing/BatchSearchEngineIndexer.ts @@ -15,7 +15,7 @@ */ import { assertError } from '@backstage/errors'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { Writable } from 'stream'; /** diff --git a/plugins/search-backend-node/src/indexing/DecoratorBase.test.ts b/plugins/search-backend-node/src/indexing/DecoratorBase.test.ts index 3b045dcddf..12c61bd7d3 100644 --- a/plugins/search-backend-node/src/indexing/DecoratorBase.test.ts +++ b/plugins/search-backend-node/src/indexing/DecoratorBase.test.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { DecoratorBase } from './DecoratorBase'; import { TestPipeline } from '../test-utils'; diff --git a/plugins/search-backend-node/src/indexing/DecoratorBase.ts b/plugins/search-backend-node/src/indexing/DecoratorBase.ts index 382ce443e3..0541ab82d7 100644 --- a/plugins/search-backend-node/src/indexing/DecoratorBase.ts +++ b/plugins/search-backend-node/src/indexing/DecoratorBase.ts @@ -15,7 +15,7 @@ */ import { assertError } from '@backstage/errors'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { Transform } from 'stream'; /** diff --git a/plugins/search-backend-node/src/test-utils/TestPipeline.ts b/plugins/search-backend-node/src/test-utils/TestPipeline.ts index c0c2bf5f89..162572d929 100644 --- a/plugins/search-backend-node/src/test-utils/TestPipeline.ts +++ b/plugins/search-backend-node/src/test-utils/TestPipeline.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { pipeline, Readable, Transform, Writable } from 'stream'; /** diff --git a/plugins/search-backend-node/src/types.ts b/plugins/search-backend-node/src/types.ts index 68ccfe4c7e..d21bfaf453 100644 --- a/plugins/search-backend-node/src/types.ts +++ b/plugins/search-backend-node/src/types.ts @@ -18,7 +18,7 @@ import { DocumentCollatorFactory, DocumentDecoratorFactory, SearchEngine, -} from '@backstage/search-common'; +} from '@backstage/plugin-search-common'; import { Logger } from 'winston'; /** diff --git a/plugins/search-backend/api-report.md b/plugins/search-backend/api-report.md index 796f54c09d..d9d408395f 100644 --- a/plugins/search-backend/api-report.md +++ b/plugins/search-backend/api-report.md @@ -4,7 +4,7 @@ ```ts import { Config } from '@backstage/config'; -import { DocumentTypeInfo } from '@backstage/search-common'; +import { DocumentTypeInfo } from '@backstage/plugin-search-common'; import express from 'express'; import { Logger as Logger_2 } from 'winston'; import { PermissionAuthorizer } from '@backstage/plugin-permission-common'; diff --git a/plugins/search-backend/package.json b/plugins/search-backend/package.json index 2733be841e..c42406686c 100644 --- a/plugins/search-backend/package.json +++ b/plugins/search-backend/package.json @@ -26,11 +26,11 @@ "@backstage/backend-common": "^0.12.0", "@backstage/config": "^0.1.15", "@backstage/errors": "^0.2.2", - "@backstage/search-common": "^0.3.0", "@backstage/plugin-auth-node": "^0.1.4", "@backstage/plugin-permission-common": "^0.5.2", "@backstage/plugin-permission-node": "^0.5.3", "@backstage/plugin-search-backend-node": "^0.5.0", + "@backstage/plugin-search-common": "^0.3.0", "@backstage/types": "^0.1.3", "@types/express": "^4.17.6", "dataloader": "^2.0.0", diff --git a/plugins/search-backend/src/service/AuthorizedSearchEngine.test.ts b/plugins/search-backend/src/service/AuthorizedSearchEngine.test.ts index 137ffc24f1..ba63f8484e 100644 --- a/plugins/search-backend/src/service/AuthorizedSearchEngine.test.ts +++ b/plugins/search-backend/src/service/AuthorizedSearchEngine.test.ts @@ -24,7 +24,7 @@ import { DocumentTypeInfo, IndexableDocument, SearchEngine, -} from '@backstage/search-common'; +} from '@backstage/plugin-search-common'; import { encodePageCursor, decodePageCursor, diff --git a/plugins/search-backend/src/service/AuthorizedSearchEngine.ts b/plugins/search-backend/src/service/AuthorizedSearchEngine.ts index 82ed061196..2e65e18a84 100644 --- a/plugins/search-backend/src/service/AuthorizedSearchEngine.ts +++ b/plugins/search-backend/src/service/AuthorizedSearchEngine.ts @@ -31,7 +31,7 @@ import { SearchQuery, SearchResult, SearchResultSet, -} from '@backstage/search-common'; +} from '@backstage/plugin-search-common'; import { Config } from '@backstage/config'; import { InputError } from '@backstage/errors'; import { Writable } from 'stream'; diff --git a/plugins/search-backend/src/service/router.ts b/plugins/search-backend/src/service/router.ts index 3f25c4f24a..92e4e5526f 100644 --- a/plugins/search-backend/src/service/router.ts +++ b/plugins/search-backend/src/service/router.ts @@ -24,7 +24,10 @@ import { Config } from '@backstage/config'; import { JsonObject, JsonValue } from '@backstage/types'; import { getBearerTokenFromAuthorizationHeader } from '@backstage/plugin-auth-node'; import { PermissionAuthorizer } from '@backstage/plugin-permission-common'; -import { DocumentTypeInfo, SearchResultSet } from '@backstage/search-common'; +import { + DocumentTypeInfo, + SearchResultSet, +} from '@backstage/plugin-search-common'; import { SearchEngine } from '@backstage/plugin-search-backend-node'; import { AuthorizedSearchEngine } from './AuthorizedSearchEngine'; diff --git a/plugins/search-common/CHANGELOG.md b/plugins/search-common/CHANGELOG.md index 112d3d583a..d4f12f6146 100644 --- a/plugins/search-common/CHANGELOG.md +++ b/plugins/search-common/CHANGELOG.md @@ -1,4 +1,4 @@ -# @backstage/search-common +# @backstage/plugin-search-common ## 0.3.0 diff --git a/plugins/search-common/README.md b/plugins/search-common/README.md index 66828cc7af..7299c758d4 100644 --- a/plugins/search-common/README.md +++ b/plugins/search-common/README.md @@ -1,3 +1,3 @@ -# @backstage/search-common +# @backstage/plugin-search-common Common functionalities for Search, to be shared between various search-enabled plugins. diff --git a/plugins/search-common/api-report.md b/plugins/search-common/api-report.md index 475d85e11c..8ab25d5e42 100644 --- a/plugins/search-common/api-report.md +++ b/plugins/search-common/api-report.md @@ -1,4 +1,4 @@ -## API Report File for "@backstage/search-common" +## API Report File for "@backstage/plugin-search-common" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). diff --git a/plugins/search-common/package.json b/plugins/search-common/package.json index 0e4482e377..98c02e5cc6 100644 --- a/plugins/search-common/package.json +++ b/plugins/search-common/package.json @@ -1,5 +1,5 @@ { - "name": "@backstage/search-common", + "name": "@backstage/plugin-search-common", "description": "Common functionalities for Search, to be shared between various search-enabled plugins", "version": "0.3.0", "main": "src/index.ts", @@ -17,7 +17,7 @@ "repository": { "type": "git", "url": "https://github.com/backstage/backstage", - "directory": "packages/search-common" + "directory": "plugins/search-common" }, "keywords": [ "backstage", diff --git a/plugins/search/api-report.md b/plugins/search/api-report.md index 10ce787a6c..0a277dab85 100644 --- a/plugins/search/api-report.md +++ b/plugins/search/api-report.md @@ -9,16 +9,16 @@ import { ApiRef } from '@backstage/core-plugin-api'; import { AsyncState } from 'react-use/lib/useAsync'; import { BackstagePlugin } from '@backstage/core-plugin-api'; import { IconComponent } from '@backstage/core-plugin-api'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { InputBaseProps } from '@material-ui/core'; import { JsonObject } from '@backstage/types'; import { default as React_2 } from 'react'; import { ReactElement } from 'react'; import { ReactNode } from 'react'; import { RouteRef } from '@backstage/core-plugin-api'; -import { SearchQuery } from '@backstage/search-common'; -import { SearchResult as SearchResult_2 } from '@backstage/search-common'; -import { SearchResultSet } from '@backstage/search-common'; +import { SearchQuery } from '@backstage/plugin-search-common'; +import { SearchResult as SearchResult_2 } from '@backstage/plugin-search-common'; +import { SearchResultSet } from '@backstage/plugin-search-common'; // Warning: (ae-missing-release-tag) "DefaultResultListItem" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) // diff --git a/plugins/search/package.json b/plugins/search/package.json index 6499920806..eabfae1b16 100644 --- a/plugins/search/package.json +++ b/plugins/search/package.json @@ -39,7 +39,7 @@ "@backstage/core-plugin-api": "^0.8.0", "@backstage/errors": "^0.2.2", "@backstage/plugin-catalog-react": "^0.8.0", - "@backstage/search-common": "^0.3.0", + "@backstage/plugin-search-common": "^0.3.0", "@backstage/theme": "^0.2.15", "@backstage/types": "^0.1.3", "@material-ui/core": "^4.12.2", diff --git a/plugins/search/src/apis.ts b/plugins/search/src/apis.ts index 008002deb1..908942d87d 100644 --- a/plugins/search/src/apis.ts +++ b/plugins/search/src/apis.ts @@ -20,7 +20,7 @@ import { IdentityApi, } from '@backstage/core-plugin-api'; import { ResponseError } from '@backstage/errors'; -import { SearchQuery, SearchResultSet } from '@backstage/search-common'; +import { SearchQuery, SearchResultSet } from '@backstage/plugin-search-common'; import qs from 'qs'; export const searchApiRef = createApiRef({ diff --git a/plugins/search/src/components/DefaultResultListItem/DefaultResultListItem.tsx b/plugins/search/src/components/DefaultResultListItem/DefaultResultListItem.tsx index a6c9a36bb6..d9fbfe315e 100644 --- a/plugins/search/src/components/DefaultResultListItem/DefaultResultListItem.tsx +++ b/plugins/search/src/components/DefaultResultListItem/DefaultResultListItem.tsx @@ -15,7 +15,7 @@ */ import React, { ReactNode } from 'react'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { ListItem, ListItemIcon, diff --git a/plugins/search/src/components/SearchContext/SearchContext.tsx b/plugins/search/src/components/SearchContext/SearchContext.tsx index a9f42fe5ca..100d8a3ac3 100644 --- a/plugins/search/src/components/SearchContext/SearchContext.tsx +++ b/plugins/search/src/components/SearchContext/SearchContext.tsx @@ -16,7 +16,7 @@ import { JsonObject } from '@backstage/types'; import { useApi, AnalyticsContext } from '@backstage/core-plugin-api'; -import { SearchResultSet } from '@backstage/search-common'; +import { SearchResultSet } from '@backstage/plugin-search-common'; import React, { createContext, PropsWithChildren, diff --git a/plugins/search/src/components/SearchContext/SearchContextForStorybook.stories.tsx b/plugins/search/src/components/SearchContext/SearchContextForStorybook.stories.tsx index 36d670a1ed..7d6c35b00c 100644 --- a/plugins/search/src/components/SearchContext/SearchContextForStorybook.stories.tsx +++ b/plugins/search/src/components/SearchContext/SearchContextForStorybook.stories.tsx @@ -14,7 +14,7 @@ * limitations under the License. */ import { ApiProvider } from '@backstage/core-app-api'; -import { SearchResultSet } from '@backstage/search-common'; +import { SearchResultSet } from '@backstage/plugin-search-common'; import { TestApiRegistry } from '@backstage/test-utils'; import React, { ComponentProps, PropsWithChildren } from 'react'; import { searchApiRef } from '../../apis'; diff --git a/plugins/search/src/components/SearchResult/SearchResult.tsx b/plugins/search/src/components/SearchResult/SearchResult.tsx index 34b6840f21..d6ca9fd968 100644 --- a/plugins/search/src/components/SearchResult/SearchResult.tsx +++ b/plugins/search/src/components/SearchResult/SearchResult.tsx @@ -19,7 +19,7 @@ import { Progress, ResponseErrorPanel, } from '@backstage/core-components'; -import { SearchResult } from '@backstage/search-common'; +import { SearchResult } from '@backstage/plugin-search-common'; import React from 'react'; import { useSearch } from '../SearchContext'; diff --git a/plugins/techdocs-backend/api-report.md b/plugins/techdocs-backend/api-report.md index acce0b4981..f306ce4f35 100644 --- a/plugins/techdocs-backend/api-report.md +++ b/plugins/techdocs-backend/api-report.md @@ -7,7 +7,7 @@ import { CatalogApi } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; -import { DocumentCollatorFactory } from '@backstage/search-common'; +import { DocumentCollatorFactory } from '@backstage/plugin-search-common'; import { Entity } from '@backstage/catalog-model'; import express from 'express'; import { GeneratorBuilder } from '@backstage/plugin-techdocs-node'; diff --git a/plugins/techdocs-backend/package.json b/plugins/techdocs-backend/package.json index aea75b1c3d..b11e038879 100644 --- a/plugins/techdocs-backend/package.json +++ b/plugins/techdocs-backend/package.json @@ -41,8 +41,8 @@ "@backstage/errors": "^0.2.2", "@backstage/integration": "^0.8.0", "@backstage/plugin-catalog-common": "^0.2.0", + "@backstage/plugin-search-common": "^0.3.0", "@backstage/plugin-techdocs-node": "^0.11.11", - "@backstage/search-common": "^0.3.0", "@types/express": "^4.17.6", "dockerode": "^3.3.1", "express": "^4.17.1", diff --git a/plugins/techdocs-backend/src/search/DefaultTechDocsCollatorFactory.ts b/plugins/techdocs-backend/src/search/DefaultTechDocsCollatorFactory.ts index 7ba76350e4..41d637e319 100644 --- a/plugins/techdocs-backend/src/search/DefaultTechDocsCollatorFactory.ts +++ b/plugins/techdocs-backend/src/search/DefaultTechDocsCollatorFactory.ts @@ -31,7 +31,7 @@ import { } from '@backstage/catalog-model'; import { Config } from '@backstage/config'; import { catalogEntityReadPermission } from '@backstage/plugin-catalog-common'; -import { DocumentCollatorFactory } from '@backstage/search-common'; +import { DocumentCollatorFactory } from '@backstage/plugin-search-common'; import { TechDocsDocument } from '@backstage/plugin-techdocs-node'; import unescape from 'lodash/unescape'; import fetch from 'node-fetch'; diff --git a/plugins/techdocs-node/api-report.md b/plugins/techdocs-node/api-report.md index 9ec1aafb09..768865896b 100644 --- a/plugins/techdocs-node/api-report.md +++ b/plugins/techdocs-node/api-report.md @@ -10,7 +10,7 @@ import { Config } from '@backstage/config'; import { ContainerRunner } from '@backstage/backend-common'; import { Entity } from '@backstage/catalog-model'; import express from 'express'; -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; import { Logger as Logger_2 } from 'winston'; import { PluginEndpointDiscovery } from '@backstage/backend-common'; import { ScmIntegrationRegistry } from '@backstage/integration'; diff --git a/plugins/techdocs-node/package.json b/plugins/techdocs-node/package.json index 7cbf49f954..ee2edd3e58 100644 --- a/plugins/techdocs-node/package.json +++ b/plugins/techdocs-node/package.json @@ -46,8 +46,8 @@ "@backstage/catalog-model": "^0.12.0", "@backstage/config": "^0.1.15", "@backstage/errors": "^0.2.2", - "@backstage/search-common": "^0.3.0", "@backstage/integration": "^0.8.0", + "@backstage/plugin-search-common": "^0.3.0", "@google-cloud/storage": "^5.6.0", "@trendyol-js/openstack-swift-sdk": "^0.0.5", "@types/express": "^4.17.6", diff --git a/plugins/techdocs-node/src/techdocsTypes.ts b/plugins/techdocs-node/src/techdocsTypes.ts index 0b722f4da5..77436b35d5 100644 --- a/plugins/techdocs-node/src/techdocsTypes.ts +++ b/plugins/techdocs-node/src/techdocsTypes.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { IndexableDocument } from '@backstage/search-common'; +import { IndexableDocument } from '@backstage/plugin-search-common'; /** * TechDocs indexable document interface diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index d37fa51c60..153861b875 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -237,6 +237,7 @@ const NO_WARNING_PACKAGES = [ 'plugins/scaffolder-backend-module-yeoman', 'plugins/scaffolder-common', 'plugins/search-backend-node', + 'plugins/search-common', 'plugins/techdocs-backend', 'plugins/techdocs-node', 'plugins/tech-insights', diff --git a/yarn.lock b/yarn.lock index 48784ac13c..fc8d5480a8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12049,6 +12049,7 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: "@backstage/plugin-rollbar" "^0.4.1" "@backstage/plugin-scaffolder" "^0.14.0" "@backstage/plugin-search" "^0.7.2" + "@backstage/plugin-search-common" "^0.3.0" "@backstage/plugin-sentry" "^0.3.39" "@backstage/plugin-shortcuts" "^0.2.2" "@backstage/plugin-tech-insights" "^0.1.11" @@ -12056,7 +12057,6 @@ evp_bytestokey@^1.0.0, evp_bytestokey@^1.0.3: "@backstage/plugin-techdocs" "^0.15.0" "@backstage/plugin-todo" "^0.2.3" "@backstage/plugin-user-settings" "^0.4.0" - "@backstage/search-common" "^0.3.0" "@backstage/theme" "^0.2.15" "@material-ui/core" "^4.12.2" "@material-ui/icons" "^4.9.1" From d52155466adeab052bdbcf86d8921b445367ef10 Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 3 Mar 2022 17:12:01 +0100 Subject: [PATCH 6/6] Recreate a shell of @backstage/search-common for smooth deprecation process Signed-off-by: Eric Peterson --- .changeset/search-byta-namnet.md | 5 + .changeset/search-common-people.md | 7 ++ packages/search-common/.eslintrc.js | 3 + packages/search-common/CHANGELOG.md | 148 +++++++++++++++++++++++++++ packages/search-common/README.md | 7 ++ packages/search-common/api-report.md | 9 ++ packages/search-common/package.json | 50 +++++++++ packages/search-common/src/index.ts | 17 +++ 8 files changed, 246 insertions(+) create mode 100644 .changeset/search-byta-namnet.md create mode 100644 .changeset/search-common-people.md create mode 100644 packages/search-common/.eslintrc.js create mode 100644 packages/search-common/CHANGELOG.md create mode 100644 packages/search-common/README.md create mode 100644 packages/search-common/api-report.md create mode 100644 packages/search-common/package.json create mode 100644 packages/search-common/src/index.ts diff --git a/.changeset/search-byta-namnet.md b/.changeset/search-byta-namnet.md new file mode 100644 index 0000000000..c3abc81996 --- /dev/null +++ b/.changeset/search-byta-namnet.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search-common': patch +--- + +Renamed `@backstage/search-common` to `@backstage/plugin-search-common`. diff --git a/.changeset/search-common-people.md b/.changeset/search-common-people.md new file mode 100644 index 0000000000..2ed34c7573 --- /dev/null +++ b/.changeset/search-common-people.md @@ -0,0 +1,7 @@ +--- +'@backstage/search-common': patch +--- + +**DEPRECATION** + +The `@backstage/search-common` package is being renamed `@backstage/plugin-search-common`. We may continue to publish changes to `@backstage/search-common` for a time, but will stop doing so in the near future. If you depend on this package, you should update your dependencies to point at the renamed package. diff --git a/packages/search-common/.eslintrc.js b/packages/search-common/.eslintrc.js new file mode 100644 index 0000000000..16a033dbc6 --- /dev/null +++ b/packages/search-common/.eslintrc.js @@ -0,0 +1,3 @@ +module.exports = { + extends: [require.resolve('@backstage/cli/config/eslint.backend')], +}; diff --git a/packages/search-common/CHANGELOG.md b/packages/search-common/CHANGELOG.md new file mode 100644 index 0000000000..112d3d583a --- /dev/null +++ b/packages/search-common/CHANGELOG.md @@ -0,0 +1,148 @@ +# @backstage/search-common + +## 0.3.0 + +### Minor Changes + +- 022507c860: **BREAKING** + + The Backstage Search Platform's indexing process has been rewritten as a stream + pipeline in order to improve efficiency and performance on large document sets. + + The concepts of `Collator` and `Decorator` have been replaced with readable and + transform object streams (respectively), as well as factory classes to + instantiate them. Accordingly, the `SearchEngine.index()` method has also been + replaced with a `getIndexer()` factory method that resolves to a writable + object stream. + + Check [this upgrade guide](https://backstage.io/docs/features/search/how-to-guides#how-to-migrate-from-search-alpha-to-beta) + for further details. + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-permission-common@0.5.2 + +## 0.2.4 + +### Patch Changes + +- Fix for the previous release with missing type declarations. +- Updated dependencies + - @backstage/types@0.1.3 + - @backstage/plugin-permission-common@0.5.1 + +## 0.2.3 + +### Patch Changes + +- c77c5c7eb6: Added `backstage.role` to `package.json` +- Updated dependencies + - @backstage/plugin-permission-common@0.5.0 + - @backstage/types@0.1.2 + +## 0.2.2 + +### Patch Changes + +- 9a511968b1: - Add optional visibilityPermission property to DocumentCollator type + - Add new DocumentTypeInfo type for housing information about the document types stored in a search engine. +- b2e918fa0b: Add optional resourceRef field to the IndexableDocument type for use when authorizing access to documents. +- 96cbebc629: Add optional query request options containing authorization token to SearchEngine#query. + +## 0.2.1 + +### Patch Changes + +- 10615525f3: Switch to use the json and observable types from `@backstage/types` + +## 0.2.0 + +### Minor Changes + +- a13f21cdc: Implement optional `pageCursor` based paging in search. + + To use paging in your app, add a `` to your + `SearchPage.tsx`. + +## 0.1.3 + +### Patch Changes + +- d9c13d535: Implements configuration and indexing functionality for ElasticSearch search engine. Adds indexing, searching and default translator for ElasticSearch and modifies default backend example-app to use ES if it is configured. + + ## Example configurations: + + ### AWS + + Using AWS hosted ElasticSearch the only configuration options needed is the URL to the ElasticSearch service. The implementation assumes + that environment variables for AWS access key id and secret access key are defined in accordance to the [default AWS credential chain.](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html). + + ```yaml + search: + elasticsearch: + provider: aws + node: https://my-backstage-search-asdfqwerty.eu-west-1.es.amazonaws.com + ``` + + ### Elastic.co + + Elastic Cloud hosted ElasticSearch uses a Cloud ID to determine the instance of hosted ElasticSearch to connect to. Additionally, username and password needs to be provided either directly or using environment variables like defined in [Backstage documentation.](https://backstage.io/docs/conf/writing#includes-and-dynamic-data) + + ```yaml + search: + elasticsearch: + provider: elastic + cloudId: backstage-elastic:asdfqwertyasdfqwertyasdfqwertyasdfqwerty== + auth: + username: elastic + password: changeme + ``` + + ### Others + + Other ElasticSearch instances can be connected to by using standard ElasticSearch authentication methods and exposed URL, provided that the cluster supports that. The configuration options needed are the URL to the node and authentication information. Authentication can be handled by either providing username/password or and API key or a bearer token. In case both username/password combination and one of the tokens are provided, token takes precedence. For more information how to create an API key, see [Elastic documentation on API keys](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html) and how to create a bearer token, see [Elastic documentation on tokens.](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html) + + #### Configuration examples + + ##### With username and password + + ```yaml + search: + elasticsearch: + node: http://localhost:9200 + auth: + username: elastic + password: changeme + ``` + + ##### With bearer token + + ```yaml + search: + elasticsearch: + node: http://localhost:9200 + auth: + bearer: token + ``` + + ##### With API key + + ```yaml + search: + elasticsearch: + node: http://localhost:9200 + auth: + apiKey: base64EncodedKey + ``` + +- Updated dependencies + - @backstage/config@0.1.6 + +## 0.1.2 + +### Patch Changes + +- db1c8f93b: The ` set of components exported by the Search Plugin are now updated to use the Search Backend API. These will be made available as the default non-"next" versions in a follow-up release. + + The interfaces for decorators and collators in the Search Backend have also seen minor, breaking revisions ahead of a general release. If you happen to be building on top of these interfaces, check and update your implementations accordingly. The APIs will be considered more stable in a follow-up release. diff --git a/packages/search-common/README.md b/packages/search-common/README.md new file mode 100644 index 0000000000..3a75dac4c2 --- /dev/null +++ b/packages/search-common/README.md @@ -0,0 +1,7 @@ +# @backstage/search-common + +**WARNING**: This package is moving to `@backstage/plugin-search-common`. +Please update any dependencies you may have, as this package will no longer be +published or updated in the near future. + +Common functionalities for Search, to be shared between various search-enabled plugins. diff --git a/packages/search-common/api-report.md b/packages/search-common/api-report.md new file mode 100644 index 0000000000..03965ace66 --- /dev/null +++ b/packages/search-common/api-report.md @@ -0,0 +1,9 @@ +## API Report File for "@backstage/search-common" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +export * from '@backstage/plugin-search-common'; + +// (No @packageDocumentation comment for this package) +``` diff --git a/packages/search-common/package.json b/packages/search-common/package.json new file mode 100644 index 0000000000..e85ed2dd83 --- /dev/null +++ b/packages/search-common/package.json @@ -0,0 +1,50 @@ +{ + "name": "@backstage/search-common", + "description": "Common functionalities for Search, to be shared between various search-enabled plugins", + "version": "0.3.0", + "main": "src/index.ts", + "types": "src/index.ts", + "private": false, + "publishConfig": { + "access": "public", + "main": "dist/index.cjs.js", + "types": "dist/index.d.ts" + }, + "backstage": { + "role": "common-library" + }, + "homepage": "https://backstage.io", + "repository": { + "type": "git", + "url": "https://github.com/backstage/backstage", + "directory": "packages/search-common" + }, + "keywords": [ + "backstage", + "search" + ], + "license": "Apache-2.0", + "files": [ + "dist" + ], + "scripts": { + "build": "backstage-cli package build", + "lint": "backstage-cli package lint", + "test": "backstage-cli package test", + "prepack": "backstage-cli package prepack", + "postpack": "backstage-cli package postpack", + "clean": "backstage-cli package clean" + }, + "bugs": { + "url": "https://github.com/backstage/backstage/issues" + }, + "dependencies": { + "@backstage/plugin-search-common": "^0.3.0" + }, + "devDependencies": {}, + "jest": { + "roots": [ + ".." + ] + } +} diff --git a/packages/search-common/src/index.ts b/packages/search-common/src/index.ts new file mode 100644 index 0000000000..8e21c5f936 --- /dev/null +++ b/packages/search-common/src/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright 2021 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from '@backstage/plugin-search-common';