Skip to content

Commit

Permalink
Revert "remove unused deps & code"
Browse files Browse the repository at this point in the history
This reverts commit 80e9bd9.
  • Loading branch information
50l3r committed Oct 3, 2023
1 parent 80e9bd9 commit 69842a8
Show file tree
Hide file tree
Showing 9 changed files with 39,111 additions and 9,355 deletions.
100 changes: 100 additions & 0 deletions .storybook/main.js.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
const path = require('path')
// const postcss = require('../postcss.config.js')
// const { mergeConfig } = require('vite')
const { VitePWA } = require('vite-plugin-pwa')
const { viteStaticCopy } = require('vite-plugin-static-copy')

const INVALID_CHAR_REGEX = /[\u0000-\u001F"#$&*+,:;<=>?[\]^`{|}\u007F_]/g
const DRIVE_LETTER_REGEX = /^[a-z]:/i
function sanitizeFileName(name) {
const match = DRIVE_LETTER_REGEX.exec(name)
const driveLetter = match ? match[0] : ''
return (
driveLetter +
name.slice(driveLetter.length).replace(INVALID_CHAR_REGEX, '+')
)
}

module.exports = {
stories: [
'../src/components/**/*.story.@(js|jsx|ts|tsx|mdx)',
'../src/plugins/**/*.story.@(js|jsx|ts|tsx|mdx)',
'../src/views/**/*.story.@(js|jsx|ts|tsx|mdx)'
],

addons: [{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss')
}
}
}, '@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-interactions', 'storybook-dark-mode', '@storybook/addon-mdx-gfm'],

framework: {
name: '@storybook/vue3-vite',
options: {}
},

features: {
storyStoreV7: true
},

typescript: {
check: false,
checkOptions: {},
reactDocgen: 'react-docgen-typescript',
reactDocgenTypescriptOptions: {
shouldExtractLiteralValuesFromEnum: true,
propFilter: (prop) =>
prop.parent ? !/node_modules/.test(prop.parent.fileName) : true
}
},

async viteFinal(config, { configType }) {
config.resolve.alias = {
...config.resolve.alias,
'@': path.resolve(__dirname, '../src'),
'tailwind.config': path.resolve(__dirname, '../tailwind.config.js')
}

config.build = {
...config.build,
...{
rollupOptions: {
output: { sanitizeFileName: sanitizeFileName }
}
}
}

config.optimizeDeps = {
...config.optimizeDeps,
include: ['tailwind.config']
}

config.plugins.push(VitePWA({}))

config.plugins.push(
viteStaticCopy({
targets: [
{
src: './plugin.js',
dest: './'
}
]
})
)

// config.build.commonjsOptions = {
// ...config.build.commonjsOptions,
// include: ['../tailwind-config.js', '../node_modules/**'],
// esmExternals: true
// }

return config
},

docs: {
autodocs: true
}
}
85 changes: 47 additions & 38 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@ const config: StorybookConfig = {
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'storybook-dark-mode'
'storybook-dark-mode',
'@storybook/addon-mdx-gfm',
{
name: '@storybook/addon-postcss',
options: {
postcssLoaderOptions: {
implementation: require('postcss')
}
}
}
],
framework: {
name: '@storybook/vue3-vite',
Expand All @@ -23,48 +32,48 @@ const config: StorybookConfig = {
docs: {
autodocs: false,
defaultName: 'Documentación'
}
// async viteFinal(config, { configType }) {
// config.resolve.alias = {
// ...config.resolve.alias,
// '@': path.resolve(__dirname, '../src'),
// 'tailwind.config': path.resolve(__dirname, '../tailwind.config.js')
// }
},
async viteFinal(config, { configType }) {
config.resolve.alias = {
...config.resolve.alias,
'@': path.resolve(__dirname, '../src'),
'tailwind.config': path.resolve(__dirname, '../tailwind.config.js')
}

// // config.build = {
// // ...config.build,
// // ...{
// // rollupOptions: {
// // output: { sanitizeFileName: sanitizeFileName }
// // }
// // }
// // }
// config.build = {
// ...config.build,
// ...{
// rollupOptions: {
// output: { sanitizeFileName: sanitizeFileName }
// }
// }
// }

// config.optimizeDeps = {
// ...config.optimizeDeps,
// include: ['tailwind.config', 'react']
// }
config.optimizeDeps = {
...config.optimizeDeps,
include: ['tailwind.config', 'react']
}

// config.plugins.push(VitePWA({}))
config.plugins.push(VitePWA({}))

// config.plugins.push(
// viteStaticCopy({
// targets: [
// {
// src: './plugin.js',
// dest: './'
// }
// ]
// })
// )
config.plugins.push(
viteStaticCopy({
targets: [
{
src: './plugin.js',
dest: './'
}
]
})
)

// // config.build.commonjsOptions = {
// // ...config.build.commonjsOptions,
// // include: ['../tailwind-config.js', '../node_modules/**'],
// // esmExternals: true
// // }
// config.build.commonjsOptions = {
// ...config.build.commonjsOptions,
// include: ['../tailwind-config.js', '../node_modules/**'],
// esmExternals: true
// }

// return config
// }
return config
}
}
export default config
5 changes: 5 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { addons } from '@storybook/addons'

