diff --git a/bun.lockb b/bun.lockb index 5ddcc43..2ba6159 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index bb9b865..fe31eff 100644 --- a/package.json +++ b/package.json @@ -120,7 +120,7 @@ "hono": ">=4.*" }, "devDependencies": { - "@hono/eslint-config": "^0.0.4", + "@hono/eslint-config": "^0.0.6", "@mdx-js/rollup": "^3.0.0", "@playwright/test": "^1.42.0", "@types/babel__generator": "^7", diff --git a/src/client/client.ts b/src/client/client.ts index b91f3e7..3f7197e 100644 --- a/src/client/client.ts +++ b/src/client/client.ts @@ -1,14 +1,14 @@ import { render } from 'hono/jsx/dom' import { jsx as jsxFn } from 'hono/jsx/dom/jsx-runtime' import { - COMPONENT_NAME, COMPONENT_EXPORT, + COMPONENT_NAME, DATA_HONO_TEMPLATE, DATA_SERIALIZED_PROPS, } from '../constants.js' import type { - CreateElement, CreateChildren, + CreateElement, Hydrate, HydrateComponent, TriggerHydration, diff --git a/src/client/runtime.ts b/src/client/runtime.ts index 63a5315..18929b9 100644 --- a/src/client/runtime.ts +++ b/src/client/runtime.ts @@ -1,6 +1,6 @@ import { Suspense, use } from 'hono/jsx/dom' import { COMPONENT_NAME, DATA_HONO_TEMPLATE, DATA_SERIALIZED_PROPS } from '../constants.js' -import type { CreateElement, CreateChildren, HydrateComponent } from '../types.js' +import type { CreateChildren, CreateElement, HydrateComponent } from '../types.js' type ImportComponent = (name: string) => Promise export const buildCreateChildrenFn = ( diff --git a/src/server/server.ts b/src/server/server.ts index c6e4204..20e737e 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { Hono } from 'hono' -import type { Env, NotFoundHandler, ErrorHandler, MiddlewareHandler } from 'hono' +import type { Env, ErrorHandler, MiddlewareHandler, NotFoundHandler } from 'hono' import { createMiddleware } from 'hono/factory' import type { H } from 'hono/types' import { IMPORTING_ISLANDS_ID } from '../constants.js' diff --git a/src/vite/inject-importing-islands.ts b/src/vite/inject-importing-islands.ts index d9f2754..5f9f229 100644 --- a/src/vite/inject-importing-islands.ts +++ b/src/vite/inject-importing-islands.ts @@ -4,7 +4,8 @@ import _generate from '@babel/generator' import { parse } from '@babel/parser' // @ts-expect-error `precinct` is not typed import precinct from 'precinct' -import { normalizePath, type Plugin } from 'vite' +import { normalizePath } from 'vite' +import type { Plugin } from 'vite' import { IMPORTING_ISLANDS_ID } from '../constants.js' import { matchIslandComponentId } from './utils/path.js' diff --git a/src/vite/island-components.test.ts b/src/vite/island-components.test.ts index fa147e5..038c096 100644 --- a/src/vite/island-components.test.ts +++ b/src/vite/island-components.test.ts @@ -1,7 +1,7 @@ import fs from 'fs' import os from 'os' import path from 'path' -import { transformJsxTags, islandComponents } from './island-components.js' +import { islandComponents, transformJsxTags } from './island-components.js' describe('transformJsxTags', () => { it('Should add component-wrapper and component-name attribute', () => { diff --git a/src/vite/island-components.ts b/src/vite/island-components.ts index f28af88..042fef2 100644 --- a/src/vite/island-components.ts +++ b/src/vite/island-components.ts @@ -10,32 +10,32 @@ import _traverse from '@babel/traverse' // @ts-ignore const traverse = (_traverse.default as typeof _traverse) ?? _traverse import { + blockStatement, + conditionalExpression, + exportDefaultDeclaration, + exportNamedDeclaration, + exportSpecifier, + functionExpression, identifier, + importDeclaration, + importSpecifier, jsxAttribute, jsxClosingElement, jsxElement, + jsxExpressionContainer, jsxIdentifier, jsxOpeningElement, - stringLiteral, - variableDeclarator, - variableDeclaration, - functionExpression, - blockStatement, - returnStatement, jsxSpreadAttribute, - jsxExpressionContainer, - exportDefaultDeclaration, - conditionalExpression, memberExpression, - importDeclaration, - importSpecifier, - exportNamedDeclaration, - exportSpecifier, + returnStatement, + stringLiteral, + variableDeclaration, + variableDeclarator, } from '@babel/types' import { parse as parseJsonc } from 'jsonc-parser' // eslint-disable-next-line node/no-extraneous-import import type { Plugin } from 'vite' -import { matchIslandComponentId, isComponentName } from './utils/path.js' +import { isComponentName, matchIslandComponentId } from './utils/path.js' function addSSRCheck(funcName: string, componentName: string, componentExport?: string) { const isSSR = memberExpression( diff --git a/test-e2e/e2e.test.ts b/test-e2e/e2e.test.ts index aeca420..2691c49 100644 --- a/test-e2e/e2e.test.ts +++ b/test-e2e/e2e.test.ts @@ -1,4 +1,4 @@ -import { test, expect } from '@playwright/test' +import { expect, test } from '@playwright/test' test('test counter', async ({ page }) => { await page.goto('/interaction') diff --git a/test-integration/apps.test.ts b/test-integration/apps.test.ts index 485e473..25874a5 100644 --- a/test-integration/apps.test.ts +++ b/test-integration/apps.test.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import { poweredBy } from 'hono/powered-by' -import { describe, it, expect, vi } from 'vitest' +import { describe, expect, it, vi } from 'vitest' import { createApp } from '../src/server' describe('Basic', () => { diff --git a/yarn.lock b/yarn.lock index 1058676..a22b5b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1,6 +1,6 @@ # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. # yarn lockfile v1 -# bun ./bun.lockb --hash: EEA022DC5A02E807-9535a4759596cd0b-CADC0EADF1F622AE-e0c0fb8a64d8bcd6 +# bun ./bun.lockb --hash: 0B0BA37058D3CD5C-3670130fe0734764-A920B39892F98B96-7d88c4e0bbc96280 "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.23.5", "@babel/code-frame@^7.24.2": @@ -414,10 +414,10 @@ resolved "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz" integrity sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA== -"@hono/eslint-config@^0.0.4": - version "0.0.4" - resolved "https://registry.npmjs.org/@hono/eslint-config/-/eslint-config-0.0.4.tgz" - integrity sha512-CaL3LBdI2tw7Luo4vGDhhrdntA02Nsts6P0FjAz3U5piy3UhWzgEvEN+L9M0fsG7Mm1cgd+kM3hF8CRJOH0aGA== +"@hono/eslint-config@^0.0.6": + version "0.0.6" + resolved "https://registry.npmjs.org/@hono/eslint-config/-/eslint-config-0.0.6.tgz" + integrity sha512-svFH026Vp5UHREJZzG6wx0SVHpX3O6yxeHjSYLXB4tXEzDEM2zK17tZ1XRFZRtx9NQH2yUGBEciwxdbx0LF7Jg== dependencies: "@typescript-eslint/eslint-plugin" "^6.14.0" "@typescript-eslint/parser" "^6.14.0"