Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kyubisation committed Sep 19, 2023
1 parent 1e52246 commit 6bc4e6e
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 17 deletions.
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,15 @@
"@storybook/testing-library": "0.2.1",
"@storybook/web-components": "^7.0.27",
"@storybook/web-components-vite": "^7.4.0",
"@types/glob": "^8.1.0",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "6.7.0",
"@typescript-eslint/parser": "6.7.0",
"@typescript-eslint/eslint-plugin": "6.7.2",
"@typescript-eslint/parser": "6.7.2",
"@web/test-runner": "^0.16.1",
"@web/test-runner-commands": "^0.7.0",
"@web/test-runner-playwright": "^0.10.1",
"chromatic": "7.1.0",
"chromatic": "7.2.0",
"eslint": "8.49.0",
"eslint-config-prettier": "9.0.0",
"eslint-plugin-jest": "27.4.0",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
}
]
},
"include": ["./src/**/*.ts", "node_modules/lit-scss-loader/types.d.ts"]
"include": ["./src/**/*.ts", "./src/**/*.tsx", "node_modules/lit-scss-loader/types.d.ts"]
}
36 changes: 23 additions & 13 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { PluginOption, defineConfig } from 'vite';
import postcssLit from 'rollup-plugin-postcss-lit';
// import dts from 'vite-plugin-dts';
import dts from 'vite-plugin-dts';
import glob from 'glob';
import { basename, dirname } from 'path';
import { basename, dirname, join } from 'path';
import { fileURLToPath } from 'url';

export const plugins: PluginOption[] = [
Expand All @@ -11,20 +11,30 @@ export const plugins: PluginOption[] = [
}),
];

// Include all directories containing an index.ts
const modules = glob
.sync('src/components/*/index.ts', {
cwd: dirname(fileURLToPath(import.meta.url)),
})
.map(dirname);

export default defineConfig({
// TODO: Add dts({ rollupTypes: true }) for production
plugins: [...plugins],
plugins: [
...plugins,
...modules.map((p) =>
dts({
entryRoot: p,
include: `${p}/**/*.{ts,tsx}`,
exclude: '**/*.{stories,spec,e2e}.{ts,tsx}',
}),
),
],
build: {
lib: {
// Could also be a dictionary or array of multiple entry points
entry: glob
.sync('src/components/*/index.ts', {
cwd: dirname(fileURLToPath(import.meta.url)),
})
.reduce(
(current, next) => Object.assign(current, { [basename(dirname(next))]: next }),
{} as Record<string, string>,
),
entry: modules.reduce(
(current, next) => Object.assign(current, { [basename(next)]: join(next, 'index.ts') }),
{} as Record<string, string>,
),
formats: ['es'],
},
minify: false,
Expand Down
13 changes: 13 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3136,6 +3136,14 @@
resolved "https://registry.yarnpkg.com/@types/find-cache-dir/-/find-cache-dir-3.2.1.tgz#7b959a4b9643a1e6a1a5fe49032693cc36773501"
integrity sha512-frsJrz2t/CeGifcu/6uRo4b+SzAwT4NYCVPu1GN8IB9XTzrpPkGuV0tmh9mN+/L0PklAlsC3u5Fxt0ju00LXIw==

"@types/glob@^8.1.0":
version "8.1.0"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-8.1.0.tgz#b63e70155391b0584dce44e7ea25190bbc38f2fc"
integrity sha512-IO+MJPVhoqz+28h1qLAcBEH2+xHMK6MTyHJc7MTnnYb6wsoLR29POVGJ7LycmVXIqyy/4/2ShP5sUwTXuOwb/w==
dependencies:
"@types/minimatch" "^5.1.2"
"@types/node" "*"

"@types/graceful-fs@^4.1.3":
version "4.1.6"
resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae"
Expand Down Expand Up @@ -3243,6 +3251,11 @@
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a"
integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==

"@types/minimatch@^5.1.2":
version "5.1.2"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca"
integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==

"@types/minimist@^1.2.0", "@types/minimist@^1.2.2":
version "1.2.2"
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c"
Expand Down

0 comments on commit 6bc4e6e

Please sign in to comment.