This is an automated email from the ASF dual-hosted git repository.

aglinxinyuan pushed a commit to branch xinyuan-fix-license
in repository https://gitbox.apache.org/repos/asf/texera.git


The following commit(s) were added to refs/heads/xinyuan-fix-license by this 
push:
     new 28a1a30336 update
28a1a30336 is described below

commit 28a1a30336e4325ebf9d0dd0e3d59e77257f0196
Author: Xinyuan Lin <[email protected]>
AuthorDate: Wed Apr 22 20:27:56 2026 -0700

    update
---
 frontend/tools/jschardet-stub/README.md    | 53 ------------------------------
 frontend/tools/jschardet-stub/index.d.ts   | 27 ---------------
 frontend/tools/jschardet-stub/index.js     | 35 +++++---------------
 frontend/tools/jschardet-stub/package.json |  5 ++-
 4 files changed, 10 insertions(+), 110 deletions(-)

diff --git a/frontend/tools/jschardet-stub/README.md 
b/frontend/tools/jschardet-stub/README.md
deleted file mode 100644
index a3b3985610..0000000000
--- a/frontend/tools/jschardet-stub/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
--->
-
-# jschardet-stub
-
-Apache-2.0 no-op replacement for the `jschardet` npm package.
-
-## Why this exists
-
-The upstream [`jschardet`](https://www.npmjs.com/package/jschardet)
-package is LGPL-2.1, which is
-[ASF Category X](https://www.apache.org/legal/resolved.html#category-x)
-and cannot ship in an Apache binary distribution.
-
-`jschardet` is declared as a direct dependency of
-`@codingame/[email protected]`. Inside that package it is
-referenced only from
-`vscode/src/vs/workbench/services/textfile/common/encoding.js`, inside
-`guessEncodingByBuffer()`, which is loaded lazily via a dynamic
-`await import('jschardet')`. Texera does not open arbitrary binary
-files through Monaco — the editor is wired up as a Yjs-backed code
-editor — so the encoding-guessing path is never exercised.
-
-## How it is wired in
-
-`frontend/package.json` has a `resolutions` entry that redirects the
-`jschardet` module name to this directory:
-
-```json
-"resolutions": {
-  "jschardet": "portal:./tools/jschardet-stub"
-}
-```
-
-Yarn then installs this stub in place of the real package. The stub
-exports the same named functions (`detect`, `detectAll`, `enableDebug`)
-and the same default shape, so the dynamic import and any defensive
-caller keep working; `detect()` simply returns `null`, which the VS
-Code encoding helper already treats as "no guess available".
-
-## Scope
-
-Do not use this package for anything else. It intentionally reports
-that it cannot detect any charset.
diff --git a/frontend/tools/jschardet-stub/index.d.ts 
b/frontend/tools/jschardet-stub/index.d.ts
deleted file mode 100644
index 7532c520ce..0000000000
--- a/frontend/tools/jschardet-stub/index.d.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- */
-
-export interface IDetectedMap {
-  encoding: string;
-  confidence: number;
-}
-
-export interface IOptionsMap {
-  minimumThreshold?: number;
-  detectEncodings?: Array<string>;
-}
-
-export declare function detect(buffer: Buffer | string, options?: 
IOptionsMap): IDetectedMap | null;
-
-export declare function detectAll(buffer: Buffer | string, options?: 
IOptionsMap): IDetectedMap[];
-
-export declare function enableDebug(): void;
diff --git a/frontend/tools/jschardet-stub/index.js 
b/frontend/tools/jschardet-stub/index.js
index 1ea022e2e1..0af1982368 100644
--- a/frontend/tools/jschardet-stub/index.js
+++ b/frontend/tools/jschardet-stub/index.js
@@ -17,32 +17,13 @@
  * under the License.
  */
 
-// No-op replacement for the jschardet npm package.
-//
-// The upstream `jschardet` package (LGPL-2.1) is declared as a direct
-// dependency of `@codingame/monaco-vscode-api` and is pulled in via a
-// dynamic `await import('jschardet')` inside the VS Code textfile
-// encoding-guessing service. Texera does not use that code path --
-// Monaco is only used as a Yjs-backed code editor and never opens
-// arbitrary binary files that require charset detection.
-//
-// To keep the LGPL code out of the Apache binary distribution we
-// redirect the `jschardet` module name to this stub via Yarn's
-// `resolutions`. The stub preserves the public API surface so the
-// dynamic import resolves successfully and any defensive caller
-// receives a safe "no guess" answer.
+// No-op replacement for the LGPL-2.1 `jschardet` package, which is
+// ASF Category X. Redirected here via `resolutions` in
+// frontend/package.json. The upstream call site lives in
+// @codingame/monaco-vscode-api's encoding service and is only reached
+// when opening binary files through Monaco, which Texera never does.
 
-function detect() {
-  return null;
-}
-
-function detectAll() {
-  return [];
-}
-
-function enableDebug() {
-  // no-op
-}
-
-module.exports = { detect: detect, detectAll: detectAll, enableDebug: 
enableDebug };
+module.exports = {
+  detect: () => null,
+};
 module.exports.default = module.exports;
diff --git a/frontend/tools/jschardet-stub/package.json 
b/frontend/tools/jschardet-stub/package.json
index 944a82a60d..aa69357138 100644
--- a/frontend/tools/jschardet-stub/package.json
+++ b/frontend/tools/jschardet-stub/package.json
@@ -1,8 +1,7 @@
 {
   "name": "jschardet",
   "version": "3.1.3",
-  "description": "No-op stub replacing upstream jschardet (LGPL-2.1, ASF 
Category X). See frontend/tools/jschardet-stub/README.md.",
+  "description": "Apache-2.0 no-op stub replacing upstream jschardet 
(LGPL-2.1, ASF Category X).",
   "license": "Apache-2.0",
-  "main": "index.js",
-  "types": "index.d.ts"
+  "main": "index.js"
 }

Reply via email to