@aire-ux/aire-condensation
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,5 +0,5 @@ | ||
import TypeRegistry from "@condensation/type-registry"; | ||
import RemoteRegistry from "@condensation/remote-registry"; | ||
import { Address, Class, Pointer, Region } from "@condensation/types"; | ||
import { Deserializer } from "@condensation/deserializer"; | ||
import TypeRegistry from "./type-registry"; | ||
import RemoteRegistry from "./remote-registry"; | ||
import { Address, Class, Pointer, Region } from "./types"; | ||
import { Deserializer } from "./deserializer"; | ||
export declare type Format = "json"; | ||
@@ -6,0 +6,0 @@ export interface Context { |
@@ -37,6 +37,6 @@ var __read = (this && this.__read) || function (o, n) { | ||
}; | ||
import TypeRegistry from "@condensation/type-registry"; | ||
import RemoteRegistry from "@condensation/remote-registry"; | ||
import { allocate, Region } from "@condensation/types"; | ||
import { BooleanDeserializer, NumberDeserializer, StringDeserializer, TypeRegistrationDeserializer, } from "@condensation/deserializer"; | ||
import TypeRegistry from "./type-registry"; | ||
import RemoteRegistry from "./remote-registry"; | ||
import { allocate, Region } from "./types"; | ||
import { BooleanDeserializer, NumberDeserializer, StringDeserializer, TypeRegistrationDeserializer, } from "./deserializer"; | ||
/** | ||
@@ -157,6 +157,6 @@ * root context for all operations | ||
type: Boolean, | ||
deserializer: new BooleanDeserializer() | ||
deserializer: new BooleanDeserializer(), | ||
}, { | ||
type: Number, | ||
deserializer: new NumberDeserializer() | ||
deserializer: new NumberDeserializer(), | ||
}); |
import "reflect-metadata"; | ||
import { Class } from "@condensation/types"; | ||
import { TypeRegistration } from "@condensation/type-registry"; | ||
import { Class } from "./types"; | ||
import { TypeRegistration } from "./type-registry"; | ||
export interface Deserializer<T> { | ||
@@ -5,0 +5,0 @@ read(object: any): T; |
@@ -29,3 +29,3 @@ var __values = (this && this.__values) || function(o) { | ||
import "reflect-metadata"; | ||
import { Condensation } from "@condensation/condensation"; | ||
import { Condensation } from "./condensation"; | ||
var StringDeserializer = /** @class */ (function () { | ||
@@ -32,0 +32,0 @@ function StringDeserializer() { |
@@ -1,3 +0,3 @@ | ||
import { Class } from "@condensation/types"; | ||
import { Class } from "./types"; | ||
export declare function Remotable<T>(type: Class<T>): Class<T>; | ||
export declare function Receive<T>(type: Class<T>): <U>(target: Class<U>, key: PropertyKey, index: number) => void; |
@@ -1,2 +0,2 @@ | ||
import { Condensation } from "@condensation/condensation"; | ||
import { Condensation } from "./condensation"; | ||
export function Remotable(type) { | ||
@@ -3,0 +3,0 @@ Condensation.remoteRegistry.register(type); |
@@ -1,2 +0,2 @@ | ||
import { Class } from "@condensation/types"; | ||
import { Class } from "./types"; | ||
export declare type InvocationType = "method" | "constructor"; | ||
@@ -3,0 +3,0 @@ declare type ParameterDefinition = { |
import "reflect-metadata"; | ||
import { Class } from "@condensation/types"; | ||
import { Class } from "./types"; | ||
export declare type RootElementConfiguration = { | ||
@@ -4,0 +4,0 @@ alias: string; |
@@ -13,3 +13,3 @@ var __assign = (this && this.__assign) || function () { | ||
import "reflect-metadata"; | ||
import { Condensation } from "@condensation/condensation"; | ||
import { Condensation } from "./condensation"; | ||
export function Configuration(cfg) { | ||
@@ -16,0 +16,0 @@ var reg = Condensation.typeRegistry; |
@@ -1,3 +0,3 @@ | ||
import { Class } from "@condensation/types"; | ||
import { PropertyConfiguration, RootElementConfiguration } from "@condensation/root-element"; | ||
import { Class } from "./types"; | ||
import { PropertyConfiguration, RootElementConfiguration } from "./root-element"; | ||
export declare type PropertyDefinition = { | ||
@@ -4,0 +4,0 @@ type: Class<any>; |
{ | ||
"name": "@aire-ux/aire-condensation", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Client-side serialization library for Aire-UX", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "tsc -p tsconfig.json", | ||
"build": "ttsc -p tsconfig.json", | ||
"test": "npx jest", | ||
@@ -28,2 +28,3 @@ "format": "npx prettier --write ." | ||
"@types/jest": "^27.0.3", | ||
"@zerollup/ts-transform-paths": "^1.7.18", | ||
"husky": "^7.0.4", | ||
@@ -34,2 +35,3 @@ "jest": "^27.4.2", | ||
"ts-jest": "^27.0.7", | ||
"ttypescript": "^1.5.13", | ||
"typescript": "^4.5.2" | ||
@@ -36,0 +38,0 @@ }, |
@@ -6,3 +6,4 @@ import TypeRegistry from "@condensation/type-registry"; | ||
BooleanDeserializer, | ||
Deserializer, NumberDeserializer, | ||
Deserializer, | ||
NumberDeserializer, | ||
StringDeserializer, | ||
@@ -141,11 +142,15 @@ TypeRegistrationDeserializer, | ||
register({ | ||
type: String, | ||
deserializer: new StringDeserializer(), | ||
}, { | ||
type: Boolean, | ||
deserializer: new BooleanDeserializer() | ||
}, { | ||
type: Number, | ||
deserializer: new NumberDeserializer() | ||
}); | ||
register( | ||
{ | ||
type: String, | ||
deserializer: new StringDeserializer(), | ||
}, | ||
{ | ||
type: Boolean, | ||
deserializer: new BooleanDeserializer(), | ||
}, | ||
{ | ||
type: Number, | ||
deserializer: new NumberDeserializer(), | ||
} | ||
); |
@@ -77,56 +77,50 @@ import { Receive, Remotable } from "@condensation/remotable"; | ||
test('ensure base use-case works', () => { | ||
test("ensure base use-case works", () => { | ||
@RootElement | ||
class GraphConfiguration { | ||
@Property({ | ||
type:String, | ||
type: String, | ||
read: { | ||
alias: 'load-resources' | ||
} | ||
alias: "load-resources", | ||
}, | ||
}) | ||
loadResources: string | undefined; | ||
@Property({ | ||
type:Boolean, | ||
type: Boolean, | ||
read: { | ||
alias: 'force-includes' | ||
} | ||
alias: "force-includes", | ||
}, | ||
}) | ||
forceIncludes: string | undefined; | ||
@Property({ | ||
type:Boolean, | ||
type: Boolean, | ||
read: { | ||
alias: 'force-includes' | ||
} | ||
alias: "force-includes", | ||
}, | ||
}) | ||
loadStylesheets: boolean | undefined; | ||
@Property({ | ||
type:String, | ||
type: String, | ||
read: { | ||
alias: 'resource-extension' | ||
} | ||
alias: "resource-extension", | ||
}, | ||
}) | ||
resourceExtension: boolean | undefined; | ||
@Property({ | ||
type:Boolean, | ||
type: Boolean, | ||
read: { | ||
alias: 'production-mode' | ||
} | ||
alias: "production-mode", | ||
}, | ||
}) | ||
productionMode: boolean | undefined; | ||
@Property({ | ||
type:String, | ||
type: String, | ||
read: { | ||
alias: 'base-path' | ||
} | ||
alias: "base-path", | ||
}, | ||
}) | ||
@@ -138,9 +132,13 @@ basePath: string | undefined; | ||
class MxGraphManager { | ||
constructor(@Receive(GraphConfiguration) readonly configuration: GraphConfiguration) { | ||
} | ||
constructor( | ||
@Receive(GraphConfiguration) readonly configuration: GraphConfiguration | ||
) {} | ||
} | ||
const mgr = Condensation.newContext().create<MxGraphManager>(MxGraphManager, `{ | ||
const mgr = Condensation.newContext().create<MxGraphManager>( | ||
MxGraphManager, | ||
`{ | ||
"load-resources": "loading them resources" | ||
}`); | ||
}` | ||
); | ||
expect(mgr.configuration?.loadResources).toEqual("loading them resources"); | ||
@@ -147,0 +145,0 @@ }); |
@@ -20,2 +20,8 @@ { | ||
}, | ||
"plugins": [ | ||
{ | ||
"transform": "@zerollup/ts-transform-paths", | ||
"exclude": ["*"] | ||
} | ||
] | ||
}, | ||
@@ -22,0 +28,0 @@ "exclude": ["node_modules/**/*"], |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49509
1514
10