@yadsh/dsh-l10n-overrides 0.1.0 → 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/LICENSE +21 -21
- package/README.md +6 -6
- package/ROADMAP.md +35 -35
- package/compatibility.json +13 -0
- package/lib/client.js +15 -11
- package/lib/index.js +10 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/types/runtime/protected-surfaces.d.ts +8 -0
- package/lib/types/runtime/scope-selector.d.ts +4 -0
- package/package.json +98 -95
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 xarleyn
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 xarleyn
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -10,21 +10,21 @@ Runtime localization overrides for [DeepSeek Harness](https://github.com/deepsee
|
|
|
10
10
|
|
|
11
11
|
`dsh-l10n-overrides` overlays missing or incorrect locale entries without replacing the host locale service. Translation packs can also provide narrowly scoped DOM fallbacks for text and selected accessibility attributes.
|
|
12
12
|
|
|
13
|
-
[Specification](
|
|
13
|
+
[Specification](SPEC.md) · [Roadmap](ROADMAP.md)
|
|
14
14
|
|
|
15
15
|
## Installation
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Install it by package name:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
21
|
-
dsh plugin --profile web add ./plugins/dsh-l10n-overrides
|
|
20
|
+
dsh plugin --profile web add @yadsh/dsh-l10n-overrides
|
|
22
21
|
```
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
To build and install from a local monorepo checkout instead:
|
|
25
24
|
|
|
26
25
|
```bash
|
|
27
|
-
|
|
26
|
+
pnpm --filter @yadsh/dsh-l10n-overrides build
|
|
27
|
+
dsh plugin --profile web add ./plugins/dsh-l10n-overrides
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
To remove the plugin:
|
package/ROADMAP.md
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
# Roadmap
|
|
2
|
-
|
|
3
|
-
## Implemented foundation
|
|
4
|
-
|
|
5
|
-
- Translation pack contracts, validation, diagnostics, precedence, and lookup.
|
|
6
|
-
- Safe interpolation for named and positional placeholders.
|
|
7
|
-
- Reversible locale-runtime hook with shared-installation lifecycle handling.
|
|
8
|
-
- Scoped, exact-match DOM translation with mutation observation and restoration.
|
|
9
|
-
- DSH client composition and module-loader bundle generation.
|
|
10
|
-
- Unit, integration, build, and package smoke checks.
|
|
11
|
-
|
|
12
|
-
## Required before the first public release
|
|
13
|
-
|
|
14
|
-
- Run an end-to-end smoke test inside a real DSH browser session, including
|
|
15
|
-
plugin reload and disposal.
|
|
16
|
-
- Harden duplicate installation under real Cordis fibers: keep locale listeners
|
|
17
|
-
owned per fiber, DOM translators per document, and prevent a partially drained
|
|
18
|
-
installation from being leased again.
|
|
19
|
-
- Replace the example pack with reviewed translations for actual target plugins
|
|
20
|
-
and record their supported version ranges.
|
|
21
|
-
- Verify the packed npm tarball contents and imports from a clean consumer
|
|
22
|
-
project, not only from the repository build output.
|
|
23
|
-
- Confirm compatibility against the supported DSH and locale-plugin versions.
|
|
24
|
-
- Document installation and enablement once the real DSH loading path is
|
|
25
|
-
verified.
|
|
26
|
-
|
|
27
|
-
## Follow-up work
|
|
28
|
-
|
|
29
|
-
- Add optional settings and debug diagnostics UI.
|
|
30
|
-
- Support external or user-authored pack loading after defining a trust model.
|
|
31
|
-
- Add more target locales without changing the English-first core semantics.
|
|
32
|
-
- Split the DOM translation engine into smaller parsing, matching, and ownership
|
|
33
|
-
modules as its rule surface grows.
|
|
34
|
-
- Evaluate broader selector and SVG attribute support only with explicit tests;
|
|
35
|
-
the current HTML-oriented scope and attribute rules remain intentional.
|
|
1
|
+
# Roadmap
|
|
2
|
+
|
|
3
|
+
## Implemented foundation
|
|
4
|
+
|
|
5
|
+
- Translation pack contracts, validation, diagnostics, precedence, and lookup.
|
|
6
|
+
- Safe interpolation for named and positional placeholders.
|
|
7
|
+
- Reversible locale-runtime hook with shared-installation lifecycle handling.
|
|
8
|
+
- Scoped, exact-match DOM translation with mutation observation and restoration.
|
|
9
|
+
- DSH client composition and module-loader bundle generation.
|
|
10
|
+
- Unit, integration, build, and package smoke checks.
|
|
11
|
+
|
|
12
|
+
## Required before the first public release
|
|
13
|
+
|
|
14
|
+
- Run an end-to-end smoke test inside a real DSH browser session, including
|
|
15
|
+
plugin reload and disposal.
|
|
16
|
+
- Harden duplicate installation under real Cordis fibers: keep locale listeners
|
|
17
|
+
owned per fiber, DOM translators per document, and prevent a partially drained
|
|
18
|
+
installation from being leased again.
|
|
19
|
+
- Replace the example pack with reviewed translations for actual target plugins
|
|
20
|
+
and record their supported version ranges.
|
|
21
|
+
- Verify the packed npm tarball contents and imports from a clean consumer
|
|
22
|
+
project, not only from the repository build output.
|
|
23
|
+
- Confirm compatibility against the supported DSH and locale-plugin versions.
|
|
24
|
+
- Document installation and enablement once the real DSH loading path is
|
|
25
|
+
verified.
|
|
26
|
+
|
|
27
|
+
## Follow-up work
|
|
28
|
+
|
|
29
|
+
- Add optional settings and debug diagnostics UI.
|
|
30
|
+
- Support external or user-authored pack loading after defining a trust model.
|
|
31
|
+
- Add more target locales without changing the English-first core semantics.
|
|
32
|
+
- Split the DOM translation engine into smaller parsing, matching, and ownership
|
|
33
|
+
modules as its rule surface grows.
|
|
34
|
+
- Evaluate broader selector and SVG attribute support only with explicit tests;
|
|
35
|
+
the current HTML-oriented scope and attribute rules remain intentional.
|
package/lib/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
window.__ModuleLoader__.load({
|
|
2
|
-
id: "dsh-l10n-overrides",
|
|
2
|
+
id: "@yadsh/dsh-l10n-overrides",
|
|
3
3
|
factory: (require) => {
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
@@ -372,16 +372,7 @@ window.__ModuleLoader__.load({
|
|
|
372
372
|
}
|
|
373
373
|
};
|
|
374
374
|
//#endregion
|
|
375
|
-
//#region src/runtime/
|
|
376
|
-
const DOM_TRANSLATION_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
377
|
-
"placeholder",
|
|
378
|
-
"title",
|
|
379
|
-
"aria-label",
|
|
380
|
-
"alt"
|
|
381
|
-
]);
|
|
382
|
-
const ELEMENT_NODE = 1;
|
|
383
|
-
const TEXT_NODE = 3;
|
|
384
|
-
const SHOW_ELEMENT_AND_TEXT = 5;
|
|
375
|
+
//#region src/runtime/protected-surfaces.ts
|
|
385
376
|
const KNOWN_PROTECTION_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
386
377
|
"class",
|
|
387
378
|
"contenteditable",
|
|
@@ -429,6 +420,8 @@ window.__ModuleLoader__.load({
|
|
|
429
420
|
...SHARED_PROTECTED_SURFACES
|
|
430
421
|
].join(",");
|
|
431
422
|
const ATTRIBUTE_PROTECTED_SURFACE_SELECTOR = [...CODE_LIKE_PROTECTED_SURFACES, ...SHARED_PROTECTED_SURFACES].join(",");
|
|
423
|
+
//#endregion
|
|
424
|
+
//#region src/runtime/scope-selector.ts
|
|
432
425
|
function isScopeIdentifierStart(character) {
|
|
433
426
|
return character !== void 0 && /[A-Z_a-z\u0080-\uFFFF]/.test(character);
|
|
434
427
|
}
|
|
@@ -521,6 +514,17 @@ window.__ModuleLoader__.load({
|
|
|
521
514
|
}
|
|
522
515
|
return components > 0 ? { dependencies } : void 0;
|
|
523
516
|
}
|
|
517
|
+
//#endregion
|
|
518
|
+
//#region src/runtime/dom-translator.ts
|
|
519
|
+
const DOM_TRANSLATION_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
520
|
+
"placeholder",
|
|
521
|
+
"title",
|
|
522
|
+
"aria-label",
|
|
523
|
+
"alt"
|
|
524
|
+
]);
|
|
525
|
+
const ELEMENT_NODE = 1;
|
|
526
|
+
const TEXT_NODE = 3;
|
|
527
|
+
const SHOW_ELEMENT_AND_TEXT = 5;
|
|
524
528
|
var DomTranslator = class {
|
|
525
529
|
document;
|
|
526
530
|
diagnostics;
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
import { createHostLoggerSink, getPluginLogger } from "@yadsh/dsh-plugin-log";
|
|
1
2
|
//#region src/index.ts
|
|
2
|
-
|
|
3
|
+
/** Host lifecycle companion; translation diagnostics remain browser-local. */
|
|
4
|
+
function apply(ctx) {
|
|
5
|
+
const logger = getPluginLogger({
|
|
6
|
+
pluginId: "dsh-l10n-overrides",
|
|
7
|
+
consoleSink: createHostLoggerSink(ctx.logger)
|
|
8
|
+
});
|
|
9
|
+
logger.info("plugin.ready");
|
|
10
|
+
return async () => logger.close();
|
|
11
|
+
}
|
|
3
12
|
//#endregion
|
|
4
13
|
export { apply };
|
package/lib/types/index.d.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const KNOWN_PROTECTION_ATTRIBUTES: Set<string>;
|
|
2
|
+
export declare const CLASS_PROTECTION_PATTERN: RegExp;
|
|
3
|
+
export declare const TEST_ID_PROTECTION_PATTERN: RegExp;
|
|
4
|
+
export declare const SCOPE_AND_PROTECTION_ATTRIBUTES: string[];
|
|
5
|
+
export declare const SHARED_PROTECTED_SURFACES: string[];
|
|
6
|
+
export declare const CODE_LIKE_PROTECTED_SURFACES: string[];
|
|
7
|
+
export declare const TEXT_PROTECTED_SURFACE_SELECTOR: string;
|
|
8
|
+
export declare const ATTRIBUTE_PROTECTED_SURFACE_SELECTOR: string;
|
package/package.json
CHANGED
|
@@ -1,95 +1,98 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@yadsh/dsh-l10n-overrides",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "English localization overrides for DeepSeek Harness plugins",
|
|
5
|
-
"repository": {
|
|
6
|
-
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/xarleyn/dsh-plugins.git",
|
|
8
|
-
"directory": "plugins/dsh-l10n-overrides"
|
|
9
|
-
},
|
|
10
|
-
"homepage": "https://github.com/xarleyn/dsh-plugins/tree/main/plugins/dsh-l10n-overrides#readme",
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/xarleyn/dsh-plugins/issues"
|
|
13
|
-
},
|
|
14
|
-
"type": "module",
|
|
15
|
-
"main": "./lib/index.js",
|
|
16
|
-
"types": "./lib/types/index.d.ts",
|
|
17
|
-
"exports": {
|
|
18
|
-
".": {
|
|
19
|
-
"types": "./lib/types/index.d.ts",
|
|
20
|
-
"default": "./lib/index.js"
|
|
21
|
-
},
|
|
22
|
-
"./client": {
|
|
23
|
-
"types": "./lib/types/client/index.d.ts",
|
|
24
|
-
"default": "./lib/client.js"
|
|
25
|
-
},
|
|
26
|
-
"./types": {
|
|
27
|
-
"types": "./lib/types/types.d.ts"
|
|
28
|
-
},
|
|
29
|
-
"./package.json": "./package.json"
|
|
30
|
-
},
|
|
31
|
-
"dsh": {
|
|
32
|
-
"bundle": {
|
|
33
|
-
"patch": "./cordis.patch.yml"
|
|
34
|
-
},
|
|
35
|
-
"client": {
|
|
36
|
-
"platform": "web",
|
|
37
|
-
"inject": [
|
|
38
|
-
"@deepseek-ai/dsh-client-locale"
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"files": [
|
|
43
|
-
"lib/**/*.js",
|
|
44
|
-
"lib/types/**/*.d.ts",
|
|
45
|
-
"cordis.patch.yml",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
"deepseek"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"dsh-plugin"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@yadsh/dsh-l10n-overrides",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "English localization overrides for DeepSeek Harness plugins",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/xarleyn/dsh-plugins.git",
|
|
8
|
+
"directory": "plugins/dsh-l10n-overrides"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/xarleyn/dsh-plugins/tree/main/plugins/dsh-l10n-overrides#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/xarleyn/dsh-plugins/issues"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "./lib/index.js",
|
|
16
|
+
"types": "./lib/types/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./lib/types/index.d.ts",
|
|
20
|
+
"default": "./lib/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./client": {
|
|
23
|
+
"types": "./lib/types/client/index.d.ts",
|
|
24
|
+
"default": "./lib/client.js"
|
|
25
|
+
},
|
|
26
|
+
"./types": {
|
|
27
|
+
"types": "./lib/types/types.d.ts"
|
|
28
|
+
},
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"dsh": {
|
|
32
|
+
"bundle": {
|
|
33
|
+
"patch": "./cordis.patch.yml"
|
|
34
|
+
},
|
|
35
|
+
"client": {
|
|
36
|
+
"platform": "web",
|
|
37
|
+
"inject": [
|
|
38
|
+
"@deepseek-ai/dsh-client-locale"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"files": [
|
|
43
|
+
"lib/**/*.js",
|
|
44
|
+
"lib/types/**/*.d.ts",
|
|
45
|
+
"cordis.patch.yml",
|
|
46
|
+
"compatibility.json",
|
|
47
|
+
"README.md",
|
|
48
|
+
"ROADMAP.md",
|
|
49
|
+
"LICENSE"
|
|
50
|
+
],
|
|
51
|
+
"keywords": [
|
|
52
|
+
"deepseek",
|
|
53
|
+
"deepseek-harness",
|
|
54
|
+
"dsh",
|
|
55
|
+
"dsh-plugin",
|
|
56
|
+
"localization",
|
|
57
|
+
"web-ui"
|
|
58
|
+
],
|
|
59
|
+
"license": "MIT",
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
62
|
+
},
|
|
63
|
+
"peerDependencies": {
|
|
64
|
+
"@deepseek-ai/cordis": "^4.0.1",
|
|
65
|
+
"@deepseek-ai/dsh-client-locale": ">=0.1.1-rc.2 <0.2.0"
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@yadsh/dsh-plugin-log": "^0.2.1"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"@deepseek-ai/cordis": "4.0.1",
|
|
72
|
+
"@deepseek-ai/dsh-client-locale": "0.1.1-rc.2",
|
|
73
|
+
"@types/node": "^26.4.0",
|
|
74
|
+
"eslint": "10.9.1",
|
|
75
|
+
"jsdom": "^26.1.0",
|
|
76
|
+
"prettier": "^3.6.2",
|
|
77
|
+
"tsdown": "^0.22.14",
|
|
78
|
+
"typescript": "^7.0.2",
|
|
79
|
+
"vitest": "^4.1.11",
|
|
80
|
+
"@yadsh/dsh-config": "^0.0.0"
|
|
81
|
+
},
|
|
82
|
+
"publishConfig": {
|
|
83
|
+
"access": "public",
|
|
84
|
+
"registry": "https://registry.npmjs.org/"
|
|
85
|
+
},
|
|
86
|
+
"scripts": {
|
|
87
|
+
"clean": "node -e \"require('node:fs').rmSync('lib', { recursive: true, force: true })\"",
|
|
88
|
+
"lint": "eslint src tests scripts",
|
|
89
|
+
"format": "prettier --check . --end-of-line auto",
|
|
90
|
+
"format:write": "prettier --write . --end-of-line auto",
|
|
91
|
+
"typecheck": "tsc --noEmit",
|
|
92
|
+
"test": "vitest run",
|
|
93
|
+
"build": "pnpm run clean && tsdown && tsc -p tsconfig.build.json",
|
|
94
|
+
"test:package": "node scripts/verify-package.mjs && node scripts/verify-client-bundle.mjs",
|
|
95
|
+
"verify": "pnpm run test:package",
|
|
96
|
+
"check": "pnpm run format && pnpm run typecheck && pnpm run test && pnpm run build && pnpm run test:package"
|
|
97
|
+
}
|
|
98
|
+
}
|