@telepath-computer/television 0.1.65 → 0.1.67
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/dist/cli.cjs
CHANGED
|
@@ -33252,6 +33252,7 @@ var index_exports = {};
|
|
|
33252
33252
|
__export(index_exports, {
|
|
33253
33253
|
listVisibleCLICommandNames: () => listVisibleCLICommandNames,
|
|
33254
33254
|
resolveBundledViewsPath: () => resolveBundledViewsPath,
|
|
33255
|
+
resolveCanonicalDir: () => resolveCanonicalDir,
|
|
33255
33256
|
resolveStaticDir: () => resolveStaticDir,
|
|
33256
33257
|
runCLI: () => runCLI
|
|
33257
33258
|
});
|
|
@@ -48929,6 +48930,9 @@ var Server = class {
|
|
|
48929
48930
|
requireAuth: this.publicServer ? null : this.requireAuthorization,
|
|
48930
48931
|
getConnectedClientCount: () => this.events.getConnectedClientCount()
|
|
48931
48932
|
});
|
|
48933
|
+
if (options.canonicalDir) {
|
|
48934
|
+
this.app.use("/canonical/v1", import_express2.default.static(options.canonicalDir));
|
|
48935
|
+
}
|
|
48932
48936
|
if (options.staticDir) {
|
|
48933
48937
|
this.app.use(import_express2.default.static(options.staticDir));
|
|
48934
48938
|
}
|
|
@@ -50017,8 +50021,8 @@ function getDevPackageDir() {
|
|
|
50017
50021
|
return import_node_path7.default.resolve(import_node_path7.default.dirname((0, import_node_url.fileURLToPath)(import_meta.url)), "..");
|
|
50018
50022
|
}
|
|
50019
50023
|
function readCLIVersion() {
|
|
50020
|
-
if ("0.1.
|
|
50021
|
-
return "0.1.
|
|
50024
|
+
if ("0.1.67".length > 0) {
|
|
50025
|
+
return "0.1.67";
|
|
50022
50026
|
}
|
|
50023
50027
|
const devPackageJsonPath = import_node_path7.default.join(getDevPackageDir(), "package.json");
|
|
50024
50028
|
if (!(0, import_node_fs4.existsSync)(devPackageJsonPath)) {
|
|
@@ -50079,6 +50083,18 @@ function resolveBundledViewsPath() {
|
|
|
50079
50083
|
const devViewsPath = import_node_path7.default.join(getDevPackageDir(), "dist/views");
|
|
50080
50084
|
return (0, import_node_fs4.existsSync)(devViewsPath) ? devViewsPath : void 0;
|
|
50081
50085
|
}
|
|
50086
|
+
function resolveCanonicalDir() {
|
|
50087
|
+
if (process.argv[1]) {
|
|
50088
|
+
const entryDir = import_node_path7.default.dirname((0, import_node_fs4.realpathSync)(process.argv[1]));
|
|
50089
|
+
const resolved = import_node_path7.default.resolve(entryDir, "./canonical/v1");
|
|
50090
|
+
return (0, import_node_fs4.existsSync)(resolved) ? resolved : void 0;
|
|
50091
|
+
}
|
|
50092
|
+
const devCanonicalPath = import_node_path7.default.resolve(
|
|
50093
|
+
getDevPackageDir(),
|
|
50094
|
+
"../server/dist/canonical/v1"
|
|
50095
|
+
);
|
|
50096
|
+
return (0, import_node_fs4.existsSync)(devCanonicalPath) ? devCanonicalPath : void 0;
|
|
50097
|
+
}
|
|
50082
50098
|
function isTopLevelHelpInvocation(argv) {
|
|
50083
50099
|
if (argv.length === 0) return true;
|
|
50084
50100
|
if (argv.length !== 1) return false;
|
|
@@ -50216,6 +50232,7 @@ function createEnvironment(environment) {
|
|
|
50216
50232
|
host: options.host,
|
|
50217
50233
|
port: options.port,
|
|
50218
50234
|
staticDir: options.staticDir,
|
|
50235
|
+
canonicalDir: options.canonicalDir,
|
|
50219
50236
|
public: options.public
|
|
50220
50237
|
})),
|
|
50221
50238
|
createDaemon: environment.createDaemon ?? ((options = {}) => {
|
|
@@ -50232,6 +50249,7 @@ function createEnvironment(environment) {
|
|
|
50232
50249
|
});
|
|
50233
50250
|
}),
|
|
50234
50251
|
resolveStaticDir: environment.resolveStaticDir ?? (() => resolveStaticDir()),
|
|
50252
|
+
resolveCanonicalDir: environment.resolveCanonicalDir ?? (() => resolveCanonicalDir()),
|
|
50235
50253
|
resolveBundledViewsPath: environment.resolveBundledViewsPath ?? (() => resolveBundledViewsPath()),
|
|
50236
50254
|
onSignal: environment.onSignal ?? ((signal, handler) => process.on(signal, handler))
|
|
50237
50255
|
};
|
|
@@ -50275,6 +50293,7 @@ function createProgram(env, argv = []) {
|
|
|
50275
50293
|
port: opts.port,
|
|
50276
50294
|
storagePath: opts.storagePath,
|
|
50277
50295
|
staticDir: env.resolveStaticDir(),
|
|
50296
|
+
canonicalDir: env.resolveCanonicalDir(),
|
|
50278
50297
|
bundledViewsPath: env.resolveBundledViewsPath(),
|
|
50279
50298
|
public: opts.public
|
|
50280
50299
|
});
|
|
@@ -50540,6 +50559,7 @@ if (!isVitestRuntime()) {
|
|
|
50540
50559
|
0 && (module.exports = {
|
|
50541
50560
|
listVisibleCLICommandNames,
|
|
50542
50561
|
resolveBundledViewsPath,
|
|
50562
|
+
resolveCanonicalDir,
|
|
50543
50563
|
resolveStaticDir,
|
|
50544
50564
|
runCLI
|
|
50545
50565
|
});
|