-
Notifications
You must be signed in to change notification settings - Fork 5
chore: setup initial repo #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e612134
chore: add scaffolding for base Backstage plugin
Parkreiner 43ae557
chore: add starter scaffolding for Coder plugin
Parkreiner dbc9bb3
chore: rename plugin package
Parkreiner c6a0d0a
chore: add Card component
Parkreiner da9b8dc
chore: port over components from Backstage deployment
Parkreiner c04137e
docs: update plugin readme with working draft
Parkreiner 5b9ac26
chore: add proxy options for app-config.yaml
Parkreiner 4271aa3
refactor: clean up markup for CoderWorkspacesCard
Parkreiner ae85ee8
chore: disable eslint rules for scoping
Parkreiner d9daa15
fix: update typo in auth initialization logic
Parkreiner 67fa4cd
chore: add all public exports for plugin
Parkreiner f6acba4
fix: update imports for api.ts file
Parkreiner 2a1c036
chore: add support metadata for dev mode
Parkreiner 3dd9b1b
chore: add code for isolated plugin development
Parkreiner 7c1134f
fix: add missing init files and GitHub auth logic
Parkreiner a4720b5
fix: delete unused example components
Parkreiner 4695468
fix: remove auto-generated example files
Parkreiner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore: add code for isolated plugin development
- Loading branch information
commit 3dd9b1b8736834455b71895e5477c849c939a1a5
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/** | ||
* @file Defines a simple routable component for wrapping around non-page | ||
* Backstage components. | ||
*/ | ||
import React from 'react'; | ||
import { CoderWorkspacesCard } from '../src/components/CoderWorkspacesCard'; | ||
import { | ||
type CoderAppConfig, | ||
CoderProvider, | ||
} from '../src/components/CoderProvider'; | ||
|
||
import { | ||
Content, | ||
ContentHeader, | ||
Header, | ||
Page, | ||
SupportButton, | ||
} from '@backstage/core-components'; | ||
import { Grid } from '@material-ui/core'; | ||
|
||
const appConfig: CoderAppConfig = { | ||
deployment: { | ||
accessUrl: 'https://dev.coder.com', | ||
}, | ||
|
||
workspaces: { | ||
templateName: 'devcontainers', | ||
mode: 'manual', | ||
repoUrlParamKeys: ['custom_repo', 'repo_url'], | ||
params: { | ||
repo: 'custom', | ||
region: 'eu-helsinki', | ||
}, | ||
}, | ||
}; | ||
|
||
const pluginTitle = 'Coder Plugin - dev mode'; | ||
|
||
export const DevPage = () => { | ||
return ( | ||
<CoderProvider appConfig={appConfig}> | ||
<Page themeId="tool"> | ||
<Header | ||
title={pluginTitle} | ||
subtitle="Place non-routable components in this wrapper for development" | ||
/> | ||
|
||
<Content> | ||
<ContentHeader title={pluginTitle}> | ||
<SupportButton /> | ||
</ContentHeader> | ||
|
||
<Grid container spacing={3} direction="column"> | ||
<Grid | ||
item | ||
style={{ | ||
width: '600px', | ||
marginLeft: 'auto', | ||
marginRight: 'auto', | ||
}} | ||
> | ||
<CoderWorkspacesCard /> | ||
</Grid> | ||
</Grid> | ||
</Content> | ||
</Page> | ||
</CoderProvider> | ||
); | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,34 @@ | ||
import React from 'react'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a new file, but this is the first time it's really being filled out |
||
import { createDevApp } from '@backstage/dev-utils'; | ||
import { coderPlugin, CoderPage } from '../src/plugin'; | ||
|
||
import { coderPlugin } from '../src/plugin'; | ||
import { createRoutableExtension } from '@backstage/core-plugin-api'; | ||
import { rootRouteRef } from '../src/routes'; | ||
|
||
/** | ||
* This extension should only be made available in dev mode, which is why it is | ||
* not being exported with the other extensions. | ||
* | ||
* 2024-02-14 - This does not work just yet – the plugin is able to launch in | ||
* isolated dev mode, but it needs a running backend process so that it has a | ||
* proxy to go through. With no backend, all network requests will time out. | ||
* | ||
* @todo Figure out how to make proxying available to isolated plugin instances; | ||
* until then, development will have to be done with a full Backstage app. | ||
*/ | ||
const DevEnvironmentPage = coderPlugin.provide( | ||
createRoutableExtension({ | ||
name: 'CoderDevPage', | ||
mountPoint: rootRouteRef, | ||
component: () => import('./DevPage').then(m => m.DevPage), | ||
}), | ||
); | ||
|
||
createDevApp() | ||
.registerPlugin(coderPlugin) | ||
.addPage({ | ||
element: <CoderPage />, | ||
title: 'Root Page', | ||
path: '/backstage-plugin-coder', | ||
element: <DevEnvironmentPage />, | ||
title: 'CoderDevPage', | ||
path: '/dev', | ||
}) | ||
.render(); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New component