refactor: 包名改为 @wishesl/dsh-lan-access
与 GitHub 仓库归属 wishedl 对齐(原 @sutong 不是发布身份,npm 发布会 403)。 同时把包名改为单一来源:scripts/build-client.mjs 与 scripts/test-client.mjs 都从 package.json 读取,避免产物 id 与清单漂移。LICENSE 版权主体同步为 wishesl。 顺带修正 src/panel.js 里「Plugins 内页」的过时注释(面板早已是 Settings 顶层入口)。
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2026 sutong
|
Copyright (c) 2026 wishesl
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# @sutong/dsh-lan-access
|
# @wishesl/dsh-lan-access
|
||||||
|
|
||||||
Publish the dsh Web UI on your local network with a **standalone reverse proxy**: it listens on `0.0.0.0:<port>`, forwards HTTP and WebSocket to the loopback web server, and **keeps the official launch-token login**.
|
Publish the dsh Web UI on your local network with a **standalone reverse proxy**: it listens on `0.0.0.0:<port>`, forwards HTTP and WebSocket to the loopback web server, and **keeps the official launch-token login**.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# @sutong/dsh-lan-access
|
# @wishesl/dsh-lan-access
|
||||||
|
|
||||||
局域网访问 dsh Web UI:一个**独立反向代理**,在 `0.0.0.0:<port>` 监听,把 HTTP 与 WebSocket 转发到回环 web 服务器,并**保留官方 launch token 登录**。
|
局域网访问 dsh Web UI:一个**独立反向代理**,在 `0.0.0.0:<port>` 监听,把 HTTP 与 WebSocket 转发到回环 web 服务器,并**保留官方 launch token 登录**。
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* @sutong/dsh-lan-access — browser half (generated by scripts/build-client.mjs).
|
* @wishesl/dsh-lan-access — browser half (generated by scripts/build-client.mjs).
|
||||||
*
|
*
|
||||||
* Do not edit this file: change src/panel.js or src/qrcode.js and rebuild.
|
* Do not edit this file: change src/panel.js or src/qrcode.js and rebuild.
|
||||||
*/
|
*/
|
||||||
window.__ModuleLoader__.load({
|
window.__ModuleLoader__.load({
|
||||||
id: "@sutong/dsh-lan-access",
|
id: "@wishesl/dsh-lan-access",
|
||||||
factory: function (require) {
|
factory: function (require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var React = require("react");
|
var React = require("react");
|
||||||
@@ -23,7 +23,7 @@ window.__ModuleLoader__.load({
|
|||||||
* Verified against the reference `qrcode` npm package: `node scripts/test-qr.mjs`
|
* Verified against the reference `qrcode` npm package: `node scripts/test-qr.mjs`
|
||||||
* compares every module of every version and mask.
|
* compares every module of every version and mask.
|
||||||
*
|
*
|
||||||
* @module @sutong/dsh-lan-access/qrcode
|
* @module @wishesl/dsh-lan-access/qrcode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** Error-correction level indicator bits (`M` = 0b00) and the format-info prefix. */
|
/** Error-correction level indicator bits (`M` = 0b00) and the format-info prefix. */
|
||||||
@@ -510,14 +510,14 @@ window.__ModuleLoader__.load({
|
|||||||
|
|
||||||
// ── inlined src/panel.js ─────────────────────────────────────────────────
|
// ── inlined src/panel.js ─────────────────────────────────────────────────
|
||||||
/**
|
/**
|
||||||
* Client half of @sutong/dsh-lan-access: a Plugins-settings tab that shows the
|
* Client half of @wishesl/dsh-lan-access: its own Settings page showing the LAN
|
||||||
* LAN addresses the host listener publishes, with a scannable QR code for the
|
* addresses the host listener publishes, with a scannable QR code for the
|
||||||
* address you pick.
|
* address you pick.
|
||||||
*
|
*
|
||||||
* This file is bundled into the single browser artifact `client.js` by
|
* This file is bundled into the single browser artifact `client.js` by
|
||||||
* `scripts/build-client.mjs`; it is never loaded directly by the browser.
|
* `scripts/build-client.mjs`; it is never loaded directly by the browser.
|
||||||
*
|
*
|
||||||
* @module @sutong/dsh-lan-access/panel
|
* @module @wishesl/dsh-lan-access/panel
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
# @sutong/dsh-lan-access — bundle patch.
|
# @wishesl/dsh-lan-access — bundle patch.
|
||||||
#
|
#
|
||||||
# The LAN listener itself overrides no shipped row: it is a separate socket that
|
# The LAN listener itself overrides no shipped row: it is a separate socket that
|
||||||
# forwards to the loopback web server, so the official webserver bind, the
|
# forwards to the loopback web server, so the official webserver bind, the
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
# An ordinary Cordis plugin activated by package name.
|
# An ordinary Cordis plugin activated by package name.
|
||||||
- insert:
|
- insert:
|
||||||
- id: dsh-lan-access
|
- id: dsh-lan-access
|
||||||
name: '@sutong/dsh-lan-access'
|
name: '@wishesl/dsh-lan-access'
|
||||||
config:
|
config:
|
||||||
# The official client derives its `isLoopback` topology fact from
|
# The official client derives its `isLoopback` topology fact from
|
||||||
# `location.hostname`, and the durable settings surface is loopback-only
|
# `location.hostname`, and the durable settings surface is loopback-only
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @sutong/dsh-lan-access — host half.
|
* @wishesl/dsh-lan-access — host half.
|
||||||
*
|
*
|
||||||
* Publishes the loopback dsh Web UI on the LAN through a standalone reverse
|
* Publishes the loopback dsh Web UI on the LAN through a standalone reverse
|
||||||
* proxy. `dsh web --host 0.0.0.0` is refused by the shipped CLI on purpose
|
* proxy. `dsh web --host 0.0.0.0` is refused by the shipped CLI on purpose
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
* it. The official browser-trust fence and the launch-token login stay in
|
* it. The official browser-trust fence and the launch-token login stay in
|
||||||
* force; nothing about the composed application is overridden.
|
* force; nothing about the composed application is overridden.
|
||||||
*
|
*
|
||||||
* @module @sutong/dsh-lan-access
|
* @module @wishesl/dsh-lan-access
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { createServer, request as httpRequest } from 'node:http'
|
import { createServer, request as httpRequest } from 'node:http'
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@sutong/dsh-lan-access",
|
"name": "@wishesl/dsh-lan-access",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"description": "Expose the dsh Web UI on the LAN through a standalone reverse proxy that preserves the official launch token — HTTP and WebSocket forwarding, no Host rewrite of your trust boundary.",
|
"description": "Expose the dsh Web UI on the LAN through a standalone reverse proxy that preserves the official launch token — HTTP and WebSocket forwarding, no Host rewrite of your trust boundary.",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -17,6 +17,9 @@ import { fileURLToPath } from 'node:url'
|
|||||||
const here = dirname(fileURLToPath(import.meta.url))
|
const here = dirname(fileURLToPath(import.meta.url))
|
||||||
const root = join(here, '..')
|
const root = join(here, '..')
|
||||||
|
|
||||||
|
/** The browser module id must equal the package name; read it, never restate it. */
|
||||||
|
const packageName = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')).name
|
||||||
|
|
||||||
/** Read a source file and turn its ESM exports into plain declarations. */
|
/** Read a source file and turn its ESM exports into plain declarations. */
|
||||||
function inline(relativePath) {
|
function inline(relativePath) {
|
||||||
const source = readFileSync(join(root, relativePath), 'utf8')
|
const source = readFileSync(join(root, relativePath), 'utf8')
|
||||||
@@ -30,12 +33,12 @@ const qrcode = inline('src/qrcode.js')
|
|||||||
const panel = inline('src/panel.js')
|
const panel = inline('src/panel.js')
|
||||||
|
|
||||||
const artifact = `/**
|
const artifact = `/**
|
||||||
* @sutong/dsh-lan-access — browser half (generated by scripts/build-client.mjs).
|
* ${packageName} — browser half (generated by scripts/build-client.mjs).
|
||||||
*
|
*
|
||||||
* Do not edit this file: change src/panel.js or src/qrcode.js and rebuild.
|
* Do not edit this file: change src/panel.js or src/qrcode.js and rebuild.
|
||||||
*/
|
*/
|
||||||
window.__ModuleLoader__.load({
|
window.__ModuleLoader__.load({
|
||||||
id: "@sutong/dsh-lan-access",
|
id: ${JSON.stringify(packageName)},
|
||||||
factory: function (require) {
|
factory: function (require) {
|
||||||
"use strict";
|
"use strict";
|
||||||
var React = require("react");
|
var React = require("react");
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import { SUMMARY_PATH } from '../index.js'
|
|||||||
|
|
||||||
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
|
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
|
||||||
const source = readFileSync(join(root, 'client.js'), 'utf8')
|
const source = readFileSync(join(root, 'client.js'), 'utf8')
|
||||||
|
const packageName = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8')).name
|
||||||
|
|
||||||
const results = []
|
const results = []
|
||||||
function check(label, condition, detail) {
|
function check(label, condition, detail) {
|
||||||
@@ -37,7 +38,7 @@ vm.createContext(sandbox)
|
|||||||
vm.runInContext(source, sandbox)
|
vm.runInContext(source, sandbox)
|
||||||
|
|
||||||
check('artifact registers exactly once', captured !== undefined)
|
check('artifact registers exactly once', captured !== undefined)
|
||||||
check('module id equals the package name', captured?.id === '@sutong/dsh-lan-access', captured?.id)
|
check('module id equals the package name', captured?.id === packageName, captured?.id)
|
||||||
check('factory is a function', typeof captured?.factory === 'function')
|
check('factory is a function', typeof captured?.factory === 'function')
|
||||||
|
|
||||||
// ── stub React ──────────────────────────────────────────────────────────────
|
// ── stub React ──────────────────────────────────────────────────────────────
|
||||||
|
|||||||
+3
-3
@@ -1,12 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Client half of @sutong/dsh-lan-access: a Plugins-settings tab that shows the
|
* Client half of @wishesl/dsh-lan-access: its own Settings page showing the LAN
|
||||||
* LAN addresses the host listener publishes, with a scannable QR code for the
|
* addresses the host listener publishes, with a scannable QR code for the
|
||||||
* address you pick.
|
* address you pick.
|
||||||
*
|
*
|
||||||
* This file is bundled into the single browser artifact `client.js` by
|
* This file is bundled into the single browser artifact `client.js` by
|
||||||
* `scripts/build-client.mjs`; it is never loaded directly by the browser.
|
* `scripts/build-client.mjs`; it is never loaded directly by the browser.
|
||||||
*
|
*
|
||||||
* @module @sutong/dsh-lan-access/panel
|
* @module @wishesl/dsh-lan-access/panel
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { encodeQR } from './qrcode.js'
|
import { encodeQR } from './qrcode.js'
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
* Verified against the reference `qrcode` npm package: `node scripts/test-qr.mjs`
|
* Verified against the reference `qrcode` npm package: `node scripts/test-qr.mjs`
|
||||||
* compares every module of every version and mask.
|
* compares every module of every version and mask.
|
||||||
*
|
*
|
||||||
* @module @sutong/dsh-lan-access/qrcode
|
* @module @wishesl/dsh-lan-access/qrcode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** Error-correction level indicator bits (`M` = 0b00) and the format-info prefix. */
|
/** Error-correction level indicator bits (`M` = 0b00) and the format-info prefix. */
|
||||||
|
|||||||
Reference in New Issue
Block a user