Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
77d720f
v2
bugra9 Dec 14, 2025
7945e1c
chore: add renovate bot for sample version update for minor,patch cha…
erenkucuker Dec 31, 2025
a5299ca
chore: bundler plugins update for support ssr based web frameworks raw
erenkucuker Jan 4, 2026
b254741
chore: added new samples for different tech stacks
erenkucuker Jan 4, 2026
959ee3a
chore: added new samples into create app
erenkucuker Jan 4, 2026
05e98c4
ignore gradle files
erenkucuker Apr 26, 2026
53546ec
Merge branch 'bugra9:main' into main
erenkucuker May 2, 2026
db5dee6
Merge branch 'main' into v2-new-samples (Groups 1, 2, 4, 5)
erenkucuker May 2, 2026
7294e3f
Group 3: port SSR/multithread plugin support to main's target API
erenkucuker May 2, 2026
88312f8
fix(samples): await Native.* calls + drop broken svelteLogo reference
erenkucuker May 2, 2026
0d7f5d9
fix(samples): backend-nodejs-wasm-multithread — migrate to new target…
erenkucuker May 2, 2026
48e1dea
chore: remove tracked build-cache leftovers + sync pnpm lockfile
erenkucuker May 2, 2026
cd6aa3c
fix: delete all multithread packages
erenkucuker May 2, 2026
1f53b06
fix(samples): playground-backend-nodejs-multithread — update CI build…
erenkucuker May 2, 2026
3425c1e
chore: exclude playground-mt samples from workspace until mt packages…
erenkucuker May 2, 2026
c95e838
ci(mobile): build matrix-mt prebuilt for android+ios alongside the st…
erenkucuker May 2, 2026
244bf6e
fix(samples): mt App templates render in the format playwright tests …
erenkucuker May 2, 2026
85fea0c
fix(ci): restore mobile sample bridge files (revert deletion in 48e1dea)
erenkucuker May 2, 2026
6e88cc4
fix(samples): mt e2e tests pass on chromium+firefox; skip webkit
erenkucuker May 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 8 additions & 2 deletions .github/workflows/test-android-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build cppjs-sample-lib-prebuilt-matrix
run: pnpm --filter=@cpp.js/sample-lib-prebuilt-matrix run build:android
- name: Build cppjs-sample-lib-prebuilt-matrix (st + mt)
# Glob picks up both @cpp.js/sample-lib-prebuilt-matrix and the
# -multithread variant. The mt sample-mobile-reactnative-cli's
# native.cpp does `#include <Matrix.h>` which resolves to the
# prebuilt artifacts under matrix-mt's dist/prebuilt/<target>/
# — without this build the e2e:android step fails for the mt
# sample with "fatal error: 'Matrix.h' file not found".
run: pnpm --filter='@cpp.js/sample-lib-prebuilt-matrix*' run build:android

- name: Install Maestro
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test-ios-sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ jobs:
echo "$HOME/.maestro/bin" >> $GITHUB_PATH
- name: Restore cached bridge files
run: cp -r ./cppjs-samples/cppjs-sample-mobile-reactnative-cli/ci/.cppjs ./cppjs-samples/cppjs-sample-mobile-reactnative-cli
- name: Build cppjs-sample-lib-prebuilt-matrix
run: pnpm --filter=@cpp.js/sample-lib-prebuilt-matrix run build:ios
- name: Build cppjs-sample-lib-prebuilt-matrix (st + mt)
# Same fix as test-android-sample.yml: glob also matches the
# -multithread variant so the mt mobile sample's <Matrix.h>
# resolves at native compile.
run: pnpm --filter='@cpp.js/sample-lib-prebuilt-matrix*' run build:ios
- name: Pod install
run: cd cppjs-samples/cppjs-sample-mobile-reactnative-cli/ios && pod install && cd ../../../
- name: E2E IOS
Expand Down
12 changes: 12 additions & 0 deletions cppjs-core/cppjs-core-create-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,29 @@
"dependencies": {
"cpp.js": "workspace:^",
"@cpp.js/sample-lib-cmake": "workspace:^",
"@cpp.js/sample-lib-cmake-multithread": "workspace:^",
"@cpp.js/sample-lib-prebuilt-matrix": "workspace:^",
"@cpp.js/sample-lib-prebuilt-matrix-multithread": "workspace:^",
"@cpp.js/sample-lib-source": "workspace:^",
"@cpp.js/sample-lib-source-multithread": "workspace:^",
"@cpp.js/sample-web-vanilla": "workspace:^",
"@cpp.js/sample-web-react-rspack": "workspace:^",
"@cpp.js/sample-web-react-vite": "workspace:^",
"@cpp.js/sample-web-react-vite-multithread": "workspace:^",
"@cpp.js/sample-web-svelte-vite": "workspace:^",
"@cpp.js/sample-web-svelte-vite-multithread": "workspace:^",
"@cpp.js/sample-web-vue-vite": "workspace:^",
"@cpp.js/sample-web-next-webpack": "workspace:^",
"@cpp.js/sample-web-next-webpack-multithread": "workspace:^",
"@cpp.js/sample-web-nuxt-vite": "workspace:^",
"@cpp.js/sample-web-nuxt-vite-multithread": "workspace:^",
"@cpp.js/sample-backend-nodejs-wasm": "workspace:^",
"@cpp.js/sample-backend-nodejs-wasm-multithread": "workspace:^",
"@cpp.js/sample-cloud-cloudflare-worker": "workspace:^",
"@cpp.js/sample-mobile-reactnative-cli": "workspace:^",
"@cpp.js/sample-mobile-reactnative-cli-multithread": "workspace:^",
"@cpp.js/sample-mobile-reactnative-expo": "2.0.0-beta.12",
"@cpp.js/sample-mobile-reactnative-expo-multithread": "workspace:^",
"fs-extra": "^11.3.4",
"kleur": "^4.1.5",
"prompts": "^2.4.2",
Expand Down
27 changes: 24 additions & 3 deletions cppjs-core/cppjs-core-create-app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,34 @@ async function main() {
}));
}

