@viji-dev/sdk 1.0.0 → 1.0.2
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.
- package/README.md +70 -63
- package/bin/viji.js +9 -29
- package/dist/assets/artist-dts-BHUsvSI6.js +613 -0
- package/dist/assets/artist-dts-p5-Cyw8vmy_.js +736 -0
- package/dist/assets/core-CiQx3w0t.js +12 -0
- package/dist/assets/dark-plus-C3mMm8J8.js +1 -0
- package/dist/assets/docs-api-PBLtY4Ni.js +12381 -0
- package/dist/assets/engine-javascript-CXyY7cc8.js +141 -0
- package/dist/assets/essentia-wasm.web-0S-sW98u-CYV1l1zv.js +38 -0
- package/dist/assets/essentia.js-core.es-DnrJE0uR-DOSrF5_G.js +32 -0
- package/dist/assets/glsl-DMyvO4G4.js +1 -0
- package/dist/assets/index-BhFxsauQ.js +215 -0
- package/dist/assets/index-BqhVeA7U.css +1 -0
- package/dist/assets/index-T4TOjvD0.js +1 -0
- package/dist/assets/index-Wz9WqGqz.js +52 -0
- package/dist/assets/index-t24aGwla.js +1 -0
- package/dist/assets/javascript-wDzz0qaB.js +1 -0
- package/dist/assets/shader-uniforms-GdaUkQPK.js +1 -0
- package/dist/assets/typescript-BPQ3VLAy.js +1 -0
- package/dist/assets/viji.worker-CQSJ0SiO-ljtBlcNZ.js +27018 -0
- package/{index.html → dist/index.html} +2 -1
- package/package.json +31 -35
- package/src/cli/commands/build.js +50 -99
- package/src/cli/commands/create.js +49 -46
- package/src/cli/commands/dev.js +30 -97
- package/src/cli/server/dev-server.js +233 -0
- package/src/cli/server/scene-scanner.js +93 -0
- package/src/cli/server/vite-scene-plugin.d.ts +2 -0
- package/src/cli/server/vite-scene-plugin.js +134 -0
- package/src/cli/utils/cli-utils.js +29 -139
- package/src/cli/utils/scene-compiler.js +10 -17
- package/src/templates/scene-templates.js +85 -0
- package/.gitignore +0 -29
- package/eslint.config.js +0 -37
- package/postcss.config.js +0 -6
- package/scenes/audio-visualizer/main.js +0 -287
- package/scenes/core-demo/main.js +0 -532
- package/scenes/demo-scene/main.js +0 -619
- package/scenes/global.d.ts +0 -15
- package/scenes/particle-system/main.js +0 -349
- package/scenes/tsconfig.json +0 -12
- package/scenes/video-mirror/main.ts +0 -436
- package/src/App.css +0 -42
- package/src/App.tsx +0 -279
- package/src/cli/commands/init.js +0 -262
- package/src/components/SDKPage.tsx +0 -337
- package/src/components/core/CoreContainer.tsx +0 -126
- package/src/components/ui/DeviceSelectionList.tsx +0 -137
- package/src/components/ui/FPSCounter.tsx +0 -78
- package/src/components/ui/FileDropzonePanel.tsx +0 -120
- package/src/components/ui/FileListPanel.tsx +0 -285
- package/src/components/ui/InputExpansionPanel.tsx +0 -31
- package/src/components/ui/MediaPlayerControls.tsx +0 -191
- package/src/components/ui/MenuContainer.tsx +0 -71
- package/src/components/ui/ParametersMenu.tsx +0 -797
- package/src/components/ui/ProjectSwitcherMenu.tsx +0 -192
- package/src/components/ui/QuickInputControls.tsx +0 -542
- package/src/components/ui/SDKMenuSystem.tsx +0 -96
- package/src/components/ui/SettingsMenu.tsx +0 -346
- package/src/components/ui/SimpleInputControls.tsx +0 -137
- package/src/index.css +0 -68
- package/src/main.tsx +0 -10
- package/src/scenes-hmr.ts +0 -158
- package/src/services/project-filesystem.ts +0 -436
- package/src/stores/scene-player/index.ts +0 -3
- package/src/stores/scene-player/input-manager.store.ts +0 -1045
- package/src/stores/scene-player/scene-session.store.ts +0 -659
- package/src/styles/globals.css +0 -111
- package/src/templates/minimal-template.js +0 -11
- package/src/utils/debounce.js +0 -34
- package/src/vite-env.d.ts +0 -1
- package/tailwind.config.js +0 -18
- package/tsconfig.app.json +0 -27
- package/tsconfig.json +0 -27
- package/tsconfig.node.json +0 -27
- package/vite.config.ts +0 -54
- /package/{public → dist}/favicon.png +0 -0
package/README.md
CHANGED
|
@@ -1,103 +1,110 @@
|
|
|
1
1
|
# Viji SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Development environment for [Viji Creative](https://viji.art) scenes. Write scene code in your IDE, preview it live in the browser with real-time parameter controls, audio analysis, video input, and interaction handling — the same execution environment as the Viji platform. Supports Canvas 2D, WebGL, P5.js, and GLSL shaders.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
+
Requires [Node.js](https://nodejs.org/) v18 or later.
|
|
8
|
+
|
|
7
9
|
```bash
|
|
8
10
|
npm install -g @viji-dev/sdk
|
|
9
11
|
```
|
|
10
12
|
|
|
13
|
+
To update to the latest version:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm update -g @viji-dev/sdk
|
|
17
|
+
```
|
|
18
|
+
|
|
11
19
|
## Quick Start
|
|
12
20
|
|
|
13
21
|
```bash
|
|
14
|
-
# Create a
|
|
15
|
-
mkdir my-viji-
|
|
16
|
-
cd my-viji-workspace
|
|
17
|
-
viji init .
|
|
22
|
+
# Create a workspace folder (any name works)
|
|
23
|
+
mkdir my-viji-scenes && cd my-viji-scenes
|
|
18
24
|
|
|
19
|
-
# Create your first scene
|
|
20
|
-
viji create my-scene
|
|
25
|
+
# Create your first scene (native renderer is the default)
|
|
26
|
+
viji create my-scene
|
|
21
27
|
|
|
22
|
-
# Start development server
|
|
28
|
+
# Start the development server
|
|
23
29
|
viji dev
|
|
24
30
|
```
|
|
25
31
|
|
|
26
|
-
|
|
32
|
+
Open `http://localhost:3000` in your browser to see the SDK UI. Edit `scenes/my-scene/main.js` in your IDE — changes appear in real time.
|
|
27
33
|
|
|
28
|
-
|
|
29
|
-
Initialize a new Viji workspace with complete development environment.
|
|
30
|
-
- Use `viji init .` to initialize in current directory
|
|
31
|
-
- Use `viji init my-workspace` to create new directory
|
|
34
|
+
## CLI Commands
|
|
32
35
|
|
|
33
|
-
### `viji create <scene-name> [--
|
|
34
|
-
Create a new scene in the current workspace.
|
|
35
|
-
- Must be run inside a Viji workspace
|
|
36
|
-
- Creates scene in `scenes/<scene-name>/` folder
|
|
36
|
+
### `viji create <scene-name> [--renderer <type>]`
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
Start development server with hot reload.
|
|
40
|
-
- Must be run inside a Viji workspace
|
|
41
|
-
- Opens browser-based development UI
|
|
38
|
+
Create a new scene in the `scenes/` folder.
|
|
42
39
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
- Ready for copy-paste to Viji platform
|
|
40
|
+
- `viji create my-scene` — native renderer (Canvas 2D / WebGL), the default
|
|
41
|
+
- `viji create my-scene --renderer p5` — P5.js renderer
|
|
42
|
+
- `viji create my-scene --renderer shader` — GLSL fragment shader
|
|
47
43
|
|
|
48
|
-
|
|
44
|
+
Creates the following structure:
|
|
49
45
|
|
|
50
46
|
```
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
│ │ └── main.ts # Scene entry point
|
|
56
|
-
│ └── another-scene/
|
|
57
|
-
├── vite.config.ts # Vite configuration
|
|
58
|
-
├── package.json # Dependencies
|
|
59
|
-
└── ... # TypeScript configs, etc.
|
|
47
|
+
scenes/
|
|
48
|
+
└── my-scene/
|
|
49
|
+
└── main.js # or main.glsl for shader scenes
|
|
50
|
+
global.d.ts # generated once for IDE type support
|
|
60
51
|
```
|
|
61
52
|
|
|
62
|
-
|
|
53
|
+
### `viji dev [--port <port>] [--host <host>] [--open]`
|
|
54
|
+
|
|
55
|
+
Start the development server with live reload.
|
|
56
|
+
|
|
57
|
+
| Option | Default | Description |
|
|
58
|
+
|--------|---------|-------------|
|
|
59
|
+
| `--port` | `3000` | Server port |
|
|
60
|
+
| `--host` | `localhost` | Server host |
|
|
61
|
+
| `--open` | `false` | Open browser automatically |
|
|
63
62
|
|
|
64
|
-
|
|
63
|
+
The server watches the `scenes/` directory for changes and pushes updates to the browser UI in real time via WebSocket.
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
// scenes/my-scene/main.ts
|
|
68
|
-
export const parameters = [
|
|
69
|
-
// Parameter definitions
|
|
70
|
-
];
|
|
65
|
+
### `viji build <scene-name> [-o <file>]`
|
|
71
66
|
|
|
72
|
-
|
|
73
|
-
// Initialization code
|
|
74
|
-
}
|
|
67
|
+
Bundle a scene into a single file for deployment to the Viji platform.
|
|
75
68
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
69
|
+
```bash
|
|
70
|
+
viji build my-scene # outputs dist/my-scene.js
|
|
71
|
+
viji build my-scene -o bundle/output.js # custom output path
|
|
79
72
|
```
|
|
80
73
|
|
|
81
|
-
|
|
74
|
+
Multi-file scenes (with local imports) are resolved and concatenated automatically.
|
|
75
|
+
|
|
76
|
+
## Writing Scenes
|
|
77
|
+
|
|
78
|
+
The SDK includes built-in documentation for the Viji scene API, parameter system, renderers, audio/video analysis, and interaction handling.
|
|
79
|
+
|
|
80
|
+
Start the development server and open the docs panel from the toolbar, or navigate directly to `http://localhost:3000/docs`.
|
|
82
81
|
|
|
83
|
-
|
|
84
|
-
- **🔥 Hot Reload**: Instant updates when you save scene files
|
|
85
|
-
- **📁 Workspace Management**: Organize multiple scenes in one project
|
|
86
|
-
- **🛠️ TypeScript Support**: Full type safety and IDE integration
|
|
87
|
-
- **📦 Single-File Build**: Compile to platform-ready scene.js
|
|
88
|
-
- **🎯 Platform Compatible**: Uses same Core runtime as Viji platform
|
|
82
|
+
The documentation includes live code playgrounds where you can experiment with the API directly in the browser.
|
|
89
83
|
|
|
90
|
-
##
|
|
84
|
+
## Project Structure
|
|
85
|
+
|
|
86
|
+
After creating a few scenes, your workspace looks like this:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
my-viji-scenes/
|
|
90
|
+
├── scenes/
|
|
91
|
+
│ ├── my-scene/
|
|
92
|
+
│ │ └── main.js
|
|
93
|
+
│ ├── shader-demo/
|
|
94
|
+
│ │ └── main.glsl
|
|
95
|
+
│ └── p5-sketch/
|
|
96
|
+
│ └── main.js
|
|
97
|
+
└── global.d.ts # IDE type support (auto-generated)
|
|
98
|
+
```
|
|
91
99
|
|
|
92
|
-
|
|
93
|
-
- Implementation guide: `docs/06-cursor-implementation-guide.md`
|
|
100
|
+
No configuration files, no `node_modules`, no build tools in your workspace. Everything is handled by the globally installed SDK.
|
|
94
101
|
|
|
95
|
-
##
|
|
102
|
+
## License
|
|
96
103
|
|
|
97
|
-
Copyright (c) 2025 Artem Verkhovskiy and Dmitry Manoilenko.
|
|
98
|
-
All rights reserved
|
|
104
|
+
Copyright (c) 2025 Artem Verkhovskiy and Dmitry Manoilenko.
|
|
105
|
+
All rights reserved — see the LICENSE file for details.
|
|
99
106
|
|
|
100
107
|
## Contributor License Agreement
|
|
101
108
|
|
|
102
|
-
By contributing, you agree to the [CLA](./CLA.md).
|
|
103
|
-
Please also confirm your agreement by filling out this short [form](https://forms.gle/A49WTz8nj5b99Yev7).
|
|
109
|
+
By contributing, you agree to the [CLA](./CLA.md).
|
|
110
|
+
Please also confirm your agreement by filling out this short [form](https://forms.gle/A49WTz8nj5b99Yev7).
|
package/bin/viji.js
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
/**
|
|
4
|
-
* Viji SDK Command Line Interface
|
|
5
|
-
* Professional toolkit for creating interactive Viji scenes
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
3
|
import { createRequire } from 'module';
|
|
9
4
|
const require = createRequire(import.meta.url);
|
|
10
5
|
const { program } = require('commander');
|
|
11
6
|
import { createCommand } from '../src/cli/commands/create.js';
|
|
12
7
|
import { devCommand } from '../src/cli/commands/dev.js';
|
|
13
8
|
import { buildCommand } from '../src/cli/commands/build.js';
|
|
14
|
-
import { initCommand } from '../src/cli/commands/init.js';
|
|
15
9
|
import { fileURLToPath } from 'url';
|
|
16
10
|
import { dirname, join } from 'path';
|
|
17
11
|
import { readFileSync } from 'fs';
|
|
18
12
|
|
|
19
|
-
// Get package.json version
|
|
20
13
|
const __filename = fileURLToPath(import.meta.url);
|
|
21
14
|
const __dirname = dirname(__filename);
|
|
22
15
|
const packagePath = join(__dirname, '..', 'package.json');
|
|
@@ -24,52 +17,39 @@ const packageJson = JSON.parse(readFileSync(packagePath, 'utf8'));
|
|
|
24
17
|
|
|
25
18
|
program
|
|
26
19
|
.name('viji')
|
|
27
|
-
.description('
|
|
20
|
+
.description('Viji SDK - Professional toolkit for creating interactive scenes')
|
|
28
21
|
.version(packageJson.version);
|
|
29
22
|
|
|
30
|
-
// Command: Initialize new workspace
|
|
31
|
-
program
|
|
32
|
-
.command('init')
|
|
33
|
-
.argument('[workspace-name]', 'Name of the workspace (use "." for current directory)', '.')
|
|
34
|
-
.description('Initialize a new Viji workspace')
|
|
35
|
-
.action(initCommand);
|
|
36
|
-
|
|
37
|
-
// Command: Create new scene
|
|
38
23
|
program
|
|
39
24
|
.command('create')
|
|
40
25
|
.argument('<scene-name>', 'Name of the new scene')
|
|
41
|
-
.option('--
|
|
26
|
+
.option('--renderer <type>', 'Renderer type (native|p5|shader)', 'native')
|
|
42
27
|
.description('Create a new scene in the current workspace')
|
|
43
28
|
.action(createCommand);
|
|
44
29
|
|
|
45
|
-
// Command: Start development server
|
|
46
30
|
program
|
|
47
31
|
.command('dev')
|
|
48
|
-
.option('-p, --port <port>', 'Development server port', '
|
|
49
|
-
.option('
|
|
32
|
+
.option('-p, --port <port>', 'Development server port', '3000')
|
|
33
|
+
.option('--host <host>', 'Development server host', 'localhost')
|
|
50
34
|
.option('--open', 'Open browser automatically', false)
|
|
51
|
-
.description('Start development server with
|
|
35
|
+
.description('Start development server with live reload')
|
|
52
36
|
.action(devCommand);
|
|
53
37
|
|
|
54
|
-
// Command: Build for production
|
|
55
38
|
program
|
|
56
39
|
.command('build')
|
|
57
40
|
.argument('<scene-name>', 'Name of the scene to build')
|
|
58
|
-
.option('-o, --output <file>', 'Output file path'
|
|
59
|
-
.description('Build scene: bundle multi-file projects into one
|
|
41
|
+
.option('-o, --output <file>', 'Output file path')
|
|
42
|
+
.description('Build scene: bundle multi-file projects into one')
|
|
60
43
|
.action(buildCommand);
|
|
61
44
|
|
|
62
|
-
|
|
63
|
-
// Global error handling
|
|
64
45
|
process.on('uncaughtException', (error) => {
|
|
65
|
-
console.error('
|
|
46
|
+
console.error('Unexpected error:', error.message);
|
|
66
47
|
process.exit(1);
|
|
67
48
|
});
|
|
68
49
|
|
|
69
50
|
process.on('unhandledRejection', (reason) => {
|
|
70
|
-
console.error('
|
|
51
|
+
console.error('Unhandled promise rejection:', reason);
|
|
71
52
|
process.exit(1);
|
|
72
53
|
});
|
|
73
54
|
|
|
74
|
-
// Parse and execute
|
|
75
55
|
program.parse();
|