-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. closes #44, closes #52
- Loading branch information
Showing
57 changed files
with
28,291 additions
and
36,178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/dist/ | ||
/coverage | ||
.vscode | ||
.yalc | ||
yalc.lock | ||
*.timestamp-* | ||
|
||
# Storybook Build | ||
storybook-static/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
module.exports = { | ||
root: true, | ||
env: { | ||
browser: true, | ||
node: true | ||
}, | ||
globals: { | ||
vi: true | ||
}, | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
parser: require.resolve('@typescript-eslint/parser'), | ||
sourceType: 'module' | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:vue/vue3-recommended', | ||
'plugin:storybook/recommended', | ||
'plugin:prettier/recommended' | ||
], | ||
plugins: ['vue'], | ||
rules: { | ||
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', | ||
'vue/component-tags-order': [ | ||
'error', | ||
{ | ||
order: ['script', 'template', 'style'] | ||
} | ||
], | ||
'vue/multi-word-component-names': 'off' | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['vitest.setup.ts', '**/__tests__/*.{j,t}s', '**/tests/**/*.{spec,test}.{j,t}s'], | ||
env: { | ||
jest: true | ||
}, | ||
plugins: ['vitest'], | ||
extends: ['plugin:vitest/recommended'], | ||
rules: { | ||
'vitest/no-commented-out-tests': 'off' | ||
} | ||
} | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
16.16.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
## directories | ||
/dist/ | ||
backstop_data | ||
test/unit/coverage/ | ||
|
||
## file extensions | ||
*.* | ||
!.storybook/ | ||
!*.cjs | ||
!*.cts | ||
!*.js | ||
!*.json | ||
!*.jsonc | ||
!*.mjs | ||
!*.mts | ||
!*.vue | ||
!*.ts | ||
!*.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"printWidth": 120, | ||
"arrowParens": "always", | ||
"trailingComma": "none" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { type StorybookConfig } from '@storybook/vue3-vite' | ||
import { mergeConfig } from 'vite' | ||
import { execSync } from 'child_process' | ||
|
||
const STORYBOOK_VERSION_NUM = execSync('git describe --tags --abbrev=0').toString().trim() | ||
const STORYBOOK_COMMIT_HASH = execSync('git rev-parse --short HEAD').toString().trim() | ||
|
||
const config: StorybookConfig = { | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: ['@storybook/addon-links', '@storybook/addon-essentials'], | ||
core: { | ||
builder: '@storybook/builder-vite', | ||
disableTelemetry: true | ||
}, | ||
framework: { | ||
name: '@storybook/vue3-vite', | ||
options: {} | ||
}, | ||
docs: { | ||
autodocs: 'tag' | ||
}, | ||
env: (config) => ({ | ||
...config, | ||
STORYBOOK_VERSION_NUM, | ||
STORYBOOK_COMMIT_HASH | ||
}), | ||
async viteFinal(config, { configType }) { | ||
// return the customized config | ||
return mergeConfig(config, { | ||
// customize the Vite config here | ||
}) | ||
} | ||
} | ||
|
||
export default config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { addons } from '@storybook/manager-api' | ||
|
||
addons.setConfig({ | ||
sidebar: { | ||
filters: { | ||
patterns: (item: any) => { | ||
return !item.tags.includes('hidden') | ||
} | ||
} | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { type Preview, setup } from '@storybook/vue3' | ||
import { type App } from 'vue' | ||
import { plugin as InputFacade } from '@/plugin.js' | ||
import Checkbox from '@/stories/components/Checkbox.vue' | ||
import Display from '@/stories/components/Display.vue' | ||
import Field from '@/stories/components/Field.vue' | ||
|
||
import './styles.scss' | ||
|
||
const versionNum = import.meta.env.STORYBOOK_VERSION_NUM | ||
const commitHash = import.meta.env.STORYBOOK_COMMIT_HASH | ||
|
||
setup((app: App) => { | ||
app.use(InputFacade) | ||
app.component('Checkbox', Checkbox) | ||
app.component('Display', Display) | ||
app.component('Field', Field) | ||
}) | ||
|
||
const preview: Preview = { | ||
globalTypes: { | ||
version: { | ||
name: 'Version', | ||
description: 'Vue Input Facade version', | ||
defaultValue: versionNum, | ||
toolbar: { | ||
icon: 'info', | ||
items: [ | ||
{ | ||
value: versionNum, | ||
title: `${versionNum}` | ||
}, | ||
{ | ||
value: commitHash, | ||
title: `Commit Hash: ${commitHash}` | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
|
||
export default preview |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.