-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ Port code from Lysand Server and improve it
- Loading branch information
1 parent
ef76ee4
commit bf8898a
Showing
18 changed files
with
733 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"conventionalCommits.scopes": ["docs"] | ||
"conventionalCommits.scopes": ["docs"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.6.4/schema.json", | ||
"organizeImports": { | ||
"enabled": true, | ||
"ignore": ["node_modules", "dist"] | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
}, | ||
"ignore": ["node_modules", "dist"] | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"indentWidth": 4, | ||
"ignore": ["node_modules", "dist"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import dts from "bun-plugin-dts"; | ||
import ora from "ora"; | ||
|
||
const spinner = ora("Building...").start(); | ||
|
||
await Bun.build({ | ||
entrypoints: ["federation/index.ts"], | ||
outdir: "federation/dist", | ||
format: "esm", | ||
minify: true, | ||
sourcemap: "external", | ||
splitting: true, | ||
target: "browser", | ||
plugins: [dts()], | ||
}); | ||
|
||
spinner.succeed("Built federation module"); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* @file index.ts | ||
* @fileoverview Main entrypoint and export for the module | ||
* @module federation | ||
* @see module:federation/schemas/base | ||
*/ | ||
|
||
import type { z } from "zod"; | ||
import { | ||
Action, | ||
ActorPublicKeyData, | ||
ContentFormat, | ||
Dislike, | ||
Entity, | ||
Extension, | ||
Follow, | ||
FollowAccept, | ||
FollowReject, | ||
Like, | ||
Note, | ||
Patch, | ||
Publication, | ||
Report, | ||
ServerMetadata, | ||
Undo, | ||
User, | ||
VanityExtension, | ||
Visibility, | ||
} from "~/federation/schemas/base"; | ||
|
||
export type InferType<T extends z.AnyZodObject> = z.infer<T>; | ||
|
||
export { | ||
Entity, | ||
ContentFormat, | ||
Visibility, | ||
Publication, | ||
Note, | ||
Patch, | ||
ActorPublicKeyData, | ||
VanityExtension, | ||
User, | ||
Action, | ||
Like, | ||
Undo, | ||
Dislike, | ||
Follow, | ||
FollowAccept, | ||
FollowReject, | ||
Extension, | ||
Report, | ||
ServerMetadata, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,67 @@ | ||
{ | ||
"name": "@lysand-org/federation", | ||
"displayName": "Lysand Federation", | ||
"version": "3.0.0", | ||
"author": { | ||
"email": "jesse.wierzbinski@lysand.org", | ||
"name": "Jesse Wierzbinski (CPlusPatch)", | ||
"url": "https://cpluspatch.com" | ||
}, | ||
"readme": "README.md", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/lysand-org/api.git", | ||
"directory": "federation" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/lysand-org/api/issues" | ||
}, | ||
"license": "MIT", | ||
"contributors": [ | ||
{ | ||
"name": "Jesse Wierzbinski", | ||
"email": "jesse.wierzbinski@lysand.org", | ||
"url": "https://cpluspatch.com" | ||
} | ||
], | ||
"maintainers": [ | ||
{ | ||
"name": "Jesse Wierzbinski", | ||
"email": "jesse.wierzbinski@lysand.org", | ||
"url": "https://cpluspatch.com" | ||
} | ||
], | ||
"description": "Type definitions for Lysand Federation, with validators.", | ||
"categories": ["Other"], | ||
"type": "module", | ||
"engines": { | ||
"bun": ">=1.1.8" | ||
}, | ||
"exports": { | ||
"import": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"default": "./dist/index.js" | ||
}, | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/lysand" | ||
}, | ||
"homepage": "https://lysand.org", | ||
"keywords": [ | ||
"lysand", | ||
"federation", | ||
"api", | ||
"typescript", | ||
"zod", | ||
"validation" | ||
], | ||
"packageManager": "bun@1.1.8", | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.7.3" | ||
}, | ||
"trustedDependencies": ["@biomejs/biome"] | ||
"name": "@lysand-org/federation", | ||
"displayName": "Lysand Federation", | ||
"version": "3.0.0", | ||
"author": { | ||
"email": "jesse.wierzbinski@lysand.org", | ||
"name": "Jesse Wierzbinski (CPlusPatch)", | ||
"url": "https://cpluspatch.com" | ||
}, | ||
"readme": "README.md", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/lysand-org/api.git", | ||
"directory": "federation" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/lysand-org/api/issues" | ||
}, | ||
"license": "MIT", | ||
"contributors": [ | ||
{ | ||
"name": "Jesse Wierzbinski", | ||
"email": "jesse.wierzbinski@lysand.org", | ||
"url": "https://cpluspatch.com" | ||
} | ||
], | ||
"maintainers": [ | ||
{ | ||
"name": "Jesse Wierzbinski", | ||
"email": "jesse.wierzbinski@lysand.org", | ||
"url": "https://cpluspatch.com" | ||
} | ||
], | ||
"description": "Type definitions for Lysand Federation, with validators.", | ||
"categories": ["Other"], | ||
"type": "module", | ||
"engines": { | ||
"bun": ">=1.1.8" | ||
}, | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.js", | ||
"default": "./dist/index.js" | ||
} | ||
}, | ||
"funding": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/lysand" | ||
}, | ||
"homepage": "https://lysand.org", | ||
"keywords": [ | ||
"lysand", | ||
"federation", | ||
"api", | ||
"typescript", | ||
"zod", | ||
"validation" | ||
], | ||
"packageManager": "bun@1.1.8", | ||
"dependencies": { | ||
"@types/mime-types": "^2.1.4", | ||
"magic-regexp": "^0.8.0", | ||
"mime-types": "^2.1.35", | ||
"zod": "^3.23.8", | ||
"zod-validation-error": "^3.3.0" | ||
} | ||
} |
Oops, something went wrong.