New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

battuta

Package Overview
Dependencies
Maintainers
0
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

battuta - npm Package Compare versions

Comparing version

to
0.0.3

dist/contexts.d.ts

3

dist/cli.d.ts

@@ -5,1 +5,4 @@ export { }

2

dist/cli.js

@@ -10,3 +10,3 @@ #!/usr/bin/env node

import { execSync as m } from "child_process";
import { t as C } from "./jsx-Bwrm210x.js";
import { t as C } from "./jsx-qFfO16Cf.js";
const o = {

@@ -13,0 +13,0 @@ pattern: (t) => `${t} <file>`,

@@ -11,1 +11,4 @@ import { GeneratorResult } from '@babel/generator';

@@ -1,2 +0,2 @@

import { t as o } from "./jsx-Bwrm210x.js";
import { t as o } from "./jsx-qFfO16Cf.js";
function m(r) {

@@ -3,0 +3,0 @@ return o(r);

@@ -72,6 +72,9 @@ import { TreeNode } from "./runtime";

declare global {
interface HTMLElement extends TreeNode {
interface Function {
[prev]: Function;
}
interface Function extends TreeNode {
}
}
declare global {
interface Object extends TreeNode {

@@ -78,0 +81,0 @@ }

@@ -72,6 +72,9 @@ import { TreeNode } from "./runtime";

declare global {
interface HTMLElement extends TreeNode {
interface Function {
[prev]: Function;
}
interface Function extends TreeNode {
}
}
declare global {
interface Object extends TreeNode {

@@ -78,0 +81,0 @@ }

@@ -7,1 +7,4 @@ export declare function css(this: any, css: TemplateStringsArray, ..._args: any[]): Record<string, string>;

@@ -35,1 +35,4 @@ export declare function optimize(jsCode: string, config?: any): {

import { parse as S } from "@babel/parser";
import L from "@babel/generator";
import M from "@babel/traverse";
import M from "@babel/generator";
import x from "@babel/traverse";
import * as n from "@babel/types";
const O = M.default, x = L.default;
function W(c) {
const O = x.default, W = M.default;
function j(c) {
const a = S(c, {
sourceType: "module",
plugins: ["typescript", "jsx"]
plugins: ["typescript", "jsx", "decorators"]
}), o = [];
function d(e) {
function u(e) {
var g, P, b, k;

@@ -30,5 +30,5 @@ const i = (g = e.parentPath) == null ? void 0 : g.node;

}), t.every((s) => y.hasOwnBinding(s) || r.hasOwnBinding(s));
let u = e.parentPath;
let d = e.parentPath;
function v() {
const s = u == null ? void 0 : u.parentPath, w = u;
const s = d == null ? void 0 : d.parentPath, w = d;
if (w != s)

@@ -38,8 +38,8 @@ return !(!s || t.some((l) => {

return ((B = w == null ? void 0 : w.scope) == null ? void 0 : B.hasOwnBinding(l)) && !r.hasOwnBinding(l);
}) || !t.every((l) => s.scope.hasBinding(l) || r.hasOwnBinding(l) || F[l]));
}) || !t.every((l) => s.scope.hasBinding(l) || r.hasOwnBinding(l) || I[l]));
}
for (; v(); )
u = u.parentPath;
if (u == e.parentPath || !u) return;
const f = u.isBlockStatement() || u.isProgram() ? u : u.findParent((s) => s.isBlockStatement() || s.isProgram()), p = (P = e.parentPath) != null && P.isBlockStatement() || (b = e.parentPath) != null && b.isProgram() ? e.parentPath : (k = e.parentPath) == null ? void 0 : k.findParent((s) => s.isBlockStatement() || s.isProgram());
d = d.parentPath;
if (d == e.parentPath || !d) return;
const f = d.isBlockStatement() || d.isProgram() ? d : d.findParent((s) => s.isBlockStatement() || s.isProgram()), p = (P = e.parentPath) != null && P.isBlockStatement() || (b = e.parentPath) != null && b.isProgram() ? e.parentPath : (k = e.parentPath) == null ? void 0 : k.findParent((s) => s.isBlockStatement() || s.isProgram());
(f == null ? void 0 : f.node) != (p == null ? void 0 : p.node) && o.push({

@@ -54,4 +54,4 @@ blockPath: f,

}) {
var u, v, f, p, g, P, b, k, s;
const r = j(), t = (u = i.parentPath) == null ? void 0 : u.node;
var d, v, f, p, g, P, b, k, s;
const r = F(), t = (d = i.parentPath) == null ? void 0 : d.node;
switch (t.type) {

@@ -147,6 +147,6 @@ case "ArrowFunctionExpression": {

const i = e.node;
i.type == "ObjectMethod" && ["get", "set"].includes(i.kind) || d(e.get("body"));
i.type == "ObjectMethod" && ["get", "set"].includes(i.kind) || u(e.get("body"));
}
}), o.forEach(m);
const h = x(a, { retainLines: !0 }, c);
const h = W(a, {}, c);
return {

@@ -157,7 +157,7 @@ code: h.code,

}
function j(c = "", a = 8) {
function F(c = "", a = 8) {
const o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
return "f_" + (c || "unnamed").split("").filter((d) => o.includes(d)).join("") + "_" + Array.from({ length: a }, () => o[Math.floor(Math.random() * o.length)]).join("");
return "f_" + (c || "unnamed").split("").filter((u) => o.includes(u)).join("") + "_" + Array.from({ length: a }, () => o[Math.floor(Math.random() * o.length)]).join("");
}
const F = {
const I = {
globalThis: !0,

@@ -169,8 +169,8 @@ console: !0,

setTimeout: !0
}, D = M.default, I = L.default;
}, D = x.default, L = M.default;
function R(c) {
const a = S(c, {
sourceType: "module",
plugins: ["typescript", "jsx"]
}), o = {}, d = (e) => {
plugins: ["typescript", "jsx", "decorators"]
}), o = {}, u = (e) => {
e in o ? o[e].count++ : o[e] = { count: 1, name: A(e) };

@@ -180,7 +180,7 @@ };

StringLiteral(e) {
d(e.node.value);
u(e.node.value);
},
ObjectProperty(e) {
const i = e.node.key;
i.type === "Identifier" && d(i.name);
i.type === "Identifier" && u(i.name);
}

@@ -210,3 +210,3 @@ });

}), a.program.body.unshift(...m));
const h = I(a, { retainLines: !0 }, c);
const h = L(a, {}, c);
return {

@@ -219,12 +219,12 @@ code: h.code,

const o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
return "s_" + c.split("").filter((d) => o.includes(d)).join("") + "_" + Array.from({ length: a }, () => o[Math.floor(Math.random() * o.length)]).join("");
return "s_" + c.split("").filter((u) => o.includes(u)).join("") + "_" + Array.from({ length: a }, () => o[Math.floor(Math.random() * o.length)]).join("");
}
function z(c, a) {
var o, d;
return ((a == null ? void 0 : a.functions) ?? !0) && (c = ((o = W(c)) == null ? void 0 : o.code) || c), ((a == null ? void 0 : a.strings) ?? !0) && (c = ((d = R(c)) == null ? void 0 : d.code) || c), { code: c };
var o, u;
return ((a == null ? void 0 : a.functions) ?? !0) && (c = ((o = j(c)) == null ? void 0 : o.code) || c), ((a == null ? void 0 : a.strings) ?? !0) && (c = ((u = R(c)) == null ? void 0 : u.code) || c), { code: c };
}
export {
z as optimize,
W as optimizeFunctions,
j as optimizeFunctions,
R as optimizeStrings
};
export declare const append: unique symbol;
export declare const appendMultiple: unique symbol;
export declare const assign: unique symbol;

@@ -9,12 +7,10 @@

export declare const children: unique symbol;
export declare const childrenIndex: unique symbol;
export declare const cleanupListeners: unique symbol;
export declare const cleanup: unique symbol;
declare const context: unique symbol;
export declare const context: unique symbol;
export declare const create: unique symbol;
export declare const createContext: <T = any, P = any>(defaultValue: (props?: P) => T) => readonly [() => T, ({ children, ...props }: any) => () => any];
export declare const createElement: any;

@@ -24,8 +20,13 @@

export declare const currentContext: () => Record<symbol, any>;
export declare const empty: unique symbol;
export declare const onCleanup: (f: Function) => void;
export declare const insert: unique symbol;
export declare const onRemove: unique symbol;
export declare const listeners: unique symbol;
export declare const on: unique symbol;
declare const parent_2: unique symbol;
export { parent_2 as parent }
export declare const remove: unique symbol;

@@ -37,31 +38,31 @@

export declare type TreeChild = TreeNode | (() => TreeChild) | TreeChild[];
export declare interface TreeNode {
[append]: (child: TreeNode) => TreeNode;
[appendMultiple]: (...child: TreeNode[]) => TreeNode;
[assign]: (key: string, value: () => any) => TreeNode;
[call]: (key: string, value: () => any) => TreeNode;
[set]: (key: string, value: any) => TreeNode;
[insert]: (child: TreeNode, index: number) => TreeNode;
[append]: (...child: TreeNode[]) => TreeNode;
[assign]: (value: () => any, ...keys: string[]) => TreeNode;
[call]: (value: () => any, ...keys: string[]) => TreeNode;
[set]: (value: any, ...keys: string[]) => TreeNode;
[create]: (...props: any[]) => TreeNode;
[children]: () => TreeNode[];
[unmount]: () => void;
[childrenIndex]: (child?: TreeNode) => number;
[cleanup]: () => void;
[remove]: () => void;
[onRemove]: (f: Function) => TreeNode;
[cleanupListeners]?: Function[];
[empty]: () => TreeNode;
[context]?: Record<string, any>;
[listeners]: Record<string, Function[]>;
[on]: (event: string, f: Function) => TreeNode;
}
export declare const unmount: unique symbol;
export { }
export declare function useAppend(): (...childs: TreeNode[]) => void;
export declare function useRemove(): (() => void) | undefined;
declare global {
interface Function {
[prev]: Function;
}
}
export { }
declare global {
interface HTMLElement extends TreeNode {
}
interface Function extends TreeNode {
}
interface Object extends TreeNode {

@@ -68,0 +69,0 @@ }

@@ -1,110 +0,116 @@

import { useEffect as p } from "./signals.js";
const g = Symbol("+"), j = Symbol("+"), C = Symbol("<"), O = Symbol("="), R = Symbol("m"), r = Symbol("l"), b = Symbol("d"), w = Symbol("c"), _ = Symbol("r"), d = Symbol("u"), A = Symbol("x"), v = Symbol("call"), a = Element.prototype;
a[g] = function(t) {
return this.append(t), this;
import { contextStack as E } from "./contexts.js";
import { useEffect as v } from "./signals.js";
const d = Symbol("insert"), P = Symbol("append"), C = Symbol("assign"), O = Symbol("set"), A = Symbol("create"), b = Symbol("listeners"), m = Symbol("on"), w = Symbol("childrenIndex"), i = Symbol("remove"), f = Symbol("context"), B = Symbol("call"), T = Symbol("empty"), I = Symbol("parent"), S = Symbol("cleanup"), y = Element.prototype;
y[i] = Text.prototype[i] = function() {
this.remove();
};
a[w] = function() {
return Array.from(this.children);
y[w] = function(t) {
const n = this.childNodes;
for (let e = 0; e < n.length; e++)
if (n[e] === t) return e;
return -1;
};
a[_] = function() {
this.remove();
let j;
y[T] = function() {
return j ?? (j = document.createTextNode("")), j.cloneNode();
};
const s = Object.prototype;
s[R] = function(...t) {
return Reflect.construct(this, t);
y[d] = function(t, n) {
return t instanceof Node || (t = document.createTextNode(t)), this.insertBefore(t, this.childNodes[n]), t;
};
s[O] = function(t, n) {
if (t.includes(":")) {
const o = t.split(":");
this[o[0]][o[1]] = n;
} else
this[t] = n;
return this;
const o = Object.prototype;
o[w] = function() {
return -1;
};
s[C] = function(t, n) {
if (t.includes(":")) {
const o = t.split(":");
p((i) => this[o[0]][o[1]] = n());
} else
p((o) => this[t] = n());
o[d] = function() {
return this;
};
s[v] = function(t, n) {
if (t.includes(":")) {
const o = t.split(":");
p((i) => this[o[0]][o[1]](...n()));
} else
p((o) => this[t](...n()));
return this;
o[i] = function() {
const t = this[b].remove;
if (t)
for (const n of t) n();
};
s[g] = function() {
return this;
o[A] = function(...t) {
return Reflect.construct(this, t);
};
const l = [], c = [], y = [], S = () => l == null ? void 0 : l[l.length - 1], M = (t) => {
const n = Symbol("context");
return [() => S()[n], ({ children: h, ...m }) => () => (S()[n] = t(m), h)];
}, G = (t) => {
var n, o;
(o = (n = c == null ? void 0 : c[c.length - 1]) == null ? void 0 : n[b]) == null || o.call(n, t);
o[P] = function(...t) {
return h(this, t, this), this;
};
function f(t, n, o, i) {
var h, m;
for (let E = 0; E < n.length; E++) {
const e = n[E];
if (typeof e == "function") {
l.push({ ...i || S() });
const u = new Object();
(h = o[b]) == null || h.call(o, () => u == null ? void 0 : u[d]()), c.push(u), y.push((...x) => f(t, x, u)), f(t, [e()], u), l.pop(), y.pop(), c.pop();
} else if (Array.isArray(e))
f(t, e, o, i);
else {
if (!e) continue;
(m = o[b]) == null || m.call(o, () => e == null ? void 0 : e[d]()), e instanceof Object && (e[A] = i || S()), t[g](e);
}
}
}
s[j] = function(...t) {
return f(this, t, this, this[A]), this;
o[S] = function() {
const t = this[b], n = t.cleanup;
if (n) for (const e of n) e();
delete t.cleanup, this[i]();
};
s[b] = function(t) {
return this[r] ?? (this[r] = []), this[r].push(t), this;
o[m] = function(t, n) {
const e = this[b];
return e[t] ?? (e[t] = []), e[t].push(n), this;
};
s[w] = function() {
return [];
o[O] = function(t, ...n) {
const e = n.pop();
return N(this, n)[e] = t, this;
};
s[_] = function() {
o[C] = function(t, ...n) {
const e = n.pop(), c = N(this, n);
return v(() => c[e] = t()), this;
};
s[d] = function() {
var t;
(t = this[r]) == null || t.forEach((n) => n()), delete this[r], this[_]();
o[B] = function(t, ...n) {
const e = n.pop(), c = N(this, n), l = c[e].bind(c);
return v(() => l(...t())), this;
};
function N() {
return y[y.length - 1];
const p = Symbol("l");
Object.defineProperty(o, b, {
get() {
return this[p] ?? (this[p] = {}), this[p];
}
});
function h(t, n, e, c = { v: -1 }) {
let l = null;
for (let a = 0; a < n.length; a++) {
const u = n[a];
if (typeof u == "function") {
let s = c;
v(() => {
const r = new Object();
e[m]("remove", () => r[i]()), e[m]("cleanup", () => r[S]()), r[f] = {
...e[f],
[d]: (...g) => h(t, g, r, s),
[I]: r
}, E.push(r[f]);
const x = h(t, [u()], r, s);
return E.pop(), l ?? (l = x), () => {
s = { v: t[w](x) }, r[i]();
};
});
} else if (Array.isArray(u)) {
const s = h(t, u, e, c);
l ?? (l = s);
} else {
const s = t[d](u ?? t[T](), c.v);
c.v > -1 && c.v++, s[f] = e[f], e[m]("remove", () => s[i]()), e[m]("cleanup", () => s[S]()), l ?? (l = s);
}
}
return l;
}
function P() {
const t = c[c.length - 1];
if (t)
return () => t[d]();
function N(t, n) {
for (; n.length; ) t = t[n.shift()];
return t;
}
const T = document.createElement.bind(document), V = document.createElementNS.bind(document, "http://www.w3.org/2000/svg"), q = (t, n) => n[j](t);
const V = document.createElement.bind(document), q = document.createElementNS.bind(document, "http://www.w3.org/2000/svg"), z = (t, n) => n[P](t);
export {
g as append,
j as appendMultiple,
P as append,
C as assign,
v as call,
w as children,
r as cleanupListeners,
R as create,
M as createContext,
T as createElement,
V as createSVGElement,
S as currentContext,
G as onCleanup,
b as onRemove,
_ as remove,
q as render,
O as set,
d as unmount,
N as useAppend,
P as useRemove
B as call,
w as childrenIndex,
S as cleanup,
f as context,
A as create,
V as createElement,
q as createSVGElement,
T as empty,
d as insert,
b as listeners,
m as on,
I as parent,
i as remove,
z as render,
O as set
};

@@ -11,1 +11,4 @@ export declare function createSignal<T>(defaultValue: T): readonly [() => T, (_value: T) => void];

@@ -1,25 +0,25 @@

const s = [];
function f(t) {
const n = /* @__PURE__ */ new Set();
let e = t;
const u = [], r = Symbol("prev");
function p(e) {
const s = /* @__PURE__ */ new Set();
let t = e;
return [() => {
const o = s[s.length - 1];
return o && n.add(o), e;
}, (o) => {
e = o, n.forEach((c) => c());
const n = u[u.length - 1];
return n && s.add(n), t;
}, (n) => {
t = n, s.forEach((o) => (typeof o[r] == "function" && o[r](), o[r] = o()));
}];
}
function r(t) {
s.push(t), t(), s.pop();
function f(e) {
u.push(e), e[r] = e(), u.pop();
}
function l(t, n = 250) {
let e = !0, u;
r(() => {
e ? (e = !1, t()) : (clearTimeout(u), setTimeout(t, n));
function l(e, s = 250) {
let t = !0, c;
f(() => {
t ? (t = !1, e()) : (clearTimeout(c), setTimeout(e, s));
});
}
export {
f as createSignal,
p as createSignal,
l as useDebounced,
r as useEffect
f as useEffect
};

@@ -6,1 +6,4 @@ export * from '../lib/signals/screen'

@@ -20,1 +20,4 @@ import { PerspectiveCamera } from 'three';

@@ -1,28 +0,33 @@

import { append as g, children as E, remove as x, createContext as F, onCleanup as r, unmount as m, appendMultiple as P } from "./runtime.js";
import { useEffect as y } from "./signals.js";
import { aspectRatio as M, width as R, height as S } from "./signals/screen.js";
import { Object3D as d, PerspectiveCamera as b, Scene as O, WebGLRenderer as _, PCFSoftShadowMap as j, Clock as k } from "three";
import { EffectComposer as D, OrbitControls as W, RenderPass as q } from "three/examples/jsm/Addons.js";
d.prototype[g] = function(n) {
return this.add(n), this;
import { insert as g, childrenIndex as x, remove as y, empty as E, cleanup as h, append as F } from "./runtime.js";
import { useEffect as P } from "./signals.js";
import { aspectRatio as R, width as S, height as b } from "./signals/screen.js";
import { Object3D as s, Group as M, PerspectiveCamera as O, Scene as _, WebGLRenderer as j, PCFSoftShadowMap as k, Clock as D } from "three";
import { EffectComposer as G, OrbitControls as W, RenderPass as q } from "three/examples/jsm/Addons.js";
import { createContext as z } from "./contexts.js";
import { onCleanup as l } from "./hooks.js";
s.prototype[g] = function(o) {
return this.add(o), this;
};
d.prototype[E] = function() {
return this.children;
s.prototype[x] = function() {
return -1;
};
d.prototype[x] = function() {
s.prototype[y] = function() {
return this.removeFromParent();
};
const [z, A] = F((n) => n);
function I(n) {
s.prototype[E] = function() {
return new M();
};
const [A, H] = z((o) => o);
function Q(o) {
const {
updateFunctions: e
} = z();
e.push(n);
const o = () => e.splice(e.indexOf(n), 1);
return r(o), o;
} = A();
e.push(o);
const n = () => e.splice(e.indexOf(o), 1);
return l(n), n;
}
function J({
children: n,
function U({
children: o,
camera: e,
scene: o,
scene: n,
antialias: w,

@@ -32,24 +37,24 @@ shadowMap: C,

composer: i,
controls: a,
passes: c,
controls: d,
passes: r,
renderPass: u
}) {
e ?? (e = new b(75, window.innerWidth / window.innerHeight, 0.1, 1e3)), o ?? (o = new O()), t ?? (t = new _({
e ?? (e = new O(75, window.innerWidth / window.innerHeight, 0.1, 1e3)), n ?? (n = new _()), t ?? (t = new j({
antialias: w
})), i ?? (i = new D(t)), a ?? (a = new W(e, t.domElement)), c ?? (c = []), u ?? (u = new q(o, e)), C && (t.shadowMap.enabled = !0, t.shadowMap.type = j), y(() => {
e.aspect = M(), e.updateProjectionMatrix(), t.setSize(R(), S()), t.domElement.style.width = "100vw", t.domElement.style.height = "100vh", t.setPixelRatio(window.devicePixelRatio);
}), i.addPass(u), c.forEach((s) => i.addPass(s));
const h = [], v = new k();
let l = !1;
function f() {
if (l) return;
requestAnimationFrame(f);
const s = v.getDelta();
h.forEach((p) => p(s)), i.render();
})), i ?? (i = new G(t)), d ?? (d = new W(e, t.domElement)), r ?? (r = []), u ?? (u = new q(n, e)), C && (t.shadowMap.enabled = !0, t.shadowMap.type = k), P(() => {
e.aspect = R(), e.updateProjectionMatrix(), t.setSize(S(), b()), t.domElement.style.width = "100vw", t.domElement.style.height = "100vh", t.setPixelRatio(window.devicePixelRatio);
}), i.addPass(u), r.forEach((p) => i.addPass(p));
const f = [], v = new D();
let m = !1;
function c() {
if (m) return;
requestAnimationFrame(c);
const p = v.getDelta();
f.forEach((a) => a(p)), i.render();
}
return f(), r(() => {
l = !0, t.dispose(), u.dispose(), i.dispose(), a.dispose(), e[m](), o[m]();
}), A({
return c(), l(() => {
m = !0, t.dispose(), u.dispose(), i.dispose(), d.dispose(), e[h](), n[h]();
}), H({
get scene() {
return o;
return n;
},

@@ -63,11 +68,11 @@ get camera() {

get updateFunctions() {
return h;
return f;
},
children: (s) => [(p) => (o[P](n), void 0), (p) => t.domElement]
children: (p) => [(a) => (n[F](o), void 0), (a) => t.domElement]
});
}
export {
J as Canvas,
I as useFrame,
z as useScene
U as Canvas,
Q as useFrame,
A as useScene
};

@@ -29,1 +29,4 @@ import { BindingParams } from 'tweakpane';

@@ -1,4 +0,4 @@

import { onCleanup as l } from "./runtime.js";
import { useDebounced as m, useEffect as w, createSignal as u } from "./signals.js";
import { Pane as b } from "tweakpane";
import { onCleanup as l } from "./hooks.js";
const f = Symbol("folder"), a = new b({ title: "Tweaks" });

@@ -5,0 +5,0 @@ let d = null, h = 0, F = 0, S = 0;

@@ -34,1 +34,4 @@ import { default as battutaMacros } from 'unplugin-macros/vite';

@@ -1,2 +0,2 @@

import { t as f } from "./jsx-Bwrm210x.js";
import { t as f } from "./jsx-qFfO16Cf.js";
import h from "unplugin-macros/vite";

@@ -3,0 +3,0 @@ import { default as I } from "unplugin-macros/vite";

{
"name": "battuta",
"private": false,
"version": "0.0.2",
"version": "0.0.3",
"type": "module",

@@ -22,2 +22,4 @@ "license": "MIT",

"./signals": "./dist/signals.js",
"./contexts": "./dist/contexts.js",
"./hooks": "./dist/hooks.js",
"./tweak": "./dist/tweak.js",

@@ -51,2 +53,8 @@ "./signals/screen": "./dist/signals/screen.js",

],
"contexts": [
"dist/contexts.d.ts"
],
"hooks": [
"dist/hooks.d.ts"
],
"tweak": [

@@ -75,3 +83,3 @@ "dist/tweak.d.ts"

"@types/three": "^0.169.0",
"battuta": "0.0.1",
"battuta": "0.0.2",
"typescript": "^5.5.3",

@@ -78,0 +86,0 @@ "vite-plugin-dts": "^4.0.3",

@@ -98,10 +98,10 @@ # Battuta

THREE.PointLight[create](0xffff00, 2, 100)
[call]("color:set", () => color()) // calls light.color.set(color()) when color get updated
[assign]("position:y", () => position())
[set]("position:x", 1)
[set]("castShadow", true)
[call](() => color(), "color", "set") // calls light.color.set(color()) when color get updated
[assign](() => position(), "position", "y")
[set](1, "position", "x")
[set](true, "castShadow")
)
```
for this to work some methods need to be implmented on the parent prototypes, by default Object instances define default implementations that can be overwriten, at least `append` and `remove` need to be implemented, those should never be called directly, instead use the `useAppend` & `useRemove` hooks or the `appendMultiple` and `unmount` methods
for this to work some methods need to be implmented on the parent prototypes, by default Object instances define default implementations that can be overwriten, at least `empty`, `childrenIndex`, `insert` and `remove` need to be implemented, those last two should never be called directly, instead use the `useAppend` & `useRemove` hooks or the `append` and `cleanup` methods

@@ -111,5 +111,6 @@ this is an example in the case of threejs

```ts
import { append, remove } from "battuta/runtime"
import { append, remove, childrenIndex, empty } from "battuta/runtime";
import { Object3D, Group } from "three";
Object3D.prototype[append] = function(child: any){
Object3D.prototype[insert] = function(child: any, index?: number){
this.add(child);

@@ -122,2 +123,10 @@ return this;

}
Object3D.prototype[childrenIndex] = function(child){
return -1;
}
Object3D.prototype[empty] = function(){
return new Group();
}
```

@@ -164,6 +173,6 @@

MeshPhongMaterial[create]()
[call]("color:set", () => color())
[call](() => color(), "color", "set")
)
[set]("castShadow", true)
[set]("receiveShadow", true)
[set](true, "castShadow")
[set](true, "receiveShadow")
```

@@ -261,3 +270,2 @@

const div = <div/>
div[appendMultiple](Component)
```

@@ -314,3 +322,3 @@

function Parent() {
return createElement(div)[appendMultiple](Child())
return createElement(div)[append](Child())
}

@@ -321,3 +329,3 @@ ```

the second uncommon behavior is that if you have a `onCleanup` hook in your Child the Child is gonna consume from the parenting context, which in this case is the Parent element, this doesn't cause issues unless you're directly removing the div separatly using the `unmount` method, in this case the div will be removed as well as the h1 but the `onCleanup` hook won't run for the child as it's bound to the Parent component
the second uncommon behavior is that if you have a `onCleanup` hook in your Child the Child is gonna consume from the parenting context, which in this case is the Parent element, this doesn't cause issues unless you're directly removing the div separatly using the `cleanup` method, in this case the div will be removed as well as the h1 but the `onCleanup` hook won't run for the child as it's bound to the Parent component

@@ -324,0 +332,0 @@ ## CLI