Skip to content

Commit 06d24da

Browse files
authored
chore(Coder plugin): import preview version of Coder SDK into plugin (#130)
* chore: add vendored version of experimental Coder SDK * fix: improve data hiding for CoderSdk * docs: update typo * fix: add additional properties to hide from SDK
1 parent c116ebc commit 06d24da

File tree

8 files changed

+4741
-15
lines changed

8 files changed

+4741
-15
lines changed

plugins/backstage-plugin-coder/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
"@material-ui/lab": "4.0.0-alpha.61",
4343
"@tanstack/react-query": "4.36.1",
4444
"axios": "^1.6.8",
45+
"dayjs": "^1.11.11",
46+
"ua-parser-js": "^1.0.37",
4547
"use-sync-external-store": "^1.2.1",
4648
"valibot": "^0.28.1"
4749
},
@@ -57,6 +59,7 @@
5759
"@testing-library/jest-dom": "^5.10.1",
5860
"@testing-library/react": "^14.2.1",
5961
"@testing-library/user-event": "^14.0.0",
62+
"@types/ua-parser-js": "^0.7.39",
6063
"msw": "^1.0.0"
6164
},
6265
"files": [
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Coder SDK - Experimental Vendored Version
2+
3+
This is a vendored version of the main API files from the
4+
[core Coder OSS repo](https://github.com/coder/coder/tree/main/site/src/api). All files (aside from test files) have been copied over directly, with only a
5+
few changes made to satisfy default Backstage ESLint rules.
6+
7+
While there is a risk of this getting out of sync with the versions of the
8+
files in Coder OSS, the Coder API itself should be treated as stable. Breaking
9+
changes are only made when absolutely necessary.
10+
11+
## General approach
12+
13+
- Copy over relevant files from Coder OSS and place them in relevant folders
14+
- As much as possible, the file structure of the vendored files should match the file structure of Coder OSS to make it easier to copy updated files over.
15+
- Have a single file at the top level of this directory that exports out the files for consumption elsewhere in the plugin. No plugin code should interact with the vendored files directly.
16+
17+
## Eventual plans
18+
19+
Coder has eventual plans to create a true SDK published through NPM. Once
20+
that is published, all of this vendored code should be removed in favor of it.

0 commit comments

Comments
 (0)