Skip to content

Commit

Permalink
Merge pull request #4 from caido/ef-nodenext
Browse files Browse the repository at this point in the history
Move to nodenext
  • Loading branch information
Sytten authored Apr 4, 2024
2 parents c4da3cc + feb2072 commit fef1443
Show file tree
Hide file tree
Showing 21 changed files with 84 additions and 84 deletions.
8 changes: 4 additions & 4 deletions js/src/deserialize/expr.int.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { SyntaxNode } from "@lezer/common";
import { err, ok, type Result } from "neverthrow";

import { type HTTPQLError, InvalidQuery } from "../errors";
import { terms } from "../parser";
import { type ExprInt, OperatorInt } from "../primitives";
import { getChildString, isPresent } from "../utils";
import { type HTTPQLError, InvalidQuery } from "../errors.js";
import { terms } from "../parser/index.js";
import { type ExprInt, OperatorInt } from "../primitives.js";
import { getChildString, isPresent } from "../utils.js";

export const deserializeIntExpr = (
node: SyntaxNode,
Expand Down
10 changes: 5 additions & 5 deletions js/src/deserialize/expr.string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import type { SyntaxNode } from "@lezer/common";
import { err } from "neverthrow";
import type { Result } from "neverthrow";

import { type HTTPQLError, InvalidQuery } from "../errors";
import { terms } from "../parser";
import { type ExprString, OperatorString } from "../primitives";
import { getChildString, isAbsent, isPresent } from "../utils";
import { type HTTPQLError, InvalidQuery } from "../errors.js";
import { terms } from "../parser/index.js";
import { type ExprString, OperatorString } from "../primitives.js";
import { getChildString, isAbsent, isPresent } from "../utils.js";

import { deserializeString } from "./string";
import { deserializeString } from "./string.js";

export const deserializeStringExpr = (
node: SyntaxNode,
Expand Down
4 changes: 2 additions & 2 deletions js/src/deserialize/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, expect, it } from "vitest";

import { OperatorInt, OperatorString, type Preset } from "../primitives";
import { OperatorInt, OperatorString, type Preset } from "../primitives.js";

import { deserialize } from "./index";
import { deserialize } from "./index.js";

const BACKSLASH = "\\";

Expand Down
10 changes: 5 additions & 5 deletions js/src/deserialize/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { err, ok } from "neverthrow";
import type { Result } from "neverthrow";

import { type HTTPQLError, InvalidQuery } from "../errors";
import { parser, terms } from "../parser";
import type { Options, Query } from "../primitives";
import { isAbsent } from "../utils";
import { type HTTPQLError, InvalidQuery } from "../errors.js";
import { parser, terms } from "../parser/index.js";
import type { Options, Query } from "../primitives.js";
import { isAbsent } from "../utils.js";

import { deserializeQuery } from "./query";
import { deserializeQuery } from "./query.js";

export const deserialize = (
doc: string,
Expand Down
8 changes: 4 additions & 4 deletions js/src/deserialize/query.combined.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { SyntaxNode } from "@lezer/common";
import { err, Result } from "neverthrow";

import { type HTTPQLError, InvalidQuery } from "../errors";
import { terms } from "../parser";
import type { Options, Query } from "../primitives";
import { type HTTPQLError, InvalidQuery } from "../errors.js";
import { terms } from "../parser/index.js";
import type { Options, Query } from "../primitives.js";

import { deserializeQuery } from "./query";
import { deserializeQuery } from "./query.js";

export const deserializeCombinedQuery = (
node: SyntaxNode,
Expand Down
10 changes: 5 additions & 5 deletions js/src/deserialize/query.group.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { SyntaxNode } from "@lezer/common";
import { ok, type Result } from "neverthrow";

import type { HTTPQLError } from "../errors";
import { terms } from "../parser";
import type { Options, Query } from "../primitives";
import { isPresent } from "../utils";
import type { HTTPQLError } from "../errors.js";
import { terms } from "../parser/index.js";
import type { Options, Query } from "../primitives.js";
import { isPresent } from "../utils.js";

import { deserializeQuery } from "./query";
import { deserializeQuery } from "./query.js";

export const deserializeGroupQuery = (
node: SyntaxNode,
Expand Down
12 changes: 6 additions & 6 deletions js/src/deserialize/query.preset.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { SyntaxNode } from "@lezer/common";
import { err, ok, type Result } from "neverthrow";

import { type HTTPQLError, InvalidQuery } from "../errors";
import { terms } from "../parser";
import type { ExprPreset, Options } from "../primitives";
import { ExprPresetSource } from "../primitives";
import { getChildString, isPresent } from "../utils";
import { type HTTPQLError, InvalidQuery } from "../errors.js";
import { terms } from "../parser/index.js";
import type { ExprPreset, Options } from "../primitives.js";
import { ExprPresetSource } from "../primitives.js";
import { getChildString, isPresent } from "../utils.js";

import { deserializeString } from "./string";
import { deserializeString } from "./string.js";

export const deserializePresetQuery = (
node: SyntaxNode,
Expand Down
12 changes: 6 additions & 6 deletions js/src/deserialize/query.request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import type { SyntaxNode } from "@lezer/common";
import { err } from "neverthrow";
import type { Result } from "neverthrow";

import { type HTTPQLError, InvalidQuery } from "../errors";
import { terms } from "../parser";
import type { ClauseRequest } from "../primitives";
import { getChildString, isPresent } from "../utils";
import { type HTTPQLError, InvalidQuery } from "../errors.js";
import { terms } from "../parser/index.js";
import type { ClauseRequest } from "../primitives.js";
import { getChildString, isPresent } from "../utils.js";

import { deserializeIntExpr } from "./expr.int";
import { deserializeStringExpr } from "./expr.string";
import { deserializeIntExpr } from "./expr.int.js";
import { deserializeStringExpr } from "./expr.string.js";

export const deserializeRequestQuery = (
node: SyntaxNode,
Expand Down
12 changes: 6 additions & 6 deletions js/src/deserialize/query.response.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { SyntaxNode } from "@lezer/common";
import { err, type Result } from "neverthrow";

import { type HTTPQLError, InvalidQuery } from "../errors";
import { terms } from "../parser";
import type { ClauseResponse } from "../primitives";
import { getChildString, isPresent } from "../utils";
import { type HTTPQLError, InvalidQuery } from "../errors.js";
import { terms } from "../parser/index.js";
import type { ClauseResponse } from "../primitives.js";
import { getChildString, isPresent } from "../utils.js";

import { deserializeIntExpr } from "./expr.int";
import { deserializeStringExpr } from "./expr.string";
import { deserializeIntExpr } from "./expr.int.js";
import { deserializeStringExpr } from "./expr.string.js";

export const deserializeResponseQuery = (
node: SyntaxNode,
Expand Down
14 changes: 7 additions & 7 deletions js/src/deserialize/query.single.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { SyntaxNode } from "@lezer/common";
import { err, type Result } from "neverthrow";

import { type HTTPQLError, InvalidQuery } from "../errors";
import { terms } from "../parser";
import type { Options, Query } from "../primitives";
import { isPresent } from "../utils";
import { type HTTPQLError, InvalidQuery } from "../errors.js";
import { terms } from "../parser/index.js";
import type { Options, Query } from "../primitives.js";
import { isPresent } from "../utils.js";

import { deserializePresetQuery } from "./query.preset";
import { deserializeRequestQuery } from "./query.request";
import { deserializeResponseQuery } from "./query.response";
import { deserializePresetQuery } from "./query.preset.js";
import { deserializeRequestQuery } from "./query.request.js";
import { deserializeResponseQuery } from "./query.response.js";

export const deserializeSingleQuery = (
node: SyntaxNode,
Expand Down
6 changes: 3 additions & 3 deletions js/src/deserialize/query.string.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { SyntaxNode } from "@lezer/common";
import type { Result } from "neverthrow";

import { type HTTPQLError } from "../errors";
import { OperatorString, type Query } from "../primitives";
import { type HTTPQLError } from "../errors.js";
import { OperatorString, type Query } from "../primitives.js";

import { deserializeString } from "./string";
import { deserializeString } from "./string.js";

export const deserializeStringQuery = (
node: SyntaxNode,
Expand Down
16 changes: 8 additions & 8 deletions js/src/deserialize/query.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { SyntaxNode } from "@lezer/common";
import { ok, type Result } from "neverthrow";

import type { HTTPQLError } from "../errors";
import { terms } from "../parser";
import type { Options, Query } from "../primitives";
import { isPresent } from "../utils";
import type { HTTPQLError } from "../errors.js";
import { terms } from "../parser/index.js";
import type { Options, Query } from "../primitives.js";
import { isPresent } from "../utils.js";

import { deserializeCombinedQuery } from "./query.combined";
import { deserializeGroupQuery } from "./query.group";
import { deserializeSingleQuery } from "./query.single";
import { deserializeStringQuery } from "./query.string";
import { deserializeCombinedQuery } from "./query.combined.js";
import { deserializeGroupQuery } from "./query.group.js";
import { deserializeSingleQuery } from "./query.single.js";
import { deserializeStringQuery } from "./query.string.js";

export const deserializeQuery = (
node: SyntaxNode,
Expand Down
6 changes: 3 additions & 3 deletions js/src/deserialize/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { SyntaxNode } from "@lezer/common";
import { err, ok } from "neverthrow";
import type { Result } from "neverthrow";

import { type HTTPQLError, InvalidQuery } from "../errors";
import { terms } from "../parser";
import { getChildString, isAbsent } from "../utils";
import { type HTTPQLError, InvalidQuery } from "../errors.js";
import { terms } from "../parser/index.js";
import { getChildString, isAbsent } from "../utils.js";

export const deserializeString = (
node: SyntaxNode,
Expand Down
4 changes: 2 additions & 2 deletions js/src/errors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Maybe } from "./primitives";
import { isPresent } from "./utils";
import type { Maybe } from "./primitives.js";
import { isPresent } from "./utils.js";

export class HTTPQLError extends Error {
source: Maybe<Error>;
Expand Down
4 changes: 2 additions & 2 deletions js/src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import * as fs from "fs";

import { describe, expect, it } from "vitest";

import type { Options } from "./primitives";
import type { Options } from "./primitives.js";

import { deserialize, serialize } from "./index";
import { deserialize, serialize } from "./index.js";

describe("httpql", () => {
const cases = [1, 2, 3, 4, 5];
Expand Down
8 changes: 4 additions & 4 deletions js/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from "./primitives";
export { deserialize } from "./deserialize";
export { parser, terms } from "./parser";
export { serialize } from "./serialize";
export * from "./primitives.js";
export { deserialize } from "./deserialize/index.js";
export { parser, terms } from "./parser/index.js";
export { serialize } from "./serialize.js";
4 changes: 2 additions & 2 deletions js/src/parser/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./parser";
export * as terms from "./parser.terms";
export * from "./parser.js";
export * as terms from "./parser.terms.js";
6 changes: 3 additions & 3 deletions js/src/parser/parser.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { describe, expect, it } from "vitest";

import { getString } from "../utils";
import { getString } from "../utils.js";

import { parser } from "./parser";
import { parser } from "./parser.js";
import {
And,
CombinedQuery,
Expand All @@ -13,7 +13,7 @@ import {
RequestQuery,
SingleQuery,
StringValue,
} from "./parser.terms";
} from "./parser.terms.js";

describe("parser", () => {
it("Should parse single query", () => {
Expand Down
2 changes: 1 addition & 1 deletion js/src/parser/parser.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This file was generated by lezer-generator. You probably shouldn't edit it.
import { LocalTokenGroup, LRParser } from "@lezer/lr";

import { highlight } from "./props";
import { highlight } from "./props.js";
export const parser = LRParser.deserialize({
version: 14,
states:
Expand Down
8 changes: 4 additions & 4 deletions js/src/serialize.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { err, ok, Result } from "neverthrow";

import { type HTTPQLError, InvalidQuery, MissingPreset } from "./errors";
import { type HTTPQLError, InvalidQuery, MissingPreset } from "./errors.js";
import type {
ClauseRequest,
ClauseResponse,
Expand All @@ -9,9 +9,9 @@ import type {
ExprString,
Options,
Query,
} from "./primitives";
import { ExprPresetSource } from "./primitives";
import { isAbsent, isPresent } from "./utils";
} from "./primitives.js";
import { ExprPresetSource } from "./primitives.js";
import { isAbsent, isPresent } from "./utils.js";

export const serialize = (
query: Query,
Expand Down
4 changes: 2 additions & 2 deletions js/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"module": "NodeNext",

"noImplicitAny": true,
"noUncheckedIndexedAccess": true,
Expand All @@ -10,7 +10,7 @@
"resolveJsonModule": true,
"noUnusedLocals": true,

"moduleResolution": "node",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"sourceMap": true,
"useDefineForClassFields": true,
Expand Down

0 comments on commit fef1443

Please sign in to comment.