@aom-js/schemer 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ import { Schemer } from "./module";
2
+ import { ConnectionSchema } from "./types";
3
+ export declare function ComponentSchema(schemer?: Schemer): ClassDecorator;
4
+ export declare function ComponentConnect(schema: ConnectionSchema): PropertyDecorator;
5
+ //# sourceMappingURL=decorators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/defines/decorators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAc,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAQ3C,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,cAAc,CAQjE;AAED,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,gBAAgB,GAAG,iBAAiB,CAM5E"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ComponentSchema = ComponentSchema;
4
+ exports.ComponentConnect = ComponentConnect;
5
+ const module_1 = require("./module");
6
+ function ComponentSchema(schemer) {
7
+ if (!schemer) {
8
+ schemer = module_1.Schemer.default;
9
+ }
10
+ return module_1.AomSchemas.classDecorator(($) => {
11
+ $.schemer = schemer;
12
+ });
13
+ }
14
+ function ComponentConnect(schema) {
15
+ return module_1.AomSchemas.propertyDecorator(($) => {
16
+ const { property } = $._;
17
+ $._.root.connections.set(property, schema);
18
+ });
19
+ }
20
+ //# sourceMappingURL=decorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../src/defines/decorators.ts"],"names":[],"mappings":";;AAUA,0CAQC;AAED,4CAMC;AAzBD,qCAA+C;AAS/C,SAAgB,eAAe,CAAC,OAAiB;IAE/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,GAAG,gBAAO,CAAC,OAAO,CAAC;IAC5B,CAAC;IACD,OAAO,mBAAU,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE;QACrC,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,gBAAgB,CAAC,MAAwB;IAEvD,OAAO,mBAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE;QACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { AomCore, Property } from "@aom-js/core";
2
+ import { ConnectionSchema, SchemerConfig, RenderHandler } from "./types";
3
+ export declare class AomSchemas extends AomCore {
4
+ schemer: Schemer;
5
+ connections: Map<Property, ConnectionSchema>;
6
+ }
7
+ export declare class Schemer implements SchemerConfig {
8
+ render: RenderHandler;
9
+ constructor(config: SchemerConfig);
10
+ static default: Schemer;
11
+ static config(config: SchemerConfig): void;
12
+ }
13
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/defines/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEzE,qBAAa,UAAW,SAAQ,OAAO;IACrC,OAAO,EAAE,OAAO,CAAC;IAEjB,WAAW,EAAE,GAAG,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAa;CAC1D;AAED,qBAAa,OAAQ,YAAW,aAAa;IAE3C,MAAM,EAAE,aAAa,CAAC;gBAMV,MAAM,EAAE,aAAa;IAMjC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC;IAMxB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa;CAGpC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Schemer = exports.AomSchemas = void 0;
4
+ const core_1 = require("@aom-js/core");
5
+ class AomSchemas extends core_1.AomCore {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.connections = new Map();
9
+ }
10
+ }
11
+ exports.AomSchemas = AomSchemas;
12
+ class Schemer {
13
+ constructor(config) {
14
+ this.render = config.render;
15
+ }
16
+ static config(config) {
17
+ this.default = new this(config);
18
+ }
19
+ }
20
+ exports.Schemer = Schemer;
21
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/defines/module.ts"],"names":[],"mappings":";;;AAAA,uCAAiD;AAIjD,MAAa,UAAW,SAAQ,cAAO;IAAvC;;QAGE,gBAAW,GAAoC,IAAI,GAAG,EAAE,CAAC;IAC3D,CAAC;CAAA;AAJD,gCAIC;AAED,MAAa,OAAO;IAQlB,YAAY,MAAqB;QAE/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;IASD,MAAM,CAAC,MAAM,CAAC,MAAqB;QACjC,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CACF;AAvBD,0BAuBC"}
@@ -0,0 +1,7 @@
1
+ import { ClassConstructor } from "@aom-js/core";
2
+ export declare type ConnectionSchema = (() => ClassConstructor) | ClassConstructor;
3
+ export declare type RenderHandler = (target: ClassConstructor) => any;
4
+ export declare interface SchemerConfig {
5
+ render: RenderHandler;
6
+ }
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/defines/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,CAAC,OAAO,MAAM,gBAAgB,GAAG,CAAC,MAAM,gBAAgB,CAAC,GAAG,gBAAgB,CAAC;AAMnF,MAAM,CAAC,OAAO,MAAM,aAAa,GAAG,CAAC,MAAM,EAAE,gBAAgB,KAAK,GAAG,CAAC;AAMtE,MAAM,CAAC,OAAO,WAAW,aAAa;IAEpC,MAAM,EAAE,aAAa,CAAC;CACvB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/defines/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export * from "./defines/decorators";
2
+ export * from "./defines/types";
3
+ export * from "./defines/module";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./defines/decorators"), exports);
18
+ __exportStar(require("./defines/types"), exports);
19
+ __exportStar(require("./defines/module"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,kDAAgC;AAChC,mDAAiC"}
@@ -0,0 +1,16 @@
1
+ import { Schemer, AomSchemas } from "./module";
2
+ export function ComponentSchema(schemer) {
3
+ if (!schemer) {
4
+ schemer = Schemer.default;
5
+ }
6
+ return AomSchemas.classDecorator(($) => {
7
+ $.schemer = schemer;
8
+ });
9
+ }
10
+ export function ComponentConnect(schema) {
11
+ return AomSchemas.propertyDecorator(($) => {
12
+ const { property } = $._;
13
+ $._.root.connections.set(property, schema);
14
+ });
15
+ }
16
+ //# sourceMappingURL=decorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../../src/defines/decorators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAS/C,MAAM,UAAU,eAAe,CAAC,OAAiB;IAE/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAC5B,CAAC;IACD,OAAO,UAAU,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE;QACrC,CAAC,CAAC,OAAO,GAAG,OAAO,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAwB;IAEvD,OAAO,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE;QACxC,MAAM,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { AomCore } from "@aom-js/core";
2
+ export class AomSchemas extends AomCore {
3
+ constructor() {
4
+ super(...arguments);
5
+ this.connections = new Map();
6
+ }
7
+ }
8
+ export class Schemer {
9
+ constructor(config) {
10
+ this.render = config.render;
11
+ }
12
+ static config(config) {
13
+ this.default = new this(config);
14
+ }
15
+ }
16
+ //# sourceMappingURL=module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/defines/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAY,MAAM,cAAc,CAAC;AAIjD,MAAM,OAAO,UAAW,SAAQ,OAAO;IAAvC;;QAGE,gBAAW,GAAoC,IAAI,GAAG,EAAE,CAAC;IAC3D,CAAC;CAAA;AAED,MAAM,OAAO,OAAO;IAQlB,YAAY,MAAqB;QAE/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;IASD,MAAM,CAAC,MAAM,CAAC,MAAqB;QACjC,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CACF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/defines/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export * from "./defines/decorators";
2
+ export * from "./defines/types";
3
+ export * from "./defines/module";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Schemer } from "./module";
2
+ import { ConnectionSchema } from "./types";
3
+ export declare function ComponentSchema(schemer?: Schemer): ClassDecorator;
4
+ export declare function ComponentConnect(schema: ConnectionSchema): PropertyDecorator;
@@ -0,0 +1,12 @@
1
+ import { AomCore, Property } from "@aom-js/core";
2
+ import { ConnectionSchema, SchemerConfig, RenderHandler } from "./types";
3
+ export declare class AomSchemas extends AomCore {
4
+ schemer: Schemer;
5
+ connections: Map<Property, ConnectionSchema>;
6
+ }
7
+ export declare class Schemer implements SchemerConfig {
8
+ render: RenderHandler;
9
+ constructor(config: SchemerConfig);
10
+ static default: Schemer;
11
+ static config(config: SchemerConfig): void;
12
+ }
@@ -0,0 +1,6 @@
1
+ import { ClassConstructor } from "@aom-js/core";
2
+ export declare type ConnectionSchema = (() => ClassConstructor) | ClassConstructor;
3
+ export declare type RenderHandler = (target: ClassConstructor) => any;
4
+ export declare interface SchemerConfig {
5
+ render: RenderHandler;
6
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./defines/decorators";
2
+ export * from "./defines/types";
3
+ export * from "./defines/module";
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "version": "0.0.1",
3
+ "name": "@aom-js/schemer",
4
+ "description": "`@aom` meta-framework schemer code",
5
+ "homepage": "https://github.com/aom-js/main#readme",
6
+ "bugs": {
7
+ "url": "https://github.com/aom-js/main/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/aom-js/main.git",
12
+ "directory": "packages/schemer"
13
+ },
14
+ "license": "ISC",
15
+ "author": "Grigory B. Kholstinnikov (scarych)",
16
+ "dependencies": {
17
+ "@aom-js/core": "*"
18
+ },
19
+ "devDependencies": {
20
+ "@types/node": "^22.14.0",
21
+ "tslib": "^2.8.1",
22
+ "typescript": "^5.8.3"
23
+ },
24
+ "main": "./dist/cjs/index.js",
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "type": "module",
29
+ "module": "./dist/mjs/index.js",
30
+ "types": "./dist/types/index.d.ts",
31
+ "files": [
32
+ "./dist/cjs",
33
+ "./dist/mjs",
34
+ "./dist/types"
35
+ ],
36
+ "exports": {
37
+ ".": {
38
+ "import": "./dist/mjs/index.js",
39
+ "require": "./dist/cjs/index.js",
40
+ "types": "./dist/types/index.d.ts"
41
+ }
42
+ },
43
+ "scripts": {
44
+ "test": "echo \"Error: no test specified\" && exit 1",
45
+ "clean": "rm -rf dist/",
46
+ "prebuild": "rm -rf dist/",
47
+ "build": "tsc --project tsconfig.build.json && tsc --project tsconfig.build.mjs.json && tsc --project tsconfig.build.types.json ",
48
+ "prepare": "npm run build"
49
+ }
50
+ }
package/readme.md ADDED
@@ -0,0 +1,3 @@
1
+ # `@aom-js/schemer`
2
+
3
+ Schemas controls processing