@revijs/core 0.1.1 → 0.1.2
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 +2 -2
- package/src/setup.js +22 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revijs/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Local-first SPA prerender CLI tool — converts React/Vite apps into SEO-friendly static HTML",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"revijs": "./bin/revijs.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"postinstall": "
|
|
11
|
+
"postinstall": "node -e \"import('@revijs/core/src/setup.js').catch(()=>{})\"",
|
|
12
12
|
"start": "node bin/revijs.js",
|
|
13
13
|
"dev": "node bin/revijs.js --debug",
|
|
14
14
|
"test": "node --experimental-vm-modules node_modules/.bin/jest"
|
package/src/setup.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import pc from 'picocolors';
|
|
3
|
+
|
|
4
|
+
console.log(pc.cyan('\n ⚡ ReviJs — Setting up browser engine...\n'));
|
|
5
|
+
|
|
6
|
+
try {
|
|
7
|
+
// Install system dependencies (Linux/Ubuntu)
|
|
8
|
+
if (process.platform === 'linux') {
|
|
9
|
+
console.log(pc.dim(' Installing system dependencies...'));
|
|
10
|
+
execSync('npx playwright install-deps chromium', { stdio: 'inherit' });
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Install Chromium
|
|
14
|
+
console.log(pc.dim(' Installing Chromium...'));
|
|
15
|
+
execSync('npx playwright install chromium', { stdio: 'inherit' });
|
|
16
|
+
|
|
17
|
+
console.log(pc.green('\n ✔ ReviJs is ready! Run: npx revijs\n'));
|
|
18
|
+
} catch (err) {
|
|
19
|
+
console.warn(pc.yellow('\n Warning: Auto-setup failed. Run manually:'));
|
|
20
|
+
console.warn(pc.yellow(' npx playwright install-deps chromium'));
|
|
21
|
+
console.warn(pc.yellow(' npx playwright install chromium\n'));
|
|
22
|
+
}
|