Skip to content

Commit 85d8525

Browse files
committed
Drop optional-chaining use, change to module type
1 parent 0b878f1 commit 85d8525

File tree

5 files changed

+279
-283
lines changed

5 files changed

+279
-283
lines changed

.github/workflows/node.js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v2
1515
- name: Get node
16-
uses: actions/setup-node@v1
16+
uses: actions/setup-node@v2
1717
with:
1818
node-version: 14.x
1919
- run: npm i -g yarn

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const mount = (component, { props, children, element, app } = {}) => {
44
let el = element
55

66
let vNode = createVNode(component, props, children)
7-
if (app?._context) vNode.appContext = app._context
7+
if (app && app._context) vNode.appContext = app._context
88
if (el) render(vNode, el)
99
else if (typeof document !== 'undefined' ) render(vNode, el = document.createElement('div'))
1010

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
"name": "mount-vue-component",
33
"version": "0.9.5",
44
"description": "a tiny utility to programatically create and mount Vue 3 components - e.g. a Vue.extend replacement",
5+
"type": "module",
56
"main": "dist/index.cjs.js",
67
"module": "dist/index.esm.js",
78
"scripts": {
89
"build": "rollup -c",
910
"preversion": "npm run build",
1011
"version": "npm publish --access public",
1112
"postversion": "git push --follow-tags",
12-
"test": "node -r esm-with-syntax-fixes -r browser-env/register test/mount.test.js"
13+
"test": "node test/mount.test.js"
1314
},
1415
"repository": {
1516
"type": "git",
@@ -28,11 +29,10 @@
2829
},
2930
"homepage": "https://github.com/pearofducks/mount-vue-component#readme",
3031
"devDependencies": {
31-
"browser-env": "^3.3.0",
32-
"esm": "^3.2.25",
33-
"esm-with-syntax-fixes": "^0.0.1",
34-
"rollup": "^2.27.1",
35-
"uvu": "^0.3.3",
36-
"vue": "^3.0.0"
32+
"abdomen": "^1.0.0",
33+
"jsdom": "^16.5.3",
34+
"rollup": "^2.48.0",
35+
"uvu": "^0.5.1",
36+
"vue": "^3.0.11"
3737
}
3838
}

test/mount.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
import 'abdomen/setup'
12
import { test } from 'uvu'
23
import * as assert from 'uvu/assert'
34
import { isVNode, h, createApp } from 'vue'
4-
import { mount as createComponentInstance } from '../index'
5+
import { mount as createComponentInstance } from '../index.js'
56

67
const createComponent = (options) => ({
78
template: '<h1 class="my-class">Hello {{ name }}<slot /></h1>',

0 commit comments

Comments
 (0)