Skip to content
This repository has been archived by the owner on Jan 28, 2020. It is now read-only.

Commit

Permalink
rename dynamo > dynamon
Browse files Browse the repository at this point in the history
  • Loading branch information
deptno committed Apr 5, 2018
1 parent 86683b0 commit 1bf5071
Show file tree
Hide file tree
Showing 31 changed files with 71 additions and 110 deletions.
22 changes: 1 addition & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1 @@
MIT License

Copyright (c) 2018 Bonggyun Lee

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Apache 2.0 License
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# dynamob
# dynamon

Dynamo is GUI client for DynamoDB
Dynamon is GUI client for DynamoDB
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "dynamo",
"name": "dynamon",
"version": "0.1.0",
"description": "dynamodb client ui gui local",
"repository": "https://github.com/deptno/dynamo.git",
"description": "dynamodb GUI client",
"repository": "https://github.com/deptno/dynamon.git",
"author": "Bonggyun Lee <[email protected]>",
"license": "MIT",
"license": "Apache 2.0",
"private": true,
"workspaces": ["packages/*"],
"scripts": {
"dev": "yarn workspace dynamo-fe dev & yarn workspace dynamo dev",
"pack": "yarn workspace dynamo-fe build && yarn workspace dynamo pack",
"release": "yarn workspace dynamo-fe build && yarn workspace dynamo dist",
"dev": "yarn workspace dynamon-fe dev & yarn workspace dynamon dev",
"pack": "yarn workspace dynamon-fe build && yarn workspace dynamon pack",
"release": "yarn workspace dynamon-fe build && yarn workspace dynamon dist",
"precommit": "lint-staged"
},
"lint-staged": {
Expand Down
21 changes: 0 additions & 21 deletions packages/dynamo-engine/__tests__/dynamo-engine.spec.ts

This file was deleted.

3 changes: 0 additions & 3 deletions packages/dynamo-fe/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions packages/dynamo/README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# dynamob-engine
# dynamon-engine

aws-sdk wrapper
21 changes: 21 additions & 0 deletions packages/dynamon-engine/__tests__/dynamon-engine.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {DynamonDbTable, DynamonEngine} from '../index'

describe('dynamon engine', () => {
// const engine = new DynamonEngine()
// let tables: DynamonDbTable[]
// it('tables()', async done => {
// tables = await engine.tables()
// console.log(JSON.stringify(tables, null, 2))
// expect(tables).toBeTruthy()
// done()
// })
//
// describe('dynamo db table', () => {
// it('tables()', async done => {
// const [table] = tables
// const data = await table.scan()
// console.log(data)
// done()
// })
// })
})
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const awsConfig = {
endpoint : LOCAL_DYANMODB_ENDPOINT || 'http://localhost:8000',
}

export class DynamoEngine {
export class DynamonEngine {
private readonly dynamoDb: DynamoDB
private readonly docClient: DynamoDB.DocumentClient

Expand All @@ -18,16 +18,16 @@ export class DynamoEngine {
this.dynamoDb = new DynamoDB(config)
this.docClient = new DynamoDB.DocumentClient(config)
} catch (e) {
console.log('failover')
this.failover()
console.log('failOver')
this.failOver()
}
}

failover() {
failOver() {
this.tables = async () => []
}

async tables(): Promise<DynamoDbTable[]> {
async tables(): Promise<DynamonDbTable[]> {
try {
const {TableNames} = await this.dynamoDb.listTables({}).promise()

Expand All @@ -37,15 +37,15 @@ export class DynamoEngine {
return Table
}),
)
return tables.map(table => new DynamoDbTable(this.docClient, table))
return tables.map(table => new DynamonDbTable(this.docClient, table))
} catch (error) {
handleError(error)
return []
}
}
}

export class DynamoDbTable {
export class DynamonDbTable {
constructor(private docClient: DynamoDB.DocumentClient, public readonly table: DynamoDB.TableDescription) {
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "dynamo-engine",
"name": "dynamon-engine",
"version": "0.1.0",
"description": "dynamodb client ui gui local",
"description": "dynamodb wrapper",
"main": "index.js",
"repository": "https://github.com/deptno/dynamo.git",
"repository": "https://github.com/deptno/dynamon.git",
"author": "Bonggyun Lee <[email protected]>",
"license": "MIT",
"private": false,
Expand All @@ -23,28 +23,12 @@
"aws-sdk": "^2.218.1"
},
"jest": {
"moduleFileExtensions": [
"ts",
"tsx",
"js"
],
"moduleFileExtensions": ["ts", "tsx", "js"],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testMatch": [
"**/*.(test|spec).(ts|tsx)"
],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/out/",
"/dist/",
"/.*/"
],
"coverageReporters": [
"json",
"lcov",
"text",
"text-summary"
]
"testMatch": ["**/*.(test|spec).(ts|tsx)"],
"coveragePathIgnorePatterns": ["/node_modules/", "/out/", "/dist/", "/.*/"],
"coverageReporters": ["json", "lcov", "text", "text-summary"]
}
}
3 changes: 3 additions & 0 deletions packages/dynamon-fe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# dynamon-fe

