From a56809c8916ff742055949400dd54caae5d30602 Mon Sep 17 00:00:00 2001 From: Mark Wecke Date: Thu, 4 Jul 2024 10:31:41 +0200 Subject: [PATCH] chore(repo): fix docs build --- LICENSE | 7 +++++++ pkg/angular/src/lib/a38.module.ts | 4 ++-- pkg/angular/src/lib/loader.ts | 4 ++-- pkg/angular/src/public-api.ts | 3 ++- pkg/angular/typedoc.json | 4 ++++ pkg/core/src/child-node.ts | 8 ++++---- pkg/core/src/resource-manager.ts | 4 ++-- pkg/core/src/role-manager.ts | 4 ++-- pkg/core/typedoc.json | 2 +- shared/biome-config/biome.json | 3 +-- 10 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 LICENSE create mode 100644 pkg/angular/typedoc.json diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..4209169 --- /dev/null +++ b/LICENSE @@ -0,0 +1,7 @@ +Copyright 2024 Mark Wecke + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/pkg/angular/src/lib/a38.module.ts b/pkg/angular/src/lib/a38.module.ts index 72ec986..01f5791 100644 --- a/pkg/angular/src/lib/a38.module.ts +++ b/pkg/angular/src/lib/a38.module.ts @@ -11,8 +11,8 @@ export type Value = T | InjectionToken | (() => T); export interface A38ModuleOptions { defaultRole: string; guardDenyHandler: InjectionToken | GuardDenyHandler; - roles?: Value; - resources?: Value; + roles?: Value; + resources?: Value; permissions?: Value; } diff --git a/pkg/angular/src/lib/loader.ts b/pkg/angular/src/lib/loader.ts index c98a17f..601c652 100644 --- a/pkg/angular/src/lib/loader.ts +++ b/pkg/angular/src/lib/loader.ts @@ -1,6 +1,6 @@ import type * as core from '@a38/core'; export abstract class Loader { - loadRole?(roleId: string): Promise; - loadResource?(resourceId: string): Promise; + loadRole?(roleId: string): Promise; + loadResource?(resourceId: string): Promise; loadPermissions?(roleIds: string[], resourceIds: string[]): Promise; } diff --git a/pkg/angular/src/public-api.ts b/pkg/angular/src/public-api.ts index ba2ef9a..054ec43 100644 --- a/pkg/angular/src/public-api.ts +++ b/pkg/angular/src/public-api.ts @@ -1,5 +1,6 @@ export * from './lib/a38.module'; +export * from './lib/directives'; +export * from './lib/guard'; export * from './lib/hrbac.service'; export * from './lib/loader'; export * from './lib/pipes'; -export * from './lib/directives'; diff --git a/pkg/angular/typedoc.json b/pkg/angular/typedoc.json new file mode 100644 index 0000000..c13b5ba --- /dev/null +++ b/pkg/angular/typedoc.json @@ -0,0 +1,4 @@ +{ + "extends": ["@a38/typedoc"], + "entryPoints": ["src/public-api.ts"] +} diff --git a/pkg/core/src/child-node.ts b/pkg/core/src/child-node.ts index dc302f8..7df934d 100644 --- a/pkg/core/src/child-node.ts +++ b/pkg/core/src/child-node.ts @@ -1,6 +1,6 @@ export type SerializedChildNodes = [id: string, parents: string[]][]; -export abstract class ChildNode { +export abstract class ChildNode { protected parents = new Map(); protected abstract assertEntryId(entryOrId: T | string): string; @@ -52,11 +52,11 @@ export abstract class ChildNode { return result; } - toJSON(): SerializedChildNodes { - return [...this.parents.entries()]; + toJSON(): S { + return [...this.parents.entries()] as S; } - importJSON(json: SerializedChildNodes | unknown) { + importJSON(json: S | unknown) { if (!Array.isArray(json)) { throw new Error(`Invalid serialize [${Object.getPrototypeOf(this).constructor.name}]: ${JSON.stringify(json)}`); } diff --git a/pkg/core/src/resource-manager.ts b/pkg/core/src/resource-manager.ts index 2a7566b..c1cdb1b 100644 --- a/pkg/core/src/resource-manager.ts +++ b/pkg/core/src/resource-manager.ts @@ -1,6 +1,6 @@ import { ChildNode } from './child-node.js'; -export type SerializeResources = [resource: string, parents: string[]][]; +export type SerializedResources = [resource: string, parents: string[]][]; export class Resource { constructor(public readonly resourceId: string) {} } @@ -9,6 +9,6 @@ export function assertResourceId(resourceOrId: Resource | string): string { return typeof resourceOrId === 'string' ? resourceOrId : resourceOrId.resourceId; } -export class ResourceManager extends ChildNode { +export class ResourceManager extends ChildNode { protected assertEntryId = assertResourceId; } diff --git a/pkg/core/src/role-manager.ts b/pkg/core/src/role-manager.ts index 7aef322..04b41d5 100644 --- a/pkg/core/src/role-manager.ts +++ b/pkg/core/src/role-manager.ts @@ -1,6 +1,6 @@ import { ChildNode } from './child-node.js'; -export type SerializeRoles = [role: string, parents: string[]][]; +export type SerializedRoles = [role: string, parents: string[]][]; export class Role { constructor(public readonly roleId: string) {} } @@ -9,6 +9,6 @@ export function assertRoleId(roleOrId: Role | string): string { return typeof roleOrId === 'string' ? roleOrId : roleOrId.roleId; } -export class RoleManager extends ChildNode { +export class RoleManager extends ChildNode { protected assertEntryId = assertRoleId; } diff --git a/pkg/core/typedoc.json b/pkg/core/typedoc.json index f747a34..d0687b9 100644 --- a/pkg/core/typedoc.json +++ b/pkg/core/typedoc.json @@ -1,4 +1,4 @@ { "extends": ["@a38/typedoc"], - "entryPoints": ["src/index.ts", "src/awaitable.ts"] + "entryPoints": ["src/index.ts"] } diff --git a/shared/biome-config/biome.json b/shared/biome-config/biome.json index ced0ddd..1888672 100644 --- a/shared/biome-config/biome.json +++ b/shared/biome-config/biome.json @@ -44,8 +44,7 @@ "noEmptyBlockStatements": "off" }, "nursery": { - "noUndeclaredDependencies": "off", - "useImportExtensions": "error" + "noUndeclaredDependencies": "off" }, "correctness": { "noUnusedImports": "error",