@xframes/node 0.0.2 → 0.0.3

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/CMakeLists.txt ADDED
@@ -0,0 +1,148 @@
1
+ cmake_minimum_required(VERSION 3.15)
2
+ cmake_policy(SET CMP0091 NEW)
3
+ cmake_policy(SET CMP0042 NEW)
4
+
5
+ if(NOT CMAKE_GENERATOR)
6
+ set(CMAKE_GENERATOR "Ninja")
7
+ endif()
8
+
9
+ set(CMAKE_TOOLCHAIN_FILE ../../cpp/deps/vcpkg/scripts/buildsystems/vcpkg.cmake)
10
+
11
+ if(NOT VCPKG_TARGET_TRIPLET)
12
+ if(WIN32)
13
+ set(VCPKG_TARGET_TRIPLET "x64-windows")
14
+ elseif(APPLE)
15
+ set(VCPKG_TARGET_TRIPLET "x64-osx")
16
+ else()
17
+ set(VCPKG_TARGET_TRIPLET "x64-linux")
18
+ endif()
19
+ endif()
20
+
21
+ project (xframes LANGUAGES C CXX)
22
+
23
+ set (CMAKE_CXX_STANDARD 23)
24
+
25
+ set(DEPS ${CMAKE_CURRENT_SOURCE_DIR}/../../cpp/deps)
26
+ set(APP ${CMAKE_CURRENT_SOURCE_DIR}/../../cpp/app)
27
+
28
+ find_package(OpenGL REQUIRED)
29
+ find_package(glfw3 CONFIG REQUIRED)
30
+ find_package(ada CONFIG REQUIRED)
31
+ find_package(Stb REQUIRED)
32
+
33
+ include_directories(${CMAKE_JS_INC})
34
+
35
+ file(GLOB YOGA_SRC CONFIGURE_DEPENDS
36
+ ${DEPS}/yoga/yoga/*.cpp
37
+ ${DEPS}/yoga/yoga/**/*.cpp)
38
+
39
+ add_library(${PROJECT_NAME} SHARED
40
+ ${DEPS}/css-color-parser-cpp/csscolorparser.hpp
41
+ ${DEPS}/css-color-parser-cpp/csscolorparser.cpp
42
+
43
+ ${DEPS}/imgui/imgui.cpp
44
+ ${DEPS}/imgui/imgui_draw.cpp
45
+ ${DEPS}/imgui/imgui_widgets.cpp
46
+ ${DEPS}/imgui/imgui_tables.cpp
47
+ ${DEPS}/imgui/backends/imgui_impl_opengl3.cpp
48
+ ${DEPS}/imgui/backends/imgui_impl_glfw.cpp
49
+
50
+ ${DEPS}/implot/implot.cpp
51
+ ${DEPS}/implot/implot_items.cpp
52
+
53
+ ${YOGA_SRC}
54
+
55
+ ${APP}/src/shared.cpp
56
+ ${APP}/src/color_helpers.cpp
57
+ ${APP}/src/yoga_helpers.cpp
58
+ ${APP}/src/imgui_helpers.cpp
59
+
60
+ ${APP}/src/element/layout_node.cpp
61
+ ${APP}/src/element/element.cpp
62
+
63
+ ${APP}/src/widget/widget.cpp
64
+ ${APP}/src/widget/styled_widget.cpp
65
+
66
+ ${APP}/src/xframes.cpp
67
+ ${APP}/src/imgui_renderer.cpp
68
+ ${APP}/src/implot_renderer.cpp
69
+
70
+ ${APP}/src/widget/button.cpp
71
+ ${APP}/src/widget/checkbox.cpp
72
+ ${APP}/src/widget/child.cpp
73
+ ${APP}/src/widget/clipped_multi_line_text_renderer.cpp
74
+ ${APP}/src/widget/collapsing_header.cpp
75
+ ${APP}/src/widget/combo.cpp
76
+ ${APP}/src/widget/group.cpp
77
+ ${APP}/src/widget/image.cpp
78
+ ${APP}/src/widget/input_text.cpp
79
+ ${APP}/src/widget/item_tooltip.cpp
80
+ ${APP}/src/widget/multi_slider.cpp
81
+ ${APP}/src/widget/plot_candlestick.cpp
82
+ ${APP}/src/widget/plot_line.cpp
83
+ ${APP}/src/widget/separator.cpp
84
+ ${APP}/src/widget/separator_text.cpp
85
+ ${APP}/src/widget/slider.cpp
86
+ ${APP}/src/widget/table.cpp
87
+ ${APP}/src/widget/tabs.cpp
88
+ ${APP}/src/widget/text.cpp
89
+ ${APP}/src/widget/text_wrap.cpp
90
+ ${APP}/src/widget/tree_node.cpp
91
+ ${APP}/src/widget/window.cpp
92
+
93
+ ./src/xframes-node.cpp
94
+
95
+ ${SOURCE_FILES}
96
+ ${CMAKE_JS_SRC}
97
+ )
98
+
99
+ set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".node")
100
+ target_link_libraries(${PROJECT_NAME}
101
+ ${CMAKE_JS_LIB}
102
+ ada::ada
103
+
104
+ glfw
105
+ OpenGL::GL
106
+ )
107
+
108
+ # Include Node-API wrappers
109
+ execute_process(COMMAND node -p "require('node-addon-api').include"
110
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
111
+ OUTPUT_VARIABLE NODE_ADDON_API_DIR
112
+ )
113
+ string(REGEX REPLACE "[\r\n\"]" "" NODE_ADDON_API_DIR ${NODE_ADDON_API_DIR})
114
+
115
+ target_include_directories(${PROJECT_NAME} PRIVATE
116
+ ${NODE_ADDON_API_DIR}
117
+ ${CMAKE_CURRENT_SOURCE_DIR}
118
+ ${APP}/include
119
+ ${CMAKE_CURRENT_SOURCE_DIR}/node_modules/node-addon-api
120
+
121
+ ${Stb_INCLUDE_DIR}
122
+
123
+ ${DEPS}/node-addon-api
124
+ ${DEPS}/node-api-headers/include
125
+ ${DEPS}/IconFontCppHeaders
126
+ ${DEPS}/ReactivePlusPlus/src/rpp
127
+ ${DEPS}/css-color-parser-cpp
128
+ ${DEPS}/imgui
129
+ ${DEPS}/imgui/backends
130
+ ${DEPS}/implot
131
+ ${DEPS}/json/include
132
+ ${DEPS}/yoga
133
+ ${DEPS}/glfw/include
134
+ )
135
+
136
+ # define NAPI_VERSION
137
+ add_definitions(-DNAPI_VERSION=9)
138
+
139
+ if(MSVC AND CMAKE_JS_NODELIB_DEF AND CMAKE_JS_NODELIB_TARGET)
140
+ # Generate node.lib
141
+ execute_process(COMMAND ${CMAKE_AR} /def:${CMAKE_JS_NODELIB_DEF} /out:${CMAKE_JS_NODELIB_TARGET} ${CMAKE_STATIC_LINKER_FLAGS})
142
+ endif()
143
+
144
+ #if (MSVC)
145
+
146
+ #else()
147
+
148
+ #endif()
package/dist/glfw3.dll CHANGED
Binary file
package/dist/index.js CHANGED
@@ -16,7 +16,7 @@ var __commonJS = (cb, mod) => function __require2() {
16
16
  var xframes_default;
17
17
  var init_xframes = __esm({
18
18
  "build/Release/xframes.node"() {
19
- xframes_default = "./xframes-FY3TN6FP.node";
19
+ xframes_default = "./xframes-Q7CYJXBZ.node";
20
20
  }
21
21
  });
22
22
 
package/package.json CHANGED
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "name": "@xframes/node",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "DOM-less, GPU-accelerated GUI development for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
- "dist/*"
7
+ "dist/*",
8
+ "CMakeLists.txt",
9
+ "vcpkg.json"
8
10
  ],
9
11
  "repository": {
10
12
  "type": "https",
package/vcpkg.json ADDED
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "reactdearimgui",
3
+ "version-string": "1.0.0",
4
+ "dependencies": [
5
+ "stb",
6
+ "ada-url",
7
+ "opengl-registry",
8
+ "glfw3"
9
+ ]
10
+ }