Skip to content

Commit f0863a7

Browse files
thabarbadosdangreen
authored andcommitted
feat: vue 3 support (#175)
BREAKING CHANGE: Vue 3 support.
1 parent 9b5264b commit f0863a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+5397
-736
lines changed

.eslintignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# builds
2+
package
3+
dist
4+
5+
# legacy builds
6+
/legacy/index.cjs
7+
/legacy/index.js

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ jobs:
2121
cache: 'pnpm'
2222
- name: Install dependencies
2323
run: pnpm install
24+
- name: Install dependencies to legacy folder
25+
working-directory: legacy
26+
run: pnpm install
2427
- name: Run tests
2528
run: pnpm test

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
registry-url: 'https://registry.npmjs.org'
2222
- name: Install dependencies
2323
run: pnpm install
24+
- name: Install dependencies to legacy folder
25+
working-directory: legacy
26+
run: pnpm install
2427
- name: Publish
2528
run: pnpm publish --no-git-checks
2629
env:

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@ npm-debug.log*
1616

1717
# testing
1818
coverage
19+
20+
# legacy builds
21+
/legacy/index.cjs
22+
/legacy/index.cjs.map
23+
/legacy/index.js
24+
/legacy/index.js.map

.storybook/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const path = require('path');
33
module.exports = {
44
stories: ['../stories/*.stories.(js|ts)'],
55
addons: ['@storybook/addon-essentials'],
6-
framework: '@storybook/vue',
6+
framework: '@storybook/vue3',
77
webpackFinal: async config => {
88
config.resolve.alias['vue-google-charts'] = path.resolve(
99
__dirname,

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module.exports = {
33
testMatch: ['<rootDir>/test/(*.)spec.(js|ts)'],
44
moduleFileExtensions: ['js', 'ts', 'vue'],
55
transform: {
6-
'^.+\\.vue$': '@vue/vue2-jest',
6+
'^.+\\.vue$': '@vue/vue3-jest',
77
'^.+\\.(t|j)sx?$': [
88
'@swc/jest',
99
{

legacy/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../.babelrc"
3+
}

legacy/jest.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
testEnvironment: 'jsdom',
3+
testMatch: ['<rootDir>/test/(*.)spec.(js|ts)'],
4+
moduleFileExtensions: ['js', 'ts', 'vue'],
5+
transform: {
6+
'^.+\\.vue$': '@vue/vue2-jest',
7+
'^.+\\.(t|j)sx?$': [
8+
'@swc/jest',
9+
{
10+
module: {
11+
type: 'commonjs',
12+
},
13+
env: {
14+
targets: {
15+
node: 12,
16+
},
17+
},
18+
},
19+
],
20+
},
21+
collectCoverage: true,
22+
collectCoverageFrom: ['<rootDir>/src/*'],
23+
coverageReporters: ['lcovonly', 'text'],
24+
};

legacy/package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"main": "./legacy/src/index.ts",
3+
"types": "./legacy/src/index.d.ts",
4+
"publishConfig": {
5+
"main": "./legacy/index.cjs",
6+
"module": "./legacy/index.js"
7+
},
8+
"scripts": {
9+
"test:unit": "jest -c jest.config.js"
10+
},
11+
"devDependencies": {
12+
"@babel/core": "7.17.9",
13+
"@swc/core": "^1.2.124",
14+
"@swc/jest": "^0.2.20",
15+
"@vue/test-utils": "1",
16+
"@vue/vue2-jest": "27.0.0-alpha.4",
17+
"babel-jest": "27.5.1",
18+
"core-js": "^3.22.2",
19+
"jest": "27.5.1",
20+
"rollup-plugin-vue2": "^0.8.1",
21+
"vue": "2.6.14",
22+
"vue-template-compiler": "2.6.14"
23+
}
24+
}

0 commit comments

Comments
 (0)