@vidocsecurity/cli 0.1.12
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.
- package/dist/index.js +4115 -0
- package/dist/markdown.css +132 -0
- package/dist/node_modules/@node-rs/crc32/LICENSE +21 -0
- package/dist/node_modules/@node-rs/crc32/README.md +61 -0
- package/dist/node_modules/@node-rs/crc32/browser.js +1 -0
- package/dist/node_modules/@node-rs/crc32/index.d.ts +5 -0
- package/dist/node_modules/@node-rs/crc32/index.js +368 -0
- package/dist/node_modules/@node-rs/crc32/package.json +97 -0
- package/dist/node_modules/@vidocsecurity/code-context/languages.yaml +8332 -0
- package/dist/node_modules/@vidocsecurity/code-context/package.json +83 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-c-sharp.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-c.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-cpp.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-css.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-go.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-hcl.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-ini.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-java.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-javascript.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-python.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-regex.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-ruby.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-rust.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-tsx.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-typescript.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter.js +4074 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter.wasm +0 -0
- package/dist/node_modules/@vidocsecurity/code-context/wasm/web-tree-sitter.d.ts +1027 -0
- package/dist/node_modules/yoga-layout/README.md +40 -0
- package/dist/node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js +75 -0
- package/dist/node_modules/yoga-layout/dist/src/generated/YGEnums.d.ts +189 -0
- package/dist/node_modules/yoga-layout/dist/src/generated/YGEnums.js +211 -0
- package/dist/node_modules/yoga-layout/dist/src/generated/YGEnums.js.map +1 -0
- package/dist/node_modules/yoga-layout/dist/src/index.d.ts +12 -0
- package/dist/node_modules/yoga-layout/dist/src/index.js +16 -0
- package/dist/node_modules/yoga-layout/dist/src/index.js.map +1 -0
- package/dist/node_modules/yoga-layout/dist/src/load.d.ts +11 -0
- package/dist/node_modules/yoga-layout/dist/src/load.js +17 -0
- package/dist/node_modules/yoga-layout/dist/src/load.js.map +1 -0
- package/dist/node_modules/yoga-layout/dist/src/wrapAssembly.d.ts +155 -0
- package/dist/node_modules/yoga-layout/dist/src/wrapAssembly.js +125 -0
- package/dist/node_modules/yoga-layout/dist/src/wrapAssembly.js.map +1 -0
- package/dist/node_modules/yoga-layout/package.json +53 -0
- package/dist/node_modules/yoga-layout/src/Config.cpp +54 -0
- package/dist/node_modules/yoga-layout/src/Config.h +44 -0
- package/dist/node_modules/yoga-layout/src/Layout.h +19 -0
- package/dist/node_modules/yoga-layout/src/Node.cpp +507 -0
- package/dist/node_modules/yoga-layout/src/Node.h +239 -0
- package/dist/node_modules/yoga-layout/src/Size.h +17 -0
- package/dist/node_modules/yoga-layout/src/Value.h +23 -0
- package/dist/node_modules/yoga-layout/src/embind.cpp +207 -0
- package/dist/node_modules/yoga-layout/src/generated/YGEnums.ts +210 -0
- package/dist/node_modules/yoga-layout/src/index.ts +23 -0
- package/dist/node_modules/yoga-layout/src/load.ts +25 -0
- package/dist/node_modules/yoga-layout/src/wrapAssembly.ts +336 -0
- package/dist/prebuilds/android-arm/classic-level.armv7.node +0 -0
- package/dist/prebuilds/android-arm64/classic-level.armv8.node +0 -0
- package/dist/prebuilds/darwin-x64+arm64/classic-level.node +0 -0
- package/dist/prebuilds/linux-arm/classic-level.armv6.node +0 -0
- package/dist/prebuilds/linux-arm/classic-level.armv7.node +0 -0
- package/dist/prebuilds/linux-arm64/classic-level.armv8.node +0 -0
- package/dist/prebuilds/linux-x64/classic-level.musl.node +0 -0
- package/dist/prebuilds/linux-x64/classic-level.node +0 -0
- package/dist/prebuilds/win32-ia32/classic-level.node +0 -0
- package/dist/prebuilds/win32-x64/classic-level.node +0 -0
- package/dist/version.txt +1 -0
- package/package.json +23 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// @ts-ignore untyped from Emscripten
|
|
11
|
+
import loadYoga from '../binaries/yoga-wasm-base64-esm.js';
|
|
12
|
+
import wrapAssembly from './wrapAssembly.ts';
|
|
13
|
+
|
|
14
|
+
export type {
|
|
15
|
+
Config,
|
|
16
|
+
DirtiedFunction,
|
|
17
|
+
MeasureFunction,
|
|
18
|
+
Node,
|
|
19
|
+
} from './wrapAssembly.ts';
|
|
20
|
+
|
|
21
|
+
const Yoga = wrapAssembly(await loadYoga());
|
|
22
|
+
export default Yoga;
|
|
23
|
+
export * from './generated/YGEnums.ts';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// @ts-ignore untyped from Emscripten
|
|
11
|
+
import loadYogaImpl from '../binaries/yoga-wasm-base64-esm.js';
|
|
12
|
+
import wrapAssembly from './wrapAssembly.ts';
|
|
13
|
+
|
|
14
|
+
export type {
|
|
15
|
+
Config,
|
|
16
|
+
DirtiedFunction,
|
|
17
|
+
MeasureFunction,
|
|
18
|
+
Node,
|
|
19
|
+
Yoga,
|
|
20
|
+
} from './wrapAssembly.ts';
|
|
21
|
+
|
|
22
|
+
export async function loadYoga() {
|
|
23
|
+
return wrapAssembly(await loadYogaImpl());
|
|
24
|
+
}
|
|
25
|
+
export * from './generated/YGEnums.ts';
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
* @format
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// @ts-nocheck
|
|
11
|
+
|
|
12
|
+
import {Unit, Direction} from './generated/YGEnums.ts';
|
|
13
|
+
import YGEnums from './generated/YGEnums.ts';
|
|
14
|
+
|
|
15
|
+
import type {
|
|
16
|
+
Align,
|
|
17
|
+
BoxSizing,
|
|
18
|
+
Display,
|
|
19
|
+
Edge,
|
|
20
|
+
Errata,
|
|
21
|
+
ExperimentalFeature,
|
|
22
|
+
FlexDirection,
|
|
23
|
+
Gutter,
|
|
24
|
+
Justify,
|
|
25
|
+
MeasureMode,
|
|
26
|
+
Overflow,
|
|
27
|
+
PositionType,
|
|
28
|
+
Wrap,
|
|
29
|
+
} from './generated/YGEnums.ts';
|
|
30
|
+
|
|
31
|
+
type Layout = {
|
|
32
|
+
left: number;
|
|
33
|
+
right: number;
|
|
34
|
+
top: number;
|
|
35
|
+
bottom: number;
|
|
36
|
+
width: number;
|
|
37
|
+
height: number;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
type Size = {
|
|
41
|
+
width: number;
|
|
42
|
+
height: number;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
type Value = {
|
|
46
|
+
unit: Unit;
|
|
47
|
+
value: number;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export type Config = {
|
|
51
|
+
free(): void;
|
|
52
|
+
isExperimentalFeatureEnabled(feature: ExperimentalFeature): boolean;
|
|
53
|
+
setExperimentalFeatureEnabled(
|
|
54
|
+
feature: ExperimentalFeature,
|
|
55
|
+
enabled: boolean,
|
|
56
|
+
): void;
|
|
57
|
+
setPointScaleFactor(factor: number): void;
|
|
58
|
+
getErrata(): Errata;
|
|
59
|
+
setErrata(errata: Errata): void;
|
|
60
|
+
useWebDefaults(): boolean;
|
|
61
|
+
setUseWebDefaults(useWebDefaults: boolean): void;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type DirtiedFunction = (node: Node) => void;
|
|
65
|
+
|
|
66
|
+
export type MeasureFunction = (
|
|
67
|
+
width: number,
|
|
68
|
+
widthMode: MeasureMode,
|
|
69
|
+
height: number,
|
|
70
|
+
heightMode: MeasureMode,
|
|
71
|
+
) => Size;
|
|
72
|
+
|
|
73
|
+
export type Node = {
|
|
74
|
+
calculateLayout(
|
|
75
|
+
width: number | 'auto' | undefined,
|
|
76
|
+
height: number | 'auto' | undefined,
|
|
77
|
+
direction?: Direction,
|
|
78
|
+
): void;
|
|
79
|
+
copyStyle(node: Node): void;
|
|
80
|
+
free(): void;
|
|
81
|
+
freeRecursive(): void;
|
|
82
|
+
getAlignContent(): Align;
|
|
83
|
+
getAlignItems(): Align;
|
|
84
|
+
getAlignSelf(): Align;
|
|
85
|
+
getAspectRatio(): number;
|
|
86
|
+
getBorder(edge: Edge): number;
|
|
87
|
+
getChild(index: number): Node;
|
|
88
|
+
getChildCount(): number;
|
|
89
|
+
getComputedBorder(edge: Edge): number;
|
|
90
|
+
getComputedBottom(): number;
|
|
91
|
+
getComputedHeight(): number;
|
|
92
|
+
getComputedLayout(): Layout;
|
|
93
|
+
getComputedLeft(): number;
|
|
94
|
+
getComputedMargin(edge: Edge): number;
|
|
95
|
+
getComputedPadding(edge: Edge): number;
|
|
96
|
+
getComputedRight(): number;
|
|
97
|
+
getComputedTop(): number;
|
|
98
|
+
getComputedWidth(): number;
|
|
99
|
+
getDirection(): Direction;
|
|
100
|
+
getDisplay(): Display;
|
|
101
|
+
getFlexBasis(): Value;
|
|
102
|
+
getFlexDirection(): FlexDirection;
|
|
103
|
+
getFlexGrow(): number;
|
|
104
|
+
getFlexShrink(): number;
|
|
105
|
+
getFlexWrap(): Wrap;
|
|
106
|
+
getHeight(): Value;
|
|
107
|
+
getJustifyContent(): Justify;
|
|
108
|
+
getGap(gutter: Gutter): Value;
|
|
109
|
+
getMargin(edge: Edge): Value;
|
|
110
|
+
getMaxHeight(): Value;
|
|
111
|
+
getMaxWidth(): Value;
|
|
112
|
+
getMinHeight(): Value;
|
|
113
|
+
getMinWidth(): Value;
|
|
114
|
+
getOverflow(): Overflow;
|
|
115
|
+
getPadding(edge: Edge): Value;
|
|
116
|
+
getParent(): Node | null;
|
|
117
|
+
getPosition(edge: Edge): Value;
|
|
118
|
+
getPositionType(): PositionType;
|
|
119
|
+
getBoxSizing(): BoxSizing;
|
|
120
|
+
getWidth(): Value;
|
|
121
|
+
insertChild(child: Node, index: number): void;
|
|
122
|
+
isDirty(): boolean;
|
|
123
|
+
isReferenceBaseline(): boolean;
|
|
124
|
+
markDirty(): void;
|
|
125
|
+
hasNewLayout(): boolean;
|
|
126
|
+
markLayoutSeen(): void;
|
|
127
|
+
removeChild(child: Node): void;
|
|
128
|
+
reset(): void;
|
|
129
|
+
setAlignContent(alignContent: Align): void;
|
|
130
|
+
setAlignItems(alignItems: Align): void;
|
|
131
|
+
setAlignSelf(alignSelf: Align): void;
|
|
132
|
+
setAspectRatio(aspectRatio: number | undefined): void;
|
|
133
|
+
setBorder(edge: Edge, borderWidth: number | undefined): void;
|
|
134
|
+
setDirection(direction: Direction): void;
|
|
135
|
+
setDisplay(display: Display): void;
|
|
136
|
+
setFlex(flex: number | undefined): void;
|
|
137
|
+
setFlexBasis(flexBasis: number | 'auto' | `${number}%` | undefined): void;
|
|
138
|
+
setFlexBasisPercent(flexBasis: number | undefined): void;
|
|
139
|
+
setFlexBasisAuto(): void;
|
|
140
|
+
setFlexDirection(flexDirection: FlexDirection): void;
|
|
141
|
+
setFlexGrow(flexGrow: number | undefined): void;
|
|
142
|
+
setFlexShrink(flexShrink: number | undefined): void;
|
|
143
|
+
setFlexWrap(flexWrap: Wrap): void;
|
|
144
|
+
setHeight(height: number | 'auto' | `${number}%` | undefined): void;
|
|
145
|
+
setIsReferenceBaseline(isReferenceBaseline: boolean): void;
|
|
146
|
+
setHeightAuto(): void;
|
|
147
|
+
setHeightPercent(height: number | undefined): void;
|
|
148
|
+
setJustifyContent(justifyContent: Justify): void;
|
|
149
|
+
setGap(gutter: Gutter, gapLength: number | `${number}%` | undefined): Value;
|
|
150
|
+
setGapPercent(gutter: Gutter, gapLength: number | undefined): Value;
|
|
151
|
+
setMargin(
|
|
152
|
+
edge: Edge,
|
|
153
|
+
margin: number | 'auto' | `${number}%` | undefined,
|
|
154
|
+
): void;
|
|
155
|
+
setMarginAuto(edge: Edge): void;
|
|
156
|
+
setMarginPercent(edge: Edge, margin: number | undefined): void;
|
|
157
|
+
setMaxHeight(maxHeight: number | `${number}%` | undefined): void;
|
|
158
|
+
setMaxHeightPercent(maxHeight: number | undefined): void;
|
|
159
|
+
setMaxWidth(maxWidth: number | `${number}%` | undefined): void;
|
|
160
|
+
setMaxWidthPercent(maxWidth: number | undefined): void;
|
|
161
|
+
setDirtiedFunc(dirtiedFunc: DirtiedFunction | null): void;
|
|
162
|
+
setMeasureFunc(measureFunc: MeasureFunction | null): void;
|
|
163
|
+
setMinHeight(minHeight: number | `${number}%` | undefined): void;
|
|
164
|
+
setMinHeightPercent(minHeight: number | undefined): void;
|
|
165
|
+
setMinWidth(minWidth: number | `${number}%` | undefined): void;
|
|
166
|
+
setMinWidthPercent(minWidth: number | undefined): void;
|
|
167
|
+
setOverflow(overflow: Overflow): void;
|
|
168
|
+
setPadding(edge: Edge, padding: number | `${number}%` | undefined): void;
|
|
169
|
+
setPaddingPercent(edge: Edge, padding: number | undefined): void;
|
|
170
|
+
setPosition(edge: Edge, position: number | `${number}%` | undefined): void;
|
|
171
|
+
setPositionPercent(edge: Edge, position: number | undefined): void;
|
|
172
|
+
setPositionType(positionType: PositionType): void;
|
|
173
|
+
setPositionAuto(edge: Edge): void;
|
|
174
|
+
setBoxSizing(boxSizing: BoxSizing): void;
|
|
175
|
+
setWidth(width: number | 'auto' | `${number}%` | undefined): void;
|
|
176
|
+
setWidthAuto(): void;
|
|
177
|
+
setWidthPercent(width: number | undefined): void;
|
|
178
|
+
unsetDirtiedFunc(): void;
|
|
179
|
+
unsetMeasureFunc(): void;
|
|
180
|
+
setAlwaysFormsContainingBlock(alwaysFormsContainingBlock: boolean): void;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export type Yoga = {
|
|
184
|
+
Config: {
|
|
185
|
+
create(): Config;
|
|
186
|
+
destroy(config: Config): void;
|
|
187
|
+
};
|
|
188
|
+
Node: {
|
|
189
|
+
create(config?: Config): Node;
|
|
190
|
+
createDefault(): Node;
|
|
191
|
+
createWithConfig(config: Config): Node;
|
|
192
|
+
destroy(node: Node): void;
|
|
193
|
+
};
|
|
194
|
+
} & typeof YGEnums;
|
|
195
|
+
|
|
196
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
197
|
+
export default function wrapAssembly(lib: any): Yoga {
|
|
198
|
+
function patch(prototype, name, fn) {
|
|
199
|
+
const original = prototype[name];
|
|
200
|
+
|
|
201
|
+
prototype[name] = function (...args) {
|
|
202
|
+
return fn.call(this, original, ...args);
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
for (const fnName of [
|
|
207
|
+
'setPosition',
|
|
208
|
+
'setMargin',
|
|
209
|
+
'setFlexBasis',
|
|
210
|
+
'setWidth',
|
|
211
|
+
'setHeight',
|
|
212
|
+
'setMinWidth',
|
|
213
|
+
'setMinHeight',
|
|
214
|
+
'setMaxWidth',
|
|
215
|
+
'setMaxHeight',
|
|
216
|
+
'setPadding',
|
|
217
|
+
'setGap',
|
|
218
|
+
]) {
|
|
219
|
+
const methods = {
|
|
220
|
+
[Unit.Point]: lib.Node.prototype[fnName],
|
|
221
|
+
[Unit.Percent]: lib.Node.prototype[`${fnName}Percent`],
|
|
222
|
+
[Unit.Auto]: lib.Node.prototype[`${fnName}Auto`],
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
patch(lib.Node.prototype, fnName, function (original, ...args) {
|
|
226
|
+
// We patch all these functions to add support for the following calls:
|
|
227
|
+
// .setWidth(100) / .setWidth("100%") / .setWidth(.getWidth()) / .setWidth("auto")
|
|
228
|
+
|
|
229
|
+
const value = args.pop();
|
|
230
|
+
let unit, asNumber;
|
|
231
|
+
|
|
232
|
+
if (value === 'auto') {
|
|
233
|
+
unit = Unit.Auto;
|
|
234
|
+
asNumber = undefined;
|
|
235
|
+
} else if (typeof value === 'object') {
|
|
236
|
+
unit = value.unit;
|
|
237
|
+
asNumber = value.valueOf();
|
|
238
|
+
} else {
|
|
239
|
+
unit =
|
|
240
|
+
typeof value === 'string' && value.endsWith('%')
|
|
241
|
+
? Unit.Percent
|
|
242
|
+
: Unit.Point;
|
|
243
|
+
asNumber = parseFloat(value);
|
|
244
|
+
if (
|
|
245
|
+
value !== undefined &&
|
|
246
|
+
!Number.isNaN(value) &&
|
|
247
|
+
Number.isNaN(asNumber)
|
|
248
|
+
) {
|
|
249
|
+
throw new Error(`Invalid value ${value} for ${fnName}`);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
if (!methods[unit])
|
|
254
|
+
throw new Error(
|
|
255
|
+
`Failed to execute "${fnName}": Unsupported unit '${value}'`,
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
if (asNumber !== undefined) {
|
|
259
|
+
return methods[unit].call(this, ...args, asNumber);
|
|
260
|
+
} else {
|
|
261
|
+
return methods[unit].call(this, ...args);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function wrapMeasureFunction(measureFunction) {
|
|
267
|
+
return lib.MeasureCallback.implement({
|
|
268
|
+
measure: (...args) => {
|
|
269
|
+
const {width, height} = measureFunction(...args);
|
|
270
|
+
return {
|
|
271
|
+
width: width ?? NaN,
|
|
272
|
+
height: height ?? NaN,
|
|
273
|
+
};
|
|
274
|
+
},
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
patch(lib.Node.prototype, 'setMeasureFunc', function (original, measureFunc) {
|
|
279
|
+
// This patch is just a convenience patch, since it helps write more
|
|
280
|
+
// idiomatic source code (such as .setMeasureFunc(null))
|
|
281
|
+
if (measureFunc) {
|
|
282
|
+
return original.call(this, wrapMeasureFunction(measureFunc));
|
|
283
|
+
} else {
|
|
284
|
+
return this.unsetMeasureFunc();
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
function wrapDirtiedFunc(dirtiedFunction) {
|
|
289
|
+
return lib.DirtiedCallback.implement({dirtied: dirtiedFunction});
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
patch(lib.Node.prototype, 'setDirtiedFunc', function (original, dirtiedFunc) {
|
|
293
|
+
original.call(this, wrapDirtiedFunc(dirtiedFunc));
|
|
294
|
+
});
|
|
295
|
+
|
|
296
|
+
patch(lib.Config.prototype, 'free', function () {
|
|
297
|
+
// Since we handle the memory allocation ourselves (via lib.Config.create),
|
|
298
|
+
// we also need to handle the deallocation
|
|
299
|
+
lib.Config.destroy(this);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
patch(lib.Node, 'create', (_, config) => {
|
|
303
|
+
// We decide the constructor we want to call depending on the parameters
|
|
304
|
+
return config
|
|
305
|
+
? lib.Node.createWithConfig(config)
|
|
306
|
+
: lib.Node.createDefault();
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
patch(lib.Node.prototype, 'free', function () {
|
|
310
|
+
// Since we handle the memory allocation ourselves (via lib.Node.create),
|
|
311
|
+
// we also need to handle the deallocation
|
|
312
|
+
lib.Node.destroy(this);
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
patch(lib.Node.prototype, 'freeRecursive', function () {
|
|
316
|
+
for (let t = 0, T = this.getChildCount(); t < T; ++t) {
|
|
317
|
+
this.getChild(0).freeRecursive();
|
|
318
|
+
}
|
|
319
|
+
this.free();
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
patch(
|
|
323
|
+
lib.Node.prototype,
|
|
324
|
+
'calculateLayout',
|
|
325
|
+
function (original, width = NaN, height = NaN, direction = Direction.LTR) {
|
|
326
|
+
// Just a small patch to add support for the function default parameters
|
|
327
|
+
return original.call(this, width, height, direction);
|
|
328
|
+
},
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
return {
|
|
332
|
+
Config: lib.Config,
|
|
333
|
+
Node: lib.Node,
|
|
334
|
+
...YGEnums,
|
|
335
|
+
};
|
|
336
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/version.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.1.12
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vidocsecurity/cli",
|
|
3
|
+
"version": "0.1.12",
|
|
4
|
+
"bin": {
|
|
5
|
+
"vidoc": "./dist/index.js"
|
|
6
|
+
},
|
|
7
|
+
"type": "module",
|
|
8
|
+
"scripts": {},
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"module": "dist/index.js",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@node-rs/crc32": "^1.10.6",
|
|
13
|
+
"@vscode/ripgrep": "^1.15.9"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {},
|
|
16
|
+
"volta": {
|
|
17
|
+
"node": "16.7.0",
|
|
18
|
+
"yarn": "1.22.17"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
]
|
|
23
|
+
}
|