diff --git a/package.json b/package.json index a417c3e..7f0e016 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kevisual/container", - "version": "1.0.0", + "version": "1.0.1", "description": "", "main": "dist/container.js", "publishConfig": { @@ -16,10 +16,6 @@ "./edit": { "import": "./dist/container-edit.js", "require": "./dist/container-edit.js" - }, - "./container.css": { - "import": "./dist/container.css", - "require": "./dist/container.css" } }, "scripts": { @@ -44,6 +40,8 @@ "rimraf": "^6.0.1", "rollup": "^4.22.4", "rollup-plugin-copy": "^3.5.0", + "rollup-plugin-dts": "^6.1.1", + "scheduler": "^0.23.2", "typescript": "^5.5.4" }, "peerDependencies": { @@ -52,9 +50,8 @@ "eventemitter3": "^5.0.1" }, "dependencies": { + "@kevisual/router": "0.0.6-alpha-2", "nanoid": "^5.0.7", - "rollup-plugin-dts": "^6.1.1", - "scheduler": "^0.23.2", "zustand": "^4.5.5" } } \ No newline at end of file diff --git a/src/browser.ts b/src/browser.ts new file mode 100644 index 0000000..b4f9df7 --- /dev/null +++ b/src/browser.ts @@ -0,0 +1,13 @@ +import { QueryRouterServer } from '@kevisual/router/browser'; + +export const app = new QueryRouterServer({}); + +app + .route({ + path: 'demo', + key: 'demo', + }) + .define(async (ctx) => { + // + }) + .addTo(app); diff --git a/src/container-old.ts b/src/legacy/container-old.ts similarity index 98% rename from src/container-old.ts rename to src/legacy/container-old.ts index 97cf093..5e6fdb1 100644 --- a/src/container-old.ts +++ b/src/legacy/container-old.ts @@ -1,9 +1,9 @@ // @ts-nocheck import createEmotion from '@emotion/css/create-instance'; import EventEmitter from 'eventemitter3'; -import { ContainerEvent } from './event/continer'; -import { RenderCode } from './render'; -import { codeUrlManager } from './code-url'; +import { ContainerEvent } from '../event/continer'; +import { RenderCode } from '../render'; +import { codeUrlManager } from '../code-url'; const handleOneCode = async (data: RenderData) => { const { code } = data; diff --git a/src/container.css b/src/legacy/container.css similarity index 100% rename from src/container.css rename to src/legacy/container.css diff --git a/src/store/index.ts b/src/store/index.ts index e998b3b..08e7b4a 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,4 +1,4 @@ -import { handleCode, RenderData } from '../container-old'; +import { handleCode, RenderData } from '../legacy/container-old'; import { createStore } from 'zustand/vanilla'; export type ContainerStore = { loading: boolean; diff --git a/src/utils/get-tree.ts b/src/utils/get-tree.ts index 25e8137..bc29dee 100644 --- a/src/utils/get-tree.ts +++ b/src/utils/get-tree.ts @@ -1,4 +1,4 @@ -import { RenderData } from '../container-old'; +import { RenderData } from '../legacy/container-old'; export const getTree = (data: RenderData[], id: string) => { const node = data.find((node) => node.id === id); diff --git a/tsconfig.json b/tsconfig.json index 92fb8ba..d11d070 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,9 +12,12 @@ "strict": false, "baseUrl": ".", "rootDir": "src", + "moduleResolution": "bundler", + "isolatedModules": true, + "moduleDetection": "force", + "jsx": "react-jsx", "noUnusedLocals": false, "noUnusedParameters": false, - "moduleResolution": "node", "declaration": true }, "include": [