Skip to content

Commit 68efe99

Browse files
committed
refactor: move to monorepo
1 parent 2c6cd25 commit 68efe99

40 files changed

+806
-212
lines changed

.gitignore

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ dist-ssr
1313
*.local
1414

1515
# Editor directories and files
16-
.vscode/*
17-
!.vscode/extensions.json
1816
.idea
1917
.DS_Store
2018
*.suo

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist=true

package.json

+19-30
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,31 @@
11
{
2-
"name": "vue-termui",
3-
"private": false,
2+
"name": "root",
43
"version": "0.0.0",
5-
"files": [
6-
"LICENSE"
7-
],
4+
"private": true,
5+
"repository": {
6+
"url": "https://github.com/posva/vue-termui.git",
7+
"type": "git"
8+
},
89
"scripts": {
9-
"dev": "vite build --watch",
10-
"start": "node dist/index.mjs",
11-
"build": "vue-tsc --noEmit && vite build",
12-
"preview": "vite preview"
10+
"build": "pnpm run -r build --filter ./packages",
11+
"watch": "pnpm run build && pnpm run -r watch --parallel --filter ./packages",
12+
"test": "pnpm run -r test --parallel --filter ./packages",
13+
"docs:dev": "vitepress dev docs",
14+
"docs:build": "vitepress build docs",
15+
"docs:serve": "vitepress serve docs"
1316
},
14-
"dependencies": {
15-
"@vue/runtime-core": "^3.2.31",
16-
"ansi-escapes": "^5.0.0",
17-
"chalk": "^5.0.0",
18-
"cli-boxes": "^3.0.0",
19-
"cli-cursor": "^4.0.0",
20-
"cli-truncate": "^3.1.0",
21-
"indent-string": "^5.0.0",
22-
"slice-ansi": "^5.0.0",
23-
"string-width": "^5.1.0",
24-
"type-fest": "^2.12.0",
25-
"widest-line": "^4.0.1",
26-
"wrap-ansi": "^8.0.1",
27-
"ws": "^8.5.0",
28-
"yoga-layout-prebuilt": "^1.10.0"
17+
"engines": {
18+
"node": ">=16.0.0"
2919
},
3020
"devDependencies": {
3121
"@types/node": "^17.0.21",
32-
"@types/slice-ansi": "^5.0.0",
33-
"@types/wrap-ansi": "^8.0.1",
3422
"@vitejs/plugin-vue": "^2.2.0",
35-
"typescript": "^4.5.4",
23+
"c8": "^7.11.0",
24+
"typescript": "^4.6.2",
3625
"unplugin-auto-import": "^0.6.1",
37-
"vite": "^2.8.0",
26+
"vite": "^2.8.6",
27+
"vitest": "^0.5.9",
3828
"vue": "^3.2.25",
39-
"vue-tsc": "^0.31.4",
40-
"xterm": "^4.18.0"
29+
"vue-tsc": "^0.31.4"
4130
}
4231
}

packages/playground/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?
File renamed without changes.
File renamed without changes.

packages/playground/index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

packages/playground/package.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@vue-termui/playground",
3+
"private": true,
4+
"version": "0.0.0",
5+
"scripts": {
6+
"dev": "vite build --watch",
7+
"start": "node dist/index.mjs",
8+
"build": "vue-tsc --noEmit && vite build"
9+
},
10+
"dependencies": {},
11+
"devDependencies": {}
12+
}
4.19 KB
Binary file not shown.
File renamed without changes.
File renamed without changes.

src/env.d.ts renamed to packages/playground/src/env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference types="vite/client" />
22

33
declare module '*.vue' {
4-
import type { DefineComponent } from 'vue'
4+
import type { DefineComponent } from '@vue/runtime-core'
55
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
66
const component: DefineComponent<{}, {}, any>
77
export default component
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import App from './App.vue'
2-
// import App from './demos/Borders.vue'
31
import { createApp } from 'vue-termui'
2+
import App from './App.vue'
43

54
createApp(App).mount()

packages/playground/tsconfig.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "../../tsconfig.json",
3+
"compilerOptions": {
4+
"target": "esnext",
5+
"module": "esnext",
6+
"sourceMap": true,
7+
"lib": ["esnext", "dom"]
8+
},
9+
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
10+
"references": [{ "path": "./tsconfig.node.json" }]
11+
}
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"compilerOptions": {
3+
"composite": true,
4+
"module": "esnext",
5+
"moduleResolution": "node"
6+
},
7+
"include": ["vite.config.ts"]
8+
}

vite.config.ts renamed to packages/playground/vite.config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ export default defineConfig({
8282
publicDir: false,
8383
resolve: {
8484
alias: {
85-
'vue-termui': './src/tui/renderer/index.ts',
85+
'vue-termui': '../termui/src/index.ts',
8686
},
8787
},
8888
build: {
8989
target: 'esnext',
9090
sourcemap: true,
9191
minify: false,
9292
rollupOptions: {
93-
input: ['src/tui/index.ts'],
93+
input: ['src/main.ts'],
9494
external: [
9595
'events',
9696
'assert',
@@ -122,7 +122,7 @@ export default defineConfig({
122122
},
123123
},
124124
watch: {
125-
include: ['src/tui/index.ts'],
125+
include: ['src/main.ts'],
126126
},
127127
},
128128
plugins: [

packages/termui/package.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "vue-termui",
3+
"private": false,
4+
"version": "0.0.0",
5+
"files": [
6+
"LICENSE"
7+
],
8+
"scripts": {
9+
"dev": "vite build --watch",
10+
"start": "node dist/index.mjs",
11+
"build": "echo TODO:"
12+
},
13+
"dependencies": {
14+
"@vue/runtime-core": "^3.2.31",
15+
"ansi-escapes": "^5.0.0",
16+
"chalk": "^5.0.0",
17+
"cli-boxes": "^3.0.0",
18+
"cli-cursor": "^4.0.0",
19+
"cli-truncate": "^3.1.0",
20+
"indent-string": "^5.0.0",
21+
"slice-ansi": "^5.0.0",
22+
"string-width": "^5.1.0",
23+
"type-fest": "^2.12.0",
24+
"widest-line": "^4.0.1",
25+
"wrap-ansi": "^8.0.1",
26+
"ws": "^8.5.0",
27+
"yoga-layout-prebuilt": "^1.10.0"
28+
},
29+
"devDependencies": {
30+
"@types/slice-ansi": "^5.0.0",
31+
"@types/wrap-ansi": "^8.0.1"
32+
}
33+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/tui/renderer/index.ts renamed to packages/termui/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { createRenderer, App, Component } from '@vue/runtime-core'
2-
import { onExit, Signal } from '../deps/signal-exit'
2+
import { onExit, Signal } from './deps/signal-exit'
33
import cliCursor from 'cli-cursor'
44
import { createLog } from './LogUpdate'
55
import {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)