koffi 2.5.7 → 2.5.9

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +17 -100
  2. package/build/{2.5.7/koffi_darwin_arm64 → koffi/darwin_arm64}/koffi.node +0 -0
  3. package/build/{2.5.7/koffi_darwin_x64 → koffi/darwin_x64}/koffi.node +0 -0
  4. package/build/koffi/freebsd_arm64/koffi.node +0 -0
  5. package/build/koffi/freebsd_ia32/koffi.node +0 -0
  6. package/build/{2.5.7/koffi_freebsd_x64 → koffi/freebsd_x64}/koffi.node +0 -0
  7. package/build/koffi/linux_arm32hf/koffi.node +0 -0
  8. package/build/koffi/linux_arm64/koffi.node +0 -0
  9. package/build/koffi/linux_ia32/koffi.node +0 -0
  10. package/build/koffi/linux_riscv64hf64/koffi.node +0 -0
  11. package/build/{2.5.7/koffi_linux_x64 → koffi/linux_x64}/koffi.node +0 -0
  12. package/build/koffi/openbsd_ia32/koffi.node +0 -0
  13. package/build/{2.5.7/koffi_openbsd_x64 → koffi/openbsd_x64}/koffi.node +0 -0
  14. package/build/koffi/win32_arm64/koffi.node +0 -0
  15. package/build/{2.5.7/koffi_win32_ia32 → koffi/win32_ia32}/koffi.node +0 -0
  16. package/build/{2.5.7/koffi_win32_x64 → koffi/win32_x64}/koffi.node +0 -0
  17. package/doc/conf.py +15 -7
  18. package/doc/contribute.md +2 -2
  19. package/doc/index.rst +1 -0
  20. package/doc/packaging.md +60 -0
  21. package/doc/pyproject.toml +1 -1
  22. package/doc/start.md +9 -3
  23. package/doc/static/custom.css +41 -1
  24. package/doc/static/node_c.webp +0 -0
  25. package/doc/static/opensans/LICENSE.txt +202 -0
  26. package/doc/static/opensans/OpenSans.css +39 -0
  27. package/doc/static/opensans/OpenSans_v17_Latin_Bold.woff +0 -0
  28. package/doc/static/opensans/OpenSans_v17_Latin_Bold.woff2 +0 -0
  29. package/doc/static/opensans/OpenSans_v17_Latin_BoldItalic.woff +0 -0
  30. package/doc/static/opensans/OpenSans_v17_Latin_BoldItalic.woff2 +0 -0
  31. package/doc/static/opensans/OpenSans_v17_Latin_Italic.woff +0 -0
  32. package/doc/static/opensans/OpenSans_v17_Latin_Italic.woff2 +0 -0
  33. package/doc/static/opensans/OpenSans_v17_Latin_Regular.woff +0 -0
  34. package/doc/static/opensans/OpenSans_v17_Latin_Regular.woff2 +0 -0
  35. package/doc/templates/logo.html +3 -0
  36. package/package.json +3 -3
  37. package/src/cnoke/assets/FindCNoke.cmake +16 -0
  38. package/src/core/libcc/libcc.cc +67 -13
  39. package/src/core/libcc/libcc.hh +24 -13
  40. package/src/index.d.ts +4 -0
  41. package/src/index.js +51 -10
  42. package/src/koffi/CMakeLists.txt +6 -0
  43. package/src/koffi/examples/electron-builder/README.md +23 -0
  44. package/src/koffi/examples/electron-builder/package.json +21 -0
  45. package/src/koffi/examples/electron-builder/src/app.js +20 -0
  46. package/src/koffi/examples/electron-builder/src/index.html +143 -0
  47. package/src/koffi/examples/electron-builder/src/preload.js +5 -0
  48. package/src/koffi/examples/electron-forge/README.md +25 -0
  49. package/src/koffi/examples/electron-forge/forge.config.js +43 -0
  50. package/src/koffi/examples/electron-forge/package.json +37 -0
  51. package/src/koffi/examples/electron-forge/src/index.css +7 -0
  52. package/src/koffi/examples/electron-forge/src/index.html +143 -0
  53. package/src/koffi/examples/electron-forge/src/main.js +52 -0
  54. package/src/koffi/examples/electron-forge/src/preload.js +5 -0
  55. package/src/koffi/examples/electron-forge/src/renderer.js +31 -0
  56. package/src/koffi/examples/electron-forge/webpack.main.config.js +11 -0
  57. package/src/koffi/examples/electron-forge/webpack.renderer.config.js +13 -0
  58. package/src/koffi/examples/electron-forge/webpack.rules.js +35 -0
  59. package/src/koffi/examples/nwjs/README.md +20 -0
  60. package/src/koffi/examples/nwjs/package.json +11 -0
  61. package/src/koffi/examples/nwjs/src/index.html +145 -0
  62. package/src/koffi/examples/nwjs/src/package.json +9 -0
  63. package/src/koffi/src/ffi.cc +1 -0
  64. package/build/2.5.7/koffi_freebsd_arm64/koffi.node +0 -0
  65. package/build/2.5.7/koffi_freebsd_ia32/koffi.node +0 -0
  66. package/build/2.5.7/koffi_linux_arm32hf/koffi.node +0 -0
  67. package/build/2.5.7/koffi_linux_arm64/koffi.node +0 -0
  68. package/build/2.5.7/koffi_linux_ia32/koffi.node +0 -0
  69. package/build/2.5.7/koffi_linux_riscv64hf64/koffi.node +0 -0
  70. package/build/2.5.7/koffi_openbsd_ia32/koffi.node +0 -0
  71. package/build/2.5.7/koffi_win32_arm64/koffi.node +0 -0
  72. package/doc/favicon.png +0 -0
  73. /package/build/{2.5.7/koffi_win32_arm64 → koffi/win32_arm64}/koffi.exp +0 -0
  74. /package/build/{2.5.7/koffi_win32_arm64 → koffi/win32_arm64}/koffi.lib +0 -0
  75. /package/build/{2.5.7/koffi_win32_ia32 → koffi/win32_ia32}/koffi.exp +0 -0
  76. /package/build/{2.5.7/koffi_win32_ia32 → koffi/win32_ia32}/koffi.lib +0 -0
  77. /package/build/{2.5.7/koffi_win32_x64 → koffi/win32_x64}/koffi.exp +0 -0
  78. /package/build/{2.5.7/koffi_win32_x64 → koffi/win32_x64}/koffi.lib +0 -0
