diff --git a/.changeset/loud-signs-wear.md b/.changeset/loud-signs-wear.md new file mode 100644 index 0000000..e58ff5d --- /dev/null +++ b/.changeset/loud-signs-wear.md @@ -0,0 +1,8 @@ +--- +"@getlang/parser": patch +"@getlang/utils": patch +"@getlang/get": patch +"@getlang/lib": patch +--- + +upgrade deps diff --git a/biome.json b/biome.json index d0dd45b..dc4c811 100644 --- a/biome.json +++ b/biome.json @@ -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, diff --git a/bun.lockb b/bun.lockb index ce4c0ae..a1604ed 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 18a9aed..a02785a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "get", "license": "Apache-2.0", "private": true, - "packageManager": "bun@1.2.2", + "packageManager": "bun@1.2.20", "scripts": { "fmt": "biome check --write", "lint": "bun lint:check && bun lint:types && bun lint:unused && bun lint:repo", @@ -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" } } diff --git a/packages/get/src/execute.ts b/packages/get/src/execute.ts index 235de58..b93c83e 100644 --- a/packages/get/src/execute.ts +++ b/packages/get/src/execute.ts @@ -1,6 +1,6 @@ -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' @@ -8,13 +8,13 @@ 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' diff --git a/packages/get/src/index.ts b/packages/get/src/index.ts index 5b1d7bd..1d6caf8 100644 --- a/packages/get/src/index.ts +++ b/packages/get/src/index.ts @@ -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 { diff --git a/packages/get/src/test.d.ts b/packages/get/src/test.d.ts index 7ac03fc..73818fb 100644 --- a/packages/get/src/test.d.ts +++ b/packages/get/src/test.d.ts @@ -2,6 +2,6 @@ interface MyCustomMatchers { headers(headers: globalThis.Headers): any } declare module 'bun:test' { - interface Matchers extends MyCustomMatchers {} + interface Matchers extends MyCustomMatchers {} interface AsymmetricMatchers extends MyCustomMatchers {} } diff --git a/packages/lib/package.json b/packages/lib/package.json index 5b53f3a..17b6981 100644 --- a/packages/lib/package.json +++ b/packages/lib/package.json @@ -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" } } diff --git a/packages/lib/src/index.ts b/packages/lib/src/index.ts index e58b88f..ff692c8 100644 --- a/packages/lib/src/index.ts +++ b/packages/lib/src/index.ts @@ -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) diff --git a/packages/lib/src/values/cookies.ts b/packages/lib/src/values/cookies.ts index 0ee034d..bcd8608 100644 --- a/packages/lib/src/values/cookies.ts +++ b/packages/lib/src/values/cookies.ts @@ -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' diff --git a/packages/lib/src/values/html.ts b/packages/lib/src/values/html.ts index d582443..7a5b2fd 100644 --- a/packages/lib/src/values/html.ts +++ b/packages/lib/src/values/html.ts @@ -1,10 +1,10 @@ /// import { + invariant, NullSelection, NullSelectionError, SelectorSyntaxError, - invariant, } from '@getlang/utils' import xpath from '@getlang/xpath' import { selectAll, selectOne } from 'css-select' diff --git a/packages/lib/src/values/js.ts b/packages/lib/src/values/js.ts index eb23ec9..b887173 100644 --- a/packages/lib/src/values/js.ts +++ b/packages/lib/src/values/js.ts @@ -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 => { diff --git a/packages/parser/package.json b/packages/parser/package.json index 4778137..908d3a0 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -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" diff --git a/packages/parser/src/ast/print.ts b/packages/parser/src/ast/print.ts index 7ca503a..ede889e 100644 --- a/packages/parser/src/ast/print.ts +++ b/packages/parser/src/ast/print.ts @@ -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 diff --git a/packages/parser/src/ast/scope.ts b/packages/parser/src/ast/scope.ts index 37f9531..0ed152e 100644 --- a/packages/parser/src/ast/scope.ts +++ b/packages/parser/src/ast/scope.ts @@ -1,4 +1,4 @@ -import { ValueReferenceError, invariant } from '@getlang/utils' +import { invariant, ValueReferenceError } from '@getlang/utils' export class Scope { vars: Record @@ -45,7 +45,6 @@ export class RootScope { if (this.context) { this.vars[''] = this.context } else { - // biome-ignore lint/performance/noDelete: remove shadow value delete this.vars[''] } } diff --git a/packages/parser/src/desugar/inference/context.ts b/packages/parser/src/desugar/inference/context.ts index f9d0baf..2f2b5a8 100644 --- a/packages/parser/src/desugar/inference/context.ts +++ b/packages/parser/src/desugar/inference/context.ts @@ -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' diff --git a/packages/parser/src/desugar/inference/links.ts b/packages/parser/src/desugar/inference/links.ts index 3cf6287..78263b4 100644 --- a/packages/parser/src/desugar/inference/links.ts +++ b/packages/parser/src/desugar/inference/links.ts @@ -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' diff --git a/packages/parser/src/desugar/inference/slicedeps.ts b/packages/parser/src/desugar/inference/slicedeps.ts index 560c679..6ab26cd 100644 --- a/packages/parser/src/desugar/inference/slicedeps.ts +++ b/packages/parser/src/desugar/inference/slicedeps.ts @@ -1,6 +1,6 @@ /// -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' diff --git a/packages/parser/src/desugar/inference/typeinfo.ts b/packages/parser/src/desugar/inference/typeinfo.ts index fa75475..2bc0e9c 100644 --- a/packages/parser/src/desugar/inference/typeinfo.ts +++ b/packages/parser/src/desugar/inference/typeinfo.ts @@ -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' diff --git a/packages/parser/src/desugar/reqparse.ts b/packages/parser/src/desugar/reqparse.ts index 0aaf6b7..c5f7e80 100644 --- a/packages/parser/src/desugar/reqparse.ts +++ b/packages/parser/src/desugar/reqparse.ts @@ -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' diff --git a/packages/parser/src/desugar/simplified.ts b/packages/parser/src/desugar/simplified.ts index 5978339..840c579 100644 --- a/packages/parser/src/desugar/simplified.ts +++ b/packages/parser/src/desugar/simplified.ts @@ -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' diff --git a/packages/parser/src/desugar/utils.ts b/packages/parser/src/desugar/utils.ts index 757a3f6..871e00f 100644 --- a/packages/parser/src/desugar/utils.ts +++ b/packages/parser/src/desugar/utils.ts @@ -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' diff --git a/packages/parser/src/grammar/lex/slice.ts b/packages/parser/src/grammar/lex/slice.ts index 70371f4..c52c1c6 100644 --- a/packages/parser/src/grammar/lex/slice.ts +++ b/packages/parser/src/grammar/lex/slice.ts @@ -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) => { diff --git a/packages/parser/src/grammar/parse.ts b/packages/parser/src/grammar/parse.ts index a06dbe0..4780fb1 100644 --- a/packages/parser/src/grammar/parse.ts +++ b/packages/parser/src/grammar/parse.ts @@ -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 diff --git a/packages/parser/src/index.ts b/packages/parser/src/index.ts index 88f44d5..994b674 100644 --- a/packages/parser/src/index.ts +++ b/packages/parser/src/index.ts @@ -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' diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index 17f5732..3c2645b 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -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) {} diff --git a/test/helpers.ts b/test/helpers.ts index 65a4cbf..cacd3d3 100644 --- a/test/helpers.ts +++ b/test/helpers.ts @@ -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' diff --git a/test/package.json b/test/package.json index ae8a934..a50841d 100644 --- a/test/package.json +++ b/test/package.json @@ -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" } } diff --git a/test/values.spec.ts b/test/values.spec.ts index 218bf48..0be3f8a 100644 --- a/test/values.spec.ts +++ b/test/values.spec.ts @@ -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()