Skip to content

Commit b03d463

Browse files
Robo-Rindependabot[bot]Umi8UmiSarah LeventhalRonald Jerez
authored
feat(vue3): various upgrades for vue 3
Upgrades dependencies, migrates to storybook + vite, removes default export. BREAKING CHANGE: Users will have to use es6-style named imports instead. Also merges in changes from upstream master since beta branch diverged. closes #44, closes #52 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Sarah Umi Leventhal <35374315+Umi8Umi@users.noreply.github.com> Co-authored-by: Sarah Leventhal <sarah.leventhal@mastercard.com> Co-authored-by: Ronald Jerez <ronald.jerez@mastercard.com> Co-authored-by: Reuk Bundara <bundarareuk@gmail.com>
1 parent 2fe4afd commit b03d463

Some content is hidden

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

61 files changed

+28359
-36209
lines changed

.eslintignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/dist/
2+
/coverage
3+
.vscode
4+
.yalc
5+
yalc.lock
6+
*.timestamp-*
7+
8+
# Storybook Build
9+
storybook-static/

.eslintrc.cjs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true
6+
},
7+
globals: {
8+
vi: true
9+
},
10+
parserOptions: {
11+
ecmaVersion: 'latest',
12+
parser: require.resolve('@typescript-eslint/parser'),
13+
sourceType: 'module'
14+
},
15+
extends: [
16+
'eslint:recommended',
17+
'plugin:vue/vue3-recommended',
18+
'plugin:storybook/recommended',
19+
'plugin:prettier/recommended'
20+
],
21+
plugins: ['vue'],
22+
rules: {
23+
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
24+
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
25+
'vue/component-tags-order': [
26+
'error',
27+
{
28+
order: ['script', 'template', 'style']
29+
}
30+
],
31+
'vue/multi-word-component-names': 'off'
32+
},
33+
overrides: [
34+
{
35+
files: ['vitest.setup.ts', '**/__tests__/*.{j,t}s', '**/tests/**/*.{spec,test}.{j,t}s'],
36+
env: {
37+
jest: true
38+
},
39+
plugins: ['vitest'],
40+
extends: ['plugin:vitest/recommended'],
41+
rules: {
42+
'vitest/no-commented-out-tests': 'off'
43+
}
44+
}
45+
]
46+
}

.eslintrc.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/workflows/coverage.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
name: Coverage
22

33
on:
4-
- push
5-
- pull_request
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- beta
69

710
jobs:
811
coverage:
912
name: Coverage
1013
runs-on: ubuntu-latest
1114
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-node@v2
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
1417
with:
15-
node-version: 14
18+
node-version: 16
1619
- name: Install
1720
run: npm ci
1821
- name: Test
1922
run: npm test
2023
- name: Coveralls
21-
uses: coverallsapp/github-action@master
24+
uses: coverallsapp/github-action@v2
2225
with:
2326
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docs.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/workflows/gh-pages-beta.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish beta demo page
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
7+
8+
jobs:
9+
docs:
10+
name: Generate Docs
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 16
17+
- name: Install
18+
run: npm ci
19+
- name: Build Docs
20+
run: npm run build:docs
21+
- name: Deploy Github Pages
22+
uses: peaceiris/actions-gh-pages@v3
23+
with:
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
publish_dir: ./storybook-static
26+
destination_dir: beta
27+

.github/workflows/gh-pages-latest.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish latest demo page
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
docs:
10+
name: Generate Docs
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: 16
17+
- name: Install
18+
run: npm ci
19+
- name: Build Docs
20+
run: npm run build:docs
21+
- name: Deploy Github Pages
22+
uses: peaceiris/actions-gh-pages@v3
23+
with:
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
publish_dir: ./build
26+
destination_dir: latest
27+

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v2
1818
- uses: actions/setup-node@v2
1919
with:
20-
node-version: 14
20+
node-version: 16
2121
- name: Install
2222
run: npm ci
2323
- name: Test

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
.DS_Store
22
node_modules
33
/dist
4-
/build
54
/coverage
5+
.yalc
6+
yalc.lock
7+
*.timestamp-*
68

79
# local env files
810
.env.local
@@ -21,3 +23,6 @@ yarn-error.log*
2123
*.njsproj
2224
*.sln
2325
*.sw?
26+
27+
# Storybook Build
28+
storybook-static/

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16.16.0

.prettierignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## directories
2+
/dist/
3+
backstop_data
4+
test/unit/coverage/
5+
6+
## file extensions
7+
*.*
8+
!.storybook/
9+
!*.cjs
10+
!*.cts
11+
!*.js
12+
!*.json
13+
!*.jsonc
14+
!*.mjs
15+
!*.mts
16+
!*.vue
17+
!*.ts
18+
!*.yml

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"printWidth": 120,
5+
"arrowParens": "always",
6+
"trailingComma": "none"
7+
}

.storybook/main.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { type StorybookConfig } from '@storybook/vue3-vite'
2+
import { mergeConfig } from 'vite'
3+
import { execSync } from 'child_process'
4+
5+
const STORYBOOK_VERSION_NUM = execSync('git describe --tags --abbrev=0').toString().trim()
6+
const STORYBOOK_COMMIT_HASH = execSync('git rev-parse --short HEAD').toString().trim()
7+
8+
const config: StorybookConfig = {
9+
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
10+
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
11+
core: {
12+
builder: '@storybook/builder-vite',
13+
disableTelemetry: true
14+
},
15+
framework: {
16+
name: '@storybook/vue3-vite',
17+
options: {}
18+
},
19+
docs: {
20+
autodocs: 'tag'
21+
},
22+
env: (config) => ({
23+
...config,
24+
STORYBOOK_VERSION_NUM,
25+
STORYBOOK_COMMIT_HASH
26+
}),
27+
async viteFinal(config, { configType }) {
28+
// return the customized config
29+
return mergeConfig(config, {
30+
// customize the Vite config here
31+
})
32+
}
33+
}
34+
35+
export default config

.storybook/manager.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { addons } from '@storybook/manager-api'
2+
3+
addons.setConfig({
4+
sidebar: {
5+
filters: {
6+
patterns: (item: any) => {
7+
return !item.tags.includes('hidden')
8+
}
9+
}
10+
}
11+
})

.storybook/preview.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
import { type Preview, setup } from '@storybook/vue3'
2+
import { type App } from 'vue'
3+
import { plugin as InputFacade } from '@/plugin.js'
4+
import Checkbox from '@/stories/components/Checkbox.vue'
5+
import Display from '@/stories/components/Display.vue'
6+
import Field from '@/stories/components/Field.vue'
7+
8+
import './styles.scss'
9+
10+
const versionNum = import.meta.env.STORYBOOK_VERSION_NUM
11+
const commitHash = import.meta.env.STORYBOOK_COMMIT_HASH
12+
13+
setup((app: App) => {
14+
app.use(InputFacade)
15+
app.component('Checkbox', Checkbox)
16+
app.component('Display', Display)
17+
app.component('Field', Field)
18+
})
19+
20+
const preview: Preview = {
21+
globalTypes: {
22+
version: {
23+
name: 'Version',
24+
description: 'Vue Input Facade version',
25+
defaultValue: versionNum,
26+
toolbar: {
27+
icon: 'info',
28+
items: [
29+
{
30+
value: versionNum,
31+
title: `${versionNum}`
32+
},
33+
{
34+
value: commitHash,
35+
title: `Commit Hash: ${commitHash}`
36+
}
37+
]
38+
}
39+
}
40+
}
41+
}
42+
43+
export default preview
File renamed without changes.

0 commit comments

Comments
 (0)