@osdk/client 2.30.0 → 2.31.0-main-57cbc6de01ebfa2602892af13b45d6abbdfc19d1
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 +16 -0
- package/build/browser/Client.js +1 -1
- package/build/browser/Client.js.map +1 -1
- package/build/browser/util/UserAgent.js +2 -2
- package/build/browser/util/UserAgent.js.map +1 -1
- package/build/cjs/MediaReferenceProperty-QB5RSPON.cjs +22 -0
- package/build/cjs/{MediaReferenceProperty-SYUA2YYQ.cjs.map → MediaReferenceProperty-QB5RSPON.cjs.map} +1 -1
- package/build/cjs/{ObjectSetListenerWebsocket-O3NBPHXI.cjs → ObjectSetListenerWebsocket-JCUV33MX.cjs} +3 -3
- package/build/cjs/{ObjectSetListenerWebsocket-O3NBPHXI.cjs.map → ObjectSetListenerWebsocket-JCUV33MX.cjs.map} +1 -1
- package/build/cjs/{applyStreamingQuery-HWSAMCMX.cjs → applyStreamingQuery-5GIZD6RX.cjs} +11 -11
- package/build/cjs/{applyStreamingQuery-HWSAMCMX.cjs.map → applyStreamingQuery-5GIZD6RX.cjs.map} +1 -1
- package/build/cjs/{chunk-7FJ2Y6UO.cjs → chunk-3N4RHZYX.cjs} +6 -6
- package/build/cjs/{chunk-7FJ2Y6UO.cjs.map → chunk-3N4RHZYX.cjs.map} +1 -1
- package/build/cjs/{chunk-GANSH24P.cjs → chunk-JX5KXEAF.cjs} +15 -15
- package/build/cjs/{chunk-GANSH24P.cjs.map → chunk-JX5KXEAF.cjs.map} +1 -1
- package/build/cjs/{chunk-AN2R7X5W.cjs → chunk-PIWGMK3H.cjs} +4 -4
- package/build/cjs/{chunk-AN2R7X5W.cjs.map → chunk-PIWGMK3H.cjs.map} +1 -1
- package/build/cjs/chunk-Q7SFCCGT.cjs +11 -0
- package/build/cjs/chunk-Q7SFCCGT.cjs.map +1 -0
- package/build/cjs/{chunk-OVT3RFMG.cjs → chunk-QSJEXHBO.cjs} +77 -77
- package/build/cjs/{chunk-OVT3RFMG.cjs.map → chunk-QSJEXHBO.cjs.map} +1 -1
- package/build/cjs/{chunk-HRWHTCP3.cjs → chunk-ROJIXXGF.cjs} +4 -4
- package/build/cjs/{chunk-HRWHTCP3.cjs.map → chunk-ROJIXXGF.cjs.map} +1 -1
- package/build/cjs/{chunk-TZMBMUJD.cjs → chunk-S7WNOSCX.cjs} +55 -55
- package/build/cjs/chunk-S7WNOSCX.cjs.map +1 -0
- package/build/cjs/{createBulkLinksAsyncIterFactory-OBBVBSJZ.cjs → createBulkLinksAsyncIterFactory-F4NZOXU7.cjs} +3 -3
- package/build/cjs/{createBulkLinksAsyncIterFactory-OBBVBSJZ.cjs.map → createBulkLinksAsyncIterFactory-F4NZOXU7.cjs.map} +1 -1
- package/build/cjs/index.cjs +14 -14
- package/build/cjs/public/experimental.cjs +9 -9
- package/build/cjs/public/internal.cjs +9 -9
- package/build/cjs/public/observable.cjs +8 -8
- package/build/cjs/public/unstable-do-not-use.cjs +17 -17
- package/build/cjs/{transformAndWaitInternal-JGUDGNDJ.cjs → transformAndWaitInternal-PTYSXCC2.cjs} +7 -7
- package/build/cjs/{transformAndWaitInternal-JGUDGNDJ.cjs.map → transformAndWaitInternal-PTYSXCC2.cjs.map} +1 -1
- package/build/esm/Client.js +1 -1
- package/build/esm/Client.js.map +1 -1
- package/build/esm/util/UserAgent.js +2 -2
- package/build/esm/util/UserAgent.js.map +1 -1
- package/build/types/Client.d.ts +1 -1
- package/package.json +10 -18
- package/build/browser/public/internal-node.js +0 -18
- package/build/browser/public/internal-node.js.map +0 -1
- package/build/browser/tsserver.js +0 -135
- package/build/browser/tsserver.js.map +0 -1
- package/build/cjs/MediaReferenceProperty-SYUA2YYQ.cjs +0 -22
- package/build/cjs/chunk-74HV6NQQ.cjs +0 -16
- package/build/cjs/chunk-74HV6NQQ.cjs.map +0 -1
- package/build/cjs/chunk-TZMBMUJD.cjs.map +0 -1
- package/build/cjs/public/internal-node.cjs +0 -143
- package/build/cjs/public/internal-node.cjs.map +0 -1
- package/build/cjs/public/internal-node.d.cts +0 -29
- package/build/esm/public/internal-node.js +0 -18
- package/build/esm/public/internal-node.js.map +0 -1
- package/build/esm/tsserver.js +0 -135
- package/build/esm/tsserver.js.map +0 -1
- package/build/types/public/internal-node.d.ts +0 -2
- package/build/types/public/internal-node.d.ts.map +0 -1
- package/build/types/tsserver.d.ts +0 -35
- package/build/types/tsserver.d.ts.map +0 -1
- package/internal-node.d.ts +0 -17
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunk74HV6NQQ_cjs = require('../chunk-74HV6NQQ.cjs');
|
|
4
|
-
var execa = require('execa');
|
|
5
|
-
var findUp = require('find-up');
|
|
6
|
-
var events = require('events');
|
|
7
|
-
var fs = require('fs/promises');
|
|
8
|
-
var path = require('path');
|
|
9
|
-
var pLocate = require('p-locate');
|
|
10
|
-
var pMap = require('p-map');
|
|
11
|
-
var invariant = require('tiny-invariant');
|
|
12
|
-
var typescript = require('typescript');
|
|
13
|
-
|
|
14
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
|
|
16
|
-
function _interopNamespace(e) {
|
|
17
|
-
if (e && e.__esModule) return e;
|
|
18
|
-
var n = Object.create(null);
|
|
19
|
-
if (e) {
|
|
20
|
-
Object.keys(e).forEach(function (k) {
|
|
21
|
-
if (k !== 'default') {
|
|
22
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
23
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
get: function () { return e[k]; }
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
n.default = e;
|
|
31
|
-
return Object.freeze(n);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
var fs__namespace = /*#__PURE__*/_interopNamespace(fs);
|
|
35
|
-
var path__namespace = /*#__PURE__*/_interopNamespace(path);
|
|
36
|
-
var pLocate__default = /*#__PURE__*/_interopDefault(pLocate);
|
|
37
|
-
var pMap__default = /*#__PURE__*/_interopDefault(pMap);
|
|
38
|
-
var invariant__default = /*#__PURE__*/_interopDefault(invariant);
|
|
39
|
-
|
|
40
|
-
var TsServerImpl = class extends events.EventEmitter {
|
|
41
|
-
#tsServerPath;
|
|
42
|
-
#nextSeq = 1;
|
|
43
|
-
#subprocess;
|
|
44
|
-
#logger;
|
|
45
|
-
constructor(tsServerPath, logger) {
|
|
46
|
-
super();
|
|
47
|
-
this.#tsServerPath = tsServerPath;
|
|
48
|
-
this.#logger = logger;
|
|
49
|
-
}
|
|
50
|
-
get subprocess() {
|
|
51
|
-
return this.#subprocess;
|
|
52
|
-
}
|
|
53
|
-
async start() {
|
|
54
|
-
this.#subprocess = execa.execaNode({
|
|
55
|
-
ipc: true,
|
|
56
|
-
serialization: "json"
|
|
57
|
-
})`${this.#tsServerPath} --useNodeIpc`;
|
|
58
|
-
if (this.#logger.isLevelEnabled("trace")) {
|
|
59
|
-
this.#subprocess.on("message", (req) => {
|
|
60
|
-
this.#logger.trace({
|
|
61
|
-
req
|
|
62
|
-
}, "message received");
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
this.#subprocess.on("exit", () => {
|
|
66
|
-
this.#logger.info("tsserver exited");
|
|
67
|
-
this.emit("exit");
|
|
68
|
-
});
|
|
69
|
-
return this;
|
|
70
|
-
}
|
|
71
|
-
stop() {
|
|
72
|
-
if (this.#subprocess?.connected) {
|
|
73
|
-
this.#subprocess?.disconnect();
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
async getOneMessage(filter) {
|
|
77
|
-
return await this.subprocess.getOneMessage({
|
|
78
|
-
filter
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
#requestFactory = (command, isResponse2) => async (args) => {
|
|
82
|
-
return await this.#makeRequest(command, args, isResponse2);
|
|
83
|
-
};
|
|
84
|
-
sendOpenRequest = this.#requestFactory(typescript.server.protocol.CommandTypes.Open);
|
|
85
|
-
sendQuickInfoRequest = this.#requestFactory(typescript.server.protocol.CommandTypes.Quickinfo, isQuickInfoResponse);
|
|
86
|
-
sendCompletionsRequest = this.#requestFactory(typescript.server.protocol.CommandTypes.CompletionInfo, (m) => isResponse(m) && m.command === typescript.server.protocol.CommandTypes.CompletionInfo);
|
|
87
|
-
async #makeRequest(command, args, isResponse2) {
|
|
88
|
-
const seq = this.#nextSeq++;
|
|
89
|
-
const req = {
|
|
90
|
-
type: "request",
|
|
91
|
-
command,
|
|
92
|
-
arguments: args,
|
|
93
|
-
seq
|
|
94
|
-
};
|
|
95
|
-
this.#logger.trace({
|
|
96
|
-
req
|
|
97
|
-
}, "requesting");
|
|
98
|
-
await this.#subprocess?.sendMessage(req);
|
|
99
|
-
if (isResponse2) {
|
|
100
|
-
return {
|
|
101
|
-
req,
|
|
102
|
-
resp: await this.#subprocess?.getOneMessage({
|
|
103
|
-
filter: isResponse2
|
|
104
|
-
})
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
req,
|
|
109
|
-
resp: void 0
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
async function startTsServer(logger) {
|
|
114
|
-
const tsServerPath = await getTsServerPath();
|
|
115
|
-
!(tsServerPath != null) ? process.env.NODE_ENV !== "production" ? invariant__default.default(false) : invariant__default.default(false) : void 0;
|
|
116
|
-
return new TsServerImpl(tsServerPath, logger).start();
|
|
117
|
-
}
|
|
118
|
-
async function getTsServerPath() {
|
|
119
|
-
const nodeModuleDirs = await findUp.findUpMultiple("node_modules", {
|
|
120
|
-
cwd: chunk74HV6NQQ_cjs.importMetaUrl,
|
|
121
|
-
type: "directory"
|
|
122
|
-
});
|
|
123
|
-
const possibleTsServerPaths = await pMap__default.default(nodeModuleDirs, (dir) => path__namespace.join(dir, "typescript", "lib", "tsserver.js"));
|
|
124
|
-
const tsServerPath = await pLocate__default.default(["no", ...possibleTsServerPaths], async (dir) => {
|
|
125
|
-
try {
|
|
126
|
-
const c = await fs__namespace.stat(dir);
|
|
127
|
-
return c.isFile();
|
|
128
|
-
} catch (e) {
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
return tsServerPath;
|
|
133
|
-
}
|
|
134
|
-
function isResponse(m) {
|
|
135
|
-
return !!(m && typeof m === "object" && "type" in m && m.type === "response");
|
|
136
|
-
}
|
|
137
|
-
function isQuickInfoResponse(m, requestSeq) {
|
|
138
|
-
return isResponse(m) && m.command === typescript.server.protocol.CommandTypes.Quickinfo && (requestSeq == null || m.request_seq === requestSeq);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
exports.startTsServer = startTsServer;
|
|
142
|
-
//# sourceMappingURL=internal-node.cjs.map
|
|
143
|
-
//# sourceMappingURL=internal-node.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/tsserver.ts"],"names":["EventEmitter","execaNode","isResponse","s","invariant","findUpMultiple","importMetaUrl","pMap","path","pLocate","fs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,IAAM,YAAA,GAAN,cAA2BA,mBAAA,CAAa;AAAA,EACtC,aAAA;AAAA,EACA,QAAA,GAAW,CAAA;AAAA,EACX,WAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA,CAAY,cAAc,MAAA,EAAQ;AAChC,IAAA,KAAA,EAAM;AACN,IAAA,IAAA,CAAK,aAAA,GAAgB,YAAA;AACrB,IAAA,IAAA,CAAK,OAAA,GAAU,MAAA;AAAA,EACjB;AAAA,EACA,IAAI,UAAA,GAAa;AACf,IAAA,OAAO,IAAA,CAAK,WAAA;AAAA,EACd;AAAA,EACA,MAAM,KAAA,GAAQ;AACZ,IAAA,IAAA,CAAK,cAAcC,eAAA,CAAU;AAAA,MAC3B,GAAA,EAAK,IAAA;AAAA,MACL,aAAA,EAAe;AA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e,cAAA,EAAgB;AAAA,IAC1D,GAAA,EAAKC,+BAAA;AAAA,IACL,IAAA,EAAM;AAAA,GACP,CAAA;AACD,EAAA,MAAM,qBAAA,GAAwB,MAAMC,qBAAA,CAAK,cAAA,EAAgB,CAAA,GAAA,KAAYC,qBAAK,GAAA,EAAK,YAAA,EAAc,KAAA,EAAO,aAAa,CAAC,CAAA;AAClH,EAAA,MAAM,YAAA,GAAe,MAAMC,wBAAA,CAAQ,CAAC,MAAM,GAAG,qBAAqB,CAAA,EAAG,OAAM,GAAA,KAAO;AAChF,IAAA,IAAI;AACF,MAAA,MAAM,CAAA,GAAI,MAASC,aAAA,CAAA,IAAA,CAAK,GAAG,CAAA;AAC3B,MAAA,OAAO,EAAE,MAAA,EAAO;AAAA,IAClB,SAAS,CAAA,EAAG;AACV,MAAA,OAAO,KAAA;AAAA,IACT;AAAA,EACF,CAAC,CAAA;AACD,EAAA,OAAO,YAAA;AACT;AAIO,SAAS,WAAW,CAAA,EAAG;AAC5B,EAAA,OAAO,CAAC,EAAE,CAAA,IAAK,OAAO,MAAM,QAAA,IAAY,MAAA,IAAU,CAAA,IAAK,CAAA,CAAE,IAAA,KAAS,UAAA,CAAA;AACpE;AAOO,SAAS,mBAAA,CAAoB,GAAG,UAAA,EAAY;AACjD,EAAA,OAAO,UAAA,CAAW,CAAC,CAAA,IAAK,CAAA,CAAE,OAAA,KAAYP,iBAAA,CAAE,QAAA,CAAS,YAAA,CAAa,SAAA,KAAc,UAAA,IAAc,IAAA,IAAQ,CAAA,CAAE,WAAA,KAAgB,UAAA,CAAA;AACtH","file":"internal-node.cjs","sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { execaNode } from \"execa\";\nimport { findUpMultiple } from \"find-up\";\nimport { EventEmitter } from \"node:events\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport pLocate from \"p-locate\";\nimport pMap from \"p-map\";\nimport invariant from \"tiny-invariant\";\nimport { server as s } from \"typescript\";\nclass TsServerImpl extends EventEmitter {\n #tsServerPath;\n #nextSeq = 1;\n #subprocess;\n #logger;\n constructor(tsServerPath, logger) {\n super();\n this.#tsServerPath = tsServerPath;\n this.#logger = logger;\n }\n get subprocess() {\n return this.#subprocess;\n }\n async start() {\n this.#subprocess = execaNode({\n ipc: true,\n serialization: \"json\"\n })`${this.#tsServerPath} --useNodeIpc`;\n if (this.#logger.isLevelEnabled(\"trace\")) {\n this.#subprocess.on(\"message\", req => {\n this.#logger.trace({\n req\n }, \"message received\");\n });\n }\n this.#subprocess.on(\"exit\", () => {\n this.#logger.info(\"tsserver exited\");\n this.emit(\"exit\");\n });\n return this;\n }\n stop() {\n if (this.#subprocess?.connected) {\n this.#subprocess?.disconnect();\n }\n }\n async getOneMessage(filter) {\n return await this.subprocess.getOneMessage({\n filter\n });\n }\n #requestFactory = (command, isResponse) => async args => {\n return await this.#makeRequest(command, args, isResponse);\n };\n sendOpenRequest = this.#requestFactory(s.protocol.CommandTypes.Open);\n sendQuickInfoRequest = this.#requestFactory(s.protocol.CommandTypes.Quickinfo, isQuickInfoResponse);\n sendCompletionsRequest = this.#requestFactory(s.protocol.CommandTypes.CompletionInfo, m => isResponse(m) && m.command === s.protocol.CommandTypes.CompletionInfo);\n async #makeRequest(command, args, isResponse) {\n const seq = this.#nextSeq++;\n const req = {\n type: \"request\",\n command,\n arguments: args,\n seq\n };\n this.#logger.trace({\n req\n }, \"requesting\");\n await this.#subprocess?.sendMessage(req);\n if (isResponse) {\n return {\n req,\n resp: await this.#subprocess?.getOneMessage({\n filter: isResponse\n })\n };\n }\n return {\n req,\n resp: undefined\n };\n }\n}\nexport async function startTsServer(logger) {\n const tsServerPath = await getTsServerPath();\n !(tsServerPath != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false) : invariant(false) : void 0;\n return new TsServerImpl(tsServerPath, logger).start();\n}\nasync function getTsServerPath() {\n const nodeModuleDirs = await findUpMultiple(\"node_modules\", {\n cwd: import.meta.url,\n type: \"directory\"\n });\n const possibleTsServerPaths = await pMap(nodeModuleDirs, dir => path.join(dir, \"typescript\", \"lib\", \"tsserver.js\"));\n const tsServerPath = await pLocate([\"no\", ...possibleTsServerPaths], async dir => {\n try {\n const c = await fs.stat(dir);\n return c.isFile();\n } catch (e) {\n return false;\n }\n });\n return tsServerPath;\n}\nexport function isEvent(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m && m.type === \"event\");\n}\nexport function isResponse(m) {\n return !!(m && typeof m === \"object\" && \"type\" in m && m.type === \"response\");\n}\nexport function isProjectLoadingStart(m) {\n return isEvent(m) && m.event === \"projectLoadingStart\";\n}\nexport function isProjectLoadingEnd(m) {\n return isEvent(m) && m.event === \"projectLoadingFinish\";\n}\nexport function isQuickInfoResponse(m, requestSeq) {\n return isResponse(m) && m.command === s.protocol.CommandTypes.Quickinfo && (requestSeq == null || m.request_seq === requestSeq);\n}"]}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Logger } from '@osdk/api';
|
|
2
|
-
import { Subprocess } from 'execa';
|
|
3
|
-
import { EventEmitter } from 'node:events';
|
|
4
|
-
import { server } from 'typescript';
|
|
5
|
-
|
|
6
|
-
type RequestFn<T extends server.protocol.Request, X extends server.protocol.Response = never> = (args: T["arguments"]) => Promise<{
|
|
7
|
-
req: T;
|
|
8
|
-
resp: X;
|
|
9
|
-
}>;
|
|
10
|
-
declare class TsServerImpl extends EventEmitter<{
|
|
11
|
-
exit: [];
|
|
12
|
-
}> {
|
|
13
|
-
#private;
|
|
14
|
-
constructor(tsServerPath: string, logger: Logger);
|
|
15
|
-
get subprocess(): Subprocess<{
|
|
16
|
-
ipc: true;
|
|
17
|
-
serialization: "json";
|
|
18
|
-
}> | undefined;
|
|
19
|
-
start(): Promise<this>;
|
|
20
|
-
stop(): void;
|
|
21
|
-
getOneMessage<X>(filter?: (m: unknown) => m is X): Promise<X>;
|
|
22
|
-
sendOpenRequest: RequestFn<server.protocol.OpenRequest>;
|
|
23
|
-
sendQuickInfoRequest: RequestFn<server.protocol.QuickInfoRequest, server.protocol.QuickInfoResponse>;
|
|
24
|
-
sendCompletionsRequest: RequestFn<server.protocol.CompletionsRequest, server.protocol.CompletionInfoResponse>;
|
|
25
|
-
}
|
|
26
|
-
type TsServer = Omit<TsServerImpl, Exclude<keyof EventEmitter, "on" | "addListener" | "off" | "once" | "removeListener" | "removeAllListeners">>;
|
|
27
|
-
declare function startTsServer(logger: Logger): Promise<TsServer>;
|
|
28
|
-
|
|
29
|
-
export { type TsServer, startTsServer };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
export { startTsServer } from "../tsserver.js";
|
|
18
|
-
//# sourceMappingURL=internal-node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"internal-node.js","names":["startTsServer"],"sources":["internal-node.ts"],"sourcesContent":["/*\n * Copyright 2025 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { startTsServer } from \"../tsserver.js\";\nexport type { TsServer } from \"../tsserver.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,aAAa,QAAQ,gBAAgB","ignoreList":[]}
|
package/build/esm/tsserver.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2024 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
import { execaNode } from "execa";
|
|
18
|
-
import { findUpMultiple } from "find-up";
|
|
19
|
-
import { EventEmitter } from "node:events";
|
|
20
|
-
import * as fs from "node:fs/promises";
|
|
21
|
-
import * as path from "node:path";
|
|
22
|
-
import pLocate from "p-locate";
|
|
23
|
-
import pMap from "p-map";
|
|
24
|
-
import invariant from "tiny-invariant";
|
|
25
|
-
import { server as s } from "typescript";
|
|
26
|
-
class TsServerImpl extends EventEmitter {
|
|
27
|
-
#tsServerPath;
|
|
28
|
-
#nextSeq = 1;
|
|
29
|
-
#subprocess;
|
|
30
|
-
#logger;
|
|
31
|
-
constructor(tsServerPath, logger) {
|
|
32
|
-
super();
|
|
33
|
-
this.#tsServerPath = tsServerPath;
|
|
34
|
-
this.#logger = logger;
|
|
35
|
-
}
|
|
36
|
-
get subprocess() {
|
|
37
|
-
return this.#subprocess;
|
|
38
|
-
}
|
|
39
|
-
async start() {
|
|
40
|
-
this.#subprocess = execaNode({
|
|
41
|
-
ipc: true,
|
|
42
|
-
serialization: "json"
|
|
43
|
-
})`${this.#tsServerPath} --useNodeIpc`;
|
|
44
|
-
if (this.#logger.isLevelEnabled("trace")) {
|
|
45
|
-
this.#subprocess.on("message", req => {
|
|
46
|
-
this.#logger.trace({
|
|
47
|
-
req
|
|
48
|
-
}, "message received");
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
this.#subprocess.on("exit", () => {
|
|
52
|
-
this.#logger.info("tsserver exited");
|
|
53
|
-
this.emit("exit");
|
|
54
|
-
});
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
stop() {
|
|
58
|
-
if (this.#subprocess?.connected) {
|
|
59
|
-
this.#subprocess?.disconnect();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
async getOneMessage(filter) {
|
|
63
|
-
return await this.subprocess.getOneMessage({
|
|
64
|
-
filter
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
#requestFactory = (command, isResponse) => async args => {
|
|
68
|
-
return await this.#makeRequest(command, args, isResponse);
|
|
69
|
-
};
|
|
70
|
-
sendOpenRequest = this.#requestFactory(s.protocol.CommandTypes.Open);
|
|
71
|
-
sendQuickInfoRequest = this.#requestFactory(s.protocol.CommandTypes.Quickinfo, isQuickInfoResponse);
|
|
72
|
-
sendCompletionsRequest = this.#requestFactory(s.protocol.CommandTypes.CompletionInfo, m => isResponse(m) && m.command === s.protocol.CommandTypes.CompletionInfo);
|
|
73
|
-
async #makeRequest(command, args, isResponse) {
|
|
74
|
-
const seq = this.#nextSeq++;
|
|
75
|
-
const req = {
|
|
76
|
-
type: "request",
|
|
77
|
-
command,
|
|
78
|
-
arguments: args,
|
|
79
|
-
seq
|
|
80
|
-
};
|
|
81
|
-
this.#logger.trace({
|
|
82
|
-
req
|
|
83
|
-
}, "requesting");
|
|
84
|
-
await this.#subprocess?.sendMessage(req);
|
|
85
|
-
if (isResponse) {
|
|
86
|
-
return {
|
|
87
|
-
req,
|
|
88
|
-
resp: await this.#subprocess?.getOneMessage({
|
|
89
|
-
filter: isResponse
|
|
90
|
-
})
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
return {
|
|
94
|
-
req,
|
|
95
|
-
resp: undefined
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
export async function startTsServer(logger) {
|
|
100
|
-
const tsServerPath = await getTsServerPath();
|
|
101
|
-
!(tsServerPath != null) ? process.env.NODE_ENV !== "production" ? invariant(false) : invariant(false) : void 0;
|
|
102
|
-
return new TsServerImpl(tsServerPath, logger).start();
|
|
103
|
-
}
|
|
104
|
-
async function getTsServerPath() {
|
|
105
|
-
const nodeModuleDirs = await findUpMultiple("node_modules", {
|
|
106
|
-
cwd: import.meta.url,
|
|
107
|
-
type: "directory"
|
|
108
|
-
});
|
|
109
|
-
const possibleTsServerPaths = await pMap(nodeModuleDirs, dir => path.join(dir, "typescript", "lib", "tsserver.js"));
|
|
110
|
-
const tsServerPath = await pLocate(["no", ...possibleTsServerPaths], async dir => {
|
|
111
|
-
try {
|
|
112
|
-
const c = await fs.stat(dir);
|
|
113
|
-
return c.isFile();
|
|
114
|
-
} catch (e) {
|
|
115
|
-
return false;
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
return tsServerPath;
|
|
119
|
-
}
|
|
120
|
-
export function isEvent(m) {
|
|
121
|
-
return !!(m && typeof m === "object" && "type" in m && m.type === "event");
|
|
122
|
-
}
|
|
123
|
-
export function isResponse(m) {
|
|
124
|
-
return !!(m && typeof m === "object" && "type" in m && m.type === "response");
|
|
125
|
-
}
|
|
126
|
-
export function isProjectLoadingStart(m) {
|
|
127
|
-
return isEvent(m) && m.event === "projectLoadingStart";
|
|
128
|
-
}
|
|
129
|
-
export function isProjectLoadingEnd(m) {
|
|
130
|
-
return isEvent(m) && m.event === "projectLoadingFinish";
|
|
131
|
-
}
|
|
132
|
-
export function isQuickInfoResponse(m, requestSeq) {
|
|
133
|
-
return isResponse(m) && m.command === s.protocol.CommandTypes.Quickinfo && (requestSeq == null || m.request_seq === requestSeq);
|
|
134
|
-
}
|
|
135
|
-
//# sourceMappingURL=tsserver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tsserver.js","names":["execaNode","findUpMultiple","EventEmitter","fs","path","pLocate","pMap","invariant","server","s","TsServerImpl","tsServerPath","nextSeq","subprocess","logger","constructor","start","ipc","serialization","isLevelEnabled","on","req","trace","info","emit","stop","connected","disconnect","getOneMessage","filter","requestFactory","#requestFactory","command","isResponse","args","makeRequest","sendOpenRequest","protocol","CommandTypes","Open","sendQuickInfoRequest","Quickinfo","isQuickInfoResponse","sendCompletionsRequest","CompletionInfo","m","#makeRequest","seq","type","arguments","sendMessage","resp","undefined","startTsServer","getTsServerPath","process","env","NODE_ENV","nodeModuleDirs","cwd","import","meta","url","possibleTsServerPaths","dir","join","c","stat","isFile","e","isEvent","isProjectLoadingStart","event","isProjectLoadingEnd","requestSeq","request_seq"],"sources":["tsserver.ts"],"sourcesContent":["/*\n * Copyright 2024 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Logger } from \"@osdk/api\";\nimport type { Subprocess } from \"execa\";\nimport { execaNode } from \"execa\";\nimport { findUpMultiple } from \"find-up\";\nimport { EventEmitter } from \"node:events\";\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport pLocate from \"p-locate\";\nimport pMap from \"p-map\";\nimport invariant from \"tiny-invariant\";\nimport { server as s } from \"typescript\";\n\ntype RequestFn<\n T extends s.protocol.Request,\n X extends s.protocol.Response = never,\n> = (\n args: T[\"arguments\"],\n) => Promise<{ req: T; resp: X }>;\n\nclass TsServerImpl extends EventEmitter<{\n exit: [];\n}> {\n #tsServerPath: string;\n #nextSeq = 1;\n #subprocess: Subprocess<{ ipc: true; serialization: \"json\" }> | undefined;\n #logger: Logger;\n\n constructor(tsServerPath: string, logger: Logger) {\n super();\n this.#tsServerPath = tsServerPath;\n this.#logger = logger;\n }\n\n get subprocess():\n | Subprocess<{\n ipc: true;\n serialization: \"json\";\n }>\n | undefined\n {\n return this.#subprocess;\n }\n\n async start(): Promise<this> {\n this.#subprocess = execaNode({\n ipc: true,\n serialization: \"json\",\n })`${this.#tsServerPath} --useNodeIpc`;\n\n if (this.#logger.isLevelEnabled(\"trace\")) {\n this.#subprocess.on(\"message\", (req) => {\n this.#logger.trace({ req }, \"message received\");\n });\n }\n\n this.#subprocess.on(\"exit\", () => {\n this.#logger.info(\"tsserver exited\");\n this.emit(\"exit\");\n });\n return this;\n }\n\n stop(): void {\n if (this.#subprocess?.connected) {\n this.#subprocess?.disconnect();\n }\n }\n\n async getOneMessage<X>(filter?: (m: unknown) => m is X): Promise<X> {\n return await this.subprocess!.getOneMessage({ filter }) as X;\n }\n\n #requestFactory =\n <T extends s.protocol.Request, X extends s.protocol.Response = never>(\n command: T[\"command\"],\n isResponse?: (m: unknown) => m is X,\n ): RequestFn<T, X> =>\n async (args: T[\"arguments\"]): Promise<{ req: T; resp: X }> => {\n return await this.#makeRequest<T, X>(command, args, isResponse);\n };\n\n sendOpenRequest: RequestFn<s.protocol.OpenRequest> = this.#requestFactory(\n s.protocol.CommandTypes.Open,\n );\n\n sendQuickInfoRequest: RequestFn<\n s.protocol.QuickInfoRequest,\n s.protocol.QuickInfoResponse\n > = this.#requestFactory(\n s.protocol.CommandTypes.Quickinfo,\n isQuickInfoResponse,\n );\n\n sendCompletionsRequest: RequestFn<\n s.protocol.CompletionsRequest,\n s.protocol.CompletionInfoResponse\n > = this.#requestFactory(\n s.protocol.CommandTypes.CompletionInfo,\n (m): m is s.protocol.CompletionInfoResponse =>\n isResponse(m)\n && m.command === s.protocol.CommandTypes.CompletionInfo as string,\n );\n\n async #makeRequest<\n T extends s.protocol.Request,\n X extends s.protocol.Response = never,\n >(\n command: T[\"command\"],\n args: T[\"arguments\"],\n isResponse?: (m: unknown) => m is X,\n ): Promise<{ req: T; resp: X }> {\n const seq = this.#nextSeq++;\n const req: T = {\n type: \"request\",\n command,\n arguments: args,\n seq,\n } as T;\n this.#logger.trace({ req }, \"requesting\");\n\n await this.#subprocess?.sendMessage(req as any);\n\n if (isResponse) {\n return {\n req,\n resp: await this.#subprocess?.getOneMessage({\n filter: isResponse,\n }) as unknown as X,\n };\n }\n return { req, resp: undefined as unknown as X };\n }\n}\n\nexport type TsServer = Omit<\n TsServerImpl,\n Exclude<\n keyof EventEmitter,\n | \"on\"\n | \"addListener\"\n | \"off\"\n | \"once\"\n | \"removeListener\"\n | \"removeAllListeners\"\n >\n>;\n\nexport async function startTsServer(logger: Logger): Promise<TsServer> {\n const tsServerPath = await getTsServerPath();\n invariant(tsServerPath != null);\n\n return new TsServerImpl(tsServerPath, logger).start();\n}\n\nasync function getTsServerPath() {\n const nodeModuleDirs = await findUpMultiple(\"node_modules\", {\n cwd: import.meta.url,\n type: \"directory\",\n });\n const possibleTsServerPaths = await pMap(\n nodeModuleDirs,\n (dir) => path.join(dir, \"typescript\", \"lib\", \"tsserver.js\"),\n );\n\n const tsServerPath = await pLocate(\n [\"no\", ...possibleTsServerPaths],\n async (dir) => {\n try {\n const c = await fs.stat(\n dir,\n );\n return c.isFile();\n } catch (e) {\n return false;\n }\n },\n );\n return tsServerPath;\n}\n\nexport function isEvent(m: unknown): m is s.protocol.Event {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"event\");\n}\n\nexport function isResponse(m: unknown): m is s.protocol.Response {\n return !!(m && typeof m === \"object\" && \"type\" in m\n && m.type === \"response\");\n}\n\nexport function isProjectLoadingStart(\n m: unknown,\n): m is s.protocol.ProjectLoadingStartEvent {\n return isEvent(m) && m.event === \"projectLoadingStart\";\n}\nexport function isProjectLoadingEnd(\n m: unknown,\n): m is s.protocol.ProjectLoadingStartEvent {\n return isEvent(m) && m.event === \"projectLoadingFinish\";\n}\nexport function isQuickInfoResponse(\n m: unknown,\n requestSeq?: number,\n): m is s.protocol.QuickInfoResponse {\n return isResponse(m)\n && m.command === s.protocol.CommandTypes.Quickinfo as string\n && (requestSeq == null || m.request_seq === requestSeq);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAIA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,cAAc,QAAQ,SAAS;AACxC,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAO,KAAKC,EAAE,MAAM,kBAAkB;AACtC,OAAO,KAAKC,IAAI,MAAM,WAAW;AACjC,OAAOC,OAAO,MAAM,UAAU;AAC9B,OAAOC,IAAI,MAAM,OAAO;AACxB,OAAOC,SAAS,MAAM,gBAAgB;AACtC,SAASC,MAAM,IAAIC,CAAC,QAAQ,YAAY;AASxC,MAAMC,YAAY,SAASR,YAAY,CAEpC;EACD,CAACS,YAAY;EACb,CAACC,OAAO,GAAG,CAAC;EACZ,CAACC,UAAU;EACX,CAACC,MAAM;E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AI,MAAM,IAAIA,CAAC,IAC9CA,CAAC,CAACG,IAAI,KAAK,UAAU,CAAC;AAC7B;AAEA,OAAO,SAASuB,qBAAqBA,CACnC1B,CAAU,EACgC;EAC1C,OAAOyB,OAAO,CAACzB,CAAC,CAAC,IAAIA,CAAC,CAAC2B,KAAK,KAAK,qBAAqB;AACxD;AACA,OAAO,SAASC,mBAAmBA,CACjC5B,CAAU,EACgC;EAC1C,OAAOyB,OAAO,CAACzB,CAAC,CAAC,IAAIA,CAAC,CAAC2B,KAAK,KAAK,sBAAsB;AACzD;AACA,OAAO,SAAS9B,mBAAmBA,CACjCG,CAAU,EACV6B,UAAmB,EACgB;EACnC,OAAOzC,UAAU,CAACY,CAAC,CAAC,IACfA,CAAC,CAACb,OAAO,KAAKvB,CAAC,CAAC4B,QAAQ,CAACC,YAAY,CAACG,SAAmB,KACxDiC,UAAU,IAAI,IAAI,IAAI7B,CAAC,CAAC8B,WAAW,KAAKD,UAAU,CAAC;AAC3D","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAgBA,SAAS,qBAAqB;AAC9B,cAAc,gBAAgB","names":[],"sources":["../../../src/public/internal-node.ts"],"version":3,"file":"internal-node.d.ts"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { Logger } from "@osdk/api";
|
|
2
|
-
import type { Subprocess } from "execa";
|
|
3
|
-
import { EventEmitter } from "node:events";
|
|
4
|
-
import { server as s } from "typescript";
|
|
5
|
-
type RequestFn<
|
|
6
|
-
T extends s.protocol.Request,
|
|
7
|
-
X extends s.protocol.Response = never
|
|
8
|
-
> = (args: T["arguments"]) => Promise<{
|
|
9
|
-
req: T
|
|
10
|
-
resp: X
|
|
11
|
-
}>;
|
|
12
|
-
declare class TsServerImpl extends EventEmitter<{
|
|
13
|
-
exit: []
|
|
14
|
-
}> {
|
|
15
|
-
#private;
|
|
16
|
-
constructor(tsServerPath: string, logger: Logger);
|
|
17
|
-
get subprocess(): Subprocess<{
|
|
18
|
-
ipc: true
|
|
19
|
-
serialization: "json"
|
|
20
|
-
}> | undefined;
|
|
21
|
-
start(): Promise<this>;
|
|
22
|
-
stop(): void;
|
|
23
|
-
getOneMessage<X>(filter?: (m: unknown) => m is X): Promise<X>;
|
|
24
|
-
sendOpenRequest: RequestFn<s.protocol.OpenRequest>;
|
|
25
|
-
sendQuickInfoRequest: RequestFn<s.protocol.QuickInfoRequest, s.protocol.QuickInfoResponse>;
|
|
26
|
-
sendCompletionsRequest: RequestFn<s.protocol.CompletionsRequest, s.protocol.CompletionInfoResponse>;
|
|
27
|
-
}
|
|
28
|
-
export type TsServer = Omit<TsServerImpl, Exclude<keyof EventEmitter, "on" | "addListener" | "off" | "once" | "removeListener" | "removeAllListeners">>;
|
|
29
|
-
export declare function startTsServer(logger: Logger): Promise<TsServer>;
|
|
30
|
-
export declare function isEvent(m: unknown): m is s.protocol.Event;
|
|
31
|
-
export declare function isResponse(m: unknown): m is s.protocol.Response;
|
|
32
|
-
export declare function isProjectLoadingStart(m: unknown): m is s.protocol.ProjectLoadingStartEvent;
|
|
33
|
-
export declare function isProjectLoadingEnd(m: unknown): m is s.protocol.ProjectLoadingStartEvent;
|
|
34
|
-
export declare function isQuickInfoResponse(m: unknown, requestSeq?: number): m is s.protocol.QuickInfoResponse;
|
|
35
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":"AAgBA,cAAc,cAAc,WAAY;AACxC,cAAc,kBAAkB,OAAQ;AAGxC,SAAS,oBAAoB,aAAc;AAM3C,SAAS,UAAU,SAAS,YAAa;KAEpC;CACH,UAAU,EAAE,SAAS;CACrB,UAAU,EAAE,SAAS;KAErBA,MAAM,EAAE,iBACL,QAAQ;CAAE,KAAK;CAAG,MAAM;AAAG;AAEhC,cAAM,qBAAqB,aAAa;CACtC;AACD,GAAE;;CAMD,YAAYC,sBAAsBC,QAAQ;CAM1C,IAAI,cACA,WAAW;EACX,KAAK;EACL,eAAe;CAChB;CAMH,AAAM,SAAS;CAmBf;CAMA,AAAM,cAAc,GAAGC,UAAUC,eAAe,KAAK,IAAI,QAAQ;CAajE,iBAAiB,UAAU,EAAE,SAAS;CAItC,sBAAsB,UACpB,EAAE,SAAS,kBACX,EAAE,SAAS;CAMb,wBAAwB,UACtB,EAAE,SAAS,oBACX,EAAE,SAAS;AAqCd;AAED,YAAY,WAAW,KACrB,cACA,cACQ,cACJ,OACA,gBACA,QACA,SACA,mBACA;AAIN,OAAO,iBAAe,cAAcF,QAAQ,SAAS,QAAQ;AAiC7D,OAAO,iBAAS,QAAQE,aAAa,KAAK,EAAE,SAAS;AAKrD,OAAO,iBAAS,WAAWA,aAAa,KAAK,EAAE,SAAS;AAKxD,OAAO,iBAAS,sBACdA,aACC,KAAK,EAAE,SAAS;AAGnB,OAAO,iBAAS,oBACdA,aACC,KAAK,EAAE,SAAS;AAGnB,OAAO,iBAAS,oBACdA,YACAC,sBACC,KAAK,EAAE,SAAS","names":["args: T[\"arguments\"]","tsServerPath: string","logger: Logger","filter?: (m: unknown) => m is X","m: unknown","requestSeq?: number"],"sources":["../../src/tsserver.ts"],"version":3,"file":"tsserver.d.ts"}
|
package/internal-node.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2025 Palantir Technologies, Inc. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
export * from "./build/cjs/public/internal-node.cjs";
|