@aom-js/holder 0.0.0-stage → 0.1.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,4 @@
1
+ export declare function Hold(...queue: PropertyDecorator[]): PropertyDecorator;
2
+ export declare function Delay(...queue: ClassDecorator[]): ClassDecorator;
3
+ export declare function Apply(...queue: ClassDecorator[]): ClassDecorator;
4
+ //# sourceMappingURL=decorators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/decorators.ts"],"names":[],"mappings":"AA2CA,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,CAKrE;AAwDD,wBAAgB,KAAK,CAAC,GAAG,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,CAgBhE;AA2CD,wBAAgB,KAAK,CAAC,GAAG,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,CAuBhE"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Hold = Hold;
4
+ exports.Delay = Delay;
5
+ exports.Apply = Apply;
6
+ const core_1 = require("@aom-js/core");
7
+ const init_1 = require("./init.js");
8
+ function Hold(...queue) {
9
+ return init_1.AomHolder.propertyDecorator(($) => {
10
+ $.queue.push(...queue);
11
+ }, core_1.ExecutionPhase.LAST);
12
+ }
13
+ const queueInherited = new WeakSet();
14
+ function Delay(...queue) {
15
+ return init_1.AomHolder.classDecorator(($) => {
16
+ $.queue.push(...queue);
17
+ const parent = Object.getPrototypeOf($._.target);
18
+ if (!queueInherited.has($)) {
19
+ queueInherited.add($);
20
+ $.queue.unshift(...(init_1.AomHolder.checkExists(parent)?.queue ?? []));
21
+ }
22
+ $._.inherit(parent);
23
+ $._.apply();
24
+ }, core_1.ExecutionPhase.INSTANT);
25
+ }
26
+ function Apply(...queue) {
27
+ return init_1.AomHolder.classDecorator(($) => {
28
+ Reflect.decorate([Delay(...queue)], $._.target);
29
+ $._.origins.forEach((origin) => {
30
+ const $origin = origin.self;
31
+ const isClassOrigin = origin.target === $origin._.target;
32
+ Reflect.decorate(origin.self.queue, isClassOrigin ? $._.target : $._.target.prototype, origin.property);
33
+ });
34
+ Reflect.decorate($.queue, $._.target);
35
+ }, core_1.ExecutionPhase.INSTANT);
36
+ }
37
+ //# sourceMappingURL=decorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../src/decorators.ts"],"names":[],"mappings":";;;;;AAAA,uCAAiE;AACjE,iCAAmC;AA0CnC,cAAqB,GAAG,KAA0B;IAChD,OAAO,gBAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE;QACvC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAI,KAAwC,CAAC,CAAC;IAE7D,CAAC,EAAE,qBAAc,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAID,MAAM,cAAc,GAAG,IAAI,OAAO,EAAa,CAAC;AAoDhD,eAAsB,GAAG,KAAuB;IAC9C,OAAO,gBAAS,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE;QACpC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAEvB,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3B,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAEtB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,gBAAS,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;QACnE,CAAC;QAGD,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEpB,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IACd,CAAC,EAAE,qBAAc,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC;AA2CD,eAAsB,GAAG,KAAuB;IAC9C,OAAO,gBAAS,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE;QAGpC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAIhD,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7B,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;YAC5B,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;YAGzD,OAAO,CAAC,QAAQ,CACd,MAAM,CAAC,IAAI,CAAC,KAAuC,EACnD,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EACjD,MAAM,CAAC,QAAQ,CAChB,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAExC,CAAC,EAAE,qBAAc,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import "reflect-metadata";
2
+ export * from "./decorators.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,kBAAkB,CAAC;AAE1B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,19 @@
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
+ require("reflect-metadata");
18
+ __exportStar(require("./decorators.js"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,4BAA0B;AAE1B,+CAA6B"}
@@ -0,0 +1,5 @@
1
+ import { AomCore, CombinedDecorator } from "@aom-js/core";
2
+ export declare class AomHolder extends AomCore {
3
+ queue: CombinedDecorator[];
4
+ }
5
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAS1D,qBAAa,SAAU,SAAQ,OAAO;IAUpC,KAAK,EAAE,iBAAiB,EAAE,CAAM;CACjC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AomHolder = void 0;
4
+ const core_1 = require("@aom-js/core");
5
+ class AomHolder extends core_1.AomCore {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.queue = [];
9
+ }
10
+ }
11
+ exports.AomHolder = AomHolder;
12
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/init.ts"],"names":[],"mappings":";;;AAAA,uCAA0D;AAS1D,eAAuB,SAAQ,cAAO;IAAtC;;QAUE,UAAK,GAAwB,EAAE,CAAC;IAClC,CAAC;CAAA"}
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -0,0 +1,4 @@
1
+ export declare function Hold(...queue: PropertyDecorator[]): PropertyDecorator;
2
+ export declare function Delay(...queue: ClassDecorator[]): ClassDecorator;
3
+ export declare function Apply(...queue: ClassDecorator[]): ClassDecorator;
4
+ //# sourceMappingURL=decorators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../src/decorators.ts"],"names":[],"mappings":"AA2CA,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,iBAAiB,EAAE,GAAG,iBAAiB,CAKrE;AAwDD,wBAAgB,KAAK,CAAC,GAAG,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,CAgBhE;AA2CD,wBAAgB,KAAK,CAAC,GAAG,KAAK,EAAE,cAAc,EAAE,GAAG,cAAc,CAuBhE"}
@@ -0,0 +1,32 @@
1
+ import { ExecutionPhase } from "@aom-js/core";
2
+ import { AomHolder } from "./init.js";
3
+ export function Hold(...queue) {
4
+ return AomHolder.propertyDecorator(($) => {
5
+ $.queue.push(...queue);
6
+ }, ExecutionPhase.LAST);
7
+ }
8
+ const queueInherited = new WeakSet();
9
+ export function Delay(...queue) {
10
+ return AomHolder.classDecorator(($) => {
11
+ $.queue.push(...queue);
12
+ const parent = Object.getPrototypeOf($._.target);
13
+ if (!queueInherited.has($)) {
14
+ queueInherited.add($);
15
+ $.queue.unshift(...(AomHolder.checkExists(parent)?.queue ?? []));
16
+ }
17
+ $._.inherit(parent);
18
+ $._.apply();
19
+ }, ExecutionPhase.INSTANT);
20
+ }
21
+ export function Apply(...queue) {
22
+ return AomHolder.classDecorator(($) => {
23
+ Reflect.decorate([Delay(...queue)], $._.target);
24
+ $._.origins.forEach((origin) => {
25
+ const $origin = origin.self;
26
+ const isClassOrigin = origin.target === $origin._.target;
27
+ Reflect.decorate(origin.self.queue, isClassOrigin ? $._.target : $._.target.prototype, origin.property);
28
+ });
29
+ Reflect.decorate($.queue, $._.target);
30
+ }, ExecutionPhase.INSTANT);
31
+ }
32
+ //# sourceMappingURL=decorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,cAAc,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AA0CnC,MAAM,UAAU,IAAI,CAAC,GAAG,KAA0B;IAChD,OAAO,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,EAAE;QACvC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAI,KAAwC,CAAC,CAAC;IAE7D,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAID,MAAM,cAAc,GAAG,IAAI,OAAO,EAAa,CAAC;AAoDhD,MAAM,UAAU,KAAK,CAAC,GAAG,KAAuB;IAC9C,OAAO,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE;QACpC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAEvB,MAAM,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACjD,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3B,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAEtB,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC;QACnE,CAAC;QAGD,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAEpB,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;IACd,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC;AA2CD,MAAM,UAAU,KAAK,CAAC,GAAG,KAAuB;IAC9C,OAAO,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE;QAGpC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAIhD,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7B,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC;YAC5B,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;YAGzD,OAAO,CAAC,QAAQ,CACd,MAAM,CAAC,IAAI,CAAC,KAAuC,EACnD,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EACjD,MAAM,CAAC,QAAQ,CAChB,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAExC,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;AAC7B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import "reflect-metadata";
2
+ export * from "./decorators.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,kBAAkB,CAAC;AAE1B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,3 @@
1
+ import "reflect-metadata";
2
+ export * from "./decorators.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,kBAAkB,CAAC;AAE1B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { AomCore, CombinedDecorator } from "@aom-js/core";
2
+ export declare class AomHolder extends AomCore {
3
+ queue: CombinedDecorator[];
4
+ }
5
+ //# sourceMappingURL=init.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAS1D,qBAAa,SAAU,SAAQ,OAAO;IAUpC,KAAK,EAAE,iBAAiB,EAAE,CAAM;CACjC"}
@@ -0,0 +1,8 @@
1
+ import { AomCore } from "@aom-js/core";
2
+ export class AomHolder extends AomCore {
3
+ constructor() {
4
+ super(...arguments);
5
+ this.queue = [];
6
+ }
7
+ }
8
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAqB,MAAM,cAAc,CAAC;AAS1D,MAAM,OAAO,SAAU,SAAQ,OAAO;IAAtC;;QAUE,UAAK,GAAwB,EAAE,CAAC;IAClC,CAAC;CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare function Hold(...queue: PropertyDecorator[]): PropertyDecorator;
2
+ export declare function Delay(...queue: ClassDecorator[]): ClassDecorator;
3
+ export declare function Apply(...queue: ClassDecorator[]): ClassDecorator;
@@ -0,0 +1,2 @@
1
+ import "reflect-metadata";
2
+ export * from "./decorators.js";
@@ -0,0 +1,4 @@
1
+ import { AomCore, CombinedDecorator } from "@aom-js/core";
2
+ export declare class AomHolder extends AomCore {
3
+ queue: CombinedDecorator[];
4
+ }
package/package.json CHANGED
@@ -1,6 +1,56 @@
1
1
  {
2
+ "version": "0.1.1",
2
3
  "name": "@aom-js/holder",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
4
+ "description": "`@aom` meta-framework holder code",
5
+ "homepage": "https://aom.js.org/packages/holder/",
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/holder"
13
+ },
14
+ "license": "ISC",
15
+ "author": "Grigory B. Kholstinnikov (scarych)",
16
+ "dependencies": {
17
+ "@aom-js/core": "0.1.0",
18
+ "reflect-metadata": "^0.2.2"
19
+ },
20
+ "devDependencies": {
21
+ "@types/node": "^26.1.2",
22
+ "tslib": "^2.8.1",
23
+ "typescript": "^7.0.2"
24
+ },
25
+ "main": "./dist/cjs/index.js",
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "type": "module",
30
+ "module": "./dist/mjs/index.js",
31
+ "types": "./dist/types/index.d.ts",
32
+ "files": [
33
+ "./dist/cjs",
34
+ "./dist/mjs",
35
+ "./dist/types"
36
+ ],
37
+ "exports": {
38
+ ".": {
39
+ "import": {
40
+ "types": "./dist/types/index.d.ts",
41
+ "default": "./dist/mjs/index.js"
42
+ },
43
+ "require": {
44
+ "types": "./dist/cjs/index.d.ts",
45
+ "default": "./dist/cjs/index.js"
46
+ }
47
+ }
48
+ },
49
+ "scripts": {
50
+ "test": "echo \"Error: no test specified\" && exit 1",
51
+ "clean": "rm -rf dist/",
52
+ "prebuild": "rm -rf dist/",
53
+ "build": "tsc --project tsconfig.build.json && tsc --project tsconfig.build.mjs.json && tsc --project tsconfig.build.types.json && node ../../scripts/post-build.js",
54
+ "prepare": ""
55
+ }
6
56
  }
package/readme.md ADDED
@@ -0,0 +1,9 @@
1
+ # `@aom-js/holder`
2
+
3
+ Экспериментальный пакет: три декоратора `Hold` / `Delay` / `Apply`, которые откладывают применение сторонних декораторов на предках и применяют их на конечном потомке.
4
+
5
+ Документация: https://aom.js.org/packages/holder/
6
+
7
+ ```bash
8
+ npm install @aom-js/holder
9
+ ```
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.