Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci
run: npm install

- name: Run tests
run: npm test
Expand Down
33 changes: 0 additions & 33 deletions .github/workflows/nuxthub.yml

This file was deleted.

7 changes: 5 additions & 2 deletions .github/workflows/pr-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ jobs:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci
- name: Clean install dependencies
run: |
rm -rf node_modules package-lock.json
npm install --ignore-scripts
npm rebuild

- name: Run tests with coverage
run: npm run test:coverage
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ logs
.fleet
.idea

# NPM package files
*.tgz

# Local env files
.env
.env.*
Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 28 additions & 5 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import path from 'path';
import fs from 'fs';
import url from 'url';
import { fileURLToPath } from 'url';
import open from 'open';
import { exec } from 'child_process';
import os from 'os';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down Expand Up @@ -57,11 +58,35 @@ function getMimeType(filePath) {
'.woff': 'font/woff',
'.woff2': 'font/woff2',
'.ttf': 'font/ttf',
'.otf': 'font/otf'
'.otf': 'font/otf',
'.wasm': 'application/wasm'
};
return mimeTypes[ext] || 'application/octet-stream';
}

function openBrowser(url) {
const platform = os.platform();
let command;

switch (platform) {
case 'darwin':
command = `open "${url}"`;
break;
case 'win32':
command = `start "${url}"`;
break;
default:
// Linux and others
command = `xdg-open "${url}" || sensible-browser "${url}" || x-www-browser "${url}" || gnome-open "${url}"`;
}

exec(command, (err) => {
if (err) {
console.log('📌 Could not open browser automatically. Please open the URL manually.');
}
});
}

function startServer() {
const distPath = path.join(__dirname, 'dist');

Expand Down Expand Up @@ -132,9 +157,7 @@ function startServer() {
console.log('📋 Press Ctrl+C to stop the server\n');

// Open browser
open(serverUrl).catch(() => {
console.log('📌 Could not open browser automatically. Please open the URL manually.');
});
openBrowser(serverUrl);
});

process.on('SIGINT', () => {
Expand Down
13 changes: 5 additions & 8 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,13 @@ export default defineNuxtConfig({
devtools: { enabled: true },
ssr: false,
nitro: {
preset: 'cloudflare-pages',
preset: 'static',
output: {
dir: './dist',
publicDir: './dist'
},
experimental: {
wasm: true
},
cloudflare: {
pages: {
routes: {
exclude: ['/favicon.ico']
}
}
}
},
app: {
Expand Down
Loading