create-crossbind 2.0.0-beta.50

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 (235) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +63 -0
  3. package/package.json +47 -0
  4. package/src/index.js +182 -0
  5. package/src/manifest.json +14 -0
  6. package/src/utils.js +8 -0
  7. package/templates/backend-nodejs-wasm/CHANGELOG.md +34 -0
  8. package/templates/backend-nodejs-wasm/README.md +32 -0
  9. package/templates/backend-nodejs-wasm/crossbind.config.mjs +14 -0
  10. package/templates/backend-nodejs-wasm/package.json +25 -0
  11. package/templates/backend-nodejs-wasm/src/index.js +5 -0
  12. package/templates/backend-nodejs-wasm/src/index.mjs +5 -0
  13. package/templates/backend-nodejs-wasm/src/native/native.cpp +9 -0
  14. package/templates/backend-nodejs-wasm/src/native/native.h +12 -0
  15. package/templates/cloud-cloudflare-worker/CHANGELOG.md +27 -0
  16. package/templates/cloud-cloudflare-worker/Readme.md +46 -0
  17. package/templates/cloud-cloudflare-worker/crossbind.config.mjs +9 -0
  18. package/templates/cloud-cloudflare-worker/e2e/crossbind.spec.cjs +7 -0
  19. package/templates/cloud-cloudflare-worker/index.js +10 -0
  20. package/templates/cloud-cloudflare-worker/package.json +38 -0
  21. package/templates/cloud-cloudflare-worker/playwright.dev.config.cjs +48 -0
  22. package/templates/cloud-cloudflare-worker/src/native/native.cpp +5 -0
  23. package/templates/cloud-cloudflare-worker/src/native/native.h +11 -0
  24. package/templates/cloud-cloudflare-worker/wrangler.toml +3 -0
  25. package/templates/lib-cmake/CHANGELOG.md +20 -0
  26. package/templates/lib-cmake/CMakeLists.txt +16 -0
  27. package/templates/lib-cmake/README.md +51 -0
  28. package/templates/lib-cmake/crossbind.config.js +9 -0
  29. package/templates/lib-cmake/package.json +16 -0
  30. package/templates/lib-cmake/src/native/crossbind-lib-samplebasic-cmake/samplebasiccmake.h +11 -0
  31. package/templates/lib-cmake/src/native/samplebasiccmake.cpp +5 -0
  32. package/templates/lib-prebuilt/AGENTS.md +78 -0
  33. package/templates/lib-prebuilt/CHANGELOG.md +20 -0
  34. package/templates/lib-prebuilt/README.md +81 -0
  35. package/templates/lib-prebuilt/crossbind-example-lib-prebuilt-matrix.podspec +21 -0
  36. package/templates/lib-prebuilt/crossbind.config.js +13 -0
  37. package/templates/lib-prebuilt/package.json +36 -0
  38. package/templates/lib-prebuilt/playground/Matrix.js +19 -0
  39. package/templates/lib-prebuilt/playground/index.html +74 -0
  40. package/templates/lib-prebuilt/src/native/Matrix.cpp +17 -0
  41. package/templates/lib-prebuilt/src/native/Matrix.h +12 -0
  42. package/templates/lib-source/CHANGELOG.md +20 -0
  43. package/templates/lib-source/README.md +51 -0
  44. package/templates/lib-source/crossbind.config.js +8 -0
  45. package/templates/lib-source/package.json +12 -0
  46. package/templates/lib-source/src/native/crossbind-lib-samplebasic/samplebasic.h +13 -0
  47. package/templates/mobile-reactnative-cli/.bundle/config +2 -0
  48. package/templates/mobile-reactnative-cli/.eslintrc.js +4 -0
  49. package/templates/mobile-reactnative-cli/.prettierrc.js +7 -0
  50. package/templates/mobile-reactnative-cli/AGENTS.md +89 -0
  51. package/templates/mobile-reactnative-cli/CHANGELOG.md +38 -0
  52. package/templates/mobile-reactnative-cli/Gemfile +20 -0
  53. package/templates/mobile-reactnative-cli/README.md +55 -0
  54. package/templates/mobile-reactnative-cli/__tests__/App.test.tsx +13 -0
  55. package/templates/mobile-reactnative-cli/android/app/build.gradle +119 -0
  56. package/templates/mobile-reactnative-cli/android/app/debug.keystore +0 -0
  57. package/templates/mobile-reactnative-cli/android/app/proguard-rules.pro +10 -0
  58. package/templates/mobile-reactnative-cli/android/app/src/debug/AndroidManifest.xml +9 -0
  59. package/templates/mobile-reactnative-cli/android/app/src/main/AndroidManifest.xml +27 -0
  60. package/templates/mobile-reactnative-cli/android/app/src/main/java/dev/crossbind/sampleReactNativeCLI/MainActivity.kt +22 -0
  61. package/templates/mobile-reactnative-cli/android/app/src/main/java/dev/crossbind/sampleReactNativeCLI/MainApplication.kt +27 -0
  62. package/templates/mobile-reactnative-cli/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  63. package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  64. package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  65. package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  66. package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  67. package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  68. package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  69. package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  70. package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  71. package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  72. package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  73. package/templates/mobile-reactnative-cli/android/app/src/main/res/values/strings.xml +3 -0
  74. package/templates/mobile-reactnative-cli/android/app/src/main/res/values/styles.xml +9 -0
  75. package/templates/mobile-reactnative-cli/android/build.gradle +21 -0
  76. package/templates/mobile-reactnative-cli/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  77. package/templates/mobile-reactnative-cli/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  78. package/templates/mobile-reactnative-cli/android/gradle.properties +44 -0
  79. package/templates/mobile-reactnative-cli/android/gradlew +248 -0
  80. package/templates/mobile-reactnative-cli/android/gradlew.bat +98 -0
  81. package/templates/mobile-reactnative-cli/android/settings.gradle +6 -0
  82. package/templates/mobile-reactnative-cli/app.json +4 -0
  83. package/templates/mobile-reactnative-cli/babel.config.js +3 -0
  84. package/templates/mobile-reactnative-cli/ci/crossbind-snapshot/cache.json +12 -0
  85. package/templates/mobile-reactnative-cli/crossbind.config.mjs +10 -0
  86. package/templates/mobile-reactnative-cli/index.js +9 -0
  87. package/templates/mobile-reactnative-cli/ios/.xcode.env +11 -0
  88. package/templates/mobile-reactnative-cli/ios/Podfile +42 -0
  89. package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI/AppDelegate.swift +48 -0
  90. package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  91. package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI/Images.xcassets/Contents.json +6 -0
  92. package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI/Info.plist +60 -0
  93. package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI/LaunchScreen.storyboard +47 -0
  94. package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI/PrivacyInfo.xcprivacy +37 -0
  95. package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI.xcodeproj/project.pbxproj +494 -0
  96. package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI.xcodeproj/xcshareddata/xcschemes/crossbindSampleReactNativeCLI.xcscheme +88 -0
  97. package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI.xcworkspace/contents.xcworkspacedata +10 -0
  98. package/templates/mobile-reactnative-cli/jest.config.js +3 -0
  99. package/templates/mobile-reactnative-cli/maestro.yaml +4 -0
  100. package/templates/mobile-reactnative-cli/metro.config.js +17 -0
  101. package/templates/mobile-reactnative-cli/package.json +68 -0
  102. package/templates/mobile-reactnative-cli/src/App.tsx +53 -0
  103. package/templates/mobile-reactnative-cli/src/native/native.cpp +9 -0
  104. package/templates/mobile-reactnative-cli/src/native/native.h +12 -0
  105. package/templates/mobile-reactnative-cli/tsconfig.json +16 -0
  106. package/templates/mobile-reactnative-expo/README.md +34 -0
  107. package/templates/mobile-reactnative-expo/app.json +51 -0
  108. package/templates/mobile-reactnative-expo/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
  109. package/templates/mobile-reactnative-expo/assets/expo.icon/Assets/grid.png +0 -0
  110. package/templates/mobile-reactnative-expo/assets/expo.icon/icon.json +40 -0
  111. package/templates/mobile-reactnative-expo/assets/images/android-icon-background.png +0 -0
  112. package/templates/mobile-reactnative-expo/assets/images/android-icon-foreground.png +0 -0
  113. package/templates/mobile-reactnative-expo/assets/images/android-icon-monochrome.png +0 -0
  114. package/templates/mobile-reactnative-expo/assets/images/expo-badge-white.png +0 -0
  115. package/templates/mobile-reactnative-expo/assets/images/expo-badge.png +0 -0
  116. package/templates/mobile-reactnative-expo/assets/images/expo-logo.png +0 -0
  117. package/templates/mobile-reactnative-expo/assets/images/favicon.png +0 -0
  118. package/templates/mobile-reactnative-expo/assets/images/icon.png +0 -0
  119. package/templates/mobile-reactnative-expo/assets/images/logo-glow.png +0 -0
  120. package/templates/mobile-reactnative-expo/assets/images/react-logo.png +0 -0
  121. package/templates/mobile-reactnative-expo/assets/images/react-logo@2x.png +0 -0
  122. package/templates/mobile-reactnative-expo/assets/images/react-logo@3x.png +0 -0
  123. package/templates/mobile-reactnative-expo/assets/images/splash-icon.png +0 -0
  124. package/templates/mobile-reactnative-expo/assets/images/tabIcons/explore.png +0 -0
  125. package/templates/mobile-reactnative-expo/assets/images/tabIcons/explore@2x.png +0 -0
  126. package/templates/mobile-reactnative-expo/assets/images/tabIcons/explore@3x.png +0 -0
  127. package/templates/mobile-reactnative-expo/assets/images/tabIcons/home.png +0 -0
  128. package/templates/mobile-reactnative-expo/assets/images/tabIcons/home@2x.png +0 -0
  129. package/templates/mobile-reactnative-expo/assets/images/tabIcons/home@3x.png +0 -0
  130. package/templates/mobile-reactnative-expo/assets/images/tutorial-web.png +0 -0
  131. package/templates/mobile-reactnative-expo/crossbind.config.mjs +10 -0
  132. package/templates/mobile-reactnative-expo/maestro.yaml +4 -0
  133. package/templates/mobile-reactnative-expo/metro.config.js +13 -0
  134. package/templates/mobile-reactnative-expo/package-lock.json +9433 -0
  135. package/templates/mobile-reactnative-expo/package.json +82 -0
  136. package/templates/mobile-reactnative-expo/scripts/reset-project.js +113 -0
  137. package/templates/mobile-reactnative-expo/src/app/_layout.tsx +16 -0
  138. package/templates/mobile-reactnative-expo/src/app/explore.tsx +181 -0
  139. package/templates/mobile-reactnative-expo/src/app/index.tsx +110 -0
  140. package/templates/mobile-reactnative-expo/src/components/animated-icon.module.css +6 -0
  141. package/templates/mobile-reactnative-expo/src/components/animated-icon.tsx +132 -0
  142. package/templates/mobile-reactnative-expo/src/components/animated-icon.web.tsx +108 -0
  143. package/templates/mobile-reactnative-expo/src/components/app-tabs.tsx +33 -0
  144. package/templates/mobile-reactnative-expo/src/components/app-tabs.web.tsx +116 -0
  145. package/templates/mobile-reactnative-expo/src/components/external-link.tsx +25 -0
  146. package/templates/mobile-reactnative-expo/src/components/hint-row.tsx +35 -0
  147. package/templates/mobile-reactnative-expo/src/components/themed-text.tsx +73 -0
  148. package/templates/mobile-reactnative-expo/src/components/themed-view.tsx +16 -0
  149. package/templates/mobile-reactnative-expo/src/components/ui/collapsible.tsx +65 -0
  150. package/templates/mobile-reactnative-expo/src/components/web-badge.tsx +44 -0
  151. package/templates/mobile-reactnative-expo/src/constants/theme.ts +65 -0
  152. package/templates/mobile-reactnative-expo/src/global.css +9 -0
  153. package/templates/mobile-reactnative-expo/src/hooks/use-color-scheme.ts +1 -0
  154. package/templates/mobile-reactnative-expo/src/hooks/use-color-scheme.web.ts +21 -0
  155. package/templates/mobile-reactnative-expo/src/hooks/use-theme.ts +14 -0
  156. package/templates/mobile-reactnative-expo/src/native/native.cpp +9 -0
  157. package/templates/mobile-reactnative-expo/src/native/native.h +12 -0
  158. package/templates/mobile-reactnative-expo/tsconfig.json +20 -0
  159. package/templates/web-react-rspack/CHANGELOG.md +35 -0
  160. package/templates/web-react-rspack/README.md +38 -0
  161. package/templates/web-react-rspack/crossbind.config.mjs +13 -0
  162. package/templates/web-react-rspack/e2e/crossbind.spec.cjs +7 -0
  163. package/templates/web-react-rspack/index.html +11 -0
  164. package/templates/web-react-rspack/package.json +44 -0
  165. package/templates/web-react-rspack/playwright.dev.config.cjs +48 -0
  166. package/templates/web-react-rspack/playwright.prod.config.cjs +52 -0
  167. package/templates/web-react-rspack/rspack.config.mjs +78 -0
  168. package/templates/web-react-rspack/src/App.css +41 -0
  169. package/templates/web-react-rspack/src/App.jsx +19 -0
  170. package/templates/web-react-rspack/src/index.css +70 -0
  171. package/templates/web-react-rspack/src/main.jsx +10 -0
  172. package/templates/web-react-rspack/src/native/native.cpp +9 -0
  173. package/templates/web-react-rspack/src/native/native.h +12 -0
  174. package/templates/web-react-vite/CHANGELOG.md +34 -0
  175. package/templates/web-react-vite/README.md +38 -0
  176. package/templates/web-react-vite/crossbind.config.js +13 -0
  177. package/templates/web-react-vite/e2e/crossbind.spec.cjs +7 -0
  178. package/templates/web-react-vite/eslint.config.js +38 -0
  179. package/templates/web-react-vite/index.html +13 -0
  180. package/templates/web-react-vite/package.json +44 -0
  181. package/templates/web-react-vite/playwright.dev.config.cjs +48 -0
  182. package/templates/web-react-vite/playwright.prod.config.cjs +52 -0
  183. package/templates/web-react-vite/public/vite.svg +1 -0
  184. package/templates/web-react-vite/src/App.css +42 -0
  185. package/templates/web-react-vite/src/App.jsx +21 -0
  186. package/templates/web-react-vite/src/assets/react.svg +1 -0
  187. package/templates/web-react-vite/src/index.css +68 -0
  188. package/templates/web-react-vite/src/main.jsx +10 -0
  189. package/templates/web-react-vite/src/native/native.cpp +9 -0
  190. package/templates/web-react-vite/src/native/native.h +12 -0
  191. package/templates/web-react-vite/vite.config.js +8 -0
  192. package/templates/web-svelte-vite/CHANGELOG.md +34 -0
  193. package/templates/web-svelte-vite/README.md +38 -0
  194. package/templates/web-svelte-vite/crossbind.config.js +13 -0
  195. package/templates/web-svelte-vite/e2e/crossbind.spec.cjs +7 -0
  196. package/templates/web-svelte-vite/index.html +13 -0
  197. package/templates/web-svelte-vite/jsconfig.json +32 -0
  198. package/templates/web-svelte-vite/package.json +35 -0
  199. package/templates/web-svelte-vite/playwright.dev.config.cjs +48 -0
  200. package/templates/web-svelte-vite/playwright.prod.config.cjs +52 -0
  201. package/templates/web-svelte-vite/public/vite.svg +1 -0
  202. package/templates/web-svelte-vite/src/App.svelte +12 -0
  203. package/templates/web-svelte-vite/src/app.css +79 -0
  204. package/templates/web-svelte-vite/src/main.js +9 -0
  205. package/templates/web-svelte-vite/src/native/native.cpp +9 -0
  206. package/templates/web-svelte-vite/src/native/native.h +12 -0
  207. package/templates/web-svelte-vite/src/vite-env.d.ts +2 -0
  208. package/templates/web-svelte-vite/svelte.config.js +7 -0
  209. package/templates/web-svelte-vite/vite.config.js +8 -0
  210. package/templates/web-vanilla/CHANGELOG.md +34 -0
  211. package/templates/web-vanilla/README.md +32 -0
  212. package/templates/web-vanilla/crossbind.config.mjs +14 -0
  213. package/templates/web-vanilla/e2e/crossbind.spec.cjs +7 -0
  214. package/templates/web-vanilla/index.html +37 -0
  215. package/templates/web-vanilla/package.json +29 -0
  216. package/templates/web-vanilla/playwright.prod.config.cjs +52 -0
  217. package/templates/web-vanilla/serve.json +17 -0
  218. package/templates/web-vanilla/src/native/native.cpp +9 -0
  219. package/templates/web-vanilla/src/native/native.h +12 -0
  220. package/templates/web-vue-vite/CHANGELOG.md +34 -0
  221. package/templates/web-vue-vite/README.md +38 -0
  222. package/templates/web-vue-vite/crossbind.config.js +13 -0
  223. package/templates/web-vue-vite/e2e/crossbind.spec.cjs +7 -0
  224. package/templates/web-vue-vite/index.html +13 -0
  225. package/templates/web-vue-vite/package.json +35 -0
  226. package/templates/web-vue-vite/playwright.dev.config.cjs +48 -0
  227. package/templates/web-vue-vite/playwright.prod.config.cjs +52 -0
  228. package/templates/web-vue-vite/public/vite.svg +1 -0
  229. package/templates/web-vue-vite/serve.json +17 -0
  230. package/templates/web-vue-vite/src/App.vue +14 -0
  231. package/templates/web-vue-vite/src/main.js +5 -0
  232. package/templates/web-vue-vite/src/native/native.cpp +9 -0
  233. package/templates/web-vue-vite/src/native/native.h +12 -0
  234. package/templates/web-vue-vite/src/style.css +38 -0
  235. package/templates/web-vue-vite/vite.config.js +18 -0
