From 401452bfe092e6c6cf26da8062031c4a02db7dbe Mon Sep 17 00:00:00 2001 From: Shantibhushan Naik Date: Fri, 25 Mar 2022 17:52:47 +0900 Subject: [PATCH 01/10] Make vuex usable in react, react-native --- .gitignore | 1 + package.json | 5 ++++- src/helpers.js | 27 ++++++++++++++++----------- src/injectKey.js | 2 +- src/store-util.js | 3 ++- src/store.js | 2 +- 6 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 6a5927e1e..db52354ab 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ *.log .DS_Store node_modules +.idea diff --git a/package.json b/package.json index 3173432af..c27e7d158 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,10 @@ "vue": "^3.2.0" }, "dependencies": { - "@vue/devtools-api": "^6.0.0-beta.11" + "@vue/devtools-api": "^6.0.0-beta.11", + "@vue/reactivity": "^3.2.31", + "@vue/runtime-core": "^3.2.31", + "@vue/shared": "^3.2.31" }, "devDependencies": { "@babel/core": "^7.14.3", diff --git a/src/helpers.js b/src/helpers.js index 0b2aac7bc..8614de81d 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -1,4 +1,5 @@ import { isObject } from './util' +import {getGlobalThis} from "@vue/shared"; /** * Reduce the code which written in Vue.js for getting the state. @@ -7,16 +8,17 @@ import { isObject } from './util' * @param {Object} */ export const mapState = normalizeNamespace((namespace, states) => { + const globalThis= getGlobalThis() const res = {} if (__DEV__ && !isValidMap(states)) { console.error('[vuex] mapState: mapper parameter must be either an Array or an Object') } normalizeMap(states).forEach(({ key, val }) => { res[key] = function mappedState () { - let state = this.$store.state - let getters = this.$store.getters + let state = globalThis.$store.state + let getters = globalThis.$store.getters if (namespace) { - const module = getModuleByNamespace(this.$store, 'mapState', namespace) + const module = getModuleByNamespace(globalThis.$store, 'mapState', namespace) if (!module) { return } @@ -40,6 +42,7 @@ export const mapState = normalizeNamespace((namespace, states) => { * @return {Object} */ export const mapMutations = normalizeNamespace((namespace, mutations) => { + const globalThis= getGlobalThis() const res = {} if (__DEV__ && !isValidMap(mutations)) { console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object') @@ -47,9 +50,9 @@ export const mapMutations = normalizeNamespace((namespace, mutations) => { normalizeMap(mutations).forEach(({ key, val }) => { res[key] = function mappedMutation (...args) { // Get the commit method from store - let commit = this.$store.commit + let commit = globalThis.$store.commit if (namespace) { - const module = getModuleByNamespace(this.$store, 'mapMutations', namespace) + const module = getModuleByNamespace(globalThis.$store, 'mapMutations', namespace) if (!module) { return } @@ -70,6 +73,7 @@ export const mapMutations = normalizeNamespace((namespace, mutations) => { * @return {Object} */ export const mapGetters = normalizeNamespace((namespace, getters) => { + const globalThis= getGlobalThis() const res = {} if (__DEV__ && !isValidMap(getters)) { console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object') @@ -78,14 +82,14 @@ export const mapGetters = normalizeNamespace((namespace, getters) => { // The namespace has been mutated by normalizeNamespace val = namespace + val res[key] = function mappedGetter () { - if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) { + if (namespace && !getModuleByNamespace(globalThis.$store, 'mapGetters', namespace)) { return } - if (__DEV__ && !(val in this.$store.getters)) { + if (__DEV__ && !(val in globalThis.$store.getters)) { console.error(`[vuex] unknown getter: ${val}`) return } - return this.$store.getters[val] + return globalThis.$store.getters[val] } // mark vuex getter for devtools res[key].vuex = true @@ -100,6 +104,7 @@ export const mapGetters = normalizeNamespace((namespace, getters) => { * @return {Object} */ export const mapActions = normalizeNamespace((namespace, actions) => { + const globalThis= getGlobalThis() const res = {} if (__DEV__ && !isValidMap(actions)) { console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object') @@ -107,9 +112,9 @@ export const mapActions = normalizeNamespace((namespace, actions) => { normalizeMap(actions).forEach(({ key, val }) => { res[key] = function mappedAction (...args) { // get dispatch function from store - let dispatch = this.$store.dispatch + let dispatch = globalThis.$store.dispatch if (namespace) { - const module = getModuleByNamespace(this.$store, 'mapActions', namespace) + const module = getModuleByNamespace(globalThis.$store, 'mapActions', namespace) if (!module) { return } @@ -117,7 +122,7 @@ export const mapActions = normalizeNamespace((namespace, actions) => { } return typeof val === 'function' ? val.apply(this, [dispatch].concat(args)) - : dispatch.apply(this.$store, [val].concat(args)) + : dispatch.apply(globalThis.$store, [val].concat(args)) } }) return res diff --git a/src/injectKey.js b/src/injectKey.js index f5da60457..6da1c22ec 100644 --- a/src/injectKey.js +++ b/src/injectKey.js @@ -1,4 +1,4 @@ -import { inject } from 'vue' +import { inject } from '@vue/runtime-core' export const storeKey = 'store' diff --git a/src/store-util.js b/src/store-util.js index e3ba18609..c7aa4a49a 100644 --- a/src/store-util.js +++ b/src/store-util.js @@ -1,4 +1,5 @@ -import { reactive, computed, watch, effectScope } from 'vue' +import { reactive, computed, effectScope } from '@vue/reactivity' +import { watch } from '@vue/runtime-core' import { forEachValue, isObject, isPromise, assert, partial } from './util' export function genericSubscribe (fn, subs, options) { diff --git a/src/store.js b/src/store.js index e22c74b5d..eae7a85a0 100644 --- a/src/store.js +++ b/src/store.js @@ -1,4 +1,4 @@ -import { watch } from 'vue' +import { watch } from '@vue/runtime-core' import { storeKey } from './injectKey' import { addDevtools } from './plugins/devtool' import ModuleCollection from './module/module-collection' From ff70d457d9f2fdc65816080c1d0adf676dc31eb4 Mon Sep 17 00:00:00 2001 From: Shantibhushan Naik Date: Sat, 26 Mar 2022 10:17:13 +0900 Subject: [PATCH 02/10] Fix circleci tests --- src/helpers.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/helpers.js b/src/helpers.js index 8614de81d..b415a5b16 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -8,17 +8,17 @@ import {getGlobalThis} from "@vue/shared"; * @param {Object} */ export const mapState = normalizeNamespace((namespace, states) => { - const globalThis= getGlobalThis() + const instance= this || getGlobalThis() const res = {} if (__DEV__ && !isValidMap(states)) { console.error('[vuex] mapState: mapper parameter must be either an Array or an Object') } normalizeMap(states).forEach(({ key, val }) => { res[key] = function mappedState () { - let state = globalThis.$store.state - let getters = globalThis.$store.getters + let state = instance.$store.state + let getters = instance.$store.getters if (namespace) { - const module = getModuleByNamespace(globalThis.$store, 'mapState', namespace) + const module = getModuleByNamespace(instance.$store, 'mapState', namespace) if (!module) { return } @@ -42,7 +42,7 @@ export const mapState = normalizeNamespace((namespace, states) => { * @return {Object} */ export const mapMutations = normalizeNamespace((namespace, mutations) => { - const globalThis= getGlobalThis() + const instance= this || getGlobalThis() const res = {} if (__DEV__ && !isValidMap(mutations)) { console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object') @@ -50,9 +50,9 @@ export const mapMutations = normalizeNamespace((namespace, mutations) => { normalizeMap(mutations).forEach(({ key, val }) => { res[key] = function mappedMutation (...args) { // Get the commit method from store - let commit = globalThis.$store.commit + let commit = instance.$store.commit if (namespace) { - const module = getModuleByNamespace(globalThis.$store, 'mapMutations', namespace) + const module = getModuleByNamespace(instance.$store, 'mapMutations', namespace) if (!module) { return } @@ -73,7 +73,7 @@ export const mapMutations = normalizeNamespace((namespace, mutations) => { * @return {Object} */ export const mapGetters = normalizeNamespace((namespace, getters) => { - const globalThis= getGlobalThis() + const instance= this || getGlobalThis() const res = {} if (__DEV__ && !isValidMap(getters)) { console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object') @@ -82,14 +82,14 @@ export const mapGetters = normalizeNamespace((namespace, getters) => { // The namespace has been mutated by normalizeNamespace val = namespace + val res[key] = function mappedGetter () { - if (namespace && !getModuleByNamespace(globalThis.$store, 'mapGetters', namespace)) { + if (namespace && !getModuleByNamespace(instance.$store, 'mapGetters', namespace)) { return } - if (__DEV__ && !(val in globalThis.$store.getters)) { + if (__DEV__ && !(val in instance.$store.getters)) { console.error(`[vuex] unknown getter: ${val}`) return } - return globalThis.$store.getters[val] + return instance.$store.getters[val] } // mark vuex getter for devtools res[key].vuex = true @@ -104,7 +104,7 @@ export const mapGetters = normalizeNamespace((namespace, getters) => { * @return {Object} */ export const mapActions = normalizeNamespace((namespace, actions) => { - const globalThis= getGlobalThis() + const instance= this || getGlobalThis() const res = {} if (__DEV__ && !isValidMap(actions)) { console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object') @@ -112,9 +112,9 @@ export const mapActions = normalizeNamespace((namespace, actions) => { normalizeMap(actions).forEach(({ key, val }) => { res[key] = function mappedAction (...args) { // get dispatch function from store - let dispatch = globalThis.$store.dispatch + let dispatch = instance.$store.dispatch if (namespace) { - const module = getModuleByNamespace(globalThis.$store, 'mapActions', namespace) + const module = getModuleByNamespace(instance.$store, 'mapActions', namespace) if (!module) { return } @@ -122,7 +122,7 @@ export const mapActions = normalizeNamespace((namespace, actions) => { } return typeof val === 'function' ? val.apply(this, [dispatch].concat(args)) - : dispatch.apply(globalThis.$store, [val].concat(args)) + : dispatch.apply(instance.$store, [val].concat(args)) } }) return res From d16d2e96aac22cac47c7dfbfa3a8ec85328ffbea Mon Sep 17 00:00:00 2001 From: Shantibhushan Naik Date: Sat, 26 Mar 2022 10:27:14 +0900 Subject: [PATCH 03/10] Move `this` accessor fixes within mapped functions --- src/helpers.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/helpers.js b/src/helpers.js index b415a5b16..b10065928 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -8,13 +8,13 @@ import {getGlobalThis} from "@vue/shared"; * @param {Object} */ export const mapState = normalizeNamespace((namespace, states) => { - const instance= this || getGlobalThis() const res = {} if (__DEV__ && !isValidMap(states)) { console.error('[vuex] mapState: mapper parameter must be either an Array or an Object') } normalizeMap(states).forEach(({ key, val }) => { res[key] = function mappedState () { + const instance = this || getGlobalThis() let state = instance.$store.state let getters = instance.$store.getters if (namespace) { @@ -42,13 +42,13 @@ export const mapState = normalizeNamespace((namespace, states) => { * @return {Object} */ export const mapMutations = normalizeNamespace((namespace, mutations) => { - const instance= this || getGlobalThis() const res = {} if (__DEV__ && !isValidMap(mutations)) { console.error('[vuex] mapMutations: mapper parameter must be either an Array or an Object') } normalizeMap(mutations).forEach(({ key, val }) => { res[key] = function mappedMutation (...args) { + const instance = this || getGlobalThis() // Get the commit method from store let commit = instance.$store.commit if (namespace) { @@ -73,7 +73,6 @@ export const mapMutations = normalizeNamespace((namespace, mutations) => { * @return {Object} */ export const mapGetters = normalizeNamespace((namespace, getters) => { - const instance= this || getGlobalThis() const res = {} if (__DEV__ && !isValidMap(getters)) { console.error('[vuex] mapGetters: mapper parameter must be either an Array or an Object') @@ -82,6 +81,7 @@ export const mapGetters = normalizeNamespace((namespace, getters) => { // The namespace has been mutated by normalizeNamespace val = namespace + val res[key] = function mappedGetter () { + const instance = this || getGlobalThis() if (namespace && !getModuleByNamespace(instance.$store, 'mapGetters', namespace)) { return } @@ -104,13 +104,13 @@ export const mapGetters = normalizeNamespace((namespace, getters) => { * @return {Object} */ export const mapActions = normalizeNamespace((namespace, actions) => { - const instance= this || getGlobalThis() const res = {} if (__DEV__ && !isValidMap(actions)) { console.error('[vuex] mapActions: mapper parameter must be either an Array or an Object') } normalizeMap(actions).forEach(({ key, val }) => { res[key] = function mappedAction (...args) { + const instance = this || getGlobalThis() // get dispatch function from store let dispatch = instance.$store.dispatch if (namespace) { From 6113f641446e234bb6a4bcfd58d9c2ea25538374 Mon Sep 17 00:00:00 2001 From: Shantibhushan Naik Date: Sat, 26 Mar 2022 10:39:37 +0900 Subject: [PATCH 04/10] Revert to main branch, no changes needed --- src/helpers.js | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/helpers.js b/src/helpers.js index b10065928..1ca4e26b3 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -1,5 +1,4 @@ import { isObject } from './util' -import {getGlobalThis} from "@vue/shared"; /** * Reduce the code which written in Vue.js for getting the state. @@ -14,11 +13,10 @@ export const mapState = normalizeNamespace((namespace, states) => { } normalizeMap(states).forEach(({ key, val }) => { res[key] = function mappedState () { - const instance = this || getGlobalThis() - let state = instance.$store.state - let getters = instance.$store.getters + let state = this.$store.state + let getters = this.$store.getters if (namespace) { - const module = getModuleByNamespace(instance.$store, 'mapState', namespace) + const module = getModuleByNamespace(this.$store, 'mapState', namespace) if (!module) { return } @@ -48,11 +46,10 @@ export const mapMutations = normalizeNamespace((namespace, mutations) => { } normalizeMap(mutations).forEach(({ key, val }) => { res[key] = function mappedMutation (...args) { - const instance = this || getGlobalThis() // Get the commit method from store - let commit = instance.$store.commit + let commit = this.$store.commit if (namespace) { - const module = getModuleByNamespace(instance.$store, 'mapMutations', namespace) + const module = getModuleByNamespace(this.$store, 'mapMutations', namespace) if (!module) { return } @@ -81,15 +78,14 @@ export const mapGetters = normalizeNamespace((namespace, getters) => { // The namespace has been mutated by normalizeNamespace val = namespace + val res[key] = function mappedGetter () { - const instance = this || getGlobalThis() - if (namespace && !getModuleByNamespace(instance.$store, 'mapGetters', namespace)) { + if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) { return } - if (__DEV__ && !(val in instance.$store.getters)) { + if (__DEV__ && !(val in this.$store.getters)) { console.error(`[vuex] unknown getter: ${val}`) return } - return instance.$store.getters[val] + return this.$store.getters[val] } // mark vuex getter for devtools res[key].vuex = true @@ -110,11 +106,10 @@ export const mapActions = normalizeNamespace((namespace, actions) => { } normalizeMap(actions).forEach(({ key, val }) => { res[key] = function mappedAction (...args) { - const instance = this || getGlobalThis() // get dispatch function from store - let dispatch = instance.$store.dispatch + let dispatch = this.$store.dispatch if (namespace) { - const module = getModuleByNamespace(instance.$store, 'mapActions', namespace) + const module = getModuleByNamespace(this.$store, 'mapActions', namespace) if (!module) { return } @@ -122,7 +117,7 @@ export const mapActions = normalizeNamespace((namespace, actions) => { } return typeof val === 'function' ? val.apply(this, [dispatch].concat(args)) - : dispatch.apply(instance.$store, [val].concat(args)) + : dispatch.apply(this.$store, [val].concat(args)) } }) return res @@ -195,4 +190,4 @@ function getModuleByNamespace (store, helper, namespace) { console.error(`[vuex] module namespace not found in ${helper}(): ${namespace}`) } return module -} +} \ No newline at end of file From f29c0fe7aed8a1db9f27863189a4880201551f0b Mon Sep 17 00:00:00 2001 From: Shantibhushan Naik Date: Sat, 26 Mar 2022 10:48:42 +0900 Subject: [PATCH 05/10] Remove unnecessary dependencies --- package.json | 3 +-- src/helpers.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c27e7d158..b53e03e93 100644 --- a/package.json +++ b/package.json @@ -58,8 +58,7 @@ "dependencies": { "@vue/devtools-api": "^6.0.0-beta.11", "@vue/reactivity": "^3.2.31", - "@vue/runtime-core": "^3.2.31", - "@vue/shared": "^3.2.31" + "@vue/runtime-core": "^3.2.31" }, "devDependencies": { "@babel/core": "^7.14.3", diff --git a/src/helpers.js b/src/helpers.js index 1ca4e26b3..0b2aac7bc 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -190,4 +190,4 @@ function getModuleByNamespace (store, helper, namespace) { console.error(`[vuex] module namespace not found in ${helper}(): ${namespace}`) } return module -} \ No newline at end of file +} From 695970e96a787ebe4ed29fb2ffafc3e7f009b67d Mon Sep 17 00:00:00 2001 From: Shantibhushan Naik Date: Sat, 26 Mar 2022 20:15:34 +0900 Subject: [PATCH 06/10] Ensuring local tests pass --- .gitignore | 1 - package.json | 4 +++- rollup.config.js | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index db52354ab..6a5927e1e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,3 @@ *.log .DS_Store node_modules -.idea diff --git a/package.json b/package.json index b53e03e93..25aa17765 100644 --- a/package.json +++ b/package.json @@ -77,7 +77,8 @@ "cross-env": "^7.0.3", "css-loader": "^2.1.0", "enquirer": "^2.3.5", - "eslint": "^7.27.0", + "eslint": "^6.0.0", + "eslint-plugin-vue": "^8.5.0", "eslint-plugin-vue-libs": "^4.0.0", "execa": "^5.0.0", "express": "^4.17.1", @@ -86,6 +87,7 @@ "puppeteer": "^9.1.1", "regenerator-runtime": "^0.13.5", "rollup": "^2.49.0", + "rollup-plugin-regenerator": "^0.6.0", "rollup-plugin-terser": "^7.0.2", "semver": "^7.3.5", "start-server-and-test": "^1.12.3", diff --git a/rollup.config.js b/rollup.config.js index 30b9df0bb..7dd9819ac 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,6 +3,7 @@ import replace from '@rollup/plugin-replace' import resolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import { terser } from 'rollup-plugin-terser' +import regenerator from 'rollup-plugin-regenerator' import pkg from './package.json' const banner = `/*! @@ -32,7 +33,7 @@ function createEntry(config) { const c = { external: ['vue'], input: config.input, - plugins: [], + plugins: [ regenerator() ], output: { banner, file: config.file, From f01924eaa27d4b17e436f73e4cce787c2c2166a2 Mon Sep 17 00:00:00 2001 From: Shantibhushan Naik Date: Sun, 27 Mar 2022 21:11:35 +0900 Subject: [PATCH 07/10] Bumping up to circleci, package versions --- .circleci/config.yml | 5 +++-- package.json | 48 ++++++++++++++++++++++---------------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c12856e77..887497e5f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,10 @@ -version: 2 +version: 2.1 defaults: &defaults working_directory: ~/vuex docker: - - image: circleci/node:12-browsers + - image: cimg/node:current-browsers + parallelism: 4 jobs: install: diff --git a/package.json b/package.json index 25aa17765..1b89149a3 100644 --- a/package.json +++ b/package.json @@ -56,49 +56,49 @@ "vue": "^3.2.0" }, "dependencies": { - "@vue/devtools-api": "^6.0.0-beta.11", + "@vue/devtools-api": "^6.1.3", "@vue/reactivity": "^3.2.31", "@vue/runtime-core": "^3.2.31" }, "devDependencies": { - "@babel/core": "^7.14.3", - "@babel/preset-env": "^7.14.2", + "@babel/core": "^7.17.8", + "@babel/preset-env": "^7.16.11", "@rollup/plugin-buble": "^0.21.3", - "@rollup/plugin-commonjs": "^19.0.0", - "@rollup/plugin-node-resolve": "^13.0.0", + "@rollup/plugin-commonjs": "^19.0.2", + "@rollup/plugin-node-resolve": "^13.1.3", "@rollup/plugin-replace": "^2.4.2", - "@types/node": "^15.6.0", + "@types/node": "^15.14.9", "@vue/compiler-sfc": "^3.2.4", "babel-jest": "^26.6.3", - "babel-loader": "^8.2.2", + "babel-loader": "^8.2.4", "brotli": "^1.3.2", - "chalk": "^4.1.1", - "conventional-changelog-cli": "^2.1.1", + "chalk": "^4.1.2", + "conventional-changelog-cli": "^2.2.2", "cross-env": "^7.0.3", - "css-loader": "^2.1.0", - "enquirer": "^2.3.5", - "eslint": "^6.0.0", + "css-loader": "^2.1.1", + "enquirer": "^2.3.6", + "eslint": "^6.8.0", "eslint-plugin-vue": "^8.5.0", "eslint-plugin-vue-libs": "^4.0.0", "execa": "^5.0.0", - "express": "^4.17.1", - "fs-extra": "^10.0.0", + "express": "^4.17.3", + "fs-extra": "^10.0.1", "jest": "^26.6.3", "puppeteer": "^9.1.1", - "regenerator-runtime": "^0.13.5", - "rollup": "^2.49.0", + "regenerator-runtime": "^0.13.9", + "rollup": "^2.70.1", "rollup-plugin-regenerator": "^0.6.0", "rollup-plugin-terser": "^7.0.2", "semver": "^7.3.5", - "start-server-and-test": "^1.12.3", - "todomvc-app-css": "^2.4.1", - "typescript": "^4.2.4", - "vitepress": "^0.20.0", + "start-server-and-test": "^1.14.0", + "todomvc-app-css": "^2.4.2", + "typescript": "^4.6.3", + "vitepress": "^0.20.10", "vue": "^3.2.4", - "vue-loader": "^16.5.0", + "vue-loader": "^16.8.3", "vue-style-loader": "^4.1.3", - "webpack": "^4.43.0", - "webpack-dev-middleware": "^3.7.2", - "webpack-hot-middleware": "^2.25.0" + "webpack": "^4.46.0", + "webpack-dev-middleware": "^3.7.3", + "webpack-hot-middleware": "^2.25.1" } } From 7b9a4f16a7e6fdb90f0e6d3d9a5fddd17ba1c927 Mon Sep 17 00:00:00 2001 From: Shantibhushan Naik Date: Mon, 28 Mar 2022 17:24:35 +0900 Subject: [PATCH 08/10] Explicit peerDependency install for circleci --- .circleci/config.yml | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 887497e5f..d62700d38 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 defaults: &defaults working_directory: ~/vuex docker: - - image: cimg/node:current-browsers + - image: cimg/node:lts-browsers parallelism: 4 jobs: @@ -49,8 +49,13 @@ jobs: test-unit: <<: *defaults steps: - - attach_workspace: - at: ~/ + - checkout + - run: + name: Installing Dependencies + command: yarn + - run: + name: Installing peerDependencies explicitly + command: yarn add vue --peer - run: name: Running Unit Tests command: | @@ -59,8 +64,13 @@ jobs: test-e2e: <<: *defaults steps: - - attach_workspace: - at: ~/ + - checkout + - run: + name: Installing Dependencies + command: yarn + - run: + name: Installing peerDependencies explicitly + command: yarn add vue --peer - run: name: Running End-to-end Tests command: | @@ -69,8 +79,13 @@ jobs: test-ssr: <<: *defaults steps: - - attach_workspace: - at: ~/ + - checkout + - run: + name: Installing Dependencies + command: yarn + - run: + name: Installing peerDependencies explicitly + command: yarn add vue --peer - run: name: Running Server-side Rendering Tests command: | From 1afc4c6070df7a65d729bd8eca7fe85e33be6489 Mon Sep 17 00:00:00 2001 From: Shantibhushan Naik Date: Tue, 29 Mar 2022 18:56:30 +0900 Subject: [PATCH 09/10] Publish until go for PR merge --- package.json | 1 - rollup.config.js | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 1b89149a3..78172dceb 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,6 @@ "puppeteer": "^9.1.1", "regenerator-runtime": "^0.13.9", "rollup": "^2.70.1", - "rollup-plugin-regenerator": "^0.6.0", "rollup-plugin-terser": "^7.0.2", "semver": "^7.3.5", "start-server-and-test": "^1.14.0", diff --git a/rollup.config.js b/rollup.config.js index 7dd9819ac..6150e2ade 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,7 +3,6 @@ import replace from '@rollup/plugin-replace' import resolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' import { terser } from 'rollup-plugin-terser' -import regenerator from 'rollup-plugin-regenerator' import pkg from './package.json' const banner = `/*! @@ -33,7 +32,7 @@ function createEntry(config) { const c = { external: ['vue'], input: config.input, - plugins: [ regenerator() ], + plugins: [], output: { banner, file: config.file, @@ -69,7 +68,7 @@ function createEntry(config) { })) if (config.transpile !== false) { - c.plugins.push(buble()) + c.plugins.push(buble({ transforms: { asyncAwait: false, forOf: false }})) } c.plugins.push(resolve()) From dc97aecba1b4aa0dd1943625049e5b7adad16f2f Mon Sep 17 00:00:00 2001 From: Shantibhushan Naik Date: Tue, 5 Apr 2022 19:13:40 +0900 Subject: [PATCH 10/10] Replace @rollup/plugin-buble with @rollup/plugin-babel --- package.json | 2 +- rollup.config.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 78172dceb..3c2579b34 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "devDependencies": { "@babel/core": "^7.17.8", "@babel/preset-env": "^7.16.11", - "@rollup/plugin-buble": "^0.21.3", + "@rollup/plugin-babel": "^5.3.1", "@rollup/plugin-commonjs": "^19.0.2", "@rollup/plugin-node-resolve": "^13.1.3", "@rollup/plugin-replace": "^2.4.2", diff --git a/rollup.config.js b/rollup.config.js index 6150e2ade..69963919b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,4 +1,4 @@ -import buble from '@rollup/plugin-buble' +import { babel } from '@rollup/plugin-babel' import replace from '@rollup/plugin-replace' import resolve from '@rollup/plugin-node-resolve' import commonjs from '@rollup/plugin-commonjs' @@ -68,7 +68,7 @@ function createEntry(config) { })) if (config.transpile !== false) { - c.plugins.push(buble({ transforms: { asyncAwait: false, forOf: false }})) + c.plugins.push(babel({ babelHelpers: 'bundled' })) } c.plugins.push(resolve())