Skip to content

Commit 7cf3638

Browse files
update package commands with rimraf for cross platform compatibility and added additional info on readme how to do first time setup and tests
1 parent b1bca02 commit 7cf3638

File tree

2 files changed

+70
-12
lines changed

2 files changed

+70
-12
lines changed

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,59 @@ Bit By Bit Developers company will keep these core algorithms that you can find
8787
## About Bit By Bit Developers platform
8888
Bit By Bit Developers web platform allows creators to program geometry through simple visual programming language or choose monaco typescript editor with full intellisense of bitbybit API. This cloud platform can fulfil many practical, educational and artistic needs of its users. Through familiar programming interface used in tools such as Scratch and Blockly.Games we expose powerful 3D algorithms that make it easier to implement various parametric tasks. Our goal is to make it very simple for users to share their ideas and designs. We want to encourage everyone to engage in the future of this tool.
8989

90+
# Development Setup
91+
92+
## First Time Setup and Testing
93+
94+
For first-time developers working on this project, follow these steps to set up the development environment and run all unit tests:
95+
96+
### Prerequisites
97+
- Node.js (v16 or higher recommended)
98+
- npm (comes with Node.js)
99+
- Git
100+
101+
### Quick Start
102+
1. Clone the repository:
103+
```bash
104+
git clone https://github.com/bitbybit-dev/bitbybit.git
105+
cd bitbybit
106+
```
107+
108+
2. Run the complete first-time setup (this will install all dependencies, build all packages, and run all unit tests):
109+
```bash
110+
npm run first-time-setup
111+
```
112+
113+
### Available Commands
114+
115+
- `npm run first-time-setup` - Complete setup for new developers (installs dependencies, builds packages, runs tests)
116+
- `npm run setup` - Install dependencies and build all packages without running tests
117+
- `npm run setup-and-test` - Install dependencies, build packages, and run all unit tests
118+
- `npm run test` - Run all unit tests (requires packages to be built first)
119+
- `npm run ci-packages` - Install dependencies for all packages
120+
- `npm run build-packages` - Build all packages
121+
- `npm run rebuild-all-packages` - Clean and rebuild all packages
122+
123+
### Cross-Platform Compatibility
124+
All commands are now cross-platform compatible and work on Windows, macOS, and Linux. The project uses:
125+
- `rimraf` for cross-platform file deletion
126+
- Standard npm scripts for package management
127+
128+
### Running Individual Package Tests
129+
You can also run tests for individual packages:
130+
- `npm run test-base` - Test base package
131+
- `npm run test-occt` - Test OCCT package
132+
- `npm run test-core` - Test core package
133+
- `npm run test-jscad` - Test JSCAD package
134+
- `npm run test-manifold` - Test Manifold package
135+
- `npm run test-threejs` - Test ThreeJS package
136+
137+
### Troubleshooting
138+
If you encounter issues during setup:
139+
1. Make sure you have Node.js v16+ installed
140+
2. Clear npm cache: `npm cache clean --force`
141+
3. Delete node_modules and package-lock.json, then run `npm install`
142+
4. If on Windows, make sure to run commands in a proper terminal (Command Prompt, PowerShell, or WSL)
143+
90144
## Major Dependencies
91145
BabylonJS, ThreeJS, OpenCascade, Manifold, JSCAD, Verbnurbs

package.json

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
"ci-manifold-worker": "cd packages/dev/manifold-worker && npm ci",
1616
"ci-manifold": "cd packages/dev/manifold && npm ci",
1717
"ci-packages": "npm run ci-base && npm run ci-core && npm run ci-threejs && npm run ci-babylonjs && npm run ci-occt-worker && npm run ci-occt && npm run ci-jscad-worker && npm run ci-jscad && npm run ci-manifold-worker && npm run ci-manifold",
18-
"rm-dist-base-if-exists": "rm -rf packages/dev/base/dist || true",
19-
"rm-dist-core-if-exists": "rm -rf packages/dev/core/dist || true",
20-
"rm-dist-threejs-if-exists": "rm -rf packages/dev/threejs/dist || true",
21-
"rm-dist-babylonjs-if-exists": "rm -rf packages/dev/babylonjs/dist || true",
22-
"rm-dist-occt-worker-if-exists": "rm -rf packages/dev/occt-worker/dist || true",
23-
"rm-dist-occt-if-exists": "rm -rf packages/dev/occt/dist || true",
24-
"rm-dist-jscad-worker-if-exists": "rm -rf packages/dev/jscad-worker/dist || true",
25-
"rm-dist-jscad-if-exists": "rm -rf packages/dev/jscad/dist || true",
26-
"rm-dist-manifold-worker-if-exists": "rm -rf packages/dev/manifold-worker/dist || true",
27-
"rm-dist-manifold-if-exists": "rm -rf packages/dev/manifold/dist || true",
18+
"rm-dist-base-if-exists": "rimraf packages/dev/base/dist",
19+
"rm-dist-core-if-exists": "rimraf packages/dev/core/dist",
20+
"rm-dist-threejs-if-exists": "rimraf packages/dev/threejs/dist",
21+
"rm-dist-babylonjs-if-exists": "rimraf packages/dev/babylonjs/dist",
22+
"rm-dist-occt-worker-if-exists": "rimraf packages/dev/occt-worker/dist",
23+
"rm-dist-occt-if-exists": "rimraf packages/dev/occt/dist",
24+
"rm-dist-jscad-worker-if-exists": "rimraf packages/dev/jscad-worker/dist",
25+
"rm-dist-jscad-if-exists": "rimraf packages/dev/jscad/dist",
26+
"rm-dist-manifold-worker-if-exists": "rimraf packages/dev/manifold-worker/dist",
27+
"rm-dist-manifold-if-exists": "rimraf packages/dev/manifold/dist",
2828
"rm-dist-packages": "npm run rm-dist-base-if-exists && npm run rm-dist-core-if-exists && npm run rm-dist-threejs-if-exists && npm run rm-dist-babylonjs-if-exists && npm run rm-dist-occt-worker-if-exists && npm run rm-dist-occt-if-exists && npm run rm-dist-jscad-worker-if-exists && npm run rm-dist-jscad-if-exists && npm run rm-dist-manifold-worker-if-exists && npm run rm-dist-manifold-if-exists",
2929
"build-base": "cd packages/dev/base && npm run build-p",
3030
"build-core": "cd packages/dev/core && npm run build-p",
@@ -45,7 +45,10 @@
4545
"test-jscad": "cd packages/dev/jscad && npm run test-c",
4646
"test-manifold": "cd packages/dev/manifold && npm run test-c",
4747
"test-threejs": "cd packages/dev/threejs && npm run test-c",
48-
"test": "npm run test-occt && npm run test-base && npm run test-core && npm run test-jscad && npm run test-manifold && npm run test-threejs"
48+
"test": "npm run test-occt && npm run test-base && npm run test-core && npm run test-jscad && npm run test-manifold && npm run test-threejs",
49+
"setup": "npm run install-rebuild-all-packages",
50+
"setup-and-test": "npm run setup && npm run test",
51+
"first-time-setup": "npm install && npm run setup-and-test"
4952
},
5053
"repository": {
5154
"type": "git",
@@ -70,6 +73,7 @@
7073
},
7174
"homepage": "https://bitbybit.dev",
7275
"devDependencies": {
73-
"typescript": "^4.3.5"
76+
"typescript": "^4.3.5",
77+
"rimraf": "^5.0.5"
7478
}
7579
}

0 commit comments

Comments
 (0)