@vesk/vesk-cli 0.0.1
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/README.md +25 -0
- package/bin/haul.js +49 -0
- package/dist/cli.js +33180 -0
- package/dist/sidecar.js +9346 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# vesk
|
|
2
|
+
|
|
3
|
+
Vesk — compiler-first framework for the post-VDOM web.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install vesk
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
vesk dev # Start dev server with HMR
|
|
15
|
+
vesk build # Production build
|
|
16
|
+
vesk start # Start production server
|
|
17
|
+
vesk typecheck # Type-check .vsk files
|
|
18
|
+
vesk seo # Run SEO audit
|
|
19
|
+
haul dev # Native engine dev server
|
|
20
|
+
haul build # Native engine production build
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## License
|
|
24
|
+
|
|
25
|
+
MIT
|
package/bin/haul.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { existsSync } from 'node:fs';
|
|
4
|
+
import { createRequire } from 'node:module';
|
|
5
|
+
import { dirname, join, resolve } from 'node:path';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const projectRequire = createRequire(resolve(process.cwd(), 'package.json'));
|
|
10
|
+
|
|
11
|
+
const PLATFORM_BIN = {
|
|
12
|
+
'linux-x64': '@vesk/haul-linux-x64',
|
|
13
|
+
'linux-arm64': '@vesk/haul-linux-arm64',
|
|
14
|
+
'darwin-x64': '@vesk/haul-darwin-x64',
|
|
15
|
+
'darwin-arm64': '@vesk/haul-darwin-arm64',
|
|
16
|
+
'win32-x64': '@vesk/haul-win32-x64',
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const key = `${process.platform}-${process.arch}`;
|
|
20
|
+
const pkgName = PLATFORM_BIN[key];
|
|
21
|
+
if (!pkgName) {
|
|
22
|
+
console.error(`[vesk haul] unsupported platform: ${key}`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let binPath;
|
|
27
|
+
try {
|
|
28
|
+
const binFile = `bin/haul${process.platform === 'win32' ? '.exe' : ''}`;
|
|
29
|
+
binPath = projectRequire.resolve(`${pkgName}/${binFile}`);
|
|
30
|
+
} catch {
|
|
31
|
+
console.error(
|
|
32
|
+
`[vesk haul] ${pkgName} is not installed — haul ships as a platform binary.\n` +
|
|
33
|
+
` Run \`npm install\` again, or install the matching binary for your platform:\n` +
|
|
34
|
+
` npm install ${pkgName}@$(node -p "require('vesk/package.json').version")`,
|
|
35
|
+
);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const env = { ...process.env };
|
|
40
|
+
const sidecar = join(__dirname, '..', 'dist', 'sidecar.js');
|
|
41
|
+
if (existsSync(sidecar)) env.VESK_SIDECAR = sidecar;
|
|
42
|
+
else delete env.VESK_SIDECAR;
|
|
43
|
+
|
|
44
|
+
const result = spawnSync(binPath, process.argv.slice(2), {
|
|
45
|
+
stdio: 'inherit',
|
|
46
|
+
env,
|
|
47
|
+
cwd: process.cwd(),
|
|
48
|
+
});
|
|
49
|
+
process.exit(result.status ?? 1);
|