Commit Graph
38 Commits
Author SHA1 Message Date
qwqcode 91ac907778 chore(ui/deps): upgrade deps for ui 2024-10-19 16:25:48 +08:00
qwqcode 7c251fd067 feat(api/vote): add get vote status endpoint (#998)
A new HTTP API endpoint `GET /votes/:target_name/:target_id` is now available. (See https://artalk.js.org/http-api.html#tag/Vote/operation/GetVote)

- Implement GET endpoint for retrieving vote status
- Add tests for vote functionality

Related to: #997

This is a prerequisite PR for #983.
2024-10-06 22:31:59 +08:00
qwqcode abac3f0f36 feat(ui/eslint): add eslint plugin for artalk ui development (#995)
- Implemented `eslint-plugin-artalk` to enforce Artalk's development conventions.
- Added setup script for UI development environment.
- Created test cases for Artalk plugin rules.
- Configured TypeScript and build settings for the plugin.
- Updated documentation with installation and configuration instructions.
2024-10-05 19:19:22 +08:00
qwqcode 34d793697c chore(docs): refine deployment documentation 2024-09-19 18:27:24 +08:00
qwqcode 53aaf27fdf chore(deps): upgrade frontend deps 2024-09-18 21:56:38 +08:00
qwqcode cf7725edba refactor(go): bump the module version and support go install (#979)
BREAKING CHANGE: The original Go module name was `github.com/ArtalkJS/Artalk`, which has now been modified to `github.com/artalkjs/artalk/v2` (all lowercase). This change may affect the CI pipeline or other areas if you are compiling the Artalk server and have specified the fixed Go module name. Regarding the original `-ldflags -X github.com/ArtalkJS/Artalk/internal/config.Version` and `CommitHash` definitions, please remove them, as they are now obsolete. The `Version` has been hardcoded into the Go code, and the `CommitHash` is now read from the Go build info via runtime/debug’s vcs.revision value. This change only affects the server developers and does not impact the frontend UI client.
2024-09-18 21:43:43 +08:00
qwqcode 4bd3537c0d fix(test): separate test db to isolate concurrent test instances (#975) 2024-09-16 16:46:38 +08:00
qwqcode 9dcfd9cd91 chore(deps): upgrade deps 2024-09-15 09:52:26 +08:00
qwqcode 9fde40d843 chore(ci): improve golang build workflow on circle ci 2024-09-04 21:23:23 +08:00
qwqcode 4eb3dbaca2 fix(db): sql error with custom table prefix (#970) 2024-09-04 21:00:13 +08:00
qwqcode 1ff0c4c10f chore(deps): upgrade deps 2024-09-03 21:18:16 +08:00
qwqcode 67b37b4612 chore(deps): upgrade frontend deps 2024-08-29 14:25:06 +08:00
qwqcode cf58a545b5 chore(deps): upgrade deps 2024-08-28 16:12:43 +08:00
qwqcode 08f58cd38b chore(deps/ui): upgrade deps for frontend 2024-08-17 15:07:56 +08:00
qwqcode d22d34c223 fix(plugin/lightbox): fix import for non-browser env (#931)
* fix(plugin_lightbox): fix lightbox plugin import for non-browser env

* add artalk as peerDependency

* using default object of import result

* test and fix photoSwipe, fancyBox

* add minimal reproducible example

* refine docs
2024-07-25 16:30:34 +08:00
qwqcode 77e9a687ac docs(dev): refine contributing.md and translate to chinese 2024-06-01 21:27:00 +08:00
qwqcode 2dfee533da fix(api/stats): fix site_pv response body and add unit tests (#896) 2024-05-29 10:57:14 +08:00
qwqcode d2161cc0fb refactor(dao): improve QueryDBWithCache func and concurrent unit tests (#884) 2024-05-26 17:15:32 +08:00
qwqcode dbb3c55148 refactor(transfer): improve the reliability of the transfer (#883) 2024-05-25 18:00:27 +08:00
qwqcode 824f122dcb refactor(ui/stat): use class selector for pageview elements by default (#880)
The statistics UI component has been updated. The default selectors for `pvEl` and `countEl` have changed from `#ArtalkPV` and `#ArtalkCount` to `.artalk-pv-count` and `.artalk-comment-count` (see #826 for more details). However, it remains backward compatible with the `#ArtalkPV` and `#ArtalkCount` elements for older versions, no HTML client updates are necessary.

In this PR, we also introduced a configuration option called `statPageKeyAttr` (value `"data-page-key"` by default) for customizing the attribute name that the statistics component uses to fetch the page key.
2024-05-23 13:47:07 +08:00
qwqcode f226d476e5 chore(typo): fix typo for moderator.keywords.replace in conf 2024-04-27 13:26:49 +08:00
qwqcode b613a4368c fix(log): improve log system and fix memory leaks (#843) 2024-04-18 18:25:19 +08:00
qwqcode ec6d2b2e60 fix(db/migrator): remove foreign key constraints and better root_id generation (#835)
Add function to delete all foreign key constraints when migration.

Leave relationship maintenance to the program and reduce the difficulty of database management. Because there are many different DBs and the implementation of foreign keys may be different, and the DB may not support foreign keys, so don't rely on the foreign key function of the DB system.
2024-04-14 23:46:22 +08:00
qwqcode 915b5f48b4 refactor(ui/prettier): add prettier code formatter 2024-04-14 23:42:06 +08:00
Mr.Hope a7af2b7aaa chore(ui/deps): update deps for ui (#820) 2024-04-08 14:42:24 +08:00
qwqcode c2c5a80d8d refactor(comments_get): reduce api complexity by introducing LiteDB (#800)
* refactor(comments_get): reduce interface complexity by introducing LiteDB

* test: add unit test

* add more unit test case
2024-04-07 19:17:01 +08:00
qwqcode 589850d311 refactor(api): refactor HTTP API to version 2 (#735)
* refactor(api): refactor HTTP API to version 2

* refactor: remove forced site_origin check

* refactor: update http client

* fix

* add more api description and error code

* reduce nestings in response structures

* separate unread

* refactor(api/comments): get comments

* refactor: frontend api module

* chore: remove vite temporary file

* chore: restore swagger file

* update

* 移除为管理员分配站点名的站点隔离功能,简化实现

* refactor pagesAllFetch

* fix ci

* remove useless codes

* limiter protected paths

* add test for version endpoint

* rename handler code files

* code file separate

* fix some bug of interacting with backend

* add fetch error class for handling

* fix and rename

* refactor: checker support both `Promise` and callback fn

* fix new checker captcha iframe url

* rename and add swagger id field

* replace tab with spaces in go comment

* chore: refine

* complete the validate tag for request fields and enable `--defaultRequired`

90% of the request fields of our API are required,100% of response fields in our API are required.
Each field add validate:"required" is easy to miss.

* replace original api client with auto-generated codes

* artalk pkg apply new api client

* artalk-sidebar pkg apply new api client

* fix issues

* fix sidebar locale conf and refactor user login

* fix and refactor captcha and limiter

* fix ui testing

* add script to build http client by swagger.json
2024-01-24 21:33:30 +08:00
qwqcode a8bcd41f36 refactor(ui): refactor directory structure (#712)
* refactor(ui): refactor directory structure

* update config files

* update github workflows

* update vscode settings.json

* update docs

* update build scripts

* tidy up

* fix docs build
2023-12-21 23:51:26 +08:00
qwqcode 835a886dc8 test(ssg): add SSG test case (#675) 2023-12-18 19:09:04 +08:00
qwqcode 08be04979d chore(docs): bump Artalk to v2.7.0 2023-12-17 20:33:21 +08:00
qwqcode bad248534c docs: revise and add more examples
BREAKING CHANGE: The following top-level functions exported by the 'artalk' npm package have been deprecated: `Artalk.update`, `Artalk.reload`, and `Artalk.destroy`. These methods now require invocation on an instance created by either `Artalk.init` or `new Artalk`. Please utilize instance-level methods instead, such as `artalkInstance.update`. For more information, refer to  [the documentation](https://artalk.js.org/guide/frontend/import-framework.html). The update was implemented to enable the concurrent creation of multiple instances, adapting to situations where Vue components are simultaneously referenced across various pages. Initially, only a singular instance was permitted to mitigate memory leak concerns. However, this proved limiting for scenarios involving the caching of multiple component instances through 'keep-alive.' To better suit intricate SPA application needs, the choice was made to permit the creation of multiple independent instances. It's crucial to remember to manually invoke the `artalk.destroy` method when releasing components to avoid memory leaks (Issue #660).
2023-12-17 19:16:33 +08:00
qwqcode 9fb658599a test(vue): add test cases for vue framework 2023-12-17 00:48:24 +08:00
qwqcode 2b7d0ecb72 chore(ci): integrate with codecov 2023-11-19 23:35:12 +08:00
qwqcode 2bdb806aaf refactor(conf): better config.NewFromFile with error handle 2023-09-01 17:02:05 +08:00
qwqcode 0cbb5b2dd1 test(core): add tests for core 2023-09-01 17:02:00 +08:00
qwqcode 8336bb0345 chore: fix ci testing 2023-09-01 17:01:59 +08:00
qwqcode 84d6f9728e chore: fix test app 2023-09-01 17:01:58 +08:00
qwqcode bf13e1cdba refactor(test): create common test pkg 2023-09-01 17:01:51 +08:00