Skip to content
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
8 changes: 8 additions & 0 deletions .changeset/loud-signs-wear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@getlang/parser": patch
"@getlang/utils": patch
"@getlang/get": patch
"@getlang/lib": patch
---

upgrade deps
15 changes: 11 additions & 4 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"include": ["packages/**/*", "test/**/*"],
"ignore": ["packages/parser/src/grammar.ts"]
"includes": [
"packages/**/*",
"test/**/*",
"!packages/parser/src/grammar.ts"
]
},
"organizeImports": {
"enabled": true
"assist": {
"actions": {
"source": {
"organizeImports": "on"
}
}
},
"formatter": {
"enabled": true,
Expand Down
Binary file modified bun.lockb
Binary file not shown.
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "get",
"license": "Apache-2.0",
"private": true,
"packageManager": "[email protected].2",
"packageManager": "[email protected].20",
"scripts": {
"fmt": "biome check --write",
"lint": "bun lint:check && bun lint:types && bun lint:unused && bun lint:repo",
Expand All @@ -18,12 +18,12 @@
"test"
],
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.27.12",
"@types/bun": "^1.2.2",
"knip": "^5.43.6",
"sherif": "^1.2.0",
"typescript": "^5.7.3"
"@biomejs/biome": "^2.1.4",
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.5",
"@types/bun": "^1.2.20",
"knip": "^5.62.0",
"sherif": "^1.6.1",
"typescript": "^5.9.2"
}
}
6 changes: 3 additions & 3 deletions packages/get/src/execute.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { http, cookies, headers, html, js, json } from '@getlang/lib'
import { cookies, headers, html, http, js, json } from '@getlang/lib'
import type { CExpr, Expr, Program, Stmt } from '@getlang/parser/ast'
import { NodeKind, isToken } from '@getlang/parser/ast'
import { isToken, NodeKind } from '@getlang/parser/ast'
import { RootScope } from '@getlang/parser/scope'
import type { TypeInfo } from '@getlang/parser/typeinfo'
import { Type } from '@getlang/parser/typeinfo'
import { type AsyncInterpretVisitor, visit } from '@getlang/parser/visitor'
import type { Hooks, MaybePromise } from '@getlang/utils'
import {
ImportError,
invariant,
NullInputError,
NullSelection,
NullSelectionError,
QuerySyntaxError,
SliceError,
ValueReferenceError,
invariant,
} from '@getlang/utils'
import { mapValues } from 'lodash-es'

Expand Down
2 changes: 1 addition & 1 deletion packages/get/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { desugar, parse } from '@getlang/parser'
import type { Program } from '@getlang/parser/ast'
import type { UserHooks } from '@getlang/utils'
import { ImportError, invariant, wait } from '@getlang/utils'
import { Modules, execute as exec } from './execute.js'
import type { InternalHooks } from './execute.js'
import { execute as exec, Modules } from './execute.js'

function buildHooks(hooks: UserHooks = {}): InternalHooks {
return {
Expand Down
2 changes: 1 addition & 1 deletion packages/get/src/test.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ interface MyCustomMatchers {
headers(headers: globalThis.Headers): any
}
declare module 'bun:test' {
interface Matchers<T> extends MyCustomMatchers {}
interface Matchers extends MyCustomMatchers {}
interface AsymmetricMatchers extends MyCustomMatchers {}
}
10 changes: 5 additions & 5 deletions packages/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
"@types/esquery": "^1.5.4",
"@types/lodash-es": "^4.17.12",
"@types/set-cookie-parser": "^2.4.10",
"acorn": "^8.14.0",
"css-select": "^5.1.0",
"css-what": "^6.1.0",
"acorn": "^8.15.0",
"css-select": "^6.0.0",
"css-what": "^7.0.0",
"dom-serializer": "^2.0.0",
"domelementtype": "*",
"domhandler": "^5.0.3",
"domutils": "^3.2.2",
"esquery": "^1.6.0",
"lodash-es": "^4.17.21",
"parse5": "^7.2.1",
"parse5-htmlparser2-tree-adapter": "^7.1.0",
"parse5": "^8.0.0",
"parse5-htmlparser2-tree-adapter": "^8.0.0",
"set-cookie-parser": "^2.7.1"
}
}
6 changes: 3 additions & 3 deletions packages/lib/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export * as http from './net/http.js'
export * as cookies from './values/cookies.js'
export * as headers from './values/headers.js'
export * as html from './values/html.js'
export * as json from './values/json.js'
export * as js from './values/js.js'
export * as headers from './values/headers.js'
export * as cookies from './values/cookies.js'
export * as json from './values/json.js'

