Skip to content

Commit

Permalink
📈 (repo) [DSDK-368]: Add backstage metadata (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbertin-ledger authored Jan 10, 2025
2 parents dd51763 + 72e7b0e commit 019e9b8
Show file tree
Hide file tree
Showing 31 changed files with 2,109 additions and 1,098 deletions.
4 changes: 2 additions & 2 deletions apps/docs/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import globals from "globals";
export default [
...baseConfig,
{
ignores: [".next"],
ignores: [".next", "**/_meta.js"],
},
{
languageOptions: {
Expand All @@ -15,7 +15,7 @@ export default [
},
{
files: [
"next.config.js",
"next.config.mjs",
"postcss.config.js",
"tailwind.config.js",
"theme.config.tsx",
Expand Down
8 changes: 0 additions & 8 deletions apps/docs/next.config.js

This file was deleted.

8 changes: 8 additions & 0 deletions apps/docs/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import nextra from "nextra";

const withNextra = nextra({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
});

export default withNextra();
12 changes: 7 additions & 5 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ledgerhq/ledger-dmk-docs",
"version": "1.0.0",
"description": "",
"description": "Device Management Kit documentation",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -19,14 +19,16 @@
"dependencies": {
"autoprefixer": "^10.4.17",
"next": "^14.2.15",
"nextra": "^2.13.3",
"nextra-theme-docs": "^2.13.3",
"postcss": "^8.4.35",
"nextra": "^3.0.13",
"nextra-theme-blog": "^3.0.13",
"nextra-theme-docs": "^3.0.15",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"tailwindcss": "^3.4.16"
"tailwindcss": "^3.4.16",
"tailwind-merge": "^1.14.0"
},
"devDependencies": {
"autoprefixer": "^10.4.17",
"@ledgerhq/eslint-config-dsdk": "workspace:*",
"@ledgerhq/prettier-config-dsdk": "workspace:*",
"@ledgerhq/tsconfig-dsdk": "workspace:*",
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions apps/docs/pages/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default {
index: {
title: "Home",
theme: {
layout: "raw",
},
display: "hidden",
},
docs: {
title: "Documentation",
type: "page",
},
};
13 changes: 0 additions & 13 deletions apps/docs/pages/_meta.json

This file was deleted.

8 changes: 8 additions & 0 deletions apps/docs/pages/docs/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default {
docs: "Ledger Device Management Kits",
explanations: "Explanations",
beginners: "Beginner's guide",
integration_walkthroughs: "Integration Walkthrough",
migrations: "Migrations",
references: "References (TSDoc)",
};
8 changes: 0 additions & 8 deletions apps/docs/pages/docs/_meta.json

This file was deleted.

6 changes: 6 additions & 0 deletions apps/docs/pages/docs/beginners/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
setup: "Setup",
init_dmk: "Initialize Device Management Kit",
discover_and_connect: "Discover and connect",
exchange_data: "Exchange data with the device",
};
6 changes: 0 additions & 6 deletions apps/docs/pages/docs/beginners/_meta.json

This file was deleted.

6 changes: 6 additions & 0 deletions apps/docs/pages/docs/explanations/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
introduction: "Why the Device Management Kit?",
ledgerjs: "Differences with LedgerJS",
dmk: "Device Management Kit",
signers: "Signer kits",
};
6 changes: 0 additions & 6 deletions apps/docs/pages/docs/explanations/_meta.json

This file was deleted.

5 changes: 5 additions & 0 deletions apps/docs/pages/docs/explanations/signers/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
eth: "Signer Ethereum (EVM)",
solana: "Signer Solana",
btc: "Signer Bitcoin",
};
5 changes: 0 additions & 5 deletions apps/docs/pages/docs/explanations/signers/_meta.json

This file was deleted.

3 changes: 3 additions & 0 deletions apps/docs/pages/docs/integration_walkthroughs/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
how_to: "How to ...",
};
3 changes: 0 additions & 3 deletions apps/docs/pages/docs/integration_walkthroughs/_meta.json

This file was deleted.

4 changes: 4 additions & 0 deletions apps/docs/pages/docs/integration_walkthroughs/how_to/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export default {
how_to_use_a_signer: "use a Signer",
build_custom_command: "build a custom command",
};

This file was deleted.

3 changes: 3 additions & 0 deletions apps/docs/pages/docs/migrations/_meta.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
"04_to_05": "DMK: Migrate from v0.4.0 to 0.5.0",
};
3 changes: 0 additions & 3 deletions apps/docs/pages/docs/migrations/_meta.json

This file was deleted.

3 changes: 2 additions & 1 deletion apps/docs/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"extends": "./tsconfig.json",
"include": [
"**/*.js",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"next.config.js",
"next.config.mjs",
"postcss.config.js",
"eslint.config.mjs",
"tailwind.config.js"
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.js",
"eslint.config.mjs",
"pages/_app.js",
"tailwind.config.js"
],
"exclude": ["node_modules"]
Expand Down
Binary file added apps/sample/public/devices.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/sample/public/devices_crop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/sample/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed apps/sample/public/nano-x.png
Binary file not shown.
3 changes: 3 additions & 0 deletions apps/sample/src/app/client-layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ const ClientRootLayout: React.FC<PropsWithChildren> = ({ children }) => {
<SignerEthProvider>
<StyleProvider selectedPalette="dark" fontsPath="/fonts">
<GlobalStyle />
<head>
<link rel="shortcut icon" href="../favicon.png" />
</head>
<body>
<Root>
<Sidebar />
Expand Down
18 changes: 7 additions & 11 deletions apps/sample/src/components/MainView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styled, { type DefaultTheme } from "styled-components";

import { ConnectDeviceActions } from "./ConnectDeviceActions";

const Root = styled(Flex)`
const Root = styled(Flex).attrs({ rowGap: 6 })`
flex: 1;
justify-content: center;
align-items: center;
Expand All @@ -18,14 +18,10 @@ const ErrorNotification = styled(Notification)`
width: 70%;
`;

const Description = styled(Text).attrs({ my: 6 })`
const Description = styled(Text)`
color: ${({ theme }: { theme: DefaultTheme }) => theme.colors.neutral.c70};
`;

const NanoLogo = styled(Image).attrs({ mb: 8 })`
transform: rotate(23deg);
`;

export const MainView: React.FC = () => {
const [connectionError, setConnectionError] = useState<DmkError | null>(null);

Expand All @@ -44,11 +40,11 @@ export const MainView: React.FC = () => {
}, [connectionError]);
return (
<Root>
<NanoLogo
src={"/nano-x.png"}
alt={"nano-x-logo"}
width={155}
height={250}
<Image
src={"/devices_crop.png"}
alt={"ledger-devices-image"}
width={400}
height={330}
/>
<Text variant={"h2Inter"} fontWeight={"semiBold"} textTransform={"none"}>
Ledger Device Management Kit
Expand Down
102 changes: 102 additions & 0 deletions catalog-info.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: device-management-kit-ts
description: Device Management Kit Library
tags:
- typescript
- sdk
- device-management-kit
annotations:
#backstage.io/techdocs-ref: dir:.
#backstage.io/adr-location: docs/architecture/decisions
github.com/project-slug: "LedgerHQ/device-sdk-ts"
github.com/team-slug: "LedgerHQ/live-devices"
ledger.com/code_repository: https://github.com/LedgerHQ/device-sdk-ts
ledger.com/documentation: https://developers.ledger.com/docs/device-interaction/getting-started
jira/project-key: DSDK
labels:
ledger.com/contains_pii: "no"
ledger.com/donjon_review: "on-demand"
license: Apache-2.0
spec:
type: library
lifecycle: production
owner: group:live-devices
system: ledger-device-management-kit
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: ts-device-management-kit
description: Device Management Kit Library
tags:
- typescript
- library
- device-management-kit
- npm
spec:
type: library
lifecycle: production
owner: group:live-devices
system: ledger-device-management-kit
subComponentOf: device-management-kit-ts
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: ts-device-signer-kit-ethereum
description: Signer Kit for ETH
spec:
type: library
lifecycle: production
owner: group:live-devices
system: ledger-device-management-kit
subComponentOf: ts-device-management-kit
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: ts-device-signer-kit-ethereum
description: Signer Kit for ETH
spec:
type: library
lifecycle: production
owner: group:live-devices
system: ledger-device-management-kit
subComponentOf: ts-device-management-kit
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: ts-device-signer-kit-solana
description: Signer Kit for Solana
tags:
- typescript
- signer
- solana
- npm
spec:
type: library
lifecycle: production
owner: group:live-devices
system: ledger-device-management-kit
subComponentOf: device-management-kit-ts
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: ts-context-module
description: Module for adding context to transactions
tags:
- typescript
- cal-service
- clear-signing
- npm
spec:
type: library
lifecycle: production
owner: group:live-devices
system: ledger-device-management-kit
subComponentOf: device-management-kit-ts
Loading

0 comments on commit 019e9b8

Please sign in to comment.