mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
chore: new builds & types using tsdown (#20)
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
{
|
||||
"name": "@vjs-10/html-media-elements",
|
||||
"type": "module",
|
||||
"version": "0.1.0",
|
||||
"description": "HTML/DOM-specific media element components and utilities",
|
||||
"description": "HTML media element components and utilities",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"module": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js"
|
||||
"default": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"build": "tsdown",
|
||||
"build:watch": "tsdown --watch --silent",
|
||||
"dev": "pnpm run build:watch",
|
||||
"test": "echo \"No tests yet\"",
|
||||
"clean": "rm -rf dist"
|
||||
},
|
||||
@@ -34,7 +36,7 @@
|
||||
"@vjs-10/media-store": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tsup": "^8.5.0",
|
||||
"tsdown": "^0.15.4",
|
||||
"typescript": "^5.9.2"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
import type { Constructor, CustomElement } from '@open-wc/context-protocol';
|
||||
import type { MediaStore } from '@vjs-10/media-store';
|
||||
|
||||
import { ProviderMixin } from '@open-wc/context-protocol';
|
||||
import { createMediaStore } from '@vjs-10/media-store';
|
||||
|
||||
export class MediaProvider extends ProviderMixin(HTMLElement) {
|
||||
const ProviderHTMLElement: Constructor<CustomElement> = ProviderMixin(HTMLElement);
|
||||
|
||||
export class MediaProvider extends ProviderHTMLElement {
|
||||
contexts = {
|
||||
mediaStore: () => {
|
||||
mediaStore: (): MediaStore => {
|
||||
return createMediaStore();
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
// @ts-expect-error - fix types after (Rahim)
|
||||
customElements.define('media-provider', MediaProvider);
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": ["src"]
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
{
|
||||
"extends": "../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src"
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["dist", "node_modules"]
|
||||
"include": ["src"]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { defineConfig } from 'tsdown';
|
||||
|
||||
export default defineConfig({
|
||||
entry: 'src/index.ts',
|
||||
platform: 'browser',
|
||||
format: 'es',
|
||||
sourcemap: true,
|
||||
clean: true,
|
||||
dts: {
|
||||
oxc: true,
|
||||
},
|
||||
});
|
||||
@@ -1,21 +0,0 @@
|
||||
import { defineConfig } from 'tsup';
|
||||
|
||||
export default defineConfig({
|
||||
entry: ['src/index.ts'],
|
||||
format: ['cjs', 'esm'],
|
||||
clean: true,
|
||||
sourcemap: true,
|
||||
outDir: 'dist',
|
||||
external: [
|
||||
// Keep all dependencies external for library builds
|
||||
/^@vjs-10\//,
|
||||
/^[^.]/,
|
||||
],
|
||||
// Generate TypeScript declarations with custom config
|
||||
dts: {
|
||||
compilerOptions: {
|
||||
composite: false,
|
||||
incremental: false,
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user