create-vista-app 0.0.3 → 0.0.5

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 (2) hide show
  1. package/bin/vista.js +15 -4
  2. package/package.json +1 -1
package/bin/vista.js CHANGED
@@ -18,8 +18,16 @@ import { vistaPlugin } from 'vista-core-js/plugin';
18
18
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
19
19
 
20
20
  const args = process.argv.slice(2);
21
- const command = args[0] || 'dev';
22
- const targetDirArg = args[1]; // Removed default '.' to rely on prompt if creating
21
+ let command = args[0];
22
+ let targetDirArg = args[1];
23
+
24
+ const knownCommands = ['dev', 'build', 'start', 'create'];
25
+ if (!command) {
26
+ command = 'create';
27
+ } else if (!knownCommands.includes(command)) {
28
+ targetDirArg = command;
29
+ command = 'create';
30
+ }
23
31
 
24
32
  // Helper: Find all CSS files in app directory
25
33
  function findCssFiles(dir, fileList = []) {
@@ -210,8 +218,11 @@ async function startDev() {
210
218
  resolve: {
211
219
  dedupe: ['react', 'react-dom'],
212
220
  alias: {
213
- // Dev Fix: Point vista-core-js to source to enable HMR/Fast Refresh for framework internals
214
- 'vista-core-js': path.resolve(__dirname, '../../core/src')
221
+ alias: {
222
+ ...(fs.existsSync(path.resolve(__dirname, '../../core/package.json'))
223
+ ? { 'vista-core-js': path.resolve(__dirname, '../../core/src') }
224
+ : {})
225
+ }
215
226
  }
216
227
  },
217
228
  optimizeDeps: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-vista-app",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "vista": "./bin/vista.js"