Skip to content

Commit 0a4a058

Browse files
committed
remove moonshine, use emotion
1 parent 788455f commit 0a4a058

22 files changed

+1041
-3670
lines changed

.speakeasy/gen.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ id: 521af75f-d011-41f9-a5ff-9f8033773118
33
management:
44
docChecksum: a16089f06495dd5f7de1f5121d72ec45
55
docVersion: 0.4.0
6-
speakeasyVersion: 1.484.1
7-
generationVersion: 2.503.2
8-
releaseVersion: 2.1.6
9-
configChecksum: 21f134167daabccf2f501cd418de0227
6+
speakeasyVersion: 1.488.0
7+
generationVersion: 2.506.0
8+
releaseVersion: 2.1.11
9+
configChecksum: 6110142ef342c1d51bd542a38c650667
1010
repoURL: https://github.com/speakeasy-api/speakeasy-code-samples-ts.git
1111
installationURL: https://github.com/speakeasy-api/speakeasy-code-samples-ts
1212
published: true
1313
features:
1414
typescript:
1515
additionalDependencies: 0.1.0
16-
core: 3.18.22
16+
core: 3.19.0
1717
deepObjectParams: 0.1.0
1818
defaultEnabledRetries: 0.1.0
1919
devContainers: 2.90.0
@@ -115,7 +115,7 @@ examples:
115115
languages: ["python", "javascript"]
116116
responses:
117117
2XX:
118-
application/json: {"snippets": [{"path": "/sbin", "method": "<value>", "operationId": "<id>", "language": "<value>", "code": "<value>"}, {"path": "/root", "method": "<value>", "operationId": "<id>", "language": "<value>", "code": "<value>"}]}
118+
application/json: {"snippets": [{"path": "/sbin", "method": "<value>", "operationId": "<id>", "language": "php,", "code": "<value>"}, {"path": "/root", "method": "<value>", "operationId": "<id>", "language": "unity,", "code": "<value>"}]}
119119
4XX:
120120
application/json: {"message": "<value>", "status_code": 521235}
121121
default:

.speakeasy/gen.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ generation:
1616
oAuth2ClientCredentialsEnabled: false
1717
oAuth2PasswordEnabled: false
1818
typescript:
19-
version: 2.1.6
19+
version: 2.1.11
2020
additionalDependencies:
2121
dependencies:
22-
'@speakeasy-api/moonshine': ^0.69.0
22+
'@emotion/react': ^11.14.0
23+
codehike: ^1.0.4
2324
devDependencies: {}
24-
peerDependencies:
25-
highlight.js: ^11.11.1
25+
peerDependencies: {}
2626
additionalPackageJSON: {}
2727
author: Speakeasy
2828
clientServerStatusCodesAsErrors: true
@@ -43,7 +43,7 @@ typescript:
4343
inputModelSuffix: input
4444
maxMethodParams: 1
4545
methodArguments: require-security-and-request
46-
moduleFormat: dual
46+
moduleFormat: esm
4747
outputModelSuffix: output
4848
packageName: '@speakeasyapi/code-samples'
4949
responseFormat: flat

