@mdfriday/foundry 26.4.10 → 26.4.12
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.
- package/dist/cli.js +446 -447
- package/dist/index.js +1 -1
- package/dist/internal/interfaces/obsidian/auth.d.ts +3 -3
- package/dist/internal/interfaces/obsidian/config.d.ts +3 -3
- package/dist/internal/interfaces/obsidian/license.d.ts +3 -3
- package/dist/internal/interfaces/obsidian/mobile-config-types.d.ts +13 -0
- package/dist/internal/interfaces/obsidian/mobile-container.d.ts +6 -0
- package/dist/internal/interfaces/obsidian/mobile.d.ts +2 -3
- package/dist/internal/interfaces/obsidian/workspace.d.ts +2 -2
- package/dist/obsidian/mobile.js +2829 -5738
- package/dist/pkg/log/browser-manager.d.ts +20 -0
- package/dist/pkg/log/browser.d.ts +25 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4357,12 +4357,11 @@ var init_workspace2 = __esm({
|
|
|
4357
4357
|
});
|
|
4358
4358
|
|
|
4359
4359
|
// internal/application/workspace.ts
|
|
4360
|
-
var
|
|
4360
|
+
var log6, WorkspaceAppService;
|
|
4361
4361
|
var init_workspace3 = __esm({
|
|
4362
4362
|
"internal/application/workspace.ts"() {
|
|
4363
4363
|
"use strict";
|
|
4364
4364
|
init_log();
|
|
4365
|
-
import_path = __toESM(require("path"));
|
|
4366
4365
|
log6 = getDomainLogger("workspace-app", { component: "application" });
|
|
4367
4366
|
WorkspaceAppService = class {
|
|
4368
4367
|
workspaceFactory;
|
|
@@ -4375,17 +4374,17 @@ var init_workspace3 = __esm({
|
|
|
4375
4374
|
/**
|
|
4376
4375
|
* Load workspace from path
|
|
4377
4376
|
*/
|
|
4378
|
-
async loadWorkspace(
|
|
4379
|
-
if (
|
|
4380
|
-
return this.workspaceFactory.load(
|
|
4377
|
+
async loadWorkspace(path39) {
|
|
4378
|
+
if (path39) {
|
|
4379
|
+
return this.workspaceFactory.load(path39);
|
|
4381
4380
|
}
|
|
4382
4381
|
return this.workspaceFactory.loadOrFind();
|
|
4383
4382
|
}
|
|
4384
4383
|
/**
|
|
4385
4384
|
* Create new workspace
|
|
4386
4385
|
*/
|
|
4387
|
-
async createWorkspace(
|
|
4388
|
-
return this.workspaceFactory.create(
|
|
4386
|
+
async createWorkspace(path39, options) {
|
|
4387
|
+
return this.workspaceFactory.create(path39, options);
|
|
4389
4388
|
}
|
|
4390
4389
|
/**
|
|
4391
4390
|
* Save workspace
|
|
@@ -4449,7 +4448,7 @@ var init_workspace3 = __esm({
|
|
|
4449
4448
|
if (!fsRepo) {
|
|
4450
4449
|
project = void 0;
|
|
4451
4450
|
} else {
|
|
4452
|
-
const inputPath =
|
|
4451
|
+
const inputPath = fsRepo.resolvePathSync(projectNameOrPath);
|
|
4453
4452
|
for (const p2 of projects) {
|
|
4454
4453
|
const projectPath = p2.getPath();
|
|
4455
4454
|
if (inputPath.startsWith(projectPath) || projectPath === inputPath) {
|
|
@@ -5031,12 +5030,12 @@ var init_identity2 = __esm({
|
|
|
5031
5030
|
});
|
|
5032
5031
|
|
|
5033
5032
|
// internal/infrastructure/persistence/node-workspace-repository.ts
|
|
5034
|
-
var import_fs,
|
|
5033
|
+
var import_fs, import_path, MDFRIDAY_DIR, WORKSPACE_FILE, PROJECTS_FILE, PROJECT_FILE, CONFIG_FILE, NodeWorkspaceRepository, NodeProjectRepository;
|
|
5035
5034
|
var init_node_workspace_repository = __esm({
|
|
5036
5035
|
"internal/infrastructure/persistence/node-workspace-repository.ts"() {
|
|
5037
5036
|
"use strict";
|
|
5038
5037
|
import_fs = require("fs");
|
|
5039
|
-
|
|
5038
|
+
import_path = __toESM(require("path"));
|
|
5040
5039
|
MDFRIDAY_DIR = ".mdfriday";
|
|
5041
5040
|
WORKSPACE_FILE = "workspace.json";
|
|
5042
5041
|
PROJECTS_FILE = "projects.json";
|
|
@@ -5045,7 +5044,7 @@ var init_node_workspace_repository = __esm({
|
|
|
5045
5044
|
NodeWorkspaceRepository = class {
|
|
5046
5045
|
async isWorkspace(workspacePath) {
|
|
5047
5046
|
try {
|
|
5048
|
-
const metadataPath =
|
|
5047
|
+
const metadataPath = import_path.default.join(workspacePath, MDFRIDAY_DIR, WORKSPACE_FILE);
|
|
5049
5048
|
await import_fs.promises.access(metadataPath);
|
|
5050
5049
|
return true;
|
|
5051
5050
|
} catch {
|
|
@@ -5053,28 +5052,28 @@ var init_node_workspace_repository = __esm({
|
|
|
5053
5052
|
}
|
|
5054
5053
|
}
|
|
5055
5054
|
async initWorkspaceStructure(workspacePath, modulesDir, projectsDir) {
|
|
5056
|
-
const mdfridayDir =
|
|
5057
|
-
const modulesDirPath =
|
|
5058
|
-
const projectsDirPath =
|
|
5055
|
+
const mdfridayDir = import_path.default.join(workspacePath, MDFRIDAY_DIR);
|
|
5056
|
+
const modulesDirPath = import_path.default.join(workspacePath, modulesDir);
|
|
5057
|
+
const projectsDirPath = import_path.default.join(workspacePath, projectsDir);
|
|
5059
5058
|
await import_fs.promises.mkdir(mdfridayDir, { recursive: true });
|
|
5060
5059
|
await import_fs.promises.mkdir(modulesDirPath, { recursive: true });
|
|
5061
5060
|
await import_fs.promises.mkdir(projectsDirPath, { recursive: true });
|
|
5062
5061
|
}
|
|
5063
5062
|
async saveWorkspaceMetadata(workspacePath, metadata) {
|
|
5064
|
-
const metadataPath =
|
|
5063
|
+
const metadataPath = import_path.default.join(workspacePath, MDFRIDAY_DIR, WORKSPACE_FILE);
|
|
5065
5064
|
await import_fs.promises.writeFile(metadataPath, JSON.stringify(metadata, null, 2));
|
|
5066
5065
|
}
|
|
5067
5066
|
async loadWorkspaceMetadata(workspacePath) {
|
|
5068
|
-
const metadataPath =
|
|
5067
|
+
const metadataPath = import_path.default.join(workspacePath, MDFRIDAY_DIR, WORKSPACE_FILE);
|
|
5069
5068
|
const content = await import_fs.promises.readFile(metadataPath, "utf-8");
|
|
5070
5069
|
return JSON.parse(content);
|
|
5071
5070
|
}
|
|
5072
5071
|
async saveProjectRegistry(workspacePath, registry) {
|
|
5073
|
-
const registryPath =
|
|
5072
|
+
const registryPath = import_path.default.join(workspacePath, MDFRIDAY_DIR, PROJECTS_FILE);
|
|
5074
5073
|
await import_fs.promises.writeFile(registryPath, JSON.stringify(registry, null, 2));
|
|
5075
5074
|
}
|
|
5076
5075
|
async loadProjectRegistry(workspacePath) {
|
|
5077
|
-
const registryPath =
|
|
5076
|
+
const registryPath = import_path.default.join(workspacePath, MDFRIDAY_DIR, PROJECTS_FILE);
|
|
5078
5077
|
const content = await import_fs.promises.readFile(registryPath, "utf-8");
|
|
5079
5078
|
return JSON.parse(content);
|
|
5080
5079
|
}
|
|
@@ -5082,7 +5081,7 @@ var init_node_workspace_repository = __esm({
|
|
|
5082
5081
|
NodeProjectRepository = class {
|
|
5083
5082
|
async isProject(projectPath) {
|
|
5084
5083
|
try {
|
|
5085
|
-
const metadataPath =
|
|
5084
|
+
const metadataPath = import_path.default.join(projectPath, MDFRIDAY_DIR, PROJECT_FILE);
|
|
5086
5085
|
await import_fs.promises.access(metadataPath);
|
|
5087
5086
|
return true;
|
|
5088
5087
|
} catch {
|
|
@@ -5090,26 +5089,26 @@ var init_node_workspace_repository = __esm({
|
|
|
5090
5089
|
}
|
|
5091
5090
|
}
|
|
5092
5091
|
async initProjectStructure(projectPath, contentDir, staticDir, publishDir) {
|
|
5093
|
-
const mdfridayDir =
|
|
5094
|
-
const contentDirPath =
|
|
5095
|
-
const staticDirPath =
|
|
5096
|
-
const publishDirPath =
|
|
5092
|
+
const mdfridayDir = import_path.default.join(projectPath, MDFRIDAY_DIR);
|
|
5093
|
+
const contentDirPath = import_path.default.join(projectPath, contentDir);
|
|
5094
|
+
const staticDirPath = import_path.default.join(projectPath, staticDir);
|
|
5095
|
+
const publishDirPath = import_path.default.join(projectPath, publishDir);
|
|
5097
5096
|
await import_fs.promises.mkdir(mdfridayDir, { recursive: true });
|
|
5098
5097
|
await import_fs.promises.mkdir(contentDirPath, { recursive: true });
|
|
5099
5098
|
await import_fs.promises.mkdir(staticDirPath, { recursive: true });
|
|
5100
5099
|
await import_fs.promises.mkdir(publishDirPath, { recursive: true });
|
|
5101
5100
|
}
|
|
5102
5101
|
async saveProjectMetadata(projectPath, metadata) {
|
|
5103
|
-
const metadataPath =
|
|
5102
|
+
const metadataPath = import_path.default.join(projectPath, MDFRIDAY_DIR, PROJECT_FILE);
|
|
5104
5103
|
await import_fs.promises.writeFile(metadataPath, JSON.stringify(metadata, null, 2));
|
|
5105
5104
|
}
|
|
5106
5105
|
async loadProjectMetadata(projectPath) {
|
|
5107
|
-
const metadataPath =
|
|
5106
|
+
const metadataPath = import_path.default.join(projectPath, MDFRIDAY_DIR, PROJECT_FILE);
|
|
5108
5107
|
const content = await import_fs.promises.readFile(metadataPath, "utf-8");
|
|
5109
5108
|
return JSON.parse(content);
|
|
5110
5109
|
}
|
|
5111
5110
|
async saveProjectConfig(projectPath, config) {
|
|
5112
|
-
const configPath =
|
|
5111
|
+
const configPath = import_path.default.join(projectPath, CONFIG_FILE);
|
|
5113
5112
|
await import_fs.promises.writeFile(configPath, JSON.stringify(config, null, 2));
|
|
5114
5113
|
}
|
|
5115
5114
|
async createSampleContent(contentPath, content) {
|
|
@@ -5126,20 +5125,20 @@ var init_node_workspace_repository = __esm({
|
|
|
5126
5125
|
});
|
|
5127
5126
|
|
|
5128
5127
|
// internal/infrastructure/persistence/node-snapshot-repository.ts
|
|
5129
|
-
var import_fs2,
|
|
5128
|
+
var import_fs2, import_path2, NodeSnapshotRepository;
|
|
5130
5129
|
var init_node_snapshot_repository = __esm({
|
|
5131
5130
|
"internal/infrastructure/persistence/node-snapshot-repository.ts"() {
|
|
5132
5131
|
"use strict";
|
|
5133
5132
|
import_fs2 = require("fs");
|
|
5134
|
-
|
|
5133
|
+
import_path2 = __toESM(require("path"));
|
|
5135
5134
|
NodeSnapshotRepository = class {
|
|
5136
5135
|
/**
|
|
5137
5136
|
* Create a snapshot by copying output directory to snapshot storage
|
|
5138
5137
|
*/
|
|
5139
5138
|
async createSnapshot(projectPath, snapshotId, outputDir) {
|
|
5140
|
-
const snapshotDir =
|
|
5139
|
+
const snapshotDir = import_path2.default.join(projectPath, ".mdfriday", "snapshots");
|
|
5141
5140
|
await import_fs2.promises.mkdir(snapshotDir, { recursive: true });
|
|
5142
|
-
const storageDir =
|
|
5141
|
+
const storageDir = import_path2.default.join(snapshotDir, snapshotId);
|
|
5143
5142
|
await import_fs2.promises.mkdir(storageDir, { recursive: true });
|
|
5144
5143
|
await this.copyDirectory(outputDir, storageDir);
|
|
5145
5144
|
const size = await this.getDirectorySize(storageDir);
|
|
@@ -5149,12 +5148,12 @@ var init_node_snapshot_repository = __esm({
|
|
|
5149
5148
|
name: snapshotId,
|
|
5150
5149
|
// Will be updated by service if custom name provided
|
|
5151
5150
|
timestamp: Date.now(),
|
|
5152
|
-
outputDir:
|
|
5153
|
-
storageDir:
|
|
5151
|
+
outputDir: import_path2.default.relative(projectPath, outputDir),
|
|
5152
|
+
storageDir: import_path2.default.relative(projectPath, storageDir),
|
|
5154
5153
|
size,
|
|
5155
5154
|
fileCount
|
|
5156
5155
|
};
|
|
5157
|
-
const metadataPath =
|
|
5156
|
+
const metadataPath = import_path2.default.join(snapshotDir, `${snapshotId}.json`);
|
|
5158
5157
|
await import_fs2.promises.writeFile(metadataPath, JSON.stringify(metadata, null, 2));
|
|
5159
5158
|
return metadata;
|
|
5160
5159
|
}
|
|
@@ -5162,7 +5161,7 @@ var init_node_snapshot_repository = __esm({
|
|
|
5162
5161
|
* List all snapshots for a project
|
|
5163
5162
|
*/
|
|
5164
5163
|
async listSnapshots(projectPath) {
|
|
5165
|
-
const snapshotDir =
|
|
5164
|
+
const snapshotDir = import_path2.default.join(projectPath, ".mdfriday", "snapshots");
|
|
5166
5165
|
try {
|
|
5167
5166
|
await import_fs2.promises.access(snapshotDir);
|
|
5168
5167
|
} catch {
|
|
@@ -5173,7 +5172,7 @@ var init_node_snapshot_repository = __esm({
|
|
|
5173
5172
|
const snapshots = [];
|
|
5174
5173
|
for (const file of jsonFiles) {
|
|
5175
5174
|
try {
|
|
5176
|
-
const content = await import_fs2.promises.readFile(
|
|
5175
|
+
const content = await import_fs2.promises.readFile(import_path2.default.join(snapshotDir, file), "utf-8");
|
|
5177
5176
|
snapshots.push(JSON.parse(content));
|
|
5178
5177
|
} catch {
|
|
5179
5178
|
}
|
|
@@ -5184,8 +5183,8 @@ var init_node_snapshot_repository = __esm({
|
|
|
5184
5183
|
* Get snapshot metadata
|
|
5185
5184
|
*/
|
|
5186
5185
|
async getSnapshot(projectPath, snapshotId) {
|
|
5187
|
-
const snapshotDir =
|
|
5188
|
-
const metadataPath =
|
|
5186
|
+
const snapshotDir = import_path2.default.join(projectPath, ".mdfriday", "snapshots");
|
|
5187
|
+
const metadataPath = import_path2.default.join(snapshotDir, `${snapshotId}.json`);
|
|
5189
5188
|
try {
|
|
5190
5189
|
const content = await import_fs2.promises.readFile(metadataPath, "utf-8");
|
|
5191
5190
|
const metadata = JSON.parse(content);
|
|
@@ -5205,7 +5204,7 @@ var init_node_snapshot_repository = __esm({
|
|
|
5205
5204
|
*/
|
|
5206
5205
|
async restoreSnapshot(projectPath, snapshotId, outputDir) {
|
|
5207
5206
|
const metadata = await this.getSnapshot(projectPath, snapshotId);
|
|
5208
|
-
const storageDir =
|
|
5207
|
+
const storageDir = import_path2.default.join(projectPath, metadata.storageDir);
|
|
5209
5208
|
try {
|
|
5210
5209
|
await import_fs2.promises.access(storageDir);
|
|
5211
5210
|
} catch {
|
|
@@ -5221,13 +5220,13 @@ var init_node_snapshot_repository = __esm({
|
|
|
5221
5220
|
* Delete a snapshot
|
|
5222
5221
|
*/
|
|
5223
5222
|
async deleteSnapshot(projectPath, snapshotId) {
|
|
5224
|
-
const snapshotDir =
|
|
5225
|
-
const metadataPath =
|
|
5223
|
+
const snapshotDir = import_path2.default.join(projectPath, ".mdfriday", "snapshots");
|
|
5224
|
+
const metadataPath = import_path2.default.join(snapshotDir, `${snapshotId}.json`);
|
|
5226
5225
|
try {
|
|
5227
5226
|
const content = await import_fs2.promises.readFile(metadataPath, "utf-8");
|
|
5228
5227
|
const metadata = JSON.parse(content);
|
|
5229
5228
|
if (metadata.storageDir) {
|
|
5230
|
-
const storageDir =
|
|
5229
|
+
const storageDir = import_path2.default.join(projectPath, metadata.storageDir);
|
|
5231
5230
|
try {
|
|
5232
5231
|
await import_fs2.promises.rm(storageDir, { recursive: true, force: true });
|
|
5233
5232
|
} catch {
|
|
@@ -5249,8 +5248,8 @@ var init_node_snapshot_repository = __esm({
|
|
|
5249
5248
|
const entries = await import_fs2.promises.readdir(src, { withFileTypes: true });
|
|
5250
5249
|
await Promise.all(
|
|
5251
5250
|
entries.map(async (entry) => {
|
|
5252
|
-
const srcPath =
|
|
5253
|
-
const destPath =
|
|
5251
|
+
const srcPath = import_path2.default.join(src, entry.name);
|
|
5252
|
+
const destPath = import_path2.default.join(dest, entry.name);
|
|
5254
5253
|
if (entry.isDirectory()) {
|
|
5255
5254
|
await this.copyDirectory(srcPath, destPath);
|
|
5256
5255
|
} else {
|
|
@@ -5266,7 +5265,7 @@ var init_node_snapshot_repository = __esm({
|
|
|
5266
5265
|
let size = 0;
|
|
5267
5266
|
const entries = await import_fs2.promises.readdir(dir2, { withFileTypes: true });
|
|
5268
5267
|
for (const entry of entries) {
|
|
5269
|
-
const entryPath =
|
|
5268
|
+
const entryPath = import_path2.default.join(dir2, entry.name);
|
|
5270
5269
|
if (entry.isDirectory()) {
|
|
5271
5270
|
size += await this.getDirectorySize(entryPath);
|
|
5272
5271
|
} else {
|
|
@@ -5283,7 +5282,7 @@ var init_node_snapshot_repository = __esm({
|
|
|
5283
5282
|
let count = 0;
|
|
5284
5283
|
const entries = await import_fs2.promises.readdir(dir2, { withFileTypes: true });
|
|
5285
5284
|
for (const entry of entries) {
|
|
5286
|
-
const entryPath =
|
|
5285
|
+
const entryPath = import_path2.default.join(dir2, entry.name);
|
|
5287
5286
|
if (entry.isDirectory()) {
|
|
5288
5287
|
count += await this.countFiles(entryPath);
|
|
5289
5288
|
} else {
|
|
@@ -5301,12 +5300,12 @@ function mapLanguageCode(code) {
|
|
|
5301
5300
|
const normalized = code.toLowerCase().trim();
|
|
5302
5301
|
return LANGUAGE_CODE_MAP[normalized] || normalized;
|
|
5303
5302
|
}
|
|
5304
|
-
var import_fs3,
|
|
5303
|
+
var import_fs3, import_path3, log8, LANGUAGE_CODE_MAP, NodeFileSystemRepository;
|
|
5305
5304
|
var init_node_file_system = __esm({
|
|
5306
5305
|
"internal/infrastructure/persistence/node-file-system.ts"() {
|
|
5307
5306
|
"use strict";
|
|
5308
5307
|
import_fs3 = require("fs");
|
|
5309
|
-
|
|
5308
|
+
import_path3 = __toESM(require("path"));
|
|
5310
5309
|
init_log();
|
|
5311
5310
|
log8 = getDomainLogger("node-fs", { component: "infrastructure" });
|
|
5312
5311
|
LANGUAGE_CODE_MAP = {
|
|
@@ -5355,7 +5354,7 @@ var init_node_file_system = __esm({
|
|
|
5355
5354
|
try {
|
|
5356
5355
|
const entries = await import_fs3.promises.readdir(dirPath, { withFileTypes: true });
|
|
5357
5356
|
return entries.map((entry) => ({
|
|
5358
|
-
path:
|
|
5357
|
+
path: import_path3.default.join(dirPath, entry.name),
|
|
5359
5358
|
name: entry.name,
|
|
5360
5359
|
isDirectory: entry.isDirectory(),
|
|
5361
5360
|
isFile: entry.isFile()
|
|
@@ -5406,7 +5405,7 @@ var init_node_file_system = __esm({
|
|
|
5406
5405
|
if (a.weight !== b.weight) {
|
|
5407
5406
|
return a.weight - b.weight;
|
|
5408
5407
|
}
|
|
5409
|
-
return
|
|
5408
|
+
return import_path3.default.basename(a.path).localeCompare(import_path3.default.basename(b.path));
|
|
5410
5409
|
});
|
|
5411
5410
|
const isStructured = contentFolders.length > 0;
|
|
5412
5411
|
log8.debug(`Scanned folder structure: ${dirPath}`, {
|
|
@@ -5550,7 +5549,7 @@ var init_node_file_system = __esm({
|
|
|
5550
5549
|
}
|
|
5551
5550
|
async copyFile(source, target) {
|
|
5552
5551
|
try {
|
|
5553
|
-
const targetDir =
|
|
5552
|
+
const targetDir = import_path3.default.dirname(target);
|
|
5554
5553
|
if (!await this.exists(targetDir)) {
|
|
5555
5554
|
await import_fs3.promises.mkdir(targetDir, { recursive: true });
|
|
5556
5555
|
}
|
|
@@ -5571,7 +5570,7 @@ var init_node_file_system = __esm({
|
|
|
5571
5570
|
}
|
|
5572
5571
|
async writeFile(filePath, content, encoding = "utf-8") {
|
|
5573
5572
|
try {
|
|
5574
|
-
const dir2 =
|
|
5573
|
+
const dir2 = import_path3.default.dirname(filePath);
|
|
5575
5574
|
if (!await this.exists(dir2)) {
|
|
5576
5575
|
await import_fs3.promises.mkdir(dir2, { recursive: true });
|
|
5577
5576
|
}
|
|
@@ -5599,34 +5598,34 @@ var init_node_file_system = __esm({
|
|
|
5599
5598
|
}
|
|
5600
5599
|
}
|
|
5601
5600
|
async resolvePath(filePath) {
|
|
5602
|
-
return
|
|
5601
|
+
return import_path3.default.resolve(filePath);
|
|
5603
5602
|
}
|
|
5604
5603
|
basename(filePath) {
|
|
5605
|
-
return
|
|
5604
|
+
return import_path3.default.basename(filePath);
|
|
5606
5605
|
}
|
|
5607
5606
|
dirname(filePath) {
|
|
5608
|
-
return
|
|
5607
|
+
return import_path3.default.dirname(filePath);
|
|
5609
5608
|
}
|
|
5610
5609
|
join(...paths) {
|
|
5611
|
-
return
|
|
5610
|
+
return import_path3.default.join(...paths);
|
|
5612
5611
|
}
|
|
5613
5612
|
// ============================================================================
|
|
5614
5613
|
// Path Operations (Sync)
|
|
5615
5614
|
// ============================================================================
|
|
5616
5615
|
resolvePathSync(...paths) {
|
|
5617
|
-
return
|
|
5616
|
+
return import_path3.default.resolve(...paths);
|
|
5618
5617
|
}
|
|
5619
5618
|
relative(from, to) {
|
|
5620
|
-
return
|
|
5619
|
+
return import_path3.default.relative(from, to);
|
|
5621
5620
|
}
|
|
5622
5621
|
parsePath(filePath) {
|
|
5623
|
-
return
|
|
5622
|
+
return import_path3.default.parse(filePath);
|
|
5624
5623
|
}
|
|
5625
5624
|
normalize(filePath) {
|
|
5626
|
-
return
|
|
5625
|
+
return import_path3.default.normalize(filePath);
|
|
5627
5626
|
}
|
|
5628
5627
|
isAbsolute(filePath) {
|
|
5629
|
-
return
|
|
5628
|
+
return import_path3.default.isAbsolute(filePath);
|
|
5630
5629
|
}
|
|
5631
5630
|
};
|
|
5632
5631
|
}
|
|
@@ -5840,10 +5839,10 @@ var init_publish_manifest = __esm({
|
|
|
5840
5839
|
*/
|
|
5841
5840
|
getChangedFiles(newManifest) {
|
|
5842
5841
|
const changedFiles = [];
|
|
5843
|
-
for (const [
|
|
5844
|
-
const oldEntry = this.files.get(
|
|
5842
|
+
for (const [path39, newEntry] of newManifest.files.entries()) {
|
|
5843
|
+
const oldEntry = this.files.get(path39);
|
|
5845
5844
|
if (!oldEntry || oldEntry.hash !== newEntry.hash) {
|
|
5846
|
-
changedFiles.push(
|
|
5845
|
+
changedFiles.push(path39);
|
|
5847
5846
|
}
|
|
5848
5847
|
}
|
|
5849
5848
|
return changedFiles;
|
|
@@ -5854,9 +5853,9 @@ var init_publish_manifest = __esm({
|
|
|
5854
5853
|
*/
|
|
5855
5854
|
getDeletedFiles(newManifest) {
|
|
5856
5855
|
const deletedFiles = [];
|
|
5857
|
-
for (const
|
|
5858
|
-
if (!newManifest.files.has(
|
|
5859
|
-
deletedFiles.push(
|
|
5856
|
+
for (const path39 of this.files.keys()) {
|
|
5857
|
+
if (!newManifest.files.has(path39)) {
|
|
5858
|
+
deletedFiles.push(path39);
|
|
5860
5859
|
}
|
|
5861
5860
|
}
|
|
5862
5861
|
return deletedFiles;
|
|
@@ -5866,8 +5865,8 @@ var init_publish_manifest = __esm({
|
|
|
5866
5865
|
*/
|
|
5867
5866
|
toJSON() {
|
|
5868
5867
|
const filesObj = {};
|
|
5869
|
-
for (const [
|
|
5870
|
-
filesObj[
|
|
5868
|
+
for (const [path39, entry] of this.files.entries()) {
|
|
5869
|
+
filesObj[path39] = entry;
|
|
5871
5870
|
}
|
|
5872
5871
|
return {
|
|
5873
5872
|
projectId: this.projectId,
|
|
@@ -7459,8 +7458,8 @@ var require_Client = __commonJS({
|
|
|
7459
7458
|
/**
|
|
7460
7459
|
* Set the working directory.
|
|
7461
7460
|
*/
|
|
7462
|
-
async cd(
|
|
7463
|
-
const validPath = await this.protectWhitespace(
|
|
7461
|
+
async cd(path39) {
|
|
7462
|
+
const validPath = await this.protectWhitespace(path39);
|
|
7464
7463
|
return this.send("CWD " + validPath);
|
|
7465
7464
|
}
|
|
7466
7465
|
/**
|
|
@@ -7473,8 +7472,8 @@ var require_Client = __commonJS({
|
|
|
7473
7472
|
* Get the last modified time of a file. This is not supported by every FTP server, in which case
|
|
7474
7473
|
* calling this method will throw an exception.
|
|
7475
7474
|
*/
|
|
7476
|
-
async lastMod(
|
|
7477
|
-
const validPath = await this.protectWhitespace(
|
|
7475
|
+
async lastMod(path39) {
|
|
7476
|
+
const validPath = await this.protectWhitespace(path39);
|
|
7478
7477
|
const res = await this.send(`MDTM ${validPath}`);
|
|
7479
7478
|
const date = res.message.slice(4);
|
|
7480
7479
|
return (0, parseListMLSD_1.parseMLSxDate)(date);
|
|
@@ -7482,8 +7481,8 @@ var require_Client = __commonJS({
|
|
|
7482
7481
|
/**
|
|
7483
7482
|
* Get the size of a file.
|
|
7484
7483
|
*/
|
|
7485
|
-
async size(
|
|
7486
|
-
const validPath = await this.protectWhitespace(
|
|
7484
|
+
async size(path39) {
|
|
7485
|
+
const validPath = await this.protectWhitespace(path39);
|
|
7487
7486
|
const command = `SIZE ${validPath}`;
|
|
7488
7487
|
const res = await this.send(command);
|
|
7489
7488
|
const size = parseInt(res.message.slice(4), 10);
|
|
@@ -7510,8 +7509,8 @@ var require_Client = __commonJS({
|
|
|
7510
7509
|
* You can ignore FTP error return codes which won't throw an exception if e.g.
|
|
7511
7510
|
* the file doesn't exist.
|
|
7512
7511
|
*/
|
|
7513
|
-
async remove(
|
|
7514
|
-
const validPath = await this.protectWhitespace(
|
|
7512
|
+
async remove(path39, ignoreErrorCodes = false) {
|
|
7513
|
+
const validPath = await this.protectWhitespace(path39);
|
|
7515
7514
|
if (ignoreErrorCodes) {
|
|
7516
7515
|
return this.sendIgnoringError(`DELE ${validPath}`);
|
|
7517
7516
|
}
|
|
@@ -7665,8 +7664,8 @@ var require_Client = __commonJS({
|
|
|
7665
7664
|
*
|
|
7666
7665
|
* @param [path] Path to remote file or directory.
|
|
7667
7666
|
*/
|
|
7668
|
-
async list(
|
|
7669
|
-
const validPath = await this.protectWhitespace(
|
|
7667
|
+
async list(path39 = "") {
|
|
7668
|
+
const validPath = await this.protectWhitespace(path39);
|
|
7670
7669
|
let lastError;
|
|
7671
7670
|
for (const candidate of this.availableListCommands) {
|
|
7672
7671
|
const command = validPath === "" ? candidate : `${candidate} ${validPath}`;
|
|
@@ -7836,21 +7835,21 @@ var require_Client = __commonJS({
|
|
|
7836
7835
|
/**
|
|
7837
7836
|
* Remove an empty directory, will fail if not empty.
|
|
7838
7837
|
*/
|
|
7839
|
-
async removeEmptyDir(
|
|
7840
|
-
const validPath = await this.protectWhitespace(
|
|
7838
|
+
async removeEmptyDir(path39) {
|
|
7839
|
+
const validPath = await this.protectWhitespace(path39);
|
|
7841
7840
|
return this.send(`RMD ${validPath}`);
|
|
7842
7841
|
}
|
|
7843
7842
|
/**
|
|
7844
7843
|
* FTP servers can't handle filenames that have leading whitespace. This method transforms
|
|
7845
7844
|
* a given path to fix that issue for most cases.
|
|
7846
7845
|
*/
|
|
7847
|
-
async protectWhitespace(
|
|
7848
|
-
if (!
|
|
7849
|
-
return
|
|
7846
|
+
async protectWhitespace(path39) {
|
|
7847
|
+
if (!path39.startsWith(" ")) {
|
|
7848
|
+
return path39;
|
|
7850
7849
|
}
|
|
7851
7850
|
const pwd = await this.pwd();
|
|
7852
7851
|
const absolutePathPrefix = pwd.endsWith("/") ? pwd : pwd + "/";
|
|
7853
|
-
return absolutePathPrefix +
|
|
7852
|
+
return absolutePathPrefix + path39;
|
|
7854
7853
|
}
|
|
7855
7854
|
async _exitAtCurrentDirectory(func) {
|
|
7856
7855
|
const userDir = await this.pwd();
|
|
@@ -7927,11 +7926,11 @@ var require_Client = __commonJS({
|
|
|
7927
7926
|
}
|
|
7928
7927
|
};
|
|
7929
7928
|
exports2.Client = Client2;
|
|
7930
|
-
async function ensureLocalDirectory(
|
|
7929
|
+
async function ensureLocalDirectory(path39) {
|
|
7931
7930
|
try {
|
|
7932
|
-
await fsStat(
|
|
7931
|
+
await fsStat(path39);
|
|
7933
7932
|
} catch (_a2) {
|
|
7934
|
-
await fsMkDir(
|
|
7933
|
+
await fsMkDir(path39, { recursive: true });
|
|
7935
7934
|
}
|
|
7936
7935
|
}
|
|
7937
7936
|
async function ignoreError(func) {
|
|
@@ -7994,13 +7993,13 @@ var require_dist = __commonJS({
|
|
|
7994
7993
|
});
|
|
7995
7994
|
|
|
7996
7995
|
// internal/domain/publish/value-object/ftp-publisher.ts
|
|
7997
|
-
var ftp,
|
|
7996
|
+
var ftp, import_path4, import_fs4, log10, FtpPublisher;
|
|
7998
7997
|
var init_ftp_publisher = __esm({
|
|
7999
7998
|
"internal/domain/publish/value-object/ftp-publisher.ts"() {
|
|
8000
7999
|
"use strict";
|
|
8001
8000
|
init_log();
|
|
8002
8001
|
ftp = __toESM(require_dist());
|
|
8003
|
-
|
|
8002
|
+
import_path4 = __toESM(require("path"));
|
|
8004
8003
|
import_fs4 = require("fs");
|
|
8005
8004
|
log10 = getDomainLogger("ftp-publisher", { component: "domain" });
|
|
8006
8005
|
FtpPublisher = class {
|
|
@@ -8048,10 +8047,10 @@ var init_ftp_publisher = __esm({
|
|
|
8048
8047
|
});
|
|
8049
8048
|
const createdDirs = /* @__PURE__ */ new Set();
|
|
8050
8049
|
for (const relativePath of changedFiles) {
|
|
8051
|
-
const localPath =
|
|
8050
|
+
const localPath = import_path4.default.join(sourceDir, relativePath);
|
|
8052
8051
|
const remoteFilePath = this.config.remotePath && this.config.remotePath !== "/" ? `${this.config.remotePath}/${relativePath}`.replace(/\\/g, "/") : relativePath.replace(/\\/g, "/");
|
|
8053
8052
|
try {
|
|
8054
|
-
const remoteDir =
|
|
8053
|
+
const remoteDir = import_path4.default.dirname(remoteFilePath).replace(/\\/g, "/");
|
|
8055
8054
|
if (remoteDir && remoteDir !== "." && remoteDir !== "/") {
|
|
8056
8055
|
if (!createdDirs.has(remoteDir)) {
|
|
8057
8056
|
try {
|
|
@@ -8282,12 +8281,12 @@ var init_ftp_publisher = __esm({
|
|
|
8282
8281
|
});
|
|
8283
8282
|
|
|
8284
8283
|
// internal/domain/publish/value-object/netlify-publisher.ts
|
|
8285
|
-
var
|
|
8284
|
+
var import_path5, import_fs5, log11, NetlifyPublisher;
|
|
8286
8285
|
var init_netlify_publisher = __esm({
|
|
8287
8286
|
"internal/domain/publish/value-object/netlify-publisher.ts"() {
|
|
8288
8287
|
"use strict";
|
|
8289
8288
|
init_log();
|
|
8290
|
-
|
|
8289
|
+
import_path5 = __toESM(require("path"));
|
|
8291
8290
|
import_fs5 = require("fs");
|
|
8292
8291
|
log11 = getDomainLogger("netlify-publisher", { component: "domain" });
|
|
8293
8292
|
NetlifyPublisher = class {
|
|
@@ -8549,7 +8548,7 @@ var init_netlify_publisher = __esm({
|
|
|
8549
8548
|
log11.warn(`File not found in manifest: ${filePath}`);
|
|
8550
8549
|
continue;
|
|
8551
8550
|
}
|
|
8552
|
-
const localFilePath =
|
|
8551
|
+
const localFilePath = import_path5.default.join(sourceDir, filePath);
|
|
8553
8552
|
try {
|
|
8554
8553
|
const fileContent = await import_fs5.promises.readFile(localFilePath);
|
|
8555
8554
|
await this.uploadFileWithRetry(deployId, filePath, fileContent, fileEntry.hash);
|
|
@@ -8693,12 +8692,12 @@ var mdfriday_publisher_exports = {};
|
|
|
8693
8692
|
__export(mdfriday_publisher_exports, {
|
|
8694
8693
|
MDFridayPublisher: () => MDFridayPublisher
|
|
8695
8694
|
});
|
|
8696
|
-
var
|
|
8695
|
+
var import_path6, import_fs6, log12, MDFridayPublisher;
|
|
8697
8696
|
var init_mdfriday_publisher = __esm({
|
|
8698
8697
|
"internal/domain/publish/value-object/mdfriday-publisher.ts"() {
|
|
8699
8698
|
"use strict";
|
|
8700
8699
|
init_log();
|
|
8701
|
-
|
|
8700
|
+
import_path6 = __toESM(require("path"));
|
|
8702
8701
|
import_fs6 = require("fs");
|
|
8703
8702
|
log12 = getDomainLogger("mdfriday-publisher", { component: "domain" });
|
|
8704
8703
|
MDFridayPublisher = class {
|
|
@@ -8916,7 +8915,7 @@ var init_mdfriday_publisher = __esm({
|
|
|
8916
8915
|
const zip = new JSZip2();
|
|
8917
8916
|
log12.debug(`Creating incremental ZIP with ${filesToInclude.length} files`);
|
|
8918
8917
|
for (const relativePath of filesToInclude) {
|
|
8919
|
-
const filePath =
|
|
8918
|
+
const filePath = import_path6.default.join(sourceDir, relativePath);
|
|
8920
8919
|
try {
|
|
8921
8920
|
const fileContent = await import_fs6.promises.readFile(filePath);
|
|
8922
8921
|
zip.file(relativePath, new Uint8Array(fileContent));
|
|
@@ -8940,7 +8939,7 @@ var init_mdfriday_publisher = __esm({
|
|
|
8940
8939
|
const addDirectoryToZip = async (dirPath, zipFolder) => {
|
|
8941
8940
|
const items = await import_fs6.promises.readdir(dirPath, { withFileTypes: true });
|
|
8942
8941
|
for (const item of items) {
|
|
8943
|
-
const itemPath =
|
|
8942
|
+
const itemPath = import_path6.default.join(dirPath, item.name);
|
|
8944
8943
|
if (item.isDirectory()) {
|
|
8945
8944
|
const subFolder = zipFolder.folder(item.name);
|
|
8946
8945
|
if (subFolder) {
|
|
@@ -9039,10 +9038,10 @@ var init_mdfriday_publisher = __esm({
|
|
|
9039
9038
|
/**
|
|
9040
9039
|
* Build multipart form data for upload
|
|
9041
9040
|
*/
|
|
9042
|
-
buildFormData(zipContent, projectName,
|
|
9041
|
+
buildFormData(zipContent, projectName, path39, deploymentType) {
|
|
9043
9042
|
return {
|
|
9044
9043
|
type: deploymentType,
|
|
9045
|
-
path:
|
|
9044
|
+
path: path39,
|
|
9046
9045
|
id: "-1",
|
|
9047
9046
|
// NEW_ID
|
|
9048
9047
|
name: projectName,
|
|
@@ -9198,13 +9197,13 @@ var init_publish = __esm({
|
|
|
9198
9197
|
});
|
|
9199
9198
|
|
|
9200
9199
|
// internal/infrastructure/persistence/node-manifest-repository.ts
|
|
9201
|
-
var
|
|
9200
|
+
var import_path7, import_fs7, import_crypto, log14, NodeManifestRepository;
|
|
9202
9201
|
var init_node_manifest_repository = __esm({
|
|
9203
9202
|
"internal/infrastructure/persistence/node-manifest-repository.ts"() {
|
|
9204
9203
|
"use strict";
|
|
9205
9204
|
init_publish();
|
|
9206
9205
|
init_log();
|
|
9207
|
-
|
|
9206
|
+
import_path7 = __toESM(require("path"));
|
|
9208
9207
|
import_fs7 = require("fs");
|
|
9209
9208
|
import_crypto = __toESM(require("crypto"));
|
|
9210
9209
|
log14 = getDomainLogger("node-manifest-repo", { component: "infrastructure" });
|
|
@@ -9231,7 +9230,7 @@ var init_node_manifest_repository = __esm({
|
|
|
9231
9230
|
* Save manifest to file
|
|
9232
9231
|
*/
|
|
9233
9232
|
async saveManifest(projectPath, manifest, suffix) {
|
|
9234
|
-
const manifestDir =
|
|
9233
|
+
const manifestDir = import_path7.default.join(projectPath, ".mdfriday");
|
|
9235
9234
|
await import_fs7.promises.mkdir(manifestDir, { recursive: true });
|
|
9236
9235
|
const manifestPath = this.getManifestPath(
|
|
9237
9236
|
projectPath,
|
|
@@ -9290,7 +9289,7 @@ var init_node_manifest_repository = __esm({
|
|
|
9290
9289
|
*/
|
|
9291
9290
|
getManifestPath(projectPath, publishMethod, suffix) {
|
|
9292
9291
|
const filename = suffix ? `manifest-${publishMethod}-${suffix}.json` : `manifest-${publishMethod}.json`;
|
|
9293
|
-
return
|
|
9292
|
+
return import_path7.default.join(projectPath, ".mdfriday", filename);
|
|
9294
9293
|
}
|
|
9295
9294
|
/**
|
|
9296
9295
|
* Recursively scan directory and collect file info
|
|
@@ -9298,8 +9297,8 @@ var init_node_manifest_repository = __esm({
|
|
|
9298
9297
|
async scanDirectory(currentPath, relativePath, files, hashAlgorithm = "md5") {
|
|
9299
9298
|
const items = await import_fs7.promises.readdir(currentPath, { withFileTypes: true });
|
|
9300
9299
|
for (const item of items) {
|
|
9301
|
-
const itemPath =
|
|
9302
|
-
const itemRelativePath = relativePath ?
|
|
9300
|
+
const itemPath = import_path7.default.join(currentPath, item.name);
|
|
9301
|
+
const itemRelativePath = relativePath ? import_path7.default.join(relativePath, item.name) : item.name;
|
|
9303
9302
|
if (item.isDirectory()) {
|
|
9304
9303
|
await this.scanDirectory(itemPath, itemRelativePath, files, hashAlgorithm);
|
|
9305
9304
|
} else if (item.isFile()) {
|
|
@@ -10281,8 +10280,8 @@ var init_module2 = __esm({
|
|
|
10281
10280
|
/**
|
|
10282
10281
|
* Find import by path
|
|
10283
10282
|
*/
|
|
10284
|
-
findImport(
|
|
10285
|
-
return this.moduleConfig.imports.find((imp) => imp.path ===
|
|
10283
|
+
findImport(path39) {
|
|
10284
|
+
return this.moduleConfig.imports.find((imp) => imp.path === path39);
|
|
10286
10285
|
}
|
|
10287
10286
|
/**
|
|
10288
10287
|
* Find mount by source
|
|
@@ -11531,11 +11530,11 @@ var init_markdown2 = __esm({
|
|
|
11531
11530
|
function newDir(workingDir, themesDir, publishDir) {
|
|
11532
11531
|
return new Dir(workingDir, themesDir, publishDir);
|
|
11533
11532
|
}
|
|
11534
|
-
var
|
|
11533
|
+
var import_path8, DEFAULT_PUBLISH_DIR, Dir;
|
|
11535
11534
|
var init_dir = __esm({
|
|
11536
11535
|
"internal/domain/config/entity/dir.ts"() {
|
|
11537
11536
|
"use strict";
|
|
11538
|
-
|
|
11537
|
+
import_path8 = __toESM(require("path"));
|
|
11539
11538
|
DEFAULT_PUBLISH_DIR = "public";
|
|
11540
11539
|
Dir = class {
|
|
11541
11540
|
workingDir;
|
|
@@ -11547,16 +11546,16 @@ var init_dir = __esm({
|
|
|
11547
11546
|
this.publishDir = publishDir;
|
|
11548
11547
|
}
|
|
11549
11548
|
getWorkingDir() {
|
|
11550
|
-
return
|
|
11549
|
+
return import_path8.default.resolve(this.workingDir);
|
|
11551
11550
|
}
|
|
11552
11551
|
getThemesDir() {
|
|
11553
|
-
return
|
|
11552
|
+
return import_path8.default.resolve(this.themesDir);
|
|
11554
11553
|
}
|
|
11555
11554
|
getThemesCacheDir() {
|
|
11556
|
-
return
|
|
11555
|
+
return import_path8.default.resolve(this.themesDir, ".cache");
|
|
11557
11556
|
}
|
|
11558
11557
|
getPublishDir() {
|
|
11559
|
-
return
|
|
11558
|
+
return import_path8.default.resolve(this.publishDir);
|
|
11560
11559
|
}
|
|
11561
11560
|
};
|
|
11562
11561
|
}
|
|
@@ -11746,12 +11745,12 @@ var init_provider = __esm({
|
|
|
11746
11745
|
});
|
|
11747
11746
|
|
|
11748
11747
|
// internal/domain/config/factory/loader.ts
|
|
11749
|
-
var
|
|
11748
|
+
var path9, NO_CONFIG_FILE_ERR_INFO, ConfigLoader;
|
|
11750
11749
|
var init_loader = __esm({
|
|
11751
11750
|
"internal/domain/config/factory/loader.ts"() {
|
|
11752
11751
|
"use strict";
|
|
11753
11752
|
init_provider();
|
|
11754
|
-
|
|
11753
|
+
path9 = __toESM(require("path"));
|
|
11755
11754
|
NO_CONFIG_FILE_ERR_INFO = "Unable to locate config file or config directory.";
|
|
11756
11755
|
ConfigLoader = class {
|
|
11757
11756
|
cfg;
|
|
@@ -11790,13 +11789,13 @@ var init_loader = __esm({
|
|
|
11790
11789
|
async loadProvider(configName) {
|
|
11791
11790
|
const baseDir = this.baseDirs.workingDir;
|
|
11792
11791
|
let baseFilename;
|
|
11793
|
-
if (
|
|
11792
|
+
if (path9.isAbsolute(configName)) {
|
|
11794
11793
|
baseFilename = configName;
|
|
11795
11794
|
} else {
|
|
11796
|
-
baseFilename =
|
|
11795
|
+
baseFilename = path9.join(baseDir, configName);
|
|
11797
11796
|
}
|
|
11798
11797
|
let filename = "";
|
|
11799
|
-
if (
|
|
11798
|
+
if (path9.extname(configName) !== "") {
|
|
11800
11799
|
const exists = await this.fileExists(baseFilename);
|
|
11801
11800
|
if (exists) {
|
|
11802
11801
|
filename = baseFilename;
|
|
@@ -11935,9 +11934,9 @@ var init_sourcedescriptor = __esm({
|
|
|
11935
11934
|
|
|
11936
11935
|
// internal/domain/config/factory/config.ts
|
|
11937
11936
|
async function loadConfigWithParams(fs13, configFilename, workingDir, modulesDir, params = {}) {
|
|
11938
|
-
const cleanWorkingDir =
|
|
11939
|
-
const cleanModulesDir =
|
|
11940
|
-
const cleanPublishDir =
|
|
11937
|
+
const cleanWorkingDir = path10.resolve(workingDir);
|
|
11938
|
+
const cleanModulesDir = path10.resolve(modulesDir);
|
|
11939
|
+
const cleanPublishDir = path10.resolve(DEFAULT_PUBLISH_DIR);
|
|
11941
11940
|
const baseDirs = {
|
|
11942
11941
|
workingDir: cleanWorkingDir,
|
|
11943
11942
|
modulesDir: cleanModulesDir,
|
|
@@ -11954,7 +11953,7 @@ async function loadConfigWithParams(fs13, configFilename, workingDir, modulesDir
|
|
|
11954
11953
|
for (const [key2, value] of Object.entries(params)) {
|
|
11955
11954
|
provider.set(key2, value);
|
|
11956
11955
|
}
|
|
11957
|
-
const absPublishDir =
|
|
11956
|
+
const absPublishDir = path10.resolve(provider.get("publishDir") || DEFAULT_PUBLISH_DIR);
|
|
11958
11957
|
await fs13.mkdirAll(absPublishDir, 511);
|
|
11959
11958
|
return newConfig(
|
|
11960
11959
|
fs13,
|
|
@@ -11977,15 +11976,15 @@ async function getCacheDir(fs13, cacheDir) {
|
|
|
11977
11976
|
return cacheDir;
|
|
11978
11977
|
}
|
|
11979
11978
|
const homeDir = process.env.HOME || process.env.USERPROFILE || "";
|
|
11980
|
-
const defaultCacheDir =
|
|
11979
|
+
const defaultCacheDir = path10.join(homeDir, ".cache", "mdf");
|
|
11981
11980
|
try {
|
|
11982
11981
|
await fs13.mkdirAll(defaultCacheDir, 493);
|
|
11983
11982
|
return defaultCacheDir;
|
|
11984
11983
|
} catch {
|
|
11985
|
-
return
|
|
11984
|
+
return path10.join("/tmp", "hugo-cache");
|
|
11986
11985
|
}
|
|
11987
11986
|
}
|
|
11988
|
-
var
|
|
11987
|
+
var path10;
|
|
11989
11988
|
var init_config2 = __esm({
|
|
11990
11989
|
"internal/domain/config/factory/config.ts"() {
|
|
11991
11990
|
"use strict";
|
|
@@ -12000,7 +11999,7 @@ var init_config2 = __esm({
|
|
|
12000
11999
|
init_markdown2();
|
|
12001
12000
|
init_loader();
|
|
12002
12001
|
init_sourcedescriptor();
|
|
12003
|
-
|
|
12002
|
+
path10 = __toESM(require("path"));
|
|
12004
12003
|
}
|
|
12005
12004
|
});
|
|
12006
12005
|
|
|
@@ -12072,11 +12071,11 @@ function createDefaultMounts(componentFolders) {
|
|
|
12072
12071
|
(folder) => new Mount(folder, folder)
|
|
12073
12072
|
);
|
|
12074
12073
|
}
|
|
12075
|
-
var
|
|
12074
|
+
var path11, Mount;
|
|
12076
12075
|
var init_mount = __esm({
|
|
12077
12076
|
"internal/domain/module/vo/mount.ts"() {
|
|
12078
12077
|
"use strict";
|
|
12079
|
-
|
|
12078
|
+
path11 = __toESM(require("path"));
|
|
12080
12079
|
Mount = class _Mount {
|
|
12081
12080
|
constructor(sourcePath, targetPath, language2 = "") {
|
|
12082
12081
|
this.sourcePath = sourcePath;
|
|
@@ -12111,16 +12110,16 @@ var init_mount = __esm({
|
|
|
12111
12110
|
* Get component name from target path
|
|
12112
12111
|
*/
|
|
12113
12112
|
component() {
|
|
12114
|
-
const parts = this.targetPath.split(
|
|
12113
|
+
const parts = this.targetPath.split(path11.sep);
|
|
12115
12114
|
return parts[0] || "";
|
|
12116
12115
|
}
|
|
12117
12116
|
/**
|
|
12118
12117
|
* Get component and name from target path
|
|
12119
12118
|
*/
|
|
12120
12119
|
componentAndName() {
|
|
12121
|
-
const parts = this.targetPath.split(
|
|
12120
|
+
const parts = this.targetPath.split(path11.sep);
|
|
12122
12121
|
const component = parts[0] || "";
|
|
12123
|
-
const name = parts.slice(1).join(
|
|
12122
|
+
const name = parts.slice(1).join(path11.sep);
|
|
12124
12123
|
return { component, name };
|
|
12125
12124
|
}
|
|
12126
12125
|
/**
|
|
@@ -12165,12 +12164,12 @@ function newHttpClient(fs13, timeout, headers, customClient) {
|
|
|
12165
12164
|
}
|
|
12166
12165
|
return new NodeHttpClient2(fs13, timeout, headers);
|
|
12167
12166
|
}
|
|
12168
|
-
var
|
|
12167
|
+
var path12, http, https, log20, NodeHttpClient2;
|
|
12169
12168
|
var init_httpclient = __esm({
|
|
12170
12169
|
"internal/domain/module/vo/httpclient.ts"() {
|
|
12171
12170
|
"use strict";
|
|
12172
12171
|
init_type5();
|
|
12173
|
-
|
|
12172
|
+
path12 = __toESM(require("path"));
|
|
12174
12173
|
http = __toESM(require("http"));
|
|
12175
12174
|
https = __toESM(require("https"));
|
|
12176
12175
|
init_log();
|
|
@@ -12221,7 +12220,7 @@ var init_httpclient = __esm({
|
|
|
12221
12220
|
let lastProgressTime = Date.now();
|
|
12222
12221
|
let lastLoggedPercentage = -1;
|
|
12223
12222
|
try {
|
|
12224
|
-
const targetDir =
|
|
12223
|
+
const targetDir = path12.dirname(targetPath);
|
|
12225
12224
|
await this.fs.mkdirAll(targetDir, 493);
|
|
12226
12225
|
const file = await this.fs.create(targetPath);
|
|
12227
12226
|
const chunks = [];
|
|
@@ -12372,14 +12371,14 @@ function newZipExtractor(fs13, environment = "node") {
|
|
|
12372
12371
|
throw new Error(`Unsupported environment: ${environment}`);
|
|
12373
12372
|
}
|
|
12374
12373
|
}
|
|
12375
|
-
var import_jszip,
|
|
12374
|
+
var import_jszip, path13, log21, JsZipExtractor, WebZipExtractor;
|
|
12376
12375
|
var init_zipextractor = __esm({
|
|
12377
12376
|
"internal/domain/module/vo/zipextractor.ts"() {
|
|
12378
12377
|
"use strict";
|
|
12379
12378
|
init_type5();
|
|
12380
12379
|
init_log();
|
|
12381
12380
|
import_jszip = __toESM(require("jszip"));
|
|
12382
|
-
|
|
12381
|
+
path13 = __toESM(require("path"));
|
|
12383
12382
|
log21 = getDomainLogger("module", { component: "zipextractor" });
|
|
12384
12383
|
JsZipExtractor = class {
|
|
12385
12384
|
constructor(fs13) {
|
|
@@ -12453,11 +12452,11 @@ var init_zipextractor = __esm({
|
|
|
12453
12452
|
* Extract a single ZIP entry (file or directory)
|
|
12454
12453
|
*/
|
|
12455
12454
|
async extractSingleEntry(relativePath, zipEntry, targetDir) {
|
|
12456
|
-
const fullPath =
|
|
12455
|
+
const fullPath = path13.join(targetDir, relativePath);
|
|
12457
12456
|
if (zipEntry.dir) {
|
|
12458
12457
|
await this.fs.mkdirAll(fullPath, 493);
|
|
12459
12458
|
} else {
|
|
12460
|
-
const dir2 =
|
|
12459
|
+
const dir2 = path13.dirname(fullPath);
|
|
12461
12460
|
if (dir2 !== targetDir) {
|
|
12462
12461
|
await this.fs.mkdirAll(dir2, 493);
|
|
12463
12462
|
}
|
|
@@ -12513,13 +12512,13 @@ var init_zipextractor = __esm({
|
|
|
12513
12512
|
function newModuleCache(fs13, cacheDir) {
|
|
12514
12513
|
return new FsModuleCache(fs13, cacheDir);
|
|
12515
12514
|
}
|
|
12516
|
-
var
|
|
12515
|
+
var path14, log22, FsModuleCache;
|
|
12517
12516
|
var init_cache = __esm({
|
|
12518
12517
|
"internal/domain/module/vo/cache.ts"() {
|
|
12519
12518
|
"use strict";
|
|
12520
12519
|
init_type5();
|
|
12521
12520
|
init_log();
|
|
12522
|
-
|
|
12521
|
+
path14 = __toESM(require("path"));
|
|
12523
12522
|
log22 = getDomainLogger("module", { component: "cache" });
|
|
12524
12523
|
FsModuleCache = class {
|
|
12525
12524
|
constructor(fs13, cacheDir = "./module/cache") {
|
|
@@ -12615,7 +12614,7 @@ var init_cache = __esm({
|
|
|
12615
12614
|
*/
|
|
12616
12615
|
getCacheFilePath(modulePath) {
|
|
12617
12616
|
const safeFileName = modulePath.replace(/[/\\:*?"<>|]/g, "_").replace(/^_+|_+$/g, "") + ".json";
|
|
12618
|
-
return
|
|
12617
|
+
return path14.join(this.cacheDir, safeFileName);
|
|
12619
12618
|
}
|
|
12620
12619
|
/**
|
|
12621
12620
|
* Get cache directory
|
|
@@ -12632,7 +12631,7 @@ var init_cache = __esm({
|
|
|
12632
12631
|
let totalSize = 0;
|
|
12633
12632
|
for (const file of files) {
|
|
12634
12633
|
try {
|
|
12635
|
-
const filePath =
|
|
12634
|
+
const filePath = path14.join(this.cacheDir, file);
|
|
12636
12635
|
const fileInfo = await this.fs.stat(filePath);
|
|
12637
12636
|
totalSize += fileInfo.size();
|
|
12638
12637
|
} catch (error) {
|
|
@@ -12656,7 +12655,7 @@ var init_cache = __esm({
|
|
|
12656
12655
|
try {
|
|
12657
12656
|
const files = await this.listCacheFiles();
|
|
12658
12657
|
return files.map(
|
|
12659
|
-
(file) =>
|
|
12658
|
+
(file) => path14.basename(file, ".json").replace(/_/g, "/")
|
|
12660
12659
|
);
|
|
12661
12660
|
} catch (error) {
|
|
12662
12661
|
return [];
|
|
@@ -12708,13 +12707,13 @@ function newProjectModule(info) {
|
|
|
12708
12707
|
}
|
|
12709
12708
|
return projectModule;
|
|
12710
12709
|
}
|
|
12711
|
-
var
|
|
12710
|
+
var path15, Module2, ProjectModule;
|
|
12712
12711
|
var init_module3 = __esm({
|
|
12713
12712
|
"internal/domain/module/vo/module.ts"() {
|
|
12714
12713
|
"use strict";
|
|
12715
12714
|
init_type5();
|
|
12716
12715
|
init_mount();
|
|
12717
|
-
|
|
12716
|
+
path15 = __toESM(require("path"));
|
|
12718
12717
|
Module2 = class _Module {
|
|
12719
12718
|
constructor(fs13, absoluteDir, modulePath, parent = null, isProject = false) {
|
|
12720
12719
|
this.fs = fs13;
|
|
@@ -12778,7 +12777,7 @@ var init_module3 = __esm({
|
|
|
12778
12777
|
let mounts = moduleImport.mounts || [];
|
|
12779
12778
|
if (mounts.length === 0) {
|
|
12780
12779
|
for (const componentFolder of ComponentFolders) {
|
|
12781
|
-
const sourceDir =
|
|
12780
|
+
const sourceDir = path15.join(this.absoluteDir, componentFolder);
|
|
12782
12781
|
try {
|
|
12783
12782
|
const stat4 = await this.fs.stat(sourceDir);
|
|
12784
12783
|
if (stat4.isDir()) {
|
|
@@ -12929,11 +12928,11 @@ var init_module3 = __esm({
|
|
|
12929
12928
|
function newLang(modules) {
|
|
12930
12929
|
return new Lang(modules);
|
|
12931
12930
|
}
|
|
12932
|
-
var
|
|
12931
|
+
var import_path9, Lang;
|
|
12933
12932
|
var init_lang2 = __esm({
|
|
12934
12933
|
"internal/domain/module/entity/lang.ts"() {
|
|
12935
12934
|
"use strict";
|
|
12936
|
-
|
|
12935
|
+
import_path9 = __toESM(require("path"));
|
|
12937
12936
|
Lang = class {
|
|
12938
12937
|
sourceLangMap;
|
|
12939
12938
|
constructor(modules) {
|
|
@@ -12949,7 +12948,7 @@ var init_lang2 = __esm({
|
|
|
12949
12948
|
* Returns a tuple of [language, exists] to match Go's return pattern
|
|
12950
12949
|
*/
|
|
12951
12950
|
getSourceLang(source) {
|
|
12952
|
-
const lang2 = this.sourceLangMap.get(
|
|
12951
|
+
const lang2 = this.sourceLangMap.get(import_path9.default.basename(source));
|
|
12953
12952
|
if (lang2 !== void 0) {
|
|
12954
12953
|
return [lang2, true];
|
|
12955
12954
|
}
|
|
@@ -13052,7 +13051,7 @@ var init_themes = __esm({
|
|
|
13052
13051
|
function newModules(info, httpClient, zipExtractor, moduleCache) {
|
|
13053
13052
|
return new Modules(info, httpClient, zipExtractor, moduleCache);
|
|
13054
13053
|
}
|
|
13055
|
-
var import_smol_toml,
|
|
13054
|
+
var import_smol_toml, path17, log23, Modules;
|
|
13056
13055
|
var init_module4 = __esm({
|
|
13057
13056
|
"internal/domain/module/entity/module.ts"() {
|
|
13058
13057
|
"use strict";
|
|
@@ -13062,7 +13061,7 @@ var init_module4 = __esm({
|
|
|
13062
13061
|
init_themes();
|
|
13063
13062
|
init_log();
|
|
13064
13063
|
import_smol_toml = require("smol-toml");
|
|
13065
|
-
|
|
13064
|
+
path17 = __toESM(require("path"));
|
|
13066
13065
|
log23 = getDomainLogger("module", { component: "modules" });
|
|
13067
13066
|
Modules = class {
|
|
13068
13067
|
constructor(info, httpClient, zipExtractor, moduleCache) {
|
|
@@ -13217,7 +13216,7 @@ var init_module4 = __esm({
|
|
|
13217
13216
|
log23.info(`Cache version mismatch for ${moduleImport.path}: cached=${cachedMetadata.version}, requested=${effectiveVersion || "latest"}`);
|
|
13218
13217
|
}
|
|
13219
13218
|
const moduleDir = this.getModuleDir(moduleImport.path);
|
|
13220
|
-
const zipPath =
|
|
13219
|
+
const zipPath = path17.join(moduleDir, "module.zip");
|
|
13221
13220
|
const metadata = {
|
|
13222
13221
|
path: moduleImport.path,
|
|
13223
13222
|
version: moduleImport.version || "latest",
|
|
@@ -13323,7 +13322,7 @@ var init_module4 = __esm({
|
|
|
13323
13322
|
*/
|
|
13324
13323
|
getModuleDir(modulePath) {
|
|
13325
13324
|
const safeName = modulePath.replace(/[/\\:*?"<>|]/g, "_").replace(/^_+|_+$/g, "");
|
|
13326
|
-
return
|
|
13325
|
+
return path17.join(this.info.moduleDir(), safeName);
|
|
13327
13326
|
}
|
|
13328
13327
|
/**
|
|
13329
13328
|
* Get download URL for module path
|
|
@@ -13424,7 +13423,7 @@ var init_module4 = __esm({
|
|
|
13424
13423
|
*/
|
|
13425
13424
|
async parseThemeToml(module2) {
|
|
13426
13425
|
try {
|
|
13427
|
-
const themeTomlPath =
|
|
13426
|
+
const themeTomlPath = path17.join(module2.dir(), "theme.toml");
|
|
13428
13427
|
try {
|
|
13429
13428
|
const stat4 = await this.info.osFs().stat(themeTomlPath);
|
|
13430
13429
|
if (stat4.isDir()) {
|
|
@@ -13816,13 +13815,13 @@ function newFileWithMeta(file, meta, fs13) {
|
|
|
13816
13815
|
function newDirFileWithMeta(file, meta, fs13) {
|
|
13817
13816
|
return new File(file, meta, fs13, true);
|
|
13818
13817
|
}
|
|
13819
|
-
var
|
|
13818
|
+
var path18, File;
|
|
13820
13819
|
var init_file = __esm({
|
|
13821
13820
|
"internal/domain/fs/vo/file.ts"() {
|
|
13822
13821
|
"use strict";
|
|
13823
13822
|
init_filemeta();
|
|
13824
13823
|
init_fileinfo();
|
|
13825
|
-
|
|
13824
|
+
path18 = __toESM(require("path"));
|
|
13826
13825
|
File = class {
|
|
13827
13826
|
file;
|
|
13828
13827
|
fileMeta;
|
|
@@ -13916,7 +13915,7 @@ var init_file = __esm({
|
|
|
13916
13915
|
return await this.file.writeAt(buffer, offset);
|
|
13917
13916
|
}
|
|
13918
13917
|
name() {
|
|
13919
|
-
return
|
|
13918
|
+
return path18.basename(this.fileMeta.fileName());
|
|
13920
13919
|
}
|
|
13921
13920
|
async readdir(count) {
|
|
13922
13921
|
if (this.file === null) {
|
|
@@ -14038,7 +14037,7 @@ var init_dir2 = __esm({
|
|
|
14038
14037
|
function newBaseFs(fs13, roots) {
|
|
14039
14038
|
return new BaseFs(fs13, roots);
|
|
14040
14039
|
}
|
|
14041
|
-
var
|
|
14040
|
+
var path19, log26, BaseFs;
|
|
14042
14041
|
var init_basefs = __esm({
|
|
14043
14042
|
"internal/domain/fs/entity/basefs.ts"() {
|
|
14044
14043
|
"use strict";
|
|
@@ -14046,7 +14045,7 @@ var init_basefs = __esm({
|
|
|
14046
14045
|
init_fileinfo();
|
|
14047
14046
|
init_file();
|
|
14048
14047
|
init_dir2();
|
|
14049
|
-
|
|
14048
|
+
path19 = __toESM(require("path"));
|
|
14050
14049
|
init_log();
|
|
14051
14050
|
log26 = getDomainLogger("fs", { component: "basefs" });
|
|
14052
14051
|
BaseFs = class {
|
|
@@ -14069,17 +14068,17 @@ var init_basefs = __esm({
|
|
|
14069
14068
|
if (name === "") {
|
|
14070
14069
|
return root2;
|
|
14071
14070
|
}
|
|
14072
|
-
if (
|
|
14071
|
+
if (path19.isAbsolute(name)) {
|
|
14073
14072
|
if (name.startsWith(root2)) {
|
|
14074
14073
|
return name;
|
|
14075
14074
|
}
|
|
14076
|
-
return
|
|
14075
|
+
return path19.join(root2, name.substring(1));
|
|
14077
14076
|
}
|
|
14078
|
-
return
|
|
14077
|
+
return path19.join(root2, name);
|
|
14079
14078
|
}
|
|
14080
14079
|
isSameRootedPath(name) {
|
|
14081
14080
|
const root2 = this.roots[0];
|
|
14082
|
-
return name.startsWith(
|
|
14081
|
+
return name.startsWith(path19.join(root2, path19.sep)) || name === root2;
|
|
14083
14082
|
}
|
|
14084
14083
|
/**
|
|
14085
14084
|
* Stat returns file info with opener function
|
|
@@ -14165,8 +14164,8 @@ var init_basefs = __esm({
|
|
|
14165
14164
|
const absPath = this.toAbsolutePath(name);
|
|
14166
14165
|
return await this.fs.mkdir(absPath, perm);
|
|
14167
14166
|
}
|
|
14168
|
-
async mkdirAll(
|
|
14169
|
-
const absPath = this.toAbsolutePath(
|
|
14167
|
+
async mkdirAll(path39, perm) {
|
|
14168
|
+
const absPath = this.toAbsolutePath(path39);
|
|
14170
14169
|
return await this.fs.mkdirAll(absPath, perm);
|
|
14171
14170
|
}
|
|
14172
14171
|
async openFile(name, flag, perm) {
|
|
@@ -14177,8 +14176,8 @@ var init_basefs = __esm({
|
|
|
14177
14176
|
const absPath = this.toAbsolutePath(name);
|
|
14178
14177
|
return await this.fs.remove(absPath);
|
|
14179
14178
|
}
|
|
14180
|
-
async removeAll(
|
|
14181
|
-
const absPath = this.toAbsolutePath(
|
|
14179
|
+
async removeAll(path39) {
|
|
14180
|
+
const absPath = this.toAbsolutePath(path39);
|
|
14182
14181
|
return await this.fs.removeAll(absPath);
|
|
14183
14182
|
}
|
|
14184
14183
|
async rename(oldname, newname) {
|
|
@@ -14209,11 +14208,11 @@ var init_basefs = __esm({
|
|
|
14209
14208
|
function newWalkway(fs13, cb) {
|
|
14210
14209
|
return new Walkway(fs13, cb);
|
|
14211
14210
|
}
|
|
14212
|
-
var
|
|
14211
|
+
var path20, log27, Walkway;
|
|
14213
14212
|
var init_walkway = __esm({
|
|
14214
14213
|
"internal/domain/fs/vo/walkway.ts"() {
|
|
14215
14214
|
"use strict";
|
|
14216
|
-
|
|
14215
|
+
path20 = __toESM(require("path"));
|
|
14217
14216
|
init_type6();
|
|
14218
14217
|
init_fileinfo();
|
|
14219
14218
|
init_filemeta();
|
|
@@ -14340,7 +14339,7 @@ var init_walkway = __esm({
|
|
|
14340
14339
|
}
|
|
14341
14340
|
}
|
|
14342
14341
|
for (const entry of dirEntries) {
|
|
14343
|
-
const nextPath =
|
|
14342
|
+
const nextPath = path20.join(filePath, entry.name());
|
|
14344
14343
|
try {
|
|
14345
14344
|
await this.walkRecursive(nextPath, entry);
|
|
14346
14345
|
} catch (err) {
|
|
@@ -14422,9 +14421,9 @@ var init_static_copier = __esm({
|
|
|
14422
14421
|
async walkSourceFiles(sourceFs, targetDir) {
|
|
14423
14422
|
let fileCount = 0;
|
|
14424
14423
|
try {
|
|
14425
|
-
await this.walkFileSystem(sourceFs, "/", async (
|
|
14424
|
+
await this.walkFileSystem(sourceFs, "/", async (path39, isDir) => {
|
|
14426
14425
|
if (!isDir) {
|
|
14427
|
-
await this.copyFile(sourceFs,
|
|
14426
|
+
await this.copyFile(sourceFs, path39, this.toFs, targetDir);
|
|
14428
14427
|
fileCount++;
|
|
14429
14428
|
}
|
|
14430
14429
|
});
|
|
@@ -14508,8 +14507,8 @@ var init_static_copier = __esm({
|
|
|
14508
14507
|
/**
|
|
14509
14508
|
* Get directory name from path
|
|
14510
14509
|
*/
|
|
14511
|
-
dirname(
|
|
14512
|
-
const parts =
|
|
14510
|
+
dirname(path39) {
|
|
14511
|
+
const parts = path39.split("/").filter((part) => part.length > 0);
|
|
14513
14512
|
if (parts.length <= 1)
|
|
14514
14513
|
return "/";
|
|
14515
14514
|
return "/" + parts.slice(0, -1).join("/");
|
|
@@ -14522,16 +14521,16 @@ var init_static_copier = __esm({
|
|
|
14522
14521
|
async function collectFileMetaInfos(paths, fss) {
|
|
14523
14522
|
const result = /* @__PURE__ */ new Map();
|
|
14524
14523
|
let found = false;
|
|
14525
|
-
for (const
|
|
14524
|
+
for (const path39 of paths) {
|
|
14526
14525
|
for (const fs13 of fss) {
|
|
14527
14526
|
try {
|
|
14528
|
-
const fileMetaInfo = await createFileMetaInfo(
|
|
14529
|
-
result.set(
|
|
14527
|
+
const fileMetaInfo = await createFileMetaInfo(path39, fs13);
|
|
14528
|
+
result.set(path39, fileMetaInfo);
|
|
14530
14529
|
found = true;
|
|
14531
14530
|
if (found)
|
|
14532
14531
|
break;
|
|
14533
14532
|
} catch (error) {
|
|
14534
|
-
log29.error(`Failed to create FileMetaInfo for ${
|
|
14533
|
+
log29.error(`Failed to create FileMetaInfo for ${path39} with fs=${fs13}:`, error);
|
|
14535
14534
|
}
|
|
14536
14535
|
}
|
|
14537
14536
|
}
|
|
@@ -14640,8 +14639,8 @@ var init_fs = __esm({
|
|
|
14640
14639
|
/**
|
|
14641
14640
|
* Create new base path filesystem
|
|
14642
14641
|
*/
|
|
14643
|
-
newBasePathFs(source,
|
|
14644
|
-
return newBaseFs(source, [
|
|
14642
|
+
newBasePathFs(source, path39) {
|
|
14643
|
+
return newBaseFs(source, [path39]);
|
|
14645
14644
|
}
|
|
14646
14645
|
async walkPrompts(start, cb, conf) {
|
|
14647
14646
|
return await this.walk(this.prompts, start, cb, conf);
|
|
@@ -15183,11 +15182,11 @@ var init_overlayfs = __esm({
|
|
|
15183
15182
|
/**
|
|
15184
15183
|
* Create directory tree (write operation)
|
|
15185
15184
|
*/
|
|
15186
|
-
async mkdirAll(
|
|
15185
|
+
async mkdirAll(path39, perm) {
|
|
15187
15186
|
if (!this.firstWritable) {
|
|
15188
15187
|
throw new OverlayFsError("filesystem is read-only", "READ_ONLY");
|
|
15189
15188
|
}
|
|
15190
|
-
return await this.writeFs().mkdirAll(
|
|
15189
|
+
return await this.writeFs().mkdirAll(path39, perm);
|
|
15191
15190
|
}
|
|
15192
15191
|
/**
|
|
15193
15192
|
* Open file for reading (searches all filesystems)
|
|
@@ -15246,11 +15245,11 @@ var init_overlayfs = __esm({
|
|
|
15246
15245
|
/**
|
|
15247
15246
|
* Remove directory tree (write operation)
|
|
15248
15247
|
*/
|
|
15249
|
-
async removeAll(
|
|
15248
|
+
async removeAll(path39) {
|
|
15250
15249
|
if (!this.firstWritable) {
|
|
15251
15250
|
throw new OverlayFsError("filesystem is read-only", "READ_ONLY");
|
|
15252
15251
|
}
|
|
15253
|
-
return await this.writeFs().removeAll(
|
|
15252
|
+
return await this.writeFs().removeAll(path39);
|
|
15254
15253
|
}
|
|
15255
15254
|
/**
|
|
15256
15255
|
* Rename file (write operation)
|
|
@@ -15507,13 +15506,13 @@ var init_overlayfs_factory = __esm({
|
|
|
15507
15506
|
function newFilesystemsCollector(sourceProject) {
|
|
15508
15507
|
return new FilesystemsCollector(sourceProject);
|
|
15509
15508
|
}
|
|
15510
|
-
var
|
|
15509
|
+
var path21, log31, RootMapping, FilesystemsCollector;
|
|
15511
15510
|
var init_filesystemscollector = __esm({
|
|
15512
15511
|
"internal/domain/fs/vo/filesystemscollector.ts"() {
|
|
15513
15512
|
"use strict";
|
|
15514
15513
|
init_overlayfs_factory();
|
|
15515
15514
|
init_basefs();
|
|
15516
|
-
|
|
15515
|
+
path21 = __toESM(require("path"));
|
|
15517
15516
|
init_log();
|
|
15518
15517
|
log31 = getDomainLogger("fs", { component: "filesystemscollector" });
|
|
15519
15518
|
RootMapping = class {
|
|
@@ -15568,7 +15567,7 @@ var init_filesystemscollector = __esm({
|
|
|
15568
15567
|
const fromToAssets = [];
|
|
15569
15568
|
const fromToI18n = [];
|
|
15570
15569
|
const absPathify = (inputPath) => {
|
|
15571
|
-
if (
|
|
15570
|
+
if (path21.isAbsolute(inputPath)) {
|
|
15572
15571
|
return ["", inputPath];
|
|
15573
15572
|
}
|
|
15574
15573
|
return [md.dir(), this.absPathify(md.dir(), inputPath)];
|
|
@@ -15647,7 +15646,7 @@ var init_filesystemscollector = __esm({
|
|
|
15647
15646
|
return target === "i18n" || target.startsWith("i18n/") || target.startsWith("/i18n/");
|
|
15648
15647
|
}
|
|
15649
15648
|
absPathify(baseDir, relativePath) {
|
|
15650
|
-
return
|
|
15649
|
+
return path21.resolve(baseDir, relativePath);
|
|
15651
15650
|
}
|
|
15652
15651
|
};
|
|
15653
15652
|
}
|
|
@@ -15657,12 +15656,12 @@ var init_filesystemscollector = __esm({
|
|
|
15657
15656
|
function newOsFs() {
|
|
15658
15657
|
return new OsFs();
|
|
15659
15658
|
}
|
|
15660
|
-
var fs8,
|
|
15659
|
+
var fs8, path22, log32, OsFileInfo, OsFile, OsFs;
|
|
15661
15660
|
var init_osfs = __esm({
|
|
15662
15661
|
"internal/domain/fs/vo/osfs.ts"() {
|
|
15663
15662
|
"use strict";
|
|
15664
15663
|
fs8 = __toESM(require("fs/promises"));
|
|
15665
|
-
|
|
15664
|
+
path22 = __toESM(require("path"));
|
|
15666
15665
|
init_log();
|
|
15667
15666
|
log32 = getDomainLogger("fs", { component: "osfs" });
|
|
15668
15667
|
OsFileInfo = class {
|
|
@@ -15785,7 +15784,7 @@ var init_osfs = __esm({
|
|
|
15785
15784
|
const limit = count > 0 ? Math.min(count, entries.length) : entries.length;
|
|
15786
15785
|
for (let i = 0; i < limit; i++) {
|
|
15787
15786
|
const entry = entries[i];
|
|
15788
|
-
const entryPath =
|
|
15787
|
+
const entryPath = path22.join(this.filePath, entry.name);
|
|
15789
15788
|
const stats = await fs8.stat(entryPath);
|
|
15790
15789
|
result.push(new OsFileInfo(stats, entry.name));
|
|
15791
15790
|
}
|
|
@@ -15801,7 +15800,7 @@ var init_osfs = __esm({
|
|
|
15801
15800
|
if (this.closed)
|
|
15802
15801
|
throw new Error("File is closed");
|
|
15803
15802
|
const stats = await fs8.stat(this.filePath);
|
|
15804
|
-
return new OsFileInfo(stats,
|
|
15803
|
+
return new OsFileInfo(stats, path22.basename(this.filePath));
|
|
15805
15804
|
}
|
|
15806
15805
|
async sync() {
|
|
15807
15806
|
if (this.closed)
|
|
@@ -15878,7 +15877,7 @@ var init_osfs = __esm({
|
|
|
15878
15877
|
}
|
|
15879
15878
|
async stat(name) {
|
|
15880
15879
|
const stats = await fs8.stat(name);
|
|
15881
|
-
return new OsFileInfo(stats,
|
|
15880
|
+
return new OsFileInfo(stats, path22.basename(name));
|
|
15882
15881
|
}
|
|
15883
15882
|
name() {
|
|
15884
15883
|
return "OsFs";
|
|
@@ -19250,8 +19249,8 @@ function wikilinkInlineRule(state, silent) {
|
|
|
19250
19249
|
function renderWikilinkLink(tokens, idx) {
|
|
19251
19250
|
const token = tokens[idx];
|
|
19252
19251
|
const meta = token.meta;
|
|
19253
|
-
const [
|
|
19254
|
-
const slug2 = slugifyFilePath(
|
|
19252
|
+
const [path39, _anchor] = splitAnchor(meta.url);
|
|
19253
|
+
const slug2 = slugifyFilePath(path39);
|
|
19255
19254
|
const displayText = meta.alias ?? meta.filepath;
|
|
19256
19255
|
const escapedText = escapeHtml(displayText);
|
|
19257
19256
|
return `<a class="internal" data-slug="${slug2}" data-wikilink="${escapeHtml(meta.url)}">${escapedText}</a>`;
|
|
@@ -20217,8 +20216,8 @@ var init_type10 = __esm({
|
|
|
20217
20216
|
COMPONENT_FOLDER_ASSETS: "assets",
|
|
20218
20217
|
COMPONENT_FOLDER_I18N: "i18n",
|
|
20219
20218
|
// Path normalization utility
|
|
20220
|
-
normalizePath: (
|
|
20221
|
-
let p2 =
|
|
20219
|
+
normalizePath: (path39) => {
|
|
20220
|
+
let p2 = path39.replace(/\\/g, "/");
|
|
20222
20221
|
if (p2.startsWith("//")) {
|
|
20223
20222
|
p2 = p2.substring(1);
|
|
20224
20223
|
}
|
|
@@ -20468,8 +20467,8 @@ var init_path2 = __esm({
|
|
|
20468
20467
|
if (this.components.component) {
|
|
20469
20468
|
return this.components.component;
|
|
20470
20469
|
}
|
|
20471
|
-
const
|
|
20472
|
-
const parts =
|
|
20470
|
+
const path39 = this.components.normalized;
|
|
20471
|
+
const parts = path39.split("/").filter((p2) => p2.length > 0);
|
|
20473
20472
|
if (parts.length === 0) {
|
|
20474
20473
|
return "content";
|
|
20475
20474
|
}
|
|
@@ -20797,10 +20796,10 @@ var init_path2 = __esm({
|
|
|
20797
20796
|
/**
|
|
20798
20797
|
* Create a path from string components
|
|
20799
20798
|
*/
|
|
20800
|
-
static fromString(component,
|
|
20799
|
+
static fromString(component, path39) {
|
|
20801
20800
|
const components = new PathComponentsImpl(
|
|
20802
|
-
|
|
20803
|
-
|
|
20801
|
+
path39,
|
|
20802
|
+
path39,
|
|
20804
20803
|
{ containerLow: -1, containerHigh: -1, sectionHigh: -1, identifierLanguage: -1 },
|
|
20805
20804
|
[],
|
|
20806
20805
|
0 /* File */,
|
|
@@ -20811,8 +20810,8 @@ var init_path2 = __esm({
|
|
|
20811
20810
|
/**
|
|
20812
20811
|
* Check if a path has a specific extension
|
|
20813
20812
|
*/
|
|
20814
|
-
static hasExtension(
|
|
20815
|
-
const pathExt =
|
|
20813
|
+
static hasExtension(path39, extension) {
|
|
20814
|
+
const pathExt = path39.ext();
|
|
20816
20815
|
const targetExt = extension.startsWith(".") ? extension : "." + extension;
|
|
20817
20816
|
return pathExt.toLowerCase() === targetExt.toLowerCase();
|
|
20818
20817
|
}
|
|
@@ -20870,20 +20869,20 @@ var init_pathparser = __esm({
|
|
|
20870
20869
|
/**
|
|
20871
20870
|
* Parse a path with component information
|
|
20872
20871
|
*/
|
|
20873
|
-
parse(component,
|
|
20874
|
-
let normalizedPath =
|
|
20872
|
+
parse(component, path39) {
|
|
20873
|
+
let normalizedPath = path39;
|
|
20875
20874
|
if (!normalizedPath || normalizedPath === "") {
|
|
20876
20875
|
normalizedPath = "/";
|
|
20877
20876
|
}
|
|
20878
20877
|
const normalized = this.normalizer.normalize(normalizedPath);
|
|
20879
|
-
const pathComponents = this.createPathComponents(component, normalized,
|
|
20878
|
+
const pathComponents = this.createPathComponents(component, normalized, path39);
|
|
20880
20879
|
return new Path(pathComponents);
|
|
20881
20880
|
}
|
|
20882
20881
|
/**
|
|
20883
20882
|
* Parse and return only the identity
|
|
20884
20883
|
*/
|
|
20885
|
-
parseIdentity(component,
|
|
20886
|
-
const parsed = this.parse(component,
|
|
20884
|
+
parseIdentity(component, path39) {
|
|
20885
|
+
const parsed = this.parse(component, path39);
|
|
20887
20886
|
return {
|
|
20888
20887
|
identifierBase: () => parsed.base()
|
|
20889
20888
|
};
|
|
@@ -20891,8 +20890,8 @@ var init_pathparser = __esm({
|
|
|
20891
20890
|
/**
|
|
20892
20891
|
* Parse and return base and base name without identifier
|
|
20893
20892
|
*/
|
|
20894
|
-
parseBaseAndBaseNameNoIdentifier(component,
|
|
20895
|
-
const parsed = this.parse(component,
|
|
20893
|
+
parseBaseAndBaseNameNoIdentifier(component, path39) {
|
|
20894
|
+
const parsed = this.parse(component, path39);
|
|
20896
20895
|
return [parsed.base(), parsed.baseNameNoIdentifier()];
|
|
20897
20896
|
}
|
|
20898
20897
|
/**
|
|
@@ -21021,8 +21020,8 @@ var init_pathparser = __esm({
|
|
|
21021
21020
|
this.toLowerCase = toLowerCase;
|
|
21022
21021
|
this.replaceSpaces = replaceSpaces;
|
|
21023
21022
|
}
|
|
21024
|
-
normalize(
|
|
21025
|
-
let result =
|
|
21023
|
+
normalize(path39) {
|
|
21024
|
+
let result = path39;
|
|
21026
21025
|
result = result.replace(/\\/g, "/");
|
|
21027
21026
|
if (this.toLowerCase) {
|
|
21028
21027
|
result = result.toLowerCase();
|
|
@@ -21038,8 +21037,8 @@ var init_pathparser = __esm({
|
|
|
21038
21037
|
this.toLowerCase = toLowerCase;
|
|
21039
21038
|
this.replaceSpaces = replaceSpaces;
|
|
21040
21039
|
}
|
|
21041
|
-
normalize(
|
|
21042
|
-
let result =
|
|
21040
|
+
normalize(path39) {
|
|
21041
|
+
let result = path39;
|
|
21043
21042
|
result = result.replace(/\\/g, "/");
|
|
21044
21043
|
if (this.toLowerCase) {
|
|
21045
21044
|
result = result.toLowerCase();
|
|
@@ -21059,12 +21058,12 @@ var init_pathparser = __esm({
|
|
|
21059
21058
|
const htmlExts = PATH_CONSTANTS.HTML_EXTENSIONS;
|
|
21060
21059
|
return htmlExts.includes(ext.toLowerCase());
|
|
21061
21060
|
}
|
|
21062
|
-
hasExt(
|
|
21063
|
-
for (let i =
|
|
21064
|
-
if (
|
|
21061
|
+
hasExt(path39) {
|
|
21062
|
+
for (let i = path39.length - 1; i >= 0; i--) {
|
|
21063
|
+
if (path39[i] === ".") {
|
|
21065
21064
|
return true;
|
|
21066
21065
|
}
|
|
21067
|
-
if (
|
|
21066
|
+
if (path39[i] === "/") {
|
|
21068
21067
|
return false;
|
|
21069
21068
|
}
|
|
21070
21069
|
}
|
|
@@ -21075,10 +21074,10 @@ var init_pathparser = __esm({
|
|
|
21075
21074
|
/**
|
|
21076
21075
|
* Parse a path string into basic components
|
|
21077
21076
|
*/
|
|
21078
|
-
static parseBasic(
|
|
21079
|
-
const lastSlash =
|
|
21080
|
-
const dir2 = lastSlash >= 0 ?
|
|
21081
|
-
const name = lastSlash >= 0 ?
|
|
21077
|
+
static parseBasic(path39) {
|
|
21078
|
+
const lastSlash = path39.lastIndexOf("/");
|
|
21079
|
+
const dir2 = lastSlash >= 0 ? path39.substring(0, lastSlash) : "";
|
|
21080
|
+
const name = lastSlash >= 0 ? path39.substring(lastSlash + 1) : path39;
|
|
21082
21081
|
const lastDot = name.lastIndexOf(".");
|
|
21083
21082
|
const ext = lastDot >= 0 ? name.substring(lastDot) : "";
|
|
21084
21083
|
const nameWithoutExt = lastDot >= 0 ? name.substring(0, lastDot) : name;
|
|
@@ -21093,43 +21092,43 @@ var init_pathparser = __esm({
|
|
|
21093
21092
|
/**
|
|
21094
21093
|
* Normalize a path string using basic rules
|
|
21095
21094
|
*/
|
|
21096
|
-
static normalizeBasic(
|
|
21095
|
+
static normalizeBasic(path39) {
|
|
21097
21096
|
const normalizer = new BasicPathNormalizer();
|
|
21098
|
-
return normalizer.normalize(
|
|
21097
|
+
return normalizer.normalize(path39);
|
|
21099
21098
|
}
|
|
21100
21099
|
/**
|
|
21101
21100
|
* Check if a path represents a bundle
|
|
21102
21101
|
*/
|
|
21103
|
-
static isBundle(
|
|
21104
|
-
const basic = _PathParserUtils.parseBasic(
|
|
21102
|
+
static isBundle(path39) {
|
|
21103
|
+
const basic = _PathParserUtils.parseBasic(path39);
|
|
21105
21104
|
const indexNames = PATH_CONSTANTS.INDEX_NAMES;
|
|
21106
21105
|
return indexNames.includes(basic.nameWithoutExt);
|
|
21107
21106
|
}
|
|
21108
21107
|
/**
|
|
21109
21108
|
* Extract section from path
|
|
21110
21109
|
*/
|
|
21111
|
-
static extractSection(
|
|
21112
|
-
const normalized =
|
|
21110
|
+
static extractSection(path39) {
|
|
21111
|
+
const normalized = path39.startsWith("/") ? path39.substring(1) : path39;
|
|
21113
21112
|
const firstSlash = normalized.indexOf("/");
|
|
21114
21113
|
return firstSlash >= 0 ? normalized.substring(0, firstSlash) : normalized;
|
|
21115
21114
|
}
|
|
21116
21115
|
/**
|
|
21117
21116
|
* Remove extension from path
|
|
21118
21117
|
*/
|
|
21119
|
-
static removeExtension(
|
|
21120
|
-
const lastDot =
|
|
21121
|
-
const lastSlash =
|
|
21118
|
+
static removeExtension(path39) {
|
|
21119
|
+
const lastDot = path39.lastIndexOf(".");
|
|
21120
|
+
const lastSlash = path39.lastIndexOf("/");
|
|
21122
21121
|
if (lastDot > lastSlash) {
|
|
21123
|
-
return
|
|
21122
|
+
return path39.substring(0, lastDot);
|
|
21124
21123
|
}
|
|
21125
|
-
return
|
|
21124
|
+
return path39;
|
|
21126
21125
|
}
|
|
21127
21126
|
/**
|
|
21128
21127
|
* Check if path has extension
|
|
21129
21128
|
*/
|
|
21130
|
-
static hasExtension(
|
|
21129
|
+
static hasExtension(path39) {
|
|
21131
21130
|
const checker = new DefaultFileExtensionChecker();
|
|
21132
|
-
return checker.hasExt(
|
|
21131
|
+
return checker.hasExt(path39);
|
|
21133
21132
|
}
|
|
21134
21133
|
};
|
|
21135
21134
|
}
|
|
@@ -21160,11 +21159,11 @@ var init_pathfactory = __esm({
|
|
|
21160
21159
|
/**
|
|
21161
21160
|
* Create a Path from component and path string
|
|
21162
21161
|
*/
|
|
21163
|
-
create(component,
|
|
21162
|
+
create(component, path39, config) {
|
|
21164
21163
|
if (this.pool) {
|
|
21165
21164
|
const pooledPath = this.pool.get();
|
|
21166
21165
|
}
|
|
21167
|
-
return this.processor.parse(component,
|
|
21166
|
+
return this.processor.parse(component, path39);
|
|
21168
21167
|
}
|
|
21169
21168
|
/**
|
|
21170
21169
|
* Create a Path from PathComponents
|
|
@@ -21176,12 +21175,12 @@ var init_pathfactory = __esm({
|
|
|
21176
21175
|
* Create multiple paths from an array of path strings
|
|
21177
21176
|
*/
|
|
21178
21177
|
createMany(component, paths, config) {
|
|
21179
|
-
return paths.map((
|
|
21178
|
+
return paths.map((path39) => this.create(component, path39, config));
|
|
21180
21179
|
}
|
|
21181
21180
|
/**
|
|
21182
21181
|
* Create a path with custom configuration
|
|
21183
21182
|
*/
|
|
21184
|
-
createWithConfig(component,
|
|
21183
|
+
createWithConfig(component, path39, normalizeConfig) {
|
|
21185
21184
|
const config = {};
|
|
21186
21185
|
if (normalizeConfig?.toLowerCase !== void 0) {
|
|
21187
21186
|
config.normalize = normalizeConfig.toLowerCase;
|
|
@@ -21192,7 +21191,7 @@ var init_pathfactory = __esm({
|
|
|
21192
21191
|
if (normalizeConfig?.customNormalizer !== void 0) {
|
|
21193
21192
|
config.normalizer = normalizeConfig.customNormalizer;
|
|
21194
21193
|
}
|
|
21195
|
-
return this.create(component,
|
|
21194
|
+
return this.create(component, path39, config);
|
|
21196
21195
|
}
|
|
21197
21196
|
};
|
|
21198
21197
|
DefaultPathFactory = class extends PathFactoryImpl {
|
|
@@ -21216,9 +21215,9 @@ var init_pathfactory = __esm({
|
|
|
21216
21215
|
const components = PathComponentsFactory.createEmpty();
|
|
21217
21216
|
return new Path(components);
|
|
21218
21217
|
}
|
|
21219
|
-
put(
|
|
21218
|
+
put(path39) {
|
|
21220
21219
|
if (this.pool.length < this.maxSize) {
|
|
21221
|
-
this.pool.push(
|
|
21220
|
+
this.pool.push(path39);
|
|
21222
21221
|
}
|
|
21223
21222
|
}
|
|
21224
21223
|
/**
|
|
@@ -21252,8 +21251,8 @@ var init_pathfactory = __esm({
|
|
|
21252
21251
|
/**
|
|
21253
21252
|
* Set the path
|
|
21254
21253
|
*/
|
|
21255
|
-
withPath(
|
|
21256
|
-
this.path =
|
|
21254
|
+
withPath(path39) {
|
|
21255
|
+
this.path = path39;
|
|
21257
21256
|
return this;
|
|
21258
21257
|
}
|
|
21259
21258
|
/**
|
|
@@ -21301,38 +21300,38 @@ var init_pathfactory = __esm({
|
|
|
21301
21300
|
/**
|
|
21302
21301
|
* Create a content path
|
|
21303
21302
|
*/
|
|
21304
|
-
static createContentPath(
|
|
21305
|
-
return _PathFactoryUtils.defaultFactory.create("content",
|
|
21303
|
+
static createContentPath(path39) {
|
|
21304
|
+
return _PathFactoryUtils.defaultFactory.create("content", path39);
|
|
21306
21305
|
}
|
|
21307
21306
|
/**
|
|
21308
21307
|
* Create a static resource path
|
|
21309
21308
|
*/
|
|
21310
|
-
static createStaticPath(
|
|
21311
|
-
return _PathFactoryUtils.defaultFactory.create("static",
|
|
21309
|
+
static createStaticPath(path39) {
|
|
21310
|
+
return _PathFactoryUtils.defaultFactory.create("static", path39);
|
|
21312
21311
|
}
|
|
21313
21312
|
/**
|
|
21314
21313
|
* Create a layout path
|
|
21315
21314
|
*/
|
|
21316
|
-
static createLayoutPath(
|
|
21317
|
-
return _PathFactoryUtils.defaultFactory.create("layouts",
|
|
21315
|
+
static createLayoutPath(path39) {
|
|
21316
|
+
return _PathFactoryUtils.defaultFactory.create("layouts", path39);
|
|
21318
21317
|
}
|
|
21319
21318
|
/**
|
|
21320
21319
|
* Create an archetype path
|
|
21321
21320
|
*/
|
|
21322
|
-
static createArchetypePath(
|
|
21323
|
-
return _PathFactoryUtils.defaultFactory.create("archetypes",
|
|
21321
|
+
static createArchetypePath(path39) {
|
|
21322
|
+
return _PathFactoryUtils.defaultFactory.create("archetypes", path39);
|
|
21324
21323
|
}
|
|
21325
21324
|
/**
|
|
21326
21325
|
* Create a data path
|
|
21327
21326
|
*/
|
|
21328
|
-
static createDataPath(
|
|
21329
|
-
return _PathFactoryUtils.defaultFactory.create("data",
|
|
21327
|
+
static createDataPath(path39) {
|
|
21328
|
+
return _PathFactoryUtils.defaultFactory.create("data", path39);
|
|
21330
21329
|
}
|
|
21331
21330
|
/**
|
|
21332
21331
|
* Create a theme path
|
|
21333
21332
|
*/
|
|
21334
|
-
static createThemePath(
|
|
21335
|
-
return _PathFactoryUtils.defaultFactory.create("themes",
|
|
21333
|
+
static createThemePath(path39) {
|
|
21334
|
+
return _PathFactoryUtils.defaultFactory.create("themes", path39);
|
|
21336
21335
|
}
|
|
21337
21336
|
/**
|
|
21338
21337
|
* Create paths from a configuration object
|
|
@@ -21346,7 +21345,7 @@ var init_pathfactory = __esm({
|
|
|
21346
21345
|
factoryConfig.replaceSpaces = config.replaceSpaces;
|
|
21347
21346
|
}
|
|
21348
21347
|
const factory = new PathFactoryImpl(factoryConfig);
|
|
21349
|
-
return config.paths.map((
|
|
21348
|
+
return config.paths.map((path39) => factory.create(config.component, path39));
|
|
21350
21349
|
}
|
|
21351
21350
|
/**
|
|
21352
21351
|
* Get a path builder instance
|
|
@@ -21357,9 +21356,9 @@ var init_pathfactory = __esm({
|
|
|
21357
21356
|
/**
|
|
21358
21357
|
* Create a path with pooling
|
|
21359
21358
|
*/
|
|
21360
|
-
static createWithPool(component,
|
|
21359
|
+
static createWithPool(component, path39, pool2) {
|
|
21361
21360
|
const factory = new PathFactoryImpl(void 0, pool2);
|
|
21362
|
-
return factory.create(component,
|
|
21361
|
+
return factory.create(component, path39);
|
|
21363
21362
|
}
|
|
21364
21363
|
};
|
|
21365
21364
|
}
|
|
@@ -21465,12 +21464,12 @@ var init_translator = __esm({
|
|
|
21465
21464
|
async setupTranslateFuncs(fsService) {
|
|
21466
21465
|
try {
|
|
21467
21466
|
await fsService.walkI18n("", {
|
|
21468
|
-
walkFn: async (
|
|
21469
|
-
if (!
|
|
21467
|
+
walkFn: async (path39, info) => {
|
|
21468
|
+
if (!path39.endsWith(".yaml") && !path39.endsWith(".yml")) {
|
|
21470
21469
|
return;
|
|
21471
21470
|
}
|
|
21472
21471
|
try {
|
|
21473
|
-
const normalizedPath = PATH_CONSTANTS.normalizePath(
|
|
21472
|
+
const normalizedPath = PATH_CONSTANTS.normalizePath(path39);
|
|
21474
21473
|
const filename = normalizedPath.split("/").pop() || "";
|
|
21475
21474
|
const langKey = filename.replace(/\.(yaml|yml)$/, "").toLowerCase();
|
|
21476
21475
|
const content = await this.readI18nFile(info);
|
|
@@ -21490,7 +21489,7 @@ var init_translator = __esm({
|
|
|
21490
21489
|
this.translateFuncs.set(langKey, translateFunc);
|
|
21491
21490
|
log38.info(`\u2705 Loaded i18n translations for language: ${langKey} (${translations.length} items)`);
|
|
21492
21491
|
} catch (error) {
|
|
21493
|
-
log38.error(`\u274C Failed to load i18n file ${
|
|
21492
|
+
log38.error(`\u274C Failed to load i18n file ${path39}:`, error);
|
|
21494
21493
|
}
|
|
21495
21494
|
}
|
|
21496
21495
|
}, {});
|
|
@@ -21696,13 +21695,13 @@ function isContentExt(ext) {
|
|
|
21696
21695
|
function newFileInfo2(fi) {
|
|
21697
21696
|
return FileInfo7.newFileInfo(fi);
|
|
21698
21697
|
}
|
|
21699
|
-
var crypto2,
|
|
21698
|
+
var crypto2, path23, log41, contentFileExtensions, contentFileExtensionsSet, FileInfo7;
|
|
21700
21699
|
var init_fileinfo2 = __esm({
|
|
21701
21700
|
"internal/domain/content/vo/fileinfo.ts"() {
|
|
21702
21701
|
"use strict";
|
|
21703
21702
|
init_paths();
|
|
21704
21703
|
crypto2 = __toESM(require("crypto"));
|
|
21705
|
-
|
|
21704
|
+
path23 = __toESM(require("path"));
|
|
21706
21705
|
init_log();
|
|
21707
21706
|
log41 = getDomainLogger("content", { component: "FileInfo" });
|
|
21708
21707
|
contentFileExtensions = [
|
|
@@ -21740,7 +21739,7 @@ var init_fileinfo2 = __esm({
|
|
|
21740
21739
|
relPath() {
|
|
21741
21740
|
const dir2 = this.pathInfo.dir();
|
|
21742
21741
|
const dirWithoutLeadingSlash = dir2.startsWith("/") ? dir2.substring(1) : dir2;
|
|
21743
|
-
return
|
|
21742
|
+
return path23.join(dirWithoutLeadingSlash, this.pathInfo.name());
|
|
21744
21743
|
}
|
|
21745
21744
|
section() {
|
|
21746
21745
|
return this.pathInfo.section();
|
|
@@ -21837,7 +21836,7 @@ var init_fileinfo2 = __esm({
|
|
|
21837
21836
|
if (s2 === "") {
|
|
21838
21837
|
return s2;
|
|
21839
21838
|
}
|
|
21840
|
-
return
|
|
21839
|
+
return path23.normalize(s2.substring(1) + "/");
|
|
21841
21840
|
}
|
|
21842
21841
|
determineBundleType() {
|
|
21843
21842
|
const isContent = isContentExt(this.pathInfo.ext());
|
|
@@ -22117,7 +22116,7 @@ function getParam(p2, key2, stringToLower) {
|
|
|
22117
22116
|
return v;
|
|
22118
22117
|
}
|
|
22119
22118
|
}
|
|
22120
|
-
var
|
|
22119
|
+
var import_path16, FrontMatterParserImpl;
|
|
22121
22120
|
var init_frontmatter = __esm({
|
|
22122
22121
|
"internal/domain/content/vo/frontmatter.ts"() {
|
|
22123
22122
|
"use strict";
|
|
@@ -22125,7 +22124,7 @@ var init_frontmatter = __esm({
|
|
|
22125
22124
|
init_cast2();
|
|
22126
22125
|
init_string2();
|
|
22127
22126
|
init_types3();
|
|
22128
|
-
|
|
22127
|
+
import_path16 = __toESM(require("path"));
|
|
22129
22128
|
FrontMatterParserImpl = class {
|
|
22130
22129
|
params;
|
|
22131
22130
|
langSvc;
|
|
@@ -22312,7 +22311,7 @@ var init_frontmatter = __esm({
|
|
|
22312
22311
|
organization.website = Cast.toString(orgValue.website);
|
|
22313
22312
|
}
|
|
22314
22313
|
if (orgValue.logo !== void 0 && orgValue.logo !== null) {
|
|
22315
|
-
organization.logo =
|
|
22314
|
+
organization.logo = import_path16.default.join(baseURL, Cast.toString(orgValue.logo));
|
|
22316
22315
|
}
|
|
22317
22316
|
const contact = this.parseContact(orgValue.contact);
|
|
22318
22317
|
if (contact) {
|
|
@@ -22430,7 +22429,7 @@ var init_frontmatter = __esm({
|
|
|
22430
22429
|
author.website = Cast.toString(authorValue.website);
|
|
22431
22430
|
}
|
|
22432
22431
|
if (authorValue.avatar !== void 0 && authorValue.avatar !== null) {
|
|
22433
|
-
author.avatar =
|
|
22432
|
+
author.avatar = import_path16.default.join(baseURL, Cast.toString(authorValue.avatar));
|
|
22434
22433
|
}
|
|
22435
22434
|
const contact = this.parseContact(authorValue.contact);
|
|
22436
22435
|
if (contact) {
|
|
@@ -22486,8 +22485,8 @@ var init_frontmatter = __esm({
|
|
|
22486
22485
|
* Convert path to slash preserving leading slash
|
|
22487
22486
|
* Equivalent to Go's paths.ToSlashPreserveLeading
|
|
22488
22487
|
*/
|
|
22489
|
-
toSlashPreserveLeading(
|
|
22490
|
-
return
|
|
22488
|
+
toSlashPreserveLeading(path39) {
|
|
22489
|
+
return path39.replace(/\\/g, "/");
|
|
22491
22490
|
}
|
|
22492
22491
|
};
|
|
22493
22492
|
}
|
|
@@ -22912,9 +22911,9 @@ var init_radix = __esm({
|
|
|
22912
22911
|
// from the root down to a given leaf. Where WalkPrefix walks
|
|
22913
22912
|
// all the entries *under* the given prefix, this walks the
|
|
22914
22913
|
// entries *above* the given prefix.
|
|
22915
|
-
async walkPath(
|
|
22914
|
+
async walkPath(path39, fn) {
|
|
22916
22915
|
let n = this.root;
|
|
22917
|
-
let search2 =
|
|
22916
|
+
let search2 = path39;
|
|
22918
22917
|
while (true) {
|
|
22919
22918
|
if (n.leaf !== null && await fn(n.leaf.key, n.leaf.val)) {
|
|
22920
22919
|
return;
|
|
@@ -24049,8 +24048,8 @@ var init_pagesource = __esm({
|
|
|
24049
24048
|
* 3. Handle index files (index → parent folder)
|
|
24050
24049
|
* 4. Handle _index files (Hugo-style section index)
|
|
24051
24050
|
*/
|
|
24052
|
-
pathToSlug(
|
|
24053
|
-
let slug2 =
|
|
24051
|
+
pathToSlug(path39) {
|
|
24052
|
+
let slug2 = path39.replace(/^\//, "");
|
|
24054
24053
|
slug2 = slug2.replace(/\.md$/, "");
|
|
24055
24054
|
if (slug2.endsWith("/index")) {
|
|
24056
24055
|
slug2 = slug2.replace(/\/index$/, "");
|
|
@@ -24097,17 +24096,17 @@ var init_pagesource = __esm({
|
|
|
24097
24096
|
});
|
|
24098
24097
|
|
|
24099
24098
|
// internal/domain/content/entity/pagemap.ts
|
|
24100
|
-
function addTrailingSlash(
|
|
24101
|
-
if (!
|
|
24102
|
-
|
|
24099
|
+
function addTrailingSlash(path39) {
|
|
24100
|
+
if (!path39.endsWith("/")) {
|
|
24101
|
+
path39 += "/";
|
|
24103
24102
|
}
|
|
24104
|
-
return
|
|
24103
|
+
return path39;
|
|
24105
24104
|
}
|
|
24106
|
-
function addLeadingSlash(
|
|
24107
|
-
if (!
|
|
24108
|
-
|
|
24105
|
+
function addLeadingSlash(path39) {
|
|
24106
|
+
if (!path39.startsWith("/")) {
|
|
24107
|
+
path39 = "/" + path39;
|
|
24109
24108
|
}
|
|
24110
|
-
return
|
|
24109
|
+
return path39;
|
|
24111
24110
|
}
|
|
24112
24111
|
var log43, ambiguousContentNode, ContentTreeReverseIndexMap, ContentTreeReverseIndex, pagePredicates, PageMapQueryPagesBelowPathImpl, PageMapQueryPagesInSectionImpl, PageMap;
|
|
24113
24112
|
var init_pagemap = __esm({
|
|
@@ -24160,8 +24159,8 @@ var init_pagemap = __esm({
|
|
|
24160
24159
|
path;
|
|
24161
24160
|
keyPart;
|
|
24162
24161
|
include;
|
|
24163
|
-
constructor(
|
|
24164
|
-
this.path =
|
|
24162
|
+
constructor(path39, keyPart, include = pagePredicates.shouldListLocal) {
|
|
24163
|
+
this.path = path39;
|
|
24165
24164
|
this.keyPart = keyPart;
|
|
24166
24165
|
this.include = include;
|
|
24167
24166
|
}
|
|
@@ -24173,8 +24172,8 @@ var init_pagemap = __esm({
|
|
|
24173
24172
|
recursive;
|
|
24174
24173
|
includeSelf;
|
|
24175
24174
|
index;
|
|
24176
|
-
constructor(
|
|
24177
|
-
super(
|
|
24175
|
+
constructor(path39, keyPart, recursive, includeSelf, index2, include) {
|
|
24176
|
+
super(path39, keyPart, include);
|
|
24178
24177
|
this.recursive = recursive;
|
|
24179
24178
|
this.includeSelf = includeSelf;
|
|
24180
24179
|
this.index = index2;
|
|
@@ -24542,12 +24541,12 @@ var init_pagemap = __esm({
|
|
|
24542
24541
|
/**
|
|
24543
24542
|
* Helper method to get directory from path
|
|
24544
24543
|
*/
|
|
24545
|
-
pathDir(
|
|
24546
|
-
const lastSlash =
|
|
24544
|
+
pathDir(path39) {
|
|
24545
|
+
const lastSlash = path39.lastIndexOf("/");
|
|
24547
24546
|
if (lastSlash === -1) {
|
|
24548
24547
|
return "";
|
|
24549
24548
|
}
|
|
24550
|
-
return
|
|
24549
|
+
return path39.substring(0, lastSlash);
|
|
24551
24550
|
}
|
|
24552
24551
|
};
|
|
24553
24552
|
}
|
|
@@ -24586,11 +24585,11 @@ var init_pagecollector = __esm({
|
|
|
24586
24585
|
/**
|
|
24587
24586
|
* CollectDir - exact replica of Go's collectDir method
|
|
24588
24587
|
*/
|
|
24589
|
-
async collectDir(fs13,
|
|
24588
|
+
async collectDir(fs13, path39, root2) {
|
|
24590
24589
|
try {
|
|
24591
|
-
await this.fs.walkContent(fs13,
|
|
24592
|
-
hookPre: async (dir2,
|
|
24593
|
-
const fullPath =
|
|
24590
|
+
await this.fs.walkContent(fs13, path39, {
|
|
24591
|
+
hookPre: async (dir2, path40, readdir2) => {
|
|
24592
|
+
const fullPath = path40;
|
|
24594
24593
|
if (this.processedPaths.has(fullPath)) {
|
|
24595
24594
|
log44.warn("Path already processed!", {
|
|
24596
24595
|
path: fullPath,
|
|
@@ -24621,7 +24620,7 @@ var init_pagecollector = __esm({
|
|
|
24621
24620
|
});
|
|
24622
24621
|
} catch (error) {
|
|
24623
24622
|
log44.error(`Failed to collect directory: ${error}`, {
|
|
24624
|
-
path:
|
|
24623
|
+
path: path39,
|
|
24625
24624
|
rootName: root2.name(),
|
|
24626
24625
|
rootIsDir: root2.isDir(),
|
|
24627
24626
|
stack: error.stack || "No stack trace available"
|
|
@@ -24631,7 +24630,7 @@ var init_pagecollector = __esm({
|
|
|
24631
24630
|
}
|
|
24632
24631
|
async handleBundleLeaf(dir2, bundle, inPath, readdir2) {
|
|
24633
24632
|
const bundlePath = bundle.paths();
|
|
24634
|
-
const walk = async (
|
|
24633
|
+
const walk = async (path39, info) => {
|
|
24635
24634
|
if (info.isDir()) {
|
|
24636
24635
|
return;
|
|
24637
24636
|
}
|
|
@@ -24883,10 +24882,10 @@ var init_content2 = __esm({
|
|
|
24883
24882
|
* GetPageFromPath - TypeScript equivalent of Go's PageFinder.GetPageFromPath
|
|
24884
24883
|
* This is the core content domain business logic for finding pages by path
|
|
24885
24884
|
*/
|
|
24886
|
-
getPageFromPath(langIndex,
|
|
24885
|
+
getPageFromPath(langIndex, path39) {
|
|
24887
24886
|
try {
|
|
24888
24887
|
const pathProcessor = PathDomain.createProcessor();
|
|
24889
|
-
const ps = pathProcessor.parse(PATH_CONSTANTS.COMPONENT_FOLDER_CONTENT,
|
|
24888
|
+
const ps = pathProcessor.parse(PATH_CONSTANTS.COMPONENT_FOLDER_CONTENT, path39);
|
|
24890
24889
|
const tree = this.pageMap.treePages.shape(0, langIndex);
|
|
24891
24890
|
let node = tree.get(ps.base());
|
|
24892
24891
|
if (node) {
|
|
@@ -24897,7 +24896,7 @@ var init_content2 = __esm({
|
|
|
24897
24896
|
}
|
|
24898
24897
|
return null;
|
|
24899
24898
|
} catch (error) {
|
|
24900
|
-
log45.error(`\u274C Content.getPageFromPath error for path "${
|
|
24899
|
+
log45.error(`\u274C Content.getPageFromPath error for path "${path39}":`, error);
|
|
24901
24900
|
return null;
|
|
24902
24901
|
}
|
|
24903
24902
|
}
|
|
@@ -25704,15 +25703,15 @@ var init_scratch = __esm({
|
|
|
25704
25703
|
function sanitize(input) {
|
|
25705
25704
|
return input.replace(/[\s\t\n\r]+/g, "-").replace(/[^\w\-_]/g, "").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
25706
25705
|
}
|
|
25707
|
-
function addContextRoot(root2,
|
|
25708
|
-
if (!root2 ||
|
|
25709
|
-
return
|
|
25706
|
+
function addContextRoot(root2, path39) {
|
|
25707
|
+
if (!root2 || path39.startsWith(root2)) {
|
|
25708
|
+
return path39;
|
|
25710
25709
|
}
|
|
25711
|
-
return joinPaths(root2,
|
|
25710
|
+
return joinPaths(root2, path39);
|
|
25712
25711
|
}
|
|
25713
|
-
function makePermalink(baseURL,
|
|
25712
|
+
function makePermalink(baseURL, path39) {
|
|
25714
25713
|
const base2 = baseURL.replace(/\/$/, "");
|
|
25715
|
-
const cleanPath =
|
|
25714
|
+
const cleanPath = path39.replace(/^\//, "");
|
|
25716
25715
|
const fullURL = `${base2}/${cleanPath}`;
|
|
25717
25716
|
try {
|
|
25718
25717
|
return new URL(fullURL);
|
|
@@ -25741,7 +25740,7 @@ var init_paths2 = __esm({
|
|
|
25741
25740
|
});
|
|
25742
25741
|
|
|
25743
25742
|
// internal/domain/content/entity/page.ts
|
|
25744
|
-
var
|
|
25743
|
+
var import_path17, log48, PageImpl, TaxonomyPageImpl, TermPageImpl;
|
|
25745
25744
|
var init_page = __esm({
|
|
25746
25745
|
"internal/domain/content/entity/page.ts"() {
|
|
25747
25746
|
"use strict";
|
|
@@ -25753,7 +25752,7 @@ var init_page = __esm({
|
|
|
25753
25752
|
init_paths2();
|
|
25754
25753
|
init_doctree();
|
|
25755
25754
|
init_sort();
|
|
25756
|
-
|
|
25755
|
+
import_path17 = __toESM(require("path"));
|
|
25757
25756
|
init_log();
|
|
25758
25757
|
log48 = getDomainLogger("content", { component: "page" });
|
|
25759
25758
|
PageImpl = class {
|
|
@@ -25831,8 +25830,8 @@ var init_page = __esm({
|
|
|
25831
25830
|
* 3. Handle index files (index → parent folder)
|
|
25832
25831
|
* 4. Handle _index files (Hugo-style section index)
|
|
25833
25832
|
*/
|
|
25834
|
-
pathToSlug(
|
|
25835
|
-
let slug2 =
|
|
25833
|
+
pathToSlug(path39) {
|
|
25834
|
+
let slug2 = path39.replace(/^\//, "");
|
|
25836
25835
|
slug2 = slug2.replace(/\.md$/, "");
|
|
25837
25836
|
if (slug2.endsWith("/index")) {
|
|
25838
25837
|
slug2 = slug2.replace(/\/index$/, "");
|
|
@@ -25859,7 +25858,7 @@ var init_page = __esm({
|
|
|
25859
25858
|
if (/^(https?:)?\/\//.test(src)) {
|
|
25860
25859
|
return src;
|
|
25861
25860
|
}
|
|
25862
|
-
src =
|
|
25861
|
+
src = import_path17.default.normalize(src);
|
|
25863
25862
|
src = src.replace(/\\/g, "/");
|
|
25864
25863
|
if (src.startsWith("/")) {
|
|
25865
25864
|
src = src.slice(1);
|
|
@@ -26579,12 +26578,12 @@ var init_type11 = __esm({
|
|
|
26579
26578
|
function newBaseOf() {
|
|
26580
26579
|
return new BaseOf();
|
|
26581
26580
|
}
|
|
26582
|
-
var
|
|
26581
|
+
var path26, BaseOf;
|
|
26583
26582
|
var init_baseof = __esm({
|
|
26584
26583
|
"internal/domain/template/vo/baseof.ts"() {
|
|
26585
26584
|
"use strict";
|
|
26586
26585
|
init_type11();
|
|
26587
|
-
|
|
26586
|
+
path26 = __toESM(require("path"));
|
|
26588
26587
|
BaseOf = class {
|
|
26589
26588
|
baseof = /* @__PURE__ */ new Map();
|
|
26590
26589
|
needsBaseof = /* @__PURE__ */ new Map();
|
|
@@ -26624,7 +26623,7 @@ var init_baseof = __esm({
|
|
|
26624
26623
|
* Check if path is a base template path
|
|
26625
26624
|
*/
|
|
26626
26625
|
isBaseTemplatePath(filePath) {
|
|
26627
|
-
return
|
|
26626
|
+
return path26.basename(filePath).includes(BASE_FILE_BASE);
|
|
26628
26627
|
}
|
|
26629
26628
|
/**
|
|
26630
26629
|
* Check if template needs base template
|
|
@@ -28379,8 +28378,8 @@ var init_registry = __esm({
|
|
|
28379
28378
|
}
|
|
28380
28379
|
},
|
|
28381
28380
|
// PathEscape escapes special characters in a URL path
|
|
28382
|
-
PathEscape: (
|
|
28383
|
-
return encodeURIComponent(
|
|
28381
|
+
PathEscape: (path39) => {
|
|
28382
|
+
return encodeURIComponent(path39).replace(/%2F/g, "/").replace(/[!'()*]/g, (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`);
|
|
28384
28383
|
},
|
|
28385
28384
|
// QueryEscape escapes special characters in a URL query
|
|
28386
28385
|
QueryEscape: (query) => {
|
|
@@ -29536,11 +29535,11 @@ var init_registry = __esm({
|
|
|
29536
29535
|
}
|
|
29537
29536
|
}
|
|
29538
29537
|
}
|
|
29539
|
-
const getNestedValue = (obj,
|
|
29540
|
-
if (!
|
|
29538
|
+
const getNestedValue = (obj, path39) => {
|
|
29539
|
+
if (!path39 || path39 === "value") {
|
|
29541
29540
|
return obj;
|
|
29542
29541
|
}
|
|
29543
|
-
const keys =
|
|
29542
|
+
const keys = path39.split(".");
|
|
29544
29543
|
let current = obj;
|
|
29545
29544
|
for (const key2 of keys) {
|
|
29546
29545
|
if (current === null || current === void 0) {
|
|
@@ -30105,23 +30104,23 @@ var init_registry = __esm({
|
|
|
30105
30104
|
registerPathFunctions(funcMap) {
|
|
30106
30105
|
funcMap.set("path", () => ({
|
|
30107
30106
|
// Base returns the last element of path
|
|
30108
|
-
Base: (
|
|
30109
|
-
if (!
|
|
30107
|
+
Base: (path39) => {
|
|
30108
|
+
if (!path39)
|
|
30110
30109
|
return ".";
|
|
30111
|
-
|
|
30112
|
-
|
|
30113
|
-
if (!
|
|
30110
|
+
path39 = path39.replace(/\\/g, "/");
|
|
30111
|
+
path39 = path39.replace(/\/+$/, "");
|
|
30112
|
+
if (!path39)
|
|
30114
30113
|
return "/";
|
|
30115
|
-
const parts =
|
|
30114
|
+
const parts = path39.split("/");
|
|
30116
30115
|
return parts[parts.length - 1] || "/";
|
|
30117
30116
|
},
|
|
30118
30117
|
// Clean returns the shortest path name equivalent to path
|
|
30119
|
-
Clean: (
|
|
30120
|
-
if (!
|
|
30118
|
+
Clean: (path39) => {
|
|
30119
|
+
if (!path39)
|
|
30121
30120
|
return ".";
|
|
30122
|
-
|
|
30123
|
-
const isAbs =
|
|
30124
|
-
const parts =
|
|
30121
|
+
path39 = path39.replace(/\\/g, "/");
|
|
30122
|
+
const isAbs = path39.startsWith("/");
|
|
30123
|
+
const parts = path39.split("/").filter((p2) => p2 && p2 !== ".");
|
|
30125
30124
|
const stack = [];
|
|
30126
30125
|
for (const part of parts) {
|
|
30127
30126
|
if (part === "..") {
|
|
@@ -30134,56 +30133,56 @@ var init_registry = __esm({
|
|
|
30134
30133
|
stack.push(part);
|
|
30135
30134
|
}
|
|
30136
30135
|
}
|
|
30137
|
-
|
|
30136
|
+
path39 = stack.join("/");
|
|
30138
30137
|
if (isAbs)
|
|
30139
|
-
|
|
30140
|
-
return
|
|
30138
|
+
path39 = "/" + path39;
|
|
30139
|
+
return path39 || (isAbs ? "/" : ".");
|
|
30141
30140
|
},
|
|
30142
30141
|
// Dir returns all but the last element of path
|
|
30143
|
-
Dir: (
|
|
30144
|
-
if (!
|
|
30142
|
+
Dir: (path39) => {
|
|
30143
|
+
if (!path39)
|
|
30145
30144
|
return ".";
|
|
30146
|
-
|
|
30147
|
-
if (!
|
|
30145
|
+
path39 = path39.replace(/\/+$/, "");
|
|
30146
|
+
if (!path39)
|
|
30148
30147
|
return "/";
|
|
30149
|
-
const parts =
|
|
30148
|
+
const parts = path39.split("/");
|
|
30150
30149
|
parts.pop();
|
|
30151
30150
|
return parts.join("/") || ".";
|
|
30152
30151
|
},
|
|
30153
30152
|
// Ext returns the file name extension
|
|
30154
|
-
Ext: (
|
|
30155
|
-
const base2 =
|
|
30153
|
+
Ext: (path39) => {
|
|
30154
|
+
const base2 = path39.split("/").pop() || "";
|
|
30156
30155
|
const dot = base2.lastIndexOf(".");
|
|
30157
30156
|
if (dot === -1 || dot === 0)
|
|
30158
30157
|
return "";
|
|
30159
30158
|
return base2.substring(dot);
|
|
30160
30159
|
},
|
|
30161
30160
|
// IsAbs reports whether the path is absolute
|
|
30162
|
-
IsAbs: (
|
|
30163
|
-
return
|
|
30161
|
+
IsAbs: (path39) => {
|
|
30162
|
+
return path39.startsWith("/");
|
|
30164
30163
|
},
|
|
30165
30164
|
// Join joins any number of path elements into a single path
|
|
30166
30165
|
Join: (...elements) => {
|
|
30167
30166
|
if (elements.length === 0)
|
|
30168
30167
|
return ".";
|
|
30169
30168
|
const parts = elements.filter((e) => e).map((e) => e.replace(/^\/+|\/+$/g, ""));
|
|
30170
|
-
let
|
|
30169
|
+
let path39 = parts.join("/");
|
|
30171
30170
|
if (elements[0] && elements[0].startsWith("/")) {
|
|
30172
|
-
|
|
30171
|
+
path39 = "/" + path39;
|
|
30173
30172
|
}
|
|
30174
|
-
return
|
|
30173
|
+
return path39 || ".";
|
|
30175
30174
|
},
|
|
30176
30175
|
// Split splits path immediately following the final slash
|
|
30177
|
-
Split: (
|
|
30178
|
-
if (!
|
|
30176
|
+
Split: (path39) => {
|
|
30177
|
+
if (!path39)
|
|
30179
30178
|
return [".", ""];
|
|
30180
|
-
const lastSlash =
|
|
30179
|
+
const lastSlash = path39.lastIndexOf("/");
|
|
30181
30180
|
if (lastSlash === -1) {
|
|
30182
|
-
return ["",
|
|
30181
|
+
return ["", path39];
|
|
30183
30182
|
}
|
|
30184
30183
|
return [
|
|
30185
|
-
|
|
30186
|
-
|
|
30184
|
+
path39.substring(0, lastSlash),
|
|
30185
|
+
path39.substring(lastSlash + 1)
|
|
30187
30186
|
];
|
|
30188
30187
|
}
|
|
30189
30188
|
}));
|
|
@@ -30469,11 +30468,11 @@ var init_registry = __esm({
|
|
|
30469
30468
|
* Get nested value from object using dot notation path
|
|
30470
30469
|
* Following golang's path resolution logic
|
|
30471
30470
|
*/
|
|
30472
|
-
getNestedValue(obj,
|
|
30473
|
-
if (!obj || !
|
|
30471
|
+
getNestedValue(obj, path39) {
|
|
30472
|
+
if (!obj || !path39) {
|
|
30474
30473
|
return void 0;
|
|
30475
30474
|
}
|
|
30476
|
-
const cleanPath =
|
|
30475
|
+
const cleanPath = path39.replace(/^\\.+/, "");
|
|
30477
30476
|
const parts = cleanPath.split(".");
|
|
30478
30477
|
let current = obj;
|
|
30479
30478
|
for (let i = 0; i < parts.length; i++) {
|
|
@@ -31008,14 +31007,14 @@ var init_pagebuilder = __esm({
|
|
|
31008
31007
|
* Parse kind - exact replica of Go's parseKind method
|
|
31009
31008
|
*/
|
|
31010
31009
|
async parseKind() {
|
|
31011
|
-
const
|
|
31010
|
+
const path39 = this.source.file.paths();
|
|
31012
31011
|
let kind = "";
|
|
31013
31012
|
if (this.fm) {
|
|
31014
31013
|
kind = this.fm.kind || "";
|
|
31015
31014
|
}
|
|
31016
31015
|
if (kind === "") {
|
|
31017
31016
|
kind = getKindMain("page");
|
|
31018
|
-
const base2 =
|
|
31017
|
+
const base2 = path39.baseNoLeadingSlash();
|
|
31019
31018
|
switch (base2) {
|
|
31020
31019
|
case PAGE_HOME_BASE:
|
|
31021
31020
|
case "":
|
|
@@ -31030,9 +31029,9 @@ var init_pagebuilder = __esm({
|
|
|
31030
31029
|
default:
|
|
31031
31030
|
if (this.source.file.isBranchBundle()) {
|
|
31032
31031
|
kind = getKindMain("section");
|
|
31033
|
-
const v = this.taxonomy.getTaxonomy(
|
|
31032
|
+
const v = this.taxonomy.getTaxonomy(path39.path());
|
|
31034
31033
|
if (!this.taxonomy.isZero(v)) {
|
|
31035
|
-
if (this.taxonomy.isTaxonomyPath(
|
|
31034
|
+
if (this.taxonomy.isTaxonomyPath(path39.path())) {
|
|
31036
31035
|
kind = getKindMain("taxonomy");
|
|
31037
31036
|
} else {
|
|
31038
31037
|
kind = getKindMain("term");
|
|
@@ -31319,7 +31318,7 @@ function cleanTreeKey2(...elem) {
|
|
|
31319
31318
|
if (elem.length > 0) {
|
|
31320
31319
|
s2 = elem[0];
|
|
31321
31320
|
if (elem.length > 1) {
|
|
31322
|
-
s2 =
|
|
31321
|
+
s2 = path27.join(...elem);
|
|
31323
31322
|
}
|
|
31324
31323
|
}
|
|
31325
31324
|
s2 = s2.replace(/^[\.\/ \s]+|[\.\/ \s]+$/g, "");
|
|
@@ -31332,14 +31331,14 @@ function cleanTreeKey2(...elem) {
|
|
|
31332
31331
|
}
|
|
31333
31332
|
return s2;
|
|
31334
31333
|
}
|
|
31335
|
-
var
|
|
31334
|
+
var path27, filepath, Taxonomy2;
|
|
31336
31335
|
var init_taxonomy3 = __esm({
|
|
31337
31336
|
"internal/domain/content/entity/taxonomy.ts"() {
|
|
31338
31337
|
"use strict";
|
|
31339
31338
|
init_pagetrees();
|
|
31340
31339
|
init_fileinfo2();
|
|
31341
31340
|
init_pagesource();
|
|
31342
|
-
|
|
31341
|
+
path27 = __toESM(require("path"));
|
|
31343
31342
|
filepath = __toESM(require("path"));
|
|
31344
31343
|
Taxonomy2 = class {
|
|
31345
31344
|
views;
|
|
@@ -31370,7 +31369,7 @@ var init_taxonomy3 = __esm({
|
|
|
31370
31369
|
if (!ta) {
|
|
31371
31370
|
return false;
|
|
31372
31371
|
}
|
|
31373
|
-
return p2 ===
|
|
31372
|
+
return p2 === path27.join(this.pluralTreeKey(ta.plural()), "_index.md");
|
|
31374
31373
|
}
|
|
31375
31374
|
/**
|
|
31376
31375
|
* PluralTreeKey - exact replica of Go's PluralTreeKey method
|
|
@@ -31675,11 +31674,11 @@ var init_pager = __esm({
|
|
|
31675
31674
|
});
|
|
31676
31675
|
|
|
31677
31676
|
// internal/domain/site/entity/page.ts
|
|
31678
|
-
var
|
|
31677
|
+
var import_path18, log57, Page2;
|
|
31679
31678
|
var init_page2 = __esm({
|
|
31680
31679
|
"internal/domain/site/entity/page.ts"() {
|
|
31681
31680
|
"use strict";
|
|
31682
|
-
|
|
31681
|
+
import_path18 = __toESM(require("path"));
|
|
31683
31682
|
init_log();
|
|
31684
31683
|
init_pager();
|
|
31685
31684
|
log57 = getDomainLogger("site", { component: "page" });
|
|
@@ -31799,14 +31798,14 @@ var init_page2 = __esm({
|
|
|
31799
31798
|
} else {
|
|
31800
31799
|
prefix = this.site.getLanguage().getCurrentLanguage();
|
|
31801
31800
|
}
|
|
31802
|
-
targetFilenames.push(
|
|
31801
|
+
targetFilenames.push(import_path18.default.join(prefix, this.getPageOutput().targetFilePath()));
|
|
31803
31802
|
await this.renderAndWritePage(tmpl, targetFilenames);
|
|
31804
31803
|
const current = await this.current();
|
|
31805
31804
|
if (current) {
|
|
31806
31805
|
let currentPager = current.next();
|
|
31807
31806
|
while (currentPager) {
|
|
31808
31807
|
this.setCurrent(currentPager);
|
|
31809
|
-
const paginationTargets = [
|
|
31808
|
+
const paginationTargets = [import_path18.default.join(prefix, currentPager.url(), this.getPageOutput().targetFileBase())];
|
|
31810
31809
|
await this.renderAndWritePage(tmpl, paginationTargets);
|
|
31811
31810
|
currentPager = currentPager.next();
|
|
31812
31811
|
}
|
|
@@ -31839,7 +31838,7 @@ var init_page2 = __esm({
|
|
|
31839
31838
|
prefix = this.site.getLanguage().getCurrentLanguage();
|
|
31840
31839
|
}
|
|
31841
31840
|
let resourcePath = pageSource.path();
|
|
31842
|
-
targetFilenames.push(
|
|
31841
|
+
targetFilenames.push(import_path18.default.join(prefix, resourcePath));
|
|
31843
31842
|
let stream = null;
|
|
31844
31843
|
try {
|
|
31845
31844
|
const opener = () => pageSource.pageFile().open();
|
|
@@ -32494,11 +32493,11 @@ var init_baseurl = __esm({
|
|
|
32494
32493
|
/**
|
|
32495
32494
|
* Returns the appropriate root URL based on the path.
|
|
32496
32495
|
*/
|
|
32497
|
-
getRoot(
|
|
32496
|
+
getRoot(path39) {
|
|
32498
32497
|
if (this.isRelative) {
|
|
32499
32498
|
return this.basePath;
|
|
32500
32499
|
}
|
|
32501
|
-
if (
|
|
32500
|
+
if (path39.startsWith("/")) {
|
|
32502
32501
|
return this.withoutPath;
|
|
32503
32502
|
}
|
|
32504
32503
|
return this.withPath;
|
|
@@ -33892,8 +33891,8 @@ function assertNonEmpty(part, name) {
|
|
|
33892
33891
|
throw new Error("`" + name + "` cannot be empty");
|
|
33893
33892
|
}
|
|
33894
33893
|
}
|
|
33895
|
-
function assertPath(
|
|
33896
|
-
if (!
|
|
33894
|
+
function assertPath(path39, name) {
|
|
33895
|
+
if (!path39) {
|
|
33897
33896
|
throw new Error("Setting `" + name + "` requires `path` to be set too");
|
|
33898
33897
|
}
|
|
33899
33898
|
}
|
|
@@ -34078,13 +34077,13 @@ var init_lib4 = __esm({
|
|
|
34078
34077
|
* @returns {undefined}
|
|
34079
34078
|
* Nothing.
|
|
34080
34079
|
*/
|
|
34081
|
-
set path(
|
|
34082
|
-
if (isUrl(
|
|
34083
|
-
|
|
34080
|
+
set path(path39) {
|
|
34081
|
+
if (isUrl(path39)) {
|
|
34082
|
+
path39 = (0, import_node_url.fileURLToPath)(path39);
|
|
34084
34083
|
}
|
|
34085
|
-
assertNonEmpty(
|
|
34086
|
-
if (this.path !==
|
|
34087
|
-
this.history.push(
|
|
34084
|
+
assertNonEmpty(path39, "path");
|
|
34085
|
+
if (this.path !== path39) {
|
|
34086
|
+
this.history.push(path39);
|
|
34088
34087
|
}
|
|
34089
34088
|
}
|
|
34090
34089
|
/**
|
|
@@ -46845,7 +46844,7 @@ var init_is_absolute_url = __esm({
|
|
|
46845
46844
|
function createHtmlLinkProcessor(graph, options) {
|
|
46846
46845
|
return new HtmlLinkProcessor(graph, options);
|
|
46847
46846
|
}
|
|
46848
|
-
var
|
|
46847
|
+
var import_path20, log61, defaultOptions, HtmlLinkProcessor;
|
|
46849
46848
|
var init_html_link_processor = __esm({
|
|
46850
46849
|
"internal/domain/site/service/html-link-processor.ts"() {
|
|
46851
46850
|
"use strict";
|
|
@@ -46854,7 +46853,7 @@ var init_html_link_processor = __esm({
|
|
|
46854
46853
|
init_rehype_stringify();
|
|
46855
46854
|
init_unist_util_visit();
|
|
46856
46855
|
init_is_absolute_url();
|
|
46857
|
-
|
|
46856
|
+
import_path20 = __toESM(require("path"));
|
|
46858
46857
|
init_path3();
|
|
46859
46858
|
init_log();
|
|
46860
46859
|
log61 = getDomainLogger("site", { component: "HtmlLinkProcessor" });
|
|
@@ -46992,7 +46991,7 @@ var init_html_link_processor = __esm({
|
|
|
46992
46991
|
node.properties["data-slug"] = full;
|
|
46993
46992
|
}
|
|
46994
46993
|
if (opts.prettyLinks && isInternal && node.children.length === 1 && node.children[0].type === "text" && !node.children[0].value.startsWith("#")) {
|
|
46995
|
-
node.children[0].value =
|
|
46994
|
+
node.children[0].value = import_path20.default.basename(node.children[0].value);
|
|
46996
46995
|
}
|
|
46997
46996
|
}
|
|
46998
46997
|
if (["img", "video", "audio", "iframe"].includes(node.tagName) && node.properties && typeof node.properties.src === "string") {
|
|
@@ -47886,14 +47885,14 @@ var init_site = __esm({
|
|
|
47886
47885
|
|
|
47887
47886
|
// internal/domain/site/entity/publisher.ts
|
|
47888
47887
|
async function openFileForWriting(fs13, filename) {
|
|
47889
|
-
const cleanFilename =
|
|
47888
|
+
const cleanFilename = import_path22.default.normalize(filename);
|
|
47890
47889
|
try {
|
|
47891
47890
|
return await fs13.create(cleanFilename);
|
|
47892
47891
|
} catch (error) {
|
|
47893
47892
|
if (!isFileNotFoundError(error)) {
|
|
47894
47893
|
throw error;
|
|
47895
47894
|
}
|
|
47896
|
-
const dir2 =
|
|
47895
|
+
const dir2 = import_path22.default.dirname(cleanFilename);
|
|
47897
47896
|
await fs13.mkdirAll(dir2, 511);
|
|
47898
47897
|
return await fs13.create(cleanFilename);
|
|
47899
47898
|
}
|
|
@@ -47901,11 +47900,11 @@ async function openFileForWriting(fs13, filename) {
|
|
|
47901
47900
|
function isFileNotFoundError(error) {
|
|
47902
47901
|
return error && (error.code === "ENOENT" || error.code === "FILE_NOT_FOUND" || error.message?.includes("not found") || error.message?.includes("no such file"));
|
|
47903
47902
|
}
|
|
47904
|
-
var
|
|
47903
|
+
var import_path22, log64, Publisher, MultiWriter;
|
|
47905
47904
|
var init_publisher2 = __esm({
|
|
47906
47905
|
"internal/domain/site/entity/publisher.ts"() {
|
|
47907
47906
|
"use strict";
|
|
47908
|
-
|
|
47907
|
+
import_path22 = __toESM(require("path"));
|
|
47909
47908
|
init_log();
|
|
47910
47909
|
log64 = getDomainLogger("site", { component: "publisher" });
|
|
47911
47910
|
Publisher = class {
|
|
@@ -48766,8 +48765,8 @@ var init_menu_builder = __esm({
|
|
|
48766
48765
|
/**
|
|
48767
48766
|
* Fallback URL generation from path (used when site page conversion fails)
|
|
48768
48767
|
*/
|
|
48769
|
-
fallbackUrlFromPath(
|
|
48770
|
-
let url =
|
|
48768
|
+
fallbackUrlFromPath(path39) {
|
|
48769
|
+
let url = path39.replace(/\.md$/, "");
|
|
48771
48770
|
if (!url.startsWith("/")) {
|
|
48772
48771
|
url = "/" + url;
|
|
48773
48772
|
}
|
|
@@ -49690,11 +49689,11 @@ var init_template4 = __esm({
|
|
|
49690
49689
|
});
|
|
49691
49690
|
|
|
49692
49691
|
// internal/domain/resources/entity/publisher.ts
|
|
49693
|
-
var
|
|
49692
|
+
var path31, import_stream2, log73, Publisher2, FileWritable;
|
|
49694
49693
|
var init_publisher3 = __esm({
|
|
49695
49694
|
"internal/domain/resources/entity/publisher.ts"() {
|
|
49696
49695
|
"use strict";
|
|
49697
|
-
|
|
49696
|
+
path31 = __toESM(require("path"));
|
|
49698
49697
|
init_log();
|
|
49699
49698
|
import_stream2 = require("stream");
|
|
49700
49699
|
log73 = getDomainLogger("resources", { component: "publisher" });
|
|
@@ -49729,7 +49728,7 @@ var init_publisher3 = __esm({
|
|
|
49729
49728
|
return new FileWritable(file);
|
|
49730
49729
|
} catch (error) {
|
|
49731
49730
|
if (error.code === "ENOENT" || error.message.includes("ENOENT")) {
|
|
49732
|
-
const dir2 =
|
|
49731
|
+
const dir2 = path31.dirname(cleanFilename);
|
|
49733
49732
|
await this.pubFs.mkdirAll(dir2, 511);
|
|
49734
49733
|
const file = await this.pubFs.create(cleanFilename);
|
|
49735
49734
|
const originalClose = file.close.bind(file);
|
|
@@ -49763,14 +49762,14 @@ var init_publisher3 = __esm({
|
|
|
49763
49762
|
* TypeScript equivalent of OpenFileForWriting function from Go
|
|
49764
49763
|
*/
|
|
49765
49764
|
async openFileForWriting(filename) {
|
|
49766
|
-
const cleanFilename =
|
|
49765
|
+
const cleanFilename = path31.normalize(filename);
|
|
49767
49766
|
try {
|
|
49768
49767
|
return await this.pubFs.create(cleanFilename);
|
|
49769
49768
|
} catch (error) {
|
|
49770
49769
|
if (!this.isFileNotFoundError(error)) {
|
|
49771
49770
|
throw error;
|
|
49772
49771
|
}
|
|
49773
|
-
const dir2 =
|
|
49772
|
+
const dir2 = path31.dirname(cleanFilename);
|
|
49774
49773
|
await this.pubFs.mkdirAll(dir2, 511);
|
|
49775
49774
|
return await this.pubFs.create(cleanFilename);
|
|
49776
49775
|
}
|
|
@@ -49898,7 +49897,7 @@ var init_http2 = __esm({
|
|
|
49898
49897
|
});
|
|
49899
49898
|
|
|
49900
49899
|
// internal/domain/resources/entity/resources.ts
|
|
49901
|
-
var
|
|
49900
|
+
var path32, import_crypto4, log75, Resources;
|
|
49902
49901
|
var init_resources = __esm({
|
|
49903
49902
|
"internal/domain/resources/entity/resources.ts"() {
|
|
49904
49903
|
"use strict";
|
|
@@ -49910,7 +49909,7 @@ var init_resources = __esm({
|
|
|
49910
49909
|
init_publisher3();
|
|
49911
49910
|
init_http2();
|
|
49912
49911
|
init_type9();
|
|
49913
|
-
|
|
49912
|
+
path32 = __toESM(require("path"));
|
|
49914
49913
|
import_crypto4 = require("crypto");
|
|
49915
49914
|
init_log();
|
|
49916
49915
|
log75 = getDomainLogger("resources", { component: "resources" });
|
|
@@ -49945,7 +49944,7 @@ var init_resources = __esm({
|
|
|
49945
49944
|
* Supports caching for performance optimization
|
|
49946
49945
|
*/
|
|
49947
49946
|
async getResource(pathname) {
|
|
49948
|
-
const cleanPath =
|
|
49947
|
+
const cleanPath = path32.posix.normalize(pathname);
|
|
49949
49948
|
const cacheKey = `${cleanPath}__get`;
|
|
49950
49949
|
if (this.cache.has(cacheKey)) {
|
|
49951
49950
|
return this.cache.get(cacheKey) || null;
|
|
@@ -49974,7 +49973,7 @@ var init_resources = __esm({
|
|
|
49974
49973
|
* GetResourceWithOpener - Alternative way to get resource with custom opener
|
|
49975
49974
|
*/
|
|
49976
49975
|
async getResourceWithOpener(pathname, opener) {
|
|
49977
|
-
const cleanPath =
|
|
49976
|
+
const cleanPath = path32.posix.normalize(pathname);
|
|
49978
49977
|
const cacheKey = `${cleanPath}__get_with_opener`;
|
|
49979
49978
|
if (this.cache.has(cacheKey)) {
|
|
49980
49979
|
return this.cache.get(cacheKey) || null;
|
|
@@ -50112,7 +50111,7 @@ var init_resources = __esm({
|
|
|
50112
50111
|
*/
|
|
50113
50112
|
async buildResource(pathname, opener) {
|
|
50114
50113
|
try {
|
|
50115
|
-
const ext =
|
|
50114
|
+
const ext = path32.extname(pathname);
|
|
50116
50115
|
const mediaType = this.getMediaTypeFromExtension(ext);
|
|
50117
50116
|
const resourcePaths = ResourcePaths.newResourcePaths(pathname, this.workspace);
|
|
50118
50117
|
const resource = new ResourceImpl(
|
|
@@ -50214,11 +50213,11 @@ var init_resources = __esm({
|
|
|
50214
50213
|
});
|
|
50215
50214
|
|
|
50216
50215
|
// internal/domain/resources/valueobject/resourcepaths.ts
|
|
50217
|
-
var
|
|
50216
|
+
var path33, ResourcePaths;
|
|
50218
50217
|
var init_resourcepaths = __esm({
|
|
50219
50218
|
"internal/domain/resources/valueobject/resourcepaths.ts"() {
|
|
50220
50219
|
"use strict";
|
|
50221
|
-
|
|
50220
|
+
path33 = __toESM(require("path"));
|
|
50222
50221
|
ResourcePaths = class _ResourcePaths {
|
|
50223
50222
|
// This is the directory component for the target file or link.
|
|
50224
50223
|
dir;
|
|
@@ -50241,7 +50240,7 @@ var init_resourcepaths = __esm({
|
|
|
50241
50240
|
}
|
|
50242
50241
|
static newResourcePaths(targetPath, svc) {
|
|
50243
50242
|
const normalizedPath = targetPath.replace(/\\/g, "/");
|
|
50244
|
-
const parsedPath =
|
|
50243
|
+
const parsedPath = path33.posix.parse(normalizedPath);
|
|
50245
50244
|
let dir2 = parsedPath.dir;
|
|
50246
50245
|
if (dir2 === "/") {
|
|
50247
50246
|
dir2 = "";
|
|
@@ -50298,7 +50297,7 @@ var init_resourcepaths = __esm({
|
|
|
50298
50297
|
}
|
|
50299
50298
|
fromTargetPath(targetPath) {
|
|
50300
50299
|
const normalizedPath = targetPath.replace(/\\/g, "/");
|
|
50301
|
-
const parsedPath =
|
|
50300
|
+
const parsedPath = path33.posix.parse(normalizedPath);
|
|
50302
50301
|
let dir2 = parsedPath.dir;
|
|
50303
50302
|
if (dir2 === "/") {
|
|
50304
50303
|
dir2 = "";
|
|
@@ -50444,7 +50443,7 @@ function getDomainInstances() {
|
|
|
50444
50443
|
}
|
|
50445
50444
|
async function loadConfiguration(projDir, modulesDir) {
|
|
50446
50445
|
const osFs = newOsFs();
|
|
50447
|
-
const configFilePath =
|
|
50446
|
+
const configFilePath = import_path23.default.join(projDir, "config.json");
|
|
50448
50447
|
return await loadConfigWithParams(osFs, configFilePath, projDir, modulesDir);
|
|
50449
50448
|
}
|
|
50450
50449
|
async function createModule(config) {
|
|
@@ -50690,11 +50689,11 @@ function createSiteForSSG(config, fs13, content) {
|
|
|
50690
50689
|
searchPage: async (pages, page) => {
|
|
50691
50690
|
return [];
|
|
50692
50691
|
},
|
|
50693
|
-
getPageFromPath: async (langIndex,
|
|
50692
|
+
getPageFromPath: async (langIndex, path39) => {
|
|
50694
50693
|
try {
|
|
50695
|
-
const page = content.getPageFromPath(langIndex,
|
|
50694
|
+
const page = content.getPageFromPath(langIndex, path39);
|
|
50696
50695
|
if (!page) {
|
|
50697
|
-
log76.error(`\u26A0\uFE0F Application.getPageFromPath: content domain returned null for path: "${
|
|
50696
|
+
log76.error(`\u26A0\uFE0F Application.getPageFromPath: content domain returned null for path: "${path39}"`);
|
|
50698
50697
|
}
|
|
50699
50698
|
return page;
|
|
50700
50699
|
} catch (error) {
|
|
@@ -50702,11 +50701,11 @@ function createSiteForSSG(config, fs13, content) {
|
|
|
50702
50701
|
return null;
|
|
50703
50702
|
}
|
|
50704
50703
|
},
|
|
50705
|
-
getPageFromPathSync: (langIndex,
|
|
50704
|
+
getPageFromPathSync: (langIndex, path39) => {
|
|
50706
50705
|
try {
|
|
50707
|
-
const page = content.getPageFromPath(langIndex,
|
|
50706
|
+
const page = content.getPageFromPath(langIndex, path39);
|
|
50708
50707
|
if (!page) {
|
|
50709
|
-
log76.warn(`\u26A0\uFE0F Application.getPageFromPathSync: content domain returned null for path: ${
|
|
50708
|
+
log76.warn(`\u26A0\uFE0F Application.getPageFromPathSync: content domain returned null for path: ${path39}`);
|
|
50710
50709
|
}
|
|
50711
50710
|
return page;
|
|
50712
50711
|
} catch (error) {
|
|
@@ -50741,14 +50740,14 @@ function createSiteForSSG(config, fs13, content) {
|
|
|
50741
50740
|
},
|
|
50742
50741
|
workingDir: () => config.getProvider().getString("workingDir") || process.cwd(),
|
|
50743
50742
|
// ResourceService implementation (placeholder)
|
|
50744
|
-
getResource: async (
|
|
50743
|
+
getResource: async (path39) => {
|
|
50745
50744
|
return null;
|
|
50746
50745
|
},
|
|
50747
|
-
getResourceWithOpener: async (
|
|
50746
|
+
getResourceWithOpener: async (path39, opener) => {
|
|
50748
50747
|
return {
|
|
50749
|
-
name: () =>
|
|
50748
|
+
name: () => path39,
|
|
50750
50749
|
readSeekCloser: opener,
|
|
50751
|
-
targetPath: () =>
|
|
50750
|
+
targetPath: () => path39
|
|
50752
50751
|
};
|
|
50753
50752
|
},
|
|
50754
50753
|
// URLService implementation
|
|
@@ -51027,7 +51026,7 @@ async function collectAllPageTasks(projDir, modulesDir, markdown, onProgress, ht
|
|
|
51027
51026
|
throw new Error(`Failed to generate static site: ${message}`);
|
|
51028
51027
|
}
|
|
51029
51028
|
}
|
|
51030
|
-
var
|
|
51029
|
+
var import_path23, log76, configCache, modulesCache, fsCache, contentCache, resourcesCache, templateEngineCache, siteCache, createDomainInstances, tasks;
|
|
51031
51030
|
var init_ssg = __esm({
|
|
51032
51031
|
"internal/application/ssg.ts"() {
|
|
51033
51032
|
"use strict";
|
|
@@ -51038,7 +51037,7 @@ var init_ssg = __esm({
|
|
|
51038
51037
|
init_template3();
|
|
51039
51038
|
init_site2();
|
|
51040
51039
|
init_log();
|
|
51041
|
-
|
|
51040
|
+
import_path23 = __toESM(require("path"));
|
|
51042
51041
|
init_resources2();
|
|
51043
51042
|
log76 = getDomainLogger("ssg", { component: "application" });
|
|
51044
51043
|
createDomainInstances = (site, content, fs13, config, modules, resources) => {
|
|
@@ -51774,8 +51773,8 @@ var WorkerPoolManager = class {
|
|
|
51774
51773
|
* 初始化 Node.js Worker 池
|
|
51775
51774
|
*/
|
|
51776
51775
|
async initializeNodePool() {
|
|
51777
|
-
const
|
|
51778
|
-
const workerPath =
|
|
51776
|
+
const path39 = require("path");
|
|
51777
|
+
const workerPath = path39.join(__dirname, "worker", "worker-node.js");
|
|
51779
51778
|
log79.debug(`Initializing Node.js worker pool with path: ${workerPath}`);
|
|
51780
51779
|
this.pool = workerpool.pool(workerPath, {
|
|
51781
51780
|
minWorkers: this.workerCount,
|
|
@@ -52102,7 +52101,7 @@ async function processSSGParallel(projDir, modulesDir, markdown, onProgress, htt
|
|
|
52102
52101
|
|
|
52103
52102
|
// internal/interfaces/cli/commands/build.ts
|
|
52104
52103
|
init_log();
|
|
52105
|
-
var
|
|
52104
|
+
var import_path24 = __toESM(require("path"));
|
|
52106
52105
|
var import_fs14 = require("fs");
|
|
52107
52106
|
var log82 = getDomainLogger("build-command", { component: "cli" });
|
|
52108
52107
|
var BuildCommand = class {
|
|
@@ -52129,7 +52128,7 @@ var BuildCommand = class {
|
|
|
52129
52128
|
await project.loadConfig();
|
|
52130
52129
|
const projectRoot = project.getPath();
|
|
52131
52130
|
const modulesDir = options.modulesDir || workspace.getModulesDir();
|
|
52132
|
-
const outputDir = options.destination ?
|
|
52131
|
+
const outputDir = options.destination ? import_path24.default.resolve(projectRoot, options.destination) : await project.getPublishDir();
|
|
52133
52132
|
if (options.clean) {
|
|
52134
52133
|
await this.cleanOutputDir(outputDir);
|
|
52135
52134
|
log82.info(`Cleaned output directory: ${outputDir}`);
|
|
@@ -52138,7 +52137,7 @@ var BuildCommand = class {
|
|
|
52138
52137
|
let contentDirs = await project.getContentDirs();
|
|
52139
52138
|
if (options.contentDirs && options.contentDirs.length > 0) {
|
|
52140
52139
|
const extraDirs = options.contentDirs.map(
|
|
52141
|
-
(dir2) =>
|
|
52140
|
+
(dir2) => import_path24.default.resolve(projectRoot, dir2)
|
|
52142
52141
|
);
|
|
52143
52142
|
contentDirs = [...contentDirs, ...extraDirs];
|
|
52144
52143
|
log82.info(`Added extra content directories: ${options.contentDirs.join(", ")}`);
|
|
@@ -52228,7 +52227,7 @@ var BuildCommand = class {
|
|
|
52228
52227
|
const entries = await import_fs14.promises.readdir(outputDir);
|
|
52229
52228
|
await Promise.all(
|
|
52230
52229
|
entries.map(
|
|
52231
|
-
(entry) => import_fs14.promises.rm(
|
|
52230
|
+
(entry) => import_fs14.promises.rm(import_path24.default.join(outputDir, entry), { recursive: true, force: true })
|
|
52232
52231
|
)
|
|
52233
52232
|
);
|
|
52234
52233
|
} catch (error) {
|
|
@@ -52245,7 +52244,7 @@ init_log();
|
|
|
52245
52244
|
|
|
52246
52245
|
// pkg/web/watcher/content-file-watcher.ts
|
|
52247
52246
|
var chokidar = __toESM(require("chokidar"));
|
|
52248
|
-
var
|
|
52247
|
+
var path36 = __toESM(require("path"));
|
|
52249
52248
|
var fs10 = __toESM(require("fs"));
|
|
52250
52249
|
init_log();
|
|
52251
52250
|
var log83 = getDomainLogger("web", { component: "content-file-watcher" });
|
|
@@ -52282,7 +52281,7 @@ var ContentFileWatcher = class {
|
|
|
52282
52281
|
const stats = fs10.statSync(p2);
|
|
52283
52282
|
return stats.isFile();
|
|
52284
52283
|
} catch {
|
|
52285
|
-
const ext =
|
|
52284
|
+
const ext = path36.extname(p2).toLowerCase();
|
|
52286
52285
|
return ext === ".md" || ext === ".markdown";
|
|
52287
52286
|
}
|
|
52288
52287
|
});
|
|
@@ -52324,11 +52323,11 @@ var ContentFileWatcher = class {
|
|
|
52324
52323
|
let fp = filePath;
|
|
52325
52324
|
if (this.isSingleFileMode) {
|
|
52326
52325
|
const matchedIndex = this.config.contentDirs.findIndex((contentFile) => {
|
|
52327
|
-
return
|
|
52326
|
+
return path36.normalize(filePath) === path36.normalize(contentFile);
|
|
52328
52327
|
});
|
|
52329
52328
|
if (matchedIndex !== -1) {
|
|
52330
52329
|
const projContentDir = this.config.projContentDirs[matchedIndex];
|
|
52331
|
-
fp =
|
|
52330
|
+
fp = path36.join(projContentDir, "index.md");
|
|
52332
52331
|
log83.debug("Single file event mapped", {
|
|
52333
52332
|
original: filePath,
|
|
52334
52333
|
mapped: fp
|
|
@@ -52349,7 +52348,7 @@ var ContentFileWatcher = class {
|
|
|
52349
52348
|
}
|
|
52350
52349
|
}
|
|
52351
52350
|
}
|
|
52352
|
-
const normalizedPath =
|
|
52351
|
+
const normalizedPath = path36.normalize(fp);
|
|
52353
52352
|
if (!this.isRelevantFile(normalizedPath)) {
|
|
52354
52353
|
return;
|
|
52355
52354
|
}
|
|
@@ -52367,11 +52366,11 @@ var ContentFileWatcher = class {
|
|
|
52367
52366
|
return this.isMarkdownFile(filePath) || this.isImageFile(filePath);
|
|
52368
52367
|
}
|
|
52369
52368
|
isMarkdownFile(filePath) {
|
|
52370
|
-
const ext =
|
|
52369
|
+
const ext = path36.extname(filePath).toLowerCase();
|
|
52371
52370
|
return ext === ".md" || ext === ".markdown";
|
|
52372
52371
|
}
|
|
52373
52372
|
isImageFile(filePath) {
|
|
52374
|
-
const ext =
|
|
52373
|
+
const ext = path36.extname(filePath).toLowerCase();
|
|
52375
52374
|
return [".jpg", ".jpeg", ".png", ".gif", ".svg", ".webp", ".bmp"].includes(ext);
|
|
52376
52375
|
}
|
|
52377
52376
|
scheduleBatch() {
|
|
@@ -52418,7 +52417,7 @@ var ContentFileWatcher = class {
|
|
|
52418
52417
|
|
|
52419
52418
|
// pkg/web/server/livereload-server.ts
|
|
52420
52419
|
var http3 = __toESM(require("http"));
|
|
52421
|
-
var
|
|
52420
|
+
var path37 = __toESM(require("path"));
|
|
52422
52421
|
var fs11 = __toESM(require("fs/promises"));
|
|
52423
52422
|
var import_ws = require("ws");
|
|
52424
52423
|
init_log();
|
|
@@ -52489,7 +52488,7 @@ var FoundryLiveReloadServer = class {
|
|
|
52489
52488
|
};
|
|
52490
52489
|
if (changedFiles && changedFiles.length === 1) {
|
|
52491
52490
|
const file = changedFiles[0];
|
|
52492
|
-
const ext =
|
|
52491
|
+
const ext = path37.extname(file).toLowerCase();
|
|
52493
52492
|
if (ext === ".css") {
|
|
52494
52493
|
reloadEvent.path = file;
|
|
52495
52494
|
reloadEvent.liveCSS = true;
|
|
@@ -52573,7 +52572,7 @@ var FoundryLiveReloadServer = class {
|
|
|
52573
52572
|
try {
|
|
52574
52573
|
const stats = await fs11.stat(filePath);
|
|
52575
52574
|
if (stats.isDirectory()) {
|
|
52576
|
-
const indexPath =
|
|
52575
|
+
const indexPath = path37.join(filePath, "index.html");
|
|
52577
52576
|
try {
|
|
52578
52577
|
await fs11.stat(indexPath);
|
|
52579
52578
|
filePath = indexPath;
|
|
@@ -52619,9 +52618,9 @@ var FoundryLiveReloadServer = class {
|
|
|
52619
52618
|
log84.warn("Failed to decode URL:", cleanUrl, error);
|
|
52620
52619
|
decodedUrl = cleanUrl;
|
|
52621
52620
|
}
|
|
52622
|
-
const normalizedPath =
|
|
52621
|
+
const normalizedPath = path37.normalize(decodedUrl).replace(/^(\.\.[\/\\])+/, "");
|
|
52623
52622
|
const relativePath = normalizedPath.startsWith("/") ? normalizedPath.slice(1) : normalizedPath;
|
|
52624
|
-
const resolvedPath =
|
|
52623
|
+
const resolvedPath = path37.join(this.config.publicDir, relativePath);
|
|
52625
52624
|
if (process.platform === "win32" && resolvedPath.length > 260) {
|
|
52626
52625
|
log84.warn("Path too long for Windows filesystem:", resolvedPath);
|
|
52627
52626
|
}
|
|
@@ -52634,7 +52633,7 @@ var FoundryLiveReloadServer = class {
|
|
|
52634
52633
|
return resolvedPath;
|
|
52635
52634
|
}
|
|
52636
52635
|
getContentType(filePath) {
|
|
52637
|
-
const ext =
|
|
52636
|
+
const ext = path37.extname(filePath).toLowerCase();
|
|
52638
52637
|
const mimeTypes = {
|
|
52639
52638
|
".html": "text/html; charset=utf-8",
|
|
52640
52639
|
".css": "text/css; charset=utf-8",
|
|
@@ -52728,19 +52727,19 @@ var FoundryLiveReloadServer = class {
|
|
|
52728
52727
|
shouldLiveReloadCSS(changedFiles) {
|
|
52729
52728
|
if (!changedFiles)
|
|
52730
52729
|
return false;
|
|
52731
|
-
return changedFiles.some((file) =>
|
|
52730
|
+
return changedFiles.some((file) => path37.extname(file).toLowerCase() === ".css");
|
|
52732
52731
|
}
|
|
52733
52732
|
shouldLiveReloadImages(changedFiles) {
|
|
52734
52733
|
if (!changedFiles)
|
|
52735
52734
|
return false;
|
|
52736
52735
|
const imageExts = [".jpg", ".jpeg", ".png", ".gif", ".svg", ".webp"];
|
|
52737
|
-
return changedFiles.some((file) => imageExts.includes(
|
|
52736
|
+
return changedFiles.some((file) => imageExts.includes(path37.extname(file).toLowerCase()));
|
|
52738
52737
|
}
|
|
52739
52738
|
};
|
|
52740
52739
|
|
|
52741
52740
|
// pkg/web/server/electron-livereload-server.ts
|
|
52742
52741
|
var http4 = __toESM(require("http"));
|
|
52743
|
-
var
|
|
52742
|
+
var path38 = __toESM(require("path"));
|
|
52744
52743
|
var fs12 = __toESM(require("fs/promises"));
|
|
52745
52744
|
init_log();
|
|
52746
52745
|
var log85 = getDomainLogger("web", { component: "electron-livereload-server" });
|
|
@@ -52757,7 +52756,7 @@ var ElectronLiveReloadServer = class {
|
|
|
52757
52756
|
enableLiveReload: config.enableLiveReload !== false,
|
|
52758
52757
|
publicDir: config.publicDir
|
|
52759
52758
|
};
|
|
52760
|
-
this.stateFilePath =
|
|
52759
|
+
this.stateFilePath = path38.join(this.config.publicDir, ".foundry-livereload-state.json");
|
|
52761
52760
|
}
|
|
52762
52761
|
async start() {
|
|
52763
52762
|
if (this.running) {
|
|
@@ -52810,7 +52809,7 @@ var ElectronLiveReloadServer = class {
|
|
|
52810
52809
|
};
|
|
52811
52810
|
if (changedFiles && changedFiles.length === 1) {
|
|
52812
52811
|
const file = changedFiles[0];
|
|
52813
|
-
const ext =
|
|
52812
|
+
const ext = path38.extname(file).toLowerCase();
|
|
52814
52813
|
if (ext === ".css" || [".jpg", ".jpeg", ".png", ".gif", ".svg", ".webp"].includes(ext)) {
|
|
52815
52814
|
state.path = file;
|
|
52816
52815
|
}
|
|
@@ -52894,7 +52893,7 @@ var ElectronLiveReloadServer = class {
|
|
|
52894
52893
|
try {
|
|
52895
52894
|
const stats = await fs12.stat(filePath);
|
|
52896
52895
|
if (stats.isDirectory()) {
|
|
52897
|
-
const indexPath =
|
|
52896
|
+
const indexPath = path38.join(filePath, "index.html");
|
|
52898
52897
|
try {
|
|
52899
52898
|
await fs12.stat(indexPath);
|
|
52900
52899
|
filePath = indexPath;
|
|
@@ -52940,13 +52939,13 @@ var ElectronLiveReloadServer = class {
|
|
|
52940
52939
|
log85.warn("Failed to decode URL:", cleanUrl, error);
|
|
52941
52940
|
decodedUrl = cleanUrl;
|
|
52942
52941
|
}
|
|
52943
|
-
const normalizedPath =
|
|
52942
|
+
const normalizedPath = path38.normalize(decodedUrl).replace(/^(\.\.[\/\\])+/, "");
|
|
52944
52943
|
const relativePath = normalizedPath.startsWith("/") ? normalizedPath.slice(1) : normalizedPath;
|
|
52945
|
-
const resolvedPath =
|
|
52944
|
+
const resolvedPath = path38.join(this.config.publicDir, relativePath);
|
|
52946
52945
|
return resolvedPath;
|
|
52947
52946
|
}
|
|
52948
52947
|
getContentType(filePath) {
|
|
52949
|
-
const ext =
|
|
52948
|
+
const ext = path38.extname(filePath).toLowerCase();
|
|
52950
52949
|
const mimeTypes = {
|
|
52951
52950
|
".html": "text/html; charset=utf-8",
|
|
52952
52951
|
".css": "text/css; charset=utf-8",
|
|
@@ -53066,13 +53065,13 @@ var ElectronLiveReloadServer = class {
|
|
|
53066
53065
|
shouldLiveReloadCSS(changedFiles) {
|
|
53067
53066
|
if (!changedFiles)
|
|
53068
53067
|
return false;
|
|
53069
|
-
return changedFiles.some((file) =>
|
|
53068
|
+
return changedFiles.some((file) => path38.extname(file).toLowerCase() === ".css");
|
|
53070
53069
|
}
|
|
53071
53070
|
shouldLiveReloadImages(changedFiles) {
|
|
53072
53071
|
if (!changedFiles)
|
|
53073
53072
|
return false;
|
|
53074
53073
|
const imageExts = [".jpg", ".jpeg", ".png", ".gif", ".svg", ".webp"];
|
|
53075
|
-
return changedFiles.some((file) => imageExts.includes(
|
|
53074
|
+
return changedFiles.some((file) => imageExts.includes(path38.extname(file).toLowerCase()));
|
|
53076
53075
|
}
|
|
53077
53076
|
};
|
|
53078
53077
|
|
|
@@ -55372,7 +55371,7 @@ For more information, visit: https://help.mdfriday.com
|
|
|
55372
55371
|
* Show version
|
|
55373
55372
|
*/
|
|
55374
55373
|
showVersion() {
|
|
55375
|
-
const version = "26.4.
|
|
55374
|
+
const version = "26.4.12";
|
|
55376
55375
|
return {
|
|
55377
55376
|
success: true,
|
|
55378
55377
|
message: `MDFriday CLI v${version}`
|