@stainless-api/playgrounds 0.1.0-beta.48 → 0.1.0-beta.50
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/CHANGELOG.md +25 -0
- package/eslint-suppressions.json +1 -21
- package/package.json +10 -13
- package/src/codemirror/{comlink.ts → comlink.vendor.ts} +1 -1
- package/src/codemirror/curl.ts +2 -2
- package/src/codemirror/lsp.ts +3 -3
- package/src/codemirror/python/pyodide.ts +1 -1
- package/src/codemirror/python.ts +1 -1
- package/src/codemirror/react.tsx +3 -3
- package/src/codemirror/typescript/console.ts +2 -2
- package/src/codemirror/typescript/runner.ts +2 -2
- package/src/codemirror/typescript/worker.ts +3 -3
- package/src/codemirror/typescript.tsx +2 -2
- package/src/use-storage.ts +0 -2
- package/src/virtual-module.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @stainless-api/playgrounds
|
|
2
2
|
|
|
3
|
+
## 0.1.0-beta.50
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4d3b938: Remove dead code flagged by knip
|
|
8
|
+
- Updated dependencies [3019a8b]
|
|
9
|
+
- Updated dependencies [4d3b938]
|
|
10
|
+
- Updated dependencies [0791fb6]
|
|
11
|
+
- Updated dependencies [01b77d0]
|
|
12
|
+
- Updated dependencies [15e07d8]
|
|
13
|
+
- Updated dependencies [ebc039a]
|
|
14
|
+
- Updated dependencies [cfd8ea1]
|
|
15
|
+
- Updated dependencies [68a7bf8]
|
|
16
|
+
- @stainless-api/docs-ui@0.1.0-beta.93
|
|
17
|
+
- @stainless-api/ui-primitives@0.1.0-beta.53
|
|
18
|
+
- @stainless/sdk-json@0.1.0-beta.10
|
|
19
|
+
|
|
20
|
+
## 0.1.0-beta.49
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies [966ec34]
|
|
25
|
+
- @stainless-api/ui-primitives@0.1.0-beta.52
|
|
26
|
+
- @stainless-api/docs-ui@0.1.0-beta.92
|
|
27
|
+
|
|
3
28
|
## 0.1.0-beta.48
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/eslint-suppressions.json
CHANGED
|
@@ -12,26 +12,6 @@
|
|
|
12
12
|
"count": 1
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
"src/codemirror/comlink.ts": {
|
|
16
|
-
"@typescript-eslint/no-floating-promises": {
|
|
17
|
-
"count": 2
|
|
18
|
-
},
|
|
19
|
-
"@typescript-eslint/no-unsafe-argument": {
|
|
20
|
-
"count": 7
|
|
21
|
-
},
|
|
22
|
-
"@typescript-eslint/no-unsafe-assignment": {
|
|
23
|
-
"count": 11
|
|
24
|
-
},
|
|
25
|
-
"@typescript-eslint/no-unsafe-call": {
|
|
26
|
-
"count": 4
|
|
27
|
-
},
|
|
28
|
-
"@typescript-eslint/no-unsafe-member-access": {
|
|
29
|
-
"count": 12
|
|
30
|
-
},
|
|
31
|
-
"@typescript-eslint/no-unsafe-return": {
|
|
32
|
-
"count": 7
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
15
|
"src/codemirror/curl.ts": {
|
|
36
16
|
"@typescript-eslint/no-floating-promises": {
|
|
37
17
|
"count": 1
|
|
@@ -95,7 +75,7 @@
|
|
|
95
75
|
"count": 1
|
|
96
76
|
},
|
|
97
77
|
"@typescript-eslint/no-misused-promises": {
|
|
98
|
-
"count":
|
|
78
|
+
"count": 3
|
|
99
79
|
},
|
|
100
80
|
"@typescript-eslint/only-throw-error": {
|
|
101
81
|
"count": 1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stainless-api/playgrounds",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.50",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"exports": {
|
|
9
9
|
".": "./src/index.ts",
|
|
10
10
|
"./build": "./src/build.ts",
|
|
11
|
-
"./package.json": "./package.json"
|
|
11
|
+
"./package.json": "./package.json",
|
|
12
|
+
"./create": "./src/create.tsx"
|
|
12
13
|
},
|
|
13
14
|
"peerDependencies": {
|
|
14
15
|
"react": ">=19.0.0",
|
|
@@ -26,16 +27,13 @@
|
|
|
26
27
|
"@codemirror/lsp-client": "^6.1.2",
|
|
27
28
|
"@codemirror/search": "^6.5.11",
|
|
28
29
|
"@codemirror/state": "^6.5.2",
|
|
29
|
-
"@codemirror/theme-one-dark": "^6.1.3",
|
|
30
30
|
"@codemirror/view": "^6.38.2",
|
|
31
31
|
"@preact/signals-core": "^1.14.1",
|
|
32
32
|
"@replit/codemirror-vscode-keymap": "^6.0.2",
|
|
33
|
-
"@shikijs/types": "^4.0.2",
|
|
34
33
|
"@stainless-api/codemirror-ts": "^3.0.1",
|
|
35
34
|
"@typescript/vfs": "^1.6.4",
|
|
36
|
-
"clsx": "^2.1.1",
|
|
37
35
|
"corepack": "^0.34.3",
|
|
38
|
-
"dompurify": "^3.
|
|
36
|
+
"dompurify": "^3.3.3",
|
|
39
37
|
"js-tokens": "^10.0.0",
|
|
40
38
|
"lines-and-columns": "^2.0.4",
|
|
41
39
|
"lucide-react": "^0.577.0",
|
|
@@ -44,15 +42,14 @@
|
|
|
44
42
|
"source-map": "^0.7.6",
|
|
45
43
|
"type-fest": "^5.5.0",
|
|
46
44
|
"unenv": "^1.10.0",
|
|
47
|
-
"vite-plugin-prebundle-workers": "^0.2.0",
|
|
48
45
|
"vscode-languageserver-protocol": "^3.17.5",
|
|
49
|
-
"@stainless-api/docs-ui": "0.1.0-beta.
|
|
50
|
-
"@stainless-api/ui-primitives": "0.1.0-beta.
|
|
51
|
-
"@stainless/sdk-json": "^0.1.0-beta.
|
|
46
|
+
"@stainless-api/docs-ui": "0.1.0-beta.93",
|
|
47
|
+
"@stainless-api/ui-primitives": "0.1.0-beta.53",
|
|
48
|
+
"@stainless/sdk-json": "^0.1.0-beta.10"
|
|
52
49
|
},
|
|
53
50
|
"devDependencies": {
|
|
54
51
|
"@types/is-callable": "^1.1.2",
|
|
55
|
-
"@types/node": "24.12.
|
|
52
|
+
"@types/node": "24.12.2",
|
|
56
53
|
"@types/react": "19.2.14",
|
|
57
54
|
"@types/react-dom": "^19.2.3",
|
|
58
55
|
"is-callable": "^1.2.7",
|
|
@@ -60,8 +57,8 @@
|
|
|
60
57
|
"react": "^19.2.4",
|
|
61
58
|
"react-dom": "^19.2.4",
|
|
62
59
|
"typescript": "6.0.2",
|
|
63
|
-
"vite": "^7.3.
|
|
64
|
-
"@stainless/eslint-config": "0.1.0-beta.
|
|
60
|
+
"vite": "^7.3.2",
|
|
61
|
+
"@stainless/eslint-config": "0.1.0-beta.2"
|
|
65
62
|
},
|
|
66
63
|
"scripts": {
|
|
67
64
|
"lint": "eslint --flag unstable_native_nodejs_ts_config .",
|
package/src/codemirror/curl.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import runnerWorkerURL from './typescript/runner?worker&url';
|
|
2
|
-
import * as Comlink from './comlink';
|
|
2
|
+
import * as Comlink from './comlink.vendor.js';
|
|
3
3
|
import type { Language } from './react';
|
|
4
|
-
import { proxy, type Remote } from './comlink';
|
|
4
|
+
import { proxy, type Remote } from './comlink.vendor.js';
|
|
5
5
|
import type { Logger } from '../Logs';
|
|
6
6
|
import type { RunnerAPI } from './typescript/runner';
|
|
7
7
|
import { shell } from '@codemirror/legacy-modes/mode/shell';
|
package/src/codemirror/lsp.ts
CHANGED
|
@@ -2,12 +2,12 @@ import type * as lsp from 'vscode-languageserver-protocol';
|
|
|
2
2
|
import type { Transport } from '@codemirror/lsp-client';
|
|
3
3
|
import { sanitizeHTML } from './sanitize-html';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
interface WorkerTransportHooks {
|
|
6
6
|
onMessage?: (message: unknown) => void;
|
|
7
7
|
onSend?: (message: unknown) => unknown;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface WorkerTransportConfig {
|
|
11
11
|
worker: Worker;
|
|
12
12
|
hooks?: WorkerTransportHooks;
|
|
13
13
|
}
|
|
@@ -52,7 +52,7 @@ export function workerTransport({ worker, hooks = {} }: WorkerTransportConfig):
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
interface LSPClientConfig {
|
|
56
56
|
rootUri: string;
|
|
57
57
|
onDiagnostics?: (diagnostics: lsp.Diagnostic[]) => void;
|
|
58
58
|
onNotification?: (method: string, params: unknown) => void;
|
package/src/codemirror/python.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { workerTransport } from './lsp';
|
|
|
2
2
|
import { pythonLanguage } from '@codemirror/lang-python';
|
|
3
3
|
import pyodideWorkerURL from './python/pyodide?worker&url';
|
|
4
4
|
import type { Language } from './react';
|
|
5
|
-
import { proxy, releaseProxy, type Remote, wrap } from './comlink';
|
|
5
|
+
import { proxy, releaseProxy, type Remote, wrap } from './comlink.vendor.js';
|
|
6
6
|
import type { API } from './python/pyodide';
|
|
7
7
|
import type { Logger } from '../Logs';
|
|
8
8
|
import { pyTypes, wheelUrl } from '../config.js';
|
package/src/codemirror/react.tsx
CHANGED
|
@@ -16,12 +16,12 @@ import { initDropdown } from '@stainless-api/ui-primitives/scripts';
|
|
|
16
16
|
import { Panel } from '../Panel.tsx';
|
|
17
17
|
import { PlaygroundPanelWrapper } from '../PlaygroundPanelWrapper.tsx';
|
|
18
18
|
import { MaskedInput } from '@stainless-api/docs-ui/components/MaskedInput';
|
|
19
|
-
import useStorage from '../use-storage.ts';
|
|
19
|
+
import { useStorage } from '../use-storage.ts';
|
|
20
20
|
import { authData } from '../config.ts';
|
|
21
21
|
|
|
22
|
-
let codeMirrorPromise: Promise<typeof import('./deps.ts')
|
|
22
|
+
let codeMirrorPromise: Promise<typeof import('./deps.ts')> | undefined = undefined;
|
|
23
23
|
function loadCodeMirror(): Promise<typeof import('./deps.ts')> {
|
|
24
|
-
return
|
|
24
|
+
return (codeMirrorPromise ??= import('./deps.ts'));
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
function fromPosition(doc: Text, pos: lsp.Position): number {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSLogType } from '../../Logs';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type Printer = (...args: [JSLogType, (string | Part)[]] | ['clear']) => void;
|
|
4
4
|
type Logger = (...args: [JSLogType, unknown[]]) => void;
|
|
5
5
|
|
|
6
6
|
const stripMe = /^(?:.*Error.*\n)?.+\n/;
|
|
@@ -153,7 +153,7 @@ function format(args: unknown[]): (string | Part)[] {
|
|
|
153
153
|
* Methods include logging, debugging, and timing functionality.
|
|
154
154
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/console
|
|
155
155
|
*/
|
|
156
|
-
|
|
156
|
+
interface Console {
|
|
157
157
|
/**
|
|
158
158
|
* Tests that an expression is true. If not, logs an error message
|
|
159
159
|
* @param condition The expression to test for truthiness
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* and implements the structured object logging api so users can expand and collapse
|
|
5
5
|
* logged objects.
|
|
6
6
|
*/
|
|
7
|
-
import { expose } from '../comlink.ts';
|
|
7
|
+
import { expose } from '../comlink.vendor.ts';
|
|
8
8
|
import { createConsole } from './console.ts';
|
|
9
9
|
import process from 'unenv/runtime/node/process/index';
|
|
10
10
|
import { Entries, isProxy, specialInfo } from './special-info.ts';
|
|
@@ -241,7 +241,7 @@ Object.defineProperty(globalThis, 'console', {
|
|
|
241
241
|
}
|
|
242
242
|
}),
|
|
243
243
|
});
|
|
244
|
-
|
|
244
|
+
type Handle = string & { readonly _handle: unique symbol };
|
|
245
245
|
const ids = new WeakMap<WeakKey, string>();
|
|
246
246
|
const idsMap = new Map<unknown, string>();
|
|
247
247
|
const id = (obj: unknown) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createVirtualTypeScriptEnvironment, VirtualTypeScriptEnvironment } from '@typescript/vfs';
|
|
2
2
|
import ts from './cdn-typescript';
|
|
3
|
-
import * as Comlink from '../comlink';
|
|
3
|
+
import * as Comlink from '../comlink.vendor';
|
|
4
4
|
import { createWorker, HoverInfo } from '@stainless-api/codemirror-ts/worker';
|
|
5
5
|
import { format } from 'prettier';
|
|
6
6
|
import { parsers } from './prettier-plugin-external-typescript.vendor';
|
|
@@ -60,7 +60,7 @@ const libize = (path: string) => path.replace('/', '/lib.').toLowerCase();
|
|
|
60
60
|
* Creates an in-memory System object which can be used in a TypeScript program, this
|
|
61
61
|
* is what provides read/write aspects of the virtual fs
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
function createSystem(typescriptTypes: TypescriptTypes, files: Map<string, string>): ts.System {
|
|
64
64
|
return {
|
|
65
65
|
args: [],
|
|
66
66
|
createDirectory: () => notImplemented('createDirectory'),
|
|
@@ -99,7 +99,7 @@ export function createSystem(typescriptTypes: TypescriptTypes, files: Map<string
|
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
type PromiseWithResolvers<T> = {
|
|
103
103
|
promise: Promise<T>;
|
|
104
104
|
resolve: (value: T) => void;
|
|
105
105
|
reject: (reason?: unknown) => void;
|
|
@@ -3,11 +3,11 @@ import tsWorkerURL from './typescript/worker?worker&url';
|
|
|
3
3
|
import runnerWorkerURL from './typescript/runner?worker&url';
|
|
4
4
|
import type { HoverInfo } from '@stainless-api/codemirror-ts/worker';
|
|
5
5
|
import { tsAutocomplete, tsFacet, tsHover, tsLinter, tsSync, tsTwoslash } from '@stainless-api/codemirror-ts';
|
|
6
|
-
import * as Comlink from './comlink';
|
|
6
|
+
import * as Comlink from './comlink.vendor.js';
|
|
7
7
|
import { autocompletion } from '@codemirror/autocomplete';
|
|
8
8
|
import type { JSDocTagInfo, QuickInfo, SymbolDisplayPart } from 'typescript';
|
|
9
9
|
import type { Language } from './react';
|
|
10
|
-
import { proxy, type Remote } from './comlink';
|
|
10
|
+
import { proxy, type Remote } from './comlink.vendor.js';
|
|
11
11
|
import type { Logger } from '../Logs';
|
|
12
12
|
import type { RunnerAPI } from './typescript/runner';
|
|
13
13
|
import { docToHTML } from './fix-lsp-markdown';
|
package/src/use-storage.ts
CHANGED
package/src/virtual-module.d.ts
CHANGED