Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WDS-129 update vue #551

Merged
merged 8 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/itchy-kiwis-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@soramitsu-ui/ui': minor
---

**feat**: update vue and storybook
7 changes: 7 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ module.exports = {
'vue/one-component-per-file': 'off',
},
},
// TODO: delete when `as` to `satisfies` replaced
{
files: ['**/packages/ui/stories/**/*.stories.ts'],
rules: {
'@typescript-eslint/consistent-type-assertions': 'off',
},
},
{
files: ['**/*.spec.ts', '**/*.spec.cy.ts'],
rules: {
Expand Down
2 changes: 0 additions & 2 deletions Dockerfile

This file was deleted.

14 changes: 0 additions & 14 deletions Jenkinsfile

This file was deleted.

38 changes: 22 additions & 16 deletions packages/ui/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,34 @@
const path = require('path')
const { loadConfigFromFile, mergeConfig } = require('vite')

const path = require('path');
const {
loadConfigFromFile,
mergeConfig
} = require('vite');
function resolve(...paths) {
return path.resolve(__dirname, '..', ...paths)
return path.resolve(__dirname, '..', ...paths);
}

module.exports = {
stories: ['../stories/**/*.stories.@(js|jsx|ts|tsx)'],
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
core: {
builder: 'storybook-builder-vite',
},
/**
* @param {import('vite').UserConfig} config
*/
async viteFinal(config) {
const { config: mainConfig } = await loadConfigFromFile(
{ mode: 'development', command: 'serve' },
resolve('vite.config.ts'),
)
const {
config: mainConfig
} = await loadConfigFromFile({
mode: 'development',
command: 'serve'
}, resolve('vite.config.ts'));

// vue plugin is already presented in storybook's config, so we need to deduplicate it
mainConfig.plugins = mainConfig.plugins.filter((x) => !/vite:vue/.test(x.name))

return mergeConfig(config, mainConfig)
mainConfig.plugins = mainConfig.plugins.filter(x => !/vite:vue/.test(x.name));
return mergeConfig(config, mainConfig);
},
}
framework: {
name: '@storybook/vue3-vite',
options: {}
},
docs: {
autodocs: true
}
};
6 changes: 4 additions & 2 deletions packages/ui/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { defineConfig } from 'cypress'
import viteConfig from './vite.config'
import { mergeConfig } from 'vite'
import fs from 'fs'

function useAxeCoreReader(on: Cypress.PluginEvents) {
Expand Down Expand Up @@ -29,7 +31,7 @@ export default defineConfig({
bundler: 'vite',

// additional opts to the main `vite.config.ts`
viteConfig: {
viteConfig: mergeConfig(viteConfig, {
resolve: {
alias: {
vue: 'vue/dist/vue.esm-bundler.js',
Expand All @@ -39,7 +41,7 @@ export default defineConfig({
include: ['cypress-plugin-tab'],
exclude: ['platform'],
},
},
}),
},
},
})
Loading