Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(query): update exports #2455

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/config/src/exports/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External exports.
*
* Be sure you're ready to commit to these being supported and changes made backward compatible!
* Be sure we're ready to commit to these being supported and changes made backward compatible!
*/

export type { AbiType, StaticAbiType, DynamicAbiType, Schema, Table } from "../common";
2 changes: 1 addition & 1 deletion packages/protocol-parser/src/exports/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* External exports.
*
* Be sure you're ready to commit to these being supported and changes made backward compatible!
* Be sure we're ready to commit to these being supported and changes made backward compatible!
*/
8 changes: 6 additions & 2 deletions packages/query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
"license": "MIT",
"type": "module",
"exports": {
".": "./dist/index.js"
".": "./dist/index.js",
"./internal": "./dist/internal.js"
},
"typesVersions": {
"*": {
"index": [
"./src/index.ts"
"./src/exports/index.ts"
],
"internal": [
"./src/exports/internal.ts"
]
}
},
Expand Down
22 changes: 22 additions & 0 deletions packages/query/src/exports/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* External exports.
*
* Be sure we're ready to commit to these being supported and changes made backward compatible!
*/

export type {
Query,
QueryCondition,
QuerySubject,
QueryTable,
ConditionLiteral,
InCondition,
ComparisonCondition,
ResultRecord,
Subject,
SubjectSchema,
SubjectRecord,
SubjectRecords,
SubjectEvent,
Result,
} from "../api";
3 changes: 3 additions & 0 deletions packages/query/src/exports/internal.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export * from "../common";
export * from "../findSubjects";
export * from "../matchRecords";
5 changes: 4 additions & 1 deletion packages/query/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { defineConfig } from "tsup";

export default defineConfig({
entry: ["src/index.ts"],
entry: {
index: "src/exports/index.ts",
internal: "src/exports/internal.ts",
},
target: "esnext",
format: ["esm"],
dts: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/schema-type/src/typescript/exports/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* External exports.
*
* Be sure you're ready to commit to these being supported and changes made backward compatible!
* Be sure we're ready to commit to these being supported and changes made backward compatible!
*/
3 changes: 2 additions & 1 deletion packages/store-sync/src/query-cache/query.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Query } from "./common";
import { QueryCacheStore, extractTables } from "./createStore";
import { SubjectRecords, findSubjects } from "@latticexyz/query";
import { SubjectRecords } from "@latticexyz/query";
import { findSubjects } from "@latticexyz/query/internal";
import { queryToWire } from "./queryToWire";

// TODO: take in query input type so we can narrow result types
Expand Down
3 changes: 2 additions & 1 deletion packages/store-sync/src/query-cache/subscribeToQuery.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Observable, map, scan } from "rxjs";
import { SubjectEvent, SubjectRecord, SubjectRecords, findSubjects } from "@latticexyz/query";
import { SubjectEvent, SubjectRecord, SubjectRecords } from "@latticexyz/query";
import { findSubjects } from "@latticexyz/query/internal";
import { Query } from "./common";
import { QueryCacheStore, extractTables } from "./createStore";
import { queryToWire } from "./queryToWire";
Expand Down
Loading