Skip to content

Commit

Permalink
Merge pull request #3 from axelerant/publish-plugin-setup
Browse files Browse the repository at this point in the history
setup: publish to npm
  • Loading branch information
zeshanziya authored Sep 16, 2024
2 parents e020b6e + 0ac9c37 commit eda4d4d
Show file tree
Hide file tree
Showing 23 changed files with 68 additions and 28 deletions.
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@backstage/plugin-techdocs-react": "^1.2.7",
"@backstage/plugin-user-settings": "^0.8.11",
"@backstage/theme": "^0.5.6",
"@internal/backstage-plugin-platformsh": "^0.1.0",
"@axelerant/backstage-plugin-platformsh": "^0.1.0",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"history": "^5.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { AppRouter, FlatRoutes } from '@backstage/core-app-api';
import { CatalogGraphPage } from '@backstage/plugin-catalog-graph';
import { RequirePermission } from '@backstage/plugin-permission-react';
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';
import { PlatformshPage } from '@internal/backstage-plugin-platformsh';
import { PlatformshPage } from '@axelerant/backstage-plugin-platformsh';

const app = createApp({
apis,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ import {
import {
EntityPlatformshContents,
isPlatformshAvailable,
} from '@internal/backstage-plugin-platformsh';
} from '@axelerant/backstage-plugin-platformsh';

const techdocsContent = (
<EntityTechdocsContent>
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"@backstage/plugin-search-backend-module-techdocs": "^0.2.0",
"@backstage/plugin-search-backend-node": "^1.3.0",
"@backstage/plugin-techdocs-backend": "^1.10.10",
"@internal/backstage-plugin-platformsh-backend": "^0.1.0",
"@internal/backstage-plugin-platformsh-common": "^0.1.0",
"@axelerant/backstage-plugin-platformsh-backend": "^0.1.0",
"@axelerant/backstage-plugin-platformsh-common": "^0.1.0",
"app": "link:../app",
"better-sqlite3": "^9.0.0",
"node-gyp": "^10.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
createCatalogConditionalDecision,
} from '@backstage/plugin-catalog-backend/alpha';
import { catalogEntityDeletePermission } from '@backstage/plugin-catalog-common/alpha';
import { platformshEnvironmentManagePermission } from '@internal/backstage-plugin-platformsh-common';
import { platformshEnvironmentManagePermission } from '@axelerant/backstage-plugin-platformsh-common';

class CustomPermissionPolicy implements PermissionPolicy {
async handle(
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ backend.add(import('@backstage/plugin-search-backend-module-techdocs/alpha'));
// kubernetes
backend.add(import('@backstage/plugin-kubernetes-backend/alpha'));

backend.add(import('@internal/backstage-plugin-platformsh-backend'));
backend.add(import('@axelerant/backstage-plugin-platformsh-backend'));
backend.start();
18 changes: 16 additions & 2 deletions plugins/platformsh-backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@internal/backstage-plugin-platformsh-backend",
"name": "@axelerant/backstage-plugin-platformsh-backend",
"version": "0.1.0",
"description": "Backstage backend plugin for Platform.sh integration!",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
Expand All @@ -13,6 +14,19 @@
"backstage": {
"role": "backend-plugin"
},
"keywords": [
"backstage",
"plugin",
"platformsh",
"platform.sh"
],
"homepage": "https://github.com/axelerant/backstage-plugins",
"repository": {
"type": "git",
"url": "https://github.com/axelerant/backstage-plugins",
"directory": "plugins/platformsh-backend"
},
"author": "zeshanziya <[email protected]>",
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build",
Expand All @@ -32,7 +46,7 @@
"@backstage/plugin-catalog-node": "^1.12.6",
"@backstage/plugin-permission-common": "^0.8.1",
"@backstage/plugin-permission-node": "^0.8.2",
"@internal/backstage-plugin-platformsh-common": "^0.1.0",
"@axelerant/backstage-plugin-platformsh-common": "^0.1.0",
"express": "^4.17.1",
"express-promise-router": "^4.1.0",
"node-fetch": "^2.6.7",
Expand Down
2 changes: 1 addition & 1 deletion plugins/platformsh-backend/src/PlatformshHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Environment from 'platformsh-client/types/model/Environment';
import {
EnvironmentMethods,
PlatformshEnvironment,
} from '@internal/backstage-plugin-platformsh-common';
} from '@axelerant/backstage-plugin-platformsh-common';

type PlatformshAccessToken = {
access_token: string;
Expand Down
2 changes: 1 addition & 1 deletion plugins/platformsh-backend/src/service/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { PlatformshHelper } from '../PlatformshHelper';
import {
EnvironmentMethods,
platformshEnvironmentManagePermission,
} from '@internal/backstage-plugin-platformsh-common';
} from '@axelerant/backstage-plugin-platformsh-common';
import { NotAllowedError } from '@backstage/errors';
import { AuthorizeResult } from '@backstage/plugin-permission-common';
import { createPermissionIntegrationRouter } from '@backstage/plugin-permission-node';
Expand Down
2 changes: 1 addition & 1 deletion plugins/platformsh-backend/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CatalogApi } from '@backstage/catalog-client';
import { ComponentEntity } from '@backstage/catalog-model';
import { ANNOTATION_PLATFORMSH_PROJECT } from '@internal/backstage-plugin-platformsh-common';
import { ANNOTATION_PLATFORMSH_PROJECT } from '@axelerant/backstage-plugin-platformsh-common';

export const findEntityByProjectId = async (
catalogApi: CatalogApi,
Expand Down
17 changes: 15 additions & 2 deletions plugins/platformsh-common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@internal/backstage-plugin-platformsh-common",
"description": "Common functionalities for the platformsh plugin",
"name": "@axelerant/backstage-plugin-platformsh-common",
"description": "Common functionalities for the backstage platformsh plugin",
"version": "0.1.0",
"main": "src/index.ts",
"types": "src/index.ts",
Expand All @@ -15,6 +15,19 @@
"backstage": {
"role": "common-library"
},
"keywords": [
"backstage",
"plugin",
"platformsh",
"platform.sh"
],
"homepage": "https://github.com/axelerant/backstage-plugins",
"repository": {
"type": "git",
"url": "https://github.com/axelerant/backstage-plugins",
"directory": "plugins/platformsh-common"
},
"author": "zeshanziya <[email protected]>",
"sideEffects": false,
"scripts": {
"build": "backstage-cli package build",
Expand Down
19 changes: 16 additions & 3 deletions plugins/platformsh/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@internal/backstage-plugin-platformsh",
"name": "@axelerant/backstage-plugin-platformsh",
"version": "0.1.0",
"description": "Backstage frontend plugin for Platform.sh integration!",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
"private": true,
"publishConfig": {
"access": "public",
"main": "dist/index.esm.js",
Expand All @@ -13,6 +13,19 @@
"backstage": {
"role": "frontend-plugin"
},
"keywords": [
"backstage",
"plugin",
"platformsh",
"platform.sh"
],
"homepage": "https://github.com/axelerant/backstage-plugins",
"repository": {
"type": "git",
"url": "https://github.com/axelerant/backstage-plugins",
"directory": "plugins/platformsh"
},
"author": "zeshanziya <[email protected]>",
"sideEffects": false,
"scripts": {
"start": "backstage-cli package start",
Expand All @@ -30,7 +43,7 @@
"@backstage/plugin-catalog-react": "^1.12.3",
"@backstage/plugin-permission-react": "^0.4.25",
"@backstage/theme": "^0.5.6",
"@internal/backstage-plugin-platformsh-common": "^0.1.0",
"@axelerant/backstage-plugin-platformsh-common": "^0.1.0",
"@material-ui/core": "^4.9.13",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.61",
Expand Down
2 changes: 1 addition & 1 deletion plugins/platformsh/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
PlatformshProject,
ProjectEnvironmentsResponse,
ProjectInfoResponse,
} from '@internal/backstage-plugin-platformsh-common';
} from '@axelerant/backstage-plugin-platformsh-common';

export interface PlatformshApi {
listProjects(): Promise<PlatformshProject[]>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
MenuItem,
} from '@material-ui/core';
import MoreVertIcon from '@material-ui/icons/MoreVert';
import { PlatformshEnvironment } from '@internal/backstage-plugin-platformsh-common';
import { PlatformshEnvironment } from '@axelerant/backstage-plugin-platformsh-common';
import useAsyncFn from 'react-use/lib/useAsyncFn';

export const ActionButtons = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { platformshApiRef } from '../../../api';
import {
ANNOTATION_PLATFORMSH_PROJECT,
PlatformshEnvironment,
} from '@internal/backstage-plugin-platformsh-common';
} from '@axelerant/backstage-plugin-platformsh-common';
import { permissionApiRef } from '@backstage/plugin-permission-react';

jest.mock('@backstage/plugin-catalog-react', () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
import {
PlatformshEnvironment,
platformshEnvironmentManagePermission,
} from '@internal/backstage-plugin-platformsh-common';
} from '@axelerant/backstage-plugin-platformsh-common';
import { alertApiRef, useApi } from '@backstage/core-plugin-api';
import { platformshApiRef } from '../../../api';
import { ActionButtons } from './ActionButtons';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TestApiProvider,
} from '@backstage/test-utils';
import { platformshApiRef } from '../../../api';
import { PlatformshProject } from '@internal/backstage-plugin-platformsh-common';
import { PlatformshProject } from '@axelerant/backstage-plugin-platformsh-common';

describe('ProjectDetailsCard', () => {
const server = setupServer();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import { Typography, Box, makeStyles, Link } from '@material-ui/core';
import { platformshApiRef } from '../../../api';
import { useApi } from '@backstage/core-plugin-api';
import { PlatformshProject } from '@internal/backstage-plugin-platformsh-common';
import { PlatformshProject } from '@axelerant/backstage-plugin-platformsh-common';
import useAsync from 'react-use/lib/useAsync';

const useStyles = makeStyles(theme => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { platformshApiRef } from '../../api';
import {
PlatformshProject,
ANNOTATION_PLATFORMSH_PROJECT,
} from '@internal/backstage-plugin-platformsh-common';
} from '@axelerant/backstage-plugin-platformsh-common';

jest.mock('@backstage/plugin-catalog-react', () => ({
useEntity: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Grid } from '@material-ui/core';
import { ProjectDetailsCard } from '../Cards/ProjectDetailsCard';
import { useEntity } from '@backstage/plugin-catalog-react';
import { EnvironmentsCard } from '../Cards/EnvironmentsCard/EnvironmentsCard';
import { ANNOTATION_PLATFORMSH_PROJECT } from '@internal/backstage-plugin-platformsh-common';
import { ANNOTATION_PLATFORMSH_PROJECT } from '@axelerant/backstage-plugin-platformsh-common';

export const EntityTabComponent = () => {
const { entity } = useEntity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { render, screen } from '@testing-library/react';
import { ProjectsComponent } from './ProjectsComponent';
import { platformshApiRef } from '../../api';
import { TestApiProvider } from '@backstage/test-utils';
import { PlatformshProject } from '@internal/backstage-plugin-platformsh-common';
import { PlatformshProject } from '@axelerant/backstage-plugin-platformsh-common';

describe('ProjectsComponent', () => {
const platformshApi: jest.Mocked<typeof platformshApiRef.T> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ResponseErrorPanel,
} from '@backstage/core-components';
import useAsync from 'react-use/lib/useAsync';
import { PlatformshProject } from '@internal/backstage-plugin-platformsh-common';
import { PlatformshProject } from '@axelerant/backstage-plugin-platformsh-common';
import { useApi } from '@backstage/core-plugin-api';
import { platformshApiRef } from '../../api';

Expand Down
2 changes: 1 addition & 1 deletion plugins/platformsh/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Entity } from '@backstage/catalog-model';
import { ANNOTATION_PLATFORMSH_PROJECT } from '@internal/backstage-plugin-platformsh-common';
import { ANNOTATION_PLATFORMSH_PROJECT } from '@axelerant/backstage-plugin-platformsh-common';

export const isPlatformshAvailable = (entity: Entity) =>
Boolean(entity?.metadata.annotations?.[ANNOTATION_PLATFORMSH_PROJECT]);

0 comments on commit eda4d4d

Please sign in to comment.