visual-ai-staging 0.0.2 → 0.0.3
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/.github/workflows/publish.yml +10 -1
- package/README.md +20 -3
- package/cli.js +49 -0
- package/package.json +2 -2
|
@@ -10,6 +10,8 @@ on:
|
|
|
10
10
|
jobs:
|
|
11
11
|
publish:
|
|
12
12
|
runs-on: ubuntu-latest
|
|
13
|
+
env:
|
|
14
|
+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
|
|
13
15
|
steps:
|
|
14
16
|
- name: Checkout repository
|
|
15
17
|
uses: actions/checkout@v4
|
|
@@ -17,7 +19,7 @@ jobs:
|
|
|
17
19
|
- name: Set up Node.js
|
|
18
20
|
uses: actions/setup-node@v4
|
|
19
21
|
with:
|
|
20
|
-
node-version: '
|
|
22
|
+
node-version: '24'
|
|
21
23
|
registry-url: 'https://registry.npmjs.org'
|
|
22
24
|
|
|
23
25
|
- name: Run Milestone 4 Unit Tests
|
|
@@ -26,6 +28,13 @@ jobs:
|
|
|
26
28
|
- name: Run Milestone 5 Unit Tests
|
|
27
29
|
run: node verify_r4.js
|
|
28
30
|
|
|
31
|
+
- name: Sync version with Git Tag
|
|
32
|
+
run: |
|
|
33
|
+
# Extract clean version number from tag (e.g., v0.0.2 -> 0.0.2)
|
|
34
|
+
CLEAN_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
|
|
35
|
+
echo "Syncing package.json version to $CLEAN_VERSION"
|
|
36
|
+
npm version $CLEAN_VERSION --no-git-tag-version
|
|
37
|
+
|
|
29
38
|
- name: Publish Package to NPM Registry
|
|
30
39
|
run: npm publish
|
|
31
40
|
env:
|
package/README.md
CHANGED
|
@@ -33,10 +33,26 @@ npm install -g visual-ai-staging
|
|
|
33
33
|
## Quick Start
|
|
34
34
|
|
|
35
35
|
### 1. Initialize the Staging Environment
|
|
36
|
-
Navigate to your project root folder and
|
|
36
|
+
Navigate to your project root folder and initialize the workspace to create the local staging directories:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
#
|
|
39
|
+
# Prepare the Visual AI Staging local workspace
|
|
40
|
+
vais init
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
*Console Output:*
|
|
44
|
+
```bash
|
|
45
|
+
Successfully initialized Visual AI Staging workspace!
|
|
46
|
+
Created directories:
|
|
47
|
+
- .ai-staging/audio/
|
|
48
|
+
- .ai-staging/feedback/
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 2. Start the Development Server
|
|
52
|
+
Launch the native local HTTP staging server:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Start the local staging daemon
|
|
40
56
|
vais dev
|
|
41
57
|
```
|
|
42
58
|
|
|
@@ -45,7 +61,7 @@ vais dev
|
|
|
45
61
|
Visual AI Staging Dev Server running at http://localhost:3000/
|
|
46
62
|
```
|
|
47
63
|
|
|
48
|
-
###
|
|
64
|
+
### 3. Run Visual Staging
|
|
49
65
|
1. Open your web browser and navigate to `http://localhost:3000/`.
|
|
50
66
|
2. Activate **Inspection Mode** or **Free-Zone Drawing** on the toolbar.
|
|
51
67
|
3. Select elements, alter visual parameters, record voice notes, and staging your layout options.
|
|
@@ -64,6 +80,7 @@ Options:
|
|
|
64
80
|
-h, --help Output usage information
|
|
65
81
|
|
|
66
82
|
Commands:
|
|
83
|
+
init Initialize Visual AI Staging workspace (.ai-staging/ directories)
|
|
67
84
|
dev Start the Visual AI Staging native development server
|
|
68
85
|
```
|
|
69
86
|
|
package/cli.js
CHANGED
|
@@ -28,15 +28,64 @@ Options:
|
|
|
28
28
|
-h, --help Output usage information
|
|
29
29
|
|
|
30
30
|
Commands:
|
|
31
|
+
init Initialize Visual AI Staging workspace (.ai-staging/ directories)
|
|
31
32
|
dev Start the Visual AI Staging native development server
|
|
32
33
|
`);
|
|
33
34
|
process.exit(0);
|
|
34
35
|
}
|
|
35
36
|
|
|
37
|
+
if (command === 'init') {
|
|
38
|
+
const resolvedBase = path.resolve(__dirname);
|
|
39
|
+
const audioDir = path.join(resolvedBase, '.ai-staging', 'audio');
|
|
40
|
+
const feedbackDir = path.join(resolvedBase, '.ai-staging', 'feedback');
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
let alreadyExists = fs.existsSync(audioDir) && fs.existsSync(feedbackDir);
|
|
44
|
+
|
|
45
|
+
fs.mkdirSync(audioDir, { recursive: true });
|
|
46
|
+
fs.mkdirSync(feedbackDir, { recursive: true });
|
|
47
|
+
|
|
48
|
+
// Create .gitkeep to ensure empty directories are tracked by Git
|
|
49
|
+
const gitkeepAudio = path.join(audioDir, '.gitkeep');
|
|
50
|
+
const gitkeepFeedback = path.join(feedbackDir, '.gitkeep');
|
|
51
|
+
|
|
52
|
+
if (!fs.existsSync(gitkeepAudio)) fs.writeFileSync(gitkeepAudio, '');
|
|
53
|
+
if (!fs.existsSync(gitkeepFeedback)) fs.writeFileSync(gitkeepFeedback, '');
|
|
54
|
+
|
|
55
|
+
if (alreadyExists) {
|
|
56
|
+
console.log('Visual AI Staging environment already initialized in this workspace.');
|
|
57
|
+
} else {
|
|
58
|
+
console.log('Successfully initialized Visual AI Staging workspace!');
|
|
59
|
+
console.log('Created directories:');
|
|
60
|
+
console.log(' - .ai-staging/audio/');
|
|
61
|
+
console.log(' - .ai-staging/feedback/');
|
|
62
|
+
}
|
|
63
|
+
} catch (err) {
|
|
64
|
+
console.error('Error initializing workspace:', err.message);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
process.exit(0);
|
|
68
|
+
}
|
|
69
|
+
|
|
36
70
|
if (command === 'dev') {
|
|
37
71
|
const port = 3000;
|
|
38
72
|
const resolvedBase = path.resolve(__dirname);
|
|
39
73
|
|
|
74
|
+
// Auto-initialize directories silently on server startup if they do not exist
|
|
75
|
+
const audioDir = path.join(resolvedBase, '.ai-staging', 'audio');
|
|
76
|
+
const feedbackDir = path.join(resolvedBase, '.ai-staging', 'feedback');
|
|
77
|
+
try {
|
|
78
|
+
fs.mkdirSync(audioDir, { recursive: true });
|
|
79
|
+
fs.mkdirSync(feedbackDir, { recursive: true });
|
|
80
|
+
|
|
81
|
+
const gitkeepAudio = path.join(audioDir, '.gitkeep');
|
|
82
|
+
const gitkeepFeedback = path.join(feedbackDir, '.gitkeep');
|
|
83
|
+
if (!fs.existsSync(gitkeepAudio)) fs.writeFileSync(gitkeepAudio, '');
|
|
84
|
+
if (!fs.existsSync(gitkeepFeedback)) fs.writeFileSync(gitkeepFeedback, '');
|
|
85
|
+
} catch (err) {
|
|
86
|
+
console.warn('Warning: Failed to auto-initialize staging directories on startup:', err.message);
|
|
87
|
+
}
|
|
88
|
+
|
|
40
89
|
const server = http.createServer((req, res) => {
|
|
41
90
|
const parsedUrl = url.parse(req.url, true);
|
|
42
91
|
const pathname = parsedUrl.pathname;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visual-ai-staging",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Visual AI Staging Companion — Bridge the gap between UI design staging and AI coding assistants.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "app.js",
|
|
7
7
|
"bin": {
|
|
8
8
|
"vais": "./cli.js"
|
|
9
9
|
}
|
|
10
|
-
}
|
|
10
|
+
}
|