Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Daily -> Alpha #1879

Open
wants to merge 4 commits into
base: release/alpha
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@liexp/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"debug": "*",
"dotenv": "^16.4.7",
"query-string": "^7",
"vite": "^5",
"vite": "^6",
"vite-plugin-css-injected-by-js": "^3",
"vite-plugin-optimizer": "^1",
"vite-tsconfig-paths": "^5"
Expand Down
6 changes: 3 additions & 3 deletions packages/@liexp/core/src/frontend/vite/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import { type GetViteConfigParams } from "./type.js";

// https://vitejs.dev/config/
export const defineViteConfig = <A extends Record<string, any>>(

Check warning on line 14 in packages/@liexp/core/src/frontend/vite/config.ts

View workflow job for this annotation

GitHub Actions / pull_request

Unexpected any. Specify a different type
config: GetViteConfigParams<A>,
): ((env: ConfigEnv) => UserConfig) => {
return ({ mode: _mode }) => {
Expand All @@ -25,9 +25,9 @@
const mode = process.env.VITE_NODE_ENV ?? _mode;

const validateEnv =
process.env.VITE_VALIDATE_ENV !== "undefined"
? process.env.VITE_VALIDATE_ENV
: true;
process.env.VITE_VALIDATE_ENV === undefined
? true
: process.env.VITE_VALIDATE_ENV === "true";

// eslint-disable-next-line
console.log(mode, `Validating env: ${validateEnv}`);
Expand Down
18 changes: 7 additions & 11 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions scripts/deploy.admin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ set -e -x

HOST=${1:-"alpha.lies.exposed"}

export VITE_NODE_ENV=production

pnpm admin-web clean

pnpm packages:build

export VITE_NODE_ENV=production
export DOTENV_CONFIG_PATH=".env.alpha"

pnpm admin-web build:app
pnpm admin-web deploy --prod services/admin-web/deploy

rsync -aP ./services/admin-web/deploy/ $HOST:/var/www/html/${HOST}/admin-web
ssh "$HOST" "rm -rf /var/www/html/${HOST}/admin-web"

rsync -aP ./services/admin-web/build/ "$HOST":/var/www/html/"${HOST}"/admin

pnpm admin-web clean
7 changes: 4 additions & 3 deletions scripts/deploy.storybook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ export VITE_NODE_ENV=production
pnpm storybook clean

pnpm storybook build:app
pnpm storybook deploy --prod services/storybook/deploy

rsync -aP ./services/storybook/deploy/ $HOST:/var/www/html/${HOST}/storybook/
ssh "$HOST" "rm -rf /var/www/html/${HOST}/storybook"

rm -rf services/storybook/deploy
rsync -aP ./services/storybook/build/ "$HOST":/var/www/html/"${HOST}"/storybook

pnpm storybook clean
40 changes: 39 additions & 1 deletion services/admin-web/src/pages/AdminQueue.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Queue } from "@liexp/shared/lib/io/http/index.js";
import JSONInput from "@liexp/ui/lib/components/Common/JSON/JSONInput.js";
import { Loader } from "@liexp/ui/lib/components/Common/Loader.js";
import { SlugInput } from "@liexp/ui/lib/components/admin/common/inputs/SlugInput.js";
import {
Button,
Expand All @@ -19,6 +20,7 @@ import {
type TransformData,
type ButtonProps,
type EditProps,
useRefresh,
} from "@liexp/ui/lib/components/admin/react-admin.js";
import { Box, Stack } from "@liexp/ui/lib/components/mui/index.js";
import { useDataProvider } from "@liexp/ui/lib/hooks/useDataProvider.js";
Expand Down Expand Up @@ -158,6 +160,36 @@ export const QueueList: React.FC<ListProps> = (props) => {
);
};

const RetryQueueJobButton: React.FC<{
type: string;
resource: string;
id: string;
}> = ({ type, resource, id }) => {
const refresh = useRefresh();
const api = useDataProvider();
const record = useRecordContext<Queue.Queue>();

const onClick = () => {
void api
.put(`queues/${type}/${resource}/${id}`, {
...record,
status: "pending",
data: { ...record?.data, result: undefined },
error: null,
id,
})
.finally(() => {
refresh();
});
};

if (!record) {
return <Loader />;
}

return <Button label="Retry" variant="contained" onClick={onClick} />;
};

const transformQueue: TransformData = (data) => ({
...data,
value: JSON.stringify(data.value),
Expand All @@ -178,7 +210,12 @@ export const QueueEdit: React.FC<Omit<EditProps, "children">> = (props) => {
title="Create a custom Queue"
>
<SimpleForm>
<Stack spacing={1} direction="row" alignItems={"center"}>
<Stack
spacing={1}
direction="row"
alignItems={"center"}
justifyContent={"center"}
>
<SelectQueueResourceInput size="small" />
<SlugInput source="id" size="small" />
<Box display="flex">
Expand All @@ -196,6 +233,7 @@ export const QueueEdit: React.FC<Omit<EditProps, "children">> = (props) => {
<Stack spacing={1} direction="row" alignItems={"center"}>
<SelectQueueStatusInput size="small" />
<SelectQueueTypeInput size="small" />
<RetryQueueJobButton resource={resource} type={type} id={id} />
</Stack>

<JSONInput source="data" />
Expand Down
2 changes: 1 addition & 1 deletion services/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"build:app": "storybook build -o build",
"clean": "rm -rf build deploy",
"clean": "rm -rf build",
"dev": "storybook dev --quiet -p 6006",
"lint": "eslint src",
"serve": "serve -d ./build"
Expand Down
Loading