2.1.0 env update
This commit is contained in:
parent
0a2a0128ef
commit
2a63643b58
33
.gitea/workflows/deploy.yml
Normal file
33
.gitea/workflows/deploy.yml
Normal file
@ -0,0 +1,33 @@
|
||||
name: Deploy
|
||||
run-name: ${{ gitea.actor }} build image and push to container registry
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
- 'staging'
|
||||
- 'dev'
|
||||
|
||||
jobs:
|
||||
Publish:
|
||||
runs-on: ["skeris"]
|
||||
conainer:
|
||||
image: gitea.pena:3000/penadevops/container-images/node-compose:main
|
||||
steps:
|
||||
- name: Check out repository code
|
||||
uses: http://gitea.pena:3000/PenaDevops/actions.git/checkout@v1
|
||||
- name: Publish
|
||||
run: |
|
||||
npm config set registry=http://gitea.pena/api/packages/skeris/npm/
|
||||
npm config set -- '//gitea.pena/api/packages/skeris/npm/:_authToken' "1856e802057f59193ca6fdb4068cbea44982bcc2"
|
||||
if [ "${{ github.ref }}" == "refs/heads/main" ]; then
|
||||
npm version major
|
||||
elif [ "${{ github.ref }}" == "refs/heads/staging" ]; then
|
||||
npm version minor
|
||||
else
|
||||
npm version patch
|
||||
fi
|
||||
npm publish
|
||||
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
- Теперь запросы не по переменным окружения, а по глобальной переменной
|
||||
- Бог в помощь
|
||||
- Обновлены все пакеты
|
||||
- Убран yarn
|
||||
|
||||
11
env.d.ts
vendored
11
env.d.ts
vendored
@ -1,11 +0,0 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_REACT_APP_DOMAIN: string;
|
||||
readonly VITE_API_KEY: string;
|
||||
// Добавьте другие переменные окружения, которые вы используете
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
@ -2,7 +2,7 @@ import { UserAccount, UserName } from "../model/account";
|
||||
import { makeRequest } from "./makeRequest";
|
||||
|
||||
|
||||
const apiUrl = import.meta.env.VITE__APP_DOMAIN + "/customer";
|
||||
const apiUrl = window.the_domain + "/customer";
|
||||
|
||||
export function patchUserAccount(user: UserName, version:string | undefined) {
|
||||
return makeRequest<UserName, UserAccount>({
|
||||
|
||||
@ -66,7 +66,7 @@ export async function makeRequest<TRequest = unknown, TResponse = unknown>({
|
||||
|
||||
function refresh(token: string) {
|
||||
|
||||
return axios<never, AxiosResponse<{ accessToken: string; }>>(import.meta.env.VITE__APP_DOMAIN + "/auth/refresh", {
|
||||
return axios<never, AxiosResponse<{ accessToken: string; }>>(window.the_domain + "/auth/refresh", {
|
||||
headers: {
|
||||
"Authorization": `Bearer ${token}`,
|
||||
"Content-Type": "application/json",
|
||||
|
||||
@ -4,7 +4,7 @@ import { makeRequest } from "./makeRequest";
|
||||
|
||||
export function getTariffById(tariffId:string){
|
||||
return makeRequest<never, Tariff>({
|
||||
url: import.meta.env.VITE__APP_DOMAIN + `/strator/tariff/${tariffId}`,
|
||||
url: window.the_domain + `/strator/tariff/${tariffId}`,
|
||||
method: "get",
|
||||
useToken: true,
|
||||
});
|
||||
|
||||
7
lib/env.d.ts
vendored
7
lib/env.d.ts
vendored
@ -1,7 +0,0 @@
|
||||
export declare global {
|
||||
namespace NodeJS {
|
||||
interface ProcessEnv {
|
||||
readonly NODE_ENV: 'development' | 'production' | 'test';
|
||||
}
|
||||
}
|
||||
}
|
||||
3
lib/global.d.ts
vendored
Normal file
3
lib/global.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
interface Window {
|
||||
the_domain: string;
|
||||
}
|
||||
@ -5,7 +5,7 @@ import { makeRequest } from "../api/makeRequest";
|
||||
|
||||
export function useAllTariffsFetcher({
|
||||
enabled = true,
|
||||
baseUrl = import.meta.env.VITE__APP_DOMAIN + "/strator/tariff",
|
||||
baseUrl = window.the_domain + "/strator/tariff",
|
||||
onSuccess,
|
||||
onError,
|
||||
}: {
|
||||
|
||||
@ -5,7 +5,7 @@ import { Privilege } from "../model";
|
||||
|
||||
export function usePrivilegeFetcher({
|
||||
onSuccess,
|
||||
url = import.meta.env.VITE__APP_DOMAIN + "/strator/privilege",
|
||||
url = window.the_domain + "/strator/privilege",
|
||||
onError,
|
||||
}: {
|
||||
onSuccess: (response: Privilege[]) => void;
|
||||
|
||||
@ -24,7 +24,7 @@ export function getMessageFromFetchError(error: any, defaultMessage = "Что-т
|
||||
}
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV === "development") return rawMessage ?? error.message ?? defaultMessage;
|
||||
if (window.the_domain === "dev") return rawMessage ?? error.message ?? defaultMessage;
|
||||
|
||||
return defaultMessage;
|
||||
}
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
export const devlog: typeof console.log = (...args) => {
|
||||
if (process.env.NODE_ENV === "development") console.log(...args);
|
||||
if (window.the_domain === "dev") console.log(...args);
|
||||
};
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@frontend/kitui",
|
||||
"version": "1.0.92",
|
||||
"version": "2.2.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@frontend/kitui",
|
||||
"version": "1.0.92",
|
||||
"version": "2.2.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"immer": "^10.1.1",
|
||||
|
||||
28
package.json
28
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@frontend/kitui",
|
||||
"version": "2.0.2",
|
||||
"version": "2.1.1",
|
||||
"description": "test",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.js",
|
||||
@ -37,39 +37,37 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.14.0",
|
||||
"@mui/icons-material": "^6.4.7",
|
||||
"@mui/material": "^6.4.6",
|
||||
"@emotion/styled": "^11.14.1",
|
||||
"@mui/icons-material": "^7.3.5",
|
||||
"@mui/material": "^7.3.5",
|
||||
"@types/node": "^22.13.10",
|
||||
"@types/react": "^19.0.4",
|
||||
"@types/react-dom": "^19.0.4",
|
||||
"@types/react-syntax-highlighter": "^15.5.13",
|
||||
"@typescript-eslint/eslint-plugin": "^8.26.0",
|
||||
"@typescript-eslint/parser": "^8.26.0",
|
||||
"@vitejs/plugin-react": "^4.3.4",
|
||||
"axios": "^1.8.2",
|
||||
"axios": "^1.13.1",
|
||||
"eslint": "^9.22.0",
|
||||
"eslint-plugin-react": "^7.37.4",
|
||||
"eslint-plugin-react-hooks": "^5.2.0",
|
||||
"npm": "^11.2.0",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-router-dom": "^7.3.0",
|
||||
"react-syntax-highlighter": "^15.6.1",
|
||||
"typescript": "^5.8.2",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^6.2.1",
|
||||
"vite-plugin-dts": "^4.5.3",
|
||||
"vitest": "^3.0.8",
|
||||
"zustand": "^5.0.3"
|
||||
"zustand": "^5.0.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@emotion/react": "^11.14.0",
|
||||
"@emotion/styled": "^11.14.0",
|
||||
"@mui/icons-material": "^6.4.7",
|
||||
"@mui/material": "^6.4.6",
|
||||
"axios": "^1.8.2",
|
||||
"@emotion/styled": "^11.14.1",
|
||||
"@mui/icons-material": "^7.3.5",
|
||||
"@mui/material": "^7.3.5",
|
||||
"axios": "^1.13.1",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react-router-dom": "^7.3.0",
|
||||
"zustand": "^5.0.3"
|
||||
"zustand": "^5.0.8"
|
||||
}
|
||||
}
|
||||
|
||||
1
src/vite-env.d.ts
vendored
1
src/vite-env.d.ts
vendored
@ -1 +0,0 @@
|
||||
/// <reference types="vite/client" />
|
||||
Loading…
Reference in New Issue
Block a user