From 3c9ebf00f5c7a0b4ff16d0fee49d9715187e747c Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Fri, 27 Jan 2023 13:18:47 +0300 Subject: [PATCH 1/5] update yoga submodule --- yoga | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yoga b/yoga index eea87c3..5496554 160000 --- a/yoga +++ b/yoga @@ -1 +1 @@ -Subproject commit eea87c3abc08c8bb764a0127155c7c046a15f335 +Subproject commit 5496554cbf450633066b7bfad6839dd9524018fe From 1c45e8fd1d1bf559c46c36538b7ae500516325f6 Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Fri, 27 Jan 2023 13:19:40 +0300 Subject: [PATCH 2/5] compile bindings from submodule --- Makefile | 21 +- asm.js | 10 +- bindings/Config.cc | 31 --- bindings/Config.hh | 34 --- bindings/Layout.hh | 12 - bindings/Node.cc | 446 ----------------------------- bindings/Node.hh | 219 --------------- bindings/Value.hh | 16 -- bindings/embind.cc | 181 ------------ build.js | 3 - entry/index.js | 358 ------------------------ entry/package.json | 1 - index.js | 36 +-- package.json | 7 +- pnpm-lock.yaml | 681 ++++++++++++++++++++++++++++++--------------- 15 files changed, 488 insertions(+), 1568 deletions(-) delete mode 100644 bindings/Config.cc delete mode 100644 bindings/Config.hh delete mode 100644 bindings/Layout.hh delete mode 100644 bindings/Node.cc delete mode 100644 bindings/Node.hh delete mode 100644 bindings/Value.hh delete mode 100644 bindings/embind.cc delete mode 100644 entry/index.js delete mode 100644 entry/package.json diff --git a/Makefile b/Makefile index 28e134e..b97a572 100644 --- a/Makefile +++ b/Makefile @@ -3,12 +3,17 @@ CC=emcc all: clean dir wasm asm wasm: - $(CC) yoga/yoga/*.cpp bindings/*.cc \ + $(CC) yoga/yoga/*.cpp yoga/yoga/**/*.cpp yoga/javascript/src_native/*.cc \ --bind \ -Iyoga \ -g0 \ - -Os \ + -O3 \ -flto \ + -std=c++14 \ + -fno-exceptions \ + -fno-rtti \ + -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \ + --closure 1 \ -s WASM=1 \ -s WASM_ASYNC_COMPILATION=1 \ -s USE_CLOSURE_COMPILER=1 \ @@ -19,19 +24,25 @@ wasm: -s DYNAMIC_EXECUTION=0 \ -s TEXTDECODER=0 \ -s ENVIRONMENT='web' \ + -s FETCH_SUPPORT_INDEXEDDB=0 \ -s FILESYSTEM=0 \ -s MALLOC="emmalloc" \ - -s INCOMING_MODULE_JS_API=['instantiateWasm','locateFile']\ + -s INCOMING_MODULE_JS_API=['instantiateWasm']\ -s EXPORT_NAME="yoga" \ -o tmp/yoga.mjs asm: - $(CC) yoga/yoga/*.cpp bindings/*.cc \ + $(CC) yoga/yoga/*.cpp yoga/yoga/**/*.cpp yoga/javascript/src_native/*.cc \ --bind \ -Iyoga \ -g0 \ -Os \ -flto \ + -std=c++14 \ + -fno-exceptions \ + -fno-rtti \ + -DEMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0 \ + --closure 1 \ --memory-init-file 0 \ -s WASM=0 \ -s WASM_ASYNC_COMPILATION=0 \ @@ -43,7 +54,7 @@ asm: -s DYNAMIC_EXECUTION=0 \ -s TEXTDECODER=0 \ -s ENVIRONMENT='web' \ - -s ERROR_ON_UNDEFINED_SYMBOLS=0 \ + -s FETCH_SUPPORT_INDEXEDDB=0 \ -s FILESYSTEM=0 \ -s MALLOC="emmalloc" \ -s EXPORT_NAME="yoga" \ diff --git a/asm.js b/asm.js index 44b4a1d..119032e 100644 --- a/asm.js +++ b/asm.js @@ -1,10 +1,6 @@ -import entry from './entry/index.js' -import yoga from './tmp/yoga-asm.mjs' - -function bind(_, proto) { - return proto -} +import wrapAsm from "./yoga/javascript/src_js/wrapAsm.js"; +import yoga from "./tmp/yoga-asm.mjs"; export default function () { - return entry(bind, yoga()) + return wrapAsm(yoga()); } diff --git a/bindings/Config.cc b/bindings/Config.cc deleted file mode 100644 index a667a2c..0000000 --- a/bindings/Config.cc +++ /dev/null @@ -1,31 +0,0 @@ -#include - -#include "./Config.hh" - -/* static */ Config* Config::create(void) { - return new Config(); -} - -/* static */ void Config::destroy(Config* node) { - delete node; -} - -Config::Config(void) : m_config(YGConfigNew()) {} - -Config::~Config(void) { - YGConfigFree(m_config); -} - -void Config::setExperimentalFeatureEnabled(int feature, bool enabled) { - YGConfigSetExperimentalFeatureEnabled( - m_config, static_cast(feature), enabled); -} - -void Config::setPointScaleFactor(float pixelsInPoint) { - YGConfigSetPointScaleFactor(m_config, pixelsInPoint); -} - -bool Config::isExperimentalFeatureEnabled(int feature) const { - return YGConfigIsExperimentalFeatureEnabled( - m_config, static_cast(feature)); -} diff --git a/bindings/Config.hh b/bindings/Config.hh deleted file mode 100644 index 216cb5e..0000000 --- a/bindings/Config.hh +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -#include - -class Config { - - friend class Node; - -public: - static Config* create(void); - - static void destroy(Config* config); - -private: - Config(void); - -public: - ~Config(void); - -public: // Prevent accidental copy - Config(Config const&) = delete; - - Config const& operator=(Config const&) = delete; - -public: // Setters - void setExperimentalFeatureEnabled(int feature, bool enabled); - void setPointScaleFactor(float pixelsInPoint); - -public: // Getters - bool isExperimentalFeatureEnabled(int feature) const; - -private: - YGConfigRef m_config; -}; diff --git a/bindings/Layout.hh b/bindings/Layout.hh deleted file mode 100644 index 3892c23..0000000 --- a/bindings/Layout.hh +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - -struct Layout { - double left; - double right; - - double top; - double bottom; - - double width; - double height; -}; diff --git a/bindings/Node.cc b/bindings/Node.cc deleted file mode 100644 index 3a615fd..0000000 --- a/bindings/Node.cc +++ /dev/null @@ -1,446 +0,0 @@ -#include - -#include - -#include "./Node.hh" -#include "./Layout.hh" -#include "./Config.hh" -#include "./Value.hh" - -static YGSize globalMeasureFunc( - YGNodeRef nodeRef, - float width, - YGMeasureMode widthMode, - float height, - YGMeasureMode heightMode) { - Node const& node = *reinterpret_cast(YGNodeGetContext(nodeRef)); - - return node.callMeasureFunc(width, widthMode, height, heightMode); -} - -static void globalDirtiedFunc(YGNodeRef nodeRef) { - Node const& node = *reinterpret_cast(YGNodeGetContext(nodeRef)); - - node.callDirtiedFunc(); -} - -/* static */ Node* Node::createDefault(void) { - return new Node(nullptr); -} - -/* static */ Node* Node::createWithConfig(Config* config) { - return new Node(config); -} - -/* static */ void Node::destroy(Node* node) { - delete node; -} - -/* static */ Node* Node::fromYGNode(YGNodeRef nodeRef) { - return reinterpret_cast(YGNodeGetContext(nodeRef)); -} - -Node::Node(Config* config) - : m_node( - config != nullptr ? YGNodeNewWithConfig(config->m_config) - : YGNodeNew()), - m_measureFunc(nullptr), - m_dirtiedFunc(nullptr) { - YGNodeSetContext(m_node, reinterpret_cast(this)); -} - -Node::~Node(void) { - YGNodeFree(m_node); -} - -void Node::reset(void) { - m_measureFunc.reset(nullptr); - m_dirtiedFunc.reset(nullptr); - - YGNodeReset(m_node); -} - -void Node::copyStyle(Node const& other) { - YGNodeCopyStyle(m_node, other.m_node); -} - -void Node::setPositionType(int positionType) { - YGNodeStyleSetPositionType(m_node, static_cast(positionType)); -} - -void Node::setPosition(int edge, double position) { - YGNodeStyleSetPosition(m_node, static_cast(edge), position); -} - -void Node::setPositionPercent(int edge, double position) { - YGNodeStyleSetPositionPercent(m_node, static_cast(edge), position); -} - -void Node::setAlignContent(int alignContent) { - YGNodeStyleSetAlignContent(m_node, static_cast(alignContent)); -} - -void Node::setAlignItems(int alignItems) { - YGNodeStyleSetAlignItems(m_node, static_cast(alignItems)); -} - -void Node::setAlignSelf(int alignSelf) { - YGNodeStyleSetAlignSelf(m_node, static_cast(alignSelf)); -} - -void Node::setFlexDirection(int flexDirection) { - YGNodeStyleSetFlexDirection( - m_node, static_cast(flexDirection)); -} - -void Node::setFlexWrap(int flexWrap) { - YGNodeStyleSetFlexWrap(m_node, static_cast(flexWrap)); -} - -void Node::setJustifyContent(int justifyContent) { - YGNodeStyleSetJustifyContent(m_node, static_cast(justifyContent)); -} - -void Node::setMargin(int edge, double margin) { - YGNodeStyleSetMargin(m_node, static_cast(edge), margin); -} - -void Node::setMarginPercent(int edge, double margin) { - YGNodeStyleSetMarginPercent(m_node, static_cast(edge), margin); -} - -void Node::setMarginAuto(int edge) { - YGNodeStyleSetMarginAuto(m_node, static_cast(edge)); -} - -void Node::setOverflow(int overflow) { - YGNodeStyleSetOverflow(m_node, static_cast(overflow)); -} - -void Node::setDisplay(int display) { - YGNodeStyleSetDisplay(m_node, static_cast(display)); -} - -void Node::setFlex(double flex) { - YGNodeStyleSetFlex(m_node, flex); -} - -void Node::setFlexBasis(double flexBasis) { - YGNodeStyleSetFlexBasis(m_node, flexBasis); -} - -void Node::setFlexBasisPercent(double flexBasis) { - YGNodeStyleSetFlexBasisPercent(m_node, flexBasis); -} - -void Node::setFlexGrow(double flexGrow) { - YGNodeStyleSetFlexGrow(m_node, flexGrow); -} - -void Node::setFlexShrink(double flexShrink) { - YGNodeStyleSetFlexShrink(m_node, flexShrink); -} - -void Node::setWidth(double width) { - YGNodeStyleSetWidth(m_node, width); -} - -void Node::setWidthPercent(double width) { - YGNodeStyleSetWidthPercent(m_node, width); -} - -void Node::setWidthAuto() { - YGNodeStyleSetWidthAuto(m_node); -} - -void Node::setHeight(double height) { - YGNodeStyleSetHeight(m_node, height); -} - -void Node::setHeightPercent(double height) { - YGNodeStyleSetHeightPercent(m_node, height); -} - -void Node::setHeightAuto() { - YGNodeStyleSetHeightAuto(m_node); -} - -void Node::setMinWidth(double minWidth) { - YGNodeStyleSetMinWidth(m_node, minWidth); -} - -void Node::setMinWidthPercent(double minWidth) { - YGNodeStyleSetMinWidthPercent(m_node, minWidth); -} - -void Node::setMinHeight(double minHeight) { - YGNodeStyleSetMinHeight(m_node, minHeight); -} - -void Node::setMinHeightPercent(double minHeight) { - YGNodeStyleSetMinHeightPercent(m_node, minHeight); -} - -void Node::setMaxWidth(double maxWidth) { - YGNodeStyleSetMaxWidth(m_node, maxWidth); -} - -void Node::setMaxWidthPercent(double maxWidth) { - YGNodeStyleSetMaxWidthPercent(m_node, maxWidth); -} - -void Node::setMaxHeight(double maxHeight) { - YGNodeStyleSetMaxHeight(m_node, maxHeight); -} - -void Node::setMaxHeightPercent(double maxHeight) { - YGNodeStyleSetMaxHeightPercent(m_node, maxHeight); -} - -void Node::setAspectRatio(double aspectRatio) { - YGNodeStyleSetAspectRatio(m_node, aspectRatio); -} - -void Node::setBorder(int edge, double border) { - YGNodeStyleSetBorder(m_node, static_cast(edge), border); -} - -void Node::setPadding(int edge, double padding) { - YGNodeStyleSetPadding(m_node, static_cast(edge), padding); -} - -void Node::setPaddingPercent(int edge, double padding) { - YGNodeStyleSetPaddingPercent(m_node, static_cast(edge), padding); -} - -void Node::setGap(int gutter, double gapLength) { - YGNodeStyleSetGap(m_node, static_cast(gutter), gapLength); -} - -int Node::getPositionType(void) const { - return YGNodeStyleGetPositionType(m_node); -} - -Value Node::getPosition(int edge) const { - return Value::fromYGValue( - YGNodeStyleGetPosition(m_node, static_cast(edge))); -} - -int Node::getAlignContent(void) const { - return YGNodeStyleGetAlignContent(m_node); -} - -int Node::getAlignItems(void) const { - return YGNodeStyleGetAlignItems(m_node); -} - -int Node::getAlignSelf(void) const { - return YGNodeStyleGetAlignSelf(m_node); -} - -int Node::getFlexDirection(void) const { - return YGNodeStyleGetFlexDirection(m_node); -} - -int Node::getFlexWrap(void) const { - return YGNodeStyleGetFlexWrap(m_node); -} - -int Node::getJustifyContent(void) const { - return YGNodeStyleGetJustifyContent(m_node); -} - -Value Node::getMargin(int edge) const { - return Value::fromYGValue( - YGNodeStyleGetMargin(m_node, static_cast(edge))); -} - -int Node::getOverflow(void) const { - return YGNodeStyleGetOverflow(m_node); -} - -int Node::getDisplay(void) const { - return YGNodeStyleGetDisplay(m_node); -} - -Value Node::getFlexBasis(void) const { - return Value::fromYGValue(YGNodeStyleGetFlexBasis(m_node)); -} - -double Node::getFlexGrow(void) const { - return YGNodeStyleGetFlexGrow(m_node); -} - -double Node::getFlexShrink(void) const { - return YGNodeStyleGetFlexShrink(m_node); -} - -Value Node::getWidth(void) const { - return Value::fromYGValue(YGNodeStyleGetWidth(m_node)); -} - -Value Node::getHeight(void) const { - return Value::fromYGValue(YGNodeStyleGetHeight(m_node)); -} - -Value Node::getMinWidth(void) const { - return Value::fromYGValue(YGNodeStyleGetMinWidth(m_node)); -} - -Value Node::getMinHeight(void) const { - return Value::fromYGValue(YGNodeStyleGetMinHeight(m_node)); -} - -Value Node::getMaxWidth(void) const { - return Value::fromYGValue(YGNodeStyleGetMaxWidth(m_node)); -} - -Value Node::getMaxHeight(void) const { - return Value::fromYGValue(YGNodeStyleGetMaxHeight(m_node)); -} - -double Node::getAspectRatio(void) const { - return YGNodeStyleGetAspectRatio(m_node); -} - -double Node::getBorder(int edge) const { - return YGNodeStyleGetBorder(m_node, static_cast(edge)); -} - -Value Node::getPadding(int edge) const { - return Value::fromYGValue(YGNodeStyleGetPadding(m_node, static_cast(edge))); -} - -double Node::getGap(int gutter) { - return YGNodeStyleGetGap(m_node, static_cast(gutter)); -} - -void Node::insertChild(Node* child, unsigned index) { - YGNodeInsertChild(m_node, child->m_node, index); -} - -void Node::removeChild(Node* child) { - YGNodeRemoveChild(m_node, child->m_node); -} - -unsigned Node::getChildCount(void) const { - return YGNodeGetChildCount(m_node); -} - -Node* Node::getParent(void) { - auto nodePtr = YGNodeGetParent(m_node); - - if (nodePtr == nullptr) - return nullptr; - - return Node::fromYGNode(nodePtr); -} - -Node* Node::getChild(unsigned index) { - auto nodePtr = YGNodeGetChild(m_node, index); - - if (nodePtr == nullptr) - return nullptr; - - return Node::fromYGNode(nodePtr); -} - -void Node::setMeasureFunc(MeasureCallback *measureFunc) { - m_measureFunc.reset(measureFunc); - - YGNodeSetMeasureFunc(m_node, &globalMeasureFunc); -} - -void Node::unsetMeasureFunc(void) { - m_measureFunc.reset(nullptr); - - YGNodeSetMeasureFunc(m_node, nullptr); -} - -YGSize Node::callMeasureFunc( - double width, - YGMeasureMode widthMode, - double height, - YGMeasureMode heightMode) const { - return m_measureFunc->measure(width, widthMode, height, heightMode); -} - -void Node::setDirtiedFunc(DirtiedCallback *dirtiedFunc) { - m_dirtiedFunc.reset(dirtiedFunc); - - YGNodeSetDirtiedFunc(m_node, &globalDirtiedFunc); -} - -void Node::unsetDirtiedFunc(void) { - m_dirtiedFunc.reset(nullptr); - - YGNodeSetDirtiedFunc(m_node, nullptr); -} - -void Node::callDirtiedFunc(void) const { - m_dirtiedFunc->dirtied(); -} - -void Node::markDirty(void) { - YGNodeMarkDirty(m_node); -} - -bool Node::isDirty(void) const { - return YGNodeIsDirty(m_node); -} - -void Node::calculateLayout(double width, double height, int direction) { - YGNodeCalculateLayout( - m_node, width, height, static_cast(direction)); -} - -double Node::getComputedLeft(void) const { - return YGNodeLayoutGetLeft(m_node); -} - -double Node::getComputedRight(void) const { - return YGNodeLayoutGetRight(m_node); -} - -double Node::getComputedTop(void) const { - return YGNodeLayoutGetTop(m_node); -} - -double Node::getComputedBottom(void) const { - return YGNodeLayoutGetBottom(m_node); -} - -double Node::getComputedWidth(void) const { - return YGNodeLayoutGetWidth(m_node); -} - -double Node::getComputedHeight(void) const { - return YGNodeLayoutGetHeight(m_node); -} - -Layout Node::getComputedLayout(void) const { - Layout layout; - - layout.left = YGNodeLayoutGetLeft(m_node); - layout.right = YGNodeLayoutGetRight(m_node); - - layout.top = YGNodeLayoutGetTop(m_node); - layout.bottom = YGNodeLayoutGetBottom(m_node); - - layout.width = YGNodeLayoutGetWidth(m_node); - layout.height = YGNodeLayoutGetHeight(m_node); - - return layout; -} - -double Node::getComputedMargin(int edge) const { - return YGNodeLayoutGetMargin(m_node, static_cast(edge)); -} - -double Node::getComputedBorder(int edge) const { - return YGNodeLayoutGetBorder(m_node, static_cast(edge)); -} - -double Node::getComputedPadding(int edge) const { - return YGNodeLayoutGetPadding(m_node, static_cast(edge)); -} diff --git a/bindings/Node.hh b/bindings/Node.hh deleted file mode 100644 index b3afc86..0000000 --- a/bindings/Node.hh +++ /dev/null @@ -1,219 +0,0 @@ -#pragma once - -#include - -#include - -#include - -#include "./Layout.hh" -#include "./Config.hh" -#include "./Value.hh" - -struct MeasureCallback -{ - virtual YGSize measure(float width, - int widthMode, - float height, - int heightMode) = 0; -}; - -struct MeasureCallbackWrapper : public emscripten::wrapper -{ - EMSCRIPTEN_WRAPPER(MeasureCallbackWrapper); - YGSize measure(float width, int widthMode, float height, int heightMode) - { - return call("measure", width, widthMode, height, heightMode); - } -}; - -struct DirtiedCallback -{ - virtual void dirtied() = 0; -}; - -struct DirtiedCallbackWrapper : public emscripten::wrapper -{ - EMSCRIPTEN_WRAPPER(DirtiedCallbackWrapper); - void dirtied() - { - return call("dirtied"); - } -}; - -class Node { - -public: - static Node* createDefault(void); - static Node* createWithConfig(Config* config); - - static void destroy(Node* node); - -public: - static Node* fromYGNode(YGNodeRef nodeRef); - -private: - Node(Config* config); - -public: - ~Node(void); - -public: // Prevent accidental copy - Node(Node const&) = delete; - - Node const& operator=(Node const&) = delete; - -public: - void reset(void); - -public: // Style setters - void copyStyle(Node const& other); - - void setPositionType(int positionType); - void setPosition(int edge, double position); - void setPositionPercent(int edge, double position); - - void setAlignContent(int alignContent); - void setAlignItems(int alignItems); - void setAlignSelf(int alignSelf); - void setFlexDirection(int flexDirection); - void setFlexWrap(int flexWrap); - void setJustifyContent(int justifyContent); - - void setMargin(int edge, double margin); - void setMarginPercent(int edge, double margin); - void setMarginAuto(int edge); - - void setOverflow(int overflow); - void setDisplay(int display); - - void setFlex(double flex); - void setFlexBasis(double flexBasis); - void setFlexBasisPercent(double flexBasis); - void setFlexBasisAuto(); - void setFlexGrow(double flexGrow); - void setFlexShrink(double flexShrink); - - void setWidth(double width); - void setWidthPercent(double width); - void setWidthAuto(); - void setHeight(double height); - void setHeightPercent(double height); - void setHeightAuto(); - - void setMinWidth(double minWidth); - void setMinWidthPercent(double minWidth); - void setMinHeight(double minHeight); - void setMinHeightPercent(double minHeight); - - void setMaxWidth(double maxWidth); - void setMaxWidthPercent(double maxWidth); - void setMaxHeight(double maxHeight); - void setMaxHeightPercent(double maxHeight); - - void setAspectRatio(double aspectRatio); - - void setBorder(int edge, double border); - - void setPadding(int edge, double padding); - void setPaddingPercent(int edge, double padding); - - void setGap(int gutter, double gapLength); - -public: // Style getters - int getPositionType(void) const; - Value getPosition(int edge) const; - - int getAlignContent(void) const; - int getAlignItems(void) const; - int getAlignSelf(void) const; - int getFlexDirection(void) const; - int getFlexWrap(void) const; - int getJustifyContent(void) const; - - Value getMargin(int edge) const; - - int getOverflow(void) const; - int getDisplay(void) const; - - Value getFlexBasis(void) const; - double getFlexGrow(void) const; - double getFlexShrink(void) const; - - Value getWidth(void) const; - Value getHeight(void) const; - - Value getMinWidth(void) const; - Value getMinHeight(void) const; - - Value getMaxWidth(void) const; - Value getMaxHeight(void) const; - - double getAspectRatio(void) const; - - double getBorder(int edge) const; - - Value getPadding(int edge) const; - - double getGap(int gutter); - -public: // Tree hierarchy mutators - void insertChild(Node* child, unsigned index); - void removeChild(Node* child); - -public: // Tree hierarchy inspectors - unsigned getChildCount(void) const; - - // The following functions cannot be const because they could discard const - // qualifiers (ex: constNode->getChild(0)->getParent() wouldn't be const) - - Node* getParent(void); - Node* getChild(unsigned index); - -public: // Measure func mutators - void setMeasureFunc(MeasureCallback *measureFunc); - void unsetMeasureFunc(void); - -public: // Measure func inspectors - YGSize callMeasureFunc( - double width, - YGMeasureMode widthMode, - double height, - YGMeasureMode heightMode) const; - -public: // Dirtied func mutators - void setDirtiedFunc(DirtiedCallback *dirtiedFunc); - void unsetDirtiedFunc(void); - -public: // Dirtied func inspectors - void callDirtiedFunc(void) const; - -public: // Dirtiness accessors - void markDirty(void); - bool isDirty(void) const; - -public: // Layout mutators - void calculateLayout(double width, double height, int direction); - -public: // Layout inspectors - double getComputedLeft(void) const; - double getComputedRight(void) const; - - double getComputedTop(void) const; - double getComputedBottom(void) const; - - double getComputedWidth(void) const; - double getComputedHeight(void) const; - - Layout getComputedLayout(void) const; - - double getComputedMargin(int edge) const; - double getComputedBorder(int edge) const; - double getComputedPadding(int edge) const; - -public: - YGNodeRef m_node; - - std::unique_ptr m_measureFunc; - std::unique_ptr m_dirtiedFunc; -}; diff --git a/bindings/Value.hh b/bindings/Value.hh deleted file mode 100644 index 49e7d1a..0000000 --- a/bindings/Value.hh +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include - -struct Value { - static Value fromYGValue(YGValue const& ygValue) { - return Value(static_cast(ygValue.unit), ygValue.value); - } - - int unit; - double value; - - Value(void) : unit(YGUnitUndefined), value(0.0) {} - - Value(int unit, double value) : unit(unit), value(value) {} -}; diff --git a/bindings/embind.cc b/bindings/embind.cc deleted file mode 100644 index 111134a..0000000 --- a/bindings/embind.cc +++ /dev/null @@ -1,181 +0,0 @@ -#include "./Config.hh" -#include "./Layout.hh" -#include "./Node.hh" -#include "./Value.hh" - -#include - -#include - -using namespace emscripten; - -EMSCRIPTEN_BINDINGS(Config) { - class_("Config") - .constructor<>(&Config::create, allow_raw_pointers()) - .class_function<>("create", &Config::create, allow_raw_pointers()) - .function("setExperimentalFeatureEnabled", &Config::setExperimentalFeatureEnabled) - .function("setPointScaleFactor", &Config::setPointScaleFactor) - .function("isExperimentalFeatureEnabled", &Config::isExperimentalFeatureEnabled) - ; -} - -EMSCRIPTEN_BINDINGS(Layout) { - value_object("Layout") - .field("left", &Layout::left) - .field("right", &Layout::right) - .field("top", &Layout::top) - .field("bottom", &Layout::bottom) - .field("width", &Layout::width) - .field("height", &Layout::height) - ; -} - -EMSCRIPTEN_BINDINGS(Node) { - class_("MeasureCallback") - .function("measure", &MeasureCallback::measure, pure_virtual()) - .allow_subclass("MeasureCallbackWrapper") - ; - class_("DirtiedCallback") - .function("dirtied", &DirtiedCallback::dirtied, pure_virtual()) - .allow_subclass("DirtiedCallbackWrapper") - ; - - value_object("Size") - .field("width", &YGSize::width) - .field("height", &YGSize::height) - ; - - value_object("Value") - .field("value", &Value::value) - .field("unit", &Value::unit) - ; - - class_("Node") - .constructor<>(&Node::createDefault, allow_raw_pointers()) - - .class_function<>("createDefault", &Node::createDefault, allow_raw_pointers()) - .class_function<>("createWithConfig", &Node::createWithConfig, allow_raw_pointers()) - .class_function<>("destroy", &Node::destroy, allow_raw_pointers()) - .function("reset", &Node::reset) - - .function("copyStyle", &Node::copyStyle) - - .function("setPositionType", &Node::setPositionType) - .function("setPosition", &Node::setPosition) - .function("setPositionPercent", &Node::setPositionPercent) - - .function("setAlignContent", &Node::setAlignContent) - .function("setAlignItems", &Node::setAlignItems) - .function("setAlignSelf", &Node::setAlignSelf) - .function("setFlexDirection", &Node::setFlexDirection) - .function("setFlexWrap", &Node::setFlexWrap) - .function("setJustifyContent", &Node::setJustifyContent) - - .function("setMargin", &Node::setMargin) - .function("setMarginPercent", &Node::setMarginPercent) - .function("setMarginAuto", &Node::setMarginAuto) - - .function("setOverflow", &Node::setOverflow) - .function("setDisplay", &Node::setDisplay) - - .function("setFlex", &Node::setFlex) - .function("setFlexBasis", &Node::setFlexBasis) - .function("setFlexBasisPercent", &Node::setFlexBasisPercent) - .function("setFlexGrow", &Node::setFlexGrow) - .function("setFlexShrink", &Node::setFlexShrink) - - .function("setWidth", &Node::setWidth) - .function("setWidthPercent", &Node::setWidthPercent) - .function("setWidthAuto", &Node::setWidthAuto) - .function("setHeight", &Node::setHeight) - .function("setHeightPercent", &Node::setHeightPercent) - .function("setHeightAuto", &Node::setHeightAuto) - - .function("setMinWidth", &Node::setMinWidth) - .function("setMinWidthPercent", &Node::setMinWidthPercent) - .function("setMinHeight", &Node::setMinHeight) - .function("setMinHeightPercent", &Node::setMinHeightPercent) - - .function("setMaxWidth", &Node::setMaxWidth) - .function("setMaxWidthPercent", &Node::setMaxWidthPercent) - .function("setMaxHeight", &Node::setMaxHeight) - .function("setMaxHeightPercent", &Node::setMaxHeightPercent) - - .function("setAspectRatio", &Node::setAspectRatio) - - .function("setBorder", &Node::setBorder) - - .function("setPadding", &Node::setPadding) - .function("setPaddingPercent", &Node::setPaddingPercent) - .function("setGap", &Node::setGap) - - .function("getPositionType", &Node::getPositionType) - .function("getPosition", &Node::getPosition) - - .function("getAlignContent", &Node::getAlignContent) - .function("getAlignItems", &Node::getAlignItems) - .function("getAlignSelf", &Node::getAlignSelf) - .function("getFlexDirection", &Node::getFlexDirection) - .function("getFlexWrap", &Node::getFlexWrap) - .function("getJustifyContent", &Node::getJustifyContent) - - .function("getMargin", &Node::getMargin) - - .function("getFlexBasis", &Node::getFlexBasis) - .function("getFlexGrow", &Node::getFlexGrow) - .function("getFlexShrink", &Node::getFlexShrink) - - .function("getWidth", &Node::getWidth) - .function("getHeight", &Node::getHeight) - - .function("getMinWidth", &Node::getMinWidth) - .function("getMinHeight", &Node::getMinHeight) - - .function("getMaxWidth", &Node::getMaxWidth) - .function("getMaxHeight", &Node::getMaxHeight) - - .function("getAspectRatio", &Node::getAspectRatio) - - .function("getBorder", &Node::getBorder) - - .function("getOverflow", &Node::getOverflow) - .function("getDisplay", &Node::getDisplay) - - .function("getPadding", &Node::getPadding) - .function("getGap", &Node::getGap) - - .function("insertChild", &Node::insertChild, allow_raw_pointers()) - .function("removeChild", &Node::removeChild, allow_raw_pointers()) - - .function("getChildCount", &Node::getChildCount) - - .function("getParent", &Node::getParent, allow_raw_pointers()) - .function("getChild", &Node::getChild, allow_raw_pointers()) - - .function("setMeasureFunc", &Node::setMeasureFunc, allow_raw_pointers()) - .function("unsetMeasureFunc", &Node::unsetMeasureFunc) - - .function("setDirtiedFunc", &Node::setDirtiedFunc, allow_raw_pointers()) - .function("unsetDirtiedFunc", &Node::unsetDirtiedFunc) - - .function("markDirty", &Node::markDirty) - .function("isDirty", &Node::isDirty) - - .function("calculateLayout", &Node::calculateLayout) - - .function("getComputedLeft", &Node::getComputedLeft) - .function("getComputedRight", &Node::getComputedRight) - - .function("getComputedTop", &Node::getComputedTop) - .function("getComputedBottom", &Node::getComputedBottom) - - .function("getComputedWidth", &Node::getComputedWidth) - .function("getComputedHeight", &Node::getComputedHeight) - - .function("getComputedLayout", &Node::getComputedLayout) - - .function("getComputedMargin", &Node::getComputedMargin) - .function("getComputedBorder", &Node::getComputedBorder) - .function("getComputedPadding", &Node::getComputedPadding) - ; -} diff --git a/build.js b/build.js index 1f0b62e..e26e6c6 100644 --- a/build.js +++ b/build.js @@ -1,6 +1,5 @@ import { copyFile } from 'node:fs/promises' import { build } from 'esbuild' -import flow from 'esbuild-plugin-flow' async function start() { const asm = build({ @@ -14,7 +13,6 @@ async function start() { entryPoints: ['./asm.js'], outfile: './dist/asm.js', minify: true, - plugins: [flow(/\.js$/, true)], }) await build({ @@ -28,7 +26,6 @@ async function start() { entryPoints: ['./index.js'], outfile: './dist/index.js', minify: true, - plugins: [flow(/\.js$/, true)], }) await copyFile('./tmp/yoga.wasm', './dist/yoga.wasm') diff --git a/entry/index.js b/entry/index.js deleted file mode 100644 index b690e40..0000000 --- a/entry/index.js +++ /dev/null @@ -1,358 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - * @format - */ - -import CONSTANTS from '../yoga/javascript/sources/YGEnums' -import type { - Yoga$Edge, - Yoga$FlexWrap, - Yoga$Align, - Yoga$FlexDirection, - Yoga$Direction, - Yoga$PositionType, - Yoga$Overflow, - Yoga$JustifyContent, - Yoga$Display, - Yoga$ExperimentalFeature, - Yoga$Gutter, -} from '../yoga/javascript/sources/YGEnums' - -class Layout { - left: number - right: number - top: number - bottom: number - width: number - height: number - - constructor(left, right, top, bottom, width, height) { - this.left = left - this.right = right - this.top = top - this.bottom = bottom - this.width = width - this.height = height - } - - fromJS(expose) { - expose( - this.left, - this.right, - this.top, - this.bottom, - this.width, - this.height - ) - } - - toString() { - return `` - } -} - -class Size { - static fromJS({ width, height }) { - return new Size(width, height) - } - - width: number - height: number - - constructor(width, height) { - this.width = width - this.height = height - } - - fromJS(expose) { - expose(this.width, this.height) - } - - toString() { - return `` - } -} - -class Value { - unit: number - value: number - - constructor(unit, value) { - this.unit = unit - this.value = value - } - - fromJS(expose) { - expose(this.unit, this.value) - } - - toString() { - switch (this.unit) { - case CONSTANTS.UNIT_POINT: - return String(this.value) - case CONSTANTS.UNIT_PERCENT: - return `${this.value}%` - case CONSTANTS.UNIT_AUTO: - return 'auto' - default: { - return `${this.value}?` - } - } - } - - valueOf() { - return this.value - } -} - -export type Yoga$Config = { - isExperimentalFeatureEnabled(feature: Yoga$ExperimentalFeature): boolean, - setExperimentalFeatureEnabled( - feature: Yoga$ExperimentalFeature, - enabled: boolean - ): void, - setPointScaleFactor(factor: number): void, -} - -export type Yoga$Node = { - calculateLayout( - width?: number, - height?: number, - direction?: Yoga$Direction - ): void, - copyStyle(node: Yoga$Node): void, - free(): void, - freeRecursive(): void, - getAlignContent(): Yoga$Align, - getAlignItems(): Yoga$Align, - getAlignSelf(): Yoga$Align, - getAspectRatio(): number, - getBorder(edge: Yoga$Edge): number, - getChild(index: number): Yoga$Node, - getChildCount(): number, - getComputedBorder(edge: Yoga$Edge): number, - getComputedBottom(): number, - getComputedHeight(): number, - getComputedLayout(): Layout, - getComputedLeft(): number, - getComputedMargin(edge: Yoga$Edge): number, - getComputedPadding(edge: Yoga$Edge): number, - getComputedRight(): number, - getComputedTop(): number, - getComputedWidth(): number, - getDisplay(): Yoga$Display, - getFlexBasis(): number, - getFlexDirection(): Yoga$FlexDirection, - getFlexGrow(): number, - getFlexShrink(): number, - getFlexWrap(): Yoga$FlexWrap, - getHeight(): Value, - getJustifyContent(): Yoga$JustifyContent, - getMargin(edge: Yoga$Edge): Value, - getMaxHeight(): Value, - getMaxWidth(): Value, - getMinHeight(): Value, - getMinWidth(): Value, - getOverflow(): Yoga$Overflow, - getPadding(edge: Yoga$Edge): Value, - getParent(): ?Yoga$Node, - getPosition(edge: Yoga$Edge): Value, - getPositionType(): Yoga$PositionType, - getWidth(): Value, - getGap(gutter: Yoga$Gutter): Value, - insertChild(child: Yoga$Node, index: number): void, - isDirty(): boolean, - markDirty(): void, - removeChild(child: Yoga$Node): void, - reset(): void, - setAlignContent(alignContent: Yoga$Align): void, - setAlignItems(alignItems: Yoga$Align): void, - setAlignSelf(alignSelf: Yoga$Align): void, - setAspectRatio(aspectRatio: number): void, - setBorder(edge: Yoga$Edge, borderWidth: number): void, - setDisplay(display: Yoga$Display): void, - setFlex(flex: number): void, - setFlexBasis(flexBasis: number | string): void, - setFlexBasisPercent(flexBasis: number): void, - setFlexDirection(flexDirection: Yoga$FlexDirection): void, - setFlexGrow(flexGrow: number): void, - setFlexShrink(flexShrink: number): void, - setFlexWrap(flexWrap: Yoga$FlexWrap): void, - setHeight(height: number | string): void, - setHeightAuto(): void, - setHeightPercent(height: number): void, - setJustifyContent(justifyContent: Yoga$JustifyContent): void, - setMargin(edge: Yoga$Edge, margin: number): void, - setMarginAuto(edge: Yoga$Edge): void, - setMarginPercent(edge: Yoga$Edge, margin: number): void, - setMaxHeight(maxHeight: number | string): void, - setMaxHeightPercent(maxHeight: number): void, - setMaxWidth(maxWidth: number | string): void, - setMaxWidthPercent(maxWidth: number): void, - setMeasureFunc(measureFunc: ?Function): void, - setMinHeight(minHeight: number | string): void, - setMinHeightPercent(minHeight: number): void, - setMinWidth(minWidth: number | string): void, - setMinWidthPercent(minWidth: number): void, - setOverflow(overflow: Yoga$Overflow): void, - setPadding(edge: Yoga$Edge, padding: number | string): void, - setPaddingPercent(edge: Yoga$Edge, padding: number): void, - setGap(gutter: Yoga$Gutter, gapLength: number): void, - setPosition(edge: Yoga$Edge, position: number | string): void, - setPositionPercent(edge: Yoga$Edge, position: number): void, - setPositionType(positionType: Yoga$PositionType): void, - setWidth(width: number | string): void, - setWidthAuto(): void, - setWidthPercent(width: number): void, - unsetMeasureFun(): void, -} - -type Yoga = { - Config: { - create(): Yoga$Config, - destroy(config: Yoga$Config): any, - }, - Node: { - create(): Yoga$Node, - createDefault(): Yoga$Node, - createWithConfig(config: Yoga$Config): Yoga$Node, - destroy(node: Yoga$Node): any, - }, - Layout: Layout, - Size: Size, - Value: Value, - getInstanceCount(): number, - ...typeof CONSTANTS, -} - -function patch(prototype, name, fn) { - let original = prototype[name] - - prototype[name] = function (...args) { - return fn.call(this, original, ...args) - } -} - -module.exports = (bind: any, lib: any): Yoga => { - for (let fnName of [ - 'setPosition', - 'setMargin', - 'setFlexBasis', - 'setWidth', - 'setHeight', - 'setMinWidth', - 'setMinHeight', - 'setMaxWidth', - 'setMaxHeight', - 'setPadding', - ]) { - let methods = { - [CONSTANTS.UNIT_POINT]: lib.Node.prototype[fnName], - [CONSTANTS.UNIT_PERCENT]: lib.Node.prototype[`${fnName}Percent`], - [CONSTANTS.UNIT_AUTO]: lib.Node.prototype[`${fnName}Auto`], - } - - patch(lib.Node.prototype, fnName, function (original, ...args) { - // We patch all these functions to add support for the following calls: - // .setWidth(100) / .setWidth("100%") / .setWidth(.getWidth()) / .setWidth("auto") - - let value = args.pop() - let unit, asNumber - - if (value === 'auto') { - unit = CONSTANTS.UNIT_AUTO - asNumber = undefined - } else if (value instanceof Value) { - unit = value.unit - asNumber = value.valueOf() - } else { - unit = - typeof value === 'string' && value.endsWith('%') - ? CONSTANTS.UNIT_PERCENT - : CONSTANTS.UNIT_POINT - asNumber = parseFloat(value) - if (!Number.isNaN(value) && Number.isNaN(asNumber)) { - throw new Error(`Invalid value ${value} for ${fnName}`) - } - } - - if (!methods[unit]) - throw new Error( - `Failed to execute "${fnName}": Unsupported unit '${value}'` - ) - - if (asNumber !== undefined) { - return methods[unit].call(this, ...args, asNumber) - } else { - return methods[unit].call(this, ...args) - } - }) - } - - patch(lib.Config.prototype, 'free', function () { - // Since we handle the memory allocation ourselves (via lib.Config.create), - // we also need to handle the deallocation - lib.Config.destroy(this) - }) - - patch(lib.Node, 'create', function (_, config) { - // We decide the constructor we want to call depending on the parameters - return config ? lib.Node.createWithConfig(config) : lib.Node.createDefault() - }) - - patch(lib.Node.prototype, 'free', function () { - // Since we handle the memory allocation ourselves (via lib.Node.create), - // we also need to handle the deallocation - lib.Node.destroy(this) - }) - - patch(lib.Node.prototype, 'freeRecursive', function () { - for (let t = 0, T = this.getChildCount(); t < T; ++t) { - this.getChild(0).freeRecursive() - } - this.free() - }) - - // https://github.com/vincentriemer/yoga-dom/blob/b1592710c64c85f610f9d963cd54c99bbf01ae03/src/index.js - function wrapMeasureFunction(measureFunction) { - return lib.MeasureCallback.implement({ measure: (...args) => { - const { width, height } = measureFunction(...args) - return { - width: width ?? 0, - height: height ?? 0, - } - }}) - } - - patch(lib.Node.prototype, 'setMeasureFunc', function (original, measureFunc) { - original.call(this, wrapMeasureFunction(measureFunc)) - }) - - patch( - lib.Node.prototype, - 'calculateLayout', - function ( - original, - width = NaN, - height = NaN, - direction = CONSTANTS.DIRECTION_LTR - ) { - // Just a small patch to add support for the function default parameters - return original.call(this, width, height, direction) - } - ) - - return { - Config: lib.Config, - Node: lib.Node, - Layout: bind('Layout', Layout), - Size: bind('Size', Size), - Value: bind('Value', Value), - ...CONSTANTS, - } -} diff --git a/entry/package.json b/entry/package.json deleted file mode 100644 index 0967ef4..0000000 --- a/entry/package.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/index.js b/index.js index 98ee4b0..b797606 100644 --- a/index.js +++ b/index.js @@ -1,36 +1,24 @@ -import entry from './entry/index.js' -import yoga from './tmp/yoga.mjs' - -function bind(_, proto) { - return proto -} +import wrapAsm from "./yoga/javascript/src_js/wrapAsm.js"; +import yoga from "./tmp/yoga.mjs"; export default async function (wasm) { const mod = await yoga({ instantiateWasm(info, receive) { - WebAssembly.instantiate(wasm, info).then((instance) => { - receive(instance.instance || instance) - }) - return {} + WebAssembly.instantiate(wasm, info).then(({ instance }) => { + receive(instance); + }); }, - locateFile() { - return '' - }, - }) - return entry(bind, mod) + }); + return wrapAsm(mod); } export async function initStreaming(response) { const mod = await yoga({ instantiateWasm(info, receive) { - WebAssembly.instantiateStreaming(response, info).then((instance) => { - receive(instance.instance || instance) - }) - return {} - }, - locateFile() { - return '' + WebAssembly.instantiateStreaming(response, info).then(({ instance }) => { + receive(instance); + }); }, - }) - return entry(bind, mod) + }); + return wrapAsm(mod); } diff --git a/package.json b/package.json index e71e2e2..8ff422b 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "scripts": { "build": "make && node build.js", - "test": "vitest" + "test": "vitest run --dir ./test" }, "repository": "shuding/yoga-wasm-web", "license": "MIT", @@ -22,8 +22,7 @@ "LICENSE" ], "devDependencies": { - "esbuild": "^0.14.18", - "esbuild-plugin-flow": "^0.3.2", - "vitest": "^0.25.2" + "esbuild": "^0.17.4", + "vitest": "^0.28.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 00ea094..4f0c0ff 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,14 +1,12 @@ -lockfileVersion: 5.3 +lockfileVersion: 5.4 specifiers: - esbuild: ^0.14.18 - esbuild-plugin-flow: ^0.3.2 - vitest: ^0.25.2 + esbuild: ^0.17.4 + vitest: ^0.28.2 devDependencies: - esbuild: 0.14.18 - esbuild-plugin-flow: 0.3.2 - vitest: 0.25.2 + esbuild: 0.17.4 + vitest: 0.28.2 packages: @@ -21,6 +19,96 @@ packages: dev: true optional: true + /@esbuild/android-arm/0.17.4: + resolution: {integrity: sha512-R9GCe2xl2XDSc2XbQB63mFiFXHIVkOP+ltIxICKXqUPrFX97z6Z7vONCLQM1pSOLGqfLrGi3B7nbhxmFY/fomg==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm64/0.17.4: + resolution: {integrity: sha512-91VwDrl4EpxBCiG6h2LZZEkuNvVZYJkv2T9gyLG/mhGG1qrM7i5SwUcg/hlSPnL/4hDT0TFcF35/XMGSn0bemg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64/0.17.4: + resolution: {integrity: sha512-mGSqhEPL7029XL7QHNPxPs15JVa02hvZvysUcyMP9UXdGFwncl2WU0bqx+Ysgzd+WAbv8rfNa73QveOxAnAM2w==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64/0.17.4: + resolution: {integrity: sha512-tTyJRM9dHvlMPt1KrBFVB5OW1kXOsRNvAPtbzoKazd5RhD5/wKlXk1qR2MpaZRYwf4WDMadt0Pv0GwxB41CVow==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64/0.17.4: + resolution: {integrity: sha512-phQuC2Imrb3TjOJwLN8EO50nb2FHe8Ew0OwgZDH1SV6asIPGudnwTQtighDF2EAYlXChLoMJwqjAp4vAaACq6w==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64/0.17.4: + resolution: {integrity: sha512-oH6JUZkocgmjzzYaP5juERLpJQSwazdjZrTPgLRmAU2bzJ688x0vfMB/WTv4r58RiecdHvXOPC46VtsMy/mepg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64/0.17.4: + resolution: {integrity: sha512-U4iWGn/9TrAfpAdfd56eO0pRxIgb0a8Wj9jClrhT8hvZnOnS4dfMPW7o4fn15D/KqoiVYHRm43jjBaTt3g/2KA==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm/0.17.4: + resolution: {integrity: sha512-S2s9xWTGMTa/fG5EyMGDeL0wrWVgOSQcNddJWgu6rG1NCSXJHs76ZP9AsxjB3f2nZow9fWOyApklIgiTGZKhiw==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64/0.17.4: + resolution: {integrity: sha512-UkGfQvYlwOaeYJzZG4cLV0hCASzQZnKNktRXUo3/BMZvdau40AOz9GzmGA063n1piq6VrFFh43apRDQx8hMP2w==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32/0.17.4: + resolution: {integrity: sha512-3lqFi4VFo/Vwvn77FZXeLd0ctolIJH/uXkH3yNgEk89Eh6D3XXAC9/iTPEzeEpsNE5IqGIsFa5Z0iPeOh25IyA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@esbuild/linux-loong64/0.15.14: resolution: {integrity: sha512-eQi9rosGNVQFJyJWV0HCA5WZae/qWIQME7s8/j8DMvnylfBv62Pbu+zJ2eUDqNf2O4u3WB+OEXyfkpBoe194sg==} engines: {node: '>=12'} @@ -30,6 +118,114 @@ packages: dev: true optional: true + /@esbuild/linux-loong64/0.17.4: + resolution: {integrity: sha512-HqpWZkVslDHIwdQ9D+gk7NuAulgQvRxF9no54ut/M55KEb3mi7sQS3GwpPJzSyzzP0UkjQVN7/tbk88/CaX4EQ==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el/0.17.4: + resolution: {integrity: sha512-d/nMCKKh/SVDbqR9ju+b78vOr0tNXtfBjcp5vfHONCCOAL9ad8gN9dC/u+UnH939pz7wO+0u/x9y1MaZcb/lKA==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64/0.17.4: + resolution: {integrity: sha512-lOD9p2dmjZcNiTU+sGe9Nn6G3aYw3k0HBJies1PU0j5IGfp6tdKOQ6mzfACRFCqXjnBuTqK7eTYpwx09O5LLfg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64/0.17.4: + resolution: {integrity: sha512-mTGnwWwVshAjGsd8rP+K6583cPDgxOunsqqldEYij7T5/ysluMHKqUIT4TJHfrDFadUwrghAL6QjER4FeqQXoA==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x/0.17.4: + resolution: {integrity: sha512-AQYuUGp50XM29/N/dehADxvc2bUqDcoqrVuijop1Wv72SyxT6dDB9wjUxuPZm2HwIM876UoNNBMVd+iX/UTKVQ==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64/0.17.4: + resolution: {integrity: sha512-+AsFBwKgQuhV2shfGgA9YloxLDVjXgUEWZum7glR5lLmV94IThu/u2JZGxTgjYby6kyXEx8lKOqP5rTEVBR0Rw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64/0.17.4: + resolution: {integrity: sha512-zD1TKYX9553OiLS/qkXPMlWoELYkH/VkzRYNKEU+GwFiqkq0SuxsKnsCg5UCdxN3cqd+1KZ8SS3R+WG/Hxy2jQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64/0.17.4: + resolution: {integrity: sha512-PY1NjEsLRhPEFFg1AV0/4Or/gR+q2dOb9s5rXcPuCjyHRzbt8vnHJl3vYj+641TgWZzTFmSUnZbzs1zwTzjeqw==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64/0.17.4: + resolution: {integrity: sha512-B3Z7s8QZQW9tKGleMRXvVmwwLPAUoDCHs4WZ2ElVMWiortLJFowU1NjAhXOKjDgC7o9ByeVcwyOlJ+F2r6ZgmQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64/0.17.4: + resolution: {integrity: sha512-0HCu8R3mY/H5V7N6kdlsJkvrT591bO/oRZy8ztF1dhgNU5xD5tAh5bKByT1UjTGjp/VVBsl1PDQ3L18SfvtnBQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32/0.17.4: + resolution: {integrity: sha512-VUjhVDQycse1gLbe06pC/uaA0M+piQXJpdpNdhg8sPmeIZZqu5xPoGWVCmcsOO2gaM2cywuTYTHkXRozo3/Nkg==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64/0.17.4: + resolution: {integrity: sha512-0kLAjs+xN5OjhTt/aUA6t48SfENSCKgGPfExADYTOo/UCn0ivxos9/anUVeSfg+L+2O9xkFxvJXIJfG+Q4sYSg==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@types/chai-subset/1.3.3: resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} dependencies: @@ -44,6 +240,38 @@ packages: resolution: {integrity: sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==} dev: true + /@vitest/expect/0.28.2: + resolution: {integrity: sha512-syEAK7I24/aGR2lXma98WNnvMwAJ+fMx32yPcj8eLdCEWjZI3SH8ozMaKQMy65B/xZCZAl6MXmfjtJb2CpWPMg==} + dependencies: + '@vitest/spy': 0.28.2 + '@vitest/utils': 0.28.2 + chai: 4.3.7 + dev: true + + /@vitest/runner/0.28.2: + resolution: {integrity: sha512-BJ9CtfPwWM8uc5p7Ty0OprwApyh8RIaSK7QeQPhwfDYA59AAE009OytqA3aX0yj1Qy5+k/mYFJS8RJZgsueSGA==} + dependencies: + '@vitest/utils': 0.28.2 + p-limit: 4.0.0 + pathe: 1.1.0 + dev: true + + /@vitest/spy/0.28.2: + resolution: {integrity: sha512-KlLzTzi5E6tHcI12VT+brlY1Pdi7sUzLf9+YXgh80+CfLu9DqPZi38doBBAUhqEnW/emoLCMinPMMoJlNAQZXA==} + dependencies: + tinyspy: 1.0.2 + dev: true + + /@vitest/utils/0.28.2: + resolution: {integrity: sha512-wcVTNnVdr22IGxZHDgiXrxWYcXsNg0iX2iBuOH3tVs9eme6fXJ0wxjn0/gCpp0TofQSoUwo3tX8LNACFVseDuA==} + dependencies: + cli-truncate: 3.1.0 + diff: 5.1.0 + loupe: 2.3.6 + picocolors: 1.0.0 + pretty-format: 27.5.1 + dev: true + /acorn-walk/8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} @@ -55,10 +283,39 @@ packages: hasBin: true dev: true + /ansi-regex/5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-regex/6.0.1: + resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} + engines: {node: '>=12'} + dev: true + + /ansi-styles/5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + dev: true + + /ansi-styles/6.2.1: + resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + engines: {node: '>=12'} + dev: true + /assertion-error/1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} dev: true + /buffer-from/1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + dev: true + + /cac/6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + dev: true + /chai/4.3.7: resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==} engines: {node: '>=4'} @@ -76,6 +333,14 @@ packages: resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} dev: true + /cli-truncate/3.1.0: + resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + slice-ansi: 5.0.0 + string-width: 5.1.2 + dev: true + /debug/4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} @@ -95,6 +360,19 @@ packages: type-detect: 4.0.8 dev: true + /diff/5.1.0: + resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} + engines: {node: '>=0.3.1'} + dev: true + + /eastasianwidth/0.2.0: + resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + dev: true + + /emoji-regex/9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + dev: true + /esbuild-android-64/0.15.14: resolution: {integrity: sha512-HuilVIb4rk9abT4U6bcFdU35UHOzcWVGLSjEmC58OVr96q5UiRqzDtWjPlCMugjhgUGKEs8Zf4ueIvYbOStbIg==} engines: {node: '>=12'} @@ -104,15 +382,6 @@ packages: dev: true optional: true - /esbuild-android-arm64/0.14.18: - resolution: {integrity: sha512-AuE8vIwc6QLquwykyscFk0Ji3RFczoOvjka64FJlcjLLhD6VsS584RYlQrSnPpRkv69PunUvyrBoEF7JFTJijg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - /esbuild-android-arm64/0.15.14: resolution: {integrity: sha512-/QnxRVxsR2Vtf3XottAHj7hENAMW2wCs6S+OZcAbc/8nlhbAL/bCQRCVD78VtI5mdwqWkVi3wMqM94kScQCgqg==} engines: {node: '>=12'} @@ -122,15 +391,6 @@ packages: dev: true optional: true - /esbuild-darwin-64/0.14.18: - resolution: {integrity: sha512-nN1XziZtDy8QYOggaXC3zu0vVh8YJpS8Bol7bHaxx0enTLDSFBCXUUJEKYpmAAJ4OZRPgjXv8NzEHHQWQvLzXg==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /esbuild-darwin-64/0.15.14: resolution: {integrity: sha512-ToNuf1uifu8hhwWvoZJGCdLIX/1zpo8cOGnT0XAhDQXiKOKYaotVNx7pOVB1f+wHoWwTLInrOmh3EmA7Fd+8Vg==} engines: {node: '>=12'} @@ -140,15 +400,6 @@ packages: dev: true optional: true - /esbuild-darwin-arm64/0.14.18: - resolution: {integrity: sha512-v0i2n6TCsbxco/W1fN8RgQt3RW00Q9zJO2eqiAdmLWg6Hx0HNHloZyfhF11i7nMUUgW8r5n++ZweIXjAFPE/gQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - /esbuild-darwin-arm64/0.15.14: resolution: {integrity: sha512-KgGP+y77GszfYJgceO0Wi/PiRtYo5y2Xo9rhBUpxTPaBgWDJ14gqYN0+NMbu+qC2fykxXaipHxN4Scaj9tUS1A==} engines: {node: '>=12'} @@ -158,15 +409,6 @@ packages: dev: true optional: true - /esbuild-freebsd-64/0.14.18: - resolution: {integrity: sha512-XLyJZTWbSuQJOqw867tBxvto6GjxULvWZYKs6RFHYQPCqgQ0ODLRtBmp4Fqqpde52yOe45npaaoup9IXNfr32A==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /esbuild-freebsd-64/0.15.14: resolution: {integrity: sha512-xr0E2n5lyWw3uFSwwUXHc0EcaBDtsal/iIfLioflHdhAe10KSctV978Te7YsfnsMKzcoGeS366+tqbCXdqDHQA==} engines: {node: '>=12'} @@ -176,15 +418,6 @@ packages: dev: true optional: true - /esbuild-freebsd-arm64/0.14.18: - resolution: {integrity: sha512-0ItfrR8hePnDcUXxUQxY+VfICcBfeMJCdK6mcNUXnXw6LyHjyUYXWpFXF+J18pg1/YUWRWO1HbsJ7FEwELcQIA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - /esbuild-freebsd-arm64/0.15.14: resolution: {integrity: sha512-8XH96sOQ4b1LhMlO10eEWOjEngmZ2oyw3pW4o8kvBcpF6pULr56eeYVP5radtgw54g3T8nKHDHYEI5AItvskZg==} engines: {node: '>=12'} @@ -194,15 +427,6 @@ packages: dev: true optional: true - /esbuild-linux-32/0.14.18: - resolution: {integrity: sha512-mnG84D9NsEsoQdBpBT0IsFjm5iAwnd81SP4tRMXZLl09lPvIWjHHSq6LDlb4+L5H5K5y68WC//X5Dr2MtNY3DQ==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - /esbuild-linux-32/0.15.14: resolution: {integrity: sha512-6ssnvwaTAi8AzKN8By2V0nS+WF5jTP7SfuK6sStGnDP7MCJo/4zHgM9oE1eQTS2jPmo3D673rckuCzRlig+HMA==} engines: {node: '>=12'} @@ -212,15 +436,6 @@ packages: dev: true optional: true - /esbuild-linux-64/0.14.18: - resolution: {integrity: sha512-HvExRtkeA8l/p+7Lf6aBrnLH+jTCFJTUMJxGKExh2RD8lCXGTeDJFyP+BOEetP80fuuH+Syj79+LVQ9MihdBsg==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /esbuild-linux-64/0.15.14: resolution: {integrity: sha512-ONySx3U0wAJOJuxGUlXBWxVKFVpWv88JEv0NZ6NlHknmDd1yCbf4AEdClSgLrqKQDXYywmw4gYDvdLsS6z0hcw==} engines: {node: '>=12'} @@ -230,15 +445,6 @@ packages: dev: true optional: true - /esbuild-linux-arm/0.14.18: - resolution: {integrity: sha512-+ZL8xfXVNaeaZ2Kxqlw2VYZWRDZ7NSK4zOV9GKNAtkkWURLsPUU84aUOBatRe9BH1O5FDo3LLQSlaA04ed6lhA==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - /esbuild-linux-arm/0.15.14: resolution: {integrity: sha512-D2LImAIV3QzL7lHURyCHBkycVFbKwkDb1XEUWan+2fb4qfW7qAeUtul7ZIcIwFKZgPcl+6gKZmvLgPSj26RQ2Q==} engines: {node: '>=12'} @@ -248,15 +454,6 @@ packages: dev: true optional: true - /esbuild-linux-arm64/0.14.18: - resolution: {integrity: sha512-CCWmilODE1ckw+M7RVqoqKWA4UB0alCyK2bv0ikEeEAwkzinlJeoe94t9CnT/ECSQ2sL+C16idsr+aUviGp7sg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /esbuild-linux-arm64/0.15.14: resolution: {integrity: sha512-kle2Ov6a1e5AjlHlMQl1e+c4myGTeggrRzArQFmWp6O6JoqqB9hT+B28EW4tjFWgV/NxUq46pWYpgaWXsXRPAg==} engines: {node: '>=12'} @@ -266,15 +463,6 @@ packages: dev: true optional: true - /esbuild-linux-mips64le/0.14.18: - resolution: {integrity: sha512-8LjO4+6Vxz5gbyCHO4OONYMF689nLderCtzb8lG1Bncs4ZXHpo6bjvuWeTMRbGUkvAhp+P6hMTzia7RHOC53wQ==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - /esbuild-linux-mips64le/0.15.14: resolution: {integrity: sha512-FVdMYIzOLXUq+OE7XYKesuEAqZhmAIV6qOoYahvUp93oXy0MOVTP370ECbPfGXXUdlvc0TNgkJa3YhEwyZ6MRA==} engines: {node: '>=12'} @@ -284,15 +472,6 @@ packages: dev: true optional: true - /esbuild-linux-ppc64le/0.14.18: - resolution: {integrity: sha512-0OJk/6iYEmF1J7LXY6+cqf6Ga5vG4an7n1nubTKce7kYqaTyNGfYcTjDZce6lnDVlZTJtwntIMszq1+ZX7Kenw==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - /esbuild-linux-ppc64le/0.15.14: resolution: {integrity: sha512-2NzH+iuzMDA+jjtPjuIz/OhRDf8tzbQ1tRZJI//aT25o1HKc0reMMXxKIYq/8nSHXiJSnYV4ODzTiv45s+h73w==} engines: {node: '>=12'} @@ -311,15 +490,6 @@ packages: dev: true optional: true - /esbuild-linux-s390x/0.14.18: - resolution: {integrity: sha512-UNY7YKZHjY31KcNanJK4QaT2/aoIQyS+jViP3QuDRIoYAogRnc6WydylzIkkEzGMaC4fzaXOmQ8fxwpLAXK4Yg==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - /esbuild-linux-s390x/0.15.14: resolution: {integrity: sha512-+KVHEUshX5n6VP6Vp/AKv9fZIl5kr2ph8EUFmQUJnDpHwcfTSn2AQgYYm0HTBR2Mr4d0Wlr0FxF/Cs5pbFgiOw==} engines: {node: '>=12'} @@ -329,15 +499,6 @@ packages: dev: true optional: true - /esbuild-netbsd-64/0.14.18: - resolution: {integrity: sha512-wE/2xT9KNzLCfEBw24YbVmMmXH92cFIzrRPUlwWH9dIizjvEYYcyQ+peTMVkqzUum7pdlVLZ2CDDqAaZo/nW/w==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - /esbuild-netbsd-64/0.15.14: resolution: {integrity: sha512-6D/dr17piEgevIm1xJfZP2SjB9Z+g8ERhNnBdlZPBWZl+KSPUKLGF13AbvC+nzGh8IxOH2TyTIdRMvKMP0nEzQ==} engines: {node: '>=12'} @@ -347,15 +508,6 @@ packages: dev: true optional: true - /esbuild-openbsd-64/0.14.18: - resolution: {integrity: sha512-vdymE2jyuH/FRmTvrguCYSrq81/rUwuhMYyvt/6ibv9ac7xQ674c8qTdT+RH73sR9/2WUD/NsYxrBA/wUVTxcg==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - /esbuild-openbsd-64/0.15.14: resolution: {integrity: sha512-rREQBIlMibBetgr2E9Lywt2Qxv2ZdpmYahR4IUlAQ1Efv/A5gYdO0/VIN3iowDbCNTLxp0bb57Vf0LFcffD6kA==} engines: {node: '>=12'} @@ -365,21 +517,6 @@ packages: dev: true optional: true - /esbuild-plugin-flow/0.3.2: - resolution: {integrity: sha512-/PCopavWjTngOiPzxoUX9j3lnzJpaGFiw/ws734azGFVu8qHZwhztyf2nHVR9jmy+55WzvT1YKPxyq9OLBGpIQ==} - dependencies: - flow-remove-types: 2.171.0 - dev: true - - /esbuild-sunos-64/0.14.18: - resolution: {integrity: sha512-X/Tesy6K1MdJF1d5cbzFDxrIMMn0ye+VgTQRI8P5Vo2CcKxOdckwsKUwpRAvg+VDZ6MxrSOTYS9OOoggPUjxTg==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - /esbuild-sunos-64/0.15.14: resolution: {integrity: sha512-DNVjSp/BY4IfwtdUAvWGIDaIjJXY5KI4uD82+15v6k/w7px9dnaDaJJ2R6Mu+KCgr5oklmFc0KjBjh311Gxl9Q==} engines: {node: '>=12'} @@ -389,15 +526,6 @@ packages: dev: true optional: true - /esbuild-windows-32/0.14.18: - resolution: {integrity: sha512-glG23I/JzCL4lu7DWFUtVwqFwNwlL0g+ks+mcjjUisHcINoSXTeCNToUN0bHhzn6IlXXnggNQ38Ew/idHPM8+g==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - /esbuild-windows-32/0.15.14: resolution: {integrity: sha512-pHBWrcA+/oLgvViuG9FO3kNPO635gkoVrRQwe6ZY1S0jdET07xe2toUvQoJQ8KT3/OkxqUasIty5hpuKFLD+eg==} engines: {node: '>=12'} @@ -407,15 +535,6 @@ packages: dev: true optional: true - /esbuild-windows-64/0.14.18: - resolution: {integrity: sha512-zEiFKHgV/3z14wsVamV98/5mxeOwz+ecyg0pD3fWcBz9j4EOIT1Tg47axypD4QLwiKFvve9mUBYX1cD99qxOyw==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /esbuild-windows-64/0.15.14: resolution: {integrity: sha512-CszIGQVk/P8FOS5UgAH4hKc9zOaFo69fe+k1rqgBHx3CSK3Opyk5lwYriIamaWOVjBt7IwEP6NALz+tkVWdFog==} engines: {node: '>=12'} @@ -425,15 +544,6 @@ packages: dev: true optional: true - /esbuild-windows-arm64/0.14.18: - resolution: {integrity: sha512-Mh8lZFcPLat13dABN7lZThGUOn9YxoH5RYkhBq0U3WqQohHzKRhllYh7ibFixnkpMLnv8OZEbl8bGLMy03MpfA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /esbuild-windows-arm64/0.15.14: resolution: {integrity: sha512-KW9W4psdZceaS9A7Jsgl4WialOznSURvqX/oHZk3gOP7KbjtHLSsnmSvNdzagGJfxbAe30UVGXRe8q8nDsOSQw==} engines: {node: '>=12'} @@ -443,32 +553,6 @@ packages: dev: true optional: true - /esbuild/0.14.18: - resolution: {integrity: sha512-vCUoISSltnX7ax01w70pWOSQT+e55o+2P/a+A9MSTukJAt3T4aDZajcjeG4fnZbkvOEv+dkKgdkvljz6vVQD4A==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - esbuild-android-arm64: 0.14.18 - esbuild-darwin-64: 0.14.18 - esbuild-darwin-arm64: 0.14.18 - esbuild-freebsd-64: 0.14.18 - esbuild-freebsd-arm64: 0.14.18 - esbuild-linux-32: 0.14.18 - esbuild-linux-64: 0.14.18 - esbuild-linux-arm: 0.14.18 - esbuild-linux-arm64: 0.14.18 - esbuild-linux-mips64le: 0.14.18 - esbuild-linux-ppc64le: 0.14.18 - esbuild-linux-s390x: 0.14.18 - esbuild-netbsd-64: 0.14.18 - esbuild-openbsd-64: 0.14.18 - esbuild-sunos-64: 0.14.18 - esbuild-windows-32: 0.14.18 - esbuild-windows-64: 0.14.18 - esbuild-windows-arm64: 0.14.18 - dev: true - /esbuild/0.15.14: resolution: {integrity: sha512-pJN8j42fvWLFWwSMG4luuupl2Me7mxciUOsMegKvwCmhEbJ2covUdFnihxm0FMIBV+cbwbtMoHgMCCI+pj1btQ==} engines: {node: '>=12'} @@ -499,19 +583,34 @@ packages: esbuild-windows-arm64: 0.15.14 dev: true - /flow-parser/0.171.0: - resolution: {integrity: sha512-cqEsgic6HH81Pz0IQLeyuoh0O8Y7ECAIdZ0idPQ9P1jZ/kHB9KK0hwqnjVtqTGog15JURkIxvyXm+9pAb6uuSQ==} - engines: {node: '>=0.4.0'} - dev: true - - /flow-remove-types/2.171.0: - resolution: {integrity: sha512-lKUteoFiJa2yFy0MozPeQTubOuqpoYrHhCubFkCVsoxfETyGVfLn8Lvemygfg7eC8k33ccHydWE6srCoQXsfRg==} - engines: {node: '>=4'} + /esbuild/0.17.4: + resolution: {integrity: sha512-zBn9MeCwT7W5F1a3lXClD61ip6vQM+H8Msb0w8zMT4ZKBpDg+rFAraNyWCDelB/2L6M3g6AXHPnsyvjMFnxtFw==} + engines: {node: '>=12'} hasBin: true - dependencies: - flow-parser: 0.171.0 - pirates: 3.0.2 - vlq: 0.2.3 + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.17.4 + '@esbuild/android-arm64': 0.17.4 + '@esbuild/android-x64': 0.17.4 + '@esbuild/darwin-arm64': 0.17.4 + '@esbuild/darwin-x64': 0.17.4 + '@esbuild/freebsd-arm64': 0.17.4 + '@esbuild/freebsd-x64': 0.17.4 + '@esbuild/linux-arm': 0.17.4 + '@esbuild/linux-arm64': 0.17.4 + '@esbuild/linux-ia32': 0.17.4 + '@esbuild/linux-loong64': 0.17.4 + '@esbuild/linux-mips64el': 0.17.4 + '@esbuild/linux-ppc64': 0.17.4 + '@esbuild/linux-riscv64': 0.17.4 + '@esbuild/linux-s390x': 0.17.4 + '@esbuild/linux-x64': 0.17.4 + '@esbuild/netbsd-x64': 0.17.4 + '@esbuild/openbsd-x64': 0.17.4 + '@esbuild/sunos-x64': 0.17.4 + '@esbuild/win32-arm64': 0.17.4 + '@esbuild/win32-ia32': 0.17.4 + '@esbuild/win32-x64': 0.17.4 dev: true /fsevents/2.3.2: @@ -543,6 +642,15 @@ packages: has: 1.0.3 dev: true + /is-fullwidth-code-point/4.0.0: + resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} + engines: {node: '>=12'} + dev: true + + /jsonc-parser/3.2.0: + resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} + dev: true + /local-pkg/0.4.2: resolution: {integrity: sha512-mlERgSPrbxU3BP4qBqAvvwlgW4MTg78iwJdGGnv7kibKjWcJksrG3t6LB5lXI93wXRDvG4NpUgJFmTG4T6rdrg==} engines: {node: '>=14'} @@ -554,6 +662,15 @@ packages: get-func-name: 2.0.0 dev: true + /mlly/1.1.0: + resolution: {integrity: sha512-cwzBrBfwGC1gYJyfcy8TcZU1f+dbH/T+TuOhtYP2wLv/Fb51/uV7HJQfBPtEupZ2ORLRU1EKFS/QfS3eo9+kBQ==} + dependencies: + acorn: 8.8.1 + pathe: 1.1.0 + pkg-types: 1.0.1 + ufo: 1.0.1 + dev: true + /ms/2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true @@ -564,15 +681,21 @@ packages: hasBin: true dev: true - /node-modules-regexp/1.0.0: - resolution: {integrity: sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=} - engines: {node: '>=0.10.0'} + /p-limit/4.0.0: + resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + yocto-queue: 1.0.0 dev: true /path-parse/1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true + /pathe/1.1.0: + resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==} + dev: true + /pathval/1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} dev: true @@ -581,11 +704,12 @@ packages: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} dev: true - /pirates/3.0.2: - resolution: {integrity: sha512-c5CgUJq6H2k6MJz72Ak1F5sN9n9wlSlJyEnwvpm9/y3WB4E3pHBDT2c6PEiS1vyJvq2bUxUAIu0EGf8Cx4Ic7Q==} - engines: {node: '>= 4'} + /pkg-types/1.0.1: + resolution: {integrity: sha512-jHv9HB+Ho7dj6ItwppRDDl0iZRYBD0jsakHXtFgoLr+cHSF6xC+QL54sJmWxyGxOLYSHm0afhXhXcQDQqH9z8g==} dependencies: - node-modules-regexp: 1.0.0 + jsonc-parser: 3.2.0 + mlly: 1.1.0 + pathe: 1.1.0 dev: true /postcss/8.4.19: @@ -597,6 +721,19 @@ packages: source-map-js: 1.0.2 dev: true + /pretty-format/27.5.1: + resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + dependencies: + ansi-regex: 5.0.1 + ansi-styles: 5.2.0 + react-is: 17.0.2 + dev: true + + /react-is/17.0.2: + resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} + dev: true + /resolve/1.22.1: resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true @@ -614,18 +751,61 @@ packages: fsevents: 2.3.2 dev: true + /siginfo/2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + dev: true + + /slice-ansi/5.0.0: + resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} + engines: {node: '>=12'} + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 4.0.0 + dev: true + /source-map-js/1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} dev: true + /source-map-support/0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + dev: true + /source-map/0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} dev: true - /strip-literal/0.4.2: - resolution: {integrity: sha512-pv48ybn4iE1O9RLgCAN0iU4Xv7RlBTiit6DKmMiErbs9x1wH6vXBs45tWc0H5wUIF6TLTrKweqkmYF/iraQKNw==} + /stackback/0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + dev: true + + /std-env/3.3.1: + resolution: {integrity: sha512-3H20QlwQsSm2OvAxWIYhs+j01MzzqwMwGiiO1NQaJYZgJZFPuAbf95/DiKRBSTYIJ2FeGUc+B/6mPGcWP9dO3Q==} + dev: true + + /string-width/5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} + dependencies: + eastasianwidth: 0.2.0 + emoji-regex: 9.2.2 + strip-ansi: 7.0.1 + dev: true + + /strip-ansi/7.0.1: + resolution: {integrity: sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==} + engines: {node: '>=12'} + dependencies: + ansi-regex: 6.0.1 + dev: true + + /strip-literal/1.0.0: + resolution: {integrity: sha512-5o4LsH1lzBzO9UFH63AJ2ad2/S2AVx6NtjOcaz+VTT2h1RiRvbipW72z8M/lxEhcPHDBQwpDrnTF7sXy/7OwCQ==} dependencies: acorn: 8.8.1 dev: true @@ -654,6 +834,33 @@ packages: engines: {node: '>=4'} dev: true + /ufo/1.0.1: + resolution: {integrity: sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA==} + dev: true + + /vite-node/0.28.2_@types+node@18.11.9: + resolution: {integrity: sha512-zyiJ3DLs9zXign4P2MD4PQk+7rdT+JkHukgmmS0KuImbCQ7WnCdea5imQVeT6OtUsBwsLztJxQODUsinVr91tg==} + engines: {node: '>=v14.16.0'} + hasBin: true + dependencies: + cac: 6.7.14 + debug: 4.3.4 + mlly: 1.1.0 + pathe: 1.1.0 + picocolors: 1.0.0 + source-map: 0.6.1 + source-map-support: 0.5.21 + vite: 3.2.4_@types+node@18.11.9 + transitivePeerDependencies: + - '@types/node' + - less + - sass + - stylus + - sugarss + - supports-color + - terser + dev: true + /vite/3.2.4_@types+node@18.11.9: resolution: {integrity: sha512-Z2X6SRAffOUYTa+sLy3NQ7nlHFU100xwanq1WDwqaiFiCe+25zdxP1TfCS5ojPV2oDDcXudHIoPnI1Z/66B7Yw==} engines: {node: ^14.18.0 || >=16.0.0} @@ -688,8 +895,8 @@ packages: fsevents: 2.3.2 dev: true - /vitest/0.25.2: - resolution: {integrity: sha512-qqkzfzglEFbQY7IGkgSJkdOhoqHjwAao/OrphnHboeYHC5JzsVFoLCaB2lnAy8krhj7sbrFTVRApzpkTOeuDWQ==} + /vitest/0.28.2: + resolution: {integrity: sha512-HJBlRla4Mng0OiZ8aWunCecJ6BzLDA4yuzuxiBuBU2MXjGB6I4zT7QgIBL/UrwGKlNxLwaDC5P/4OpeuTlW8yQ==} engines: {node: '>=v14.16.0'} hasBin: true peerDependencies: @@ -713,17 +920,27 @@ packages: '@types/chai': 4.3.4 '@types/chai-subset': 1.3.3 '@types/node': 18.11.9 + '@vitest/expect': 0.28.2 + '@vitest/runner': 0.28.2 + '@vitest/spy': 0.28.2 + '@vitest/utils': 0.28.2 acorn: 8.8.1 acorn-walk: 8.2.0 + cac: 6.7.14 chai: 4.3.7 debug: 4.3.4 local-pkg: 0.4.2 + pathe: 1.1.0 + picocolors: 1.0.0 source-map: 0.6.1 - strip-literal: 0.4.2 + std-env: 3.3.1 + strip-literal: 1.0.0 tinybench: 2.3.1 tinypool: 0.3.0 tinyspy: 1.0.2 vite: 3.2.4_@types+node@18.11.9 + vite-node: 0.28.2_@types+node@18.11.9 + why-is-node-running: 2.2.2 transitivePeerDependencies: - less - sass @@ -733,6 +950,16 @@ packages: - terser dev: true - /vlq/0.2.3: - resolution: {integrity: sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==} + /why-is-node-running/2.2.2: + resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} + engines: {node: '>=8'} + hasBin: true + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + dev: true + + /yocto-queue/1.0.0: + resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} + engines: {node: '>=12.20'} dev: true From 5c030d33951f0877d6aff919f43a7aad0ae4310d Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Fri, 27 Jan 2023 13:22:17 +0300 Subject: [PATCH 3/5] update setup-emsdk action --- .github/workflows/ci.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 54b9d1d..70f3564 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -14,9 +14,9 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - - uses: mymindstorm/setup-emsdk@v11 + - uses: mymindstorm/setup-emsdk@v12 with: - version: 3.1.26 + version: 3.1.31 actions-cache-folder: "emsdk-cache" - name: Use pnpm run: corepack enable pnpm && pnpm --version From 5b1e7e29d52d046f55d38e671f0dd73c3017cc14 Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Fri, 27 Jan 2023 14:02:09 +0300 Subject: [PATCH 4/5] new types --- asm.d.ts | 6 ++++++ build.js | 43 ++++++++++++++++++++++++++----------------- index.d.ts | 26 +++++--------------------- package.json | 1 + 4 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 asm.d.ts diff --git a/asm.d.ts b/asm.d.ts new file mode 100644 index 0000000..0b8e3aa --- /dev/null +++ b/asm.d.ts @@ -0,0 +1,6 @@ +import type { Yoga } from "./dist/wrapAsm"; + +export * from "./dist/generated/YGEnums"; +export * from "./dist/wrapAsm"; + +export default function (): Yoga; diff --git a/build.js b/build.js index e26e6c6..2a69b29 100644 --- a/build.js +++ b/build.js @@ -1,35 +1,44 @@ -import { copyFile } from 'node:fs/promises' -import { build } from 'esbuild' +import { copyFile, mkdir } from "node:fs/promises"; +import { build } from "esbuild"; async function start() { const asm = build({ bundle: true, sourcemap: false, - format: 'esm', - target: 'esnext', + format: "esm", + target: "esnext", loader: { - '.js': 'ts', + ".js": "ts", }, - entryPoints: ['./asm.js'], - outfile: './dist/asm.js', + entryPoints: ["./asm.js"], + outfile: "./dist/asm.js", minify: true, - }) + }); await build({ bundle: true, sourcemap: false, - format: 'esm', - target: 'esnext', + format: "esm", + target: "esnext", loader: { - '.js': 'ts', + ".js": "ts", }, - entryPoints: ['./index.js'], - outfile: './dist/index.js', + entryPoints: ["./index.js"], + outfile: "./dist/index.js", minify: true, - }) + }); - await copyFile('./tmp/yoga.wasm', './dist/yoga.wasm') - await asm + await copyFile("./tmp/yoga.wasm", "./dist/yoga.wasm"); + await copyFile( + "./yoga/javascript/src_js/wrapAsm.d.ts", + "./dist/wrapAsm.d.ts" + ); + await mkdir("./dist/generated/", { recursive: true }); + await copyFile( + "./yoga/javascript/src_js/generated/YGEnums.d.ts", + "./dist/generated/YGEnums.d.ts" + ); + await asm; } -start() +start(); diff --git a/index.d.ts b/index.d.ts index 1714999..4644640 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,23 +1,7 @@ -import Yoga from "yoga-layout"; +import type { Yoga } from "./dist/wrapAsm"; -export { - YogaNode, - YogaConfig, - YogaAlign, - YogaDirection, - YogaDisplay, - YogaEdge, - YogaFlexDirection, - YogaExperimentalFeature, - YogaFlexWrap, - YogaJustifyContent, - YogaOverflow, - YogaPositionType, - YogaUnit, - YogaMeasureMode, -} from "yoga-layout" +export * from "./dist/generated/YGEnums"; +export * from "./dist/wrapAsm"; -export type YogaStatic = typeof Yoga - -export default function(wasm: ArrayBuffer): YogaStatic; -export function initStreaming(response: Response): Promise; +export default function (wasm: ArrayBuffer): Promise; +export function initStreaming(response: Response): Promise; diff --git a/package.json b/package.json index 8ff422b..b961250 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "dist", "package.json", "index.d.ts", + "asm.d.ts", "LICENSE" ], "devDependencies": { From a44903c31cc0df15c10f04767be90e215874e83f Mon Sep 17 00:00:00 2001 From: Dmitry Ivakhnenko Date: Fri, 27 Jan 2023 15:23:30 +0300 Subject: [PATCH 5/5] =?UTF-8?q?add=20comments=20=F0=9F=91=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.js b/build.js index 2a69b29..478f6d9 100644 --- a/build.js +++ b/build.js @@ -28,7 +28,10 @@ async function start() { minify: true, }); + // copy wasm file await copyFile("./tmp/yoga.wasm", "./dist/yoga.wasm"); + + // copy d.ts files await copyFile( "./yoga/javascript/src_js/wrapAsm.d.ts", "./dist/wrapAsm.d.ts"