Skip to content

Commit

Permalink
fix: build error
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuanzmj committed Jan 20, 2025
1 parent ca22bf4 commit 7bea325
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 6 deletions.
6 changes: 6 additions & 0 deletions packages/compiler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @vue-jsx-vapor/compiler

## 0.1.1

### Patch Changes

- support browser environments

## 0.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue-jsx-vapor/compiler",
"version": "0.1.0",
"version": "0.1.1",
"packageManager": "[email protected]",
"description": "Vue JSX Vapor Compiler",
"type": "module",
Expand Down
8 changes: 8 additions & 0 deletions packages/unplugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# unplugin-vue-jsx-vapor

## 1.2.1

### Patch Changes

- support browser environments
- Updated dependencies
- @vue-jsx-vapor/compiler@0.1.1

## 1.2.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/unplugin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unplugin-vue-jsx-vapor",
"version": "1.2.0",
"version": "1.2.1",
"packageManager": "[email protected]",
"description": "Convert Vue JSX to Vapor",
"type": "module",
Expand Down
1 change: 1 addition & 0 deletions packages/unplugin/src/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './core'
9 changes: 6 additions & 3 deletions packages/unplugin/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ import {
} from '@vue-macros/common'
import { compile } from '@vue-jsx-vapor/compiler'
import MagicStringStack from 'magic-string-stack'
import { helperId } from './helper'
import * as helper from './helper'
import type { JSXElement, JSXFragment, Node } from '@babel/types'
import type { Options } from '../types'

export * from './helper'
export const helperCode = helper.helperCode
export const helperId = helper.helperId
export const helperPrefix = helper.helperPrefix

export function transformVueJsxVapor(
code: string,
Expand Down Expand Up @@ -40,6 +42,7 @@ export function transformVueJsxVapor(
})

for (const node of rootNodes) {
// @ts-ignore
let { code, vaporHelpers, preamble } = compile(
s.slice(node.start!, node.end!),
{
Expand Down Expand Up @@ -73,7 +76,7 @@ export function transformVueJsxVapor(
}

for (const [, events] of preamble.matchAll(/_delegateEvents\((.*)\)/g)) {
events.split(', ').forEach((event) => delegateEventSet.add(event))
events.split(', ').forEach((event: any) => delegateEventSet.add(event))
}

s.overwrite(node.start!, node.end!, code)
Expand Down
2 changes: 1 addition & 1 deletion packages/unplugin/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Raw from 'unplugin-raw/esbuild'
import type { Options } from 'tsup'

export default {
entry: ['./src/*.ts', './src/core/index.ts', './src/core/helper/index.ts'],
entry: ['./src/*.ts'],
clean: true,
format: ['cjs', 'esm'],
watch: !!process.env.DEV,
Expand Down

0 comments on commit 7bea325

Please sign in to comment.