From 7d3c4196aba0c5cfc728b159dead5a4517d87a54 Mon Sep 17 00:00:00 2001 From: Valerie Date: Wed, 9 Jun 2021 21:31:17 -0400 Subject: [PATCH] theoretically complete --- package.json | 7 +++++-- src/Serializable.ts | 13 +++---------- tsconfig.json | 3 ++- yarn.lock | 4 ++++ 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 7b4e530..4debde2 100644 --- a/package.json +++ b/package.json @@ -2,14 +2,17 @@ "name": "frigid", "version": "1.0.0", "main": "out/index.js", + "types": "out/index.d.ts", "license": "MIT", "type": "module", - "repository": "", + "repository": "https://github.com/marcus13345/frigid.git", "devDependencies": { + "@types/node": "^15.12.2", "typescript": "^4.3.2", - "@types/node": "^15.12.2" + "yarn": "^1.22.10" }, "scripts": { + "prepublish": "yarn build", "build": "tsc" } } diff --git a/src/Serializable.ts b/src/Serializable.ts index a60bcc9..16ac141 100644 --- a/src/Serializable.ts +++ b/src/Serializable.ts @@ -7,6 +7,9 @@ export default class Serializable { // things that need to be stored only in cold // storage are keyed with a special prefix + // its namesapce pollution, eventually the + // format should be a bit more complex, to + // avoid this but... simplicity for now... static CLASS_REFERENCE = '$$CLASS_NAME'; // things that need to be stored only at runtime @@ -14,16 +17,6 @@ export default class Serializable { // user code. static PERSIST_LOCATION = Symbol('PERSIST_LOCATION'); - start() {} - - // toUbj() { - // return Ubjson.encode(this.toSerializableObject()); - // } - - // static fromUbj(buffer) { - // return this.fromSerializableObject(Ubjson.decode(buffer)); - // } - toJson() { return JSON.stringify(this.toSerializableObject(), null, 2); } diff --git a/tsconfig.json b/tsconfig.json index a8f8e54..1bd2c13 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,8 @@ "target": "ES2020", "module": "ES2020", "moduleResolution": "Node", - "outDir": "out" + "outDir": "out", + "declaration": true }, "include": [ "src/**/*.ts" diff --git a/yarn.lock b/yarn.lock index c278594..5b29763 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9,3 +9,7 @@ typescript@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.3.2.tgz#399ab18aac45802d6f2498de5054fcbbe716a805" + +yarn@^1.22.10: + version "1.22.10" + resolved "https://registry.yarnpkg.com/yarn/-/yarn-1.22.10.tgz#c99daa06257c80f8fa2c3f1490724e394c26b18c"