function runSlice(slice: string, context: unknown = {}, raw: unknown = {}) {
return new Function('$', '$$', slice)(context, raw)
Expand Down
2 changes: 1 addition & 1 deletion packages/lib/src/values/cookies.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NullSelection, QuerySyntaxError, invariant } from '@getlang/utils'
import { invariant, NullSelection, QuerySyntaxError } from '@getlang/utils'
import { mapValues } from 'lodash-es'
import * as scp from 'set-cookie-parser'

Expand Down
2 changes: 1 addition & 1 deletion packages/lib/src/values/html.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/// <reference types="./html/types.d.ts" />

import {
invariant,
NullSelection,
NullSelectionError,
SelectorSyntaxError,
invariant,
} from '@getlang/utils'
import xpath from '@getlang/xpath'
import { selectAll, selectOne } from 'css-select'
Expand Down
4 changes: 2 additions & 2 deletions packages/lib/src/values/js.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
ConversionError,
invariant,
NullSelection,
SelectorSyntaxError,
SliceSyntaxError,
invariant,
} from '@getlang/utils'
import { parse as acorn } from 'acorn'
import type { AnyNode } from 'acorn'
import { parse as acorn } from 'acorn'
import esquery from 'esquery'

export const parse = (js: string): AnyNode => {
Expand Down
6 changes: 3 additions & 3 deletions packages/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"@getlang/utils": "workspace:^0.1.6",
"@types/moo": "^0.5.10",
"@types/nearley": "^2.11.5",
"acorn": "^8.14.0",
"acorn": "^8.15.0",
"acorn-globals": "^7.0.1",
"globals": "^15.14.0",
"globals": "^16.3.0",
"lodash-es": "^4.17.21",
"moo": "^0.5.2",
"nearley": "^2.20.1",
"prettier": "^3.4.2"
"prettier": "^3.6.2"
},
"devDependencies": {
"@types/lodash-es": "^4.17.12"
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/ast/print.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { builders, printer } from 'prettier/doc'
import type { InterpretVisitor } from '../visitor/visitor.js'
import { visit } from '../visitor/visitor.js'
import type { Node } from './ast.js'
import { NodeKind, isToken } from './ast.js'
import { isToken, NodeKind } from './ast.js'

type Doc = builders.Doc

Expand Down
3 changes: 1 addition & 2 deletions packages/parser/src/ast/scope.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ValueReferenceError, invariant } from '@getlang/utils'
import { invariant, ValueReferenceError } from '@getlang/utils'