let templatePath;
// Get the template object
let template;
if (selectedBundler) {
templatePath = samples[selectedType][selectedPlatform][selectedBundler].path;
template = samples[selectedType][selectedPlatform][selectedBundler];
} else {
templatePath = samples[selectedType][selectedPlatform].path;
template = samples[selectedType][selectedPlatform];
}

// Check if multithread is available and ask user
let useMultithread = false;
if (template.multithreadPath) {
({ useMultithread } = await prompts({
type: 'confirm',
name: 'useMultithread',
message: 'Enable multithread support?',
initial: false,
}, {
onCancel: () => {
process.exit(1);
},
}));
}

// Determine the template path based on multithread selection
const templatePath = useMultithread && template.multithreadPath
? template.multithreadPath
: template.path;

fse.copySync(templatePath, cwd, { overwrite: true });

const packageJsonFilePath = `${cwd}/package.json`;
Expand Down
32 changes: 32 additions & 0 deletions cppjs-core/cppjs-core-create-app/src/samples.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
import getParentPath from 'cpp.js/src/utils/getParentPath.js';

import sampleLibCmake from '@cpp.js/sample-lib-cmake/cppjs.config.js';
import sampleLibCmakeMultithread from '@cpp.js/sample-lib-cmake-multithread/cppjs.config.js';
import sampleLibMatrix from '@cpp.js/sample-lib-prebuilt-matrix/cppjs.config.js';
import sampleLibMatrixMultithread from '@cpp.js/sample-lib-prebuilt-matrix-multithread/cppjs.config.js';
import sampleLibSource from '@cpp.js/sample-lib-source/cppjs.config.js';
import sampleLibSourceMultithread from '@cpp.js/sample-lib-source-multithread/cppjs.config.js';

import sampleMobileReactNativeCLI from '@cpp.js/sample-mobile-reactnative-cli/cppjs.config.mjs';
import sampleMobileReactNativeCLIMultithread from '@cpp.js/sample-mobile-reactnative-cli-multithread/cppjs.config.mjs';
import sampleMobileReactNativeExpo from '@cpp.js/sample-mobile-reactnative-expo/cppjs.config.mjs';
import sampleMobileReactNativeExpoMultithread from '@cpp.js/sample-mobile-reactnative-expo-multithread/cppjs.config.mjs';

import sampleWebVanilla from '@cpp.js/sample-web-vanilla/cppjs.config.mjs';
import sampleWebReactRspack from '@cpp.js/sample-web-react-rspack/cppjs.config.mjs';
import sampleWebReactVite from '@cpp.js/sample-web-react-vite/cppjs.config.js';
import sampleWebReactViteMultithread from '@cpp.js/sample-web-react-vite-multithread/cppjs.config.js';
import sampleWebSvelteVite from '@cpp.js/sample-web-svelte-vite/cppjs.config.js';
import sampleWebSvelteViteMultithread from '@cpp.js/sample-web-svelte-vite-multithread/cppjs.config.js';
import sampleWebVueVite from '@cpp.js/sample-web-vue-vite/cppjs.config.js';
import sampleWebNextWebpack from '@cpp.js/sample-web-next-webpack/cppjs.config.js';
import sampleWebNextWebpackMultithread from '@cpp.js/sample-web-next-webpack-multithread/cppjs.config.js';
import sampleWebNuxtVite from '@cpp.js/sample-web-nuxt-vite/cppjs.config.js';
import sampleWebNuxtViteMultithread from '@cpp.js/sample-web-nuxt-vite-multithread/cppjs.config.js';

