Skip to content

Commit

Permalink
Co-locate vue storybook stories with components (#470)
Browse files Browse the repository at this point in the history
* moving story files

* rebuilding dist

* adjusting linting settings
  • Loading branch information
stephiescastle authored Jun 26, 2024
1 parent c680d01 commit 01e9f83
Show file tree
Hide file tree
Showing 288 changed files with 12,223 additions and 856 deletions.
1 change: 1 addition & 0 deletions apps/html-storybook/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { defineConfig } from 'vite'
// https://vitejs.dev/config/
export default defineConfig({
publicDir: './../public/',
// because pnpm and stories are in node_modules
resolve: {
preserveSymlinks: true
},
Expand Down
7 changes: 2 additions & 5 deletions apps/vue-storybook/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
import remarkGfm from 'remark-gfm'
const config = {
stories: [
'./../stories/**/*.stories.@(js|jsx|ts|tsx)',
'./../stories/**/*.docs.mdx',
'./../docs/**/*.stories.@(js|jsx|ts|tsx)',
'./../docs/**/*.docs.mdx',
'./../../../packages/vue/src/**/*.stories.@(js|jsx|ts|tsx)'
'./../node_modules/@explorer-1/vue/src/**/*.stories.@(js|jsx|ts|tsx)',
'./../node_modules/@explorer-1/vue/src/**/*.docs.mdx'
],
addons: [
{
Expand Down
8 changes: 4 additions & 4 deletions apps/vue-storybook/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ declare module 'vue' {
HeroListingIndex: typeof import('./node_modules/@explorer-1/vue/src/components/HeroListingIndex/HeroListingIndex.vue')['default']
HeroMedia: typeof import('./node_modules/@explorer-1/vue/src/components/HeroMedia/HeroMedia.vue')['default']
HeroMedium: typeof import('./node_modules/@explorer-1/vue/src/components/HeroMedium/HeroMedium.vue')['default']
HomePage: typeof import('./node_modules/@explorer-1/vue/src/templates/www/HomePage.vue')['default']
HomePage: typeof import('./node_modules/@explorer-1/vue/src/templates/www/HomePage/HomePage.vue')['default']
HomepageCarousel: typeof import('./node_modules/@explorer-1/vue/src/components/HomepageCarousel/HomepageCarousel.vue')['default']
HomepageCarouselItem: typeof import('./node_modules/@explorer-1/vue/src/components/HomepageCarouselItem/HomepageCarouselItem.vue')['default']
HomepageEmbedBlock: typeof import('./node_modules/@explorer-1/vue/src/components/HomepageEmbedBlock/HomepageEmbedBlock.vue')['default']
Expand Down Expand Up @@ -180,18 +180,18 @@ declare module 'vue' {
PageAsteroidWatchContent: typeof import('./node_modules/@explorer-1/vue/src/templates/PageAsteroidWatchContent/PageAsteroidWatchContent.vue')['default']
PageAsteroidWatchIndex: typeof import('./node_modules/@explorer-1/vue/src/templates/PageAsteroidWatchIndex/PageAsteroidWatchIndex.vue')['default']
PageAudioDetail: typeof import('./node_modules/@explorer-1/vue/src/templates/PageAudioDetail/PageAudioDetail.vue')['default']
PageContent: typeof import('./node_modules/@explorer-1/vue/src/templates/PageContent.vue')['default']
PageContent: typeof import('./node_modules/@explorer-1/vue/src/templates/PageContent/PageContent.vue')['default']
PageCuratedGallery: typeof import('./node_modules/@explorer-1/vue/src/templates/PageCuratedGallery/PageCuratedGallery.vue')['default']
PageEduNewsDetail: typeof import('./node_modules/@explorer-1/vue/src/templates/edu/PageEduNewsDetail.vue')['default']
PageError: typeof import('./node_modules/@explorer-1/vue/src/templates/PageError/PageError.vue')['default']
PageEventDetail: typeof import('./node_modules/@explorer-1/vue/src/templates/PageEventDetail.vue')['default']
PageEventDetail: typeof import('./node_modules/@explorer-1/vue/src/templates/PageEventDetail/PageEventDetail.vue')['default']
PageGoDirectory: typeof import('./node_modules/@explorer-1/vue/src/templates/PageGoDirectory/PageGoDirectory.vue')['default']
PageImageDetail: typeof import('./node_modules/@explorer-1/vue/src/templates/PageImageDetail/PageImageDetail.vue')['default']
PageInfographicDetail: typeof import('./node_modules/@explorer-1/vue/src/templates/PageInfographicDetail/PageInfographicDetail.vue')['default']
PageListingIndex: typeof import('./node_modules/@explorer-1/vue/src/templates/PageListingIndex.vue')['default']
PageMaintenanceMode: typeof import('./node_modules/@explorer-1/vue/src/templates/PageMaintenanceMode/PageMaintenanceMode.vue')['default']
PageMissionDetail: typeof import('./node_modules/@explorer-1/vue/src/templates/PageMissionDetail/PageMissionDetail.vue')['default']
PageNewsDetail: typeof import('./node_modules/@explorer-1/vue/src/templates/PageNewsDetail.vue')['default']
PageNewsDetail: typeof import('./node_modules/@explorer-1/vue/src/templates/PageNewsDetail/PageNewsDetail.vue')['default']
PagePodcast: typeof import('./node_modules/@explorer-1/vue/src/templates/PagePodcast/PagePodcast.vue')['default']
PagePodcastSeason: typeof import('./node_modules/@explorer-1/vue/src/templates/PagePodcastSeason/PagePodcastSeason.vue')['default']
PagePressKitIndex: typeof import('./node_modules/@explorer-1/vue/src/templates/PagePressKitIndex/PagePressKitIndex.vue')['default']
Expand Down
88 changes: 0 additions & 88 deletions apps/vue-storybook/docs/foundation/FontVariants.vue

This file was deleted.

6 changes: 4 additions & 2 deletions apps/vue-storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"build": "storybook build -c .storybook -o storybook_compiled",
"percy": "percy storybook http://localhost:6006",
"percy:dry-run": "percy storybook http://localhost:6006 --dry-run",
"lint": "eslint ./stories",
"lint:fix": "eslint ./stories --fix",
"lint:app": "eslint './.storybook/**/*.@(js|ts)'",
"lint:app:fix": "eslint './.storybook/**/*.@(js|ts)' --fix",
"lint": "eslint './../../packages/vue/src/**/*.stories.@(js|ts|mdx)' && pnpm lint:app",
"lint:fix": "eslint './../../packages/vue/src/**/*.stories.@(js|ts|mdx)' --fix && pnpm lint:app:fix",
"init-msw": "msw init public/"
},
"dependencies": {
Expand Down
82 changes: 0 additions & 82 deletions apps/vue-storybook/stories/components/BlockDialog.stories.mdx

This file was deleted.

7 changes: 3 additions & 4 deletions apps/vue-storybook/tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ import explorer1Config from '@explorer-1/common/tailwind.config'
export default {
...explorer1Config,
content: [
'stories/**/*',
'docs/**/*',
'./node_modules/@explorer-1/vue/src/components/**/*.vue',
'./node_modules/@explorer-1/vue/src/templates/**/*.vue'
'./node_modules/@explorer-1/vue/src/docs/**/*',
'./node_modules/@explorer-1/vue/src/components/**/*',
'./node_modules/@explorer-1/vue/src/templates/**/*'
]
}
5 changes: 5 additions & 0 deletions apps/vue-storybook/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ export default defineConfig({
]
})
],
publicDir: './../public/',
// because pnpm and stories are in node_modules
resolve: {
preserveSymlinks: true
},
server: {
watch: {
usePolling: true
Expand Down
35 changes: 12 additions & 23 deletions packages/configs/eslint/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: {}, // Add recommendedConfig property
allConfig: {}, // Add allConfig property
allConfig: {} // Add allConfig property
})

export default [
Expand All @@ -37,29 +37,22 @@ export default [
'**/*.ts',
'**/*.tsx',
'**/*.cts',
'**/*.mts',
],
ignores: [
'**/*.d.ts',
'**/dist/**/*',
'**/dist/**/*',
'**/.nuxt/*',
'**/node_modules/**/*',
'.gitignore',
'**/*.mts'
],
ignores: ['**/*.d.ts', '**/dist/**/*', '**/.nuxt/*', '**/node_modules/**/*', '.gitignore'],
plugins: {
'@typescript-eslint': tsPlugin,
'@stylistic': stylistic,
'@stylistic': stylistic
},
languageOptions: {
parser: vueParser,
parserOptions: {
parser: tsParser,
parser: tsParser
},
ecmaVersion: 'latest',
ecmaVersion: 'latest'
},
rules: {
'semi': 'off',
semi: 'off',
'@stylistic/semi': ['warn', 'never'],
// allow async-await
'generator-star-spacing': 'off',
Expand All @@ -69,7 +62,7 @@ export default [
'no-void': 'off',
'multiline-ternary': 'off',
'no-unused-vars': 'warn',

'no-undef': 'warn',

'prefer-promise-reject-errors': 'off',
Expand All @@ -78,11 +71,7 @@ export default [
'vue/multi-word-component-names': 'warn',

// TypeScript
quotes: [
'warn',
'single',
{ avoidEscape: true, allowTemplateLiterals: true },
],
quotes: ['warn', 'single', { avoidEscape: true, allowTemplateLiterals: true }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
Expand All @@ -98,8 +87,8 @@ export default [
'storybook/prefer-pascal-case': 'off',
'storybook/story-exports': 'off',
'vue/singleline-html-element-content-newline': 'off',
'vue/max-attributes-per-line': 'off',
},
'vue/max-attributes-per-line': 'off'
}
},
eslintPluginPrettierRecommended,
eslintPluginPrettierRecommended
]
3 changes: 2 additions & 1 deletion packages/configs/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"publishConfig": {
"access": "public"
},
"prettier": "@explorer-1/prettier-config",
"devDependencies": {
"@eslint/eslintrc": "^3.1.0",
"@eslint/js": "^9.3.0",
Expand All @@ -21,4 +22,4 @@
"eslint-plugin-vue": "^9.26.0",
"vue-eslint-parser": "^9.4.2"
}
}
}
Loading

0 comments on commit 01e9f83

Please sign in to comment.