mirror of
https://github.com/layer-systems/website.git
synced 2026-09-16 08:19:33 +02:00
Rename package and establish version 1.0.0 (#71)
* Initial plan * Wire package metadata into About app Co-authored-by: mroxso <24775431+mroxso@users.noreply.github.com> * Complete About version test wiring Co-authored-by: mroxso <24775431+mroxso@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mroxso <24775431+mroxso@users.noreply.github.com>
This commit is contained in:
22
src/apps/about/index.test.tsx
Normal file
22
src/apps/about/index.test.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { describe, expect, test, vi } from 'vitest';
|
||||
import AboutApp from './index';
|
||||
|
||||
vi.mock('@/os/useWindowManager', () => ({
|
||||
useWindowManager: () => ({ openApp: vi.fn() }),
|
||||
}));
|
||||
|
||||
describe('About app', () => {
|
||||
test('displays the package version', () => {
|
||||
render(
|
||||
<AboutApp
|
||||
windowId="about"
|
||||
params={{}}
|
||||
setTitle={vi.fn()}
|
||||
setParams={vi.fn()}
|
||||
/>,
|
||||
);
|
||||
|
||||
expect(screen.getByText('Version 1.0.0')).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -5,6 +5,7 @@ import { Button } from '@/components/ui/button';
|
||||
import { useWindowManager } from '@/os/useWindowManager';
|
||||
import { APPS } from '@/os/registry';
|
||||
import type { AppProps } from '@/os/types';
|
||||
import { APP_NAME, APP_VERSION } from '@/lib/appMetadata';
|
||||
|
||||
const SHORTCUTS: [keys: string, action: string][] = [
|
||||
['⌘K', 'Search apps and windows'],
|
||||
@@ -27,7 +28,8 @@ export default function AboutApp({ setTitle }: AppProps) {
|
||||
<span className="inline-flex size-11 items-center justify-center rounded-xl border border-border bg-background shadow-sm">
|
||||
<Zap className="size-5 text-primary" aria-hidden />
|
||||
</span>
|
||||
<h1 className="text-xl font-semibold tracking-tight">LAYER.systems</h1>
|
||||
<h1 className="text-xl font-semibold tracking-tight">{APP_NAME}</h1>
|
||||
<p className="text-xs text-muted-foreground">Version {APP_VERSION}</p>
|
||||
<p className="text-sm leading-relaxed text-muted-foreground">
|
||||
A Nostr client shaped like a desktop. Every part of it is an app in a window you
|
||||
can move, resize, stack and keep open side by side — reading a thread does not
|
||||
|
||||
12
src/lib/appMetadata.test.ts
Normal file
12
src/lib/appMetadata.test.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import packageJson from '../../package.json';
|
||||
import { describe, expect, test } from 'vitest';
|
||||
import { APP_NAME, APP_VERSION } from './appMetadata';
|
||||
|
||||
describe('app metadata', () => {
|
||||
test('uses package metadata as the authoritative source', () => {
|
||||
expect(APP_NAME).toBe(packageJson.name);
|
||||
expect(APP_VERSION).toBe(packageJson.version);
|
||||
expect(APP_NAME).toBe('LAYER.systems');
|
||||
expect(APP_VERSION).toBe('1.0.0');
|
||||
});
|
||||
});
|
||||
4
src/lib/appMetadata.ts
Normal file
4
src/lib/appMetadata.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import packageJson from '../../package.json';
|
||||
|
||||
export const APP_NAME = packageJson.name;
|
||||
export const APP_VERSION = packageJson.version;
|
||||
Reference in New Issue
Block a user