Skip to content

Commit

Permalink
docs(website): add packages and releases sections
Browse files Browse the repository at this point in the history
  • Loading branch information
bugra9 committed Jan 15, 2025
1 parent a49d52a commit de2f9c4
Show file tree
Hide file tree
Showing 92 changed files with 1,364 additions and 410 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Buğra Sarı
Copyright (c) 2025 Buğra Sarı

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"clear:samples": "pnpm run clear:cache:samples; pnpm run clear:dist:samples",
"clear:packages": "pnpm run clear:cache:package; pnpm run clear:dist:package",
"pack:list": "find packages -name \"*.tgz\" -type d -maxdepth 2",
"pack:build": "pnpm pack:clear; node ./scripts/pack-all.mjs && pnpm pack:list",
"ci:linux:build:package": "pnpm --filter=@cpp.js/package-zlib run build",
"ci:linux:build": "pnpm run build:samples && pnpm run ci:linux:build:package",
"ci:windows:build": "pnpm run build:samples:lib:wasm && pnpm run build:samples:lib:android && pnpm run ci:linux:build:package",
Expand Down
30 changes: 4 additions & 26 deletions packages/cpp.js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
<span> · </span>
<a href="https://cpp.js.org/docs/api/cpp-bindings/overview">C++ Bindings</a>
<span> · </span>
<a href="https://cpp.js.org/showcase">Showcase</a>
<a href="https://cpp.js.org/docs/package/package/showcase">Showcase</a>
</h3>

