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,44 @@
1
+ {
2
+ "name": "@crossbind/example-web-react-vite",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "description": "crossbind React Vite sample",
6
+ "homepage": "https://github.com/crossbind/crossbind/tree/main/examples/web-react-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
+ "lint": "eslint .",
14
+ "preview": "vite preview",
15
+ "e2e:dev": "playwright test --config playwright.dev.config.cjs",
16
+ "e2e:prod": "playwright test --config playwright.prod.config.cjs"
17
+ },
18
+ "dependencies": {
19
+ "react": "^19.2.8",
20
+ "react-dom": "^19.2.8",
21
+ "@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.50"
22
+ },
23
+ "devDependencies": {
24
+ "@eslint/js": "^10.0.1",
25
+ "@types/react": "^19.2.18",
26
+ "@types/react-dom": "^19.2.4",
27
+ "@vitejs/plugin-react": "^6.0.5",
28
+ "eslint": "^10.8.1",
29
+ "eslint-plugin-react-hooks": "^7.1.1",
30
+ "eslint-plugin-react-refresh": "^0.5.3",
31
+ "globals": "^17.9.0",
32
+ "vite": "^8.2.1",
33
+ "@playwright/test": "^1.62.1",
34
+ "@crossbind/plugin-vite": "^2.0.0-beta.50"
35
+ },
36
+ "keywords": [
37
+ "crossbind-sample",
38
+ "webassembly",
39
+ "bind",
40
+ "c++",
41
+ "react",
42
+ "vite"
43
+ ]
44
+ }
@@ -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,42 @@
1
+ #root {
2
+ max-width: 1280px;
3
+ margin: 0 auto;
4
+ padding: 2rem;
5
+ text-align: center;
6
+ }
7
+
8
+ .logo {
9
+ height: 6em;
10
+ padding: 1.5em;
11
+ will-change: filter;
12
+ transition: filter 300ms;
13
+ }
14
+ .logo:hover {
15
+ filter: drop-shadow(0 0 2em #646cffaa);
16
+ }
17
+ .logo.react:hover {
18
+ filter: drop-shadow(0 0 2em #61dafbaa);
19
+ }
20
+
21
+ @keyframes logo-spin {
22
+ from {
23
+ transform: rotate(0deg);
24
+ }
25
+ to {
26
+ transform: rotate(360deg);
27
+ }
28
+ }
29
+
30
+ @media (prefers-reduced-motion: no-preference) {
31
+ a:nth-of-type(2) .logo {
32
+ animation: logo-spin infinite 20s linear;
33
+ }
34
+ }
35
+
36
+ .card {
37
+ padding: 2em;
38
+ }
39
+
40
+ .read-the-docs {
41
+ color: #888;
42
+ }
@@ -0,0 +1,21 @@
1
+ import { useState, useEffect } from 'react'
2
+ import './App.css'
3
+ import { initNative, Native } from './native/native.h'
4
+
5
+ function App() {
6
+ const [message, setMessage] = useState('compiling ...')
7
+
8
+ useEffect(() => {
9
+ initNative().then(async () => {
10
+ setMessage(await Native.sample());
11
+ });
12
+ }, []);
13
+
14
+ return (
15
+ <>
16
+ <p>Matrix multiplier with c++ &nbsp;&nbsp;=&gt;&nbsp;&nbsp; {message}</p>
17
+ </>
18
+ )
19
+ }
20
+
21
+ export default App
@@ -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="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.273-5.621c6.238-30.281 2.16-54.676-11.769-62.708c-13.355-7.7-35.196.329-57.254 19.526a171.23 171.23 0 0 0-6.375 5.848a155.866 155.866 0 0 0-4.241-3.917C100.759 3.829 77.587-4.822 63.673 3.233C50.33 10.957 46.379 33.89 51.995 62.588a170.974 170.974 0 0 0 1.892 8.48c-3.28.932-6.445 1.924-9.474 2.98C17.309 83.498 0 98.307 0 113.668c0 15.865 18.582 31.778 46.812 41.427a145.52 145.52 0 0 0 6.921 2.165a167.467 167.467 0 0 0-2.01 9.138c-5.354 28.2-1.173 50.591 12.134 58.266c13.744 7.926 36.812-.22 59.273-19.855a145.567 145.567 0 0 0 5.342-4.923a168.064 168.064 0 0 0 6.92 6.314c21.758 18.722 43.246 26.282 56.54 18.586c13.731-7.949 18.194-32.003 12.4-61.268a145.016 145.016 0 0 0-1.535-6.842c1.62-.48 3.21-.974 4.76-1.488c29.348-9.723 48.443-25.443 48.443-41.52c0-15.417-17.868-30.326-45.517-39.844Zm-6.365 70.984c-1.4.463-2.836.91-4.3 1.345c-3.24-10.257-7.612-21.163-12.963-32.432c5.106-11 9.31-21.767 12.459-31.957c2.619.758 5.16 1.557 7.61 2.4c23.69 8.156 38.14 20.213 38.14 29.504c0 9.896-15.606 22.743-40.946 31.14Zm-10.514 20.834c2.562 12.94 2.927 24.64 1.23 33.787c-1.524 8.219-4.59 13.698-8.382 15.893c-8.067 4.67-25.32-1.4-43.927-17.412a156.726 156.726 0 0 1-6.437-5.87c7.214-7.889 14.423-17.06 21.459-27.246c12.376-1.098 24.068-2.894 34.671-5.345a134.17 134.17 0 0 1 1.386 6.193ZM87.276 214.515c-7.882 2.783-14.16 2.863-17.955.675c-8.075-4.657-11.432-22.636-6.853-46.752a156.923 156.923 0 0 1 1.869-8.499c10.486 2.32 22.093 3.988 34.498 4.994c7.084 9.967 14.501 19.128 21.976 27.15a134.668 134.668 0 0 1-4.877 4.492c-9.933 8.682-19.886 14.842-28.658 17.94ZM50.35 144.747c-12.483-4.267-22.792-9.812-29.858-15.863c-6.35-5.437-9.555-10.836-9.555-15.216c0-9.322 13.897-21.212 37.076-29.293c2.813-.98 5.757-1.905 8.812-2.773c3.204 10.42 7.406 21.315 12.477 32.332c-5.137 11.18-9.399 22.249-12.634 32.792a134.718 134.718 0 0 1-6.318-1.979Zm12.378-84.26c-4.811-24.587-1.616-43.134 6.425-47.789c8.564-4.958 27.502 2.111 47.463 19.835a144.318 144.318 0 0 1 3.841 3.545c-7.438 7.987-14.787 17.08-21.808 26.988c-12.04 1.116-23.565 2.908-34.161 5.309a160.342 160.342 0 0 1-1.76-7.887Zm110.427 27.268a347.8 347.8 0 0 0-7.785-12.803c8.168 1.033 15.994 2.404 23.343 4.08c-2.206 7.072-4.956 14.465-8.193 22.045a381.151 381.151 0 0 0-7.365-13.322Zm-45.032-43.861c5.044 5.465 10.096 11.566 15.065 18.186a322.04 322.04 0 0 0-30.257-.006c4.974-6.559 10.069-12.652 15.192-18.18ZM82.802 87.83a323.167 323.167 0 0 0-7.227 13.238c-3.184-7.553-5.909-14.98-8.134-22.152c7.304-1.634 15.093-2.97 23.209-3.984a321.524 321.524 0 0 0-7.848 12.897Zm8.081 65.352c-8.385-.936-16.291-2.203-23.593-3.793c2.26-7.3 5.045-14.885 8.298-22.6a321.187 321.187 0 0 0 7.257 13.246c2.594 4.48 5.28 8.868 8.038 13.147Zm37.542 31.03c-5.184-5.592-10.354-11.779-15.403-18.433c4.902.192 9.899.29 14.978.29c5.218 0 10.376-.117 15.453-.343c-4.985 6.774-10.018 12.97-15.028 18.486Zm52.198-57.817c3.422 7.8 6.306 15.345 8.596 22.52c-7.422 1.694-15.436 3.058-23.88 4.071a382.417 382.417 0 0 0 7.859-13.026a347.403 347.403 0 0 0 7.425-13.565Zm-16.898 8.101a358.557 358.557 0 0 1-12.281 19.815a329.4 329.4 0 0 1-23.444.823c-7.967 0-15.716-.248-23.178-.732a310.202 310.202 0 0 1-12.513-19.846h.001a307.41 307.41 0 0 1-10.923-20.627a310.278 310.278 0 0 1 10.89-20.637l-.001.001a307.318 307.318 0 0 1 12.413-19.761c7.613-.576 15.42-.876 23.31-.876H128c7.926 0 15.743.303 23.354.883a329.357 329.357 0 0 1 12.335 19.695a358.489 358.489 0 0 1 11.036 20.54a329.472 329.472 0 0 1-11 20.722Zm22.56-122.124c8.572 4.944 11.906 24.881 6.52 51.026c-.344 1.668-.73 3.367-1.15 5.09c-10.622-2.452-22.155-4.275-34.23-5.408c-7.034-10.017-14.323-19.124-21.64-27.008a160.789 160.789 0 0 1 5.888-5.4c18.9-16.447 36.564-22.941 44.612-18.3ZM128 90.808c12.625 0 22.86 10.235 22.86 22.86s-10.235 22.86-22.86 22.86s-22.86-10.235-22.86-22.86s10.235-22.86 22.86-22.86Z"></path></svg>
@@ -0,0 +1,68 @@
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
+ button {
39
+ border-radius: 8px;
40
+ border: 1px solid transparent;
41
+ padding: 0.6em 1.2em;
42
+ font-size: 1em;
43
+ font-weight: 500;
44
+ font-family: inherit;
45
+ background-color: #1a1a1a;
46
+ cursor: pointer;
47
+ transition: border-color 0.25s;
48
+ }
49
+ button:hover {
50
+ border-color: #646cff;
51
+ }
52
+ button:focus,
53
+ button:focus-visible {
54
+ outline: 4px auto -webkit-focus-ring-color;
55
+ }
56
+
57
+ @media (prefers-color-scheme: light) {
58
+ :root {
59
+ color: #213547;
60
+ background-color: #ffffff;
61
+ }
62
+ a:hover {
63
+ color: #747bff;
64
+ }
65
+ button {
66
+ background-color: #f9f9f9;
67
+ }
68
+ }
@@ -0,0 +1,10 @@
1
+ import { StrictMode } from 'react'
2
+ import { createRoot } from 'react-dom/client'
3
+ import App from './App.jsx'
4
+ import './index.css'
5
+
6
+ createRoot(document.getElementById('root')).render(
7
+ <StrictMode>
8
+ <App />
9
+ </StrictMode>,
10
+ )
@@ -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,8 @@
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react'
3
+ import viteCrossbindPlugin from '@crossbind/plugin-vite'
4
+
5
+ // https://vitejs.dev/config/
6
+ export default defineConfig({
7
+ plugins: [react(), viteCrossbindPlugin()],
8
+ })
@@ -0,0 +1,34 @@
1
+ # @crossbind/example-web-svelte-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-svelte-vite
2
+ **crossbind Svelte Vite sample**
3
+
4
+ <a href="https://www.npmjs.com/package/@crossbind/example-web-svelte-vite">
5
+ <img alt="NPM version" src="https://img.shields.io/npm/v/@crossbind/example-web-svelte-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-svelte-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" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Vite + Svelte</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,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "moduleResolution": "bundler",
4
+ "target": "ESNext",
5
+ "module": "ESNext",
6
+ /**
7
+ * svelte-preprocess cannot figure out whether you have
8
+ * a value or a type, so tell TypeScript to enforce using
9
+ * `import type` instead of `import` for Types.
10
+ */
11
+ "verbatimModuleSyntax": true,
12
+ "isolatedModules": true,
13
+ "resolveJsonModule": true,
14
+ /**
15
+ * To have warnings / errors of the Svelte compiler at the
16
+ * correct position, enable source maps by default.
17
+ */
18
+ "sourceMap": true,
19
+ "esModuleInterop": true,
20
+ "skipLibCheck": true,
21
+ /**
22
+ * Typecheck JS in `.svelte` and `.js` files by default.
23
+ * Disable this if you'd like to use dynamic types.
24
+ */
25
+ "checkJs": true
26
+ },
27
+ /**
28
+ * Use global.d.ts instead of compilerOptions.types
29
+ * to avoid limiting type declarations.
30
+ */
31
+ "include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.svelte"]
32
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@crossbind/example-web-svelte-vite",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "description": "crossbind Svelte Vite sample",
6
+ "homepage": "https://github.com/crossbind/crossbind/tree/main/examples/web-svelte-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
+ "@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.50"
19
+ },
20
+ "devDependencies": {
21
+ "@sveltejs/vite-plugin-svelte": "^7.3.0",
22
+ "svelte": "^5.56.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
+ "svelte",
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,12 @@
1
+ <script>
2
+ import { initNative, Native } from './native/native.h';
3
+
4
+ let message = 'compiling ...';
5
+ initNative().then(async () => {
6
+ message = await Native.sample();
7
+ });
8
+ </script>
9
+
10
+ <main>
11
+ <p>Matrix multiplier with c++ &nbsp;&nbsp;=&gt;&nbsp;&nbsp; {message}</p>
12
+ </main>