@s0rt/3dvf 0.1.3 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ # __PROJECT_NAME__
2
+
3
+ A Three.js project scaffolded with [3dvf](https://github.com/s0rt/3dvf).
4
+
5
+ ## Getting started
6
+
7
+ ```bash
8
+ __DEV_CMD__
9
+ ```
10
+
11
+ ## Adding functions
12
+
13
+ ```bash
14
+ npx 3dvf add <function-name>
15
+ ```
16
+
17
+ List available functions:
18
+
19
+ ```bash
20
+ npx 3dvf list
21
+ ```
@@ -0,0 +1,27 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>__PROJECT_NAME__</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ }
13
+ body {
14
+ overflow: hidden;
15
+ background: #000;
16
+ }
17
+ #app {
18
+ width: 100vw;
19
+ height: 100vh;
20
+ }
21
+ </style>
22
+ </head>
23
+ <body>
24
+ <div id="app"></div>
25
+ <script type="module" src="/src/main.ts"></script>
26
+ </body>
27
+ </html>
@@ -0,0 +1,33 @@
1
+ import {
2
+ BoxGeometry,
3
+ MeshPhongMaterial,
4
+ Mesh,
5
+ AmbientLight,
6
+ DirectionalLight,
7
+ } from "three";
8
+ import { createViewer } from "@3dvf/create-viewer/create-viewer";
9
+
10
+ const container = document.getElementById("app") as HTMLElement;
11
+
12
+ const { scene, dispose, camera, launch } = createViewer(container);
13
+
14
+ const geometry = new BoxGeometry(1.2, 1.2, 1.2);
15
+ const material = new MeshPhongMaterial({ color: 0x4fc3f7 });
16
+ const cube = new Mesh(geometry, material);
17
+ scene.add(cube);
18
+
19
+ const ambientLight = new AmbientLight(0xffffff, 0.4);
20
+ scene.add(ambientLight);
21
+
22
+ const directionalLight = new DirectionalLight(0xffffff, 1);
23
+ directionalLight.position.set(5, 5, 5);
24
+ scene.add(directionalLight);
25
+
26
+ camera.position.set(4, 4, 4);
27
+
28
+ launch();
29
+
30
+ // HMR cleanup
31
+ if (import.meta.hot) {
32
+ import.meta.hot.dispose(dispose);
33
+ }
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from "vite";
2
+
3
+ import { join, dirname } from "path";
4
+ import { fileURLToPath } from "url";
5
+
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = dirname(__filename);
8
+
9
+ export default defineConfig({
10
+ resolve: {
11
+ alias: {
12
+ "@3dvf": join(__dirname, "./__OUTPUT_DIR__"),
13
+ },
14
+ },
15
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@s0rt/3dvf",
3
- "version": "0.1.3",
3
+ "version": "0.2.1",
4
4
  "description": "shadcn-style Three.js function library CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,10 +13,11 @@
13
13
  "access": "public"
14
14
  },
15
15
  "scripts": {
16
- "build": "bun build src/cli/index.ts --outdir dist/cli --target node --format esm",
17
- "build:registry": "bun run scripts/build-registry.ts",
18
- "serve:registry": "bunx serve public -p 3001",
19
- "dev": "bun run src/cli/index.ts",
16
+ "build": "bun scripts/build-cli.ts",
17
+ "dev": "REGISTRY_URL=http://localhost:3001/registry bun scripts/build-cli.ts --watch",
18
+ "build:registry": "bun scripts/build-registry.ts",
19
+ "dev:registry": "bun scripts/dev-registry.ts",
20
+ "release": "bun scripts/release.ts",
20
21
  "test": "bun test"
21
22
  },
22
23
  "dependencies": {
@@ -26,7 +27,10 @@
26
27
  "prompts": "^2.4.2"
27
28
  },
28
29
  "devDependencies": {
30
+ "@types/bun": "^1.3.10",
29
31
  "@types/prompts": "^2.4.9",
30
- "typescript": "^5.7.0"
32
+ "@types/three": "^0.183.1",
33
+ "typescript": "^5.7.0",
34
+ "vite": "^7.3.1"
31
35
  }
32
36
  }