## Basic Usage
**src/index.js**
```js
import { initCppJs } from './native/Factorial.h';
import { initCppJs, Factorial } from './native/Factorial.h';

const { Factorial } = await initCppJs();
await initCppJs();
const factorial = new Factorial(99999);
const result = factorial.calculate();
console.log(result);
Expand Down Expand Up @@ -77,30 +77,8 @@ To set up a new cpp.js project with a minimal starter structure, execute the fol
```sh
npm create cpp.js@latest
```
## Integrate Into Existing Project
Integrate cpp.js seamlessly into your existing projects using the appropriate packages for your development needs. Refer to the documentation links for detailed integration guides.

| Platform | Package(s) | Documentation |
| -------- | ---------- | ------------- |
| Standalone | [cpp.js](https://www.npmjs.com/package/cpp.js) | [Learn](https://cpp.js.org/docs/guide/integrate-into-existing-project/standalone) |
| Webpack | [@cpp.js/plugin-webpack](https://www.npmjs.com/package/@cpp.js/plugin-webpack), [@cpp.js/plugin-webpack-loader](https://www.npmjs.com/package/@cpp.js/plugin-webpack-loader) | [Learn](https://cpp.js.org/docs/guide/integrate-into-existing-project/webpack) |
| Rollup | [@cpp.js/plugin-rollup](https://www.npmjs.com/package/@cpp.js/plugin-rollup) | [Learn](https://cpp.js.org/docs/guide/integrate-into-existing-project/rollup) |
| Vite | [@cpp.js/plugin-vite](https://www.npmjs.com/package/@cpp.js/plugin-vite) | [Learn](https://cpp.js.org/docs/guide/integrate-into-existing-project/vite) |
| Rspack | [@cpp.js/plugin-webpack](https://www.npmjs.com/package/@cpp.js/plugin-webpack), [@cpp.js/plugin-webpack-loader](https://www.npmjs.com/package/@cpp.js/plugin-webpack-loader) | [Learn](https://cpp.js.org/docs/guide/integrate-into-existing-project/rspack) |
| Create React App (CRA) | [@cpp.js/plugin-webpack](https://www.npmjs.com/package/@cpp.js/plugin-webpack), [@cpp.js/plugin-webpack-loader](https://www.npmjs.com/package/@cpp.js/plugin-webpack-loader) | [Learn](https://cpp.js.org/docs/guide/integrate-into-existing-project/create-react-app) |
| React Native | [@cpp.js/plugin-react-native](https://www.npmjs.com/package/@cpp.js/plugin-react-native), [@cpp.js/plugin-react-native-ios-helper](https://www.npmjs.com/package/@cpp.js/plugin-react-native-ios-helper), [@cpp.js/plugin-metro](https://www.npmjs.com/package/@cpp.js/plugin-metro), [@cpp.js/core-embind-jsi](https://www.npmjs.com/package/@cpp.js/core-embind-jsi) | [Learn](https://cpp.js.org/docs/guide/integrate-into-existing-project/react-native) |
| Expo | [@cpp.js/plugin-react-native](https://www.npmjs.com/package/@cpp.js/plugin-react-native), [@cpp.js/plugin-react-native-ios-helper](https://www.npmjs.com/package/@cpp.js/plugin-react-native-ios-helper), [@cpp.js/plugin-metro](https://www.npmjs.com/package/@cpp.js/plugin-metro), [@cpp.js/core-embind-jsi](https://www.npmjs.com/package/@cpp.js/core-embind-jsi) | [Learn](https://cpp.js.org/docs/guide/integrate-into-existing-project/expo) |
| Node.js | [cpp.js](https://www.npmjs.com/package/cpp.js) | [Learn](https://cpp.js.org/docs/guide/integrate-into-existing-project/nodejs) |
| Cloudflare Workers | [cpp.js](https://www.npmjs.com/package/cpp.js) | [Learn](https://cpp.js.org/docs/guide/integrate-into-existing-project/cloudflare-worker) |

## Features
- [Calling C++ from JavaScript](https://cpp.js.org/docs/guide/features/calling-cpp-from-javascript)
- [Packages](https://cpp.js.org/docs/guide/features/packages)
- [Plugins](https://cpp.js.org/docs/guide/features/plugins)
- [Assets](https://cpp.js.org/docs/guide/features/assets)
- [Working with a Monorepo](https://cpp.js.org/docs/guide/features/monorepo)

## License
[MIT](https://github.com/bugra9/cpp.js/blob/main/LICENSE)

Copyright (c) 2023-2025, Buğra Sarı
Copyright (c) 2025, Buğra Sarı
2 changes: 1 addition & 1 deletion packages/cpp.js/src/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ commandDocker.command('stop').description('stop docker container');
commandDocker.command('delete').description('delete docker container');

const commandConfig = program.command('config')
.description('Manage the Cpp.js configuration files');
.description('manage the Cpp.js configuration files');
commandConfig.command('get').description('get the Cpp.js system configuration');
commandConfig.command('set').description('set the Cpp.js system configuration');
commandConfig.command('delete').description('delete the Cpp.js system configuration');
Expand Down
7 changes: 7 additions & 0 deletions packages/cppjs-core-create-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# create-cpp.js

## 1.0.0-beta.25

### Patch Changes

- chore: add initial version of CHANGELOGS files
2 changes: 1 addition & 1 deletion packages/cppjs-package-expat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ std::string Native::sample() {
## License
This project includes the precompiled expat library, which is distributed under the [MIT License](https://github.com/libexpat/libexpat/blob/master/COPYING).

Expat Homepage: <https://github.com/libexpat/libexpat>
Expat Homepage: [https://github.com/libexpat/libexpat](https://github.com/libexpat/libexpat)
2 changes: 1 addition & 1 deletion packages/cppjs-package-gdal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ std::string Native::sample() {
## License
This project includes the precompiled GDAL library, which is distributed under the [MIT License](https://github.com/OSGeo/gdal/blob/master/LICENSE.TXT).

GDAL Homepage: <https://gdal.org/>
GDAL Homepage: [https://gdal.org/](https://gdal.org/)
2 changes: 1 addition & 1 deletion packages/cppjs-package-geos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ std::string Native::sample() {
## License
This project includes the precompiled geos library, which is distributed under the [LGPL License](https://github.com/libgeos/geos/blob/main/COPYING).

GEOS Homepage: <https://github.com/libgeos/geos>
GEOS Homepage: [https://github.com/libgeos/geos](https://github.com/libgeos/geos)
2 changes: 1 addition & 1 deletion packages/cppjs-package-geotiff/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ std::string Native::sample() {
## License
This project includes the precompiled libgeotiff library, which is distributed under the [MIT License](https://github.com/OSGeo/libgeotiff/blob/master/libgeotiff/LICENSE).

GeoTiff Homepage: <https://github.com/OSGeo/libgeotiff>
GeoTiff Homepage: [https://github.com/OSGeo/libgeotiff](https://github.com/OSGeo/libgeotiff)
2 changes: 1 addition & 1 deletion packages/cppjs-package-iconv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ std::string Native::sample() {
## License
This project includes the precompiled libiconv library, which is distributed under the [LGPL License](https://spdx.org/licenses/LGPL-2.1-or-later.html).

iconv Homepage: <https://www.gnu.org/software/libiconv/>
iconv Homepage: [https://www.gnu.org/software/libiconv/](https://www.gnu.org/software/libiconv/)
2 changes: 1 addition & 1 deletion packages/cppjs-package-proj/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ double Native::sample() {
## License
This project includes the precompiled proj library, which is distributed under the [MIT License](https://github.com/OSGeo/PROJ/blob/master/COPYING).

Proj Homepage: <https://proj.org/>
Proj Homepage: [https://proj.org/](https://proj.org/)
2 changes: 1 addition & 1 deletion packages/cppjs-package-spatialite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ std::string Native::sample() {
## License
This project includes the precompiled spatialite library, which is distributed under the [MPL tri-license](https://website-archive.mozilla.org/www.mozilla.org/mpl/MPL/boilerplate-1.1/mpl-tri-license-html).

Spatialite Homepage: <https://www.gaia-gis.it/fossil/libspatialite/index>
Spatialite Homepage: [https://www.gaia-gis.it/fossil/libspatialite/index](https://www.gaia-gis.it/fossil/libspatialite/index)
2 changes: 1 addition & 1 deletion packages/cppjs-package-sqlite3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ std::string Native::sample() {
## License
This project includes the precompiled sqlite3 library, which is distributed under the [Public Domain License](https://www.sqlite.org/copyright.html).

Sqlite3 Homepage: <https://www.sqlite.org>
Sqlite3 Homepage: [https://www.sqlite.org](https://www.sqlite.org)
2 changes: 1 addition & 1 deletion packages/cppjs-package-tiff/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ std::string Native::sample() {
## License
This project includes the precompiled tiff library, which is distributed under the [libtiff License](https://libtiff.gitlab.io/libtiff/project/license.html).

Tiff Homepage: <https://libtiff.gitlab.io/libtiff/index.html>
Tiff Homepage: [https://libtiff.gitlab.io/libtiff/index.html](https://libtiff.gitlab.io/libtiff/index.html)
2 changes: 1 addition & 1 deletion packages/cppjs-package-webp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ std::string Native::sample() {
## License
This project includes the precompiled webp library, which is distributed under the [BSD 3-Clause License](https://chromium.googlesource.com/webm/libwebp/+/refs/heads/main/COPYING).

WebP Homepage: <https://developers.google.com/speed/webp>
WebP Homepage: [https://developers.google.com/speed/webp](https://developers.google.com/speed/webp)
2 changes: 1 addition & 1 deletion packages/cppjs-package-zlib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ std::string Native::sample() {
## License
This project includes the precompiled zlib library, which is distributed under the [zlib License](https://zlib.net/zlib_license.html).

Zlib Homepage: <https://zlib.net/>
Zlib Homepage: [https://zlib.net/](https://zlib.net/)
4 changes: 2 additions & 2 deletions packages/cppjs-sample-lib-cmake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ std::string Native::sample() {

### Usage in JavaScript Code (web, with plugin)
```js
import { initCppJs } '@cpp.js/sample-lib-cmake/cppjs-lib-samplebasic-cmake/samplebasiccmake.h';
import { initCppJs, SampleBasicCmake } from '@cpp.js/sample-lib-cmake/cppjs-lib-samplebasic-cmake/samplebasiccmake.h';