export class Scope<T> {
vars: Record<string, T>
Expand Down Expand Up @@ -45,7 +45,6 @@ export class RootScope<T> {
if (this.context) {
this.vars[''] = this.context
} else {
// biome-ignore lint/performance/noDelete: remove shadow value
delete this.vars['']
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/desugar/inference/context.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QuerySyntaxError, invariant } from '@getlang/utils'
import { invariant, QuerySyntaxError } from '@getlang/utils'
import type { CExpr, Expr } from '../../ast/ast.js'
import { NodeKind } from '../../ast/ast.js'
import { RootScope } from '../../ast/scope.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/desugar/inference/links.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
invariant,
QuerySyntaxError,
ValueReferenceError,
invariant,
} from '@getlang/utils'
import type { Expr, RequestExpr } from '../../ast/ast.js'
import { NodeKind, t } from '../../ast/ast.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/desugar/inference/slicedeps.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// <reference types="./acorn-globals.d.ts" />

import { SliceSyntaxError, invariant } from '@getlang/utils'
import { invariant, SliceSyntaxError } from '@getlang/utils'
import { type Program, parse } from 'acorn'
import detect from 'acorn-globals'
import globals from 'globals'
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/desugar/inference/typeinfo.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
invariant,
QuerySyntaxError,
ValueReferenceError,
invariant,
} from '@getlang/utils'
import { type CExpr, type Expr, NodeKind, t } from '../../ast/ast.js'
import { RootScope } from '../../ast/scope.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/desugar/reqparse.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QuerySyntaxError, invariant } from '@getlang/utils'
import { invariant, QuerySyntaxError } from '@getlang/utils'
import type { Expr, RequestExpr, Stmt } from '../ast/ast.js'
import { NodeKind, t } from '../ast/ast.js'
import { getContentField, tx } from './utils.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/desugar/simplified.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QuerySyntaxError, invariant } from '@getlang/utils'
import { invariant, QuerySyntaxError } from '@getlang/utils'
import type { Program } from '../ast/ast.js'
import { NodeKind } from '../ast/ast.js'
import { visit } from '../visitor/visitor.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/desugar/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { toPath } from 'lodash-es'
import type { Expr, RequestExpr } from '../ast/ast.js'
import { NodeKind, isToken, t } from '../ast/ast.js'
import { isToken, NodeKind, t } from '../ast/ast.js'
import type { Struct, TypeInfo } from '../ast/typeinfo.js'
import { Type } from '../ast/typeinfo.js'

Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/grammar/lex/slice.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { QuerySyntaxError, invariant } from '@getlang/utils'
import { invariant, QuerySyntaxError } from '@getlang/utils'
import { until } from './templates.js'

const getSliceValue = (text: string, places = 1) => {
Expand Down
4 changes: 2 additions & 2 deletions packages/parser/src/grammar/parse.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { QuerySyntaxError, invariant } from '@getlang/utils'
import { NodeKind, isToken, t } from '../ast/ast.js'
import { invariant, QuerySyntaxError } from '@getlang/utils'
import { isToken, NodeKind, t } from '../ast/ast.js'
import { tx } from '../desugar/utils.js'

type PP = nearley.Postprocessor
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { QuerySyntaxError } from '@getlang/utils'
import nearley from 'nearley'
import type { Program } from './ast/ast.js'
import grammar from './grammar.js'
import lexer from './grammar/lexer.js'
import grammar from './grammar.js'

export { print } from './ast/print.js'
export { desugar } from './desugar/simplified.js'
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './wait.js'
export * from './errors.js'
export * from './hooks.js'
export * from './wait.js'

export class NullSelection {
constructor(public selector: string) {}
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { executeAST as exec } from '@getlang/get'
import { desugar, parse, print } from '@getlang/parser'
import { type Program, isToken } from '@getlang/parser/ast'
import { isToken, type Program } from '@getlang/parser/ast'
import type { UserHooks } from '@getlang/utils'
import { invariant } from '@getlang/utils'
import dedent from 'dedent'
Expand Down
4 changes: 2 additions & 2 deletions test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"@getlang/get": "workspace:*",
"@getlang/parser": "workspace:*",
"@getlang/utils": "workspace:*",
"dedent": "^1.5.3"
"dedent": "^1.6.0"
},
"devDependencies": {
"@types/js-yaml": "^4.0.9",
"jest-diff": "^29.7.0",
"jest-diff": "^30.0.5",
"js-yaml": "^4.1.0"
}
}
2 changes: 1 addition & 1 deletion test/values.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
NullSelectionError,
SelectorSyntaxError,
} from '@getlang/utils'
import { SELSYN, helper } from './helpers.js'
import { helper, SELSYN } from './helpers.js'

const { execute, testIdempotency } = helper()

Expand Down