@alchemy.run/sigil 0.0.0-alpha.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.
@@ -0,0 +1,134 @@
1
+ # Third-party notices
2
+
3
+ This project contains code derived from or ported from the following projects.
4
+ Per-file headers (`// Derived from …` / `// Ported from …`) identify the
5
+ specific origin of each file.
6
+
7
+ ## Ink
8
+
9
+ The core of this project is a fork of [Ink](https://github.com/vadimdemedes/ink).
10
+ Copyright (c) Vadym Demedes. See the root `LICENSE` file.
11
+
12
+ ## Yoga
13
+
14
+ The layout engine (`src/yoga/`) is a TypeScript port of
15
+ [Yoga](https://github.com/facebook/yoga), and `patches/yoga-f64.patch` modifies
16
+ Yoga sources.
17
+
18
+ MIT License
19
+
20
+ Copyright (c) Facebook, Inc. and its affiliates.
21
+
22
+ Permission is hereby granted, free of charge, to any person obtaining a copy
23
+ of this software and associated documentation files (the "Software"), to deal
24
+ in the Software without restriction, including without limitation the rights
25
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
26
+ copies of the Software, and to permit persons to whom the Software is
27
+ furnished to do so, subject to the following conditions:
28
+
29
+ The above copyright notice and this permission notice shall be included in all
30
+ copies or substantial portions of the Software.
31
+
32
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
38
+ SOFTWARE.
39
+
40
+ ## Packages by Sindre Sorhus (MIT)
41
+
42
+ Portions of `src/ansi/` and `src/` are derived from the following packages:
43
+ `ansi-escapes`, `ansi-regex`, `ansi-styles`, `auto-bind`, `chalk`, `cli-boxes`,
44
+ `cli-cursor`, `cli-truncate`, `get-east-asian-width`, `indent-string`,
45
+ `is-fullwidth-code-point`, `is-in-ci`, `quick-lru`, `restore-cursor`,
46
+ `slice-ansi`, `string-width`, `strip-ansi`, `terminal-size`, `type-fest`,
47
+ `widest-line`, `wrap-ansi`.
48
+
49
+ MIT License
50
+
51
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
52
+
53
+ Permission is hereby granted, free of charge, to any person obtaining a copy
54
+ of this software and associated documentation files (the "Software"), to deal
55
+ in the Software without restriction, including without limitation the rights
56
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
57
+ copies of the Software, and to permit persons to whom the Software is
58
+ furnished to do so, subject to the following conditions:
59
+
60
+ The above copyright notice and this permission notice shall be included in all
61
+ copies or substantial portions of the Software.
62
+
63
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
64
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
66
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
67
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
68
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
69
+ SOFTWARE.
70
+
71
+ ## supports-color (MIT)
72
+
73
+ `src/ansi/supports-color.ts` is derived from `supports-color`.
74
+
75
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
76
+ and Josh Junon.
77
+
78
+ Licensed under the MIT License (text above).
79
+
80
+ ## color-convert (MIT)
81
+
82
+ The color-space conversions in `src/ansi/sgr.ts` originate from
83
+ `color-convert`, via `ansi-styles`.
84
+
85
+ Copyright (c) 2011-2016 Heather Arthur and Josh Junon.
86
+
87
+ Licensed under the MIT License (text above).
88
+
89
+ ## Packages by Vadym Demedes (MIT)
90
+
91
+ `src/patch-console.ts` and `src/code-excerpt.ts` are derived from
92
+ `patch-console`, `code-excerpt`, and `convert-to-spaces`.
93
+
94
+ Copyright (c) Vadym Demedes <vadimdemedes@hey.com> (https://github.com/vadimdemedes)
95
+
96
+ Licensed under the MIT License (text above).
97
+
98
+ ## @alcalzone/ansi-tokenize (MIT)
99
+
100
+ `src/ansi/tokenize.ts` is ported from `@alcalzone/ansi-tokenize`.
101
+
102
+ Copyright (c) 2023 AlCalzone (Dominic Griesel)
103
+
104
+ Licensed under the MIT License (text above).
105
+
106
+ ## stack-utils (MIT)
107
+
108
+ `src/parse-stack-line.ts` is derived from `stack-utils`.
109
+
110
+ Copyright (c) 2016-2022 Isaac Z. Schlueter <i@izs.me>, James Talmage
111
+ <james@talmage.io> (github.com/jamestalmage), and Contributors.
112
+
113
+ Licensed under the MIT License (text above).
114
+
115
+ ## signal-exit (ISC)
116
+
117
+ `src/signal-exit.ts` is a minimal reimplementation of `signal-exit`'s
118
+ behavior.
119
+
120
+ Copyright (c) 2015-2023 Benjamin Coe, Isaac Z. Schlueter, and Contributors
121
+
122
+ ISC License
123
+
124
+ Permission to use, copy, modify, and/or distribute this software for any
125
+ purpose with or without fee is hereby granted, provided that the above
126
+ copyright notice and this permission notice appear in all copies.
127
+
128
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
129
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
130
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
131
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
132
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
133
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
134
+ PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,76 @@
1
+ import ws from "ws";
2
+ import devtools from "react-devtools-core";
3
+ //#region src/devtools-window-polyfill.ts
4
+ const customGlobal = globalThis;
5
+ customGlobal.WebSocket ||= ws;
6
+ customGlobal.window ||= globalThis;
7
+ customGlobal.self ||= globalThis;
8
+ customGlobal.window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = [
9
+ {
10
+ type: 1,
11
+ value: 7,
12
+ isEnabled: true
13
+ },
14
+ {
15
+ type: 2,
16
+ value: "InternalApp",
17
+ isEnabled: true,
18
+ isValid: true
19
+ },
20
+ {
21
+ type: 2,
22
+ value: "InternalAppContext",
23
+ isEnabled: true,
24
+ isValid: true
25
+ },
26
+ {
27
+ type: 2,
28
+ value: "InternalStdoutContext",
29
+ isEnabled: true,
30
+ isValid: true
31
+ },
32
+ {
33
+ type: 2,
34
+ value: "InternalStderrContext",
35
+ isEnabled: true,
36
+ isValid: true
37
+ },
38
+ {
39
+ type: 2,
40
+ value: "InternalStdinContext",
41
+ isEnabled: true,
42
+ isValid: true
43
+ },
44
+ {
45
+ type: 2,
46
+ value: "InternalFocusContext",
47
+ isEnabled: true,
48
+ isValid: true
49
+ }
50
+ ];
51
+ //#endregion
52
+ //#region src/devtools.ts
53
+ const isDevToolsReachable = async () => new Promise((resolve) => {
54
+ const socket = new ws("ws://localhost:8097");
55
+ const timeout = setTimeout(() => {
56
+ socket.terminate();
57
+ resolve(false);
58
+ }, 2e3);
59
+ timeout.unref();
60
+ socket.on("open", () => {
61
+ clearTimeout(timeout);
62
+ socket.terminate();
63
+ resolve(true);
64
+ });
65
+ socket.on("error", () => {
66
+ clearTimeout(timeout);
67
+ socket.terminate();
68
+ resolve(false);
69
+ });
70
+ });
71
+ if (await isDevToolsReachable()) {
72
+ devtools.initialize();
73
+ devtools.connectToDevTools();
74
+ } else console.warn("DEV is set to true, but the React DevTools server is not running. Start it with:\n\n$ npx react-devtools\n");
75
+ //#endregion
76
+ export {};