Skip to content

Commit 259fccd

Browse files
committed
Cleanup tests. Added basic script from README. Fixed Nuxt starter template
1 parent e9e1460 commit 259fccd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+9284
-1230
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Archiyou is an online platform and Typescript/Javascript library to codify design and building know-how and publish it online.
66
Use our editor and community platform for free at [Archiyou.com](https://archiyou.com).
77

8-
[![build and test](https://github.com/ArchiyouApp/archiyou-core/actions/workflows/build.yml/badge.svg)](https://github.com/ArchiyouApp/archiyou-core/actions/workflows/build.yml)
8+
[![License](https://img.shields.io/github/license/ArchiyouApp/archiyou-core)](https://github.com/ArchiyouApp/archiyou-core/blob/main/LICENSE)[![build and test](https://github.com/ArchiyouApp/archiyou-core/actions/workflows/build.yml/badge.svg)](https://github.com/ArchiyouApp/archiyou-core/actions/workflows/build.yml)
99

1010
## Example
1111

@@ -63,7 +63,7 @@ npm add archiyou
6363
yarn add archiyou
6464
```
6565

66-
Now run this script in the browser or node:
66+
Now run this script in Node or browser:
6767

6868
```js
6969
import { init, Brep, Doc } from 'archiyou'
@@ -106,15 +106,15 @@ For starter-templates for some popular frameworks and build stacks see /examples
106106

107107
If your framework is not present, just look at the others for inspiration. Modern ones work most of the time with the same methods. Contributions are welcome.
108108

109-
## Notes on the wasm file
109+
## Notes on the WASM file
110110

111111
Archiyou is a TS/JS layer on top of a WASM build of [OpenCascade](https://github.com/Open-Cascade-SAS/OCCT).
112112
You application needs to be able to find the WASM file for it to work. If you experience errors during import or execution this is most probably the cause.
113113

114114

115-
## Run scripts from Archiyou platform independently
115+
## Run scripts independently from Archiyou platform
116116

117-
If you want to execute scripts (either locally or on a server like Archiyou) and get certain outputs use the Runner. You can also use the Runner to execute scripts in a Webworker.
117+
If you want to execute scripts (either locally or on a server like Archiyou) and get certain outputs: use the Runner.
118118

119119

120120
```ts

examples/templates/node/mybox.glb

89.2 KB
Binary file not shown.
26.4 KB
Binary file not shown.
Lines changed: 88 additions & 0 deletions
Loading

examples/templates/node/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"scripts": {
77
"link" : "npm link archiyou",
88
"dev": "node --loader ts-node/esm --no-warnings=ExperimentalWarning ./src/index.ts",
9-
"dev:basic": "node --loader ts-node/esm --no-warnings=ExperimentalWarning ./src/basic.ts",
109
"dev:runner": "node --loader ts-node/esm --no-warnings=ExperimentalWarning ./src/runner.ts",
1110
"dev:pdf": "node --loader ts-node/esm --no-warnings=ExperimentalWarning ./src/pdf.ts",
1211
"dev:component": "node --loader ts-node/esm --no-warnings=ExperimentalWarning ./src/component.ts",

examples/templates/node/src/index.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ const myModel = brep.Box(100)
2424
).fillet(5); // Give it round edges
2525

2626
// save the box as GLTF binary file in root of node project
27-
await myModel.save('mybox.glb')
27+
const glb = await myModel.save('mybox.glb')
28+
console.log(`Saved GLB file at: ${glb}`);
2829

2930
// make a 2D isometry projection of that box
3031
const myIso = myModel.iso([1,-1,1])
31-
myIso.save('myboxiso.svg'); // export as SVG file
32+
const svg = await myIso.save('myboxiso.svg'); // export as SVG file
33+
console.log(`Saved SVG file at: ${svg}`);
3234

3335
// put it on document
3436
const myDoc = new Doc() // Doc module
@@ -38,6 +40,5 @@ const myDoc = new Doc() // Doc module
3840
.view('iso', myIso); // place view of myIso shapes
3941

4042
// Save to PDF file
41-
await myDoc.save('myboxdoc.pdf');
42-
43-
43+
const pdf = await myDoc.save('myboxdoc.pdf');
44+
console.log(`Saved PDF file at: ${pdf}`);
File renamed without changes.

examples/templates/nuxt3-webworker/README.md renamed to examples/templates/nuxt/README.md

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,24 @@ This is the basic nuxt3 starter template generated like described here: https://
44

55
## Settings to be able to load wasm files from archiyou module
66

7-
See nuxt.config.ts
7+
See nuxt.config.ts:
8+
9+
```ts
10+
assetsInclude:
11+
['**/*.wasm'], // fix for able to load .wasm files
12+
```
813

914
## Setup
1015

1116
Make sure to install dependencies:
1217

1318
```bash
14-
# npm
15-
npm install
16-
1719
# pnpm
1820
pnpm install
1921

22+
# npm
23+
npm install
24+
2025
# yarn
2126
yarn install
2227

@@ -29,42 +34,14 @@ bun install
2934
Start the development server on `http://localhost:3000`:
3035

3136
```bash
32-
# npm
33-
npm run dev
3437
# pnpm
3538
pnpm dev
39+
# npm
40+
npm run dev
3641
# yarn
3742
yarn dev
3843
# bun
3944
bun run dev
4045
```
4146

42-
## Production
43-
44-
Build the application for production:
45-
46-
```bash
47-
# npm
48-
npm run build
49-
# pnpm
50-
pnpm build
51-
# yarn
52-
yarn build
53-
# bun
54-
bun run build
55-
```
56-
57-
Locally preview production build:
58-
59-
```bash
60-
# npm
61-
npm run preview
62-
# pnpm
63-
pnpm preview
64-
# yarn
65-
yarn preview
66-
# bun
67-
bun run preview
68-
```
69-
7047
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.

0 commit comments

Comments
 (0)