@@ -0,0 +1,79 @@
1
+ :root {
2
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
3
+ line-height: 1.5;
4
+ font-weight: 400;
5
+
6
+ color-scheme: light dark;
7
+ color: rgba(255, 255, 255, 0.87);
8
+ background-color: #242424;
9
+
10
+ font-synthesis: none;
11
+ text-rendering: optimizeLegibility;
12
+ -webkit-font-smoothing: antialiased;
13
+ -moz-osx-font-smoothing: grayscale;
14
+ }
15
+
16
+ a {
17
+ font-weight: 500;
18
+ color: #646cff;
19
+ text-decoration: inherit;
20
+ }
21
+ a:hover {
22
+ color: #535bf2;
23
+ }
24
+
25
+ body {
26
+ margin: 0;
27
+ display: flex;
28
+ place-items: center;
29
+ min-width: 320px;
30
+ min-height: 100vh;
31
+ }
32
+
33
+ h1 {
34
+ font-size: 3.2em;
35
+ line-height: 1.1;
36
+ }
37
+
38
+ .card {
39
+ padding: 2em;
40
+ }
41
+
42
+ #app {
43
+ max-width: 1280px;
44
+ margin: 0 auto;
45
+ padding: 2rem;
46
+ text-align: center;
47
+ }
48
+
49
+ button {
50
+ border-radius: 8px;
51
+ border: 1px solid transparent;
52
+ padding: 0.6em 1.2em;
53
+ font-size: 1em;
54
+ font-weight: 500;
55
+ font-family: inherit;
56
+ background-color: #1a1a1a;
57
+ cursor: pointer;
58
+ transition: border-color 0.25s;
59
+ }
60
+ button:hover {
61
+ border-color: #646cff;
62
+ }
63
+ button:focus,
64
+ button:focus-visible {
65
+ outline: 4px auto -webkit-focus-ring-color;
66
+ }
67
+
68
+ @media (prefers-color-scheme: light) {
69
+ :root {
70
+ color: #213547;
71
+ background-color: #ffffff;
72
+ }
73
+ a:hover {
74
+ color: #747bff;
75
+ }
76
+ button {
77
+ background-color: #f9f9f9;
78
+ }
79
+ }
@@ -0,0 +1,9 @@
1
+ import { mount } from 'svelte'
2
+ import './app.css'
3
+ import App from './App.svelte'
4
+
5
+ const app = mount(App, {
6
+ target: document.getElementById('app'),
7
+ })
8
+
9
+ export default app
@@ -0,0 +1,9 @@
1
+ #include "native.h"
2
+ #include <Matrix.h>
3
+
4
+ std::string Native::sample() {
5
+ auto firstMatrix = std::make_shared<Matrix>(9, 1);
6
+ auto secondMatrix = std::make_shared<Matrix>(9, 2);
7
+ auto resultStr = std::to_string(firstMatrix->multiple(secondMatrix)->get(0));
8
+ return "J₃ * (2*J₃) = " + resultStr + "*J₃";
9
+ }
@@ -0,0 +1,12 @@
1
+ #ifndef _NATIVE_H
2
+ #define _NATIVE_H
3
+
4
+ #include <string>
5
+ #include <memory>
6
+
7
+ class Native {
8
+ public:
9
+ static std::string sample();
10
+ };
11
+
12
+ #endif
@@ -0,0 +1,2 @@
1
+ /// <reference types="svelte" />
2
+ /// <reference types="vite/client" />
@@ -0,0 +1,7 @@
1
+ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'
2
+
3
+ export default {
4
+ // Consult https://svelte.dev/docs#compile-time-svelte-preprocess
5
+ // for more information about preprocessors
6
+ preprocess: vitePreprocess(),
7
+ }
@@ -0,0 +1,8 @@
1
+ import { defineConfig } from 'vite';
2
+ import { svelte } from '@sveltejs/vite-plugin-svelte';
3
+ import viteCrossbindPlugin from '@crossbind/plugin-vite';
4
+
5
+ // https://vitejs.dev/config/
6
+ export default defineConfig({
7
+ plugins: [svelte(), viteCrossbindPlugin()],
8
+ });
@@ -0,0 +1,34 @@
1
+ # @crossbind/example-web-vanilla
2
+
3
+ ## 2.0.0-beta.50
4
+
5
+ ### Patch Changes
6
+
7
+ - Aligned on the 2.0.0-beta.50 baseline. No source change; the version exists so every package in
8
+ the workspace names the same release.
9
+
10
+ ## 1.0.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+ - crossbind@1.0.4
16
+
17
+ ## 1.0.0
18
+
19
+ ### Major Changes
20
+
21
+ - 🚀 first stable release
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+ - @crossbind/example-lib-prebuilt-matrix@1.0.0
27
+
28
+ ## 1.0.0-beta.13
29
+
30
+ ### Patch Changes
31
+
32
+ - chore: add initial version of CHANGELOGS files
33
+ - Updated dependencies
34
+ - @crossbind/example-lib-prebuilt-matrix@1.0.0-beta.32
@@ -0,0 +1,32 @@
1
+ # @crossbind/example-web-vanilla
2
+ **crossbind Web Vanilla sample**
3
+
4
+ <a href="https://www.npmjs.com/package/@crossbind/example-web-vanilla">
5
+ <img alt="NPM version" src="https://img.shields.io/npm/v/@crossbind/example-web-vanilla?style=for-the-badge" />
6
+ </a>
7
+ <a href="https://github.com/crossbind/crossbind/blob/main/LICENSE">
8
+ <img alt="License" src="https://img.shields.io/github/license/crossbind/crossbind?style=for-the-badge" />
9
+ </a>
10
+ <a href="https://crossbind.dev/docs/guide/integrate-into-existing-project/standalone">
11
+ <img alt="Docs - Standalone" src="https://img.shields.io/badge/Docs_-_Standalone-20B2AA?style=for-the-badge" />
12
+ </a>
13
+
14
+ # Getting Started
15
+
16
+ >**Note**: Make sure you have completed the [crossbind - Prerequisites](https://crossbind.dev/docs/guide/getting-started/prerequisites) instructions.
17
+
18
+ ## Setup
19
+
20
+ Install the dependencies:
21
+
22
+ ```bash
23
+ pnpm install
24
+ ```
25
+
26
+ ## Get Started
27
+
28
+ Build native code to webassembly:
29
+
30
+ ```bash
31
+ pnpm run build
32
+ ```
@@ -0,0 +1,14 @@
1
+ import Matrix from '@crossbind/example-lib-prebuilt-matrix/crossbind.config.js';
2
+
3
+ export default {
4
+ general: {
5
+ name: 'crossbind-example-web-vanilla',
6
+ },
7
+ dependencies: [
8
+ Matrix,
9
+ ],
10
+ paths: {
11
+ config: import.meta.url,
12
+ output: 'dist',
13
+ },
14
+ };
@@ -0,0 +1,7 @@
1
+ // @ts-check
2
+ const { test, expect } = require('@playwright/test');
3
+
4
+ test('check string receiving from c++', async ({ page }) => {
5
+ await page.goto('/')
6
+ await expect(page.getByText('Matrix multiplier with c++ => J₃ * (2*J₃) = 6*J₃')).toBeVisible()
7
+ });
@@ -0,0 +1,37 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+
5
+ <head>
6
+ <meta charset="utf-8">
7
+ <title>crossbind Vanilla sample</title>
8
+ <script src="./dist/crossbind-example-web-vanilla-wasm-wasm32-st-release.browser.js"></script>
9
+ <script>
10
+ initNative({ path: './dist' }).then(async ({ Native }) => {
11
+ document.querySelector('#cppMessage').innerHTML = await Native.sample();
12
+ });
13
+ </script>
14
+ <style>
15
+ body {
16
+ padding: 50px;
17
+ }
18
+
19
+ table,
20
+ th,
21
+ td {
22
+ border: 1px solid red;
23
+ border-collapse: collapse;
24
+ }
25
+
26
+ table {
27
+ width: 400px;
28
+ margin-top: 20px;
29
+ }
30
+ </style>
31
+ </head>
32
+
33
+ <body>
34
+ <p>Matrix multiplier with c++ &nbsp;&nbsp;=&gt;&nbsp;&nbsp; <span id="cppMessage">compiling ...</span></p>
35
+ </body>
36
+
37
+ </html>
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@crossbind/example-web-vanilla",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "description": "crossbind Web Vanilla sample",
6
+ "homepage": "https://github.com/crossbind/crossbind/tree/main/examples/web-vanilla#readme",
7
+ "repository": "https://github.com/crossbind/crossbind.git",
8
+ "license": "MIT",
9
+ "scripts": {
10
+ "build": "crossbind build -p wasm -a wasm32 -r st -e browser -b release",
11
+ "preview": "serve -c ./serve.json",
12
+ "e2e:prod": "playwright test --config playwright.prod.config.cjs"
13
+ },
14
+ "dependencies": {
15
+ "@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.50"
16
+ },
17
+ "devDependencies": {
18
+ "crossbind": "^2.0.0-beta.51",
19
+ "serve": "^14.2.6",
20
+ "@playwright/test": "^1.62.1"
21
+ },
22
+ "keywords": [
23
+ "crossbind-sample",
24
+ "webassembly",
25
+ "bind",
26
+ "c++",
27
+ "vanilla"
28
+ ]
29
+ }
@@ -0,0 +1,52 @@
1
+ // @ts-check
2
+ const { defineConfig, devices } = require('@playwright/test');
3
+
4
+ /**
5
+ * @see https://playwright.dev/docs/test-configuration
6
+ */
7
+ // CROSSBIND_E2E_PORT lets sequential/parallel e2e runs give each project a unique free
8
+ // port (avoids teardown races on the shared default).
9
+ const port = process.env.CROSSBIND_E2E_PORT || '3000';
10
+
11
+ module.exports = defineConfig({
12
+ testDir: './e2e',
13
+ timeout: 30 * 1000,
14
+ expect: {
15
+ timeout: 50000,
16
+ },
17
+ fullyParallel: true,
18
+ forbidOnly: !!process.env.CI,
19
+ retries: process.env.CI ? 2 : 0,
20
+ workers: process.env.CI ? 1 : undefined,
21
+
22
+ reporter: 'html',
23
+
24
+ use: {
25
+ baseURL: `http://localhost:${port}`,
26
+ trace: 'on-first-retry',
27
+ },
28
+
29
+ projects: [
30
+ {
31
+ name: 'chromium',
32
+ use: { ...devices['Desktop Chrome'] },
33
+ },
34
+
35
+ {
36
+ name: 'firefox',
37
+ use: { ...devices['Desktop Firefox'] },
38
+ },
39
+
40
+ {
41
+ name: 'webkit',
42
+ use: { ...devices['Desktop Safari'] },
43
+ },
44
+ ],
45
+
46
+ /* Run your local dev server before starting the tests */
47
+ webServer: {
48
+ command: `npx serve -c ./serve.json -l ${port}`,
49
+ url: `http://localhost:${port}`,
50
+ reuseExistingServer: !process.env.CI,
51
+ },
52
+ });
@@ -0,0 +1,17 @@
1
+ {
2
+ "headers": [
3
+ {
4
+ "source": "**/*",
5
+ "headers": [
6
+ {
7
+ "key": "Cross-Origin-Opener-Policy",
8
+ "value": "same-origin"
9
+ },
10
+ {
11
+ "key": "Cross-Origin-Embedder-Policy",
12
+ "value": "require-corp"
13
+ }
14
+ ]
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,9 @@
1
+ #include "native.h"
2
+ #include <Matrix.h>
3
+
4
+ std::string Native::sample() {
5
+ auto firstMatrix = std::make_shared<Matrix>(9, 1);
6
+ auto secondMatrix = std::make_shared<Matrix>(9, 2);
7
+ auto resultStr = std::to_string(firstMatrix->multiple(secondMatrix)->get(0));
8
+ return "J₃ * (2*J₃) = " + resultStr + "*J₃";
9
+ }
@@ -0,0 +1,12 @@
1
+ #ifndef _NATIVE_H
2
+ #define _NATIVE_H
3
+
4
+ #include <string>
5
+ #include <memory>
6
+
7
+ class Native {
8
+ public:
9
+ static std::string sample();
10
+ };
11
+
12
+ #endif
@@ -0,0 +1,34 @@
1
+ # @crossbind/example-web-vue-vite
2
+
3
+ ## 2.0.0-beta.50
4
+
5
+ ### Patch Changes
6
+
7
+ - Aligned on the 2.0.0-beta.50 baseline. No source change; the version exists so every package in
8
+ the workspace names the same release.
9
+
10
+ ## 1.0.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+ - @crossbind/plugin-vite@1.0.2
16
+
17
+ ## 1.0.0
18
+
19
+ ### Major Changes
20
+
21
+ - 🚀 first stable release
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies
26
+ - @crossbind/example-lib-prebuilt-matrix@1.0.0
27
+
28
+ ## 1.0.0-beta.12
29
+
30
+ ### Patch Changes
31
+
32
+ - chore: add initial version of CHANGELOGS files
33
+ - Updated dependencies
34
+ - @crossbind/example-lib-prebuilt-matrix@1.0.0-beta.32
@@ -0,0 +1,38 @@
1
+ # @crossbind/example-web-vue-vite
2
+ **crossbind Vue Vite sample**
3
+
4
+ <a href="https://www.npmjs.com/package/@crossbind/example-web-vue-vite">
5
+ <img alt="NPM version" src="https://img.shields.io/npm/v/@crossbind/example-web-vue-vite?style=for-the-badge" />
6
+ </a>
7
+ <a href="https://github.com/crossbind/crossbind/blob/main/LICENSE">
8
+ <img alt="License" src="https://img.shields.io/github/license/crossbind/crossbind?style=for-the-badge" />
9
+ </a>
10
+ <a href="https://crossbind.dev/docs/guide/integrate-into-existing-project/vite">
11
+ <img alt="Docs - Vite" src="https://img.shields.io/badge/Docs_-_Vite-20B2AA?style=for-the-badge" />
12
+ </a>
13
+
14
+ # Getting Started
15
+
16
+ >**Note**: Make sure you have completed the [crossbind - Prerequisites](https://crossbind.dev/docs/guide/getting-started/prerequisites) instructions.
17
+
18
+ ## Setup
19
+
20
+ Install the dependencies:
21
+
22
+ ```bash
23
+ pnpm install
24
+ ```
25
+
26
+ ## Get Started
27
+
28
+ Start the dev server:
29
+
30
+ ```bash
31
+ pnpm run dev
32
+ ```
33
+
34
+ Build the app for production:
35
+
36
+ ```bash
37
+ pnpm run build
38
+ ```
@@ -0,0 +1,13 @@
1
+ import Matrix from '@crossbind/example-lib-prebuilt-matrix/crossbind.config.js';
2
+
3
+ export default {
4
+ general: {
5
+ name: 'crossbind-example-web-vue-vite',
6
+ },
7
+ dependencies: [
8
+ Matrix,
9
+ ],
10
+ paths: {
11
+ config: import.meta.url,
12
+ },
13
+ };
@@ -0,0 +1,7 @@
1
+ // @ts-check
2
+ const { test, expect } = require('@playwright/test');
3
+
4
+ test('check string receiving from c++', async ({ page }) => {
5
+ await page.goto('/')
6
+ await expect(page.getByText('Matrix multiplier with c++ => J₃ * (2*J₃) = 6*J₃')).toBeVisible()
7
+ });
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <link rel="icon" href="/favicon.ico">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>crossbind + Vite + Vue 3</title>
8
+ </head>
9
+ <body>
10
+ <div id="app"></div>
11
+ <script type="module" src="/src/main.js"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@crossbind/example-web-vue-vite",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "description": "crossbind Vue Vite sample",
6
+ "homepage": "https://github.com/crossbind/crossbind/tree/main/examples/web-vue-vite#readme",
7
+ "repository": "https://github.com/crossbind/crossbind.git",
8
+ "license": "MIT",
9
+ "type": "module",
10
+ "scripts": {
11
+ "dev": "vite",
12
+ "build": "vite build",
13
+ "preview": "vite preview",
14
+ "e2e:dev": "playwright test --config playwright.dev.config.cjs",
15
+ "e2e:prod": "playwright test --config playwright.prod.config.cjs"
16
+ },
17
+ "dependencies": {
18
+ "vue": "^3.5.41",
19
+ "@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.50"
20
+ },
21
+ "devDependencies": {
22
+ "@vitejs/plugin-vue": "^6.0.8",
23
+ "vite": "^8.2.1",
24
+ "@playwright/test": "^1.62.1",
25
+ "@crossbind/plugin-vite": "^2.0.0-beta.50"
26
+ },
27
+ "keywords": [
28
+ "crossbind-sample",
29
+ "webassembly",
30
+ "bind",
31
+ "c++",
32
+ "vue",
33
+ "vite"
34
+ ]
35
+ }
@@ -0,0 +1,48 @@
1
+ // @ts-check
2
+ const { defineConfig, devices } = require('@playwright/test');
3
+
4
+ /**
5
+ * @see https://playwright.dev/docs/test-configuration
6
+ */
7
+ module.exports = defineConfig({
8
+ testDir: './e2e',
9
+ timeout: 30 * 1000,
10
+ expect: {
11
+ timeout: 50000,
12
+ },
13
+ fullyParallel: true,
14
+ forbidOnly: !!process.env.CI,
15
+ retries: process.env.CI ? 2 : 0,
16
+ workers: process.env.CI ? 1 : undefined,
17
+
18
+ reporter: 'html',
19
+
20
+ use: {
21
+ baseURL: 'http://localhost:5173',
22
+ trace: 'on-first-retry',
23
+ },
24
+
25
+ projects: [
26
+ {
27
+ name: 'chromium',
28
+ use: { ...devices['Desktop Chrome'] },
29
+ },
30
+
31
+ {
32
+ name: 'firefox',
33
+ use: { ...devices['Desktop Firefox'] },
34
+ },
35
+
36
+ {
37
+ name: 'webkit',
38
+ use: { ...devices['Desktop Safari'] },
39
+ },
40
+ ],
41
+
42
+ /* Run your local dev server before starting the tests */
43
+ webServer: {
44
+ command: 'pnpm run dev',
45
+ url: 'http://localhost:5173',
46
+ reuseExistingServer: !process.env.CI,
47
+ },
48
+ });
@@ -0,0 +1,52 @@
1
+ // @ts-check
2
+ const { defineConfig, devices } = require('@playwright/test');
3
+
4
+ /**
5
+ * @see https://playwright.dev/docs/test-configuration
6
+ */
7
+ // CROSSBIND_E2E_PORT lets sequential/parallel e2e runs give each project a unique free
8
+ // port (avoids teardown races on the shared default).
9
+ const port = process.env.CROSSBIND_E2E_PORT || '4173';
10
+
11
+ module.exports = defineConfig({
12
+ testDir: './e2e',
13
+ timeout: 30 * 1000,
14
+ expect: {
15
+ timeout: 50000,
16
+ },
17
+ fullyParallel: true,
18
+ forbidOnly: !!process.env.CI,
19
+ retries: process.env.CI ? 2 : 0,
20
+ workers: process.env.CI ? 1 : undefined,
21
+
22
+ reporter: 'html',
23
+
24
+ use: {
25
+ baseURL: `http://localhost:${port}`,
26
+ trace: 'on-first-retry',
27
+ },
28
+
29
+ projects: [
30
+ {
31
+ name: 'chromium',
32
+ use: { ...devices['Desktop Chrome'] },
33
+ },
34
+
35
+ {
36
+ name: 'firefox',
37
+ use: { ...devices['Desktop Firefox'] },
38
+ },
39
+
40
+ {
41
+ name: 'webkit',
42
+ use: { ...devices['Desktop Safari'] },
43
+ },
44
+ ],
45
+
46
+ /* Run your local dev server before starting the tests */
47
+ webServer: {
48
+ command: `npx vite preview --port ${port} --strictPort`,
49
+ url: `http://localhost:${port}`,
50
+ reuseExistingServer: !process.env.CI,
51
+ },
52
+ });
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
@@ -0,0 +1,17 @@
1
+ {
2
+ "headers": [
3
+ {
4
+ "source" : "*",
5
+ "headers" : [
6
+ {
7
+ "key" : "Cross-Origin-Opener-Policy",
8
+ "value" : "same-origin"
9
+ },
10
+ {
11
+ "key" : "Cross-Origin-Embedder-Policy",
12
+ "value" : "require-corp"
13
+ }
14
+ ]
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,14 @@
1
+ <script setup>
2
+ import { ref } from 'vue'
3
+ import { initNative, Native } from './native/native.h'
4
+
5
+ const message = ref("compiling ...")
6
+
7
+ initNative().then(async () => {
8
+ message.value = await Native.sample();
9
+ });
10
+ </script>
11
+
12
+ <template>
13
+ <p>Matrix multiplier with c++ &nbsp;&nbsp;=&gt;&nbsp;&nbsp; {{message}}</p>
14
+ </template>