@tsgolint-rust/wasm32-wasip1 0.0.0-stage → 0.0.1

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 ADDED
@@ -0,0 +1,23 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026-present tunnckoCore and tsgolint-rust contributors
4
+ Copyright (c) 2025 July-present VoidZero Inc. & Contributors
5
+ Copyright (c) 2025 July typescript-eslint and other contributors
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,14 @@
1
- # Temporary Holding Version
1
+ # @tsgolint-rust/wasm32-wasip1
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [tsgolint-rust](https://github.com/tunnckoCoreHQ/tsgolint-rust) built for `wasm32-wasip1`, with a `tsgolint` bin that runs it on Node's WASI. Use it where no native build of `tsgolint-rust` runs, or where native binaries are not allowed. It gives the same output as the native build, on one thread.
4
+
5
+ ```json
6
+ {
7
+ "devDependencies": {
8
+ "oxlint": "^1.86.0",
9
+ "oxlint-tsgolint": "npm:@tsgolint-rust/wasm32-wasip1@0.1.0"
10
+ }
11
+ }
12
+ ```
13
+
14
+ The bin preopens `/` and passes the working directory as `PWD`, because paths in oxlint's payload are host paths. It needs Node 20 or newer, on Linux or macOS.
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ // Runs the single-thread wasm32-wasip1 build of tsgolint on Node's WASI, as a
3
+ // drop-in for the native binary. Paths in the payload and the output are host
4
+ // paths, and realpath walks every parent directory from the root, so `/` is
5
+ // preopened at `/`. WASI has no current directory: the binary enters `PWD`,
6
+ // which is the physical working directory here. Arguments, stdio, the
7
+ // environment and the exit code pass through.
8
+ import { readFile } from 'node:fs/promises';
9
+ import process from 'node:process';
10
+
11
+ // node:wasi warns that it is experimental; oxlint shows tsgolint's stderr.
12
+ const emitWarning = process.emitWarning;
13
+ process.emitWarning = (warning, ...args) => {
14
+ const type = typeof args[0] === 'string' ? args[0] : args[0]?.type;
15
+ if (type === 'ExperimentalWarning' && String(warning).includes('WASI')) {
16
+ return;
17
+ }
18
+ emitWarning.call(process, warning, ...args);
19
+ };
20
+ const { WASI } = await import('node:wasi');
21
+
22
+ const wasi = new WASI({
23
+ version: 'preview1',
24
+ args: ['tsgolint', ...process.argv.slice(2)],
25
+ env: { ...process.env, PWD: process.cwd() },
26
+ preopens: { '/': '/' },
27
+ returnOnExit: true,
28
+ });
29
+ const module = await WebAssembly.compile(await readFile(new URL('../tsgolint.wasm', import.meta.url)));
30
+ const instance = await WebAssembly.instantiate(module, wasi.getImportObject());
31
+ process.exitCode = wasi.start(instance);
package/package.json CHANGED
@@ -1,6 +1,36 @@
1
1
  {
2
2
  "name": "@tsgolint-rust/wasm32-wasip1",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.0.1",
4
+ "description": "tsgolint-rust built for wasm32-wasip1, run on Node's WASI: the type-aware linter of oxlint where no native build runs. Install it as oxlint-tsgolint.",
5
+ "keywords": [
6
+ "oxlint",
7
+ "tsgolint",
8
+ "typescript",
9
+ "linter",
10
+ "wasm",
11
+ "wasi"
12
+ ],
13
+ "license": "MIT",
14
+ "author": "tunnckoCore",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/tunnckoCoreHQ/tsgolint-rust.git",
18
+ "directory": "npm/wasm32-wasip1"
19
+ },
20
+ "bugs": "https://github.com/tunnckoCoreHQ/tsgolint-rust/issues",
21
+ "homepage": "https://github.com/tunnckoCoreHQ/tsgolint-rust#readme",
22
+ "type": "module",
23
+ "bin": {
24
+ "tsgolint": "bin/tsgolint.js"
25
+ },
26
+ "files": [
27
+ "bin",
28
+ "tsgolint.wasm"
29
+ ],
30
+ "engines": {
31
+ "node": ">=20"
32
+ },
33
+ "publishConfig": {
34
+ "access": "public"
35
+ }
6
36
  }
package/tsgolint.wasm ADDED
@@ -0,0 +1 @@
1
+ x