Skip to content

Commit

Permalink
chore: refactor to workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Apr 17, 2024
1 parent 871a46f commit 157a97c
Show file tree
Hide file tree
Showing 21 changed files with 107 additions and 783 deletions.
22 changes: 20 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,40 @@
lib
dist
temp
.cache

test.db

/coverage
/external

.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

todo.md
yarn.lock
package-lock.json
pnpm-lock.yaml

todo.md
coverage/
node_modules/
npm-debug.log
yarn-debug.log
yarn-error.log
package-lock.json
tsconfig.temp.json
tsconfig.tsbuildinfo
report.*.json

.eslintcache
.DS_Store
.idea
.vscode
.yarn
*.suo
*.ntvs*
*.njsproj
Expand Down
47 changes: 14 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,21 @@
{
"name": "@satorijs/components",
"description": "UI Components for Satori",
"version": "0.6.0",
"main": "src/index.ts",
"files": [
"src"
"name": "@root/satori-components",
"private": true,
"type": "module",
"version": "1.0.0",
"workspaces": [
"packages/*"
],
"author": "Shigma <[email protected]>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/satorijs/semisigure.git"
},
"bugs": {
"url": "https://github.com/satorijs/semisigure/issues"
},
"homepage": "https://github.com/satorijs/semisigure",
"keywords": [
"chat",
"message",
"messenger",
"ui",
"component"
],
"peerDependencies": {
"@vueuse/core": "^9.13.0",
"element-plus": "^2",
"vue": "^3"
"scripts": {
"lint": "eslint packages --ext=ts --cache"
},
"devDependencies": {
"@vueuse/core": "^9.13.0",
"element-plus": "2.3.4",
"vue": "^3.2.47"
},
"dependencies": {
"@popperjs/core": "npm:@sxzz/popperjs-es@^2.11.7",
"@satorijs/element": "^2.4.0"
"@cordisjs/eslint-config": "^1.1.1",
"@types/node": "^20.11.30",
"esbuild": "^0.18.20",
"esbuild-register": "^3.5.0",
"eslint": "^8.57.0",
"typescript": "^5.4.3"
}
}
39 changes: 39 additions & 0 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@satorijs/components-vue",
"description": "Satori Components for Vue",
"version": "0.7.0",
"main": "src/index.ts",
"files": [
"src"
],
"author": "Shigma <[email protected]>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/satorijs/components.git"
},
"bugs": {
"url": "https://github.com/satorijs/components/issues"
},
"homepage": "https://github.com/satorijs/components",
"keywords": [
"chat",
"message",
"messenger",
"ui",
"component",
"vue",
"element"
],
"peerDependencies": {
"@vueuse/core": "*",
"vue": "*"
},
"devDependencies": {
"@vueuse/core": "^10.9.0",
"vue": "^3.4.21"
},
"dependencies": {
"@satorijs/element": "^2.4.0"
}
}
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/chat/input.vue → packages/vue/src/input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function handleDataTransfer(event: Event, transfer: DataTransfer) {
const reader = new FileReader()
reader.addEventListener('load', function () {
emit('send', segment(type, { url: reader.result }).toString())
emit('send', segment(type, { src: reader.result }).toString())
}, false)
reader.readAsDataURL(file)
}
Expand Down
10 changes: 6 additions & 4 deletions src/chat/render.ts → packages/vue/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@ const render: FunctionalComponent<segment[]> = (elements, ctx) => {
return attrs.content
} else if (type === 'at') {
return h('span', `@${attrs.name}`)
} else if (type === 'image') {
return h('img', { src: attrs.url })
} else if (type === 'img') {
return h('img', { src: attrs.src })
} else if (type === 'audio') {
return h('audio', { src: attrs.url, controls: true })
return h('audio', { src: attrs.src, controls: true })
} else if (type === 'video') {
return h('video', { src: attrs.url, controls: true })
return h('video', { src: attrs.src, controls: true })
} else if (inline.includes(type)) {
return h(type, render(children, ctx))
} else if (type === 'spl') {
return h('span', { class: 'spoiler' }, render(children, ctx))
} else if (type === 'p' || type === 'message') {
return h('p', render(children, ctx))
} else if (type === 'iframe') {
return h('iframe', { innerHTML: attrs.content })
} else {
return render(children, ctx)
}
Expand Down
6 changes: 6 additions & 0 deletions packages/vue/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.base",
"include": [
"src",
],
}
3 changes: 0 additions & 3 deletions src/index.ts

This file was deleted.

32 changes: 0 additions & 32 deletions src/popper/dropdown.vue

This file was deleted.

7 changes: 0 additions & 7 deletions src/popper/index.ts

This file was deleted.

119 changes: 0 additions & 119 deletions src/popper/popper.vue

This file was deleted.

7 changes: 0 additions & 7 deletions src/popper/shared.ts

This file was deleted.

Loading

0 comments on commit 157a97c

Please sign in to comment.