@idevconn/create-icore 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +140 -9
- package/dist/index.cjs +140 -9
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +140 -9
- package/package.json +1 -1
- package/templates/apps/templates/client-antd/src/components/layout/LayoutHeader.tsx +2 -2
- package/templates/apps/templates/client-mui/src/components/layout/LayoutHeader.tsx +1 -1
- package/templates/apps/templates/client-shadcn/src/components/layout/LayoutHeader.tsx +2 -2
- package/templates/apps/templates/client-shadcn/src/components/layout/LayoutSider.tsx +7 -3
- package/templates/apps/templates/client-shadcn/src/routes/index.tsx +2 -2
- package/templates/apps/templates/client-shadcn/vite.config.mts +18 -1
- package/templates/docker-compose.yml +14 -0
- package/templates/libs/db-strategies/postgres/eslint.config.mjs +30 -0
- package/templates/libs/db-strategies/postgres/package.json +19 -0
- package/templates/libs/db-strategies/postgres/project.json +19 -0
- package/templates/libs/db-strategies/postgres/src/index.ts +3 -0
- package/templates/libs/db-strategies/postgres/src/lib/__tests__/postgres-db.contract.unit.test.ts +4 -0
- package/templates/libs/db-strategies/postgres/src/lib/__tests__/postgres-db.module.unit.test.ts +37 -0
- package/templates/libs/db-strategies/postgres/src/lib/postgres-db.module.ts +33 -0
- package/templates/libs/db-strategies/postgres/src/lib/postgres-db.strategy.ts +139 -0
- package/templates/libs/db-strategies/postgres/src/lib/testing/mock-postgres.ts +94 -0
- package/templates/libs/db-strategies/postgres/tsconfig.json +19 -0
- package/templates/libs/db-strategies/postgres/tsconfig.lib.json +24 -0
- package/templates/libs/db-strategies/postgres/tsconfig.spec.json +22 -0
- package/templates/libs/db-strategies/postgres/vitest.config.mts +22 -0
- package/templates/tsconfig.base.json +1 -0
package/dist/cli.js
CHANGED
|
@@ -233,7 +233,8 @@ Re-run with @latest to refresh:
|
|
|
233
233
|
options: [
|
|
234
234
|
{ value: "supabase", label: "Supabase Postgres" },
|
|
235
235
|
{ value: "firebase", label: "Firestore" },
|
|
236
|
-
{ value: "mongodb", label: "MongoDB" }
|
|
236
|
+
{ value: "mongodb", label: "MongoDB" },
|
|
237
|
+
{ value: "postgres", label: "PostgreSQL (direct, postgres.js)" }
|
|
237
238
|
],
|
|
238
239
|
initialValue: authProvider
|
|
239
240
|
});
|
|
@@ -410,6 +411,7 @@ async function rewriteRootPackageJson(targetDir, opts) {
|
|
|
410
411
|
const pkg = JSON.parse(raw);
|
|
411
412
|
pkg["name"] = opts.projectName;
|
|
412
413
|
pkg["version"] = "0.0.1";
|
|
414
|
+
pkg["icoreVersion"] = true ? "0.11.0" : "unknown";
|
|
413
415
|
pkg["private"] = true;
|
|
414
416
|
delete pkg.description;
|
|
415
417
|
const transportDeps = TRANSPORT_DEPS[opts.transport];
|
|
@@ -677,6 +679,7 @@ var AUTH_ONLY_PATHS = [
|
|
|
677
679
|
"apps/api/src/app/abilities",
|
|
678
680
|
"libs/shared/src/abilities",
|
|
679
681
|
"apps/client/src/components/auth",
|
|
682
|
+
"apps/client/src/components/AccessDeniedPage.tsx",
|
|
680
683
|
"apps/client/src/routes/login.tsx",
|
|
681
684
|
"apps/client/src/routes/auth.callback.tsx",
|
|
682
685
|
"apps/client/src/routes/auth.oauth.callback.tsx",
|
|
@@ -813,6 +816,121 @@ export * from './lib/draft/index.js';
|
|
|
813
816
|
export * from './lib/landing/LandingPage.js';
|
|
814
817
|
export * from './lib/stores/theme.store.js';
|
|
815
818
|
`;
|
|
819
|
+
var SHADCN_PAGE_LAYOUT_TSX = `import type { ReactNode } from 'react';
|
|
820
|
+
import { useTranslation } from 'react-i18next';
|
|
821
|
+
import { useDraft, useLoading } from '@icore/template-shared';
|
|
822
|
+
|
|
823
|
+
interface PageLayoutProps {
|
|
824
|
+
title: string;
|
|
825
|
+
description?: string;
|
|
826
|
+
actions?: ReactNode;
|
|
827
|
+
children: ReactNode;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
export function PageLayout({ title, description, actions, children }: PageLayoutProps) {
|
|
831
|
+
const { t } = useTranslation();
|
|
832
|
+
const isLoading = useLoading();
|
|
833
|
+
|
|
834
|
+
useDraft(false);
|
|
835
|
+
|
|
836
|
+
return (
|
|
837
|
+
<div className="p-4 md:p-6 space-y-4">
|
|
838
|
+
<div className="flex items-start justify-between gap-3">
|
|
839
|
+
<div>
|
|
840
|
+
<h1 className="text-xl font-semibold text-foreground">{title}</h1>
|
|
841
|
+
{description && <p className="text-sm text-muted-foreground mt-1">{description}</p>}
|
|
842
|
+
</div>
|
|
843
|
+
{actions && <div>{actions}</div>}
|
|
844
|
+
</div>
|
|
845
|
+
|
|
846
|
+
{isLoading && (
|
|
847
|
+
<div
|
|
848
|
+
role="status"
|
|
849
|
+
aria-label={t('common.loading')}
|
|
850
|
+
className="fixed inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-sm"
|
|
851
|
+
>
|
|
852
|
+
<div className="h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" />
|
|
853
|
+
</div>
|
|
854
|
+
)}
|
|
855
|
+
|
|
856
|
+
{children}
|
|
857
|
+
</div>
|
|
858
|
+
);
|
|
859
|
+
}
|
|
860
|
+
`;
|
|
861
|
+
var ANTD_PAGE_LAYOUT_TSX = `import type { ReactNode } from 'react';
|
|
862
|
+
import { Descriptions, Spin } from 'antd';
|
|
863
|
+
import { useDraft, useLoading } from '@icore/template-shared';
|
|
864
|
+
|
|
865
|
+
export interface PageLayoutProps {
|
|
866
|
+
title: ReactNode;
|
|
867
|
+
description?: ReactNode;
|
|
868
|
+
extra?: ReactNode;
|
|
869
|
+
children?: ReactNode;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
export function PageLayout({ title, description, extra, children }: PageLayoutProps) {
|
|
873
|
+
useDraft(false);
|
|
874
|
+
const loading = useLoading();
|
|
875
|
+
|
|
876
|
+
return (
|
|
877
|
+
<div style={{ padding: 24 }}>
|
|
878
|
+
<Descriptions title={title} extra={extra} style={{ marginBottom: 16 }}>
|
|
879
|
+
{description ? <Descriptions.Item>{description}</Descriptions.Item> : null}
|
|
880
|
+
</Descriptions>
|
|
881
|
+
<Spin spinning={loading}>
|
|
882
|
+
<div>{children}</div>
|
|
883
|
+
</Spin>
|
|
884
|
+
</div>
|
|
885
|
+
);
|
|
886
|
+
}
|
|
887
|
+
`;
|
|
888
|
+
var MUI_PAGE_LAYOUT_TSX = `import type { ReactNode } from 'react';
|
|
889
|
+
import { Box, LinearProgress, Stack, Typography } from '@mui/material';
|
|
890
|
+
import { useDraft, useLoading } from '@icore/template-shared';
|
|
891
|
+
|
|
892
|
+
export interface PageLayoutProps {
|
|
893
|
+
title: ReactNode;
|
|
894
|
+
description?: ReactNode;
|
|
895
|
+
extra?: ReactNode;
|
|
896
|
+
children?: ReactNode;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
export function PageLayout({ title, description, extra, children }: PageLayoutProps) {
|
|
900
|
+
useDraft(false);
|
|
901
|
+
const loading = useLoading();
|
|
902
|
+
|
|
903
|
+
return (
|
|
904
|
+
<Box sx={{ p: 3 }}>
|
|
905
|
+
<Stack
|
|
906
|
+
direction="row"
|
|
907
|
+
justifyContent="space-between"
|
|
908
|
+
alignItems="flex-start"
|
|
909
|
+
spacing={2}
|
|
910
|
+
mb={3}
|
|
911
|
+
>
|
|
912
|
+
<Box>
|
|
913
|
+
<Typography variant="h4" component="h1">
|
|
914
|
+
{title}
|
|
915
|
+
</Typography>
|
|
916
|
+
{description ? (
|
|
917
|
+
<Typography variant="body2" color="text.secondary" mt={0.5}>
|
|
918
|
+
{description}
|
|
919
|
+
</Typography>
|
|
920
|
+
) : null}
|
|
921
|
+
</Box>
|
|
922
|
+
{extra ? (
|
|
923
|
+
<Stack direction="row" spacing={1}>
|
|
924
|
+
{extra}
|
|
925
|
+
</Stack>
|
|
926
|
+
) : null}
|
|
927
|
+
</Stack>
|
|
928
|
+
{loading ? <LinearProgress sx={{ mb: 2 }} /> : null}
|
|
929
|
+
<Box>{children}</Box>
|
|
930
|
+
</Box>
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
`;
|
|
816
934
|
var SHADCN_MAIN_TSX = `import './globals.css';
|
|
817
935
|
import { StrictMode } from 'react';
|
|
818
936
|
import { createRoot } from 'react-dom/client';
|
|
@@ -913,7 +1031,7 @@ export const Route = createFileRoute('/')({
|
|
|
913
1031
|
),
|
|
914
1032
|
});
|
|
915
1033
|
`;
|
|
916
|
-
var SHADCN_LAYOUT_HEADER_TSX = `import { setStoredLocale, type IcoreLocale } from '@icore/template-shared';
|
|
1034
|
+
var SHADCN_LAYOUT_HEADER_TSX = `import { setStoredLocale, type IcoreLocale, i18next } from '@icore/template-shared';
|
|
917
1035
|
import { ThemeToggle } from '../ThemeToggle';
|
|
918
1036
|
|
|
919
1037
|
const LOCALES: { code: IcoreLocale; label: string }[] = [
|
|
@@ -925,7 +1043,7 @@ const LOCALES: { code: IcoreLocale; label: string }[] = [
|
|
|
925
1043
|
export function LayoutHeader() {
|
|
926
1044
|
function handleLocale(code: IcoreLocale) {
|
|
927
1045
|
setStoredLocale(code);
|
|
928
|
-
|
|
1046
|
+
void i18next.changeLanguage(code);
|
|
929
1047
|
}
|
|
930
1048
|
|
|
931
1049
|
return (
|
|
@@ -1059,7 +1177,7 @@ export const Route = createFileRoute('/')({
|
|
|
1059
1177
|
});
|
|
1060
1178
|
`;
|
|
1061
1179
|
var ANTD_LAYOUT_HEADER_TSX = `import { Button, Layout, Space } from 'antd';
|
|
1062
|
-
import { setStoredLocale, type IcoreLocale } from '@icore/template-shared';
|
|
1180
|
+
import { setStoredLocale, type IcoreLocale, i18next } from '@icore/template-shared';
|
|
1063
1181
|
import { ThemeToggle } from '../ThemeToggle';
|
|
1064
1182
|
|
|
1065
1183
|
const APP_VERSION = (import.meta.env.VITE_APP_VERSION as string | undefined) ?? '0.0.0-dev';
|
|
@@ -1073,7 +1191,7 @@ const LOCALES: { code: IcoreLocale; label: string }[] = [
|
|
|
1073
1191
|
export function LayoutHeader() {
|
|
1074
1192
|
function handleLocale(code: IcoreLocale) {
|
|
1075
1193
|
setStoredLocale(code);
|
|
1076
|
-
|
|
1194
|
+
void i18next.changeLanguage(code);
|
|
1077
1195
|
}
|
|
1078
1196
|
|
|
1079
1197
|
return (
|
|
@@ -1245,7 +1363,7 @@ export function LayoutHeader() {
|
|
|
1245
1363
|
|
|
1246
1364
|
function handleLocale(code: IcoreLocale) {
|
|
1247
1365
|
setStoredLocale(code);
|
|
1248
|
-
|
|
1366
|
+
void i18n.changeLanguage(code);
|
|
1249
1367
|
}
|
|
1250
1368
|
|
|
1251
1369
|
return (
|
|
@@ -1289,19 +1407,22 @@ var UI_VARIANTS = {
|
|
|
1289
1407
|
"apps/client/src/main.tsx": SHADCN_MAIN_TSX,
|
|
1290
1408
|
"apps/client/src/routes/_dashboard.tsx": SHADCN_DASHBOARD_TSX,
|
|
1291
1409
|
"apps/client/src/routes/index.tsx": SHADCN_INDEX_TSX,
|
|
1292
|
-
"apps/client/src/components/layout/LayoutHeader.tsx": SHADCN_LAYOUT_HEADER_TSX
|
|
1410
|
+
"apps/client/src/components/layout/LayoutHeader.tsx": SHADCN_LAYOUT_HEADER_TSX,
|
|
1411
|
+
"apps/client/src/components/PageLayout.tsx": SHADCN_PAGE_LAYOUT_TSX
|
|
1293
1412
|
},
|
|
1294
1413
|
antd: {
|
|
1295
1414
|
"apps/client/src/main.tsx": ANTD_MAIN_TSX,
|
|
1296
1415
|
"apps/client/src/routes/_dashboard.tsx": ANTD_DASHBOARD_TSX,
|
|
1297
1416
|
"apps/client/src/routes/index.tsx": ANTD_INDEX_TSX,
|
|
1298
|
-
"apps/client/src/components/layout/LayoutHeader.tsx": ANTD_LAYOUT_HEADER_TSX
|
|
1417
|
+
"apps/client/src/components/layout/LayoutHeader.tsx": ANTD_LAYOUT_HEADER_TSX,
|
|
1418
|
+
"apps/client/src/components/PageLayout.tsx": ANTD_PAGE_LAYOUT_TSX
|
|
1299
1419
|
},
|
|
1300
1420
|
mui: {
|
|
1301
1421
|
"apps/client/src/main.tsx": MUI_MAIN_TSX,
|
|
1302
1422
|
"apps/client/src/routes/_dashboard.tsx": MUI_DASHBOARD_TSX,
|
|
1303
1423
|
"apps/client/src/routes/index.tsx": MUI_INDEX_TSX,
|
|
1304
|
-
"apps/client/src/components/layout/LayoutHeader.tsx": MUI_LAYOUT_HEADER_TSX
|
|
1424
|
+
"apps/client/src/components/layout/LayoutHeader.tsx": MUI_LAYOUT_HEADER_TSX,
|
|
1425
|
+
"apps/client/src/components/PageLayout.tsx": MUI_PAGE_LAYOUT_TSX
|
|
1305
1426
|
}
|
|
1306
1427
|
};
|
|
1307
1428
|
async function applyAuthNoneVariants(targetDir, ui) {
|
|
@@ -1418,6 +1539,16 @@ var MANIFEST = {
|
|
|
1418
1539
|
deps: { mongoose: "^9.6.3" },
|
|
1419
1540
|
tsPaths: { "@icore/db-mongodb": ["libs/db-strategies/mongodb/src/index.ts"] },
|
|
1420
1541
|
nestModule: { importFrom: "@icore/db-mongodb", symbol: "MongoDbDbModule", into: "notes" }
|
|
1542
|
+
},
|
|
1543
|
+
postgres: {
|
|
1544
|
+
libDirs: ["libs/db-strategies/postgres"],
|
|
1545
|
+
deps: { postgres: "^3" },
|
|
1546
|
+
tsPaths: { "@icore/db-postgres": ["libs/db-strategies/postgres/src/index.ts"] },
|
|
1547
|
+
nestModule: {
|
|
1548
|
+
importFrom: "@icore/db-postgres",
|
|
1549
|
+
symbol: "PostgresDbModule",
|
|
1550
|
+
into: "notes"
|
|
1551
|
+
}
|
|
1421
1552
|
}
|
|
1422
1553
|
},
|
|
1423
1554
|
feature: {
|
package/dist/index.cjs
CHANGED
|
@@ -121,6 +121,7 @@ async function rewriteRootPackageJson(targetDir, opts) {
|
|
|
121
121
|
const pkg = JSON.parse(raw);
|
|
122
122
|
pkg["name"] = opts.projectName;
|
|
123
123
|
pkg["version"] = "0.0.1";
|
|
124
|
+
pkg["icoreVersion"] = typeof ICORE_OWN_VERSION !== "undefined" ? ICORE_OWN_VERSION : "unknown";
|
|
124
125
|
pkg["private"] = true;
|
|
125
126
|
delete pkg.description;
|
|
126
127
|
const transportDeps = TRANSPORT_DEPS[opts.transport];
|
|
@@ -388,6 +389,7 @@ var AUTH_ONLY_PATHS = [
|
|
|
388
389
|
"apps/api/src/app/abilities",
|
|
389
390
|
"libs/shared/src/abilities",
|
|
390
391
|
"apps/client/src/components/auth",
|
|
392
|
+
"apps/client/src/components/AccessDeniedPage.tsx",
|
|
391
393
|
"apps/client/src/routes/login.tsx",
|
|
392
394
|
"apps/client/src/routes/auth.callback.tsx",
|
|
393
395
|
"apps/client/src/routes/auth.oauth.callback.tsx",
|
|
@@ -524,6 +526,121 @@ export * from './lib/draft/index.js';
|
|
|
524
526
|
export * from './lib/landing/LandingPage.js';
|
|
525
527
|
export * from './lib/stores/theme.store.js';
|
|
526
528
|
`;
|
|
529
|
+
var SHADCN_PAGE_LAYOUT_TSX = `import type { ReactNode } from 'react';
|
|
530
|
+
import { useTranslation } from 'react-i18next';
|
|
531
|
+
import { useDraft, useLoading } from '@icore/template-shared';
|
|
532
|
+
|
|
533
|
+
interface PageLayoutProps {
|
|
534
|
+
title: string;
|
|
535
|
+
description?: string;
|
|
536
|
+
actions?: ReactNode;
|
|
537
|
+
children: ReactNode;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
export function PageLayout({ title, description, actions, children }: PageLayoutProps) {
|
|
541
|
+
const { t } = useTranslation();
|
|
542
|
+
const isLoading = useLoading();
|
|
543
|
+
|
|
544
|
+
useDraft(false);
|
|
545
|
+
|
|
546
|
+
return (
|
|
547
|
+
<div className="p-4 md:p-6 space-y-4">
|
|
548
|
+
<div className="flex items-start justify-between gap-3">
|
|
549
|
+
<div>
|
|
550
|
+
<h1 className="text-xl font-semibold text-foreground">{title}</h1>
|
|
551
|
+
{description && <p className="text-sm text-muted-foreground mt-1">{description}</p>}
|
|
552
|
+
</div>
|
|
553
|
+
{actions && <div>{actions}</div>}
|
|
554
|
+
</div>
|
|
555
|
+
|
|
556
|
+
{isLoading && (
|
|
557
|
+
<div
|
|
558
|
+
role="status"
|
|
559
|
+
aria-label={t('common.loading')}
|
|
560
|
+
className="fixed inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-sm"
|
|
561
|
+
>
|
|
562
|
+
<div className="h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent" />
|
|
563
|
+
</div>
|
|
564
|
+
)}
|
|
565
|
+
|
|
566
|
+
{children}
|
|
567
|
+
</div>
|
|
568
|
+
);
|
|
569
|
+
}
|
|
570
|
+
`;
|
|
571
|
+
var ANTD_PAGE_LAYOUT_TSX = `import type { ReactNode } from 'react';
|
|
572
|
+
import { Descriptions, Spin } from 'antd';
|
|
573
|
+
import { useDraft, useLoading } from '@icore/template-shared';
|
|
574
|
+
|
|
575
|
+
export interface PageLayoutProps {
|
|
576
|
+
title: ReactNode;
|
|
577
|
+
description?: ReactNode;
|
|
578
|
+
extra?: ReactNode;
|
|
579
|
+
children?: ReactNode;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
export function PageLayout({ title, description, extra, children }: PageLayoutProps) {
|
|
583
|
+
useDraft(false);
|
|
584
|
+
const loading = useLoading();
|
|
585
|
+
|
|
586
|
+
return (
|
|
587
|
+
<div style={{ padding: 24 }}>
|
|
588
|
+
<Descriptions title={title} extra={extra} style={{ marginBottom: 16 }}>
|
|
589
|
+
{description ? <Descriptions.Item>{description}</Descriptions.Item> : null}
|
|
590
|
+
</Descriptions>
|
|
591
|
+
<Spin spinning={loading}>
|
|
592
|
+
<div>{children}</div>
|
|
593
|
+
</Spin>
|
|
594
|
+
</div>
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
`;
|
|
598
|
+
var MUI_PAGE_LAYOUT_TSX = `import type { ReactNode } from 'react';
|
|
599
|
+
import { Box, LinearProgress, Stack, Typography } from '@mui/material';
|
|
600
|
+
import { useDraft, useLoading } from '@icore/template-shared';
|
|
601
|
+
|
|
602
|
+
export interface PageLayoutProps {
|
|
603
|
+
title: ReactNode;
|
|
604
|
+
description?: ReactNode;
|
|
605
|
+
extra?: ReactNode;
|
|
606
|
+
children?: ReactNode;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
export function PageLayout({ title, description, extra, children }: PageLayoutProps) {
|
|
610
|
+
useDraft(false);
|
|
611
|
+
const loading = useLoading();
|
|
612
|
+
|
|
613
|
+
return (
|
|
614
|
+
<Box sx={{ p: 3 }}>
|
|
615
|
+
<Stack
|
|
616
|
+
direction="row"
|
|
617
|
+
justifyContent="space-between"
|
|
618
|
+
alignItems="flex-start"
|
|
619
|
+
spacing={2}
|
|
620
|
+
mb={3}
|
|
621
|
+
>
|
|
622
|
+
<Box>
|
|
623
|
+
<Typography variant="h4" component="h1">
|
|
624
|
+
{title}
|
|
625
|
+
</Typography>
|
|
626
|
+
{description ? (
|
|
627
|
+
<Typography variant="body2" color="text.secondary" mt={0.5}>
|
|
628
|
+
{description}
|
|
629
|
+
</Typography>
|
|
630
|
+
) : null}
|
|
631
|
+
</Box>
|
|
632
|
+
{extra ? (
|
|
633
|
+
<Stack direction="row" spacing={1}>
|
|
634
|
+
{extra}
|
|
635
|
+
</Stack>
|
|
636
|
+
) : null}
|
|
637
|
+
</Stack>
|
|
638
|
+
{loading ? <LinearProgress sx={{ mb: 2 }} /> : null}
|
|
639
|
+
<Box>{children}</Box>
|
|
640
|
+
</Box>
|
|
641
|
+
);
|
|
642
|
+
}
|
|
643
|
+
`;
|
|
527
644
|
var SHADCN_MAIN_TSX = `import './globals.css';
|
|
528
645
|
import { StrictMode } from 'react';
|
|
529
646
|
import { createRoot } from 'react-dom/client';
|
|
@@ -624,7 +741,7 @@ export const Route = createFileRoute('/')({
|
|
|
624
741
|
),
|
|
625
742
|
});
|
|
626
743
|
`;
|
|
627
|
-
var SHADCN_LAYOUT_HEADER_TSX = `import { setStoredLocale, type IcoreLocale } from '@icore/template-shared';
|
|
744
|
+
var SHADCN_LAYOUT_HEADER_TSX = `import { setStoredLocale, type IcoreLocale, i18next } from '@icore/template-shared';
|
|
628
745
|
import { ThemeToggle } from '../ThemeToggle';
|
|
629
746
|
|
|
630
747
|
const LOCALES: { code: IcoreLocale; label: string }[] = [
|
|
@@ -636,7 +753,7 @@ const LOCALES: { code: IcoreLocale; label: string }[] = [
|
|
|
636
753
|
export function LayoutHeader() {
|
|
637
754
|
function handleLocale(code: IcoreLocale) {
|
|
638
755
|
setStoredLocale(code);
|
|
639
|
-
|
|
756
|
+
void i18next.changeLanguage(code);
|
|
640
757
|
}
|
|
641
758
|
|
|
642
759
|
return (
|
|
@@ -770,7 +887,7 @@ export const Route = createFileRoute('/')({
|
|
|
770
887
|
});
|
|
771
888
|
`;
|
|
772
889
|
var ANTD_LAYOUT_HEADER_TSX = `import { Button, Layout, Space } from 'antd';
|
|
773
|
-
import { setStoredLocale, type IcoreLocale } from '@icore/template-shared';
|
|
890
|
+
import { setStoredLocale, type IcoreLocale, i18next } from '@icore/template-shared';
|
|
774
891
|
import { ThemeToggle } from '../ThemeToggle';
|
|
775
892
|
|
|
776
893
|
const APP_VERSION = (import.meta.env.VITE_APP_VERSION as string | undefined) ?? '0.0.0-dev';
|
|
@@ -784,7 +901,7 @@ const LOCALES: { code: IcoreLocale; label: string }[] = [
|
|
|
784
901
|
export function LayoutHeader() {
|
|
785
902
|
function handleLocale(code: IcoreLocale) {
|
|
786
903
|
setStoredLocale(code);
|
|
787
|
-
|
|
904
|
+
void i18next.changeLanguage(code);
|
|
788
905
|
}
|
|
789
906
|
|
|
790
907
|
return (
|
|
@@ -956,7 +1073,7 @@ export function LayoutHeader() {
|
|
|
956
1073
|
|
|
957
1074
|
function handleLocale(code: IcoreLocale) {
|
|
958
1075
|
setStoredLocale(code);
|
|
959
|
-
|
|
1076
|
+
void i18n.changeLanguage(code);
|
|
960
1077
|
}
|
|
961
1078
|
|
|
962
1079
|
return (
|
|
@@ -1000,19 +1117,22 @@ var UI_VARIANTS = {
|
|
|
1000
1117
|
"apps/client/src/main.tsx": SHADCN_MAIN_TSX,
|
|
1001
1118
|
"apps/client/src/routes/_dashboard.tsx": SHADCN_DASHBOARD_TSX,
|
|
1002
1119
|
"apps/client/src/routes/index.tsx": SHADCN_INDEX_TSX,
|
|
1003
|
-
"apps/client/src/components/layout/LayoutHeader.tsx": SHADCN_LAYOUT_HEADER_TSX
|
|
1120
|
+
"apps/client/src/components/layout/LayoutHeader.tsx": SHADCN_LAYOUT_HEADER_TSX,
|
|
1121
|
+
"apps/client/src/components/PageLayout.tsx": SHADCN_PAGE_LAYOUT_TSX
|
|
1004
1122
|
},
|
|
1005
1123
|
antd: {
|
|
1006
1124
|
"apps/client/src/main.tsx": ANTD_MAIN_TSX,
|
|
1007
1125
|
"apps/client/src/routes/_dashboard.tsx": ANTD_DASHBOARD_TSX,
|
|
1008
1126
|
"apps/client/src/routes/index.tsx": ANTD_INDEX_TSX,
|
|
1009
|
-
"apps/client/src/components/layout/LayoutHeader.tsx": ANTD_LAYOUT_HEADER_TSX
|
|
1127
|
+
"apps/client/src/components/layout/LayoutHeader.tsx": ANTD_LAYOUT_HEADER_TSX,
|
|
1128
|
+
"apps/client/src/components/PageLayout.tsx": ANTD_PAGE_LAYOUT_TSX
|
|
1010
1129
|
},
|
|
1011
1130
|
mui: {
|
|
1012
1131
|
"apps/client/src/main.tsx": MUI_MAIN_TSX,
|
|
1013
1132
|
"apps/client/src/routes/_dashboard.tsx": MUI_DASHBOARD_TSX,
|
|
1014
1133
|
"apps/client/src/routes/index.tsx": MUI_INDEX_TSX,
|
|
1015
|
-
"apps/client/src/components/layout/LayoutHeader.tsx": MUI_LAYOUT_HEADER_TSX
|
|
1134
|
+
"apps/client/src/components/layout/LayoutHeader.tsx": MUI_LAYOUT_HEADER_TSX,
|
|
1135
|
+
"apps/client/src/components/PageLayout.tsx": MUI_PAGE_LAYOUT_TSX
|
|
1016
1136
|
}
|
|
1017
1137
|
};
|
|
1018
1138
|
async function applyAuthNoneVariants(targetDir, ui) {
|
|
@@ -1129,6 +1249,16 @@ var MANIFEST = {
|
|
|
1129
1249
|
deps: { mongoose: "^9.6.3" },
|
|
1130
1250
|
tsPaths: { "@icore/db-mongodb": ["libs/db-strategies/mongodb/src/index.ts"] },
|
|
1131
1251
|
nestModule: { importFrom: "@icore/db-mongodb", symbol: "MongoDbDbModule", into: "notes" }
|
|
1252
|
+
},
|
|
1253
|
+
postgres: {
|
|
1254
|
+
libDirs: ["libs/db-strategies/postgres"],
|
|
1255
|
+
deps: { postgres: "^3" },
|
|
1256
|
+
tsPaths: { "@icore/db-postgres": ["libs/db-strategies/postgres/src/index.ts"] },
|
|
1257
|
+
nestModule: {
|
|
1258
|
+
importFrom: "@icore/db-postgres",
|
|
1259
|
+
symbol: "PostgresDbModule",
|
|
1260
|
+
into: "notes"
|
|
1261
|
+
}
|
|
1132
1262
|
}
|
|
1133
1263
|
},
|
|
1134
1264
|
feature: {
|
|
@@ -2127,7 +2257,8 @@ Re-run with @latest to refresh:
|
|
|
2127
2257
|
options: [
|
|
2128
2258
|
{ value: "supabase", label: "Supabase Postgres" },
|
|
2129
2259
|
{ value: "firebase", label: "Firestore" },
|
|
2130
|
-
{ value: "mongodb", label: "MongoDB" }
|
|
2260
|
+
{ value: "mongodb", label: "MongoDB" },
|
|
2261
|
+
{ value: "postgres", label: "PostgreSQL (direct, postgres.js)" }
|
|
2131
2262
|
],
|
|
2132
2263
|
initialValue: authProvider
|
|
2133
2264
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type AuthBackend = 'supabase' | 'firebase' | 'mongodb';
|
|
2
2
|
type AuthProvider = AuthBackend | 'none';
|
|
3
|
-
type DbProvider = 'supabase' | 'firebase' | 'mongodb' | 'none';
|
|
3
|
+
type DbProvider = 'supabase' | 'firebase' | 'mongodb' | 'postgres' | 'none';
|
|
4
4
|
type UploadProvider = 'supabase' | 'firebase' | 'cloudinary' | 'mongodb' | 'none';
|
|
5
5
|
type PaymentProvider = 'paypal' | 'none';
|
|
6
6
|
type JobsProvider = 'bullmq' | 'none';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
type AuthBackend = 'supabase' | 'firebase' | 'mongodb';
|
|
2
2
|
type AuthProvider = AuthBackend | 'none';
|
|
3
|
-
type DbProvider = 'supabase' | 'firebase' | 'mongodb' | 'none';
|
|
3
|
+
type DbProvider = 'supabase' | 'firebase' | 'mongodb' | 'postgres' | 'none';
|
|
4
4
|
type UploadProvider = 'supabase' | 'firebase' | 'cloudinary' | 'mongodb' | 'none';
|
|
5
5
|
type PaymentProvider = 'paypal' | 'none';
|
|
6
6
|
type JobsProvider = 'bullmq' | 'none';
|