Skip to content

Commit

Permalink
refactor: Removed the word toolbox from everywhere and changed it to …
Browse files Browse the repository at this point in the history
…siera-x

Signed-off-by: Tom Lanser <[email protected]>
  • Loading branch information
Tommylans committed Feb 3, 2023
1 parent 814950e commit f3c8178
Show file tree
Hide file tree
Showing 95 changed files with 94 additions and 94 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ jobs:
sudo spctl --master-disable
yarn --cwd packages/toolbox-electron make -p darwin --arch ${{ matrix.arch }}
yarn --cwd packages/siera-desktop make -p darwin --arch ${{ matrix.arch }}
- name: Upload artifacts
uses: actions/upload-artifact@v3
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || github.event_name == 'workflow_dispatch'
with:
name: toolbox-electron-macos-${{ matrix.arch }}
path: ./packages/toolbox-electron/out/make/**/*.*
name: siera-desktop-macos-${{ matrix.arch }}
path: ./packages/siera-desktop/out/make/**/*.*
retention-days: 7

release:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</picture>
</p>

<h1 align="center" ><b>Animo Toolbox</b></h1>
<h1 align="center" ><b>Siera Desktop</b></h1>

<h4 align="center">Powered by &nbsp;
<picture>
Expand Down Expand Up @@ -45,11 +45,11 @@

All packages are placed in the [`packages/`](./packages) directory.

| Package | Version | Description |
| ------------------------------------------------- | ------- | --------------------------------------- |
| [`toolbox-electron`](./packages/toolbox-electron) | 0.0.1 | Electron app for controlling the agent. |
| [`toolbox-ui`](./packages/toolbox-ui) | 0.0.1 | UI components. |
| [`toolbox-core`](./packages/toolbox-core) | 0.0.1 | The core behind the application. |
| Package | Version | Description |
|---------------------------------------------| ------- | --------------------------------------- |
| [`siera-desktop`](./packages/siera-desktop) | 0.0.1 | Electron app for controlling the agent. |
| [`siera-ui`](./packages/siera-ui) | 0.0.1 | UI components. |
| [`siera-core`](./packages/siera-core) | 0.0.1 | The core behind the application. |

