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.
- package/LICENSE +21 -0
- package/README.md +63 -0
- package/package.json +47 -0
- package/src/index.js +182 -0
- package/src/manifest.json +14 -0
- package/src/utils.js +8 -0
- package/templates/backend-nodejs-wasm/CHANGELOG.md +34 -0
- package/templates/backend-nodejs-wasm/README.md +32 -0
- package/templates/backend-nodejs-wasm/crossbind.config.mjs +14 -0
- package/templates/backend-nodejs-wasm/package.json +25 -0
- package/templates/backend-nodejs-wasm/src/index.js +5 -0
- package/templates/backend-nodejs-wasm/src/index.mjs +5 -0
- package/templates/backend-nodejs-wasm/src/native/native.cpp +9 -0
- package/templates/backend-nodejs-wasm/src/native/native.h +12 -0
- package/templates/cloud-cloudflare-worker/CHANGELOG.md +27 -0
- package/templates/cloud-cloudflare-worker/Readme.md +46 -0
- package/templates/cloud-cloudflare-worker/crossbind.config.mjs +9 -0
- package/templates/cloud-cloudflare-worker/e2e/crossbind.spec.cjs +7 -0
- package/templates/cloud-cloudflare-worker/index.js +10 -0
- package/templates/cloud-cloudflare-worker/package.json +38 -0
- package/templates/cloud-cloudflare-worker/playwright.dev.config.cjs +48 -0
- package/templates/cloud-cloudflare-worker/src/native/native.cpp +5 -0
- package/templates/cloud-cloudflare-worker/src/native/native.h +11 -0
- package/templates/cloud-cloudflare-worker/wrangler.toml +3 -0
- package/templates/lib-cmake/CHANGELOG.md +20 -0
- package/templates/lib-cmake/CMakeLists.txt +16 -0
- package/templates/lib-cmake/README.md +51 -0
- package/templates/lib-cmake/crossbind.config.js +9 -0
- package/templates/lib-cmake/package.json +16 -0
- package/templates/lib-cmake/src/native/crossbind-lib-samplebasic-cmake/samplebasiccmake.h +11 -0
- package/templates/lib-cmake/src/native/samplebasiccmake.cpp +5 -0
- package/templates/lib-prebuilt/AGENTS.md +78 -0
- package/templates/lib-prebuilt/CHANGELOG.md +20 -0
- package/templates/lib-prebuilt/README.md +81 -0
- package/templates/lib-prebuilt/crossbind-example-lib-prebuilt-matrix.podspec +21 -0
- package/templates/lib-prebuilt/crossbind.config.js +13 -0
- package/templates/lib-prebuilt/package.json +36 -0
- package/templates/lib-prebuilt/playground/Matrix.js +19 -0
- package/templates/lib-prebuilt/playground/index.html +74 -0
- package/templates/lib-prebuilt/src/native/Matrix.cpp +17 -0
- package/templates/lib-prebuilt/src/native/Matrix.h +12 -0
- package/templates/lib-source/CHANGELOG.md +20 -0
- package/templates/lib-source/README.md +51 -0
- package/templates/lib-source/crossbind.config.js +8 -0
- package/templates/lib-source/package.json +12 -0
- package/templates/lib-source/src/native/crossbind-lib-samplebasic/samplebasic.h +13 -0
- package/templates/mobile-reactnative-cli/.bundle/config +2 -0
- package/templates/mobile-reactnative-cli/.eslintrc.js +4 -0
- package/templates/mobile-reactnative-cli/.prettierrc.js +7 -0
- package/templates/mobile-reactnative-cli/AGENTS.md +89 -0
- package/templates/mobile-reactnative-cli/CHANGELOG.md +38 -0
- package/templates/mobile-reactnative-cli/Gemfile +20 -0
- package/templates/mobile-reactnative-cli/README.md +55 -0
- package/templates/mobile-reactnative-cli/__tests__/App.test.tsx +13 -0
- package/templates/mobile-reactnative-cli/android/app/build.gradle +119 -0
- package/templates/mobile-reactnative-cli/android/app/debug.keystore +0 -0
- package/templates/mobile-reactnative-cli/android/app/proguard-rules.pro +10 -0
- package/templates/mobile-reactnative-cli/android/app/src/debug/AndroidManifest.xml +9 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/AndroidManifest.xml +27 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/java/dev/crossbind/sampleReactNativeCLI/MainActivity.kt +22 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/java/dev/crossbind/sampleReactNativeCLI/MainApplication.kt +27 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/values/strings.xml +3 -0
- package/templates/mobile-reactnative-cli/android/app/src/main/res/values/styles.xml +9 -0
- package/templates/mobile-reactnative-cli/android/build.gradle +21 -0
- package/templates/mobile-reactnative-cli/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/templates/mobile-reactnative-cli/android/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/templates/mobile-reactnative-cli/android/gradle.properties +44 -0
- package/templates/mobile-reactnative-cli/android/gradlew +248 -0
- package/templates/mobile-reactnative-cli/android/gradlew.bat +98 -0
- package/templates/mobile-reactnative-cli/android/settings.gradle +6 -0
- package/templates/mobile-reactnative-cli/app.json +4 -0
- package/templates/mobile-reactnative-cli/babel.config.js +3 -0
- package/templates/mobile-reactnative-cli/ci/crossbind-snapshot/cache.json +12 -0
- package/templates/mobile-reactnative-cli/crossbind.config.mjs +10 -0
- package/templates/mobile-reactnative-cli/index.js +9 -0
- package/templates/mobile-reactnative-cli/ios/.xcode.env +11 -0
- package/templates/mobile-reactnative-cli/ios/Podfile +42 -0
- package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI/AppDelegate.swift +48 -0
- package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI/Images.xcassets/Contents.json +6 -0
- package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI/Info.plist +60 -0
- package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI/LaunchScreen.storyboard +47 -0
- package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI/PrivacyInfo.xcprivacy +37 -0
- package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI.xcodeproj/project.pbxproj +494 -0
- package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI.xcodeproj/xcshareddata/xcschemes/crossbindSampleReactNativeCLI.xcscheme +88 -0
- package/templates/mobile-reactnative-cli/ios/crossbindSampleReactNativeCLI.xcworkspace/contents.xcworkspacedata +10 -0
- package/templates/mobile-reactnative-cli/jest.config.js +3 -0
- package/templates/mobile-reactnative-cli/maestro.yaml +4 -0
- package/templates/mobile-reactnative-cli/metro.config.js +17 -0
- package/templates/mobile-reactnative-cli/package.json +68 -0
- package/templates/mobile-reactnative-cli/src/App.tsx +53 -0
- package/templates/mobile-reactnative-cli/src/native/native.cpp +9 -0
- package/templates/mobile-reactnative-cli/src/native/native.h +12 -0
- package/templates/mobile-reactnative-cli/tsconfig.json +16 -0
- package/templates/mobile-reactnative-expo/README.md +34 -0
- package/templates/mobile-reactnative-expo/app.json +51 -0
- package/templates/mobile-reactnative-expo/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/templates/mobile-reactnative-expo/assets/expo.icon/Assets/grid.png +0 -0
- package/templates/mobile-reactnative-expo/assets/expo.icon/icon.json +40 -0
- package/templates/mobile-reactnative-expo/assets/images/android-icon-background.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/android-icon-foreground.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/android-icon-monochrome.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/expo-badge-white.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/expo-badge.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/expo-logo.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/favicon.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/icon.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/logo-glow.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/react-logo.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/react-logo@2x.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/react-logo@3x.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/splash-icon.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/tabIcons/explore.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/tabIcons/explore@2x.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/tabIcons/explore@3x.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/tabIcons/home.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/tabIcons/home@2x.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/tabIcons/home@3x.png +0 -0
- package/templates/mobile-reactnative-expo/assets/images/tutorial-web.png +0 -0
- package/templates/mobile-reactnative-expo/crossbind.config.mjs +10 -0
- package/templates/mobile-reactnative-expo/maestro.yaml +4 -0
- package/templates/mobile-reactnative-expo/metro.config.js +13 -0
- package/templates/mobile-reactnative-expo/package-lock.json +9433 -0
- package/templates/mobile-reactnative-expo/package.json +82 -0
- package/templates/mobile-reactnative-expo/scripts/reset-project.js +113 -0
- package/templates/mobile-reactnative-expo/src/app/_layout.tsx +16 -0
- package/templates/mobile-reactnative-expo/src/app/explore.tsx +181 -0
- package/templates/mobile-reactnative-expo/src/app/index.tsx +110 -0
- package/templates/mobile-reactnative-expo/src/components/animated-icon.module.css +6 -0
- package/templates/mobile-reactnative-expo/src/components/animated-icon.tsx +132 -0
- package/templates/mobile-reactnative-expo/src/components/animated-icon.web.tsx +108 -0
- package/templates/mobile-reactnative-expo/src/components/app-tabs.tsx +33 -0
- package/templates/mobile-reactnative-expo/src/components/app-tabs.web.tsx +116 -0
- package/templates/mobile-reactnative-expo/src/components/external-link.tsx +25 -0
- package/templates/mobile-reactnative-expo/src/components/hint-row.tsx +35 -0
- package/templates/mobile-reactnative-expo/src/components/themed-text.tsx +73 -0
- package/templates/mobile-reactnative-expo/src/components/themed-view.tsx +16 -0
- package/templates/mobile-reactnative-expo/src/components/ui/collapsible.tsx +65 -0
- package/templates/mobile-reactnative-expo/src/components/web-badge.tsx +44 -0
- package/templates/mobile-reactnative-expo/src/constants/theme.ts +65 -0
- package/templates/mobile-reactnative-expo/src/global.css +9 -0
- package/templates/mobile-reactnative-expo/src/hooks/use-color-scheme.ts +1 -0
- package/templates/mobile-reactnative-expo/src/hooks/use-color-scheme.web.ts +21 -0
- package/templates/mobile-reactnative-expo/src/hooks/use-theme.ts +14 -0
- package/templates/mobile-reactnative-expo/src/native/native.cpp +9 -0
- package/templates/mobile-reactnative-expo/src/native/native.h +12 -0
- package/templates/mobile-reactnative-expo/tsconfig.json +20 -0
- package/templates/web-react-rspack/CHANGELOG.md +35 -0
- package/templates/web-react-rspack/README.md +38 -0
- package/templates/web-react-rspack/crossbind.config.mjs +13 -0
- package/templates/web-react-rspack/e2e/crossbind.spec.cjs +7 -0
- package/templates/web-react-rspack/index.html +11 -0
- package/templates/web-react-rspack/package.json +44 -0
- package/templates/web-react-rspack/playwright.dev.config.cjs +48 -0
- package/templates/web-react-rspack/playwright.prod.config.cjs +52 -0
- package/templates/web-react-rspack/rspack.config.mjs +78 -0
- package/templates/web-react-rspack/src/App.css +41 -0
- package/templates/web-react-rspack/src/App.jsx +19 -0
- package/templates/web-react-rspack/src/index.css +70 -0
- package/templates/web-react-rspack/src/main.jsx +10 -0
- package/templates/web-react-rspack/src/native/native.cpp +9 -0
- package/templates/web-react-rspack/src/native/native.h +12 -0
- package/templates/web-react-vite/CHANGELOG.md +34 -0
- package/templates/web-react-vite/README.md +38 -0
- package/templates/web-react-vite/crossbind.config.js +13 -0
- package/templates/web-react-vite/e2e/crossbind.spec.cjs +7 -0
- package/templates/web-react-vite/eslint.config.js +38 -0
- package/templates/web-react-vite/index.html +13 -0
- package/templates/web-react-vite/package.json +44 -0
- package/templates/web-react-vite/playwright.dev.config.cjs +48 -0
- package/templates/web-react-vite/playwright.prod.config.cjs +52 -0
- package/templates/web-react-vite/public/vite.svg +1 -0
- package/templates/web-react-vite/src/App.css +42 -0
- package/templates/web-react-vite/src/App.jsx +21 -0
- package/templates/web-react-vite/src/assets/react.svg +1 -0
- package/templates/web-react-vite/src/index.css +68 -0
- package/templates/web-react-vite/src/main.jsx +10 -0
- package/templates/web-react-vite/src/native/native.cpp +9 -0
- package/templates/web-react-vite/src/native/native.h +12 -0
- package/templates/web-react-vite/vite.config.js +8 -0
- package/templates/web-svelte-vite/CHANGELOG.md +34 -0
- package/templates/web-svelte-vite/README.md +38 -0
- package/templates/web-svelte-vite/crossbind.config.js +13 -0
- package/templates/web-svelte-vite/e2e/crossbind.spec.cjs +7 -0
- package/templates/web-svelte-vite/index.html +13 -0
- package/templates/web-svelte-vite/jsconfig.json +32 -0
- package/templates/web-svelte-vite/package.json +35 -0
- package/templates/web-svelte-vite/playwright.dev.config.cjs +48 -0
- package/templates/web-svelte-vite/playwright.prod.config.cjs +52 -0
- package/templates/web-svelte-vite/public/vite.svg +1 -0
- package/templates/web-svelte-vite/src/App.svelte +12 -0
- package/templates/web-svelte-vite/src/app.css +79 -0
- package/templates/web-svelte-vite/src/main.js +9 -0
- package/templates/web-svelte-vite/src/native/native.cpp +9 -0
- package/templates/web-svelte-vite/src/native/native.h +12 -0
- package/templates/web-svelte-vite/src/vite-env.d.ts +2 -0
- package/templates/web-svelte-vite/svelte.config.js +7 -0
- package/templates/web-svelte-vite/vite.config.js +8 -0
- package/templates/web-vanilla/CHANGELOG.md +34 -0
- package/templates/web-vanilla/README.md +32 -0
- package/templates/web-vanilla/crossbind.config.mjs +14 -0
- package/templates/web-vanilla/e2e/crossbind.spec.cjs +7 -0
- package/templates/web-vanilla/index.html +37 -0
- package/templates/web-vanilla/package.json +29 -0
- package/templates/web-vanilla/playwright.prod.config.cjs +52 -0
- package/templates/web-vanilla/serve.json +17 -0
- package/templates/web-vanilla/src/native/native.cpp +9 -0
- package/templates/web-vanilla/src/native/native.h +12 -0
- package/templates/web-vue-vite/CHANGELOG.md +34 -0
- package/templates/web-vue-vite/README.md +38 -0
- package/templates/web-vue-vite/crossbind.config.js +13 -0
- package/templates/web-vue-vite/e2e/crossbind.spec.cjs +7 -0
- package/templates/web-vue-vite/index.html +13 -0
- package/templates/web-vue-vite/package.json +35 -0
- package/templates/web-vue-vite/playwright.dev.config.cjs +48 -0
- package/templates/web-vue-vite/playwright.prod.config.cjs +52 -0
- package/templates/web-vue-vite/public/vite.svg +1 -0
- package/templates/web-vue-vite/serve.json +17 -0
- package/templates/web-vue-vite/src/App.vue +14 -0
- package/templates/web-vue-vite/src/main.js +5 -0
- package/templates/web-vue-vite/src/native/native.cpp +9 -0
- package/templates/web-vue-vite/src/native/native.h +12 -0
- package/templates/web-vue-vite/src/style.css +38 -0
- package/templates/web-vue-vite/vite.config.js +18 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @crossbind/example-web-react-rspack
|
|
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-webpack@1.0.2
|
|
16
|
+
- @crossbind/plugin-webpack-loader@1.0.2
|
|
17
|
+
|
|
18
|
+
## 1.0.0
|
|
19
|
+
|
|
20
|
+
### Major Changes
|
|
21
|
+
|
|
22
|
+
- š first stable release
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies
|
|
27
|
+
- @crossbind/example-lib-prebuilt-matrix@1.0.0
|
|
28
|
+
|
|
29
|
+
## 1.0.0-beta.11
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- chore: add initial version of CHANGELOGS files
|
|
34
|
+
- Updated dependencies
|
|
35
|
+
- @crossbind/example-lib-prebuilt-matrix@1.0.0-beta.32
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# @crossbind/example-web-react-rspack
|
|
2
|
+
**crossbind React Rspack sample**
|
|
3
|
+
|
|
4
|
+
<a href="https://www.npmjs.com/package/@crossbind/example-web-react-rspack">
|
|
5
|
+
<img alt="NPM version" src="https://img.shields.io/npm/v/@crossbind/example-web-react-rspack?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/rspack">
|
|
11
|
+
<img alt="Docs - Rspack" src="https://img.shields.io/badge/Docs_-_Rspack-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,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@crossbind/example-web-react-rspack",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"description": "crossbind React Rspack sample",
|
|
6
|
+
"homepage": "https://github.com/crossbind/crossbind/tree/main/examples/web-react-rspack#readme",
|
|
7
|
+
"repository": "https://github.com/crossbind/crossbind.git",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"dev": "cross-env NODE_ENV=development rspack serve",
|
|
11
|
+
"build": "cross-env NODE_ENV=production rspack build",
|
|
12
|
+
"preview": "serve dist",
|
|
13
|
+
"e2e:dev": "playwright test --config playwright.dev.config.cjs",
|
|
14
|
+
"e2e:prod": "playwright test --config playwright.prod.config.cjs"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"react": "^19.2.8",
|
|
18
|
+
"react-dom": "^19.2.8",
|
|
19
|
+
"@crossbind/example-lib-prebuilt-matrix": "^2.0.0-beta.50"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@rspack/plugin-react-refresh": "^2.0.2",
|
|
23
|
+
"@rspack/cli": "^2.1.8",
|
|
24
|
+
"@rspack/core": "^2.1.8",
|
|
25
|
+
"@rspack/dev-server": "^2.2.0",
|
|
26
|
+
"@types/react": "^19.2.18",
|
|
27
|
+
"@types/react-dom": "^19.2.4",
|
|
28
|
+
"cross-env": "^10.1.0",
|
|
29
|
+
"react-refresh": "^0.18.0",
|
|
30
|
+
"@playwright/test": "^1.62.1",
|
|
31
|
+
"serve": "^14.2.6",
|
|
32
|
+
"@crossbind/plugin-webpack": "^2.0.0-beta.50",
|
|
33
|
+
"@crossbind/plugin-webpack-loader": "^2.0.0-beta.50"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"crossbind-sample",
|
|
37
|
+
"webassembly",
|
|
38
|
+
"bind",
|
|
39
|
+
"c++",
|
|
40
|
+
"react",
|
|
41
|
+
"rspack",
|
|
42
|
+
"webpack"
|
|
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:8080',
|
|
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:8080',
|
|
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 || '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 dist -l ${port}`,
|
|
49
|
+
url: `http://localhost:${port}`,
|
|
50
|
+
reuseExistingServer: !process.env.CI,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
import fs from 'node:fs';
|
|
3
|
+
import { defineConfig } from '@rspack/cli';
|
|
4
|
+
import { rspack } from '@rspack/core';
|
|
5
|
+
import { ReactRefreshRspackPlugin } from '@rspack/plugin-react-refresh';
|
|
6
|
+
import CrossbindWebpackPlugin from '@crossbind/plugin-webpack';
|
|
7
|
+
|
|
8
|
+
const isDev = process.env.NODE_ENV === 'development';
|
|
9
|
+
|
|
10
|
+
const crossbindWebpackPlugin = new CrossbindWebpackPlugin();
|
|
11
|
+
const crossbindLoaderOptions = crossbindWebpackPlugin.getLoaderOptions();
|
|
12
|
+
const { state, getTargetParams, getFilteredBuildTargets } = crossbindLoaderOptions;
|
|
13
|
+
|
|
14
|
+
const targetParams = getTargetParams({ platform: ['wasm'], arch: ['wasm32'], runtime: ['st'], runtimeEnv: ['browser'] }, true);
|
|
15
|
+
let buildTargetRelease = getFilteredBuildTargets(targetParams, { buildType: 'release' })?.[0];
|
|
16
|
+
let buildTargetDebug = getFilteredBuildTargets(targetParams, { buildType: 'debug' })?.[0];
|
|
17
|
+
|
|
18
|
+
if (!buildTargetRelease && !buildTargetDebug) {
|
|
19
|
+
throw new Error('No build targets found');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (!buildTargetDebug) {
|
|
23
|
+
buildTargetDebug = buildTargetRelease;
|
|
24
|
+
} else if (!buildTargetRelease) {
|
|
25
|
+
buildTargetRelease = buildTargetDebug;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default defineConfig({
|
|
29
|
+
entry: {
|
|
30
|
+
main: './src/main.jsx',
|
|
31
|
+
},
|
|
32
|
+
target: ['browserslist:last 2 versions, > 0.2%, not dead, Firefox ESR'],
|
|
33
|
+
resolve: {
|
|
34
|
+
extensions: ['...', '.jsx'],
|
|
35
|
+
},
|
|
36
|
+
module: {
|
|
37
|
+
rules: [
|
|
38
|
+
crossbindWebpackPlugin.getRule(),
|
|
39
|
+
{
|
|
40
|
+
test: /\.svg$/,
|
|
41
|
+
type: 'asset',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
test: /\.css$/,
|
|
45
|
+
type: 'css/auto',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
test: /\.(?:js|jsx|mjs|cjs)$/,
|
|
49
|
+
use: [
|
|
50
|
+
{
|
|
51
|
+
loader: 'builtin:swc-loader',
|
|
52
|
+
/** @type {import('@rspack/core').SwcLoaderOptions} */
|
|
53
|
+
options: {
|
|
54
|
+
detectSyntax: 'auto',
|
|
55
|
+
jsc: {
|
|
56
|
+
transform: {
|
|
57
|
+
react: {
|
|
58
|
+
runtime: 'automatic',
|
|
59
|
+
development: isDev,
|
|
60
|
+
refresh: isDev,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
plugins: [
|
|
71
|
+
crossbindWebpackPlugin,
|
|
72
|
+
new rspack.HtmlRspackPlugin({
|
|
73
|
+
template: './index.html',
|
|
74
|
+
}),
|
|
75
|
+
isDev && new ReactRefreshRspackPlugin(),
|
|
76
|
+
],
|
|
77
|
+
devServer: crossbindWebpackPlugin.getDevServerConfig(),
|
|
78
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
}
|
|
13
|
+
.logo:hover {
|
|
14
|
+
filter: drop-shadow(0 0 2em #646cffaa);
|
|
15
|
+
}
|
|
16
|
+
.logo.react:hover {
|
|
17
|
+
filter: drop-shadow(0 0 2em #61dafbaa);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@keyframes logo-spin {
|
|
21
|
+
from {
|
|
22
|
+
transform: rotate(0deg);
|
|
23
|
+
}
|
|
24
|
+
to {
|
|
25
|
+
transform: rotate(360deg);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
30
|
+
a > .logo {
|
|
31
|
+
animation: logo-spin infinite 20s linear;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.card {
|
|
36
|
+
padding: 2em;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.read-the-docs {
|
|
40
|
+
color: #888;
|
|
41
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { initNative, Native } from './native/native.h';
|
|
3
|
+
import './App.css';
|
|
4
|
+
|
|
5
|
+
function App() {
|
|
6
|
+
const [message, setMessage] = useState("compiling ...");
|
|
7
|
+
|
|
8
|
+
initNative().then(async () => {
|
|
9
|
+
setMessage(await Native.sample());
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<div className="App">
|
|
14
|
+
<p>Matrix multiplier with c++ => {message}</p>
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default App;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
|
|
3
|
+
font-size: 16px;
|
|
4
|
+
line-height: 24px;
|
|
5
|
+
font-weight: 400;
|
|
6
|
+
|
|
7
|
+
color-scheme: light dark;
|
|
8
|
+
color: rgba(255, 255, 255, 0.87);
|
|
9
|
+
background-color: #242424;
|
|
10
|
+
|
|
11
|
+
font-synthesis: none;
|
|
12
|
+
text-rendering: optimizeLegibility;
|
|
13
|
+
-webkit-font-smoothing: antialiased;
|
|
14
|
+
-moz-osx-font-smoothing: grayscale;
|
|
15
|
+
-webkit-text-size-adjust: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
a {
|
|
19
|
+
font-weight: 500;
|
|
20
|
+
color: #646cff;
|
|
21
|
+
text-decoration: inherit;
|
|
22
|
+
}
|
|
23
|
+
a:hover {
|
|
24
|
+
color: #535bf2;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
body {
|
|
28
|
+
margin: 0;
|
|
29
|
+
display: flex;
|
|
30
|
+
place-items: center;
|
|
31
|
+
min-width: 320px;
|
|
32
|
+
min-height: 100vh;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
h1 {
|
|
36
|
+
font-size: 3.2em;
|
|
37
|
+
line-height: 1.1;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
button {
|
|
41
|
+
border-radius: 8px;
|
|
42
|
+
border: 1px solid transparent;
|
|
43
|
+
padding: 0.6em 1.2em;
|
|
44
|
+
font-size: 1em;
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
font-family: inherit;
|
|
47
|
+
background-color: #1a1a1a;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
transition: border-color 0.25s;
|
|
50
|
+
}
|
|
51
|
+
button:hover {
|
|
52
|
+
border-color: #646cff;
|
|
53
|
+
}
|
|
54
|
+
button:focus,
|
|
55
|
+
button:focus-visible {
|
|
56
|
+
outline: 4px auto -webkit-focus-ring-color;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@media (prefers-color-scheme: light) {
|
|
60
|
+
:root {
|
|
61
|
+
color: #213547;
|
|
62
|
+
background-color: #ffffff;
|
|
63
|
+
}
|
|
64
|
+
a:hover {
|
|
65
|
+
color: #747bff;
|
|
66
|
+
}
|
|
67
|
+
button {
|
|
68
|
+
background-color: #f9f9f9;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -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,34 @@
|
|
|
1
|
+
# @crossbind/example-web-react-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-react-vite
|
|
2
|
+
**crossbind React Vite sample**
|
|
3
|
+
|
|
4
|
+
<a href="https://www.npmjs.com/package/@crossbind/example-web-react-vite">
|
|
5
|
+
<img alt="NPM version" src="https://img.shields.io/npm/v/@crossbind/example-web-react-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,38 @@
|
|
|
1
|
+
import js from '@eslint/js'
|
|
2
|
+
import globals from 'globals'
|
|
3
|
+
import react from 'eslint-plugin-react'
|
|
4
|
+
import reactHooks from 'eslint-plugin-react-hooks'
|
|
5
|
+
import reactRefresh from 'eslint-plugin-react-refresh'
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
{ ignores: ['dist'] },
|
|
9
|
+
{
|
|
10
|
+
files: ['**/*.{js,jsx}'],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
ecmaVersion: 2020,
|
|
13
|
+
globals: globals.browser,
|
|
14
|
+
parserOptions: {
|
|
15
|
+
ecmaVersion: 'latest',
|
|
16
|
+
ecmaFeatures: { jsx: true },
|
|
17
|
+
sourceType: 'module',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
settings: { react: { version: '18.3' } },
|
|
21
|
+
plugins: {
|
|
22
|
+
react,
|
|
23
|
+
'react-hooks': reactHooks,
|
|
24
|
+
'react-refresh': reactRefresh,
|
|
25
|
+
},
|
|
26
|
+
rules: {
|
|
27
|
+
...js.configs.recommended.rules,
|
|
28
|
+
...react.configs.recommended.rules,
|
|
29
|
+
...react.configs['jsx-runtime'].rules,
|
|
30
|
+
...reactHooks.configs.recommended.rules,
|
|
31
|
+
'react/jsx-no-target-blank': 'off',
|
|
32
|
+
'react-refresh/only-export-components': [
|
|
33
|
+
'warn',
|
|
34
|
+
{ allowConstantExport: true },
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
]
|
|
@@ -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 + React</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.jsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|