Skip to content

Commit

Permalink
refactor(esm): replace require json file with import json file (#574)
Browse files Browse the repository at this point in the history
* refactor(esm): replace require json file with import json file

* refactor(package.json): upgrade @petercatai/assistant
  • Loading branch information
ch-liuzhide authored Dec 16, 2024
1 parent 9cfca4a commit de69310
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 41 deletions.
2 changes: 1 addition & 1 deletion assistant/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@petercatai/assistant",
"version": "1.0.18",
"version": "1.0.20",
"description": "PeterCat Assistant Application",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions assistant/src/GitInsight/components/GitInsightIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Lottie from 'lottie-react';
import React, { useMemo } from 'react';

const Fork = require('../../assets/fork.json');
const Commit = require('../../assets/commit.json');
const Star = require('../../assets/star.json');
import * as Commit from '../../assets/commit.json';
import * as Fork from '../../assets/fork.json';
import * as Star from '../../assets/star.json';

interface GitInsightIconProps {
type?: 'fork' | 'commit' | 'star';
Expand Down
62 changes: 31 additions & 31 deletions assistant/src/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@
*/

*:where(.petercat-lui,.petercat-lui *),
::before:where(.petercat-lui,.petercat-lui *),
::after:where(.petercat-lui,.petercat-lui *) {
:where(.petercat-lui,.petercat-lui *)::before,
:where(.petercat-lui,.petercat-lui *)::after {
box-sizing: border-box;
/* 1 */
border-width: 0;
Expand All @@ -124,8 +124,8 @@
/* 2 */
}

::before:where(.petercat-lui,.petercat-lui *),
::after:where(.petercat-lui,.petercat-lui *) {
:where(.petercat-lui,.petercat-lui *)::before,
:where(.petercat-lui,.petercat-lui *)::after {
--tw-content: '';
}

Expand Down Expand Up @@ -378,8 +378,8 @@ progress:where(.petercat-lui,.petercat-lui *) {
Correct the cursor style of increment and decrement buttons in Safari.
*/

::-webkit-inner-spin-button:where(.petercat-lui,.petercat-lui *),
::-webkit-outer-spin-button:where(.petercat-lui,.petercat-lui *) {
:where(.petercat-lui,.petercat-lui *) ::-webkit-inner-spin-button,
:where(.petercat-lui,.petercat-lui *) ::-webkit-outer-spin-button {
height: auto;
}

Expand All @@ -399,7 +399,7 @@ Correct the cursor style of increment and decrement buttons in Safari.
Remove the inner padding in Chrome and Safari on macOS.
*/

::-webkit-search-decoration:where(.petercat-lui,.petercat-lui *) {
:where(.petercat-lui,.petercat-lui *) ::-webkit-search-decoration {
-webkit-appearance: none;
}

Expand All @@ -408,7 +408,7 @@ Remove the inner padding in Chrome and Safari on macOS.
2. Change font properties to `inherit` in Safari.
*/

::-webkit-file-upload-button:where(.petercat-lui,.petercat-lui *) {
:where(.petercat-lui,.petercat-lui *) ::-webkit-file-upload-button {
-webkit-appearance: button;
/* 1 */
font: inherit;
Expand Down Expand Up @@ -481,15 +481,15 @@ textarea:where(.petercat-lui,.petercat-lui *) {
2. Set the default placeholder color to the user's configured gray 400 color.
*/

input::-moz-placeholder:where(.petercat-lui,.petercat-lui *), textarea::-moz-placeholder:where(.petercat-lui,.petercat-lui *) {
:where(.petercat-lui,.petercat-lui *) input::-moz-placeholder, :where(.petercat-lui,.petercat-lui *) textarea::-moz-placeholder {
opacity: 1;
/* 1 */
color: #9ca3af;
/* 2 */
}

input::placeholder:where(.petercat-lui,.petercat-lui *),
textarea::placeholder:where(.petercat-lui,.petercat-lui *) {
:where(.petercat-lui,.petercat-lui *) input::placeholder,
:where(.petercat-lui,.petercat-lui *) textarea::placeholder {
opacity: 1;
/* 1 */
color: #9ca3af;
Expand Down Expand Up @@ -545,7 +545,7 @@ video:where(.petercat-lui,.petercat-lui *) {

/* Make elements with the HTML hidden attribute stay hidden by default */

[hidden]:where(.petercat-lui,.petercat-lui *) {
[hidden]:where(:not([hidden="until-found"])):where(.petercat-lui,.petercat-lui *) {
display: none;
}

Expand Down Expand Up @@ -944,42 +944,42 @@ video:where(.petercat-lui,.petercat-lui *) {

.border-\[\#e4e4e7\] {
--tw-border-opacity: 1;
border-color: rgb(228 228 231 / var(--tw-border-opacity));
border-color: rgb(228 228 231 / var(--tw-border-opacity, 1));
}

.bg-\[\#3F3F46\] {
--tw-bg-opacity: 1;
background-color: rgb(63 63 70 / var(--tw-bg-opacity));
background-color: rgb(63 63 70 / var(--tw-bg-opacity, 1));
}

.bg-\[\#F1F1F1\] {
--tw-bg-opacity: 1;
background-color: rgb(241 241 241 / var(--tw-bg-opacity));
background-color: rgb(241 241 241 / var(--tw-bg-opacity, 1));
}

.bg-\[\#FCFCFC\] {
--tw-bg-opacity: 1;
background-color: rgb(252 252 252 / var(--tw-bg-opacity));
background-color: rgb(252 252 252 / var(--tw-bg-opacity, 1));
}

.bg-\[\#f1f1f1\] {
--tw-bg-opacity: 1;
background-color: rgb(241 241 241 / var(--tw-bg-opacity));
background-color: rgb(241 241 241 / var(--tw-bg-opacity, 1));
}

.bg-gray-700 {
--tw-bg-opacity: 1;
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1));
}

.bg-gray-800 {
--tw-bg-opacity: 1;
background-color: rgb(31 41 55 / var(--tw-bg-opacity));
background-color: rgb(31 41 55 / var(--tw-bg-opacity, 1));
}

.bg-white {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
}

.object-cover {
Expand Down Expand Up @@ -1072,47 +1072,47 @@ video:where(.petercat-lui,.petercat-lui *) {

.text-black {
--tw-text-opacity: 1;
color: rgb(0 0 0 / var(--tw-text-opacity));
color: rgb(0 0 0 / var(--tw-text-opacity, 1));
}

.text-blue-600 {
--tw-text-opacity: 1;
color: rgb(37 99 235 / var(--tw-text-opacity));
color: rgb(37 99 235 / var(--tw-text-opacity, 1));
}

.text-gray-400 {
--tw-text-opacity: 1;
color: rgb(156 163 175 / var(--tw-text-opacity));
color: rgb(156 163 175 / var(--tw-text-opacity, 1));
}

.text-gray-500 {
--tw-text-opacity: 1;
color: rgb(107 114 128 / var(--tw-text-opacity));
color: rgb(107 114 128 / var(--tw-text-opacity, 1));
}

.text-gray-900 {
--tw-text-opacity: 1;
color: rgb(17 24 39 / var(--tw-text-opacity));
color: rgb(17 24 39 / var(--tw-text-opacity, 1));
}

.text-green-600 {
--tw-text-opacity: 1;
color: rgb(22 163 74 / var(--tw-text-opacity));
color: rgb(22 163 74 / var(--tw-text-opacity, 1));
}

.text-red-600 {
--tw-text-opacity: 1;
color: rgb(220 38 38 / var(--tw-text-opacity));
color: rgb(220 38 38 / var(--tw-text-opacity, 1));
}

.text-red-700 {
--tw-text-opacity: 1;
color: rgb(185 28 28 / var(--tw-text-opacity));
color: rgb(185 28 28 / var(--tw-text-opacity, 1));
}

.text-white {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
}

.opacity-0 {
Expand Down Expand Up @@ -1252,12 +1252,12 @@ video:where(.petercat-lui,.petercat-lui *) {

.hover\:\!bg-gray-700:hover {
--tw-bg-opacity: 1 !important;
background-color: rgb(55 65 81 / var(--tw-bg-opacity)) !important;
background-color: rgb(55 65 81 / var(--tw-bg-opacity, 1)) !important;
}

.hover\:\!bg-white:hover {
--tw-bg-opacity: 1 !important;
background-color: rgb(255 255 255 / var(--tw-bg-opacity)) !important;
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1)) !important;
}

.hover\:shadow-lg:hover {
Expand Down
3 changes: 2 additions & 1 deletion assistant/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"@@/*": [".dumi/tmp/*"],
"lui": ["src"],
"lui/*": ["src/*", "*"]
}
},
"resolveJsonModule": true
},
"include": [".dumirc.ts", "src/**/*"]
}
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"@fullpage/react-fullpage": "^0.1.42",
"@next/bundle-analyzer": "^13.4.19",
"@nextui-org/react": "^2.2.9",
"@petercatai/assistant": "^1.0.18",
"@petercatai/assistant": "1.0.20",
"@sentry/nextjs": "^8.28.0",
"@supabase/supabase-js": "^2.32.0",
"@tanstack/react-query": "^5.17.19",
Expand Down
8 changes: 4 additions & 4 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2842,10 +2842,10 @@
resolved "https://registry.yarnpkg.com/@panva/hkdf/-/hkdf-1.2.1.tgz#cb0d111ef700136f4580349ff0226bf25c853f23"
integrity sha512-6oclG6Y3PiDFcoyk8srjLfVKyMfVCKJ27JwNPViuXziFpmdz+MZnZN/aKY0JGXgYuO/VghU0jcOAZgWXZ1Dmrw==

"@petercatai/assistant@^1.0.17":
version "1.0.17"
resolved "https://registry.yarnpkg.com/@petercatai/assistant/-/assistant-1.0.17.tgz#c6499ee8908f116664e448b54a076d564414a965"
integrity sha512-9IGCO+BlVRvXM1OZegclofOYb57tXnOlxVvOt+rltLqzre7TDnDNFl1lb9SFjmCjBQOVCm/IXZCG6KifIb4l4Q==
"@petercatai/[email protected].20":
version "1.0.20"
resolved "https://registry.yarnpkg.com/@petercatai/assistant/-/assistant-1.0.20.tgz#2d2dc1beb296c8524219a6de7eee1575cb3b4c92"
integrity sha512-csfRRsKB9FbBM+cMcCTQQowsuuFRVerSrxfMRTWoI1XHhBW3ormbt1XTeYKiubmwz4iKznR+2UCrZrCl75ckmA==
dependencies:
"@ant-design/icons" "^5.3.5"
"@ant-design/pro-chat" "^1.9.0"
Expand Down

0 comments on commit de69310

Please sign in to comment.