Merge pull request #26797 from backstage/rugvip/opaque

frontend-internal: move OpaqueType to a new @internal/opaque package
This commit is contained in:
Ben Lambert
2024-09-20 11:03:44 +02:00
committed by GitHub
10 changed files with 76 additions and 2 deletions
@@ -25,7 +25,7 @@ import {
PortableSchema,
ResolvedExtensionInputs,
} from '@backstage/frontend-plugin-api';
import { OpaqueType } from './OpaqueType';
import { OpaqueType } from '@internal/opaque';
export const OpaqueExtensionDefinition = OpaqueType.create<{
public: ExtensionDefinition<ExtensionDefinitionParameters>;
@@ -19,7 +19,7 @@ import {
FeatureFlagConfig,
FrontendPlugin,
} from '@backstage/frontend-plugin-api';
import { OpaqueType } from './OpaqueType';
import { OpaqueType } from '@internal/opaque';
export const OpaqueFrontendPlugin = OpaqueType.create<{
public: FrontendPlugin;
+5
View File
@@ -0,0 +1,5 @@
module.exports = require('@backstage/cli/config/eslint-factory')(__dirname, {
rules: {
'@backstage/no-top-level-material-ui-4-imports': 'error',
},
});
+3
View File
@@ -0,0 +1,3 @@
# @internal/opaque
This is an internal package for use by other internal packages. Instances created with `OpaqueType.create` should never be exported in any public API, instead use an `@internal/*` if they need to be used in multiple packages.
@@ -0,0 +1,9 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: internal-opaque
title: '@internal/opaque'
spec:
lifecycle: experimental
type: backstage-common-library
owner: maintainers
+30
View File
@@ -0,0 +1,30 @@
{
"name": "@internal/opaque",
"version": "0.0.1",
"backstage": {
"role": "common-library",
"inline": true
},
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/backstage/backstage",
"directory": "packages/opaque-internal"
},
"license": "Apache-2.0",
"sideEffects": false,
"main": "src/index.ts",
"types": "src/index.ts",
"files": [
"dist"
],
"scripts": {
"lint": "backstage-cli package lint",
"test": "backstage-cli package test"
},
"devDependencies": {
"@backstage/cli": "workspace:^",
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^16.0.0"
}
}
+17
View File
@@ -0,0 +1,17 @@
/*
* Copyright 2024 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 { OpaqueType } from './OpaqueType';
+10
View File
@@ -9872,6 +9872,16 @@ __metadata:
languageName: unknown
linkType: soft
"@internal/opaque@workspace:packages/opaque-internal":
version: 0.0.0-use.local
resolution: "@internal/opaque@workspace:packages/opaque-internal"
dependencies:
"@backstage/cli": "workspace:^"
"@testing-library/jest-dom": ^6.0.0
"@testing-library/react": ^16.0.0
languageName: unknown
linkType: soft
"@internal/plugin-todo-list-backend@workspace:plugins/example-todo-list-backend":
version: 0.0.0-use.local
resolution: "@internal/plugin-todo-list-backend@workspace:plugins/example-todo-list-backend"