Skip to content

Commit

Permalink
refactor: use lit element to refactor widget component
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Wang <[email protected]>
  • Loading branch information
ruibaby committed Feb 25, 2024
1 parent 3f09e72 commit 3cbf883
Show file tree
Hide file tree
Showing 83 changed files with 5,177 additions and 14,756 deletions.
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ build {
// build frontend before build
tasks.getByName('compileJava').dependsOn('buildFrontend')
}

halo {
version = "2.12.3"
}
44 changes: 12 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"scripts": {
"build:packages": "pnpm --filter \"./packages/**\" build",
"example:dev": "pnpm --filter \"./packages/example\" dev",
"release:packages": "pnpm --filter \"./packages/**\" release"
},
"license": "GPL-3.0",
"author": {
"name": "Halo OSS Team",
"url": "https://github.com/halo-dev"
Expand All @@ -15,36 +11,20 @@
"url": "https://github.com/ruibaby"
}
],
"keywords": [],
"license": "GPL-3.0",
"dependencies": {
"axios": "^0.27.2",
"pinia": "^2.1.3",
"vue": "^3.3.4",
"vue-router": "^4.2.2",
"@vueuse/components": "^10.3.0",
"@vueuse/core": "^10.3.0"
"scripts": {
"build:packages": "pnpm --filter \"./packages/**\" build",
"example:dev": "pnpm --filter \"./packages/example\" dev",
"release:packages": "pnpm --filter \"./packages/**\" release"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.3.0",
"@types/jsdom": "^20.0.1",
"@types/node": "^18.16.16",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/compiler-sfc": "^3.3.4",
"@vue/eslint-config-prettier": "^7.1.0",
"@vue/eslint-config-typescript": "^11.0.3",
"@vue/test-utils": "^2.3.2",
"@vue/tsconfig": "^0.4.0",
"@rushstack/eslint-patch": "^1.7.2",
"@tsconfig/node18": "^18.2.2",
"eslint": "^8.42.0",
"eslint-plugin-vue": "^9.14.1",
"jsdom": "^19.0.0",
"npm-run-all": "^4.1.5",
"@types/node": "^18.19.18",
"@typescript-eslint/eslint-plugin": "^6.21.0",
"@typescript-eslint/parser": "^6.21.0",
"eslint": "^8.57.0",
"prettier": "^2.8.8",
"rollup-plugin-copy-merge": "^1.0.2",
"typescript": "~5.2.0",
"vite": "^4.3.9",
"vitest": "^0.28.5",
"vue-tsc": "^1.8.13"
"typescript": "~5.3.3",
"vite": "^4.5.2"
}
}
1 change: 0 additions & 1 deletion packages/comment-widget/.env.development

This file was deleted.

1 change: 0 additions & 1 deletion packages/comment-widget/.env.production

This file was deleted.

23 changes: 0 additions & 23 deletions packages/comment-widget/.eslintrc.cjs

This file was deleted.

17 changes: 17 additions & 0 deletions packages/comment-widget/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": ["@typescript-eslint"],
"env": {
"browser": true
}
}
6 changes: 1 addition & 5 deletions packages/comment-widget/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,15 @@ pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
Expand Down
4 changes: 0 additions & 4 deletions packages/comment-widget/.npmignore

This file was deleted.

7 changes: 7 additions & 0 deletions packages/comment-widget/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"singleQuote": true,
"bracketSpacing": true,
"arrowParens": "always"
}
8 changes: 0 additions & 8 deletions packages/comment-widget/.release-it.json

This file was deleted.

6 changes: 0 additions & 6 deletions packages/comment-widget/env.d.ts

This file was deleted.

68 changes: 25 additions & 43 deletions packages/comment-widget/package.json
Original file line number Diff line number Diff line change
@@ -1,59 +1,41 @@
{
"name": "@halo-dev/comment-widget",
"version": "1.3.0",
"private": false,
"files": [
"dist"
"author": {
"name": "Halo",
"url": "https://github.com/halo-dev"
},
"maintainers": [
{
"name": "Ryan Wang",
"url": "https://github.com/ruibaby"
}
],
"type": "module",
"main": "./dist/halo-comment-widget.es.js",
"module": "./dist/halo-comment-widget.es.js",
"unpkg": "./dist/halo-comment-widget.umd.js",
"jsdelivr": "./dist/halo-comment-widget.umd.js",
"types": "./dist/index.d.ts",
"scripts": {
"dev": "vite build --watch --mode development",
"build": "run-p type-check build-only",
"preview": "vite preview --port 4173",
"test:unit": "vitest --environment jsdom",
"build-only": "vite build",
"type-check": "vue-tsc --noEmit -p tsconfig.json --composite false",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"prettier": "prettier --write './src/**/*.{vue,js,jsx,ts,tsx,css,scss,json,yml,yaml,html}'",
"gen-types": "tsc -d --emitDeclarationOnly && vue-typegen gen -s src -o dist",
"release": "release-it"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/halo-comment-widget.es.js"
},
"./dist/style.css": "./dist/style.css"
"import": "./dist/index.js"
}
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"dev": "tsc -w",
"build": "tsc",
"lint": "lit-analyzer && eslint 'src/**/*.ts'",
"prettier": "prettier \"**/*.{cjs,html,js,json,md,ts}\" --ignore-path ./.gitignore --write"
},
"dependencies": {
"@halo-dev/api-client": "^2.9.0",
"@halo-dev/components": "^1.5.0",
"autosize": "^6.0.1",
"@halo-dev/api-client": "^2.12.0",
"@lit/context": "^1.1.0",
"dayjs": "^1.11.10",
"emoji-mart-vue-fast": "^12.0.5",
"emoji-mart": "^5.5.2",
"javascript-time-ago": "^2.5.9",
"lodash.clonedeep": "^4.5.0"
"lit": "^3.1.2"
},
"devDependencies": {
"@iconify-json/mdi": "^1.1.52",
"@tailwindcss/forms": "^0.5.6",
"@types/autosize": "^4.0.1",
"@types/lodash.clonedeep": "^4.5.7",
"@types/qs": "^6.9.7",
"@types/uuid": "^8.3.4",
"autoprefixer": "^10.4.14",
"postcss": "^8.4.24",
"prettier-plugin-tailwindcss": "^0.1.13",
"release-it": "^15.11.0",
"sass": "^1.62.1",
"tailwindcss": "^3.3.3",
"tailwindcss-themer": "^2.0.3",
"unplugin-icons": "^0.14.15",
"vue-typegen": "^0.2.0"
"lit-analyzer": "^1.2.1"
}
}
Loading

0 comments on commit 3cbf883

Please sign in to comment.