Skip to content

Commit

Permalink
feat: vue 3 support (#175)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Vue 3 support.
  • Loading branch information
thabarbados authored and dangreen committed May 5, 2022
1 parent 9b5264b commit f0863a7
Show file tree
Hide file tree
Showing 62 changed files with 5,397 additions and 736 deletions.
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# builds
package
dist

# legacy builds
/legacy/index.cjs
/legacy/index.js
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,8 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Install dependencies to legacy folder
working-directory: legacy
run: pnpm install
- name: Run tests
run: pnpm test
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: pnpm install
- name: Install dependencies to legacy folder
working-directory: legacy
run: pnpm install
- name: Publish
run: pnpm publish --no-git-checks
env:
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ npm-debug.log*

# testing
coverage

# legacy builds
/legacy/index.cjs
/legacy/index.cjs.map
/legacy/index.js
/legacy/index.js.map
2 changes: 1 addition & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const path = require('path');
module.exports = {
stories: ['../stories/*.stories.(js|ts)'],
addons: ['@storybook/addon-essentials'],
framework: '@storybook/vue',
framework: '@storybook/vue3',
webpackFinal: async config => {
config.resolve.alias['vue-google-charts'] = path.resolve(
__dirname,
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
testMatch: ['<rootDir>/test/(*.)spec.(js|ts)'],
moduleFileExtensions: ['js', 'ts', 'vue'],
transform: {
'^.+\\.vue$': '@vue/vue2-jest',
'^.+\\.vue$': '@vue/vue3-jest',
'^.+\\.(t|j)sx?$': [
'@swc/jest',
{
Expand Down
3 changes: 3 additions & 0 deletions legacy/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "../.babelrc"
}
24 changes: 24 additions & 0 deletions legacy/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
module.exports = {
testEnvironment: 'jsdom',
testMatch: ['<rootDir>/test/(*.)spec.(js|ts)'],
moduleFileExtensions: ['js', 'ts', 'vue'],
transform: {
'^.+\\.vue$': '@vue/vue2-jest',
'^.+\\.(t|j)sx?$': [
'@swc/jest',
{
module: {
type: 'commonjs',
},
env: {
targets: {
node: 12,
},
},
},
],
},
collectCoverage: true,
collectCoverageFrom: ['<rootDir>/src/*'],
coverageReporters: ['lcovonly', 'text'],
};
24 changes: 24 additions & 0 deletions legacy/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"main": "./legacy/src/index.ts",
"types": "./legacy/src/index.d.ts",
"publishConfig": {
"main": "./legacy/index.cjs",
"module": "./legacy/index.js"
},
"scripts": {
"test:unit": "jest -c jest.config.js"
},
"devDependencies": {
"@babel/core": "7.17.9",
"@swc/core": "^1.2.124",
"@swc/jest": "^0.2.20",
"@vue/test-utils": "1",
"@vue/vue2-jest": "27.0.0-alpha.4",
"babel-jest": "27.5.1",
"core-js": "^3.22.2",
"jest": "27.5.1",
"rollup-plugin-vue2": "^0.8.1",
"vue": "2.6.14",
"vue-template-compiler": "2.6.14"
}
}
Loading

0 comments on commit f0863a7

Please sign in to comment.