vmlive 1.0.5 → 1.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vmlive",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "Local development VM for custom Serverless PaaS",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli.js CHANGED
@@ -45,9 +45,9 @@ const buildProxyDispatcher = (functions, workspaceId, projectId, includeDashboar
45
45
 
46
46
  let res;
47
47
 
48
- if (targetName === 'dashboard' && env.DASHBOARD) {
48
+ ${includeDashboard ? `if (targetName === 'dashboard' && env.DASHBOARD) {
49
49
  res = await env.DASHBOARD.fetch(request);
50
- } else if (targetName && env[targetName]) {
50
+ } else ` : ''}if (targetName && env[targetName]) {
51
51
  res = await env[targetName].fetch(request);
52
52
  } else {
53
53
  res = new Response(
@@ -784,9 +784,12 @@ const main = async () => {
784
784
  await runLogin();
785
785
  } else if (command === 'deploy') {
786
786
  await runDeploy();
787
+ } else if (command === 'which' || command === '-v' || command === '--version' || command === 'v') {
788
+ const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'), 'utf-8'));
789
+ console.log(`vmlive CLI v${pkg.version}`);
787
790
  } else {
788
791
  console.error(`\x1b[31m❌ Unknown command: ${command || 'missing'}\x1b[0m`);
789
- console.log('Usage: vm init | vm add | vm dev | vm test | vm login | vm deploy');
792
+ console.log('Usage: vm init | vm add | vm dev | vm test | vm login | vm deploy | vm which');
790
793
  process.exit(1);
791
794
  }
792
795
  };
@@ -106,7 +106,7 @@ const UI_HTML = `
106
106
  </script>
107
107
  </body>
108
108
  </html>
109
- \`;
109
+ `;
110
110
 
111
111
  export default {
112
112
  async fetch(req, env) {