@mdfriday/foundry 26.3.7 → 26.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ import { WorkspaceFactory } from '@internal/domain/workspace';
2
+ import { WorkspaceAppService } from '@internal/application/workspace';
3
+ import { HttpClient as IdentityHttpClient } from '@internal/domain/identity';
4
+ import { IdentityAppService } from '@internal/application/identity';
5
+ export declare function createWorkspaceFactory(): WorkspaceFactory;
6
+ export declare function createWorkspaceAppService(): WorkspaceAppService;
7
+ export declare function createIdentityService(workspacePath?: string): Promise<IdentityAppService>;
8
+ export declare function createIdentityServiceForObsidian(workspacePath: string, httpClient: IdentityHttpClient): Promise<IdentityAppService>;
9
+ export declare function createPublishAppService(): any;
@@ -0,0 +1,4 @@
1
+ export { WorkspaceAppService } from './workspace';
2
+ export { PublishAppService } from './publish';
3
+ export { IdentityAppService } from './identity';
4
+ export { createWorkspaceFactory, createWorkspaceAppService, createIdentityService, createPublishAppService, } from './container';
@@ -1,11 +1,6 @@
1
- import { PublisherFactory } from '@internal/domain/publish';
1
+ import { PublisherFactory, AnyPublishConfig } from '@internal/domain/publish';
2
2
  import { WorkspaceAppService } from './workspace';