## Getting Started

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "toolbox",
"name": "siera-desktop",
"repository": {
"type": "git",
"url": "https://github.com/animo/toolbox"
"url": "https://github.com/animo/siera-desktop"
},
"author": {
"url": "https://animo.id",
Expand All @@ -22,7 +22,7 @@
]
},
"scripts": {
"postinstall": "(cd packages/toolbox-electron && patch-package) && patch-package",
"postinstall": "(cd packages/siera-desktop && patch-package) && patch-package",
"check-types": "yarn check-types:build && yarn check-types:tests",
"check-types:tests": "tsc -p tsconfig.test.json --noEmit",
"check-types:build": "yarn workspaces run tsc --noEmit -p tsconfig.build.json",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@animo/toolbox-core",
"name": "@animo/siera-core",
"version": "0.0.1",
"main": "src/index.ts",
"license": "Apache-2.0",
"private": true,
"repository": {
"type": "git",
"url": "https://github.com/animo/toolbox",
"directory": "packages/toolbox-core"
"url": "https://github.com/animo/siera-desktop",
"directory": "packages/siera-core"
},
"author": {
"url": "https://animo.id",
Expand Down
6 changes: 6 additions & 0 deletions packages/siera-core/src/agent/config/ConfigFileRepository.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { SieraUiConfig } from './SieraUiConfig'

export interface ConfigFileRepository {
readConfiguration(): Promise<SieraUiConfig>
writeConfiguration(config: SieraUiConfig): Promise<void>
}
6 changes: 6 additions & 0 deletions packages/siera-core/src/agent/config/DefaultConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type { SieraUiConfig } from './SieraUiConfig'

export const DefaultConfiguration: SieraUiConfig = {
colorScheme: 'light',
agents: [],
}
11 changes: 11 additions & 0 deletions packages/siera-core/src/agent/config/SieraUiConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { AgentConfigRecord } from './AgentConfigRecord'

import { SieraUiConfigSchema } from './adapters/SieraUiConfigValidation'
export interface SieraUiConfig {
colorScheme: 'dark' | 'light'
agents: AgentConfigRecord[]
}

export const validateAndParseSieraUiConfig = (config: unknown): SieraUiConfig => {
return SieraUiConfigSchema.parse(config) as SieraUiConfig
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { ConfigFileRepository } from '../ConfigFileRepository'
import type { SieraUiConfig } from '../SieraUiConfig'

export class InMemoryConfigRepository implements ConfigFileRepository {
public constructor(private config: SieraUiConfig) {}

public async readConfiguration(): Promise<SieraUiConfig> {
return this.config
}

public async writeConfiguration(config: SieraUiConfig): Promise<void> {
this.config = config
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const AgentConfigRecordSchema = z.object({
agentConfig: InitConfigSchema,
})

export const ToolboxConfigSchema = z.object({
export const SieraUiConfigSchema = z.object({
colorScheme: z.enum(['light', 'dark']).default('light'),
agents: z.array(AgentConfigRecordSchema).default([]),
})
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './ToolboxConfig'
export * from './SieraUiConfig'
export * from './ConfigFileRepository'
export * from './AgentConfigRecord'
export * from './DefaultConfiguration'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@animo/toolbox-electron",
"productName": "toolbox-electron",
"name": "@animo/siera-desktop",
"productName": "siera-desktop",
"version": "0.0.1",
"description": "My Electron application description",
"main": ".webpack/main",
Expand All @@ -23,7 +23,7 @@
"repository": {
"type": "git",
"url": "https://github.com/animo/siera-desktop",
"directory": "packages/toolbox-electron"
"directory": "packages/siera-desktop"
},
"config": {
"forge": "./forge.config.js"
Expand Down Expand Up @@ -58,8 +58,8 @@
"typescript": "~4.5.4"
},
"dependencies": {
"@animo/toolbox-core": "*",
"@animo/toolbox-ui": "*",
"@animo/siera-core": "*",
"@animo/siera-ui": "*",
"@aries-framework/core": "0.3.0-alpha.32",
"@aries-framework/node": "^0.2.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.8",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { ConfigFileRepository, ToolboxConfig } from '@animo/toolbox-core'
import type { ConfigFileRepository, SieraUiConfig } from '@animo/siera-core'

import { DefaultConfiguration, validateAndParseToolboxConfig } from '@animo/toolbox-core'
import { DefaultConfiguration, validateAndParseSieraUiConfig } from '@animo/siera-core'

export class ElectronConfigFileRepository implements ConfigFileRepository {
public constructor(public readonly configPath: string) {}

public async readConfiguration(): Promise<ToolboxConfig> {
public async readConfiguration(): Promise<SieraUiConfig> {
const exists = await window.fs.exists(this.configPath)
if (!exists) return DefaultConfiguration

Expand All @@ -14,13 +14,13 @@ export class ElectronConfigFileRepository implements ConfigFileRepository {

const config = JSON.parse(configString)

return validateAndParseToolboxConfig(config)
return validateAndParseSieraUiConfig(config)
}

public async writeConfiguration(config: ToolboxConfig): Promise<void> {
public async writeConfiguration(config: SieraUiConfig): Promise<void> {
const filePath = this.configPath

const validatedConfig = validateAndParseToolboxConfig(config)
const validatedConfig = validateAndParseSieraUiConfig(config)

const configString = JSON.stringify(validatedConfig)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AgentDependenciesProvider } from '@animo/toolbox-core'
import type { AgentDependenciesProvider } from '@animo/siera-core'
import type { AgentDependencies } from '@aries-framework/core'
import type Indy from 'indy-sdk'
import type { RequestInit } from 'node-fetch'
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { ReactNode } from 'react'

import { DefaultConfiguration, InMemoryConfigRepository } from '@animo/toolbox-core'
import { ToolboxApp } from '@animo/toolbox-ui/src/ToolboxApp'
import { AgentContext } from '@animo/toolbox-ui/src/contexts/AgentContext'
import { AgentManagerProvider, useCurrentAgentRecord } from '@animo/toolbox-ui/src/contexts/AgentManagerContext'
import { ConfigProvider } from '@animo/toolbox-ui/src/contexts/ConfigProvider'
import { routes } from '@animo/toolbox-ui/src/routes'
import { DefaultConfiguration, InMemoryConfigRepository } from '@animo/siera-core'
import { SieraUiApp } from '@animo/siera-ui/src/SieraUiApp'
import { AgentContext } from '@animo/siera-ui/src/contexts/AgentContext'
import { AgentManagerProvider, useCurrentAgentRecord } from '@animo/siera-ui/src/contexts/AgentManagerContext'
import { ConfigProvider } from '@animo/siera-ui/src/contexts/ConfigProvider'
import { routes } from '@animo/siera-ui/src/routes'
import React from 'react'
import { createMemoryRouter } from 'react-router-dom'

Expand Down Expand Up @@ -40,7 +40,7 @@ export const App = () => {
<ConfigProvider configRepository={configRepository}>
<AgentManagerProvider>
<AgentContextWrapper>
<ToolboxApp router={router} />
<SieraUiApp router={router} />
</AgentContextWrapper>
</AgentManagerProvider>
</ConfigProvider>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@animo/toolbox-ui",
"name": "@animo/siera-ui",
"version": "0.0.1",
"main": "src/index.ts",
"license": "Apache-2.0",
Expand All @@ -11,8 +11,8 @@
},
"repository": {
"type": "git",
"url": "https://github.com/animo/toolbox",
"directory": "packages/toolbox-ui"
"url": "https://github.com/animo/siera-desktop",
"directory": "packages/siera-ui"
},
"scripts": {
"build": "yarn run clean && yarn run compile",
Expand All @@ -22,7 +22,7 @@
"test": "jest"
},
"dependencies": {
"@animo/toolbox-core": "*",
"@animo/siera-core": "*",
"@aries-framework/core": "0.3.0-alpha.32",
"@aries-framework/react-hooks": "^0.3.1",
"@emotion/react": "^11.10.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,24 @@ import { NotificationsProvider } from '@mantine/notifications'
import React from 'react'
import { RouterProvider } from 'react-router-dom'

import { toolboxTheme } from './ToolboxTheme'
import { sieraUiTheme } from './SieraUiTheme'
import { GlobalErrorHandler } from './components/GlobalErrorHandler'
import { useConfigUnsafe } from './contexts/ConfigProvider'
import { PresentInviteModal } from './modals/PresentInviteModal'

interface ToolboxAppProps {
interface SieraUiAppProps {
router: RouterProviderProps['router']
}

export const ToolboxApp = ({ router }: ToolboxAppProps) => {
export const SieraUiApp = ({ router }: SieraUiAppProps) => {
const { config, setColorScheme } = useConfigUnsafe()

const colorScheme = config?.colorScheme ?? 'light'
const toggleColorScheme = (value?: ColorScheme) => setColorScheme(value || colorScheme === 'dark' ? 'light' : 'dark')

return (
<ColorSchemeProvider colorScheme={colorScheme} toggleColorScheme={toggleColorScheme}>
<MantineProvider withGlobalStyles withNormalizeCSS theme={toolboxTheme(colorScheme)}>
<MantineProvider withGlobalStyles withNormalizeCSS theme={sieraUiTheme(colorScheme)}>
<NotificationsProvider position="top-right">
<ModalsProvider modals={{ presentInvite: PresentInviteModal }}>
<GlobalErrorHandler>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ColorScheme, MantineThemeOverride, Tuple } from '@mantine/core'

import { animoLightTheme, animoDarkTheme } from './layout/themes'

export const toolboxTheme = (colorScheme: ColorScheme): MantineThemeOverride => ({
export const sieraUiTheme = (colorScheme: ColorScheme): MantineThemeOverride => ({
colorScheme: colorScheme,
colors: colorScheme === 'dark' ? animoDarkTheme : animoLightTheme,

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ConnectionRecord } from '@aries-framework/core'

import { ConnectionsUtil } from '@animo/toolbox-core/src/utils/records/ConnectionsUtil'
import { ConnectionsUtil } from '@animo/siera-core/src/utils/records/ConnectionsUtil'
import { createStyles, Group, ScrollArea, Table, Text } from '@mantine/core'
import React from 'react'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ConnectionRecord, CredentialExchangeRecord } from '@aries-framework/core'

import { formatSchemaName } from '@animo/toolbox-core/src/utils'
import { CredentialsUtil } from '@animo/toolbox-core/src/utils/records/CredentialsUtil'
import { formatSchemaName } from '@animo/siera-core/src/utils'
import { CredentialsUtil } from '@animo/siera-core/src/utils/records/CredentialsUtil'
import { createStyles, Group, ScrollArea, Table, Text } from '@mantine/core'
import React from 'react'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ConnectionRecord, ProofExchangeRecord } from '@aries-framework/core'

import { ProofsUtil } from '@animo/toolbox-core/src/utils/records/ProofsUtil'
import { ProofsUtil } from '@animo/siera-core/src/utils/records/ProofsUtil'
import { createStyles, Group, ScrollArea, Table, Text } from '@mantine/core'
import React from 'react'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { AgentConfigRecord, AgentDependenciesProvider } from '@animo/toolbox-core'
import type { AgentConfigRecord, AgentDependenciesProvider } from '@animo/siera-core'
import type { Agent } from '@aries-framework/core'
import type { PropsWithChildren } from 'react'

import { agentInitializer } from '@animo/toolbox-core/src/agent/AgentInitializer'
import { agentInitializer } from '@animo/siera-core/src/agent/AgentInitializer'
import AgentProvider from '@aries-framework/react-hooks'
import React, { useEffect, useState } from 'react'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AgentConfigRecord } from '@animo/toolbox-core'
import type { AgentConfigRecord } from '@animo/siera-core'
import type { ReactNode } from 'react'

import React, { createContext, useContext, useMemo, useState } from 'react'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { AgentConfigRecord, ConfigFileRepository, ToolboxConfig } from '@animo/toolbox-core'
import type { AgentConfigRecord, ConfigFileRepository, SieraUiConfig } from '@animo/siera-core'
import type { ReactNode } from 'react'

import React, { createContext, useContext, useEffect, useState } from 'react'

type ConfigContext = {
config?: ToolboxConfig
config?: SieraUiConfig
loading: boolean
addAgent: (agent: AgentConfigRecord) => Promise<void>
setColorScheme: (colorScheme: 'dark' | 'light') => Promise<void>
Expand Down Expand Up @@ -33,9 +33,9 @@ interface ConfigProviderProps {

export const ConfigProvider = ({ children, configRepository }: ConfigProviderProps) => {
const [loading, setLoading] = useState(true)
const [config, setConfig] = useState<ToolboxConfig>()
const [config, setConfig] = useState<SieraUiConfig>()

const saveConfig = async (config: ToolboxConfig) => {
const saveConfig = async (config: SieraUiConfig) => {
await configRepository.writeConfiguration(config)
}

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { uuid } from '@animo/toolbox-core/src/utils'
import { uuid } from '@animo/siera-core/src/utils'
import { createStyles, TextInput, Paper, Title } from '@mantine/core'
import { useForm } from '@mantine/form'
import React from 'react'
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions packages/toolbox-core/src/agent/config/ToolboxConfig.ts

This file was deleted.

Loading

0 comments on commit f3c8178

Please sign in to comment.