import sampleBackendNodeJsWasm from '@cpp.js/sample-backend-nodejs-wasm/cppjs.config.mjs';
import sampleBackendNodeJsWasmMultithread from '@cpp.js/sample-backend-nodejs-wasm-multithread/cppjs.config.mjs';
import sampleCloudCloudflareWorker from '@cpp.js/sample-cloud-cloudflare-worker/cppjs.config.mjs';

export default {
Expand All @@ -31,6 +43,7 @@ export default {
},
Vite: {
path: getParentPath(sampleWebReactVite.paths.config),
multithreadPath: getParentPath(sampleWebReactViteMultithread.paths.config),
},
},
Vue: {
Expand All @@ -41,6 +54,19 @@ export default {
Svelte: {
Vite: {
path: getParentPath(sampleWebSvelteVite.paths.config),
multithreadPath: getParentPath(sampleWebSvelteViteMultithread.paths.config),
},
},
'Next.js': {
Webpack: {
path: getParentPath(sampleWebNextWebpack.paths.config),
multithreadPath: getParentPath(sampleWebNextWebpackMultithread.paths.config),
},
},
Nuxt: {
Vite: {
path: getParentPath(sampleWebNuxtVite.paths.config),
multithreadPath: getParentPath(sampleWebNuxtViteMultithread.paths.config),
},
},
},
Expand All @@ -52,9 +78,11 @@ export default {
'React Native': {
'Native CLI': {
path: getParentPath(sampleMobileReactNativeCLI.paths.config),
multithreadPath: getParentPath(sampleMobileReactNativeCLIMultithread.paths.config),
},
Expo: {
path: getParentPath(sampleMobileReactNativeExpo.paths.config),
multithreadPath: getParentPath(sampleMobileReactNativeExpoMultithread.paths.config),
},
},
},
Expand All @@ -66,6 +94,7 @@ export default {
'Node.js': {
WebAssembly: {
path: getParentPath(sampleBackendNodeJsWasm.paths.config),
multithreadPath: getParentPath(sampleBackendNodeJsWasmMultithread.paths.config),
},
},
},
Expand All @@ -83,12 +112,15 @@ export default {
],
Prebuilt: {
path: getParentPath(sampleLibMatrix.paths.config),
multithreadPath: getParentPath(sampleLibMatrixMultithread.paths.config),
},
Source: {
path: getParentPath(sampleLibSource.paths.config),
multithreadPath: getParentPath(sampleLibSourceMultithread.paths.config),
},
CMake: {
path: getParentPath(sampleLibCmake.paths.config),
multithreadPath: getParentPath(sampleLibCmakeMultithread.paths.config),
},
},
};
40 changes: 40 additions & 0 deletions cppjs-extensions/cppjs-extension-sample/index.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
export default {
buildWasm: {
beforeBuildBrowser: (state, emccFlags) => {
if (state.config.build.usePthread && !emccFlags.includes('-pthread')) {
emccFlags.push('-pthread');
emccFlags.push('-sPTHREAD_POOL_SIZE=4');
}
},
beforeBuildNodeJS: (state, emccFlags) => {
if (state.config.build.usePthread && !emccFlags.includes('-pthread')) {
emccFlags.push('-pthread');
emccFlags.push('-sPTHREAD_POOL_SIZE=4');
}
},
},
createLib: {
setFlagWithBuildConfig: (state, buildEnv, cFlags, ldFlags) => {
if (state.config.build.usePthread) {
cFlags.push('-pthread');
ldFlags.push('-pthread');
}
},
setFlagWithoutBuildConfig: (state, buildEnv) => {
if (state.config.build.usePthread) {
buildEnv.params.push('-e', `CFLAGS=-pthread`);
buildEnv.params.push('-e', `CXXFLAGS=-pthread`);
buildEnv.params.push('-e', `LDFLAGS=-pthread`);
}
}
},
loadConfig: {
after: (newConfig) => {
newConfig.build.usePthread = newConfig.build.usePthread || false;

if (!newConfig.build.usePthread) {
newConfig.build.usePthread = newConfig.allDependencies.some((d) => d?.build?.usePthread);
}
}
}
};
4 changes: 4 additions & 0 deletions cppjs-extensions/cppjs-extension-sample/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "@cpp.js/extension-sample",
"main": "index.mjs"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require "json"
package = JSON.parse(File.read(File.join(__dir__, "package.json")))

Pod::Spec.new do |s|
s.module_name = "curl"
s.name = "cppjs-package-curl"
s.version = package["nativeVersion"]
s.summary = "Transferring data with URLs"
s.homepage = "https://curl.se/"
s.author = "CURL Authors"
s.source = { :http => "https://cpp.js.org" }
s.vendored_frameworks = 'curl.xcframework'
end
Loading
Loading