mirror of
https://github.com/morten-olsen/plainidx.git
synced 2026-02-08 01:06:24 +01:00
prepare for client/server split
This commit is contained in:
2
packages/base/.gitignore
vendored
Normal file
2
packages/base/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/node_modules/
|
||||
/dist/
|
||||
20
packages/base/package.json
Normal file
20
packages/base/package.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "@plainidx/base",
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"main": "dist/exports.js",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "tsc --build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@plainidx/configs": "workspace:*",
|
||||
"typescript": "^5.7.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"nanoid": "^5.0.9",
|
||||
"zod": "^3.24.0"
|
||||
}
|
||||
}
|
||||
8
packages/base/src/exports.ts
Normal file
8
packages/base/src/exports.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export { z } from 'zod';
|
||||
export {
|
||||
type Manifest,
|
||||
type ManifestBackendAction,
|
||||
type ManifestBackendActions,
|
||||
type ManifestBackend,
|
||||
type ManifestFrontend,
|
||||
} from './manifest/manifest.js';
|
||||
36
packages/base/src/manifest/manifest.ts
Normal file
36
packages/base/src/manifest/manifest.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { ZodSchema } from 'zod';
|
||||
|
||||
type ManifestBackendAction = {
|
||||
input: ZodSchema;
|
||||
output: ZodSchema;
|
||||
};
|
||||
|
||||
type ManifestBackendActions = Record<string, ManifestBackendAction>;
|
||||
|
||||
type ManifestBackend = {
|
||||
main: string;
|
||||
actions: ManifestBackendActions;
|
||||
};
|
||||
|
||||
type ManifestFrontend = {
|
||||
main: string;
|
||||
};
|
||||
|
||||
type Manifest = {
|
||||
id: string;
|
||||
name: string;
|
||||
version: string;
|
||||
description?: string;
|
||||
icon?: string;
|
||||
config: ZodSchema;
|
||||
frontend?: ManifestFrontend;
|
||||
backend?: ManifestBackend;
|
||||
};
|
||||
|
||||
export {
|
||||
type Manifest,
|
||||
type ManifestBackendAction,
|
||||
type ManifestBackendActions,
|
||||
type ManifestBackend,
|
||||
type ManifestFrontend,
|
||||
};
|
||||
9
packages/base/tsconfig.json
Normal file
9
packages/base/tsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "@plainidx/configs/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist"
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user