3
- import { Project } from '@internal/domain/workspace';
4
- export interface PublishOptions {
5
- force?: boolean;
6
- incremental?: boolean;
7
- config?: any;
8
- }
3
+ import { Workspace, Project } from '@internal/domain/workspace';
9
4
  export type PublishProgressCallback = (progress: {
10
5
  phase: 'scanning' | 'uploading' | 'deploying' | 'complete';
11
6
  percentage: number;
@@ -19,10 +14,14 @@ export declare class PublishAppService {
19
14
  private publisherFactory;
20
15
  private workspaceService;
21
16
  constructor(publisherFactory: PublisherFactory, workspaceService: WorkspaceAppService);
22
- publish(project: Project, method: 'ftp' | 'netlify' | 'mdfriday', options?: PublishOptions, onProgress?: PublishProgressCallback): Promise<any>;
23
- testConnection(project: Project, method: 'ftp' | 'netlify' | 'mdfriday'): Promise<{
17
+ publish(project: Project, config: AnyPublishConfig, options?: {
18
+ force?: boolean;
19
+ incremental?: boolean;
20
+ }, onProgress?: PublishProgressCallback): Promise<any>;
21
+ testConnection(project: Project, config: AnyPublishConfig): Promise<{
24
22
  success: boolean;
25
23
  error?: string;
26
24
  }>;
25
+ prepareFinalConfig(workspace: Workspace, project: Project, method: 'ftp' | 'netlify' | 'mdfriday'): Promise<AnyPublishConfig>;
27
26
  private getMethodConfig;
28
27
  }
@@ -26,4 +26,15 @@ export declare class WorkspaceAppService {
26
26
  saveProject(project: Project): Promise<void>;
27
27
  findProjectRoot(startPath: string): Promise<string | null>;
28
28
  createIdentityStorage(workspace: Workspace): import("../domain/identity").IdentityStorageProvider;
29
+ setupProjectBaseURLStructure(project: Project): Promise<{
30
+ serverRoot: string;
31
+ baseURL: string;
32
+ symlinkCreated: boolean;
33
+ }>;
34
+ cleanProjectBaseURLStructure(project: Project): Promise<void>;
35
+ ensureProjectBaseURLStructure(project: Project): Promise<{
36
+ serverRoot: string;
37
+ baseURL: string;
38
+ recreated: boolean;
39
+ }>;
29
40
  }
@@ -80,4 +80,23 @@ export declare class Project {
80
80
  getSupportedLanguagesFromLinks(): string[];
81
81
  isLinkedProject(): boolean;
82
82
  getLinkDirs(): string[];
83
+ getBaseURL(): Promise<string>;
84
+ setBaseURL(baseURL: string): Promise<void>;
85
+ parseBaseURLPath(baseURL: string): {
86
+ isRoot: boolean;
87
+ pathParts: string[];
88
+ parentParts: string[];
89
+ finalDirName: string;
90
+ relativeToPublic: string;
91
+ };
92
+ getBaseURLStructure(): {
93
+ baseURL: string;
94
+ createdAt: number;
95
+ pathParts: string[];
96
+ } | null;
97
+ updateBaseURLStructure(info: {
98
+ baseURL: string;
99
+ createdAt: number;
100
+ pathParts: string[];
101
+ } | null): void;
83
102
  }
@@ -32,6 +32,7 @@ export declare class WorkspaceFactory {
32
32
  contentDir?: string;
33
33
  staticDir?: string;
34
34
  publishDir?: string;
35
+ baseURL?: string;
35
36
  }): Promise<Project>;
36
37
  deleteProject(workspace: Workspace, projectIdOrName: string, options?: {
37
38
  deleteFiles?: boolean;
@@ -53,5 +54,16 @@ export declare class WorkspaceFactory {
53
54
  deleteSnapshot(project: Project, snapshotId: string): Promise<void>;
54
55
  getSnapshot(project: Project, snapshotId: string): Promise<SnapshotMetadata>;
55
56
  createIdentityStorage(workspace: Workspace): IdentityStorageProvider;
57
+ setupBaseURLStructure(project: Project): Promise<{
58
+ serverRoot: string;
59
+ baseURL: string;
60
+ symlinkCreated: boolean;
61
+ }>;
62
+ cleanBaseURLStructure(project: Project): Promise<void>;
63
+ ensureBaseURLStructure(project: Project): Promise<{
64
+ serverRoot: string;
65
+ baseURL: string;
66
+ recreated: boolean;
67
+ }>;
56
68
  private createSampleContent;
57
69
  }
@@ -53,6 +53,7 @@ export interface FileSystemRepository {
53
53
  unlink(path: string): Promise<void>;
54
54
  access(path: string): Promise<void>;
55
55
  resolvePath(path: string): Promise<string>;
56
+ remove(targetPath: string, recursive?: boolean): Promise<void>;
56
57
  basename(path: string): string;
57
58
  dirname(path: string): string;
58
59
  join(...paths: string[]): string;
@@ -37,6 +37,11 @@ export declare class ProjectMetadata {
37
37
  readonly contentLinks: ContentLink[];
38
38
  readonly staticLink: StaticLink | null;
39
39
  readonly fileLink: FileLink | null;
40
+ readonly baseURLStructure: {
41
+ baseURL: string;
42
+ createdAt: number;
43
+ pathParts: string[];
44
+ } | null;
40
45
  private constructor();
41
46
  static create(data: {
42
47
  id: string;
@@ -57,6 +62,11 @@ export declare class ProjectMetadata {
57
62
  contentLinks: ContentLink[];
58
63
  staticLink: StaticLink | null;
59
64
  fileLink: FileLink | null;
65
+ baseURLStructure: {
66
+ baseURL: string;
67
+ createdAt: number;
68
+ pathParts: string[];
69
+ } | null;
60
70
  }>): ProjectMetadata;
61
71
  toJSON(): any;
62
72
  }
@@ -5,16 +5,6 @@ export interface PublishOptions {
5
5
  project?: string;
6
6
  force?: boolean;
7
7
  verbose?: boolean;
8
- host?: string;
9
- port?: number;
10
- username?: string;
11
- password?: string;
12
- remotePath?: string;
13
- secure?: boolean;
14
- siteId?: string;
15
- token?: string;
16
- type?: 'share' | 'sub' | 'custom' | 'enterprise';
17
- licenseKey?: string;
18
8
  }
19
9
  export declare class PublishCommand implements Command {
20
10
  private publishService;
@@ -23,5 +13,5 @@ export declare class PublishCommand implements Command {
23
13
  description: string;
24
14
  constructor(publishService: PublishAppService, workspaceAppService: WorkspaceAppService);
25
15
  execute(args: string[], options: PublishOptions): Promise<CommandResult>;
26
- private parseConfigOverride;
16
+ private executeTest;
27
17
  }
@@ -1,7 +1 @@
1
- import { WorkspaceFactory } from '@internal/domain/workspace';
2
- import { WorkspaceAppService } from '@internal/application/workspace';
3
- import { IdentityAppService } from '@internal/application/identity';
4
- export declare function createWorkspaceFactory(): WorkspaceFactory;
5
- export declare function createWorkspaceAppService(): WorkspaceAppService;
6
- export declare function createIdentityService(projectPath?: string): Promise<IdentityAppService>;
7
- export declare function createPublishAppService(): any;
1
+ export { createWorkspaceFactory, createWorkspaceAppService, createIdentityService, createIdentityServiceForObsidian, createPublishAppService, } from '@internal/application/container';
@@ -23,6 +23,7 @@ export interface ProjectCreateOptions {
23
23
  path?: string;
24
24
  source?: string;
25
25
  sourceFile?: string;
26
+ baseUrl?: string;
26
27
  noSample?: boolean;
27
28
  interactive?: boolean;
28
29
  }
@@ -47,6 +48,4 @@ export interface ServeOptions {
47
48
  livereloadPort?: number;
48
49
  publish?: 'ftp' | 'netlify' | 'mdfriday';
49
50
  publishDelay?: number;
50
- type?: 'share' | 'sub' | 'custom' | 'enterprise';
51
- licenseKey?: string;
52
51
  }
@@ -1,4 +1,5 @@
1
- import { HttpClient } from '@internal/domain/publish/repository/http-client';
1
+ import { IdentityAppService } from '@internal/application/identity';
2
+ import { HttpClient } from '@internal/domain/identity';
2
3
  export interface ObsidianAuthStatus {
3
4
  isAuthenticated: boolean;
4
5
  email?: string;
@@ -16,11 +17,10 @@ export interface ObsidianAuthResult<T = void> {
16
17
  error?: string;
17
18
  }
18
19
  export declare class ObsidianAuthService {
19
- private httpClient;
20
- constructor(httpClient?: HttpClient);
20
+ private identityService;
21
+ constructor(identityService: IdentityAppService);
21
22
  getStatus(): Promise<ObsidianAuthResult<ObsidianAuthStatus>>;
22
23
  getConfig(): Promise<ObsidianAuthResult<ObsidianServerConfig>>;
23
24
  updateConfig(config: ObsidianServerConfig): Promise<ObsidianAuthResult<ObsidianServerConfig>>;
24
- private getIdentityService;
25
25
  }
26
- export declare function createObsidianAuthService(httpClient?: HttpClient): ObsidianAuthService;
26
+ export declare function createObsidianAuthService(workspacePath: string, httpClient: HttpClient): Promise<ObsidianAuthService>;
@@ -1,4 +1,4 @@
1
- import { WorkspaceFactory } from '@internal/domain/workspace';
2
- import { WorkspaceAppService } from '@internal/application/workspace';
3
- export declare function createWorkspaceFactory(): WorkspaceFactory;
4
- export declare function createWorkspaceAppService(): WorkspaceAppService;
1
+ import { HttpClient } from "@internal/domain/identity";
2
+ import { IdentityAppService } from "@internal/application";
3
+ export { createWorkspaceFactory, createWorkspaceAppService, createIdentityService, createIdentityServiceForObsidian, createPublishAppService, } from '@internal/application/container';
4
+ export declare function getIdentityService(workspacePath: string, httpClient: HttpClient): Promise<IdentityAppService>;
@@ -1,4 +1,5 @@
1
- import { HttpClient } from '@internal/domain/publish/repository/http-client';
1
+ import { IdentityAppService } from '@internal/application/identity';
2
+ import { HttpClient } from '@internal/domain/identity';
2
3
  export interface ObsidianDomainInfo {
3
4
  subdomain: string;
4
5
  fullDomain: string;
@@ -46,14 +47,13 @@ export interface ObsidianDomainResult<T = void> {
46
47
  error?: string;
47
48
  }
48
49
  export declare class ObsidianDomainService {
49
- private httpClient;
50
- constructor(httpClient?: HttpClient);
50
+ private identityService;
51
+ constructor(identityService: IdentityAppService);
51
52
  getDomainInfo(): Promise<ObsidianDomainResult<ObsidianDomainInfo>>;
52
53
  checkSubdomain(subdomain: string): Promise<ObsidianDomainResult<ObsidianSubdomainCheckResult>>;
53
54
  updateSubdomain(newSubdomain: string): Promise<ObsidianDomainResult<ObsidianSubdomainUpdateResult>>;
54
55
  checkCustomDomain(domain: string): Promise<ObsidianDomainResult<ObsidianCustomDomainCheckResult>>;
55
56
  addCustomDomain(domain: string): Promise<ObsidianDomainResult<ObsidianCustomDomainAddResult>>;
56
57
  checkHttpsStatus(domain: string): Promise<ObsidianDomainResult<ObsidianHttpsStatusResult>>;
57
- private getIdentityService;
58
58
  }
59
- export declare function createObsidianDomainService(httpClient?: HttpClient): ObsidianDomainService;
59
+ export declare function createObsidianDomainService(workspacePath: string, httpClient: HttpClient): Promise<ObsidianDomainService>;
@@ -8,4 +8,6 @@ export { ObsidianLicenseService, createObsidianLicenseService, ObsidianLicenseIn
8
8
  export { ObsidianAuthService, createObsidianAuthService, ObsidianAuthStatus, ObsidianServerConfig, ObsidianAuthResult, } from './auth';
9
9
  export { ObsidianDomainService, createObsidianDomainService, ObsidianDomainInfo, ObsidianSubdomainCheckResult, ObsidianSubdomainUpdateResult, ObsidianCustomDomainCheckResult, ObsidianCustomDomainAddResult, ObsidianHttpsCertificate, ObsidianHttpsStatusResult, ObsidianDomainResult, } from './domain';
10
10
  export { createWorkspaceAppService, createWorkspaceFactory, } from './container';
11
- export type { HttpClient, HttpResponse } from '@internal/domain/publish/repository/http-client';
11
+ export type { HttpClient as PublishHttpClient, HttpResponse as PublishHttpResponse } from '@internal/domain/publish/repository/http-client';
12
+ export type { HttpClient as IdentityHttpClient, HttpResponse as IdentityHttpResponse } from '@internal/domain/identity';
13
+ export type { AnyPublishConfig, FTPConfig, NetlifyConfig, MDFridayConfig, } from '@internal/domain/publish';
@@ -1,5 +1,5 @@
1
- import { WorkspaceAppService } from '@internal/application/workspace';
2
- import { HttpClient } from '@internal/domain/publish/repository/http-client';
1
+ import { IdentityAppService } from '@internal/application/identity';
2
+ import { HttpClient } from '@internal/domain/identity';
3
3
  export interface ObsidianLicenseInfo {
4
4
  key: string;
5
5
  plan: string;
@@ -60,9 +60,8 @@ export interface ObsidianLicenseResult<T = any> {
60
60
  error?: string;
61
61
  }
62
62
  export declare class ObsidianLicenseService {
63
- private workspaceAppService;
64
- private httpClient;
65
- constructor(workspaceAppService: WorkspaceAppService, httpClient?: HttpClient);
63
+ private identityService;
64
+ constructor(identityService: IdentityAppService);
66
65
  requestTrial(email: string): Promise<ObsidianLicenseResult<ObsidianLicenseInfo>>;
67
66
  loginWithLicense(licenseKey: string): Promise<ObsidianLicenseResult<ObsidianLicenseInfo>>;
68
67
  activateLicense(licenseKey: string): Promise<ObsidianLicenseResult<ObsidianLicenseInfo>>;
@@ -70,7 +69,6 @@ export declare class ObsidianLicenseService {
70
69
  getLicenseUsage(): Promise<ObsidianLicenseResult<ObsidianLicenseUsage>>;
71
70
  resetUsage(force: boolean): Promise<ObsidianLicenseResult<any>>;
72
71
  hasActiveLicense(): Promise<boolean>;
73
- private getIdentityService;
74
72
  private buildLicenseInfo;
75
73
  }
76
- export declare function createObsidianLicenseService(httpClient?: HttpClient): ObsidianLicenseService;
74
+ export declare function createObsidianLicenseService(workspacePath: string, httpClient: HttpClient): Promise<ObsidianLicenseService>;
@@ -1,13 +1,14 @@
1
1
  import { PublishAppService } from '@internal/application/publish';
2
2
  import { WorkspaceAppService } from '@internal/application/workspace';
3
+ import { AnyPublishConfig } from '@internal/domain/publish';
3
4
  import { HttpClient } from '@internal/domain/publish/repository/http-client';
4
5
  export type ObsidianPublishMethod = 'ftp' | 'netlify' | 'mdfriday';
5
6
  export interface ObsidianPublishOptions {
6
7
  workspacePath: string;
7
8
  projectName: string;
8
9
  method: ObsidianPublishMethod;
10
+ config: AnyPublishConfig;
9
11
  force?: boolean;
10
- config?: any;
11
12
  }
12
13
  export interface ObsidianPublishProgress {
13
14
  phase: 'scanning' | 'uploading' | 'deploying' | 'complete';
@@ -38,6 +39,6 @@ export declare class ObsidianPublishService {
38
39
  private workspaceAppService;
39
40
  constructor(publishAppService: PublishAppService, workspaceAppService: WorkspaceAppService);
40
41
  publish(options: ObsidianPublishOptions, onProgress?: (progress: ObsidianPublishProgress) => void): Promise<ObsidianPublishResult>;
41
- testConnection(workspacePath: string, projectName: string, method: ObsidianPublishMethod): Promise<ObsidianTestConnectionResult>;
42
+ testConnection(workspacePath: string, projectName: string, config: AnyPublishConfig): Promise<ObsidianTestConnectionResult>;
42
43
  }
43
44
  export declare function createObsidianPublishService(httpClient: HttpClient): ObsidianPublishService;
@@ -2,6 +2,7 @@ import { WorkspaceAppService } from '@internal/application/workspace';
2
2
  import { PublishAppService } from '@internal/application/publish';
3
3
  import { HttpClient } from '@internal/domain/publish/repository/http-client';
4
4
  import { MarkdownRenderer } from '@internal/domain/markdown';
5
+ import { AnyPublishConfig } from '@internal/domain/publish';
5
6
  export interface ObsidianServeOptions {
6
7
  workspacePath: string;
7
8
  projectName: string;
@@ -9,11 +10,10 @@ export interface ObsidianServeOptions {
9
10
  host?: string;
10
11
  livereloadPort?: number;
11
12
  livereload?: boolean;
12
- publish?: 'ftp' | 'netlify' | 'mdfriday';
13
- publishDelay?: number;
14
13
  publishConfig?: {
15
- type?: string;
16
- licenseKey?: string;
14
+ method: 'ftp' | 'netlify' | 'mdfriday';
15
+ config: AnyPublishConfig;
16
+ delay?: number;
17
17
  };
18
18
  markdown?: MarkdownRenderer;
19
19
  }
@@ -24,6 +24,8 @@ export interface ObsidianServeResult {
24
24
  url: string;
25
25
  port: number;
26
26
  host: string;
27
+ baseURL?: string;
28
+ serverRoot?: string;
27
29
  livereloadPort?: number;
28
30
  autoPublish?: string;
29
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mdfriday/foundry",
3
- "version": "26.3.7",
3
+ "version": "26.3.9",
4
4
  "description": "The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",