Skip to content

Commit

Permalink
chore: adjust language names (#8117)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew authored Sep 6, 2024
1 parent e8fee92 commit 0fa3738
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
24 changes: 12 additions & 12 deletions frontend/src/component/onboarding/sdkSnippets.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { SdkName } from './sharedTypes';

export const installCommands: Record<SdkName, string> = {
Node: ' npm install unleash-client',
Golang: 'go get github.com/Unleash/unleash-client-go/v3',
'Node.js': ' npm install unleash-client',
Go: 'go get github.com/Unleash/unleash-client-go/v3',
Ruby: 'gem install unleash',
PHP: 'composer require unleash/client',
Rust: 'cargo add unleash-client',
DotNet: `dotnet add package unleash.client
'.NET': `dotnet add package unleash.client
// If you do not have a json library in your project:
dotnet add package Newtonsoft.Json`,
Java: `<dependency>
Expand All @@ -15,7 +15,7 @@ dotnet add package Newtonsoft.Json`,
<version>Latest version here</version>
</dependency>`,
Python: 'pip install UnleashClient',
Javascript: 'npm install unleash-proxy-client',
JavaScript: 'npm install unleash-proxy-client',
React: 'npm install @unleash/proxy-client-react unleash-proxy-client',
Vue: 'npm install @unleash/proxy-client-vue',
Svelte: 'npm install @unleash/proxy-client-svelte',
Expand All @@ -29,7 +29,7 @@ dotnet add package Newtonsoft.Json`,
};

export const initializeCodeSnippets: Record<SdkName, string> = {
Node: `const { initialize } = require('unleash-client');
'Node.js': `const { initialize } = require('unleash-client');
const unleash = initialize({
url: '<YOUR_API_URL>',
Expand All @@ -38,7 +38,7 @@ const unleash = initialize({
metricsInterval: 5000,
});
`,
Golang: `import (
Go: `import (
"github.com/Unleash/unleash-client-go/v3"
)
Expand Down Expand Up @@ -74,7 +74,7 @@ $unleash = UnleashBuilder::create()
"<YOUR_API_TOKEN>",
)?;
client.register().await?;`,
DotNet: `using Unleash;
'.NET': `using Unleash;
var settings = new UnleashSettings()
{
AppName = "unleash-onboarding-dotnet",
Expand All @@ -100,7 +100,7 @@ client = UnleashClient(
custom_headers={'Authorization': '<YOUR_API_TOKEN>"'})
client.initialize_client()`,
Javascript: `import { UnleashClient } from 'unleash-proxy-client';
JavaScript: `import { UnleashClient } from 'unleash-proxy-client';
const unleash = new UnleashClient({
url: '<YOUR_API_URL>',
Expand Down Expand Up @@ -188,18 +188,18 @@ final unleash = UnleashClient(

// TODO: add idiomatic way of checking flag status that will populate metrics
export const checkFlagCodeSnippets: Record<SdkName, string> = {
Node: `setInterval(() => {
'Node.js': `setInterval(() => {
console.log('Is enabled', unleash.isEnabled('<YOUR_FLAG>'));
}, 1000);
`,
Golang: ``,
Go: ``,
Ruby: ``,
PHP: ``,
Rust: ``,
DotNet: ``,
'.NET': ``,
Java: ``,
Python: ``,
Javascript: ``,
JavaScript: ``,
React: ``,
Vue: ``,
Svelte: ``,
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/component/onboarding/sharedTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ import flutter from '../../assets/icons/sdks/Logo-flutter.svg';
export type SdkType = 'client' | 'frontend';
export type Sdk = { name: SdkName; type: SdkType };
export type ServerSdkName =
| 'Node'
| 'Golang'
| 'Node.js'
| 'Go'
| '.NET'
| 'Ruby'
| 'PHP'
| 'Rust'
| 'DotNet'
| 'Java'
| 'Python';
export type ClientSdkName =
| 'Javascript'
| 'JavaScript'
| 'React'
| 'Vue'
| 'Svelte'
Expand All @@ -36,17 +36,17 @@ export type ClientSdkName =
export type SdkName = ServerSdkName | ClientSdkName;

export const serverSdks: { name: ServerSdkName; icon: string }[] = [
{ name: 'Node', icon: node },
{ name: 'Golang', icon: go },
{ name: 'Node.js', icon: node },
{ name: 'Go', icon: go },
{ name: 'Ruby', icon: ruby },
{ name: 'PHP', icon: php },
{ name: 'Rust', icon: rust },
{ name: 'DotNet', icon: dotnet },
{ name: '.NET', icon: dotnet },
{ name: 'Java', icon: java },
{ name: 'Python', icon: python },
];
export const clientSdks: { name: ClientSdkName; icon: string }[] = [
{ name: 'Javascript', icon: javascript },
{ name: 'JavaScript', icon: javascript },
{ name: 'React', icon: react },
{ name: 'Vue', icon: vue },
{ name: 'Svelte', icon: svelte },
Expand Down

0 comments on commit 0fa3738

Please sign in to comment.