const { SampleBasicCmake } = await initCppJs();
await initCppJs();
console.log(SampleBasicCmake.sample());
```
4 changes: 2 additions & 2 deletions packages/cppjs-sample-lib-prebuilt-matrix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ std::string Native::sample() {

### Usage in JavaScript Code (web, with plugin)
```js
import { initCppJs } '@cpp.js/sample-lib-prebuilt-matrix/Matrix.h';
import { initCppJs, Matrix } from '@cpp.js/sample-lib-prebuilt-matrix/Matrix.h';

const { Matrix } = await initCppJs();
await initCppJs();
const a = new Matrix(1210000, 1);
const b = new Matrix(1210000, 2);
const result = a.multiple(b);
Expand Down
4 changes: 2 additions & 2 deletions packages/cppjs-sample-lib-source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ std::string Native::sample() {

### Usage in JavaScript Code (web, with plugin)
```js
import { initCppJs } '@cpp.js/sample-lib-source/cppjs-lib-samplebasic/samplebasic.h';
import { initCppJs, SampleBasic } from '@cpp.js/sample-lib-source/cppjs-lib-samplebasic/samplebasic.h';

const { SampleBasic } = await initCppJs();
await initCppJs();
console.log(SampleBasic.sample());
```
2 changes: 1 addition & 1 deletion packages/cppjs-sample-web-react-rspack/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import "./App.css";
function App() {
const [message, setMessage] = useState("compiling ...");

initCppJs().then(() => {;
initCppJs().then(() => {
setMessage(Native.sample());
});

Expand Down
2 changes: 1 addition & 1 deletion packages/cppjs-sample-web-vue-vite/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { initCppJs, Native } from './native/native.h'
const message = ref("compiling ...")
initCppJs().then(() => {;
initCppJs().then(() => {
message.value = Native.sample();
});
</script>
Expand Down
11 changes: 0 additions & 11 deletions scripts/pack-all.mjs

This file was deleted.

96 changes: 51 additions & 45 deletions website/docs/api/cli/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,58 +5,64 @@ Usage: cppjs build [options]
compile the project that was set up using Cpp.js

Options:
-p, --platform <platform> target platform (choices: "all", "wasm", "android", "ios", default: "all")
-p, --platform <platform> target platform (choices: "All", "WebAssembly", "Android", "iOS", default: "All")
-h, --help display help for command
```

<br />

**Output**
```
└── dist
├── mylib.wasm
├── mylib.browser.js
├── mylib.node.js
└── prebuilt
├── Android-arm64-v8a
│ ├── include
│ │ └── ...
│ └── lib
│ └── mylib.so
├── Emscripten-x86_64
│ ├── include
│ │ └── ...
│ └── lib
│ └── mylib.a
├── iOS-iphoneos
│ ├── include
│ │ └── ...
│ └── lib
│ └── mylib.a
├── iOS-iphonesimulator
│ ├── include
│ │ └── ...
│ └── lib
│ └── mylib.a
├── mylib.xcframework
│ ├── ios-arm64_arm64e
│ │ ├── Headers
│ │ │ └── ...
│ │ └── mylib.a
│ │
│ ├── ios-arm64_arm64e_x86_64-simulator
│ │ ├── Headers
│ │ │ └── ...
│ │ └── mylib.a
│ │
│ └── Info.plist
├── mylib.xcframework.zip
└── CMakeLists.txt
├── dist
│ ├── mylib.wasm
│ ├── mylib.browser.js
│ ├── mylib.node.js
│ └── prebuilt
│ ├── Android-arm64-v8a
│ │ ├── include
│ │ │ └── ...
│ │ └── lib
│ │ └── mylib.so
│ │
│ ├── Android-x86_64
│ │ ├── include
│ │ │ └── ...
│ │ └── lib
│ │ └── mylib.so
│ │
│ ├── Emscripten-x86_64
│ │ ├── include
│ │ │ └── ...
│ │ └── lib
│ │ └── mylib.a
│ │
│ ├── iOS-iphoneos
│ │ ├── include
│ │ │ └── ...
│ │ └── lib
│ │ └── mylib.a
│ │
│ ├── iOS-iphonesimulator
│ │ ├── include
│ │ │ └── ...
│ │ └── lib
│ │ └── mylib.a
│ │
│ ├── mylib.xcframework.zip
│ └── CMakeLists.txt
|
└── mylib.xcframework
├── ios-arm64_arm64e
│ ├── Headers
│ │ └── ...
│ └── mylib.a
├── ios-arm64_arm64e_x86_64-simulator
│ ├── Headers
│ │ └── ...
│ └── mylib.a
└── Info.plist
```

Expand Down
Loading

0 comments on commit de2f9c4

Please sign in to comment.