@@ -0,0 +1,145 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <title>Koffi Configuration</title>
6
+
7
+ <style>
8
+ html {
9
+ height: 100%;
10
+ }
11
+ body {
12
+ font-family: 'Open Sans', sans-serif;
13
+ display: flex;
14
+ min-height: calc(100% - 17px);
15
+ align-items: center;
16
+ justify-content: center;
17
+ font-size: 14px;
18
+ }
19
+
20
+ #error {
21
+ position: fixed;
22
+ top: 50px;
23
+ left: calc(50% - 200px);
24
+ width: 400px;
25
+ padding: 8px;
26
+ background: #db0a0a;
27
+ color: white;
28
+ box-shadow: 1px 1px rgba(0, 0, 0, 0.5);
29
+ text-align: center;
30
+ }
31
+ #error:empty { display: none; }
32
+
33
+ #config {
34
+ background: #f8f8f8;
35
+ border-radius: 8px;
36
+ padding: 1em;
37
+ font-size: 1.2em;
38
+ }
39
+ form {
40
+ display: flex;
41
+ flex-direction: column;
42
+ gap: 0.5em;
43
+ }
44
+ label {
45
+ display: flex;
46
+ gap: 12px;
47
+ }
48
+ label > span { width: 200px; }
49
+ label > :not(span) { flex: 1; }
50
+ button {
51
+ margin-top: 1em;
52
+ background: white;
53
+ border: white;
54
+ border-radius: 6px;
55
+ padding: 6px;
56
+ cursor: pointer;
57
+ }
58
+ button:hover { background: #ededed; }
59
+ </style>
60
+ </head>
61
+
62
+ <body>
63
+ <div id="error"></div>
64
+ <div id="config"></div>
65
+
66
+ <script>
67
+ const koffi = require('koffi');
68
+
69
+ update();
70
+
71
+ function update() {
72
+ let config = koffi.config();
73
+
74
+ let container = document.querySelector('#config');
75
+ let form = document.createElement('form');
76
+
77
+ form.addEventListener('submit', e => { e.preventDefault(); apply(e.target.elements); });
78
+
79
+ for (let key in config) {
80
+ let value = config[key];
81
+
82
+ if (typeof value != 'number')
83
+ continue;
84
+
85
+ let label = document.createElement('label');
86
+ let span = document.createElement('span');
87
+ let input = document.createElement('input');
88
+
89
+ span.textContent = key;
90
+ input.name = key;
91
+ input.type = 'number';
92
+ input.value = config[key];
93
+
94
+ label.appendChild(span);
95
+ label.appendChild(input);
96
+ form.appendChild(label);
97
+ }
98
+
99
+ let button = document.createElement('button');
100
+ button.textContent = 'Modifier';
101
+ button.type = 'submit';
102
+
103
+ form.appendChild(button);
104
+
105
+ window.requestAnimationFrame(() => {
106
+ container.innerHTML = '';
107
+ container.appendChild(form);
108
+ });
109
+ }
110
+
111
+ async function apply(elements) {
112
+ let config = koffi.config();
113
+
114
+ for (let key in elements) {
115
+ if (!config.hasOwnProperty(key))
116
+ continue;
117
+
118
+ let value = elements[key].valueAsNumber;
119
+
120
+ if (typeof value == 'number')
121
+ config[key] = value;
122
+ }
123
+
124
+ try {
125
+ koffi.config(config);
126
+ } catch (err) {
127
+ console.error(err);
128
+ flashError(err.message);
129
+ }
130
+
131
+ update();
132
+ }
133
+
134
+ function flashError(msg) {
135
+ let div = document.querySelector('#error');
136
+
137
+ if (flashError.timer != null)
138
+ clearTimeout(flashError.timer);
139
+ flashError.timer = setTimeout(() => { div.textContent = '' }, 4000);
140
+
141
+ div.textContent = msg;
142
+ }
143
+ </script>
144
+ </body>
145
+ </html>
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "Koffi Config",
3
+ "main": "index.html",
4
+ "author": "Niels Martignène <niels.martignene@protonmail.com>",
5
+ "license": "MIT",
6
+ "dependencies": {
7
+ "koffi": "^2.5.8"
8
+ }
9
+ }
@@ -2168,6 +2168,7 @@ static Napi::Object InitModule(Napi::Env env, Napi::Object exports)
2168
2168
  exports.Set("types", types);
2169
2169
 
2170
2170
  exports.Set("internal", Napi::Boolean::New(env, false));
2171
+ exports.Set("version", Napi::String::New(env, RG_STRINGIFY(VERSION)));
2171
2172
 
2172
2173
  return exports;
2173
2174
  }
package/doc/favicon.png DELETED
Binary file