.speakeasy/workflow.lock

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
speakeasyVersion: 1.484.1
1+
speakeasyVersion: 1.488.0
22
sources:
33
speakeasy-OAS:
44
sourceNamespace: speakeasy-oas
5-
sourceRevisionDigest: sha256:67db66bfe8bee7caf24220f613e60760c90e0a7fe721b9f70d46e584d61a8d79
5+
sourceRevisionDigest: sha256:ceb63058aef0e2e7f88d746e8356be77e3bf8cb1cdf297aedc1b08ff912abc5f
66
sourceBlobDigest: sha256:63701f5ff26c0ac6e0ea6e314b9dc7bf7063bf75b72a16206b62050baf740623
77
tags:
88
- latest
@@ -11,8 +11,10 @@ targets:
1111
code_samples_typescript_sdk:
1212
source: speakeasy-OAS
1313
sourceNamespace: speakeasy-oas
14-
sourceRevisionDigest: sha256:67db66bfe8bee7caf24220f613e60760c90e0a7fe721b9f70d46e584d61a8d79
14+
sourceRevisionDigest: sha256:ceb63058aef0e2e7f88d746e8356be77e3bf8cb1cdf297aedc1b08ff912abc5f
1515
sourceBlobDigest: sha256:63701f5ff26c0ac6e0ea6e314b9dc7bf7063bf75b72a16206b62050baf740623
16+
codeSamplesNamespace: speakeasy-oas-typescript-code-samples
17+
codeSamplesRevisionDigest: sha256:7b6e59994169e6ffadcc883206b4b2e8d5bd04a69d9d71bc871916edaa94356c
1618
workflow:
1719
workflowVersion: 1.0.0
1820
speakeasyVersion: latest

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ yarn add @tanstack/react-query react react-dom
8787
```
8888

8989
> [!NOTE]
90-
> This package is published with CommonJS and ES Modules (ESM) support.
90+
> This package is published as an ES Module (ESM) only. For applications using
91+
> CommonJS, use `await import("@speakeasyapi/code-samples")` to import and use this package.
9192
<!-- End SDK Installation [installation] -->
9293
9394
<!-- Start Requirements [requirements] -->

example/package-lock.json

Lines changed: 6 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/src/App.tsx

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,12 @@
11
import {
22
CodeSample,
33
SpeakeasyCodeSamplesProvider,
4-
SupportedLanguage,
4+
CodeSampleFilenameTitle,
55
} from "@speakeasyapi/code-samples/react";
66
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
77
import "./App.css";
88
import { SpeakeasyCodeSamplesCore } from "@speakeasyapi/code-samples/core";
99

10-
const CodeSampleHeader = ({ lang }: { lang: SupportedLanguage }) => {
11-
let filename = "example";
12-
13-
switch (lang) {
14-
case "python":
15-
filename += ".py";
16-
break;
17-
case "ruby":
18-
filename += ".rb";
19-
break;
20-
case "terraform":
21-
filename += ".tf";
22-
break;
23-
case "typescript":
24-
filename += ".ts";
25-
break;
26-
case "csharp":
27-
case "unity":
28-
filename += ".cs";
29-
break;
30-
case "java":
31-
case "swift":
32-
case "php":
33-
case "go":
34-
filename += `.${lang}`;
35-
break;
36-
case "postman":
37-
filename += ".json";
38-
break;
39-
default:
40-
throw new Error("unsupported language: " + lang);
41-
}
42-
43-
return (
44-
<span style={{ color: "var(--ch-1)", marginLeft: 4 }}>{filename}</span>
45-
);
46-
};
47-
4810
function App() {
4911
const queryClient = new QueryClient();
5012
const coreSdk = new SpeakeasyCodeSamplesCore({
@@ -55,14 +17,11 @@ function App() {
5517
return (
5618
<QueryClientProvider client={queryClient}>
5719
<SpeakeasyCodeSamplesProvider client={coreSdk}>
58-
<h1 className="bg-background">Speakeasy Code Samples</h1>
20+
<h1 className="">Speakeasy Code Samples</h1>
5921
<div style={{ width: "660px" }}>
6022
<CodeSample
23+
title={CodeSampleFilenameTitle}
6124
operation={{ operationId: "getPassageText" }}
62-
heading={({ selectedLang }) => (
63-
<CodeSampleHeader lang={selectedLang} />
64-
)}
65-
mode="system"
6625
/>
6726
</div>
6827
</SpeakeasyCodeSamplesProvider>

example/src/index.css

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,6 @@
1313
-moz-osx-font-smoothing: grayscale;
1414
}
1515

16-
body {
17-
margin: 0;
18-
display: flex;
19-
place-items: center;
20-
min-width: 320px;
21-
min-height: 100vh;
22-
}
23-
24-
h1 {
25-
font-size: 3.2em;
26-
line-height: 1.1;
27-
}
28-
2916
@media (prefers-color-scheme: light) {
3017
:root {
3118
color: #213547;

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
{
44
"name": "@speakeasyapi/code-samples",
5-
"version": "2.1.6",
5+
"version": "2.1.11",
66
"exports": {
77
".": "./src/index.ts",
88
"./models/errors": "./src/models/errors/index.ts",

0 commit comments

Comments
 (0)