valence-cli 1.2.7 → 1.3.0

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.
Files changed (95) hide show
  1. package/README.md +9 -2
  2. package/README.original.md +9 -20
  3. package/dist/README.md +133 -0
  4. package/dist/commands/add.d.ts.map +1 -1
  5. package/dist/commands/add.js +55 -1
  6. package/dist/commands/add.js.map +1 -1
  7. package/dist/commands/build.d.ts.map +1 -1
  8. package/dist/commands/build.js +115 -1
  9. package/dist/commands/build.js.map +1 -1
  10. package/dist/commands/codegen.js +42 -1
  11. package/dist/commands/doctor.d.ts.map +1 -1
  12. package/dist/commands/doctor.js +65 -1
  13. package/dist/commands/doctor.js.map +1 -1
  14. package/dist/commands/features/assets.d.ts +6 -0
  15. package/dist/commands/features/assets.d.ts.map +1 -0
  16. package/dist/commands/features/assets.js +113 -0
  17. package/dist/commands/features/assets.js.map +1 -0
  18. package/dist/commands/features/multiplayer.d.ts +2 -0
  19. package/dist/commands/features/multiplayer.d.ts.map +1 -0
  20. package/dist/commands/features/multiplayer.js +81 -0
  21. package/dist/commands/features/multiplayer.js.map +1 -0
  22. package/dist/commands/features/native.d.ts +2 -0
  23. package/dist/commands/features/native.d.ts.map +1 -0
  24. package/dist/commands/features/native.js +83 -0
  25. package/dist/commands/features/native.js.map +1 -0
  26. package/dist/commands/features/physics.d.ts +2 -0
  27. package/dist/commands/features/physics.d.ts.map +1 -0
  28. package/dist/commands/features/physics.js +44 -0
  29. package/dist/commands/features/physics.js.map +1 -0
  30. package/dist/commands/features/pipeline.d.ts +2 -0
  31. package/dist/commands/features/pipeline.d.ts.map +1 -0
  32. package/dist/commands/features/pipeline.js +28 -0
  33. package/dist/commands/features/pipeline.js.map +1 -0
  34. package/dist/commands/features/tailwind.d.ts +2 -0
  35. package/dist/commands/features/tailwind.d.ts.map +1 -0
  36. package/dist/commands/features/tailwind.js +46 -0
  37. package/dist/commands/features/tailwind.js.map +1 -0
  38. package/dist/commands/generate.js +186 -1
  39. package/dist/commands/lifecycle.d.ts.map +1 -1
  40. package/dist/commands/lifecycle.js +45 -1
  41. package/dist/commands/lifecycle.js.map +1 -1
  42. package/dist/commands/new-helpers.d.ts +11 -0
  43. package/dist/commands/new-helpers.d.ts.map +1 -0
  44. package/dist/commands/new-helpers.js +109 -0
  45. package/dist/commands/new-helpers.js.map +1 -0
  46. package/dist/commands/new.d.ts.map +1 -1
  47. package/dist/commands/new.js +153 -1
  48. package/dist/commands/new.js.map +1 -1
  49. package/dist/commands/publish.js +86 -1
  50. package/dist/commands/template.d.ts.map +1 -1
  51. package/dist/commands/template.js +259 -1
  52. package/dist/commands/template.js.map +1 -1
  53. package/dist/commands/verify.d.ts +2 -0
  54. package/dist/commands/verify.d.ts.map +1 -0
  55. package/dist/commands/verify.js +80 -0
  56. package/dist/commands/verify.js.map +1 -0
  57. package/dist/constants/versions.d.ts +38 -0
  58. package/dist/constants/versions.d.ts.map +1 -0
  59. package/dist/constants/versions.js +38 -0
  60. package/dist/constants/versions.js.map +1 -0
  61. package/dist/index.js +106 -1
  62. package/dist/index.js.map +1 -1
  63. package/dist/templates/angular.js +376 -1
  64. package/dist/templates/components.js +54 -1
  65. package/dist/templates/config.js +26 -1
  66. package/dist/templates/electron.js +124 -1
  67. package/dist/templates/index.d.ts +2 -0
  68. package/dist/templates/index.d.ts.map +1 -1
  69. package/dist/templates/index.js +7 -1
  70. package/dist/templates/index.js.map +1 -1
  71. package/dist/templates/multiplayer.d.ts +7 -0
  72. package/dist/templates/multiplayer.d.ts.map +1 -0
  73. package/dist/templates/multiplayer.js +151 -0
  74. package/dist/templates/multiplayer.js.map +1 -0
  75. package/dist/templates/native.d.ts +4 -0
  76. package/dist/templates/native.d.ts.map +1 -0
  77. package/dist/templates/native.js +40 -0
  78. package/dist/templates/native.js.map +1 -0
  79. package/dist/templates.js +2 -1
  80. package/dist/utils/ast.d.ts +20 -0
  81. package/dist/utils/ast.d.ts.map +1 -0
  82. package/dist/utils/ast.js +95 -0
  83. package/dist/utils/ast.js.map +1 -0
  84. package/dist/utils/engine.d.ts +9 -0
  85. package/dist/utils/engine.d.ts.map +1 -0
  86. package/dist/utils/engine.js +43 -0
  87. package/dist/utils/engine.js.map +1 -0
  88. package/dist/utils/logger.js +65 -1
  89. package/dist/utils/pipeline.d.ts +2 -0
  90. package/dist/utils/pipeline.d.ts.map +1 -0
  91. package/dist/utils/pipeline.js +69 -0
  92. package/dist/utils/pipeline.js.map +1 -0
  93. package/dist/utils/update.js +33 -1
  94. package/dist/utils/validation.js +12 -1
  95. package/package.json +3 -2
