From 98a66ee8e36b89e64d49d2fde1a751741b21eef9 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Wed, 10 Jan 2024 10:20:56 +0100 Subject: [PATCH 1/6] chore: update vue version tag --- .github/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/test.js b/.github/test.js index 2dfe4e8..304e46a 100644 --- a/.github/test.js +++ b/.github/test.js @@ -22,7 +22,7 @@ function installDeps() { let installCmd = agent === 'yarn' ? `${agent} add` : `${agent} i` - const packages = isVue27 ? 'vue@v2-alpha' : isVue2 ? `vue@2.6 @vue/composition-api` : 'vue@3' + const packages = isVue27 ? 'vue@2.7' : isVue2 ? `vue@2.6 @vue/composition-api` : 'vue@3' execSync(`${installCmd} ${packages}`, { cwd: DIR, stdio: 'inherit' }) execSync(`${installCmd} ${agent === 'yarn' ? `file:${tarball}` : tarball} --force`, { cwd: DIR, stdio: 'inherit' }) } From 4747b2797d29490102ecc8acddb0c4dec272edb6 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Wed, 10 Jan 2024 12:52:34 +0100 Subject: [PATCH 2/6] chore: try yarn 3.x instead of berry --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 169acc6..ed6b24c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: node: [14.x, 16.x] os: [ubuntu-latest] vue: [2.6, 2.7, 3] - yarn: [latest, berry] + yarn: [latest, 3.x] type: [commonjs, module] runs-on: ${{ matrix.os }} From 01e799ba7cb7e0eb09710529a395b6db500d7aa0 Mon Sep 17 00:00:00 2001 From: AnotherSola <38176179+anotherso1a@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:29:51 +0800 Subject: [PATCH 3/6] fix(scripts): fix error in install (#252) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 27e4dfc..c27d66f 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "scripts" ], "scripts": { - "postinstall": "node ./scripts/postinstall.js", + "postinstall": "node -e \"try{require('./scripts/postinstall.js')}catch(e){}\"", "release": "npx bumpp --tag --commit --push && npm publish" }, "peerDependencies": { From 253ae198a39cdbe45cb0045a78d965cd1e91ddec Mon Sep 17 00:00:00 2001 From: cccblade <156088158+cccblade@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:29:59 +0800 Subject: [PATCH 4/6] fix: replace arrow functions for compatibility (#251) --- lib/index.iife.js | 8 ++++++-- lib/v2.7/index.cjs | 4 +++- lib/v2/index.cjs | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/index.iife.js b/lib/index.iife.js index 2179268..085d02c 100644 --- a/lib/index.iife.js +++ b/lib/index.iife.js @@ -19,7 +19,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) { VueDemi.Vue2 = Vue VueDemi.version = Vue.version VueDemi.warn = Vue.util.warn - VueDemi.hasInjectionContext = () => !!VueDemi.getCurrentInstance() + VueDemi.hasInjectionContext = function() { + return !!VueDemi.getCurrentInstance() + } function createApp(rootComponent, rootProps) { var vm var provide = {} @@ -72,7 +74,9 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) { VueDemi.Vue = Vue VueDemi.Vue2 = Vue VueDemi.version = Vue.version - VueDemi.hasInjectionContext = () => !!VueDemi.getCurrentInstance() + VueDemi.hasInjectionContext = function() { + return !!VueDemi.getCurrentInstance() + } } else { console.error('[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.') } diff --git a/lib/v2.7/index.cjs b/lib/v2.7/index.cjs index 1dce010..8fa3b68 100644 --- a/lib/v2.7/index.cjs +++ b/lib/v2.7/index.cjs @@ -55,4 +55,6 @@ Object.keys(VueModule).forEach(function (key) { }) // Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance() -exports.hasInjectionContext = () => !!VueModule.getCurrentInstance() +exports.hasInjectionContext = function() { + return !!VueModule.getCurrentInstance() +} \ No newline at end of file diff --git a/lib/v2/index.cjs b/lib/v2/index.cjs index 5f873d2..c3d298e 100644 --- a/lib/v2/index.cjs +++ b/lib/v2/index.cjs @@ -29,4 +29,6 @@ exports.install = install exports.version = Vue.version // Not implemented https://github.com/vuejs/core/pull/8111, falls back to getCurrentInstance() -exports.hasInjectionContext = () => !!VueCompositionAPI.getCurrentInstance() +exports.hasInjectionContext = function () { + return !!VueCompositionAPI.getCurrentInstance() +} From f3d9ca2b37c4c145ec77dcea6297a5f15178a2a2 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 1 Feb 2024 12:31:40 +0100 Subject: [PATCH 5/6] chore: try update ci --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed6b24c..a38a9f8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: node: [14.x, 16.x] os: [ubuntu-latest] vue: [2.6, 2.7, 3] - yarn: [latest, 3.x] + yarn: [latest] type: [commonjs, module] runs-on: ${{ matrix.os }} From e42b5d594f72a8380da1eae91eacad645f161d06 Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 1 Feb 2024 12:32:34 +0100 Subject: [PATCH 6/6] chore: release v0.14.7 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c27d66f..e362bbe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-demi", - "version": "0.14.6", + "version": "0.14.7", "engines": { "node": ">=12" },