Compare commits
No commits in common. "f39ed85d29b84b1c465d07c17b04d85f2b97f6fc" and "7b1ed07e75c0d878e94983186f0bba0b8573eff7" have entirely different histories.
f39ed85d29
...
7b1ed07e75
|
@ -1 +1 @@
|
||||||
Sun Jan 15 15:11:49 CST 2023
|
Sun Jan 15 01:13:51 CST 2023
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{
|
{
|
||||||
"name": "diskernet",
|
"name": "diskernet",
|
||||||
"version": "2.9.0",
|
"version": "2.7.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "diskernet",
|
"name": "diskernet",
|
||||||
"version": "2.9.0",
|
"version": "2.7.1",
|
||||||
"license": "PolyForm Strict 1.0",
|
"license": "PolyForm Strict 1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@667/ps-list": "^1.1.3",
|
"@667/ps-list": "^1.1.3",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "diskernet",
|
"name": "diskernet",
|
||||||
"version": "2.9.0",
|
"version": "2.7.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Library server and an archivist browser controller.",
|
"description": "Library server and an archivist browser controller.",
|
||||||
"main": "src/app.js",
|
"main": "src/app.js",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
./node_modules/.bin/esbuild src/app.js --bundle --outfile=dist/diskernet.mjs --format=esm --platform=node --minify --analyze
|
./node_modules/.bin/esbuild src/app.js --bundle --outfile=dist/diskernet.mjs --format=esm --platform=node --minify --analyze
|
||||||
./node_modules/.bin/esbuild src/app.js --bundle --outfile=build/out.cjs --platform=node --minify --analyze
|
./node_modules/.bin/esbuild src/app.js --bundle --outfile=build/out.cjs --platform=node --minify --analyze
|
||||||
#./node_modules/.bin/esbuild src/app.js --bundle --outfile=build/test.cjs --platform=node
|
./node_modules/.bin/esbuild src/app.js --bundle --outfile=build/test.cjs --platform=node
|
||||||
echo "#!/usr/bin/env node" > build/diskernet.cjs
|
echo "#!/usr/bin/env node" > build/diskernet.cjs
|
||||||
cat build/out.cjs >> build/diskernet.cjs
|
cat build/out.cjs >> build/diskernet.cjs
|
||||||
chmod +x build/diskernet.cjs
|
chmod +x build/diskernet.cjs
|
||||||
|
|
|
@ -211,8 +211,8 @@
|
||||||
async function collect({chrome_port:port, mode} = {}) {
|
async function collect({chrome_port:port, mode} = {}) {
|
||||||
const {library_path} = args;
|
const {library_path} = args;
|
||||||
const exitHandlers = [];
|
const exitHandlers = [];
|
||||||
|
process.on('SIGUSR2', runHandlers);
|
||||||
process.on('beforeExit', runHandlers);
|
process.on('beforeExit', runHandlers);
|
||||||
process.on('SIGUSR2', code => runHandlers(code, 'SIGUSR2', {exit: true}));
|
|
||||||
process.on('exit', code => runHandlers(code, 'exit', {exit: true}));
|
process.on('exit', code => runHandlers(code, 'exit', {exit: true}));
|
||||||
State.connection = State.connection || await connect({port});
|
State.connection = State.connection || await connect({port});
|
||||||
State.onExit = {
|
State.onExit = {
|
||||||
|
|
|
@ -2,7 +2,6 @@ import path from 'path';
|
||||||
import {fileURLToPath} from 'url';
|
import {fileURLToPath} from 'url';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import {APP_ROOT as __ROOT} from './root.js';
|
|
||||||
|
|
||||||
const DEEB = false;
|
const DEEB = false;
|
||||||
|
|
||||||
|
@ -14,10 +13,6 @@ export const DEBUG = {
|
||||||
}
|
}
|
||||||
export const SHOW_FETCH = false;
|
export const SHOW_FETCH = false;
|
||||||
|
|
||||||
if ( DEBUG.debug ) {
|
|
||||||
console.log({APP_ROOT});
|
|
||||||
}
|
|
||||||
|
|
||||||
// server related
|
// server related
|
||||||
export const PUBLIC_SERVER = true;
|
export const PUBLIC_SERVER = true;
|
||||||
|
|
||||||
|
@ -79,7 +74,9 @@ export const SNIP_CONTEXT = 31;
|
||||||
|
|
||||||
export const NO_SANDBOX = (process.env.DEBUG_22120 && process.env.SET_22120_NO_SANDBOX) || false;
|
export const NO_SANDBOX = (process.env.DEBUG_22120 && process.env.SET_22120_NO_SANDBOX) || false;
|
||||||
|
|
||||||
export const APP_ROOT = __ROOT
|
//export const APP_ROOT = '.';
|
||||||
|
export const APP_ROOT = path.dirname(process.argv[0]);
|
||||||
|
//export const APP_ROOT = path.dirname(fileURLToPath(import.meta.url));
|
||||||
|
|
||||||
export const sleep = ms => new Promise(res => setTimeout(res, ms));
|
export const sleep = ms => new Promise(res => setTimeout(res, ms));
|
||||||
|
|
||||||
|
|
|
@ -68,12 +68,7 @@ async function start({server_port}) {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
upAt = new Date;
|
upAt = new Date;
|
||||||
say({server_up:{upAt,port,
|
say({server_up:{upAt,port}});
|
||||||
...(DEBUG.verboseSlow ? {
|
|
||||||
static_site_path: SITE_PATH,
|
|
||||||
app_root: APP_ROOT,
|
|
||||||
} : {})
|
|
||||||
}});
|
|
||||||
});
|
});
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
running = false;
|
running = false;
|
||||||
|
|
15
src/root.cjs
15
src/root.cjs
|
@ -1,15 +0,0 @@
|
||||||
const path = require('path');
|
|
||||||
const url = require('url');
|
|
||||||
|
|
||||||
const file = __filename;
|
|
||||||
const dir = path.dirname(file);
|
|
||||||
const APP_ROOT = dir;
|
|
||||||
|
|
||||||
console.log({APP_ROOT});
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
APP_ROOT,
|
|
||||||
dir,
|
|
||||||
file
|
|
||||||
}
|
|
||||||
|
|
22
src/root.js
22
src/root.js
|
@ -1,22 +0,0 @@
|
||||||
import path from 'path';
|
|
||||||
import url from 'url';
|
|
||||||
|
|
||||||
let root;
|
|
||||||
let esm = false;
|
|
||||||
|
|
||||||
try {
|
|
||||||
console.log(__dirname, __filename);
|
|
||||||
} catch(e) {
|
|
||||||
esm = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! esm ) {
|
|
||||||
root = require('./root.cjs').APP_ROOT;
|
|
||||||
} else {
|
|
||||||
root = path.dirname(url.fileURLToPath(import.meta.url));
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log({root});
|
|
||||||
|
|
||||||
export const APP_ROOT = root;
|
|
||||||
|
|
Loading…
Reference in New Issue