vaderjs 1.3.3-12219a8b18b-hotfix → 1.3.3-1b2198a8b18b
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 +1 -1
- package/vader.js +20 -22
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "vaderjs",
|
|
3
3
|
"description": "A Reactive library aimed to helping you build reactive applications inspired by react.js",
|
|
4
4
|
"module": "vader.js",
|
|
5
|
-
"version": "1.3.3-
|
|
5
|
+
"version": "1.3.3-1b2198a8b18b",
|
|
6
6
|
"bin": {
|
|
7
7
|
"vader": "./vader.js"
|
|
8
8
|
},
|
package/vader.js
CHANGED
|
@@ -907,7 +907,9 @@ async function Build() {
|
|
|
907
907
|
page.on('crash', () => {
|
|
908
908
|
console.error(`Render process crashed for ${route.url}`)
|
|
909
909
|
});
|
|
910
|
-
|
|
910
|
+
page.on('requestfailed', request => {
|
|
911
|
+
console.error('REQUEST FAILED:', request.url(), request.failure().errorText);
|
|
912
|
+
});
|
|
911
913
|
await page.goto(`http://localhost:${port}${route.url}`, { waitUntil: 'networkidle2' });
|
|
912
914
|
|
|
913
915
|
page.evaluate(() => {
|
|
@@ -1163,12 +1165,8 @@ async function Build() {
|
|
|
1163
1165
|
`;
|
|
1164
1166
|
globalThis.routeDocuments.push({ url: route.url, document: document })
|
|
1165
1167
|
})
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
ssg(globalThis.routes)
|
|
1169
|
-
globalThis.oneAndDone = true
|
|
1170
|
-
console.log('Prerendering...')
|
|
1171
|
-
}
|
|
1168
|
+
|
|
1169
|
+
ssg(globalThis.routes)
|
|
1172
1170
|
|
|
1173
1171
|
|
|
1174
1172
|
const scannedSourceFiles = await glob("**/**.{jsx,js,json}", {
|
|
@@ -1260,7 +1258,7 @@ async function Build() {
|
|
|
1260
1258
|
|
|
1261
1259
|
return true
|
|
1262
1260
|
}
|
|
1263
|
-
const s = (
|
|
1261
|
+
const s = () => {
|
|
1264
1262
|
|
|
1265
1263
|
const server = http.createServer((req, res) => {
|
|
1266
1264
|
|
|
@@ -1345,9 +1343,10 @@ const s = (port) => {
|
|
|
1345
1343
|
return 'application/octet-stream';
|
|
1346
1344
|
}
|
|
1347
1345
|
}
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1346
|
+
|
|
1347
|
+
const PORT = process.env.PORT || 3000;
|
|
1348
|
+
server.listen(PORT, () => {
|
|
1349
|
+
console.log(`Server is running on port ${PORT}`);
|
|
1351
1350
|
globalThis.ws = ws
|
|
1352
1351
|
});
|
|
1353
1352
|
|
|
@@ -1360,15 +1359,11 @@ switch (true) {
|
|
|
1360
1359
|
|
|
1361
1360
|
globalThis.devMode = true
|
|
1362
1361
|
globalThis.isProduction = false
|
|
1363
|
-
|
|
1364
|
-
let p = process.env.PORT || config.port || process.argv.includes('-p') ? process.argv[process.argv.indexOf('-p') + 1] : 3000
|
|
1365
|
-
globalThis.oneAndDone = false
|
|
1366
1362
|
console.log(`
|
|
1367
1363
|
Vader.js v${fs.readFileSync(process.cwd() + '/node_modules/vaderjs/package.json', 'utf8').split('"version": "')[1].split('"')[0]}
|
|
1368
1364
|
- Watching for changes in ./pages
|
|
1369
1365
|
- Watching for changes in ./src
|
|
1370
1366
|
- Watching for changes in ./public
|
|
1371
|
-
- Serving on port ${p}
|
|
1372
1367
|
`)
|
|
1373
1368
|
!globalThis.isBuilding ? Build() : null
|
|
1374
1369
|
|
|
@@ -1392,8 +1387,11 @@ Vader.js v${fs.readFileSync(process.cwd() + '/node_modules/vaderjs/package.json'
|
|
|
1392
1387
|
Build()
|
|
1393
1388
|
}
|
|
1394
1389
|
}).on('error', (err) => console.log(err))
|
|
1395
|
-
})
|
|
1396
|
-
|
|
1390
|
+
})
|
|
1391
|
+
let p = process.argv[process.argv.indexOf('dev') + 1] || 3000
|
|
1392
|
+
|
|
1393
|
+
process.env.PORT = p
|
|
1394
|
+
s()
|
|
1397
1395
|
|
|
1398
1396
|
globalThis.listen = true;
|
|
1399
1397
|
|
|
@@ -1413,15 +1411,15 @@ Building to ./dist
|
|
|
1413
1411
|
|
|
1414
1412
|
break;
|
|
1415
1413
|
case process.argv.includes('start') && !process.argv.includes('dev') && !process.argv.includes('build'):
|
|
1416
|
-
let port = process.
|
|
1417
|
-
|
|
1414
|
+
let port = process.argv[process.argv.indexOf('--serve') + 1] || 3000
|
|
1415
|
+
process.env.PORT = port
|
|
1418
1416
|
globalThis.devMode = false
|
|
1419
1417
|
console.log(`
|
|
1420
1418
|
Vader.js v1.3.3
|
|
1421
1419
|
Serving ./dist on port ${port}
|
|
1422
1420
|
url: http://localhost:${port}
|
|
1423
1421
|
`)
|
|
1424
|
-
s(
|
|
1422
|
+
s()
|
|
1425
1423
|
break;
|
|
1426
1424
|
default:
|
|
1427
1425
|
// add color
|
|
@@ -1432,11 +1430,11 @@ Usage: vader <command>
|
|
|
1432
1430
|
|
|
1433
1431
|
Commands:
|
|
1434
1432
|
|
|
1435
|
-
vaderjs dev
|
|
1433
|
+
vaderjs dev Start the development server
|
|
1436
1434
|
|
|
1437
1435
|
vaderjs build Build the project to ./dist
|
|
1438
1436
|
|
|
1439
|
-
vaderjs start
|
|
1437
|
+
vaderjs start <port> Production Mode (default 3000 or process.env.PORT)
|
|
1440
1438
|
|
|
1441
1439
|
Learn more about vader: https://vader-js.pages.dev/
|
|
1442
1440
|
|