Skip to content
Merged
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 biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.7/schema.json",
"$schema": "https://biomejs.dev/schemas/2.4.10/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down
3 changes: 2 additions & 1 deletion framework/SimpleModule.Blazor/Components/InertiaPage.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div id="app" data-page="@PageJson"></div>
<div id="app"></div>
<script data-page="app" type="application/json">@(new MarkupString(PageJson))</script>
<script type="module" src="/js/app.js?v=@CacheBuster"></script>

@code {
Expand Down
17 changes: 1 addition & 16 deletions framework/SimpleModule.Hosting/SimpleModuleHostExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,7 @@ public static async Task UseSimpleModuleInfrastructure(this WebApplication app)

if (scope.ServiceProvider.GetService(info.DbContextType) is DbContext db)
{
// Use MigrateAsync when migrations exist, EnsureCreated otherwise
// (projects scaffolded with sm new project have no migrations initially)
if ((await db.Database.GetPendingMigrationsAsync()).Any()
|| (await db.Database.GetAppliedMigrationsAsync()).Any())
{
await db.Database.MigrateAsync();
}
else
{
var logger = scope.ServiceProvider.GetService<ILoggerFactory>()
?.CreateLogger("SimpleModule.Hosting");
logger?.LogInformation(
"No migrations found — using EnsureCreated to initialize database. " +
"Add migrations for production use.");
await db.Database.EnsureCreatedAsync();
}
await db.Database.MigrateAsync();
}
}
}
Expand Down
1 change: 1 addition & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module '@puckeditor/core/puck.css';
2 changes: 1 addition & 1 deletion modules/Admin/src/SimpleModule.Admin/Pages/Admin/Roles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default function Roles({ roles }: Props) {
<Badge variant="info">{role.userCount}</Badge>
</TableCell>
<TableCell>
<Badge variant="secondary">{role.permissionCount}</Badge>
<Badge variant="default">{role.permissionCount}</Badge>
</TableCell>
<TableCell className="text-sm text-text-muted">
{new Date(role.createdAt).toLocaleDateString()}
Expand Down
2 changes: 1 addition & 1 deletion modules/Admin/src/SimpleModule.Admin/Pages/Admin/Users.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ interface Props {
}

function userStatus(user: User) {
if (user.isDeactivated) return { label: 'Deactivated', variant: 'secondary' as const };
if (user.isDeactivated) return { label: 'Deactivated', variant: 'default' as const };
if (user.isLockedOut) return { label: 'Locked', variant: 'danger' as const };
return { label: 'Active', variant: 'success' as const };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default function UsersEdit({
<div className="flex items-center gap-3">
<h1 className="text-2xl font-bold tracking-tight">Edit User</h1>
{isSelf && <Badge variant="info">You</Badge>}
{user.isDeactivated && <Badge variant="secondary">Deactivated</Badge>}
{user.isDeactivated && <Badge variant="default">Deactivated</Badge>}
{user.isLockedOut && !user.isDeactivated && <Badge variant="danger">Locked</Badge>}
</div>

Expand Down Expand Up @@ -463,7 +463,7 @@ export default function UsersEdit({
{activeSessions.map((session) => (
<TableRow key={session.tokenId}>
<TableCell>
<Badge variant={session.type === 'refresh_token' ? 'info' : 'secondary'}>
<Badge variant={session.type === 'refresh_token' ? 'info' : 'default'}>
{session.type === 'refresh_token' ? 'Refresh' : 'Access'}
</Badge>
</TableCell>
Expand Down
6 changes: 3 additions & 3 deletions modules/Admin/src/SimpleModule.Admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "@simplemodule/admin",
"version": "0.0.0",
"scripts": {
"build": "vite build",
"build:dev": "cross-env VITE_MODE=dev vite build",
"watch": "cross-env VITE_MODE=dev vite build --watch"
"build": "vite build --configLoader runner",
"build:dev": "cross-env VITE_MODE=dev vite build --configLoader runner",
"watch": "cross-env VITE_MODE=dev vite build --configLoader runner --watch"
},
"peerDependencies": {
"react": "^19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/Admin/src/SimpleModule.Admin/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { defineModuleConfig } from '@simplemodule/client/module';

export default defineModuleConfig(__dirname);
export default defineModuleConfig(import.meta.dirname);
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function HBarCard({
yAxisWidth = 100,
}: {
title: string;
data: { name: string; [key: string]: unknown }[];
data: readonly { name: string; count?: number; value?: number }[];
dataKey: string;
config: ChartConfig;
fill?: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ export default function Detail({ entry, correlated }: Props) {
<CardContent>
<dl className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
<LabeledField label="Method + Path">
<Badge variant="outline" className="mr-2">
<Badge variant="info" className="mr-2">
{entry.httpMethod}
</Badge>
<span className="font-mono text-xs">{entry.path}</span>
Expand Down
6 changes: 3 additions & 3 deletions modules/AuditLogs/src/SimpleModule.AuditLogs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "@simplemodule/auditlogs",
"version": "0.0.0",
"scripts": {
"build": "vite build",
"build:dev": "cross-env VITE_MODE=dev vite build",
"watch": "cross-env VITE_MODE=dev vite build --watch"
"build": "vite build --configLoader runner",
"build:dev": "cross-env VITE_MODE=dev vite build --configLoader runner",
"watch": "cross-env VITE_MODE=dev vite build --configLoader runner --watch"
},
"peerDependencies": {
"react": "^19.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { defineModuleConfig } from '@simplemodule/client/module';

export default defineModuleConfig(__dirname);
export default defineModuleConfig(import.meta.dirname);
6 changes: 3 additions & 3 deletions modules/Dashboard/src/SimpleModule.Dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "@simplemodule/dashboard",
"version": "0.0.0",
"scripts": {
"build": "vite build",
"build:dev": "cross-env VITE_MODE=dev vite build",
"watch": "cross-env VITE_MODE=dev vite build --watch"
"build": "vite build --configLoader runner",
"build:dev": "cross-env VITE_MODE=dev vite build --configLoader runner",
"watch": "cross-env VITE_MODE=dev vite build --configLoader runner --watch"
},
"peerDependencies": {
"react": "^19.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { defineModuleConfig } from '@simplemodule/client/module';

export default defineModuleConfig(__dirname);
export default defineModuleConfig(import.meta.dirname);
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default function Manage({ flags: initialFlags }: ManageProps) {
<TableCell className="font-mono text-sm">{flag.name}</TableCell>
<TableCell className="text-text-muted">{flag.description}</TableCell>
<TableCell>
<Badge variant={flag.defaultEnabled ? 'default' : 'secondary'}>
<Badge variant={flag.defaultEnabled ? 'info' : 'default'}>
{flag.defaultEnabled ? 'on' : 'off'}
</Badge>
</TableCell>
Expand Down Expand Up @@ -154,7 +154,7 @@ export default function Manage({ flags: initialFlags }: ManageProps) {
<TableRow key={flag.name} className="opacity-60">
<TableCell className="font-mono text-sm">
{flag.name}{' '}
<Badge variant="destructive" className="ml-2">
<Badge variant="danger" className="ml-2">
deprecated
</Badge>
</TableCell>
Expand Down Expand Up @@ -197,11 +197,7 @@ export default function Manage({ flags: initialFlags }: ManageProps) {
<TableCell className="font-mono text-sm">{o.overrideValue}</TableCell>
<TableCell>{o.isEnabled ? 'Yes' : 'No'}</TableCell>
<TableCell>
<Button
variant="destructive"
size="sm"
onClick={() => handleDeleteOverride(o.id)}
>
<Button variant="danger" size="sm" onClick={() => handleDeleteOverride(o.id)}>
Delete
</Button>
</TableCell>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "@simplemodule/feature-flags",
"version": "0.0.0",
"scripts": {
"build": "cross-env VITE_MODE=prod vite build",
"build:dev": "cross-env VITE_MODE=dev vite build",
"watch": "cross-env VITE_MODE=dev vite build --watch"
"build": "cross-env VITE_MODE=prod vite build --configLoader runner",
"build:dev": "cross-env VITE_MODE=dev vite build --configLoader runner",
"watch": "cross-env VITE_MODE=dev vite build --configLoader runner --watch"
},
"peerDependencies": {
"react": "^19.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { defineModuleConfig } from '@simplemodule/client/module';

export default defineModuleConfig(__dirname);
export default defineModuleConfig(import.meta.dirname);
6 changes: 3 additions & 3 deletions modules/FileStorage/src/SimpleModule.FileStorage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "@simplemodule/filestorage",
"version": "0.0.0",
"scripts": {
"build": "cross-env VITE_MODE=prod vite build",
"build:dev": "cross-env VITE_MODE=dev vite build",
"watch": "cross-env VITE_MODE=dev vite build --watch"
"build": "cross-env VITE_MODE=prod vite build --configLoader runner",
"build:dev": "cross-env VITE_MODE=dev vite build --configLoader runner",
"watch": "cross-env VITE_MODE=dev vite build --configLoader runner --watch"
},
"peerDependencies": {
"react": "^19.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { defineModuleConfig } from '@simplemodule/client/module';

export default defineModuleConfig(__dirname);
export default defineModuleConfig(import.meta.dirname);
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function Browse({
{categories.map((cat) => (
<Button
key={cat}
variant={selectedCategory === cat ? 'default' : 'secondary'}
variant={selectedCategory === cat ? 'primary' : 'secondary'}
size="sm"
onClick={() => navigate({ category: cat })}
>
Expand Down Expand Up @@ -142,7 +142,7 @@ export default function Browse({
<CardContent>
<p className="mb-3 line-clamp-2 text-sm text-text-muted">{pkg.description}</p>
<div className="flex flex-wrap items-center gap-2">
<Badge variant="secondary">{pkg.category}</Badge>
<Badge variant="default">{pkg.category}</Badge>
{pkg.isInstalled && <Badge variant="default">Installed</Badge>}
<span className="ml-auto text-xs text-text-muted">
{formatDownloads(pkg.totalDownloads)} downloads
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ export default function Detail({ package: pkg }: Props) {
<CardTitle className="text-xl">{pkg.title}</CardTitle>
<p className="mt-1 text-sm text-text-muted">by {pkg.authors}</p>
<div className="mt-2 flex flex-wrap gap-2">
<Badge variant="secondary">{pkg.category}</Badge>
<Badge variant="secondary">v{pkg.latestVersion}</Badge>
<Badge variant="default">{pkg.category}</Badge>
<Badge variant="default">v{pkg.latestVersion}</Badge>
{pkg.isInstalled && <Badge variant="default">Installed</Badge>}
</div>
</div>
Expand Down Expand Up @@ -168,8 +168,8 @@ export default function Detail({ package: pkg }: Props) {
</CardHeader>
<CardContent>
<div className="flex flex-wrap gap-1.5">
{pkg.tags.map((tag) => (
<Badge key={tag} variant="secondary">
{pkg.tags.map((tag: string) => (
<Badge key={tag} variant="default">
{tag}
</Badge>
))}
Expand Down
6 changes: 3 additions & 3 deletions modules/Marketplace/src/SimpleModule.Marketplace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "@simplemodule/marketplace",
"version": "0.0.0",
"scripts": {
"build": "cross-env VITE_MODE=prod vite build",
"build:dev": "cross-env VITE_MODE=dev vite build",
"watch": "cross-env VITE_MODE=dev vite build --watch"
"build": "cross-env VITE_MODE=prod vite build --configLoader runner",
"build:dev": "cross-env VITE_MODE=dev vite build --configLoader runner",
"watch": "cross-env VITE_MODE=dev vite build --configLoader runner --watch"
},
"peerDependencies": {
"react": "^19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/Marketplace/src/SimpleModule.Marketplace/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface MarketplacePackage {
isInstalled: boolean;
}

export interface MarketplacePackageDetail {
export interface MarketplacePackageDetail extends MarketplacePackage {
licenseLink: string;
versions: MarketplacePackageVersion[];
dependencies: string[];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { defineModuleConfig } from '@simplemodule/client/module';

export default defineModuleConfig(__dirname);
export default defineModuleConfig(import.meta.dirname);
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default function Clients({ clients }: Props) {
<TableCell className="font-mono text-sm">{client.clientId}</TableCell>
<TableCell>{client.displayName || '\u2014'}</TableCell>
<TableCell>
<Badge variant={client.clientType === 'confidential' ? 'default' : 'secondary'}>
<Badge variant={client.clientType === 'confidential' ? 'default' : 'info'}>
{client.clientType || 'public'}
</Badge>
</TableCell>
Expand Down
6 changes: 3 additions & 3 deletions modules/OpenIddict/src/SimpleModule.OpenIddict/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "@simplemodule/openiddict",
"version": "0.0.0",
"scripts": {
"build": "vite build",
"build:dev": "cross-env VITE_MODE=dev vite build",
"watch": "cross-env VITE_MODE=dev vite build --watch"
"build": "vite build --configLoader runner",
"build:dev": "cross-env VITE_MODE=dev vite build --configLoader runner",
"watch": "cross-env VITE_MODE=dev vite build --configLoader runner --watch"
},
"peerDependencies": {
"react": "^19.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { defineModuleConfig } from '@simplemodule/client/module';

export default defineModuleConfig(__dirname);
export default defineModuleConfig(import.meta.dirname);
2 changes: 1 addition & 1 deletion modules/Orders/src/SimpleModule.Orders/Pages/Create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function Create({ products }: Props) {

function handleSubmit(e: React.FormEvent) {
e.preventDefault();
router.post('/orders', { userId, items });
router.post('/orders', { userId, items: items as unknown as string });
}

return (
Expand Down
2 changes: 1 addition & 1 deletion modules/Orders/src/SimpleModule.Orders/Pages/Edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function Edit({ order, products }: Props) {

function handleSubmit(e: React.FormEvent) {
e.preventDefault();
router.post(`/orders/${order.id}`, { userId, items });
router.post(`/orders/${order.id}`, { userId, items: items as unknown as string });
}

function handleDelete() {
Expand Down
6 changes: 3 additions & 3 deletions modules/Orders/src/SimpleModule.Orders/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "@simplemodule/orders",
"version": "0.0.0",
"scripts": {
"build": "vite build",
"build:dev": "cross-env VITE_MODE=dev vite build",
"watch": "cross-env VITE_MODE=dev vite build --watch"
"build": "vite build --configLoader runner",
"build:dev": "cross-env VITE_MODE=dev vite build --configLoader runner",
"watch": "cross-env VITE_MODE=dev vite build --configLoader runner --watch"
},
"peerDependencies": {
"react": "^19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion modules/Orders/src/SimpleModule.Orders/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { defineModuleConfig } from '@simplemodule/client/module';

export default defineModuleConfig(__dirname);
export default defineModuleConfig(import.meta.dirname);
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export default function Manage({ pages }: Props) {
<TableCell>
<div className="flex gap-1.5">
<Badge
variant={page.isPublished ? 'success' : 'secondary'}
variant={page.isPublished ? 'success' : 'default'}
data-testid="status-badge"
>
{page.isPublished ? 'Published' : 'Unpublished'}
Expand All @@ -123,7 +123,7 @@ export default function Manage({ pages }: Props) {
{page.tags.map((tag) => (
<Badge
key={tag}
variant="outline"
variant="info"
className="cursor-pointer hover:line-through"
onClick={() => handleRemoveTag(page.id, tag)}
>
Expand Down
6 changes: 3 additions & 3 deletions modules/PageBuilder/src/SimpleModule.PageBuilder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"name": "@simplemodule/pagebuilder",
"version": "0.0.0",
"scripts": {
"build": "vite build",
"build:dev": "cross-env VITE_MODE=dev vite build",
"watch": "cross-env VITE_MODE=dev vite build --watch"
"build": "vite build --configLoader runner",
"build:dev": "cross-env VITE_MODE=dev vite build --configLoader runner",
"watch": "cross-env VITE_MODE=dev vite build --configLoader runner --watch"
},
"peerDependencies": {
"react": "^19.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Config } from '@puckeditor/core';
import type React from 'react';
import { ButtonBlock } from './components/ButtonBlock';
import { Card } from './components/Card';
import { Flex } from './components/Flex';
Expand All @@ -15,7 +16,7 @@ export const puckConfig: Config = {
defaultProps: {
title: '',
},
render: ({ children }) => (
render: ({ children }: { children: React.ReactNode }) => (
<div data-testid="puck-root" style={{ minHeight: '100vh' }}>
{children}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { defineModuleConfig } from '@simplemodule/client/module';

export default defineModuleConfig(__dirname);
export default defineModuleConfig(import.meta.dirname);
Loading
Loading