diff --git a/packages/core/package.json b/packages/core/package.json index 73137e7..6ccd167 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -30,7 +30,6 @@ "license": "MIT", "devDependencies": { "@rollup/plugin-node-resolve": "^15.0.1", - "csstype": "^3.1.1", "esbuild": "^0.16.9", "rollup": "^3.7.4", "rollup-plugin-esbuild": "^5.0.0", @@ -39,6 +38,7 @@ "dependencies": { "@jwcjs/reactively": "workspace:^1.0.0", "@jwcjs/runtime": "workspace:^1.0.0", + "shared": "workspace:^1.0.0", "reflect-metadata": "^0.1.13", "rollup-plugin-ts": "^3.0.2" } diff --git a/packages/core/src/decorators/component.ts b/packages/core/src/decorators/component.ts index 09eb83e..8d4dde5 100644 --- a/packages/core/src/decorators/component.ts +++ b/packages/core/src/decorators/component.ts @@ -1,4 +1,4 @@ -import { CustomElementProps } from "../types"; +import { CustomElementProps } from "shared"; export function Component(options: CustomElementProps) { return function (_class: any) { diff --git a/packages/core/src/decorators/index.ts b/packages/core/src/decorators/index.ts index 1482a86..267b6a4 100644 --- a/packages/core/src/decorators/index.ts +++ b/packages/core/src/decorators/index.ts @@ -1,5 +1,5 @@ import { defineWatcher } from "packages/reactively"; -import { WatcherOptions } from "../types"; +import { WatcherOptions } from "shared"; export * from "./props"; export * from "./event"; diff --git a/packages/core/src/decorators/props.ts b/packages/core/src/decorators/props.ts index 4a10720..b0791e1 100644 --- a/packages/core/src/decorators/props.ts +++ b/packages/core/src/decorators/props.ts @@ -1,5 +1,5 @@ import { defineProps } from "packages/reactively"; -import { PropOptions } from "../types"; +import { PropOptions } from "shared"; export function Prop(options: PropOptions): PropertyDecorator { return (target, key) => { diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 5fc7415..c5cc9c6 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,6 +1,5 @@ import "reflect-metadata"; export * from "./wc-class"; -export * from "./types"; +export * from "shared"; export * from "./decorators"; -export * from "./constants"; diff --git a/packages/core/src/wc-class.ts b/packages/core/src/wc-class.ts index 93b09cd..6b148a4 100644 --- a/packages/core/src/wc-class.ts +++ b/packages/core/src/wc-class.ts @@ -1,8 +1,8 @@ import { createCSSElement, defineProxy } from "packages/reactively"; import { createElement, diff, removeAttrs } from "packages/runtime"; -import { COMPONENT_PROP_METADATA_KEY } from "./constants/metas.constant"; -import { JwcElement, PropOptions } from "./types/jwc-element.interface"; -import { WatcherOptions } from "./types/watcher.interface"; +import { COMPONENT_PROP_METADATA_KEY } from "../../shared/src/constants/metas.constant"; +import { JwcElement, PropOptions } from "shared"; +import { WatcherOptions } from "../../shared/src/types/watcher.interface"; /** * The map of adoptedStyleSheets. diff --git a/packages/reactively/package.json b/packages/reactively/package.json index fe5a29c..7df5ac2 100644 --- a/packages/reactively/package.json +++ b/packages/reactively/package.json @@ -9,6 +9,6 @@ "author": "", "license": "ISC", "dependencies": { - "jwcjs": "workspace:*" + "shared": "workspace:*" } } diff --git a/packages/reactively/src/define-reactive.ts b/packages/reactively/src/define-reactive.ts index abd60aa..d583d0f 100644 --- a/packages/reactively/src/define-reactive.ts +++ b/packages/reactively/src/define-reactive.ts @@ -3,7 +3,7 @@ import { WatcherOptions, COMPONENT_EVENT_METADATA_KEY, COMPONENT_PROP_METADATA_KEY, -} from "jwcjs"; +} from "shared"; import { ReactiveEvent } from "./call-reactive"; /** diff --git a/packages/shared/index.ts b/packages/shared/index.ts new file mode 100644 index 0000000..3bd16e1 --- /dev/null +++ b/packages/shared/index.ts @@ -0,0 +1 @@ +export * from "./src"; diff --git a/packages/shared/package.json b/packages/shared/package.json new file mode 100644 index 0000000..ed83854 --- /dev/null +++ b/packages/shared/package.json @@ -0,0 +1,15 @@ +{ + "name": "shared", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "dependencies": { + "csstype": "^3.1.1" + } +} diff --git a/packages/core/src/constants/index.ts b/packages/shared/src/constants/index.ts similarity index 100% rename from packages/core/src/constants/index.ts rename to packages/shared/src/constants/index.ts diff --git a/packages/core/src/constants/metas.constant.ts b/packages/shared/src/constants/metas.constant.ts similarity index 100% rename from packages/core/src/constants/metas.constant.ts rename to packages/shared/src/constants/metas.constant.ts diff --git a/packages/shared/src/index.ts b/packages/shared/src/index.ts new file mode 100644 index 0000000..e6869b1 --- /dev/null +++ b/packages/shared/src/index.ts @@ -0,0 +1,2 @@ +export * from "./constants"; +export * from "./types"; diff --git a/packages/core/src/types/index.ts b/packages/shared/src/types/index.ts similarity index 100% rename from packages/core/src/types/index.ts rename to packages/shared/src/types/index.ts diff --git a/packages/core/src/types/jwc-element.interface.ts b/packages/shared/src/types/jwc-element.interface.ts similarity index 100% rename from packages/core/src/types/jwc-element.interface.ts rename to packages/shared/src/types/jwc-element.interface.ts diff --git a/packages/core/src/types/local-jsx.d.ts b/packages/shared/src/types/local-jsx.d.ts similarity index 100% rename from packages/core/src/types/local-jsx.d.ts rename to packages/shared/src/types/local-jsx.d.ts diff --git a/packages/core/src/types/watcher.interface.ts b/packages/shared/src/types/watcher.interface.ts similarity index 100% rename from packages/core/src/types/watcher.interface.ts rename to packages/shared/src/types/watcher.interface.ts diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4469544..36b4404 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,21 +37,21 @@ importers: '@jwcjs/reactively': workspace:^1.0.0 '@jwcjs/runtime': workspace:^1.0.0 '@rollup/plugin-node-resolve': ^15.0.1 - csstype: ^3.1.1 esbuild: ^0.16.9 reflect-metadata: ^0.1.13 rollup: ^3.7.4 rollup-plugin-esbuild: ^5.0.0 rollup-plugin-ts: ^3.0.2 + shared: workspace:^1.0.0 vite: ^4.0.1 dependencies: '@jwcjs/reactively': link:../reactively '@jwcjs/runtime': link:../runtime reflect-metadata: 0.1.13 rollup-plugin-ts: 3.0.2_rollup@3.7.4 + shared: link:../shared devDependencies: '@rollup/plugin-node-resolve': 15.0.1_rollup@3.7.4 - csstype: 3.1.1 esbuild: 0.16.9 rollup: 3.7.4 rollup-plugin-esbuild: 5.0.0_izxe3qgshrdgvej6ppxwob7vay @@ -79,13 +79,19 @@ importers: packages/reactively: specifiers: - jwcjs: workspace:* + shared: workspace:* dependencies: - jwcjs: link:../core + shared: link:../shared packages/runtime: specifiers: {} + packages/shared: + specifiers: + csstype: ^3.1.1 + dependencies: + csstype: 3.1.1 + packages: /@ampproject/remapping/2.2.0: @@ -1212,7 +1218,7 @@ packages: /csstype/3.1.1: resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==} - dev: true + dev: false /debug/4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}