Skip to content

Commit

Permalink
Merge branch 'main' into feat/add-transform-entry
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 authored Feb 17, 2025
2 parents f113e28 + 68855cf commit c6944e5
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 19 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/release-continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- run: corepack enable
- uses: actions/setup-node@v4
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
node-version-file: '.node-version'
cache: 'pnpm'

- name: Install dependencies
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ jobs:
with:
fetch-depth: 0

- run: corepack enable
- name: Install pnpm
uses: pnpm/action-setup@v4

- name: Set node
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
node-version-file: '.node-version'
cache: pnpm
registry-url: 'https://registry.npmjs.org'

Expand Down
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lts/*
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# [4.5.0](https://github.com/vuejs/repl/compare/v4.4.3...v4.5.0) (2025-02-03)


### Features

* pass on descriptor vapor flag when compiling template ([adaaceb](https://github.com/vuejs/repl/commit/adaaceb24984435ae02ab3eda071f10dba9e0362))



## [4.4.3](https://github.com/vuejs/repl/compare/v4.4.2...v4.4.3) (2025-01-02)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vue/repl",
"version": "4.4.3",
"version": "4.5.0",
"description": "Vue component for editing Vue components",
"packageManager": "[email protected]",
"type": "module",
Expand Down
21 changes: 10 additions & 11 deletions src/SplitPane.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const containerRef = useTemplateRef('container')
const previewRef = inject(injectKeyPreviewRef)!
// mobile only
const { store, splitPaneOptions } = inject(injectKeyProps)!
const { store, layoutReverse, splitPaneOptions } = inject(injectKeyProps)!
const state = reactive({
dragging: false,
Expand Down Expand Up @@ -66,6 +66,7 @@ function changeViewSize() {
:class="{
dragging: state.dragging,
'show-output': store.showOutput,
reverse: layoutReverse,
vertical: isVertical,
}"
@mousemove="dragMove"
Expand Down Expand Up @@ -201,21 +202,19 @@ function changeViewSize() {
.split-pane .toggler {
display: block;
}
.split-pane .right {
.split-pane .right,
.split-pane.show-output.reverse .right,
.split-pane.show-output .left,
.split-pane.reverse .left {
z-index: -1;
pointer-events: none;
}
.split-pane .left {
.split-pane .left,
.split-pane.show-output.reverse .left,
.split-pane.show-output .right,
.split-pane.reverse .right {
z-index: 0;
pointer-events: all;
}
.split-pane.show-output .right {
z-index: 0;
pointer-events: all;
}
.split-pane.show-output .left {
z-index: -1;
pointer-events: none;
}
}
</style>
8 changes: 7 additions & 1 deletion src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,11 @@ export function useStore(
}
}

function setImportMap(map: ImportMap) {
function setImportMap(map: ImportMap, merge = false) {
if (merge) {
map = mergeImportMap(getImportMap(), map)
}

if (map.imports)
for (const [key, value] of Object.entries(map.imports)) {
if (value) {
Expand Down Expand Up @@ -368,6 +372,7 @@ export function useStore(
deleteFile,
renameFile,
getImportMap,
setImportMap,
getTsConfig,
serialize,
deserialize,
Expand Down Expand Up @@ -436,6 +441,7 @@ export interface ReplStore extends UnwrapRef<StoreState> {
deleteFile(filename: string): void
renameFile(oldFilename: string, newFilename: string): void
getImportMap(): ImportMap
setImportMap(map: ImportMap, merge?: boolean): void
getTsConfig(): Record<string, any>
serialize(): string
deserialize(serializedState: string): void
Expand Down
2 changes: 2 additions & 0 deletions src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ async function doCompileTemplate(
let { code, errors } = store.compiler.compileTemplate({
isProd: false,
...store.sfcOptions?.template,
// @ts-expect-error TODO remove expect-error after 3.6
vapor: descriptor.vapor,
ast: descriptor.template!.ast,
source: descriptor.template!.content,
filename: descriptor.filename,
Expand Down

0 comments on commit c6944e5

Please sign in to comment.