addons.setConfig({
panelPosition: 'right'
})
145 changes: 145 additions & 0 deletions .storybook/preview.js.old
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
import React from 'react'
import { app } from '@storybook/vue3'
import { themes } from '@storybook/theming'
import { DocsContainer } from '@storybook/addon-docs'
import { useDarkMode } from 'storybook-dark-mode'

// PINIA
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

// KODAMA
import { createApp } from '../src/main'
import '../src/config/_style'

// CUSTOM CONFIG
import router from './app/config/router'
import menu from './app/config/menu'
import settings from './app/config/settings'
import { useAuth } from './app/modules/auth'

const components = import.meta.globEager('./app/components/**/*.vue')
const layouts = import.meta.globEager('./app/layout/**/*.vue')

const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

const vm = createApp(
{
router: router,
components: { ...components, ...layouts },
menu: menu,
settings: settings,
auth: {
getName: () => {
const auth = useAuth()
return auth.name
},
getLastName: () => {
const auth = useAuth()
return auth.lastname
},
isLoggedIn: () => {
const auth = useAuth()
return auth.isLoggedIn
},
login: (username, password) => {
const auth = useAuth()
return auth.login(username, password)
},
forgot: (email) => {
const auth = useAuth()
return auth.forgot(email)
},
logout: () => {
const auth = useAuth()
return auth.logout()
}
}
},
app
)

vm.use(pinia)

const brand = {
// Brand
brandTitle: 'Kodama',
brandUrl: 'https://calltek.es',
brandImage: 'https://place-hold.it/350x150',
brandTarget: '_self'
}

const dark = {
...themes.dark,
...brand,

// UI
appContentBg: '#111827', // gray-900
appBorderColor: '#1F2937', // gray-800
appBg: '#0b0f19',

// Text colors
textColor: '#9CA3AF', // gray-400

// Toolbar default and active colors
barTextColor: '#9CA3AF', // gray-400
barSelectedColor: '#1A56DB', //primary
barBg: '#111827', //gray-900

// Form colors
inputBg: '#374151', //gray-700
inputBorder: '#4B5563', //gray-600
inputTextColor: '#9CA3AF', //gray-400
inputBorderRadius: 4
}

const light = {
...themes.normal,
...brand,

// UI
appContentBg: '#F3F4F6', // gray-100
appBorderColor: '#D1D5DB', //gray-300
appBg: '#0b0f19',

// Text colors
textColor: '#9CA3AF',

// Toolbar default and active colors
barTextColor: '#4B5563', //gray-600
barSelectedColor: '#1A56DB', //primary
barBg: '#fff',

// Form colors
inputBg: '#F9FAFB',
inputBorder: '#D1D5DB',
inputTextColor: '#111827',
inputBorderRadius: 4
}

export const parameters = {
layout: 'centered',
darkMode: {
classTarget: 'html',
stylePreview: true,

// Override the default dark theme
dark: dark,
// Override the default light theme
light: light
},
docs: {
container: (props) => {
const isDark = useDarkMode()

const { id: storyId, storyById } = props.context
const {
parameters: { docs = {} }
} = storyById(storyId)
docs.theme = isDark ? dark : light

return React.createElement(DocsContainer, props)
}
}
}
Loading

0 comments on commit 69842a8

Please sign in to comment.