From 1bf507193f6c12ade3a31e043b127562c9838cc4 Mon Sep 17 00:00:00 2001 From: bglee Date: Thu, 5 Apr 2018 19:25:47 +0900 Subject: [PATCH] rename dynamo > dynamon --- LICENSE | 22 +------------- README.md | 4 +-- package.json | 14 ++++----- .../__tests__/dynamo-engine.spec.ts | 21 ------------- packages/dynamo-fe/README.md | 3 -- packages/dynamo/README.md | 3 -- .../README.md | 2 +- .../__tests__/dynamon-engine.spec.ts | 21 +++++++++++++ .../index.ts | 14 ++++----- .../package.json | 30 +++++-------------- .../tsconfig.json | 0 packages/dynamon-fe/README.md | 3 ++ .../components/Home.tsx | 0 .../components/Json.tsx | 0 .../components/Select.tsx | 0 .../components/StackableJsonTable.tsx | 0 packages/{dynamo-fe => dynamon-fe}/index.html | 0 packages/{dynamo-fe => dynamon-fe}/index.tsx | 0 .../lib/redux-universal-electron.ts | 0 .../{dynamo-fe => dynamon-fe}/package.json | 8 ++--- .../{dynamo-fe => dynamon-fe}/redux/index.ts | 0 packages/{dynamo-fe => dynamon-fe}/store.ts | 0 .../{dynamo-fe => dynamon-fe}/tsconfig.json | 0 packages/dynamon/README.md | 3 ++ packages/{dynamo => dynamon}/built-in-db.ts | 0 packages/{dynamo => dynamon}/index.ts | 2 +- packages/{dynamo => dynamon}/ipc.ts | 19 +++++------- packages/{dynamo => dynamon}/package.json | 8 ++--- packages/{dynamo => dynamon}/preload.ts | 0 packages/{dynamo => dynamon}/tsconfig.json | 0 packages/react-deep-json-table/package.json | 4 +-- 31 files changed, 71 insertions(+), 110 deletions(-) delete mode 100644 packages/dynamo-engine/__tests__/dynamo-engine.spec.ts delete mode 100644 packages/dynamo-fe/README.md delete mode 100644 packages/dynamo/README.md rename packages/{dynamo-engine => dynamon-engine}/README.md (50%) create mode 100644 packages/dynamon-engine/__tests__/dynamon-engine.spec.ts rename packages/{dynamo-engine => dynamon-engine}/index.ts (87%) rename packages/{dynamo-engine => dynamon-engine}/package.json (51%) rename packages/{dynamo-engine => dynamon-engine}/tsconfig.json (100%) create mode 100644 packages/dynamon-fe/README.md rename packages/{dynamo-fe => dynamon-fe}/components/Home.tsx (100%) rename packages/{dynamo-fe => dynamon-fe}/components/Json.tsx (100%) rename packages/{dynamo-fe => dynamon-fe}/components/Select.tsx (100%) rename packages/{dynamo-fe => dynamon-fe}/components/StackableJsonTable.tsx (100%) rename packages/{dynamo-fe => dynamon-fe}/index.html (100%) rename packages/{dynamo-fe => dynamon-fe}/index.tsx (100%) rename packages/{dynamo-fe => dynamon-fe}/lib/redux-universal-electron.ts (100%) rename packages/{dynamo-fe => dynamon-fe}/package.json (85%) rename packages/{dynamo-fe => dynamon-fe}/redux/index.ts (100%) rename packages/{dynamo-fe => dynamon-fe}/store.ts (100%) rename packages/{dynamo-fe => dynamon-fe}/tsconfig.json (100%) create mode 100644 packages/dynamon/README.md rename packages/{dynamo => dynamon}/built-in-db.ts (100%) rename packages/{dynamo => dynamon}/index.ts (96%) rename packages/{dynamo => dynamon}/ipc.ts (93%) rename packages/{dynamo => dynamon}/package.json (80%) rename packages/{dynamo => dynamon}/preload.ts (100%) rename packages/{dynamo => dynamon}/tsconfig.json (100%) diff --git a/LICENSE b/LICENSE index 397124d..0f7fde2 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/README.md b/README.md index c28b5f2..d656ee1 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ -# dynamob +# dynamon -Dynamo is GUI client for DynamoDB \ No newline at end of file +Dynamon is GUI client for DynamoDB diff --git a/package.json b/package.json index 985bcf6..6615512 100644 --- a/package.json +++ b/package.json @@ -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 ", - "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": { diff --git a/packages/dynamo-engine/__tests__/dynamo-engine.spec.ts b/packages/dynamo-engine/__tests__/dynamo-engine.spec.ts deleted file mode 100644 index 4ce7a91..0000000 --- a/packages/dynamo-engine/__tests__/dynamo-engine.spec.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {DynamoDbTable, DynamoEngine} from '../index' - -describe('dynamo engine', () => { - const engine = new DynamoEngine() - let tables: DynamoDbTable[] - 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() - }) - }) -}) diff --git a/packages/dynamo-fe/README.md b/packages/dynamo-fe/README.md deleted file mode 100644 index 31b8aef..0000000 --- a/packages/dynamo-fe/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# dynamob-fe - -Dynamo App build on React & Parcel \ No newline at end of file diff --git a/packages/dynamo/README.md b/packages/dynamo/README.md deleted file mode 100644 index c28b5f2..0000000 --- a/packages/dynamo/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# dynamob - -Dynamo is GUI client for DynamoDB \ No newline at end of file diff --git a/packages/dynamo-engine/README.md b/packages/dynamon-engine/README.md similarity index 50% rename from packages/dynamo-engine/README.md rename to packages/dynamon-engine/README.md index f045173..e0cabfc 100644 --- a/packages/dynamo-engine/README.md +++ b/packages/dynamon-engine/README.md @@ -1,3 +1,3 @@ -# dynamob-engine +# dynamon-engine aws-sdk wrapper diff --git a/packages/dynamon-engine/__tests__/dynamon-engine.spec.ts b/packages/dynamon-engine/__tests__/dynamon-engine.spec.ts new file mode 100644 index 0000000..b222ef3 --- /dev/null +++ b/packages/dynamon-engine/__tests__/dynamon-engine.spec.ts @@ -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() + // }) + // }) +}) diff --git a/packages/dynamo-engine/index.ts b/packages/dynamon-engine/index.ts similarity index 87% rename from packages/dynamo-engine/index.ts rename to packages/dynamon-engine/index.ts index 7846c6b..ad4e533 100644 --- a/packages/dynamo-engine/index.ts +++ b/packages/dynamon-engine/index.ts @@ -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 @@ -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 { + async tables(): Promise { try { const {TableNames} = await this.dynamoDb.listTables({}).promise() @@ -37,7 +37,7 @@ 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 [] @@ -45,7 +45,7 @@ export class DynamoEngine { } } -export class DynamoDbTable { +export class DynamonDbTable { constructor(private docClient: DynamoDB.DocumentClient, public readonly table: DynamoDB.TableDescription) { } diff --git a/packages/dynamo-engine/package.json b/packages/dynamon-engine/package.json similarity index 51% rename from packages/dynamo-engine/package.json rename to packages/dynamon-engine/package.json index 432fe62..6b7cb6e 100644 --- a/packages/dynamo-engine/package.json +++ b/packages/dynamon-engine/package.json @@ -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 ", "license": "MIT", "private": false, @@ -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"] } } diff --git a/packages/dynamo-engine/tsconfig.json b/packages/dynamon-engine/tsconfig.json similarity index 100% rename from packages/dynamo-engine/tsconfig.json rename to packages/dynamon-engine/tsconfig.json diff --git a/packages/dynamon-fe/README.md b/packages/dynamon-fe/README.md new file mode 100644 index 0000000..e4cf297 --- /dev/null +++ b/packages/dynamon-fe/README.md @@ -0,0 +1,3 @@ +# dynamon-fe + +Dynamon App build on React & Parcel diff --git a/packages/dynamo-fe/components/Home.tsx b/packages/dynamon-fe/components/Home.tsx similarity index 100% rename from packages/dynamo-fe/components/Home.tsx rename to packages/dynamon-fe/components/Home.tsx diff --git a/packages/dynamo-fe/components/Json.tsx b/packages/dynamon-fe/components/Json.tsx similarity index 100% rename from packages/dynamo-fe/components/Json.tsx rename to packages/dynamon-fe/components/Json.tsx diff --git a/packages/dynamo-fe/components/Select.tsx b/packages/dynamon-fe/components/Select.tsx similarity index 100% rename from packages/dynamo-fe/components/Select.tsx rename to packages/dynamon-fe/components/Select.tsx diff --git a/packages/dynamo-fe/components/StackableJsonTable.tsx b/packages/dynamon-fe/components/StackableJsonTable.tsx similarity index 100% rename from packages/dynamo-fe/components/StackableJsonTable.tsx rename to packages/dynamon-fe/components/StackableJsonTable.tsx diff --git a/packages/dynamo-fe/index.html b/packages/dynamon-fe/index.html similarity index 100% rename from packages/dynamo-fe/index.html rename to packages/dynamon-fe/index.html diff --git a/packages/dynamo-fe/index.tsx b/packages/dynamon-fe/index.tsx similarity index 100% rename from packages/dynamo-fe/index.tsx rename to packages/dynamon-fe/index.tsx diff --git a/packages/dynamo-fe/lib/redux-universal-electron.ts b/packages/dynamon-fe/lib/redux-universal-electron.ts similarity index 100% rename from packages/dynamo-fe/lib/redux-universal-electron.ts rename to packages/dynamon-fe/lib/redux-universal-electron.ts diff --git a/packages/dynamo-fe/package.json b/packages/dynamon-fe/package.json similarity index 85% rename from packages/dynamo-fe/package.json rename to packages/dynamon-fe/package.json index a2ba19c..f8eb05e 100644 --- a/packages/dynamo-fe/package.json +++ b/packages/dynamon-fe/package.json @@ -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 ", "license": "MIT", "private": false, @@ -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", diff --git a/packages/dynamo-fe/redux/index.ts b/packages/dynamon-fe/redux/index.ts similarity index 100% rename from packages/dynamo-fe/redux/index.ts rename to packages/dynamon-fe/redux/index.ts diff --git a/packages/dynamo-fe/store.ts b/packages/dynamon-fe/store.ts similarity index 100% rename from packages/dynamo-fe/store.ts rename to packages/dynamon-fe/store.ts diff --git a/packages/dynamo-fe/tsconfig.json b/packages/dynamon-fe/tsconfig.json similarity index 100% rename from packages/dynamo-fe/tsconfig.json rename to packages/dynamon-fe/tsconfig.json diff --git a/packages/dynamon/README.md b/packages/dynamon/README.md new file mode 100644 index 0000000..d656ee1 --- /dev/null +++ b/packages/dynamon/README.md @@ -0,0 +1,3 @@ +# dynamon + +Dynamon is GUI client for DynamoDB diff --git a/packages/dynamo/built-in-db.ts b/packages/dynamon/built-in-db.ts similarity index 100% rename from packages/dynamo/built-in-db.ts rename to packages/dynamon/built-in-db.ts diff --git a/packages/dynamo/index.ts b/packages/dynamon/index.ts similarity index 96% rename from packages/dynamo/index.ts rename to packages/dynamon/index.ts index 00d11df..57c1383 100644 --- a/packages/dynamo/index.ts +++ b/packages/dynamon/index.ts @@ -30,7 +30,7 @@ function createWindow() { mainWindow = new BrowserWindow({ width : 1280, height : 800, - title : 'Dynamo', + title : 'Dynamon', webPreferences: { nodeIntegration: false, preload : __dirname + '/preload.js', diff --git a/packages/dynamo/ipc.ts b/packages/dynamon/ipc.ts similarity index 93% rename from packages/dynamo/ipc.ts rename to packages/dynamon/ipc.ts index a1edd9a..498edeb 100644 --- a/packages/dynamo/ipc.ts +++ b/packages/dynamon/ipc.ts @@ -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, {sender}, action) { const {type, payload} = action @@ -34,8 +34,8 @@ export async function ipcHandler(db: Promise, {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 } @@ -58,7 +58,7 @@ export async function ipcHandler(db: Promise, {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() @@ -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') @@ -129,6 +129,3 @@ function createEngineGetter() { } } } - -// - diff --git a/packages/dynamo/package.json b/packages/dynamon/package.json similarity index 80% rename from packages/dynamo/package.json rename to packages/dynamon/package.json index fc2133e..81b02b6 100644 --- a/packages/dynamo/package.json +++ b/packages/dynamon/package.json @@ -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 ", "license": "MIT", "private": false, @@ -22,7 +22,7 @@ }, "dependencies": { "detect-port": "^1.2.2", - "dynamo-engine": "*", + "dynamon-engine": "*", "dynamodb-localhost": "^0.0.5", "mkdirp": "^0.5.1" } diff --git a/packages/dynamo/preload.ts b/packages/dynamon/preload.ts similarity index 100% rename from packages/dynamo/preload.ts rename to packages/dynamon/preload.ts diff --git a/packages/dynamo/tsconfig.json b/packages/dynamon/tsconfig.json similarity index 100% rename from packages/dynamo/tsconfig.json rename to packages/dynamon/tsconfig.json diff --git a/packages/react-deep-json-table/package.json b/packages/react-deep-json-table/package.json index 69d7086..56f2706 100644 --- a/packages/react-deep-json-table/package.json +++ b/packages/react-deep-json-table/package.json @@ -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 ", "license": "MIT", "private": false,