@goodbones/typescript 0.1.0-beta.1 → 0.1.0-beta.10
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/build/dts/extractor.d.ts +28 -1
- package/build/dts/extractor.d.ts.map +1 -1
- package/build/dts/index.d.ts +6 -3
- package/build/dts/index.d.ts.map +1 -1
- package/build/esm/extractor.js +353 -220
- package/build/esm/extractor.js.map +1 -1
- package/build/esm/index.js +7 -2
- package/build/esm/index.js.map +1 -1
- package/package.json +4 -4
- package/src/extractor.ts +465 -218
- package/src/index.ts +27 -3
package/build/dts/extractor.d.ts
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
import type { FactExtractor, SourceFacts } from "@goodbones/core";
|
|
1
|
+
import type { Binding, ExportSite, FactExtractor, MemberSite, SourceFacts } from "@goodbones/core";
|
|
2
|
+
import { type Node, type Program } from "oxc-parser";
|
|
3
|
+
export type SyntaxNode = Node;
|
|
4
|
+
export type EdgeForm = "import" | "export" | "import-equals" | "import-expression" | "require";
|
|
5
|
+
export type ReadBinding = Binding & {
|
|
6
|
+
readonly node: SyntaxNode;
|
|
7
|
+
readonly local: string;
|
|
8
|
+
};
|
|
9
|
+
export type ReadEdge = {
|
|
10
|
+
readonly specifier: string;
|
|
11
|
+
readonly form: EdgeForm;
|
|
12
|
+
readonly node: SyntaxNode;
|
|
13
|
+
readonly bindings: ReadonlyArray<ReadBinding>;
|
|
14
|
+
};
|
|
15
|
+
export type ReadMemberSite = MemberSite & {
|
|
16
|
+
readonly node: SyntaxNode;
|
|
17
|
+
};
|
|
18
|
+
export type ReadExportSite = ExportSite & {
|
|
19
|
+
readonly node: SyntaxNode;
|
|
20
|
+
};
|
|
21
|
+
export type ReadFacts = {
|
|
22
|
+
readonly edges: ReadonlyArray<ReadEdge>;
|
|
23
|
+
readonly memberSites: ReadonlyArray<ReadMemberSite>;
|
|
24
|
+
readonly exportSites: ReadonlyArray<ReadExportSite>;
|
|
25
|
+
};
|
|
26
|
+
export type ProgramBody = Pick<Program, "body">;
|
|
27
|
+
export declare const readProgram: (file: string, program: ProgramBody) => ReadFacts;
|
|
28
|
+
export declare const sourceFactsOf: (read: ReadFacts) => SourceFacts;
|
|
2
29
|
export declare const factsOfText: (file: string, text: string) => SourceFacts;
|
|
3
30
|
export declare const makeFactExtractorLive: () => FactExtractor;
|
|
4
31
|
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../src/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../src/extractor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EAEP,UAAU,EACV,aAAa,EACb,UAAU,EACV,WAAW,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAaL,KAAK,IAAI,EAGT,KAAK,OAAO,EASb,MAAM,YAAY,CAAC;AAYpB,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC;AAI9B,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,eAAe,GAAG,mBAAmB,GAAG,SAAS,CAAC;AAI/F,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAI1F,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AACxE,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAExE,MAAM,MAAM,SAAS,GAAG;IACtB,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACxC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IACpD,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;CACrD,CAAC;AA6QF,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AA6GhD,eAAO,MAAM,WAAW,SAAU,MAAM,WAAW,WAAW,KAAG,SAkBhE,CAAC;AAyBF,eAAO,MAAM,aAAa,SAAU,SAAS,KAAG,WAuB/C,CAAC;AAQF,eAAO,MAAM,WAAW,SAAU,MAAM,QAAQ,MAAM,KAAG,WAGxD,CAAC;AAEF,eAAO,MAAM,qBAAqB,QAAO,aAA2C,CAAC"}
|
package/build/dts/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type { Language } from "@goodbones/core";
|
|
2
|
-
export { factsOfText, makeFactExtractorLive } from "./extractor.js";
|
|
1
|
+
import type { Language, SyntaxMatcher } from "@goodbones/core";
|
|
2
|
+
export { type EdgeForm, factsOfText, makeFactExtractorLive, type ProgramBody, type ReadBinding, type ReadEdge, type ReadExportSite, type ReadFacts, type ReadMemberSite, readProgram, sourceFactsOf, type SyntaxNode, } from "./extractor.js";
|
|
3
3
|
export { npmPackageOf } from "./npm-package.js";
|
|
4
4
|
export { decodeTypescriptScopeOptions, type TypescriptScopeOptions } from "./options.js";
|
|
5
5
|
export { makeModuleResolverLive, TYPESCRIPT } from "./resolver.js";
|
|
6
|
-
export
|
|
6
|
+
export type TypescriptLanguageOptions = {
|
|
7
|
+
readonly syntax?: SyntaxMatcher | undefined;
|
|
8
|
+
};
|
|
9
|
+
export declare const typescriptLanguage: (options?: TypescriptLanguageOptions) => Language;
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
package/build/dts/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAK/D,OAAO,EACL,KAAK,QAAQ,EACb,WAAW,EACX,qBAAqB,EACrB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,QAAQ,EACb,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,cAAc,EACnB,WAAW,EACX,aAAa,EACb,KAAK,UAAU,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,4BAA4B,EAAE,KAAK,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACzF,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAEnE,MAAM,MAAM,yBAAyB,GAAG;IAGtC,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CAC7C,CAAC;AAMF,eAAO,MAAM,kBAAkB,aAAa,yBAAyB,KAAQ,QAc3E,CAAC"}
|