Skip to content

Commit

Permalink
fix(reactively): circular dependency (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
AkaraChen authored Dec 19, 2022
1 parent 39ff2fd commit 40075cc
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/decorators/component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CustomElementProps } from "../types";
import { CustomElementProps } from "shared";

export function Component(options: CustomElementProps) {
return function (_class: any) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/decorators/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineWatcher } from "packages/reactively";
import { WatcherOptions } from "../types";
import { WatcherOptions } from "shared";

export * from "./props";
export * from "./event";
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/decorators/props.ts
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import "reflect-metadata";

export * from "./wc-class";
export * from "./types";
export * from "shared";
export * from "./decorators";
export * from "./constants";
6 changes: 3 additions & 3 deletions packages/core/src/wc-class.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion packages/reactively/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"author": "",
"license": "ISC",
"dependencies": {
"jwcjs": "workspace:*"
"shared": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion packages/reactively/src/define-reactive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
WatcherOptions,
COMPONENT_EVENT_METADATA_KEY,
COMPONENT_PROP_METADATA_KEY,
} from "jwcjs";
} from "shared";
import { ReactiveEvent } from "./call-reactive";

/**
Expand Down
1 change: 1 addition & 0 deletions packages/shared/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./src";
15 changes: 15 additions & 0 deletions packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/shared/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from "./constants";
export * from "./types";
File renamed without changes.
File renamed without changes.
16 changes: 11 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 40075cc

Please sign in to comment.