package/README.md CHANGED
@@ -89,6 +89,7 @@ Generates a type-safe IPC communication channel:
89
89
  ### `valence add <feature>`
90
90
 
91
91
  Injects advanced capabilities into an existing project.
92
+ **Now powered by AST (Abstract Syntax Tree)** parsing to safely inject code into `ValenceEngineService` without breaking your custom logic.
92
93
 
93
94
  - `physics`: Installs Havok engine, configures WASM assets, and initializes physics in the global scene.
94
95
  - `inspector`: Installs `@babylonjs/inspector` and binds `Ctrl+I` to toggle the dedicated 3D debugger overlay.
@@ -97,6 +98,9 @@ Injects advanced capabilities into an existing project.
97
98
  - `skybox`: Automatically creates a large skybox mesh to provide environmental context.
98
99
  - `xr`: Initializes WebXR default experience (Teleportation + Controller support) for VR/AR.
99
100
  - `tailwind`: Configures TailwindCSS with Angular (PostCSS, Config, Styles).
101
+ - `multiplayer`: Scaffolds a dedicated Colyseus server and injects a real-time network client.
102
+ - `pipeline`: Enables the Asset Optimization Pipeline (sharp) to auto-compress textures on build.
103
+ - `native`: Scaffolds a Rust (Neon) native module for high-performance Node.js bindings.
100
104
 
101
105
  ### `valence template <type>`
102
106
 
@@ -121,6 +125,9 @@ Diagnoses your development environment:
121
125
  - Verifies Git installation.
122
126
  - Checks for global Angular CLI (optional).
123
127
 
124
- ## License
128
+ ### `valence verify`
125
129
 
126
- MIT
130
+ Performs a deep health check of your project structure and configuration:
131
+ - **Engine Service**: Validates `ValenceEngineService` class and `createScene` method structure.
132
+ - **Electron Config**: Checks `main.ts` existence and `package.json` entry point (`dist/electron/main.js`).
133
+ - **Build Config**: Verifies `angular.json` output paths and `index.html` base href for Electron compatibility.
@@ -89,6 +89,7 @@ Generates a type-safe IPC communication channel:
89
89
  ### `valence add <feature>`
90
90
 
91
91
  Injects advanced capabilities into an existing project.
92
+ **Now powered by AST (Abstract Syntax Tree)** parsing to safely inject code into `ValenceEngineService` without breaking your custom logic.
92
93
 
93
94
  - `physics`: Installs Havok engine, configures WASM assets, and initializes physics in the global scene.
94
95
  - `inspector`: Installs `@babylonjs/inspector` and binds `Ctrl+I` to toggle the dedicated 3D debugger overlay.
@@ -97,6 +98,9 @@ Injects advanced capabilities into an existing project.
97
98
  - `skybox`: Automatically creates a large skybox mesh to provide environmental context.
98
99
  - `xr`: Initializes WebXR default experience (Teleportation + Controller support) for VR/AR.
99
100
  - `tailwind`: Configures TailwindCSS with Angular (PostCSS, Config, Styles).
101
+ - `multiplayer`: Scaffolds a dedicated Colyseus server and injects a real-time network client.
102
+ - `pipeline`: Enables the Asset Optimization Pipeline (sharp) to auto-compress textures on build.
103
+ - `native`: Scaffolds a Rust (Neon) native module for high-performance Node.js bindings.
100
104
 
