feat: initial tauri commit (#206)
* feat: initial tauri commit * feat: finish up CI system * fix: fix release asset types * feat: update tauri version - added support for native windows shadows - upgraded tauri version to newest LTS - added tauri commands to package.json * feat: add setup scripts for setting up tauri dev environment * fix: script for linux - use user input instead of auto-detection * feat: initial cir release * fix: remove caching of pnpm in ci * fix: remove old path * fix: windows failing to build * fix: .releasesrc file not having a main branch * fix: .releasesrc file not having a main branch * Tauri (#1) * fix: release to tauri branch * fix: release to tauri branch * fix: release to tauri branch * fix: release to tauri * fix: fix app not loading on linux builds - update tauri - fix dist directory path BREAKING CHANGES * fix: update readme * fix: semantic-release * Update .releaserc * Update ci.yaml * fix: Update .releaserc * fix: remove repo from package.json * chore(major): 1.0.0-tauri.1 [skip ci] ## 1.0.0-tauri.1 (2023-05-09) ### ⚠ BREAKING CHANGES * CHANGES ### 🍕 Features * add setup scripts for setting up tauri dev environment ([0c41a33](0c41a33d0e)) * **dxf:** add support for dimensions in dxf. ([56c884c](56c884ccfd)) * add support for dxf blocks ([#200](https://github.com/ZanzyTHEbar/jsketcher/issues/200)) ([322d47f](322d47f802)) * add support for dxf files import ([2fa2866](2fa2866296)) * finish up CI system ([5a688d1](5a688d1a9e)) * initial cir release ([2f94a6e](2f94a6eb82)) * initial tauri commit ([0a0bb54](0a0bb5485e)) * update tauri version ([90168da](90168da42c)) ### 🐛 Bug Fixes * .releasesrc file not having a main branch ([04f2e2c](04f2e2c6b7)) * .releasesrc file not having a main branch ([25ae8a4](25ae8a464b)) * **dxf:** add dimLayers to the export. ([#183](https://github.com/ZanzyTHEbar/jsketcher/issues/183)) ([a3349b5](a3349b5da4)) * fix app not loading on linux builds ([9ef599d](9ef599ddc9)) * fix release asset types ([8f73410](8f73410c74)) * release to tauri ([0ba5387](0ba5387601)) * release to tauri branch ([11fcf2e](11fcf2e87a)) * release to tauri branch ([e8486a5](e8486a5e65)) * release to tauri branch ([6076573](6076573c98)) * remove caching of pnpm in ci ([96165f3](96165f3e1e)) * remove old path ([f0b426c](f0b426c14f)) * remove repo from package.json ([dd099b8](dd099b8ad8)) * script for linux ([46bda82](46bda82726)) * semantic-release ([3edb4cf](3edb4cf635)) * Update .releaserc ([3343d2c](3343d2cb4a)) * update readme ([b00299d](b00299d5c1)) * windows failing to build ([def0782](def0782b76)) --------- Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net> * fix: appimage failing to build * Feat: Update ci.yaml swap to use older version of ubuntu. * Add full CI and Support for linux (#3) * fix: release to tauri branch * fix: release to tauri branch * fix: release to tauri branch * fix: release to tauri * fix: fix app not loading on linux builds - update tauri - fix dist directory path BREAKING CHANGES * fix: update readme * fix: semantic-release * Update .releaserc * Update ci.yaml * fix: Update .releaserc * fix: remove repo from package.json * chore(major): 1.0.0-tauri.1 [skip ci] ## 1.0.0-tauri.1 (2023-05-09) ### ⚠ BREAKING CHANGES * CHANGES ### 🍕 Features * add setup scripts for setting up tauri dev environment ([0c41a33](0c41a33d0e)) * **dxf:** add support for dimensions in dxf. ([56c884c](56c884ccfd)) * add support for dxf blocks ([#200](https://github.com/ZanzyTHEbar/jsketcher/issues/200)) ([322d47f](322d47f802)) * add support for dxf files import ([2fa2866](2fa2866296)) * finish up CI system ([5a688d1](5a688d1a9e)) * initial cir release ([2f94a6e](2f94a6eb82)) * initial tauri commit ([0a0bb54](0a0bb5485e)) * update tauri version ([90168da](90168da42c)) ### 🐛 Bug Fixes * .releasesrc file not having a main branch ([04f2e2c](04f2e2c6b7)) * .releasesrc file not having a main branch ([25ae8a4](25ae8a464b)) * **dxf:** add dimLayers to the export. ([#183](https://github.com/ZanzyTHEbar/jsketcher/issues/183)) ([a3349b5](a3349b5da4)) * fix app not loading on linux builds ([9ef599d](9ef599ddc9)) * fix release asset types ([8f73410](8f73410c74)) * release to tauri ([0ba5387](0ba5387601)) * release to tauri branch ([11fcf2e](11fcf2e87a)) * release to tauri branch ([e8486a5](e8486a5e65)) * release to tauri branch ([6076573](6076573c98)) * remove caching of pnpm in ci ([96165f3](96165f3e1e)) * remove old path ([f0b426c](f0b426c14f)) * remove repo from package.json ([dd099b8](dd099b8ad8)) * script for linux ([46bda82](46bda82726)) * semantic-release ([3edb4cf](3edb4cf635)) * Update .releaserc ([3343d2c](3343d2cb4a)) * update readme ([b00299d](b00299d5c1)) * windows failing to build ([def0782](def0782b76)) * fix: appimage failing to build * fix: test ubuntu 18.04 * fix: test ubuntu 18.04 * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * chore(minor): 1.0.0-tauri.2 [skip ci] ## [1.0.0-tauri.2](https://github.com/ZanzyTHEbar/jsketcher/compare/v1.0.0-tauri.1...v1.0.0-tauri.2) (2023-05-11) ### 🐛 Bug Fixes * appimage failing to build ([8dc6217](8dc62170a9)) * test ubuntu 18.04 ([8f55f4d](8f55f4d1c1)) * test ubuntu 18.04 ([0afd146](0afd14642b)) ### 🍕 Features * update ci to use docker container ([7bcacb0](7bcacb0251)) * update ci to use docker container ([98de939](98de93981f)) * update ci to use docker container ([0750c00](0750c006f3)) * update ci to use docker container ([715780f](715780f8f6)) * update ci to use docker container ([ccbacdb](ccbacdba32)) * update ci to use docker container ([60aa80d](60aa80d636)) * update ci to use docker container ([f629258](f629258426)) * update ci to use docker container ([278cf82](278cf82cea)) * update ci to use docker container ([02ec38c](02ec38c1b7)) * update ci to use docker container ([8fb7924](8fb7924dc2)) * update ci to use docker container ([d0493b3](d0493b3e0c)) * update ci to use docker container ([09fbb4f](09fbb4f9b9)) * update ci to use docker container ([c7e39b9](c7e39b92f7)) * update ci to use docker container ([d9221a7](d9221a77fe)) * update ci to use docker container ([9e96489](9e96489eb7)) * update ci to use docker container ([765b708](765b708a19)) * update ci to use docker container ([484b722](484b722a49)) * update ci to use docker container ([1023d90](1023d90529)) * update ci to use docker container ([1d9fd84](1d9fd84aa2)) * feat: update rust deps * chore(minor): 1.0.0-tauri.3 [skip ci] ## [1.0.0-tauri.3](https://github.com/ZanzyTHEbar/jsketcher/compare/v1.0.0-tauri.2...v1.0.0-tauri.3) (2023-05-11) ### 🍕 Features * update rust deps ([b809c28](b809c28b8c)) * fix: wasm not loading in webkit * chore(patch): 1.0.0-tauri.4 [skip ci] ## [1.0.0-tauri.4](https://github.com/ZanzyTHEbar/jsketcher/compare/v1.0.0-tauri.3...v1.0.0-tauri.4) (2023-05-11) ### 🐛 Bug Fixes * wasm not loading in webkit ([0e74582](0e74582848)) * feat: add windows binary * fix: windows ci --------- Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net> * Fix windows CI (#4) * fix: release to tauri branch * fix: release to tauri branch * fix: release to tauri branch * fix: release to tauri * fix: fix app not loading on linux builds - update tauri - fix dist directory path BREAKING CHANGES * fix: update readme * fix: semantic-release * Update .releaserc * Update ci.yaml * fix: Update .releaserc * fix: remove repo from package.json * chore(major): 1.0.0-tauri.1 [skip ci] ## 1.0.0-tauri.1 (2023-05-09) ### ⚠ BREAKING CHANGES * CHANGES ### 🍕 Features * add setup scripts for setting up tauri dev environment ([0c41a33](0c41a33d0e)) * **dxf:** add support for dimensions in dxf. ([56c884c](56c884ccfd)) * add support for dxf blocks ([#200](https://github.com/ZanzyTHEbar/jsketcher/issues/200)) ([322d47f](322d47f802)) * add support for dxf files import ([2fa2866](2fa2866296)) * finish up CI system ([5a688d1](5a688d1a9e)) * initial cir release ([2f94a6e](2f94a6eb82)) * initial tauri commit ([0a0bb54](0a0bb5485e)) * update tauri version ([90168da](90168da42c)) ### 🐛 Bug Fixes * .releasesrc file not having a main branch ([04f2e2c](04f2e2c6b7)) * .releasesrc file not having a main branch ([25ae8a4](25ae8a464b)) * **dxf:** add dimLayers to the export. ([#183](https://github.com/ZanzyTHEbar/jsketcher/issues/183)) ([a3349b5](a3349b5da4)) * fix app not loading on linux builds ([9ef599d](9ef599ddc9)) * fix release asset types ([8f73410](8f73410c74)) * release to tauri ([0ba5387](0ba5387601)) * release to tauri branch ([11fcf2e](11fcf2e87a)) * release to tauri branch ([e8486a5](e8486a5e65)) * release to tauri branch ([6076573](6076573c98)) * remove caching of pnpm in ci ([96165f3](96165f3e1e)) * remove old path ([f0b426c](f0b426c14f)) * remove repo from package.json ([dd099b8](dd099b8ad8)) * script for linux ([46bda82](46bda82726)) * semantic-release ([3edb4cf](3edb4cf635)) * Update .releaserc ([3343d2c](3343d2cb4a)) * update readme ([b00299d](b00299d5c1)) * windows failing to build ([def0782](def0782b76)) * fix: appimage failing to build * fix: test ubuntu 18.04 * fix: test ubuntu 18.04 * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * feat: update ci to use docker container * chore(minor): 1.0.0-tauri.2 [skip ci] ## [1.0.0-tauri.2](https://github.com/ZanzyTHEbar/jsketcher/compare/v1.0.0-tauri.1...v1.0.0-tauri.2) (2023-05-11) ### 🐛 Bug Fixes * appimage failing to build ([8dc6217](8dc62170a9)) * test ubuntu 18.04 ([8f55f4d](8f55f4d1c1)) * test ubuntu 18.04 ([0afd146](0afd14642b)) ### 🍕 Features * update ci to use docker container ([7bcacb0](7bcacb0251)) * update ci to use docker container ([98de939](98de93981f)) * update ci to use docker container ([0750c00](0750c006f3)) * update ci to use docker container ([715780f](715780f8f6)) * update ci to use docker container ([ccbacdb](ccbacdba32)) * update ci to use docker container ([60aa80d](60aa80d636)) * update ci to use docker container ([f629258](f629258426)) * update ci to use docker container ([278cf82](278cf82cea)) * update ci to use docker container ([02ec38c](02ec38c1b7)) * update ci to use docker container ([8fb7924](8fb7924dc2)) * update ci to use docker container ([d0493b3](d0493b3e0c)) * update ci to use docker container ([09fbb4f](09fbb4f9b9)) * update ci to use docker container ([c7e39b9](c7e39b92f7)) * update ci to use docker container ([d9221a7](d9221a77fe)) * update ci to use docker container ([9e96489](9e96489eb7)) * update ci to use docker container ([765b708](765b708a19)) * update ci to use docker container ([484b722](484b722a49)) * update ci to use docker container ([1023d90](1023d90529)) * update ci to use docker container ([1d9fd84](1d9fd84aa2)) * feat: update rust deps * chore(minor): 1.0.0-tauri.3 [skip ci] ## [1.0.0-tauri.3](https://github.com/ZanzyTHEbar/jsketcher/compare/v1.0.0-tauri.2...v1.0.0-tauri.3) (2023-05-11) ### 🍕 Features * update rust deps ([b809c28](b809c28b8c)) * fix: wasm not loading in webkit * chore(patch): 1.0.0-tauri.4 [skip ci] ## [1.0.0-tauri.4](https://github.com/ZanzyTHEbar/jsketcher/compare/v1.0.0-tauri.3...v1.0.0-tauri.4) (2023-05-11) ### 🐛 Bug Fixes * wasm not loading in webkit ([0e74582](0e74582848)) * feat: add windows binary * fix: windows ci * fix: windows ci deps --------- Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net> --------- Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net> Co-authored-by: Mike Molinari <mike@smbisoft.com>
|
|
@ -5,6 +5,7 @@
|
|||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"node": true,
|
||||
"es6": true
|
||||
},
|
||||
"parser": "@babel/eslint-parser",
|
||||
|
|
|
|||
183
.github/workflows/ci.yaml
vendored
Normal file
|
|
@ -0,0 +1,183 @@
|
|||
name: Produce Desktop Binary Builds
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- tauri
|
||||
- feature/tauri
|
||||
#- master
|
||||
#- main
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
|
||||
APPLE_ID: ${{ secrets.APPLE_ID }}
|
||||
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
#defaults:
|
||||
# run:
|
||||
# working-directory: GUI/ETVR
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
node-version: [18.x]
|
||||
#, macos-latest
|
||||
#windows-latest,
|
||||
platform: [ubuntu-latest, windows-latest]
|
||||
include:
|
||||
#- os: ubuntu-18.04
|
||||
# rust_target: x86_64-unknown-linux-gnu
|
||||
- os: windows-latest
|
||||
rust_target: x86_64-pc-windows-msvc
|
||||
#- os: macos-latest
|
||||
# rust_target: x86_64-apple-darwin
|
||||
#- os: macos-latest
|
||||
# rust_target: aarch64-apple-darwin
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ env.GITHUB_TOKEN }}
|
||||
- name: Build the App (Linux)
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
uses: addnab/docker-run-action@v3
|
||||
with:
|
||||
image: ghcr.io/zanzythebar/tauridocker:latest
|
||||
options: -v ${{ github.workspace }}:/workspace
|
||||
run: |
|
||||
echo "::group::install node dependencies"
|
||||
npm install -g pnpm
|
||||
npm install -g typescript
|
||||
pnpm install
|
||||
echo "::group::tauri build"
|
||||
pnpm tauri build
|
||||
echo "::endgroup::"
|
||||
- name: Archive the App (Linux)
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: production-files
|
||||
path: |
|
||||
src-tauri/target/release/bundle/deb/*.deb
|
||||
src-tauri/target/release/bundle/appimage/*.AppImage
|
||||
retention-days: 5
|
||||
if-no-files-found: error
|
||||
- name: Verify build (Linux)
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
run: |
|
||||
ls -la src-tauri/target/release/bundle/appimage
|
||||
ls -la src-tauri/target/release/bundle/deb
|
||||
|
||||
- name: Node.js setup ${{ matrix.node-version }} (Windows & MacOS)
|
||||
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
#cache: "pnpm"
|
||||
# node-version-file: '.nvmrc'
|
||||
|
||||
- name: Install dependencies (Windows & MacOS)
|
||||
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
|
||||
run: |
|
||||
echo "::group::install node dependencies"
|
||||
npm install -g pnpm
|
||||
npm install -g typescript
|
||||
pnpm install
|
||||
echo "::endgroup::"
|
||||
|
||||
- name: Setup Rust (Windows & MacOS)
|
||||
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
default: true
|
||||
override: true
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
target: ${{ matrix.platform.rust_target }}
|
||||
|
||||
- name: Cache Rust (Windows & MacOS)
|
||||
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
|
||||
uses: Swatinem/rust-cache@v2
|
||||
with:
|
||||
workspaces: "./src-tauri -> target"
|
||||
|
||||
- name: Build the app (Windows & MacOS)
|
||||
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
|
||||
uses: JonasKruckenberg/tauri-build@v1.2.3
|
||||
id: tauri_build
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
|
||||
ENABLE_CODE_SIGNING: ${{ env.APPLE_CERTIFICATE }}
|
||||
#APPLE_CERTIFICATE: ${{ env.APPLE_CERTIFICATE }}
|
||||
#APPLE_CERTIFICATE_PASSWORD: ${{ env.APPLE_CERTIFICATE_PASSWORD }}
|
||||
#APPLE_SIGNING_IDENTITY: ${{ env.APPLE_SIGNING_IDENTITY }}
|
||||
#APPLE_ID: ${{ env.APPLE_ID }}
|
||||
#APPLE_PASSWORD: ${{ env.APPLE_PASSWORD }}
|
||||
with:
|
||||
target: ${{ matrix.platform.rust_target }}
|
||||
|
||||
- name: Archive the App (Windows & MacOS)
|
||||
if: matrix.platform == 'windows-latest' || matrix.platform == 'macos-latest'
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: production-files
|
||||
path: "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}"
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
name: Deploy
|
||||
needs: [build]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Create Directory
|
||||
run: mkdir -p dist
|
||||
- name: Download artifact
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: production-files
|
||||
path: ./dist
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
- run: npm install -g conventional-changelog-conventionalcommits
|
||||
- run: npm install -g semantic-release@v21.0.2
|
||||
- run: npm install -g @semantic-release/exec
|
||||
- run: npm install -g @semantic-release/git
|
||||
- run: npm install -g @semantic-release/release-notes-generator
|
||||
- run: npm install -g @semantic-release/changelog
|
||||
- run: npm install -g @semantic-release/github
|
||||
- name: Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }}
|
||||
run: |
|
||||
sudo apt-get install -y jq
|
||||
chmod +x ./scripts/prepareCMD.sh
|
||||
semantic-release
|
||||
|
||||
cleanup:
|
||||
name: Cleanup actions
|
||||
needs:
|
||||
- deploy
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: "♻️ remove build artifacts"
|
||||
uses: geekyeggo/delete-artifact@v1
|
||||
with:
|
||||
name: production-files
|
||||
1
.gitignore
vendored
|
|
@ -14,4 +14,3 @@
|
|||
/dist
|
||||
/.vs
|
||||
/web/docs/
|
||||
pnpm-lock.yaml
|
||||
194
.releaserc
Normal file
|
|
@ -0,0 +1,194 @@
|
|||
{
|
||||
"branches": [
|
||||
"main",
|
||||
"master",
|
||||
"release",
|
||||
{
|
||||
"name": "tauri",
|
||||
"prerelease": true
|
||||
},
|
||||
{
|
||||
"name": "feature/tauri",
|
||||
"prelease": true
|
||||
}
|
||||
],
|
||||
"plugins": [
|
||||
[
|
||||
"@semantic-release/commit-analyzer",
|
||||
{
|
||||
"preset": "conventionalcommits",
|
||||
"parserOpts": {
|
||||
"noteKeywords": [
|
||||
"BREAKING CHANGE",
|
||||
"BREAKING CHANGES",
|
||||
"BREAKING"
|
||||
]
|
||||
},
|
||||
"releaseRules": [
|
||||
{
|
||||
"breaking": true,
|
||||
"release": "major"
|
||||
},
|
||||
{
|
||||
"type": "feat",
|
||||
"release": "minor"
|
||||
},
|
||||
{
|
||||
"type": "fix",
|
||||
"release": "patch"
|
||||
},
|
||||
{
|
||||
"type": "perf",
|
||||
"release": "patch"
|
||||
},
|
||||
{
|
||||
"type": "revert",
|
||||
"release": "patch"
|
||||
},
|
||||
{
|
||||
"type": "docs",
|
||||
"scope": "docs-*",
|
||||
"release": "minor"
|
||||
},
|
||||
{
|
||||
"type": "docs",
|
||||
"release": false
|
||||
},
|
||||
{
|
||||
"type": "style",
|
||||
"release": "patch"
|
||||
},
|
||||
{
|
||||
"type": "refactor",
|
||||
"release": "patch"
|
||||
},
|
||||
{
|
||||
"type": "test",
|
||||
"release": "patch"
|
||||
},
|
||||
{
|
||||
"type": "build",
|
||||
"release": "patch"
|
||||
},
|
||||
{
|
||||
"type": "ci",
|
||||
"scope": "ci-*",
|
||||
"release": "patch"
|
||||
},
|
||||
{
|
||||
"type": "chore",
|
||||
"release": false
|
||||
},
|
||||
{
|
||||
"type": "no-release",
|
||||
"release": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/release-notes-generator",
|
||||
{
|
||||
"preset": "conventionalcommits",
|
||||
"parserOpts": {
|
||||
"noteKeywords": [
|
||||
"BREAKING CHANGE",
|
||||
"BREAKING CHANGES",
|
||||
"BREAKING"
|
||||
]
|
||||
},
|
||||
"writerOpts": {
|
||||
"commitsSort": [
|
||||
"subject",
|
||||
"scope"
|
||||
]
|
||||
},
|
||||
"presetConfig": {
|
||||
"types": [
|
||||
{
|
||||
"type": "feat",
|
||||
"section": "🍕 Features"
|
||||
},
|
||||
{
|
||||
"type": "feature",
|
||||
"section": "🍕 Features"
|
||||
},
|
||||
{
|
||||
"type": "fix",
|
||||
"section": "🐛 Bug Fixes"
|
||||
},
|
||||
{
|
||||
"type": "perf",
|
||||
"section": "🔥 Performance Improvements"
|
||||
},
|
||||
{
|
||||
"type": "revert",
|
||||
"section": "⏩ Reverts"
|
||||
},
|
||||
{
|
||||
"type": "docs",
|
||||
"section": "📝 Documentation"
|
||||
},
|
||||
{
|
||||
"type": "style",
|
||||
"section": "🎨 Styles"
|
||||
},
|
||||
{
|
||||
"type": "refactor",
|
||||
"section": "🧑💻 Code Refactoring"
|
||||
},
|
||||
{
|
||||
"type": "test",
|
||||
"section": "✅ Tests"
|
||||
},
|
||||
{
|
||||
"type": "build",
|
||||
"section": "🤖 Build System"
|
||||
},
|
||||
{
|
||||
"type": "ci",
|
||||
"section": "🔁 Continuous Integration"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/changelog",
|
||||
{
|
||||
"changelogTitle": "# 📦 Changelog \n[](https://conventionalcommits.org)\n[](https://semver.org)\n> All notable changes to this project will be documented in this file"
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/exec",
|
||||
{
|
||||
"prepareCmd": "./scripts/prepareCMD.sh ${nextRelease.version}",
|
||||
"publishCmd": "echo Publishing ${nextRelease.version}"
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/github",
|
||||
{
|
||||
"addReleases": "bottom",
|
||||
"assets": [
|
||||
{
|
||||
"path": "./dist/**/*.{msi,deb,rpm,AppImage,dmg,zip}"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/git",
|
||||
{
|
||||
"assets": [
|
||||
"package.json",
|
||||
"src-tauri/tauri.conf.json",
|
||||
"src-tauri/Cargo.toml",
|
||||
"LICENSE*",
|
||||
"CHANGELOG.md"
|
||||
],
|
||||
"message": "chore(${nextRelease.type}): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
3
.vscode/extensions.json
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer", "esbenp.prettier-vscode"]
|
||||
}
|
||||
6
.vscode/settings.json
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll": true
|
||||
},
|
||||
"cSpell.words": ["appimage", "clippy", "jsketcher", "shakram", "tamasfe"]
|
||||
}
|
||||
89
CHANGELOG.md
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
# 📦 Changelog
|
||||
[](https://conventionalcommits.org)
|
||||
[](https://semver.org)
|
||||
> All notable changes to this project will be documented in this file
|
||||
|
||||
## [1.0.0-tauri.4](https://github.com/ZanzyTHEbar/jsketcher/compare/v1.0.0-tauri.3...v1.0.0-tauri.4) (2023-05-11)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
* wasm not loading in webkit ([0e74582](https://github.com/ZanzyTHEbar/jsketcher/commit/0e7458284831c946c6a0b0b4e4ded96bd4ceffa7))
|
||||
|
||||
## [1.0.0-tauri.3](https://github.com/ZanzyTHEbar/jsketcher/compare/v1.0.0-tauri.2...v1.0.0-tauri.3) (2023-05-11)
|
||||
|
||||
|
||||
### 🍕 Features
|
||||
|
||||
* update rust deps ([b809c28](https://github.com/ZanzyTHEbar/jsketcher/commit/b809c28b8cba7a3354cf1f8f8f9917d1f1c9e653))
|
||||
|
||||
## [1.0.0-tauri.2](https://github.com/ZanzyTHEbar/jsketcher/compare/v1.0.0-tauri.1...v1.0.0-tauri.2) (2023-05-11)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
* appimage failing to build ([8dc6217](https://github.com/ZanzyTHEbar/jsketcher/commit/8dc62170a9be15f1ab1f20d9b7db5f3fa8e371b5))
|
||||
* test ubuntu 18.04 ([8f55f4d](https://github.com/ZanzyTHEbar/jsketcher/commit/8f55f4d1c1a0bc036441453266c5c5d3ea9c4c65))
|
||||
* test ubuntu 18.04 ([0afd146](https://github.com/ZanzyTHEbar/jsketcher/commit/0afd14642bb12107622bc39db41417c6f7d23c61))
|
||||
|
||||
|
||||
### 🍕 Features
|
||||
|
||||
* update ci to use docker container ([7bcacb0](https://github.com/ZanzyTHEbar/jsketcher/commit/7bcacb0251eb934bd020022433641475782c240e))
|
||||
* update ci to use docker container ([98de939](https://github.com/ZanzyTHEbar/jsketcher/commit/98de93981f3cb6bda3763a4eb4ce85b201145c78))
|
||||
* update ci to use docker container ([0750c00](https://github.com/ZanzyTHEbar/jsketcher/commit/0750c006f3f49f5f22205f4a6303e33627ddcbe2))
|
||||
* update ci to use docker container ([715780f](https://github.com/ZanzyTHEbar/jsketcher/commit/715780f8f6b106b6f1e0e5f19f6145d940aa79ec))
|
||||
* update ci to use docker container ([ccbacdb](https://github.com/ZanzyTHEbar/jsketcher/commit/ccbacdba32268fb8990d2b5455329014ef04d3ca))
|
||||
* update ci to use docker container ([60aa80d](https://github.com/ZanzyTHEbar/jsketcher/commit/60aa80d636affd2334526cc4569940cf9ceb77c5))
|
||||
* update ci to use docker container ([f629258](https://github.com/ZanzyTHEbar/jsketcher/commit/f629258426c7b3a52b4cdce2a120652d3e9727f6))
|
||||
* update ci to use docker container ([278cf82](https://github.com/ZanzyTHEbar/jsketcher/commit/278cf82ceaae8e76231780ab571e53e8658a3463))
|
||||
* update ci to use docker container ([02ec38c](https://github.com/ZanzyTHEbar/jsketcher/commit/02ec38c1b7f9ef6b2af5df22ca4b7ae9ceb86151))
|
||||
* update ci to use docker container ([8fb7924](https://github.com/ZanzyTHEbar/jsketcher/commit/8fb7924dc295aad48f798fd024f8a9394a53d4ba))
|
||||
* update ci to use docker container ([d0493b3](https://github.com/ZanzyTHEbar/jsketcher/commit/d0493b3e0ca956b2a5ade8c3c2deac0f78b7d16a))
|
||||
* update ci to use docker container ([09fbb4f](https://github.com/ZanzyTHEbar/jsketcher/commit/09fbb4f9b9b714a013207133963cc5de5934ca3e))
|
||||
* update ci to use docker container ([c7e39b9](https://github.com/ZanzyTHEbar/jsketcher/commit/c7e39b92f79f6d6d8fa5553e36008eb82f1da8be))
|
||||
* update ci to use docker container ([d9221a7](https://github.com/ZanzyTHEbar/jsketcher/commit/d9221a77fe581532de86b9f05a198ccca447781a))
|
||||
* update ci to use docker container ([9e96489](https://github.com/ZanzyTHEbar/jsketcher/commit/9e96489eb762a06f5256a838af90cb6e7035f387))
|
||||
* update ci to use docker container ([765b708](https://github.com/ZanzyTHEbar/jsketcher/commit/765b708a19fb8fbcb1c2c98395c0570a6b3eef0a))
|
||||
* update ci to use docker container ([484b722](https://github.com/ZanzyTHEbar/jsketcher/commit/484b722a49be1c8259e93121b6cea5e1b438f865))
|
||||
* update ci to use docker container ([1023d90](https://github.com/ZanzyTHEbar/jsketcher/commit/1023d905291e6d92dd19f23c1abd031fe2ae242b))
|
||||
* update ci to use docker container ([1d9fd84](https://github.com/ZanzyTHEbar/jsketcher/commit/1d9fd84aa23984ae9450f940bc2533447ef46d95))
|
||||
|
||||
## 1.0.0-tauri.1 (2023-05-09)
|
||||
|
||||
|
||||
### ⚠ BREAKING CHANGES
|
||||
|
||||
* CHANGES
|
||||
|
||||
### 🍕 Features
|
||||
|
||||
* add setup scripts for setting up tauri dev environment ([0c41a33](https://github.com/ZanzyTHEbar/jsketcher/commit/0c41a33d0e9dee8ecd645d04e9eb551980680941))
|
||||
* **dxf:** add support for dimensions in dxf. ([56c884c](https://github.com/ZanzyTHEbar/jsketcher/commit/56c884ccfd551e0b2dcbee0fc0a0eff62fb6a338))
|
||||
* add support for dxf blocks ([#200](https://github.com/ZanzyTHEbar/jsketcher/issues/200)) ([322d47f](https://github.com/ZanzyTHEbar/jsketcher/commit/322d47f80255d01b8bfcbaa110f0e790e91fa0d1))
|
||||
* add support for dxf files import ([2fa2866](https://github.com/ZanzyTHEbar/jsketcher/commit/2fa2866296068bb785f3adeb6e18afe19a698100))
|
||||
* finish up CI system ([5a688d1](https://github.com/ZanzyTHEbar/jsketcher/commit/5a688d1a9eec64d210ea140c9f9584fb4079a245))
|
||||
* initial cir release ([2f94a6e](https://github.com/ZanzyTHEbar/jsketcher/commit/2f94a6eb82c91757d5e4b21ae4956dda3aadddfc))
|
||||
* initial tauri commit ([0a0bb54](https://github.com/ZanzyTHEbar/jsketcher/commit/0a0bb5485e8f8d513115f210c57074d0e3e1c93e))
|
||||
* update tauri version ([90168da](https://github.com/ZanzyTHEbar/jsketcher/commit/90168da42c37424180dece3c62acc2ca5f83dd50))
|
||||
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
* .releasesrc file not having a main branch ([04f2e2c](https://github.com/ZanzyTHEbar/jsketcher/commit/04f2e2c6b77ee76bb14a584e7c7b273d5a0f5884))
|
||||
* .releasesrc file not having a main branch ([25ae8a4](https://github.com/ZanzyTHEbar/jsketcher/commit/25ae8a464b90535596827ca023af93bb2fb64a0a))
|
||||
* **dxf:** add dimLayers to the export. ([#183](https://github.com/ZanzyTHEbar/jsketcher/issues/183)) ([a3349b5](https://github.com/ZanzyTHEbar/jsketcher/commit/a3349b5da4c61de42ccebac76978da10c9e2d8f3))
|
||||
* fix app not loading on linux builds ([9ef599d](https://github.com/ZanzyTHEbar/jsketcher/commit/9ef599ddc9e7175f35b9aa70c4a5b29210c797d5))
|
||||
* fix release asset types ([8f73410](https://github.com/ZanzyTHEbar/jsketcher/commit/8f73410c7434d7c055fb405fcf11b99adf033db2))
|
||||
* release to tauri ([0ba5387](https://github.com/ZanzyTHEbar/jsketcher/commit/0ba5387601ccf883021b18016de270b3be8e57c5))
|
||||
* release to tauri branch ([11fcf2e](https://github.com/ZanzyTHEbar/jsketcher/commit/11fcf2e87acfd5e7cc9ac822046d405326b7d41b))
|
||||
* release to tauri branch ([e8486a5](https://github.com/ZanzyTHEbar/jsketcher/commit/e8486a5e65d73bcb7bc6044147d4c9e8e7c36923))
|
||||
* release to tauri branch ([6076573](https://github.com/ZanzyTHEbar/jsketcher/commit/6076573c989fb627453eb110d4ff5b8a79cc3ff0))
|
||||
* remove caching of pnpm in ci ([96165f3](https://github.com/ZanzyTHEbar/jsketcher/commit/96165f3e1e24ef90cfc1c131ab681313f94b6d89))
|
||||
* remove old path ([f0b426c](https://github.com/ZanzyTHEbar/jsketcher/commit/f0b426c14fecae1d09e06039ce273789693742ee))
|
||||
* remove repo from package.json ([dd099b8](https://github.com/ZanzyTHEbar/jsketcher/commit/dd099b8ad8df081254f005ade8eaeef8978c215f))
|
||||
* script for linux ([46bda82](https://github.com/ZanzyTHEbar/jsketcher/commit/46bda827261d9d17d0c09acbb7ec98972c8c5d8a))
|
||||
* semantic-release ([3edb4cf](https://github.com/ZanzyTHEbar/jsketcher/commit/3edb4cf63516fe70f6cf2175c194bfaa03f25a6e))
|
||||
* Update .releaserc ([3343d2c](https://github.com/ZanzyTHEbar/jsketcher/commit/3343d2cb4aed2facf5dbe14f4c8f8fca54e19c8c))
|
||||
* update readme ([b00299d](https://github.com/ZanzyTHEbar/jsketcher/commit/b00299d5c1b1e199c1c0ca0dac49d42e204c5b29))
|
||||
* windows failing to build ([def0782](https://github.com/ZanzyTHEbar/jsketcher/commit/def0782b76181ed7fbb662805d54abc703cb35c3))
|
||||
37
Gruntfile.js
|
|
@ -4,11 +4,11 @@ const webpackConfig = require('./webpack.config');
|
|||
const del = require('del');
|
||||
const libAssets = require("./build/libAssets");
|
||||
const glob = require("glob");
|
||||
const {marked} = require("marked");
|
||||
const { marked } = require("marked");
|
||||
const Handlebars = require("handlebars");
|
||||
const exec = require('child_process').exec;
|
||||
|
||||
module.exports = function(grunt) {
|
||||
module.exports = function (grunt) {
|
||||
grunt.loadNpmTasks('grunt-contrib-copy');
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
|
||||
|
|
@ -44,11 +44,11 @@ module.exports = function(grunt) {
|
|||
},
|
||||
|
||||
resources: {
|
||||
expand: true,
|
||||
cwd: 'web',
|
||||
src: '**',
|
||||
dest: 'dist/',
|
||||
filter: dirFilter(['web/app', 'web/test'])
|
||||
expand: true,
|
||||
cwd: 'web',
|
||||
src: '**',
|
||||
dest: 'dist/',
|
||||
filter: dirFilter(['web/app', 'web/test'])
|
||||
},
|
||||
|
||||
docs: {
|
||||
|
|
@ -60,11 +60,11 @@ module.exports = function(grunt) {
|
|||
}
|
||||
});
|
||||
|
||||
grunt.registerTask('clean', function() {
|
||||
grunt.registerTask('clean', function () {
|
||||
del.sync('dist');
|
||||
});
|
||||
|
||||
grunt.registerTask('build', function() {
|
||||
grunt.registerTask('build', function () {
|
||||
const done = this.async();
|
||||
webpack(webpackConfig, function (error) {
|
||||
if (error) {
|
||||
|
|
@ -75,17 +75,18 @@ module.exports = function(grunt) {
|
|||
});
|
||||
});
|
||||
|
||||
grunt.registerTask('show-revision', function() {
|
||||
grunt.registerTask('show-revision', function () {
|
||||
const done = this.async();
|
||||
exec('git rev-parse --short HEAD', (err, stdout, stderr) => {
|
||||
if (process.env.CI_BUILD_REF) exec('git rev-parse --short HEAD', (err, stdout, stderr) => {
|
||||
grunt.log.writeln(stdout);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
grunt.registerTask('mark-revision', function() {
|
||||
grunt.registerTask('mark-revision', function () {
|
||||
const done = this.async();
|
||||
exec('mkdir -p dist && git rev-parse HEAD > dist/.rev', function (err, stdout, stderr) {
|
||||
|
||||
if (process.env.CI_BUILD_REF) exec('git rev-parse HEAD > dist/.rev', function (err, stdout, stderr) {
|
||||
done(err);
|
||||
});
|
||||
});
|
||||
|
|
@ -94,7 +95,7 @@ module.exports = function(grunt) {
|
|||
|
||||
grunt.registerTask('gen-docs', ['copy:docs', 'process-markdown']);
|
||||
|
||||
grunt.registerTask('process-markdown', function() {
|
||||
grunt.registerTask('process-markdown', function () {
|
||||
const done = this.async();
|
||||
|
||||
const mainTemplate = Handlebars.compile(grunt.file.read("modules/doc/doc-layout.handlebars"));
|
||||
|
|
@ -120,7 +121,7 @@ module.exports = function(grunt) {
|
|||
let link = file.substring(file.indexOf('/') + 1); //drop web prefix
|
||||
workbench.operations.push({
|
||||
operationName,
|
||||
href: '../../../../../../' + convertMdPathToHtml(link)
|
||||
href: '../../../../../../' + convertMdPathToHtml(link)
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -138,7 +139,7 @@ module.exports = function(grunt) {
|
|||
|
||||
grunt.file.write(dest, htmlContent);
|
||||
|
||||
console.log("generated "+ dest);
|
||||
console.log("generated " + dest);
|
||||
})
|
||||
done();
|
||||
});
|
||||
|
|
@ -148,11 +149,11 @@ module.exports = function(grunt) {
|
|||
};
|
||||
|
||||
function convertMdPathToHtml(mdPath) {
|
||||
return mdPath.substring(0, mdPath.length-('.md'.length)) + '.html';
|
||||
return mdPath.substring(0, mdPath.length - ('.md'.length)) + '.html';
|
||||
}
|
||||
|
||||
function fixLinks(htmlContent) {
|
||||
return htmlContent.replace(/href=['"](.+)['"]/g, function(expr, link){
|
||||
return htmlContent.replace(/href=['"](.+)['"]/g, function (expr, link) {
|
||||
return 'href="' + convertMdPathToHtml(link) + '"';
|
||||
});
|
||||
}
|
||||
138
README.md
|
|
@ -1,4 +1,5 @@
|
|||
JSketcher
|
||||
# JSketcher
|
||||
|
||||
===========
|
||||

|
||||
|
||||
|
|
@ -20,86 +21,119 @@ Sketch solver is completely implemented in javascript/typescript.
|
|||
|
||||
[Workbench Dev Guide](./dev-guide/index.md)
|
||||
|
||||
[Comercial Licencing](https://www.autodrop3d.com/parametric-cad-beta.html)
|
||||
[Commercial Licensing](https://www.autodrop3d.com/parametric-cad-beta.html)
|
||||
|
||||
|
||||
Please consider supporting this project by becoming a backer
|
||||
|
||||
==============
|
||||
<a href="https://opencollective.com/jsketcher-ad3d/"><image src="https://opencollective.com/jsketcher-ad3d/tiers/backer.svg?avatarHeight=300&width=3000"></image><image src="https://opencollective.com/jsketcher-ad3d/tiers/badge.svg"></image></a>
|
||||
|
||||
Current Status
|
||||
## Current Status
|
||||
|
||||
==============
|
||||
|
||||
JSketcher is a parametric 3d modeler employing a 2D constraint solver for sketches and the feature/history metaphor to build models. The 2D constraint solver is completely written in javascript/typescript and is implemented in both the 3D CAD and the 2D sketcher. Originally developed by xibyte to make models for 3d printing. Today JSketcher provides a rich set of tools for visualizing, selecting/interacting with 3D geometry, tracking and storing model history all built on the foundation of the 2D sketcher engine and employing a custom wasm build of the OpenCascade kernel (https://github.com/Autodrop3d/occt-interpreter) for solid modeling operations.
|
||||
`JSketcher` is a _parametric_ 3d modeler employing a 2D constraint solver for sketches and the feature/history metaphor to build models. The 2D constraint solver is completely written in javascript/typescript and is implemented in both the 3D CAD and the 2D sketcher. Originally developed by [`xibyte`](https://github.com/xibyte) to make models for 3d printing. Today `JSketcher` provides a rich set of tools for visualizing, selecting/interacting with 3D geometry, tracking and storing model history all built on the foundation of the 2D sketcher engine and employing a custom wasm build of the [OpenCascade kernel](https://github.com/Autodrop3d/occt-interpreter) for solid modeling operations.
|
||||
|
||||
## Major Components and features
|
||||
|
||||
Major Components and features
|
||||
==============
|
||||
* Geometric Constraint Solver. This is a most crucial component which allows to solve a system of geometric constraints applied to a sketch.
|
||||
See below the list of supported constraints.
|
||||
* 2D Sketcher. Allows to design 2d sketches applying geometric constraints. Uses HTML5 canvas for rendering.
|
||||
* 3D Boolean engine. OpenCascade is used to perform booleans on BREP objects.
|
||||
* Feature History. Accumulates features builds a 3d model step by step. A compare step is employed to propagate edge/face IDs forward to provide a stable and robust model.
|
||||
* Export to **STL**, **DWG** and **SVG** formats
|
||||
* Saving projects in the browser locale storage
|
||||
* Repository of dimensions. For example if there is a line length constraint applied, it's not necessary to hardcode some length value.
|
||||
A dimension with a symbolic name can be created and the constraint can refer to that dimension by name.
|
||||
Once value of dimension gets changed the sketch is resolved again accordingly to the new dimension values.
|
||||
* 2D measurement tool. Allows adding dimensions on a 2D drawing(Linear, Vertical, Horizontal and Arc/Circle dimension are supported)
|
||||
* No any server-side needed. Only client side Javascript and wasm.
|
||||
|
||||
- Geometric Constraint Solver. This is a most crucial component which allows to solve a system of geometric constraints applied to a sketch.
|
||||
|
||||
> See below the list of supported constraints.
|
||||
|
||||
- 2D Sketcher. Allows to design 2d sketches applying geometric constraints. Uses HTML5 canvas for rendering.
|
||||
- 3D Boolean engine. OpenCascade is used to perform booleans on `BREP` objects.
|
||||
- Feature History. Accumulates features builds a 3d model step by step. A compare step is employed to propagate edge/face IDs forward to provide a stable and robust model.
|
||||
- Export to **STL**, **DWG** and **SVG** formats
|
||||
- Saving projects in the browser locale storage
|
||||
- Repository of dimensions. For example if there is a line length constraint applied, it's not necessary to hardcode some length value.
|
||||
|
||||
> **Note**: A dimension with a symbolic name can be created and the constraint can refer to that dimension by name. Once value of dimension gets changed the sketch is resolved again accordingly to the new dimension values.
|
||||
|
||||
- 2D measurement tool. Allows adding dimensions on a 2D drawing(Linear, Vertical, Horizontal and Arc/Circle dimension are supported)
|
||||
- No any server-side needed. Only client side Javascript and wasm.
|
||||
|
||||
This modeler is already used for:
|
||||
|
||||
* Designing of 3d models to get them 3d-printed. 3D models are based on parametric 2d sketches. All models can be exported as an STL file and 3d-printed after.
|
||||
* Creating of 2d parametric sketches which could be exported to DWG or SVG format.
|
||||
- Designing of 3d models to get them 3d-printed. 3D models are based on parametric `2D` sketches. All models can be exported as an STL file and 3d-printed after.
|
||||
- Creating of 2d parametric sketches which could be exported to DWG or SVG format.
|
||||
|
||||
## Supported Constraints
|
||||
|
||||
Supported Constraints
|
||||
=====================
|
||||
|
||||
* Coincident
|
||||
* Vertical
|
||||
* Horizontal
|
||||
* Parallel
|
||||
* Perpendicular
|
||||
* Point to Line Distance
|
||||
* Point to Object Distance
|
||||
* Entity Equality(radius/length)
|
||||
* Tangent
|
||||
* Radius
|
||||
* Point On Line
|
||||
* Point On Arc / Ellipse
|
||||
* Point In Middle
|
||||
* Angle
|
||||
* Symmetry
|
||||
* Lock Convexity
|
||||
* Fillet Meta Constraint
|
||||
- Coincident
|
||||
- Vertical
|
||||
- Horizontal
|
||||
- Parallel
|
||||
- Perpendicular
|
||||
- Point to Line Distance
|
||||
- Point to Object Distance
|
||||
- Entity Equality(radius/length)
|
||||
- Tangent
|
||||
- Radius
|
||||
- Point On Line
|
||||
- Point On Arc / Ellipse
|
||||
- Point In Middle
|
||||
- Angle
|
||||
- Symmetry
|
||||
- Lock Convexity
|
||||
- Fillet Meta Constraint
|
||||
|
||||
## Get Started With the Code
|
||||
|
||||
Get Started With the Code
|
||||
=========================
|
||||
|
||||
Install node.js
|
||||
```
|
||||
npm install
|
||||
npm start
|
||||
```
|
||||
Goto http://localhost:3000 using your browser. Tested on google chrome but known to work in firefox and edge.
|
||||
### Install node.js and packages
|
||||
|
||||
For this step, you can use any package manager you like.
|
||||
|
||||
We recommend using `pnpm`
|
||||
|
||||
```bash
|
||||
npm install -g pnpm
|
||||
```
|
||||
|
||||
```bash
|
||||
pnpm install
|
||||
pnpm start
|
||||
```
|
||||
|
||||
Navigate `http://localhost:3000` using your browser. Tested on google chrome but known to work in firefox and edge.
|
||||
|
||||
Generate `Tauri` Build for desktop
|
||||
|
||||
Generate Electron Build for desktop
|
||||
=========================
|
||||
|
||||
|
||||
### Install Tauri Deps
|
||||
|
||||
Navigate to the [scripts](./scripts/) folder and run the following command:
|
||||
|
||||
```bash
|
||||
chmod +x ./setup_tauri.sh
|
||||
```
|
||||
npm run electron:package:linux
|
||||
npm run electron:package:win
|
||||
npm run electron:package:mac
|
||||
|
||||
|
||||
### Build for Desktop
|
||||
|
||||
```bash
|
||||
pnpm tauri build
|
||||
```
|
||||
|
||||
The resulting binary will be placed in the dist folder that is generated.
|
||||
|
||||
Note:
|
||||
Build targeting windows from linux requires wine to be installed.
|
||||
> **Note**: Build targeting windows from linux requires wine to be installed.
|
||||
|
||||
Linux build produces app image and deb for installation.
|
||||
To use the app image you must do a 'chmod +x jsketcher-*.*.*.AppImage'
|
||||
To use the app image you must do a `chmod`:
|
||||
|
||||
```bash
|
||||
chmod +x jsketcher-*.*.*.AppImage
|
||||
```
|
||||
|
||||
Contributing Please see [.github/CONTRIBUTING.md](.github/CONTRIBUTING.md )
|
||||
|
||||
Contributing Please see [.github/CONTRIBUTING.md ](.github/CONTRIBUTING.md )
|
||||
=========================
|
||||
|
|
|
|||
102
electron.js
|
|
@ -1,102 +0,0 @@
|
|||
|
||||
// Modules to control application life and create native browser window
|
||||
// Module to control the application lifecycle and the native browser window.
|
||||
const { app, BrowserWindow, protocol } = require("electron");
|
||||
const path = require("path");
|
||||
const url = require("url");
|
||||
|
||||
// Create the native browser window.
|
||||
function createWindow() {
|
||||
const mainWindow = new BrowserWindow({
|
||||
width: 1300 ,
|
||||
height: 850,
|
||||
minWidth: 500,
|
||||
minHeight: 500,
|
||||
autoHideMenuBar:false,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
contextIsolation: true,
|
||||
devTools: true,
|
||||
},
|
||||
});
|
||||
|
||||
// In production, set the initial browser path to the local bundle generated
|
||||
// by the Create React App build process.
|
||||
// In development, set it to localhost to allow live/hot-reloading.
|
||||
const appURL = app.isPackaged
|
||||
? url.format({
|
||||
pathname: path.join(__dirname, "/dist/index.html"),
|
||||
protocol: "file:",
|
||||
slashes: true,
|
||||
})
|
||||
: "http://localhost:3000";
|
||||
mainWindow.loadURL(appURL);
|
||||
mainWindow.maximize()
|
||||
|
||||
// Automatically open Chrome's DevTools in development mode.
|
||||
if (!app.isPackaged) {
|
||||
mainWindow.webContents.openDevTools();
|
||||
}
|
||||
}
|
||||
|
||||
// Setup a local proxy to adjust the paths of requested files when loading
|
||||
// them from the local production bundle (e.g.: local fonts, etc...).
|
||||
function setupLocalFilesNormalizerProxy() {
|
||||
protocol.registerHttpProtocol(
|
||||
"file",
|
||||
(request, callback) => {
|
||||
const url = request.url.substr(8);
|
||||
callback({ path: path.normalize(`${__dirname}/${url}`) });
|
||||
},
|
||||
(error) => {
|
||||
if (error) console.error("Failed to register protocol");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// This method will be called when Electron has finished its initialization and
|
||||
// is ready to create the browser windows.
|
||||
// Some APIs can only be used after this event occurs.
|
||||
app.whenReady().then(() => {
|
||||
createWindow();
|
||||
setupLocalFilesNormalizerProxy();
|
||||
|
||||
app.on("activate", function () {
|
||||
// On macOS it's common to re-create a window in the app when the
|
||||
// dock icon is clicked and there are no other windows open.
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createWindow();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Quit when all windows are closed, except on macOS.
|
||||
// There, it's common for applications and their menu bar to stay active until
|
||||
// the user quits explicitly with Cmd + Q.
|
||||
app.on("window-all-closed", function () {
|
||||
if (process.platform !== "darwin") {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
|
||||
// If your app has no need to navigate or only needs to navigate to known pages,
|
||||
// it is a good idea to limit navigation outright to that known scope,
|
||||
// disallowing any other kinds of navigation.
|
||||
const allowedNavigationDestinations = "https://my-electron-app.com";
|
||||
app.on("web-contents-created", (event, contents) => {
|
||||
contents.on("will-navigate", (event, navigationUrl) => {
|
||||
const parsedUrl = new URL(navigationUrl);
|
||||
|
||||
if (!allowedNavigationDestinations.includes(parsedUrl.origin)) {
|
||||
event.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// In this file you can include the rest of your app's specific main process
|
||||
// code. You can also put them in separate files and require them here.
|
||||
|
||||
/*
|
||||
const mainWindow = new BrowserWindow({
|
||||
|
||||
})*/
|
||||
25945
package-lock.json
generated
76
package.json
|
|
@ -1,68 +1,10 @@
|
|||
{
|
||||
"name": "jsketcher",
|
||||
"version": "0.1.0",
|
||||
"main": "electron.js",
|
||||
"version": "1.0.0",
|
||||
"private": true,
|
||||
"description": "JS.Sketcher is a parametric 2D and 3D CAD modeler written in pure javascript",
|
||||
"build": {
|
||||
"appId": "jsketcher",
|
||||
"linux": {
|
||||
"category": "Utility",
|
||||
"icon": "icon.png",
|
||||
"target": [
|
||||
"deb",
|
||||
"appImage"
|
||||
]
|
||||
},
|
||||
"deb": {
|
||||
"depends": [
|
||||
"gconf2",
|
||||
"gconf-service",
|
||||
"libnotify4",
|
||||
"libappindicator1",
|
||||
"libxtst6",
|
||||
"libnss3"
|
||||
]
|
||||
},
|
||||
"win": {
|
||||
"icon": "icon.png"
|
||||
},
|
||||
"mac": {
|
||||
"icon": "icon.icns",
|
||||
"category": "public.app-category.utilities"
|
||||
},
|
||||
"files": [
|
||||
"build/*",
|
||||
"dev-guide",
|
||||
"misc/*",
|
||||
"modules/**/**/*",
|
||||
"node_modules/**/**/*",
|
||||
"public/*",
|
||||
"test/**/**/*",
|
||||
"web/**/**/*",
|
||||
".babelrc",
|
||||
".eslintrc.json",
|
||||
".gitignore",
|
||||
"externals.d.ts",
|
||||
"Gruntfile.js",
|
||||
"cypress.json",
|
||||
"package.json",
|
||||
"package-lock.json",
|
||||
"tsconfig.json",
|
||||
"electron.js",
|
||||
"dist/**/*",
|
||||
"webpack.config.js"
|
||||
],
|
||||
"extraMetadata": {
|
||||
"main": "public/electron.js"
|
||||
},
|
||||
"directories": {
|
||||
"buildResources": "build"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"start": "node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.config.js --port 3000 --host 0.0.0.0",
|
||||
"electron": "concurrently \"cross-env BROWSER=none yarn start\" \"wait-on http://localhost:3000 && electron .\"",
|
||||
"pack": "node ./node_modules/webpack/bin/webpack.js --config webpack.config.js --progress --profile --colors",
|
||||
"start-with-docs": "concurrently --kill-others 'npm start' './node_modules/grunt/bin/grunt docs-start'",
|
||||
"build": "grunt",
|
||||
|
|
@ -72,13 +14,11 @@
|
|||
"checks-passed-banner": "echo 'All conditions passed. Ready to go to the main branch. Good job!'",
|
||||
"before-main-branch-merge": "npm run lint && npm run check-code && npm run checks-passed-banner",
|
||||
"cypress": "npx cypress open",
|
||||
"electron:package:mac": "npm run build && electron-builder -m -c.extraMetadata.main=electron.js",
|
||||
"electron:package:win": "npm run build && electron-builder -w -c.extraMetadata.main=electron.js",
|
||||
"electron:package:linux": "npm run build && electron-builder -l -c.extraMetadata.main=electron.js"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/xibyte/jsketcher.git"
|
||||
"tauri:dev": "tauri dev",
|
||||
"tauri:build": "tauri build",
|
||||
"tauri:dev:release": "tauri dev --release",
|
||||
"tauri:build:dev": "tauri build --debug",
|
||||
"tauri:clean": "cd src-tauri && cargo clean"
|
||||
},
|
||||
"keywords": [
|
||||
"parametric",
|
||||
|
|
@ -103,6 +43,7 @@
|
|||
"@babel/preset-react": "^7.18.6",
|
||||
"@babel/preset-stage-2": "^7.8.3",
|
||||
"@babel/preset-typescript": "^7.18.6",
|
||||
"@tauri-apps/cli": "^1.3.1",
|
||||
"@types/react": "^18.0.26",
|
||||
"@types/react-dom": "^18.0.9",
|
||||
"@typescript-eslint/eslint-plugin": "^5.45.1",
|
||||
|
|
@ -117,8 +58,6 @@
|
|||
"cypress": "^12.0.1",
|
||||
"cypress-wait-until": "^1.7.1",
|
||||
"del": "^6.0.0",
|
||||
"electron": "^22.0.0",
|
||||
"electron-builder": "^22.10.3",
|
||||
"eslint": "^8.29.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"file-loader": "^6.2.0",
|
||||
|
|
@ -141,6 +80,7 @@
|
|||
"dependencies": {
|
||||
"@dxfjs/parser": "^0.2.0",
|
||||
"@tarikjabiri/dxf": "^2.6.2",
|
||||
"@tauri-apps/api": "^1.3.0",
|
||||
"@types/three": "^0.146.0",
|
||||
"browser-xml2js": "^0.4.19",
|
||||
"classnames": "^2.3.2",
|
||||
|
|
|
|||
7473
pnpm-lock.yaml
Normal file
10
preload.js
|
|
@ -1,10 +0,0 @@
|
|||
// All of the Node.js APIs are available in the preload process.
|
||||
// It has the same sandbox as a Chrome extension.
|
||||
const { contextBridge } = require("electron");
|
||||
|
||||
// As an example, here we use the exposeInMainWorld API to expose the browsers
|
||||
// and node versions to the main window.
|
||||
// They'll be accessible at "window.versions".
|
||||
process.once("loaded", () => {
|
||||
contextBridge.exposeInMainWorld("versions", process.versions);
|
||||
});
|
||||
78
scripts/prepareCMD.sh
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
#!/bin/bash
|
||||
|
||||
# create a vairable to hold a passed in argument
|
||||
# this argument is the next release version
|
||||
# this is passed in from the .releaserc file
|
||||
|
||||
sudo apt-get install -y jq
|
||||
|
||||
nextReleaseVersion=$1
|
||||
TARGET_KEY="version"
|
||||
|
||||
# parse all letters a-z and A-Z and replace with nothing
|
||||
# this will remove all letters from the version string
|
||||
# this is to ensure that the version string is a valid semver
|
||||
|
||||
# check if there is a letter in the version string
|
||||
# if there is a letter, then remove it
|
||||
# if there is no letter, then do nothing
|
||||
if [[ $nextReleaseVersion =~ [a-zA-Z] ]]; then
|
||||
nextReleaseVersion=$(echo $nextReleaseVersion | sed 's/[a-zA-Z]//g')
|
||||
|
||||
# check if there is a dash in the version string
|
||||
# if there is a dash, then replace it with a dot
|
||||
# if there is no dash, then do nothing
|
||||
if [[ $nextReleaseVersion =~ "-" ]]; then
|
||||
# parse all dashes and replace with dots
|
||||
# this is to ensure that the version string is a valid semver
|
||||
nextReleaseVersion=$(echo $nextReleaseVersion | sed 's/-/./g')
|
||||
|
||||
# remove everything after the third dot and the dot itself
|
||||
# this is to ensure that the version string is a valid semver
|
||||
nextReleaseVersion=$(echo $nextReleaseVersion | sed 's/\.[0-9]*$//g')
|
||||
# remove the last dot
|
||||
nextReleaseVersion=$(echo $nextReleaseVersion | sed 's/\.$//g')
|
||||
fi
|
||||
fi
|
||||
|
||||
# print the next release version
|
||||
|
||||
printf "[prepareCMD.sh]: Next version: ${nextReleaseVersion}\n"
|
||||
|
||||
# This script is used to execute the prepareCMD.sh script on the remote host
|
||||
printf "[prepareCMD.sh]: Executing prepareCMD.sh on remote host \n"
|
||||
|
||||
printf "[prepareCMD.sh]: Updating the version in the package.json file \n"
|
||||
|
||||
# make a temp file
|
||||
tmp=$(mktemp)
|
||||
|
||||
jq --arg a "$nextReleaseVersion" '.version = $a' ./package.json > "$tmp" && mv "$tmp" ./package.json -f
|
||||
|
||||
printf "[prepareCMD.sh]: Done \n"
|
||||
|
||||
printf "[prepareCMD.sh]: Updating the version in the tauri.conf.json file \n"
|
||||
|
||||
jq --arg a "$nextReleaseVersion" '.package.version = $a' ./src-tauri/tauri.conf.json > "$tmp" && mv "$tmp" ./src-tauri/tauri.conf.json -f
|
||||
printf "[prepareCMD.sh]: Done \n"
|
||||
|
||||
#printf "Update the version in the Cargo.toml file \n"
|
||||
#
|
||||
#sed -i "s/version = \"[0-9\\.]*\"/version = \"${nextReleaseVersion}\"/g" ./GUI/ETVR/src-tauri/Cargo.toml
|
||||
|
||||
# Install the dependencies for toml file
|
||||
printf "[prepareCMD.sh]: Installing the dependencies for the toml file \n"
|
||||
|
||||
pip3 install yq
|
||||
|
||||
export PATH="~/.local/bin:$PATH"
|
||||
source ~/.bashrc
|
||||
|
||||
tmp=$(mktemp)
|
||||
tomlq -t --arg version "$nextReleaseVersion" '.package.version |= $version' ./src-tauri/Cargo.toml > "$tmp" && mv "$tmp" ./src-tauri/Cargo.toml -f
|
||||
|
||||
# validate the Cargo.toml file
|
||||
#printf "[prepareCMD.sh]: Validating the Cargo.toml file \n"
|
||||
#cat ./GUI/ETVR/src-tauri/Cargo.toml
|
||||
|
||||
printf "[prepareCMD.sh]: Done, continuing with release. \n"
|
||||
101
scripts/setup_tauri_dev_linux.sh
Executable file
|
|
@ -0,0 +1,101 @@
|
|||
#!/bin/bash
|
||||
|
||||
printf "This Script will setup the tauri dev environment\n"
|
||||
|
||||
# check if the user is running as root
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
printf "Please run as root\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# get user input and store in variable
|
||||
|
||||
printf "Do you want to install the Linux Development Dependencies? (y/n)\n"
|
||||
read -r input
|
||||
|
||||
# check if the user input is y or n
|
||||
|
||||
#if [ "$input" == "y" ]; then
|
||||
# printf "Installing Linux Development Dependencies\n"
|
||||
#else
|
||||
# printf "Not installing Linux Development Dependencies\n"
|
||||
#fi
|
||||
|
||||
# Get their distro
|
||||
|
||||
printf "Which distro are you running? (ubuntu/arch/fedora/gentoo/opensuse/void)\n"
|
||||
|
||||
read -r distro
|
||||
|
||||
# convert distro to lowercase
|
||||
|
||||
distro=${distro,,}
|
||||
|
||||
# check if the distro is Ubuntu or arch or fedora or gentoo or openSUSE or NixOS or GNU GUIX or void
|
||||
|
||||
if [ "$distro" == "ubuntu" ] || [ "$distro" == "arch" ] || [ "$distro" == "fedora" ] || [ "$distro" == "gentoo" ] || [ "$distro" == "opensuse" ] || [ "$distro" == "void" ]; then
|
||||
printf "Distro is $distro\n"
|
||||
else
|
||||
printf "Distro is not supported\n"
|
||||
printf "NixOS and GNU GUIX are not supported by this script, but are supported by tauri - please see the tauri docs for more information.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
## Which distro are we on?
|
||||
#printf "Detecting Distro\n"
|
||||
#
|
||||
## run this command: cat /etc/*-release | uniq -u and grep for the ID field and pipe into a variable
|
||||
#
|
||||
#cat /etc/*-release | uniq -u | grep -i "ID" | cut -d "=" -f 2 | tr -d '"' | tr -d '\n' >distro.txt
|
||||
#
|
||||
## read the variable into a variable
|
||||
#distro=$(cat distro.txt)
|
||||
#
|
||||
## grab just the first word of the variable
|
||||
#distro=$(echo $distro | cut -d " " -f 1)
|
||||
#
|
||||
## convert distro to lowercase
|
||||
#distro=${distro,,}
|
||||
## remove the file
|
||||
#rm distro.txt
|
||||
|
||||
# Install Linux Development Dependencies
|
||||
# run specific commands based on the distro
|
||||
case $distro in
|
||||
"ubuntu")
|
||||
printf "Installing Ubuntu Development Dependencies\n"
|
||||
sudo apt update
|
||||
sudo apt install libwebkit2gtk-4.0-dev build-essential curl wget libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev
|
||||
;;
|
||||
"arch")
|
||||
printf "Installing Arch Development Dependencies\n"
|
||||
sudo pacman -Syu
|
||||
sudo pacman -S --needed webkit2gtk base-devel curl wget openssl appmenu-gtk-module gtk3 libappindicator-gtk3 librsvg libvips
|
||||
;;
|
||||
"fedora")
|
||||
printf "Installing Fedora Development Dependencies\n"
|
||||
sudo dnf check-update
|
||||
sudo dnf install webkit2gtk4.0-devel openssl-devel curl wget libappindicator-gtk3 librsvg2-devel
|
||||
sudo dnf group install "C Development Tools and Libraries"
|
||||
;;
|
||||
"gentoo")
|
||||
printf "Installing Gentoo Development Dependencies\n"
|
||||
sudo emerge --ask net-libs/webkit-gtk:4 dev-libs/libappindicator net-misc/curl net-misc/wget
|
||||
;;
|
||||
"opensuse")
|
||||
printf "Installing openSUSE Development Dependencies\n"
|
||||
sudo zypper up
|
||||
sudo zypper in webkit2gtk3-soup2-devel libopenssl-devel curl wget libappindicator3-1 librsvg-devel
|
||||
sudo zypper in -t pattern devel_basis
|
||||
;;
|
||||
"void")
|
||||
printf "Installing Void Development Dependencies\n"
|
||||
sudo xbps-install -Syu
|
||||
sudo xbps-install -S webkit2gtk curl wget openssl gtk+3 libappindicator librsvg gcc pkg-config
|
||||
;;
|
||||
esac
|
||||
# Install Rust
|
||||
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
|
||||
# All done!
|
||||
printf "All done!\n"
|
||||
16
scripts/setup_tauri_dev_macos.sh
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
printf "This Script will setup the tauri dev environment\n"
|
||||
# Install CLang and macOS Development Dependencies
|
||||
printf "Installing CLang and macOS Development Dependencies\n"
|
||||
xcode-select --install
|
||||
# Install Rust
|
||||
printf "Installing Rust\n"
|
||||
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
|
||||
|
||||
# All done!
|
||||
printf "All done!\n"
|
||||
printf "You can now run 'tauri dev' to start the development environment\n"
|
||||
printf "You can now run 'tauri build' to build the application\n"
|
||||
|
||||
# Path: scripts\setup_tauri_dev_windows.sh
|
||||
3
src-tauri/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Generated by Cargo
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
3597
src-tauri/Cargo.lock
generated
Normal file
39
src-tauri/Cargo.toml
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
[package]
|
||||
name = "app"
|
||||
version = "1.0.0"
|
||||
description = "A Tauri App"
|
||||
authors = ["autodrop3d, xibyte"]
|
||||
license = "LICENSE"
|
||||
repository = "https://github.com/xibyte/jsketcher"
|
||||
default-run = "app"
|
||||
edition = "2021"
|
||||
rust-version = "1.64"
|
||||
|
||||
[build-dependencies.tauri-build]
|
||||
version = "1.3.0"
|
||||
features = []
|
||||
|
||||
[dependencies]
|
||||
serde_json = "1.0"
|
||||
|
||||
[dependencies.serde]
|
||||
version = "1.0"
|
||||
features = ["derive"]
|
||||
|
||||
[dependencies.tauri]
|
||||
version = "1.3.0"
|
||||
features = []
|
||||
|
||||
[features]
|
||||
default = ["custom-protocol"]
|
||||
custom-protocol = ["tauri/custom-protocol"]
|
||||
|
||||
[profile]
|
||||
[profile.dev]
|
||||
debug = 0
|
||||
|
||||
[profile.release]
|
||||
panic = "abort"
|
||||
codegen-units = 1
|
||||
lto = true
|
||||
opt-level = "s"
|
||||
3
src-tauri/build.rs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
tauri_build::build()
|
||||
}
|
||||
BIN
src-tauri/icons/128x128.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
src-tauri/icons/128x128@2x.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
src-tauri/icons/32x32.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
src-tauri/icons/Square107x107Logo.png
Normal file
|
After Width: | Height: | Size: 9 KiB |
BIN
src-tauri/icons/Square142x142Logo.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src-tauri/icons/Square150x150Logo.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
src-tauri/icons/Square284x284Logo.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
src-tauri/icons/Square30x30Logo.png
Normal file
|
After Width: | Height: | Size: 2 KiB |
BIN
src-tauri/icons/Square310x310Logo.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
src-tauri/icons/Square44x44Logo.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
src-tauri/icons/Square71x71Logo.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
src-tauri/icons/Square89x89Logo.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
src-tauri/icons/StoreLogo.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
src-tauri/icons/icon.icns
Normal file
BIN
src-tauri/icons/icon.ico
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
src-tauri/icons/icon.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
14
src-tauri/rustfmt.toml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
max_width = 100
|
||||
hard_tabs = false
|
||||
tab_spaces = 2
|
||||
newline_style = "Auto"
|
||||
use_small_heuristics = "Default"
|
||||
reorder_imports = true
|
||||
reorder_modules = true
|
||||
remove_nested_parens = true
|
||||
edition = "2018"
|
||||
merge_derives = true
|
||||
use_try_shorthand = false
|
||||
use_field_init_shorthand = false
|
||||
force_explicit_abi = true
|
||||
imports_granularity = "Crate"
|
||||
11
src-tauri/src/main.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#![cfg_attr(
|
||||
all(not(debug_assertions), target_os = "windows"),
|
||||
windows_subsystem = "windows"
|
||||
)]
|
||||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
// Don't worry about this error, it's just the rust analyzer.
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
}
|
||||
66
src-tauri/tauri.conf.json
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
|
||||
"build": {
|
||||
"beforeBuildCommand": "pnpm build",
|
||||
"beforeDevCommand": "pnpm start",
|
||||
"devPath": "http://localhost:3000",
|
||||
"distDir": "../dist"
|
||||
},
|
||||
"package": {
|
||||
"productName": "jsketcher",
|
||||
"version": "1.0.0"
|
||||
},
|
||||
"tauri": {
|
||||
"allowlist": {
|
||||
"all": false
|
||||
},
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"category": "DeveloperTool",
|
||||
"copyright": "",
|
||||
"deb": {
|
||||
"depends": []
|
||||
},
|
||||
"externalBin": [],
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
],
|
||||
"identifier": "com.jsketcher.dev",
|
||||
"longDescription": "",
|
||||
"macOS": {
|
||||
"entitlements": null,
|
||||
"exceptionDomain": "",
|
||||
"frameworks": [],
|
||||
"providerShortName": null,
|
||||
"signingIdentity": null
|
||||
},
|
||||
"resources": [],
|
||||
"shortDescription": "",
|
||||
"targets": "all",
|
||||
"windows": {
|
||||
"certificateThumbprint": null,
|
||||
"digestAlgorithm": "sha256",
|
||||
"timestampUrl": ""
|
||||
}
|
||||
},
|
||||
"security": {
|
||||
"csp": null
|
||||
},
|
||||
"updater": {
|
||||
"active": false
|
||||
},
|
||||
"windows": [
|
||||
{
|
||||
"fullscreen": false,
|
||||
"height": 600,
|
||||
"resizable": true,
|
||||
"title": "jsketcher",
|
||||
"width": 800
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +1,14 @@
|
|||
import {GenericWASMEngine_V1} from "engine/impl/wasm/GenericWASMEngine_V1";
|
||||
import {CraftEngine} from "./craftEngine";
|
||||
import {createOCCService, OCCService} from "cad/craft/e0/occService";
|
||||
import { GenericWASMEngine_V1 } from "engine/impl/wasm/GenericWASMEngine_V1";
|
||||
import { CraftEngine } from "./craftEngine";
|
||||
import { createOCCService, OCCService } from "cad/craft/e0/occService";
|
||||
|
||||
export interface OCCBundleContext {
|
||||
|
||||
craftEngine: CraftEngine; // to be removed
|
||||
|
||||
occService: OCCService;
|
||||
}
|
||||
|
||||
export function activate(ctx) {
|
||||
|
||||
loadWasm(ctx);
|
||||
|
||||
const wasmEngine = new GenericWASMEngine_V1();
|
||||
|
|
@ -22,42 +20,39 @@ export function activate(ctx) {
|
|||
ctx.occService = createOCCService(ctx);
|
||||
}
|
||||
|
||||
function instantiateEngine(importObject, callback) {
|
||||
const url = './lib-assets/jsketcher-occ-engine/occt.wasm';
|
||||
//* work around until tauri v2
|
||||
async function instantiateEngine(importObject, callback) {
|
||||
const url = "./lib-assets/jsketcher-occ-engine/occt.wasm";
|
||||
|
||||
WebAssembly.instantiateStreaming(fetch(url), importObject).then(results => {
|
||||
callback(results.instance);
|
||||
});
|
||||
const response = await fetch(url);
|
||||
const buffer = await response.arrayBuffer();
|
||||
|
||||
const obj = await WebAssembly.instantiate(buffer, importObject);
|
||||
callback(obj.instance);
|
||||
}
|
||||
|
||||
function loadWasm(ctx) {
|
||||
ctx.services.lifecycle.startAsyncInitializingJob('e0:loader');
|
||||
ctx.services.lifecycle.startAsyncInitializingJob("e0:loader");
|
||||
|
||||
// @ts-ignore
|
||||
window.Module = {
|
||||
// locateFile: function(file) {
|
||||
// return SERVER_PATH + file;
|
||||
// },
|
||||
onRuntimeInitialized: function() {
|
||||
onRuntimeInitialized: function () {
|
||||
Module._InitCommands();
|
||||
ctx.services.lifecycle.finishAsyncInitializingJob('e0:loader');
|
||||
ctx.services.lifecycle.finishAsyncInitializingJob("e0:loader");
|
||||
},
|
||||
instantiateWasm: function (importObject, fncReceiveInstance) {
|
||||
instantiateEngine(importObject, fncReceiveInstance);
|
||||
return {};
|
||||
}
|
||||
},
|
||||
} as any;
|
||||
|
||||
const mainScript = document.createElement('script');
|
||||
mainScript.setAttribute('src', './lib-assets/jsketcher-occ-engine/occt.js');
|
||||
mainScript.setAttribute('async', 'async');
|
||||
const mainScript = document.createElement("script");
|
||||
mainScript.setAttribute("src", "./lib-assets/jsketcher-occ-engine/occt.js");
|
||||
mainScript.setAttribute("async", "async");
|
||||
document.head.appendChild(mainScript);
|
||||
}
|
||||
|
||||
export const BundleName = "@OCCT";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||