Dynamon App build on React & Parcel
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "dynamo-fe",
"name": "dynamon-fe",
"version": "0.1.0",
"description": "dynamodb client ui gui local",
"description": "dynamon frontend",
"main": "index.js",
"repository": "https://github.com/deptno/dynamo.git",
"repository": "https://github.com/deptno/dynamon.git",
"author": "Bonggyun Lee <[email protected]>",
"license": "MIT",
"private": false,
Expand All @@ -16,7 +16,7 @@
},
"scripts": {
"dev": "parcel index.html --no-autoinstall",
"build": "parcel build index.html --public-url ./ --out-dir ../dynamo/client"
"build": "parcel build index.html --public-url ./ --out-dir ../dynamon/client"
},
"dependencies": {
"@blueprintjs/core": "^2.0.1",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/dynamon/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# dynamon

Dynamon is GUI client for DynamoDB
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/dynamo/index.ts → packages/dynamon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function createWindow() {
mainWindow = new BrowserWindow({
width : 1280,
height : 800,
title : 'Dynamo',
title : 'Dynamon',
webPreferences: {
nodeIntegration: false,
preload : __dirname + '/preload.js',
Expand Down
19 changes: 8 additions & 11 deletions packages/dynamo/ipc.ts → packages/dynamon/ipc.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {DbControl} from './built-in-db'
import {DynamoEngine, Endpoint} from 'dynamo-engine'
import {DynamonEngine, Endpoint} from 'dynamon-engine'

let dynamo: DynamoEngine
let dynamon: DynamonEngine

export async function ipcHandler(db: Promise<DbControl>, {sender}, action) {
const {type, payload} = action
Expand Down Expand Up @@ -34,8 +34,8 @@ export async function ipcHandler(db: Promise<DbControl>, {sender}, action) {
break
}
case 'read tables': {
dynamo = engine(payload)
const tables = await dynamo.tables()
dynamon = engine(payload)
const tables = await dynamon.tables()
send(tables.map(table => table.table))
break
}
Expand All @@ -58,7 +58,7 @@ export async function ipcHandler(db: Promise<DbControl>, {sender}, action) {
}

case 'read records': {
const tables = await dynamo.tables()
const tables = await dynamon.tables()
const table = tables.find(table => table.name() === payload)
const {Items} = await table.scan()
const keys = table.keySchema()
Expand Down Expand Up @@ -115,11 +115,11 @@ function createEngineGetter() {
return function getEngine(endpoint: Endpoint, forceNew?: boolean) {
console.log('cache', engines)
try {
const endgine = new DynamoEngine(endpoint)
const engine = new DynamonEngine(endpoint)
if (forceNew) {
return (engines[endpoint.region] = endgine)
return (engines[endpoint.region] = engine)
}
return engines[endpoint.region] || (engines[endpoint.region] = endgine)
return engines[endpoint.region] || (engines[endpoint.region] = engine)
} catch (ex) {
console.error(ex)
console.error('error')
Expand All @@ -129,6 +129,3 @@ function createEngineGetter() {
}
}
}

//

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "dynamo",
"name": "dynamon",
"version": "0.1.0",
"description": "dynamodb client ui gui local",
"description": "dynamodb GUI client",
"main": "index.js",
"repository": "https://github.com/deptno/dynamo.git",
"repository": "https://github.com/deptno/dynamon.git",
"author": "Bonggyun Lee <[email protected]>",
"license": "MIT",
"private": false,
Expand All @@ -22,7 +22,7 @@
},
"dependencies": {
"detect-port": "^1.2.2",
"dynamo-engine": "*",
"dynamon-engine": "*",
"dynamodb-localhost": "^0.0.5",
"mkdirp": "^0.5.1"
}
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/react-deep-json-table/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "react-deep-json-table",
"version": "0.1.0",
"description": "dynamodb client ui gui local",
"description": "deep json table",
"main": "dist/index.js",
"repository": "https://github.com/deptno/dynamo.git",
"repository": "https://github.com/deptno/dynamon.git",
"author": "Bonggyun Lee <[email protected]>",
"license": "MIT",
"private": false,
Expand Down

0 comments on commit 1bf5071

Please sign in to comment.