101
105
  ### `valence template <type>`
102
106
 
@@ -121,24 +125,9 @@ Diagnoses your development environment:
121
125
  - Verifies Git installation.
122
126
  - Checks for global Angular CLI (optional).
123
127
 
124
- ## 📂 Project Structure
125
-
126
- Valence enforces a clean, separated structure:
127
-
128
- ```text
129
- my-project/
130
- ├── electron/
131
- │ ├── main.ts # Main Process (Source)
132
- │ ├── preload.ts # Preload Script (Source)
133
- │ └── tsconfig.json # Electron TS Config
134
- ├── src/ # Angular App (Renderer)
135
- ├── dist/ # Build Output
136
- │ ├── browser/ # Angular Compilation
137
- │ └── electron/ # Electron Transpilation
138
- ├── forge.config.js # Packaging Config
139
- └── package.json
140
- ```
141
-
142
- ## License
128
+ ### `valence verify`
143
129
 
144
- MIT
130
+ Performs a deep health check of your project structure and configuration:
131
+ - **Engine Service**: Validates `ValenceEngineService` class and `createScene` method structure.
132
+ - **Electron Config**: Checks `main.ts` existence and `package.json` entry point (`dist/electron/main.js`).
133
+ - **Build Config**: Verifies `angular.json` output paths and `index.html` base href for Electron compatibility.
package/dist/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # Valence CLI
2
+
3
+ <p align="center">
4
+ <img src="https://img.shields.io/badge/Angular-DD0031?style=for-the-badge&logo=angular&logoColor=white" alt="Angular" />
5
+ <img src="https://img.shields.io/badge/Electron-47848F?style=for-the-badge&logo=electron&logoColor=white" alt="Electron" />
6
+ <img src="https://img.shields.io/badge/Babylon.js-BBBBBB?style=for-the-badge&logo=babylondotjs&logoColor=white" alt="Babylon.js" />
7
+ </p>
8
+
9
+ <p align="center">
10
+ <img src="https://img.shields.io/npm/v/valence-cli?style=for-the-badge&color=2ea44f" alt="npm version" />
11
+ <img src="https://img.shields.io/badge/Status-Stable-success?style=for-the-badge" alt="Status" />
12
+ <img src="https://img.shields.io/npm/l/valence-cli?style=for-the-badge&color=blue" alt="License" />
13
+ </p>
14
+
15
+ > **The ultimate scaffolding tool for hybrid 3D applications.**
16
+
17
+ **Valence CLI** automates the creation and management of high-performance desktop applications using **Angular**, **Electron**, and **Babylon.js**. It provides a robust, pre-configured environment with TypeScript support, build orchestration, and "production-ready" defaults.
18
+
19
+ ## 🚀 Installation
20
+
21
+ ```bash
22
+ npm install -g valence-cli
23
+ ```
24
+
25
+ ## ✨ Quick Start
26
+
27
+ Create a new project with the **Valence Identity** template (includes 3D scene, SVG logo, and debug HUD):
28
+
29
+ ```bash
30
+ valence new my-game
31
+ cd my-game
32
+ valence start
33
+ ```
34
+
35
+ ## 🛠 Commands
36
+
37
+ ### `valence new <name>`
38
+ Scaffolds a new project with:
39
+ - **Angular**: Latest CLI, SCSS, Routing.
40
+ - **Electron**: TypeScript Main/Preload processes, securely configured.
41
+ - **Babylon.js**: Core dependencies pre-installed.
42
+ - **Forge**: configured for building `.exe` / `.zip` / installers.
43
+ - **Pro Template**: Includes a rotating wireframe plane, FPS counter, and real-time Camera Rotation (XYZ) tracker with a premium glassmorphic UI.
44
+
45
+ ### `valence start`
46
+ Runs the application in **Development Mode**:
47
+ - Cleans previous builds.
48
+ - Builds Angular (Dev config).
49
+ - Compiles Electron (TypeScript).
50
+ - Launches Electron window with live reload enabled.
51
+
52
+ ### `valence build`
53
+ Compiles the application for **Production**:
54
+ - Outputs to `dist/browser` (Angular) and `dist/electron` (Main Process).
55
+ - Optimizes assets.
56
+ - Enforces relative paths (`baseHref="./"`) for Electron compatibility.
57
+
58
+ ### `valence package`
59
+ Packages the application for distribution:
60
+ - Runs `valence build`.
61
+ - Executes **Electron Forge** to generate installers (e.g., Windows Squirrel.exe, Zip).
62
+ - Artifacts saved to `out/`.
63
+
64
+ ### `valence publish`
65
+ Automates the release pipeline:
66
+ 1. Bumps project version (patch).
67
+ 2. Updates `README.md` version badges.
68
+ 3. Builds & Packages.
69
+ 4. Generates `RELEASES_README.md` entry.
70
+ 5. Publishes via Electron Forge (e.g., to GitHub Releases).
71
+
72
+ ### `valence generate scene <name>`
73
+ *Alias: `valence g scene <name>`*
74
+ Scaffolds a new **Babylon.js Scene component** in `src/app/scenes/<name>`:
75
+ - Pre-wired `Engine` and `Scene` creation.
76
+ - Includes Camera, Light, and Resize event handling.
77
+ - Ready for 3D logic immediately.
78
+
79
+ ### `valence generate bridge <name>`
80
+
81
+ *Alias: `valence g bridge <name>`*
82
+
83
+ Generates a type-safe IPC communication channel:
84
+
85
+ - Main Process: Registers `ipcMain.handle` listener.
86
+ - Preload: Exposes `contextBridge` API safe for Renderer.
87
+ - Service: Creates an Angular service wrapper to call the API.
88
+
89
+ ### `valence add <feature>`
90
+
91
+ Injects advanced capabilities into an existing project.
92
+ **Now powered by AST (Abstract Syntax Tree)** parsing to safely inject code into `ValenceEngineService` without breaking your custom logic.
93
+
94
+ - `physics`: Installs Havok engine, configures WASM assets, and initializes physics in the global scene.
95
+ - `inspector`: Installs `@babylonjs/inspector` and binds `Ctrl+I` to toggle the dedicated 3D debugger overlay.
96
+ - `gui`: Installs `lil-gui` and creates a debug panel for tweaking parameters at runtime.
97
+ - `materials`: Installs `@babylonjs/materials`, enabling Grid, Gradient, and other advanced materials.
98
+ - `skybox`: Automatically creates a large skybox mesh to provide environmental context.
99
+ - `xr`: Initializes WebXR default experience (Teleportation + Controller support) for VR/AR.
100
+ - `tailwind`: Configures TailwindCSS with Angular (PostCSS, Config, Styles).
101
+ - `multiplayer`: Scaffolds a dedicated Colyseus server and injects a real-time network client.
102
+ - `pipeline`: Enables the Asset Optimization Pipeline (sharp) to auto-compress textures on build.
103
+ - `native`: Scaffolds a Rust (Neon) native module for high-performance Node.js bindings.
104
+
105
+ ### `valence template <type>`
106
+
107
+ Swaps the default 3D scene logic for a genre-specific starter.
108
+
109
+ - `fps`: First Person Shooter setup (WASD + Mouse Look + Gravity + Collisions).
110
+ - `orbit`: Product/Model Viewer setup (ArcRotateCamera + Studio Lighting).
111
+ - `platformer`: Third-person follow camera with a capsule character controller.
112
+ - `iso`: Isometric orthographic view (RTS/Strategy style) with tile grid,
113
+ - `gallery`: First-person interactive walkthrough with raycast-based highlighting.
114
+
115
+ ### `valence codegen assets`
116
+
117
+ Scans your `src/assets` folder and generates a TypeScript file (`core/asset-keys.ts`) with typed constants for every file path.
118
+
119
+ - Usage: `scene.createTexture(AssetKeys.TEXTURES_GRASS_PNG)`
120
+
121
+ ### `valence doctor`
122
+
123
+ Diagnoses your development environment:
124
+ - Checks Node.js & NPM versions.
125
+ - Verifies Git installation.
126
+ - Checks for global Angular CLI (optional).
127
+
128
+ ### `valence verify`
129
+
130
+ Performs a deep health check of your project structure and configuration:
131
+ - **Engine Service**: Validates `ValenceEngineService` class and `createScene` method structure.
132
+ - **Electron Config**: Checks `main.ts` existence and `package.json` entry point (`dist/electron/main.js`).
133
+ - **Build Config**: Verifies `angular.json` output paths and `index.html` base href for Electron compatibility.
@@ -1 +1 @@
1
- {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU,GAAU,SAAS,MAAM,kBAsB/C,CAAA"}
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,UAAU,GAAU,SAAS,MAAM,kBAyB/C,CAAA"}