@foliox/transparent-compact-pi 0.10.0 → 0.11.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.
@@ -0,0 +1,27 @@
1
+ Copyright 2009 The Go Authors.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions are
5
+ met:
6
+
7
+ * Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above
10
+ copyright notice, this list of conditions and the following disclaimer
11
+ in the documentation and/or other materials provided with the
12
+ distribution.
13
+ * Neither the name of Google LLC nor the names of its
14
+ contributors may be used to endorse or promote products derived from
15
+ this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,27 @@
1
+ Copyright (c) 2016, Daniel Martí. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions are
5
+ met:
6
+
7
+ * Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above
10
+ copyright notice, this list of conditions and the following disclaimer
11
+ in the documentation and/or other materials provided with the
12
+ distribution.
13
+ * Neither the name of the copyright holder nor the names of its
14
+ contributors may be used to endorse or promote products derived from
15
+ this software without specific prior written permission.
16
+
17
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,13 @@
1
+ # Bundled shell parser
2
+
3
+ `shell.wasm` compiles our `main.go` bridge with the official `mvdan.cc/sh/v3`
4
+ parser and `syntax/typedjson` encoder. `go.mod` pins the upstream release;
5
+ `go.sum` records its checksums. No interpreter is imported.
6
+
7
+ - mvdan/sh: BSD 3-Clause; see `LICENSE.mvdan-sh`.
8
+ - Go runtime and standard library: see `LICENSE.Go` and `PATENTS.Go`.
9
+ - `wasm_exec.js` is copied unmodified from the matching official Go toolchain.
10
+ - `build.json` records the upstream/toolchain versions and generated asset hashes.
11
+
12
+ The bridge and JavaScript loader are part of transparent-compact, under its MIT
13
+ license. The bundled assets require no Go installation or runtime downloads.
@@ -0,0 +1,22 @@
1
+ Additional IP Rights Grant (Patents)
2
+
3
+ "This implementation" means the copyrightable works distributed by
4
+ Google as part of the Go project.
5
+
6
+ Google hereby grants to You a perpetual, worldwide, non-exclusive,
7
+ no-charge, royalty-free, irrevocable (except as stated in this section)
8
+ patent license to make, have made, use, offer to sell, sell, import,
9
+ transfer and otherwise run, modify and propagate the contents of this
10
+ implementation of Go, where such license applies only to those patent
11
+ claims, both currently owned or controlled by Google and acquired in
12
+ the future, licensable by Google that are necessarily infringed by this
13
+ implementation of Go. This grant does not include claims that would be
14
+ infringed only as a consequence of further modification of this
15
+ implementation. If you or your agent or exclusive licensee institute or
16
+ order or agree to the institution of patent litigation against any
17
+ entity (including a cross-claim or counterclaim in a lawsuit) alleging
18
+ that this implementation of Go or any code incorporated within this
19
+ implementation of Go constitutes direct or contributory patent
20
+ infringement, or inducement of patent infringement, then any patent
21
+ rights granted to you under this License for this implementation of Go
22
+ shall terminate as of the date such litigation is filed.
@@ -0,0 +1,12 @@
1
+ {
2
+ "module": "mvdan.cc/sh/v3",
3
+ "version": "v3.14.1",
4
+ "go": "go1.27.3",
5
+ "wasmSha256": "5a3863987dcd484b76f7e30ba2e1b0e7ec44733de2b9020ced47fce1a805759a",
6
+ "runtimeSha256": "0c949f4996f9a89698e4b5c586de32249c3b69b7baadb64d220073cc04acba14",
7
+ "sourceSha256": {
8
+ "main.go": "9e3e81b5b887ebeed4a9ce892f1aacb074f25f1d3bc9e566cb6f5c3934c2c84c",
9
+ "go.mod": "6abdd17a1fbbd701de015c52d58142fb7baefeb3afae0eb95369f0a7d3062bdd",
10
+ "go.sum": "816811ceede3e018d293b5097e3cfea283ce6205309d387c21fce95846e2215b"
11
+ }
12
+ }
@@ -0,0 +1,5 @@
1
+ module github.com/felixwoolford/transparent-compact-pi/shellparser
2
+
3
+ go 1.27.3
4
+
5
+ require mvdan.cc/sh/v3 v3.14.1
@@ -0,0 +1,2 @@
1
+ mvdan.cc/sh/v3 v3.14.1 h1:bXkhQWNHCs0KZEChF8hYS6FC+T2N9mUZLbQv9blditI=
2
+ mvdan.cc/sh/v3 v3.14.1/go.mod h1:syYCoFET8w9tvevxiXUtY8/ICrU+l26jHmhJDra3Vwo=
@@ -0,0 +1,36 @@
1
+ // The bridge deliberately uses upstream's AST encoder, not a custom AST schema.
2
+ // No interpreter, command execution, filesystem access, or shell expansion.
3
+ package main
4
+
5
+ import (
6
+ "bytes"
7
+ "fmt"
8
+ "strings"
9
+ "syscall/js"
10
+
11
+ "mvdan.cc/sh/v3/syntax"
12
+ "mvdan.cc/sh/v3/syntax/typedjson"
13
+ )
14
+
15
+ func parse(_ js.Value, args []js.Value) (result any) {
16
+ // Keep an unexpected upstream panic from terminating the cached WASM runtime.
17
+ defer func() {
18
+ if err := recover(); err != nil {
19
+ result = map[string]any{"error": fmt.Sprint(err)}
20
+ }
21
+ }()
22
+ file, err := syntax.NewParser(syntax.Variant(syntax.LangBash)).Parse(strings.NewReader(args[0].String()), "")
23
+ if err != nil {
24
+ return map[string]any{"error": err.Error()}
25
+ }
26
+ var out bytes.Buffer
27
+ if err := typedjson.Encode(&out, file); err != nil {
28
+ return map[string]any{"error": err.Error()}
29
+ }
30
+ return map[string]any{"json": out.String()}
31
+ }
32
+
33
+ func main() {
34
+ js.Global().Call("registerShellParser", js.FuncOf(parse))
35
+ select {}
36
+ }