@valbuild/server 0.13.11 → 0.15.0
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/dist/declarations/src/Service.d.ts +3 -3
- package/dist/declarations/src/ValFSHost.d.ts +1 -1
- package/dist/declarations/src/ValModuleLoader.d.ts +2 -2
- package/dist/declarations/src/ValSourceFileHandler.d.ts +1 -1
- package/dist/declarations/src/createRequestHandler.d.ts +1 -1
- package/dist/declarations/src/hosting.d.ts +1 -1
- package/dist/declarations/src/index.d.ts +12 -12
- package/dist/declarations/src/patchValFile.d.ts +3 -3
- package/dist/valbuild-server.cjs.dev.js +5 -16
- package/dist/valbuild-server.cjs.prod.js +5 -16
- package/dist/valbuild-server.esm.js +5 -16
- package/package.json +3 -3
- package/src/ValQuickJSRuntime.ts +5 -12
- package/dist/declarations/src/LocalValServer.d.ts +0 -22
- package/dist/declarations/src/ProxyValServer.d.ts +0 -52
- package/dist/declarations/src/ValQuickJSRuntime.d.ts +0 -7
- package/dist/declarations/src/expressHelpers.d.ts +0 -4
- package/dist/declarations/src/jwt.d.ts +0 -3
- package/dist/declarations/src/patch/ts/ops.d.ts +0 -27
- package/dist/declarations/src/patch/ts/valModule.d.ts +0 -8
- package/dist/declarations/src/patch/validation.d.ts +0 -4
- package/dist/declarations/src/readValFile.d.ts +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { QuickJSRuntime } from "quickjs-emscripten";
|
|
2
2
|
import { Patch } from "@valbuild/core/patch";
|
|
3
|
-
import { ValSourceFileHandler } from "./ValSourceFileHandler";
|
|
4
|
-
import { IValFSHost } from "./ValFSHost";
|
|
5
|
-
import { SerializedModuleContent } from "./SerializedModuleContent";
|
|
3
|
+
import { ValSourceFileHandler } from "./ValSourceFileHandler.js";
|
|
4
|
+
import { IValFSHost } from "./ValFSHost.js";
|
|
5
|
+
import { SerializedModuleContent } from "./SerializedModuleContent.js";
|
|
6
6
|
import { ModuleId, ModulePath } from "@valbuild/core";
|
|
7
7
|
export type ServiceOptions = {
|
|
8
8
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ts from "typescript";
|
|
2
|
-
import type { IValFSHost } from "./ValFSHost";
|
|
3
|
-
import { ValSourceFileHandler } from "./ValSourceFileHandler";
|
|
2
|
+
import type { IValFSHost } from "./ValFSHost.js";
|
|
3
|
+
import { ValSourceFileHandler } from "./ValSourceFileHandler.js";
|
|
4
4
|
export declare const createModuleLoader: (rootDir: string, host?: IValFSHost) => ValModuleLoader;
|
|
5
5
|
export declare class ValModuleLoader {
|
|
6
6
|
readonly projectRoot: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { RequestListener } from "node:http";
|
|
3
|
-
import { ServiceOptions } from "./Service";
|
|
3
|
+
import { ServiceOptions } from "./Service.js";
|
|
4
4
|
type Opts = ValServerOverrides & ServiceOptions;
|
|
5
5
|
type ValServerOverrides = Partial<{
|
|
6
6
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export type { ServiceOptions } from "./Service";
|
|
2
|
-
export { createService, Service } from "./Service";
|
|
3
|
-
export { createRequestHandler } from "./createRequestHandler";
|
|
4
|
-
export { createRequestListener } from "./hosting";
|
|
5
|
-
export { ValModuleLoader } from "./ValModuleLoader";
|
|
6
|
-
export { getCompilerOptions } from "./getCompilerOptions";
|
|
7
|
-
export { ValSourceFileHandler } from "./ValSourceFileHandler";
|
|
8
|
-
export { ValFSHost } from "./ValFSHost";
|
|
9
|
-
export type { IValFSHost } from "./ValFSHost";
|
|
10
|
-
export type { ValFS } from "./ValFS";
|
|
11
|
-
export { patchSourceFile } from "./patchValFile";
|
|
12
|
-
export { formatSyntaxErrorTree } from "./patch/ts/syntax";
|
|
1
|
+
export type { ServiceOptions } from "./Service.js";
|
|
2
|
+
export { createService, Service } from "./Service.js";
|
|
3
|
+
export { createRequestHandler } from "./createRequestHandler.js";
|
|
4
|
+
export { createRequestListener } from "./hosting.js";
|
|
5
|
+
export { ValModuleLoader } from "./ValModuleLoader.js";
|
|
6
|
+
export { getCompilerOptions } from "./getCompilerOptions.js";
|
|
7
|
+
export { ValSourceFileHandler } from "./ValSourceFileHandler.js";
|
|
8
|
+
export { ValFSHost } from "./ValFSHost.js";
|
|
9
|
+
export type { IValFSHost } from "./ValFSHost.js";
|
|
10
|
+
export type { ValFS } from "./ValFS.js";
|
|
11
|
+
export { patchSourceFile } from "./patchValFile.js";
|
|
12
|
+
export { formatSyntaxErrorTree } from "./patch/ts/syntax.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Patch, PatchError } from "@valbuild/core/patch";
|
|
2
2
|
import { result } from "@valbuild/core/fp";
|
|
3
|
-
import { type ValSyntaxErrorTree } from "./patch/ts/syntax";
|
|
4
|
-
import { ValSourceFileHandler } from "./ValSourceFileHandler";
|
|
3
|
+
import { type ValSyntaxErrorTree } from "./patch/ts/syntax.js";
|
|
4
|
+
import { ValSourceFileHandler } from "./ValSourceFileHandler.js";
|
|
5
5
|
import { QuickJSRuntime } from "quickjs-emscripten";
|
|
6
6
|
import ts from "typescript";
|
|
7
|
-
import { SerializedModuleContent } from "./SerializedModuleContent";
|
|
7
|
+
import { SerializedModuleContent } from "./SerializedModuleContent.js";
|
|
8
8
|
export declare const patchValFile: (id: string, valConfigPath: string, patch: Patch, sourceFileHandler: ValSourceFileHandler, runtime: QuickJSRuntime) => Promise<SerializedModuleContent>;
|
|
9
9
|
export declare const patchSourceFile: (sourceFile: ts.SourceFile, patch: Patch) => result.Result<ts.SourceFile, ValSyntaxErrorTree | PatchError>;
|
|
@@ -824,22 +824,16 @@ async function newValQuickJSRuntime(quickJSModule, moduleLoader, {
|
|
|
824
824
|
runtime.setMemoryLimit(memoryLimit);
|
|
825
825
|
runtime.setModuleLoader(modulePath => {
|
|
826
826
|
try {
|
|
827
|
-
// Special cases
|
|
827
|
+
// Special cases to avoid loading the React packages since currently React does not have a ESM build:
|
|
828
828
|
// TODO: this is not stable, find a better way to do this
|
|
829
|
-
if (modulePath === "./autoTagJSX") {
|
|
830
|
-
return {
|
|
831
|
-
value: ""
|
|
832
|
-
}; // ignore this module, it's only used in the browser
|
|
833
|
-
}
|
|
834
|
-
|
|
835
829
|
if (modulePath === "@valbuild/react") {
|
|
836
830
|
return {
|
|
837
831
|
value: "export const useVal = () => { throw Error(`Cannot use 'useVal' in this type of file`) }; export function ValProvider() { throw Error(`Cannot use 'ValProvider' in this type of file`) }; export function ValRichText() { throw Error(`Cannot use 'ValRichText' in this type of file`)};"
|
|
838
832
|
};
|
|
839
833
|
}
|
|
840
|
-
if (modulePath === "
|
|
834
|
+
if (modulePath === "@valbuild/react/stega") {
|
|
841
835
|
return {
|
|
842
|
-
value: "export
|
|
836
|
+
value: "export const useVal = () => { throw Error(`Cannot use 'useVal' in this type of file`) }; export const fetchVal = () => { throw Error(`Cannot use 'fetchVal' in this type of file`) }; export const autoTagJSX = () => { /* ignore */ };"
|
|
843
837
|
};
|
|
844
838
|
}
|
|
845
839
|
return {
|
|
@@ -847,22 +841,17 @@ async function newValQuickJSRuntime(quickJSModule, moduleLoader, {
|
|
|
847
841
|
};
|
|
848
842
|
} catch (e) {
|
|
849
843
|
return {
|
|
850
|
-
error: Error(`Could not resolve module: ${modulePath}'`)
|
|
844
|
+
error: Error(`Could not resolve module: '${modulePath}': `)
|
|
851
845
|
};
|
|
852
846
|
}
|
|
853
847
|
}, (baseModuleName, requestedName) => {
|
|
854
848
|
try {
|
|
855
|
-
if (requestedName === "./autoTagJSX") {
|
|
856
|
-
return {
|
|
857
|
-
value: requestedName
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
849
|
if (requestedName === "@valbuild/react") {
|
|
861
850
|
return {
|
|
862
851
|
value: requestedName
|
|
863
852
|
};
|
|
864
853
|
}
|
|
865
|
-
if (requestedName === "
|
|
854
|
+
if (requestedName === "@valbuild/react/stega") {
|
|
866
855
|
return {
|
|
867
856
|
value: requestedName
|
|
868
857
|
};
|
|
@@ -824,22 +824,16 @@ async function newValQuickJSRuntime(quickJSModule, moduleLoader, {
|
|
|
824
824
|
runtime.setMemoryLimit(memoryLimit);
|
|
825
825
|
runtime.setModuleLoader(modulePath => {
|
|
826
826
|
try {
|
|
827
|
-
// Special cases
|
|
827
|
+
// Special cases to avoid loading the React packages since currently React does not have a ESM build:
|
|
828
828
|
// TODO: this is not stable, find a better way to do this
|
|
829
|
-
if (modulePath === "./autoTagJSX") {
|
|
830
|
-
return {
|
|
831
|
-
value: ""
|
|
832
|
-
}; // ignore this module, it's only used in the browser
|
|
833
|
-
}
|
|
834
|
-
|
|
835
829
|
if (modulePath === "@valbuild/react") {
|
|
836
830
|
return {
|
|
837
831
|
value: "export const useVal = () => { throw Error(`Cannot use 'useVal' in this type of file`) }; export function ValProvider() { throw Error(`Cannot use 'ValProvider' in this type of file`) }; export function ValRichText() { throw Error(`Cannot use 'ValRichText' in this type of file`)};"
|
|
838
832
|
};
|
|
839
833
|
}
|
|
840
|
-
if (modulePath === "
|
|
834
|
+
if (modulePath === "@valbuild/react/stega") {
|
|
841
835
|
return {
|
|
842
|
-
value: "export
|
|
836
|
+
value: "export const useVal = () => { throw Error(`Cannot use 'useVal' in this type of file`) }; export const fetchVal = () => { throw Error(`Cannot use 'fetchVal' in this type of file`) }; export const autoTagJSX = () => { /* ignore */ };"
|
|
843
837
|
};
|
|
844
838
|
}
|
|
845
839
|
return {
|
|
@@ -847,22 +841,17 @@ async function newValQuickJSRuntime(quickJSModule, moduleLoader, {
|
|
|
847
841
|
};
|
|
848
842
|
} catch (e) {
|
|
849
843
|
return {
|
|
850
|
-
error: Error(`Could not resolve module: ${modulePath}'`)
|
|
844
|
+
error: Error(`Could not resolve module: '${modulePath}': `)
|
|
851
845
|
};
|
|
852
846
|
}
|
|
853
847
|
}, (baseModuleName, requestedName) => {
|
|
854
848
|
try {
|
|
855
|
-
if (requestedName === "./autoTagJSX") {
|
|
856
|
-
return {
|
|
857
|
-
value: requestedName
|
|
858
|
-
};
|
|
859
|
-
}
|
|
860
849
|
if (requestedName === "@valbuild/react") {
|
|
861
850
|
return {
|
|
862
851
|
value: requestedName
|
|
863
852
|
};
|
|
864
853
|
}
|
|
865
|
-
if (requestedName === "
|
|
854
|
+
if (requestedName === "@valbuild/react/stega") {
|
|
866
855
|
return {
|
|
867
856
|
value: requestedName
|
|
868
857
|
};
|
|
@@ -811,22 +811,16 @@ async function newValQuickJSRuntime(quickJSModule, moduleLoader, {
|
|
|
811
811
|
runtime.setMemoryLimit(memoryLimit);
|
|
812
812
|
runtime.setModuleLoader(modulePath => {
|
|
813
813
|
try {
|
|
814
|
-
// Special cases
|
|
814
|
+
// Special cases to avoid loading the React packages since currently React does not have a ESM build:
|
|
815
815
|
// TODO: this is not stable, find a better way to do this
|
|
816
|
-
if (modulePath === "./autoTagJSX") {
|
|
817
|
-
return {
|
|
818
|
-
value: ""
|
|
819
|
-
}; // ignore this module, it's only used in the browser
|
|
820
|
-
}
|
|
821
|
-
|
|
822
816
|
if (modulePath === "@valbuild/react") {
|
|
823
817
|
return {
|
|
824
818
|
value: "export const useVal = () => { throw Error(`Cannot use 'useVal' in this type of file`) }; export function ValProvider() { throw Error(`Cannot use 'ValProvider' in this type of file`) }; export function ValRichText() { throw Error(`Cannot use 'ValRichText' in this type of file`)};"
|
|
825
819
|
};
|
|
826
820
|
}
|
|
827
|
-
if (modulePath === "
|
|
821
|
+
if (modulePath === "@valbuild/react/stega") {
|
|
828
822
|
return {
|
|
829
|
-
value: "export
|
|
823
|
+
value: "export const useVal = () => { throw Error(`Cannot use 'useVal' in this type of file`) }; export const fetchVal = () => { throw Error(`Cannot use 'fetchVal' in this type of file`) }; export const autoTagJSX = () => { /* ignore */ };"
|
|
830
824
|
};
|
|
831
825
|
}
|
|
832
826
|
return {
|
|
@@ -834,22 +828,17 @@ async function newValQuickJSRuntime(quickJSModule, moduleLoader, {
|
|
|
834
828
|
};
|
|
835
829
|
} catch (e) {
|
|
836
830
|
return {
|
|
837
|
-
error: Error(`Could not resolve module: ${modulePath}'`)
|
|
831
|
+
error: Error(`Could not resolve module: '${modulePath}': `)
|
|
838
832
|
};
|
|
839
833
|
}
|
|
840
834
|
}, (baseModuleName, requestedName) => {
|
|
841
835
|
try {
|
|
842
|
-
if (requestedName === "./autoTagJSX") {
|
|
843
|
-
return {
|
|
844
|
-
value: requestedName
|
|
845
|
-
};
|
|
846
|
-
}
|
|
847
836
|
if (requestedName === "@valbuild/react") {
|
|
848
837
|
return {
|
|
849
838
|
value: requestedName
|
|
850
839
|
};
|
|
851
840
|
}
|
|
852
|
-
if (requestedName === "
|
|
841
|
+
if (requestedName === "@valbuild/react/stega") {
|
|
853
842
|
return {
|
|
854
843
|
value: requestedName
|
|
855
844
|
};
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"./package.json": "./package.json"
|
|
13
13
|
},
|
|
14
14
|
"types": "dist/valbuild-server.cjs.d.ts",
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.15.0",
|
|
16
16
|
"scripts": {
|
|
17
17
|
"typecheck": "tsc --noEmit",
|
|
18
18
|
"test": "jest",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"concurrently": "^7.6.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@valbuild/core": "~0.
|
|
29
|
-
"@valbuild/ui": "~0.
|
|
28
|
+
"@valbuild/core": "~0.15.0",
|
|
29
|
+
"@valbuild/ui": "~0.15.0",
|
|
30
30
|
"express": "^4.18.2",
|
|
31
31
|
"quickjs-emscripten": "^0.21.1",
|
|
32
32
|
"ts-morph": "^17.0.1",
|
package/src/ValQuickJSRuntime.ts
CHANGED
|
@@ -20,40 +20,33 @@ export async function newValQuickJSRuntime(
|
|
|
20
20
|
runtime.setModuleLoader(
|
|
21
21
|
(modulePath) => {
|
|
22
22
|
try {
|
|
23
|
-
// Special cases
|
|
23
|
+
// Special cases to avoid loading the React packages since currently React does not have a ESM build:
|
|
24
24
|
// TODO: this is not stable, find a better way to do this
|
|
25
|
-
if (modulePath === "./autoTagJSX") {
|
|
26
|
-
return { value: "" }; // ignore this module, it's only used in the browser
|
|
27
|
-
}
|
|
28
25
|
if (modulePath === "@valbuild/react") {
|
|
29
26
|
return {
|
|
30
27
|
value:
|
|
31
28
|
"export const useVal = () => { throw Error(`Cannot use 'useVal' in this type of file`) }; export function ValProvider() { throw Error(`Cannot use 'ValProvider' in this type of file`) }; export function ValRichText() { throw Error(`Cannot use 'ValRichText' in this type of file`)};",
|
|
32
29
|
};
|
|
33
30
|
}
|
|
34
|
-
|
|
35
|
-
if (modulePath === "./ValRichText") {
|
|
31
|
+
if (modulePath === "@valbuild/react/stega") {
|
|
36
32
|
return {
|
|
37
33
|
value:
|
|
38
|
-
"export
|
|
34
|
+
"export const useVal = () => { throw Error(`Cannot use 'useVal' in this type of file`) }; export const fetchVal = () => { throw Error(`Cannot use 'fetchVal' in this type of file`) }; export const autoTagJSX = () => { /* ignore */ };",
|
|
39
35
|
};
|
|
40
36
|
}
|
|
41
37
|
return { value: moduleLoader.getModule(modulePath) };
|
|
42
38
|
} catch (e) {
|
|
43
39
|
return {
|
|
44
|
-
error: Error(`Could not resolve module: ${modulePath}'`),
|
|
40
|
+
error: Error(`Could not resolve module: '${modulePath}': `),
|
|
45
41
|
};
|
|
46
42
|
}
|
|
47
43
|
},
|
|
48
44
|
(baseModuleName, requestedName): JSModuleNormalizeResult => {
|
|
49
45
|
try {
|
|
50
|
-
if (requestedName === "./autoTagJSX") {
|
|
51
|
-
return { value: requestedName };
|
|
52
|
-
}
|
|
53
46
|
if (requestedName === "@valbuild/react") {
|
|
54
47
|
return { value: requestedName };
|
|
55
48
|
}
|
|
56
|
-
if (requestedName === "
|
|
49
|
+
if (requestedName === "@valbuild/react/stega") {
|
|
57
50
|
return { value: requestedName };
|
|
58
51
|
}
|
|
59
52
|
const modulePath = moduleLoader.resolveModulePath(
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import express from "express";
|
|
2
|
-
import { Service } from "./Service";
|
|
3
|
-
import { ValServer } from "./ValServer";
|
|
4
|
-
export type LocalValServerOptions = {
|
|
5
|
-
service: Service;
|
|
6
|
-
};
|
|
7
|
-
export declare class LocalValServer implements ValServer {
|
|
8
|
-
readonly options: LocalValServerOptions;
|
|
9
|
-
constructor(options: LocalValServerOptions);
|
|
10
|
-
session(_req: express.Request, res: express.Response): Promise<void>;
|
|
11
|
-
getIds(req: express.Request<{
|
|
12
|
-
0: string;
|
|
13
|
-
}>, res: express.Response): Promise<void>;
|
|
14
|
-
patchIds(req: express.Request<{
|
|
15
|
-
0: string;
|
|
16
|
-
}>, res: express.Response): Promise<void>;
|
|
17
|
-
private badRequest;
|
|
18
|
-
commit(req: express.Request, res: express.Response): Promise<void>;
|
|
19
|
-
authorize(req: express.Request, res: express.Response): Promise<void>;
|
|
20
|
-
callback(req: express.Request, res: express.Response): Promise<void>;
|
|
21
|
-
logout(req: express.Request, res: express.Response): Promise<void>;
|
|
22
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import express from "express";
|
|
2
|
-
import { ValServer } from "./ValServer";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
export type ProxyValServerOptions = {
|
|
5
|
-
apiKey: string;
|
|
6
|
-
route: string;
|
|
7
|
-
valSecret: string;
|
|
8
|
-
valBuildUrl: string;
|
|
9
|
-
gitCommit: string;
|
|
10
|
-
gitBranch: string;
|
|
11
|
-
};
|
|
12
|
-
export declare class ProxyValServer implements ValServer {
|
|
13
|
-
readonly options: ProxyValServerOptions;
|
|
14
|
-
constructor(options: ProxyValServerOptions);
|
|
15
|
-
authorize(req: express.Request, res: express.Response): Promise<void>;
|
|
16
|
-
callback(req: express.Request, res: express.Response): Promise<void>;
|
|
17
|
-
logout(_req: express.Request, res: express.Response): Promise<void>;
|
|
18
|
-
withAuth<T>(req: express.Request, res: express.Response, handler: (data: IntegratedServerJwtPayload) => Promise<T>): Promise<T | undefined>;
|
|
19
|
-
session(req: express.Request, res: express.Response): Promise<void>;
|
|
20
|
-
getIds(req: express.Request<{
|
|
21
|
-
0: string;
|
|
22
|
-
}>, res: express.Response): Promise<void>;
|
|
23
|
-
patchIds(req: express.Request<{
|
|
24
|
-
0: string;
|
|
25
|
-
}>, res: express.Response): Promise<void>;
|
|
26
|
-
commit(req: express.Request, res: express.Response): Promise<void>;
|
|
27
|
-
private getAuthHeaders;
|
|
28
|
-
private consumeCode;
|
|
29
|
-
private getAuthorizeUrl;
|
|
30
|
-
private getAppErrorUrl;
|
|
31
|
-
}
|
|
32
|
-
declare const IntegratedServerJwtPayload: z.ZodObject<{
|
|
33
|
-
sub: z.ZodString;
|
|
34
|
-
exp: z.ZodNumber;
|
|
35
|
-
token: z.ZodString;
|
|
36
|
-
org: z.ZodString;
|
|
37
|
-
project: z.ZodString;
|
|
38
|
-
}, "strip", z.ZodTypeAny, {
|
|
39
|
-
project: string;
|
|
40
|
-
sub: string;
|
|
41
|
-
exp: number;
|
|
42
|
-
token: string;
|
|
43
|
-
org: string;
|
|
44
|
-
}, {
|
|
45
|
-
project: string;
|
|
46
|
-
sub: string;
|
|
47
|
-
exp: number;
|
|
48
|
-
token: string;
|
|
49
|
-
org: string;
|
|
50
|
-
}>;
|
|
51
|
-
export type IntegratedServerJwtPayload = z.infer<typeof IntegratedServerJwtPayload>;
|
|
52
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { QuickJSWASMModule } from "quickjs-emscripten";
|
|
2
|
-
import { ValModuleLoader } from "./ValModuleLoader";
|
|
3
|
-
export declare function newValQuickJSRuntime(quickJSModule: Pick<QuickJSWASMModule, "newRuntime">, moduleLoader: ValModuleLoader, { maxStackSize, // TODO: these were randomly chosen, we should figure out what the right values are:
|
|
4
|
-
memoryLimit, }?: {
|
|
5
|
-
maxStackSize?: number;
|
|
6
|
-
memoryLimit?: number;
|
|
7
|
-
}): Promise<import("quickjs-emscripten").QuickJSRuntime>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { result, array } from "@valbuild/core/fp";
|
|
3
|
-
import { ValSyntaxErrorTree } from "./syntax";
|
|
4
|
-
import { Ops, PatchError, JSONValue } from "@valbuild/core/patch";
|
|
5
|
-
type TSOpsResult<T> = result.Result<T, PatchError | ValSyntaxErrorTree>;
|
|
6
|
-
declare module "typescript" {
|
|
7
|
-
interface PrinterOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Internal option that stops printing unnecessary ASCII escape sequences
|
|
10
|
-
* in strings, though it might have unintended effects. Might be useful?
|
|
11
|
-
*/
|
|
12
|
-
neverAsciiEscape?: boolean;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
export declare function getFromNode(node: ts.Expression, key: string): TSOpsResult<ts.Expression | undefined>;
|
|
16
|
-
export declare class TSOps implements Ops<ts.SourceFile, ValSyntaxErrorTree> {
|
|
17
|
-
private findRoot;
|
|
18
|
-
constructor(findRoot: (document: ts.SourceFile) => result.Result<ts.Expression, ValSyntaxErrorTree>);
|
|
19
|
-
get(document: ts.SourceFile, path: string[]): TSOpsResult<JSONValue>;
|
|
20
|
-
add(document: ts.SourceFile, path: string[], value: JSONValue): TSOpsResult<ts.SourceFile>;
|
|
21
|
-
remove(document: ts.SourceFile, path: array.NonEmptyArray<string>): TSOpsResult<ts.SourceFile>;
|
|
22
|
-
replace(document: ts.SourceFile, path: string[], value: JSONValue): TSOpsResult<ts.SourceFile>;
|
|
23
|
-
move(document: ts.SourceFile, from: array.NonEmptyArray<string>, path: string[]): TSOpsResult<ts.SourceFile>;
|
|
24
|
-
copy(document: ts.SourceFile, from: string[], path: string[]): TSOpsResult<ts.SourceFile>;
|
|
25
|
-
test(document: ts.SourceFile, path: string[], value: JSONValue): TSOpsResult<boolean>;
|
|
26
|
-
}
|
|
27
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import ts from "typescript";
|
|
2
|
-
import { result } from "@valbuild/core/fp";
|
|
3
|
-
import { ValSyntaxErrorTree } from "./syntax";
|
|
4
|
-
export type ValModuleAnalysis = {
|
|
5
|
-
schema: ts.Expression;
|
|
6
|
-
source: ts.Expression;
|
|
7
|
-
};
|
|
8
|
-
export declare function analyzeValModule(sourceFile: ts.SourceFile): result.Result<ValModuleAnalysis, ValSyntaxErrorTree>;
|