@farm.js/core 0.1.14 → 0.1.15
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/{chunk-U6CRU23N.mjs → chunk-FBHGHMOA.mjs} +1 -1
- package/dist/{chunk-J2F5LFQ2.mjs → chunk-JRF3C33L.mjs} +171 -5
- package/dist/{chunk-DNCKVMSV.mjs → chunk-UE75PB52.mjs} +1 -1
- package/dist/index.cjs +172 -6
- package/dist/index.mjs +3 -3
- package/dist/internal/build-runtime.cjs +172 -6
- package/dist/internal/build-runtime.mjs +3 -3
- package/dist/internal/client-error-overlay.cjs +1 -1
- package/dist/internal/client-error-overlay.mjs +1 -1
- package/dist/internal/product-telemetry-runtime.cjs +1 -1
- package/dist/internal/product-telemetry-runtime.mjs +1 -1
- package/dist/plugin.cjs +171 -5
- package/dist/plugin.mjs +2 -2
- package/dist/server.cjs +171 -5
- package/dist/server.mjs +2 -2
- package/dist/version.cjs +1 -1
- package/dist/version.mjs +1 -1
- package/dist/vite.cjs +171 -5
- package/dist/vite.mjs +2 -2
- package/package.json +3 -3
package/dist/server.cjs
CHANGED
|
@@ -23836,9 +23836,10 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
|
|
|
23836
23836
|
const importedBindings = getStaticImportBindings(content);
|
|
23837
23837
|
let estimatedBoundaryCount2 = 0;
|
|
23838
23838
|
for (const specifier of new Set(getImportSpecifiers(content))) {
|
|
23839
|
-
const
|
|
23839
|
+
const imported = resolveImportedModule(moduleSourcePath, specifier, root);
|
|
23840
|
+
const importedPath = imported.path;
|
|
23840
23841
|
if (!importedPath) continue;
|
|
23841
|
-
if (!
|
|
23842
|
+
if (!imported.local) {
|
|
23842
23843
|
const packageMetadata = inspectPackageClientBoundary(importedPath, root, /* @__PURE__ */ new Set());
|
|
23843
23844
|
if (packageMetadata.shouldHydrate) {
|
|
23844
23845
|
if (options.staticPackageBoundaries) {
|
|
@@ -23907,8 +23908,8 @@ function inspectClientModuleMetadata(resolvedPath, root, visited, inspectIslandE
|
|
|
23907
23908
|
let importsClientBoundary = false;
|
|
23908
23909
|
let importedIslandStrategy = null;
|
|
23909
23910
|
for (const specifier of getImportSpecifiers(content)) {
|
|
23910
|
-
const
|
|
23911
|
-
const importedMetadata =
|
|
23911
|
+
const imported = resolveImportedModule(resolvedPath, specifier, root);
|
|
23912
|
+
const importedMetadata = imported.local ? inspectClientModuleMetadata(imported.path, root, visited, false) : inspectPackageClientBoundary(imported.path, root, visited);
|
|
23912
23913
|
if (importedMetadata.isClientComponent || importedMetadata.shouldHydrate) {
|
|
23913
23914
|
importsClientBoundary = true;
|
|
23914
23915
|
if (importedIslandStrategy === null) {
|
|
@@ -24037,6 +24038,171 @@ function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
|
|
|
24037
24038
|
return true;
|
|
24038
24039
|
}
|
|
24039
24040
|
__name(isTypeOnlyNamedClause, "isTypeOnlyNamedClause");
|
|
24041
|
+
function resolveImportedModule(importerPath, specifier, root) {
|
|
24042
|
+
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
24043
|
+
return { path: resolveImportedModuleSourcePath(importerPath, specifier, root), local: true };
|
|
24044
|
+
}
|
|
24045
|
+
const aliased = resolveProjectAliasSourcePath(specifier, root);
|
|
24046
|
+
if (aliased !== void 0) return { path: aliased, local: true };
|
|
24047
|
+
return { path: resolvePackageModuleSourcePath(importerPath, specifier, root), local: false };
|
|
24048
|
+
}
|
|
24049
|
+
__name(resolveImportedModule, "resolveImportedModule");
|
|
24050
|
+
var projectImportAliasCache = /* @__PURE__ */ new Map();
|
|
24051
|
+
var PROJECT_ALIAS_FILES = ["tsconfig.json", "jsconfig.json", "package.json"];
|
|
24052
|
+
function resolveProjectAliasSourcePath(specifier, root) {
|
|
24053
|
+
if (!root) return void 0;
|
|
24054
|
+
const projectRoot = import_path4.default.resolve(root);
|
|
24055
|
+
let match;
|
|
24056
|
+
for (const alias of getProjectImportAliases(projectRoot)) {
|
|
24057
|
+
const captured = matchProjectImportAlias(alias, specifier);
|
|
24058
|
+
if (captured === null) continue;
|
|
24059
|
+
if (!match || alias.prefix.length > match.alias.prefix.length) match = { alias, captured };
|
|
24060
|
+
}
|
|
24061
|
+
if (!match) return void 0;
|
|
24062
|
+
return resolveSourceCandidate(
|
|
24063
|
+
match.alias.targets.map(
|
|
24064
|
+
(target) => import_path4.default.normalize(match.alias.wildcard ? target.replace("*", match.captured) : target)
|
|
24065
|
+
)
|
|
24066
|
+
);
|
|
24067
|
+
}
|
|
24068
|
+
__name(resolveProjectAliasSourcePath, "resolveProjectAliasSourcePath");
|
|
24069
|
+
function matchProjectImportAlias(alias, specifier) {
|
|
24070
|
+
if (!alias.wildcard) return specifier === alias.prefix ? "" : null;
|
|
24071
|
+
if (specifier.length < alias.prefix.length + alias.suffix.length || !specifier.startsWith(alias.prefix) || !specifier.endsWith(alias.suffix)) {
|
|
24072
|
+
return null;
|
|
24073
|
+
}
|
|
24074
|
+
return specifier.slice(alias.prefix.length, specifier.length - alias.suffix.length);
|
|
24075
|
+
}
|
|
24076
|
+
__name(matchProjectImportAlias, "matchProjectImportAlias");
|
|
24077
|
+
function getProjectImportAliases(projectRoot) {
|
|
24078
|
+
const stamp = PROJECT_ALIAS_FILES.map((file) => {
|
|
24079
|
+
try {
|
|
24080
|
+
return String(import_fs2.default.statSync(import_path4.default.join(projectRoot, file)).mtimeMs);
|
|
24081
|
+
} catch {
|
|
24082
|
+
return "-";
|
|
24083
|
+
}
|
|
24084
|
+
}).join(":");
|
|
24085
|
+
const cached = projectImportAliasCache.get(projectRoot);
|
|
24086
|
+
if (cached?.stamp === stamp) return cached.aliases;
|
|
24087
|
+
const aliases = [
|
|
24088
|
+
...readTsconfigPathAliases(projectRoot),
|
|
24089
|
+
...readPackageImportAliases(projectRoot)
|
|
24090
|
+
];
|
|
24091
|
+
if (!aliases.some((alias) => alias.prefix === "@/")) {
|
|
24092
|
+
aliases.push({
|
|
24093
|
+
prefix: "@/",
|
|
24094
|
+
suffix: "",
|
|
24095
|
+
wildcard: true,
|
|
24096
|
+
targets: [import_path4.default.join(projectRoot, "src", "*")]
|
|
24097
|
+
});
|
|
24098
|
+
}
|
|
24099
|
+
projectImportAliasCache.set(projectRoot, { stamp, aliases });
|
|
24100
|
+
return aliases;
|
|
24101
|
+
}
|
|
24102
|
+
__name(getProjectImportAliases, "getProjectImportAliases");
|
|
24103
|
+
function readTsconfigPathAliases(projectRoot) {
|
|
24104
|
+
for (const name2 of ["tsconfig.json", "jsconfig.json"]) {
|
|
24105
|
+
const configPath = import_path4.default.join(projectRoot, name2);
|
|
24106
|
+
if (!import_fs2.default.existsSync(configPath)) continue;
|
|
24107
|
+
const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
|
|
24108
|
+
if (!resolved?.paths) return [];
|
|
24109
|
+
const base = resolved.baseUrl ?? resolved.pathsDirectory;
|
|
24110
|
+
return Object.entries(resolved.paths).flatMap(([pattern, targets]) => {
|
|
24111
|
+
if (!Array.isArray(targets)) return [];
|
|
24112
|
+
const wildcardIndex = pattern.indexOf("*");
|
|
24113
|
+
return [
|
|
24114
|
+
{
|
|
24115
|
+
prefix: wildcardIndex === -1 ? pattern : pattern.slice(0, wildcardIndex),
|
|
24116
|
+
suffix: wildcardIndex === -1 ? "" : pattern.slice(wildcardIndex + 1),
|
|
24117
|
+
wildcard: wildcardIndex !== -1,
|
|
24118
|
+
targets: targets.filter((target) => typeof target === "string").map((target) => import_path4.default.resolve(base, target))
|
|
24119
|
+
}
|
|
24120
|
+
];
|
|
24121
|
+
});
|
|
24122
|
+
}
|
|
24123
|
+
return [];
|
|
24124
|
+
}
|
|
24125
|
+
__name(readTsconfigPathAliases, "readTsconfigPathAliases");
|
|
24126
|
+
function readTsconfigPaths(configPath, visited) {
|
|
24127
|
+
if (visited.has(configPath)) return null;
|
|
24128
|
+
visited.add(configPath);
|
|
24129
|
+
const config = readJsonWithComments(configPath);
|
|
24130
|
+
if (!config) return null;
|
|
24131
|
+
const directory = import_path4.default.dirname(configPath);
|
|
24132
|
+
const parents = (Array.isArray(config.extends) ? config.extends : [config.extends]).filter(
|
|
24133
|
+
(parent) => typeof parent === "string" && parent.startsWith(".")
|
|
24134
|
+
);
|
|
24135
|
+
let inherited = null;
|
|
24136
|
+
for (const parent of parents) {
|
|
24137
|
+
const parentPath = import_path4.default.resolve(
|
|
24138
|
+
directory,
|
|
24139
|
+
parent.endsWith(".json") ? parent : `${parent}.json`
|
|
24140
|
+
);
|
|
24141
|
+
inherited = readTsconfigPaths(parentPath, visited) ?? inherited;
|
|
24142
|
+
}
|
|
24143
|
+
const options = config.compilerOptions ?? {};
|
|
24144
|
+
const baseUrl = typeof options.baseUrl === "string" ? import_path4.default.resolve(directory, options.baseUrl) : inherited?.baseUrl;
|
|
24145
|
+
if (options.paths && typeof options.paths === "object") {
|
|
24146
|
+
return { paths: options.paths, pathsDirectory: directory, baseUrl };
|
|
24147
|
+
}
|
|
24148
|
+
return inherited ? { ...inherited, baseUrl } : { pathsDirectory: directory, baseUrl };
|
|
24149
|
+
}
|
|
24150
|
+
__name(readTsconfigPaths, "readTsconfigPaths");
|
|
24151
|
+
function readPackageImportAliases(projectRoot) {
|
|
24152
|
+
const imports = readPackageJson(import_path4.default.join(projectRoot, "package.json"))?.imports;
|
|
24153
|
+
if (!imports || typeof imports !== "object") return [];
|
|
24154
|
+
return Object.entries(imports).flatMap(([pattern, value]) => {
|
|
24155
|
+
const target = resolveConditionalExportTarget(value);
|
|
24156
|
+
if (!pattern.startsWith("#") || !target?.startsWith("./")) return [];
|
|
24157
|
+
const wildcardIndex = pattern.indexOf("*");
|
|
24158
|
+
return [
|
|
24159
|
+
{
|
|
24160
|
+
prefix: wildcardIndex === -1 ? pattern : pattern.slice(0, wildcardIndex),
|
|
24161
|
+
suffix: wildcardIndex === -1 ? "" : pattern.slice(wildcardIndex + 1),
|
|
24162
|
+
wildcard: wildcardIndex !== -1,
|
|
24163
|
+
targets: [import_path4.default.resolve(projectRoot, target)]
|
|
24164
|
+
}
|
|
24165
|
+
];
|
|
24166
|
+
});
|
|
24167
|
+
}
|
|
24168
|
+
__name(readPackageImportAliases, "readPackageImportAliases");
|
|
24169
|
+
function readJsonWithComments(filePath) {
|
|
24170
|
+
let source;
|
|
24171
|
+
try {
|
|
24172
|
+
source = import_fs2.default.readFileSync(filePath, "utf8");
|
|
24173
|
+
} catch {
|
|
24174
|
+
return null;
|
|
24175
|
+
}
|
|
24176
|
+
let output = "";
|
|
24177
|
+
let inString = false;
|
|
24178
|
+
for (let index = 0; index < source.length; index++) {
|
|
24179
|
+
const char = source[index];
|
|
24180
|
+
if (inString) {
|
|
24181
|
+
output += char;
|
|
24182
|
+
if (char === "\\") output += source[++index] ?? "";
|
|
24183
|
+
else if (char === '"') inString = false;
|
|
24184
|
+
continue;
|
|
24185
|
+
}
|
|
24186
|
+
if (char === '"') {
|
|
24187
|
+
inString = true;
|
|
24188
|
+
output += char;
|
|
24189
|
+
} else if (char === "/" && source[index + 1] === "/") {
|
|
24190
|
+
while (index < source.length && source[index] !== "\n") index++;
|
|
24191
|
+
output += "\n";
|
|
24192
|
+
} else if (char === "/" && source[index + 1] === "*") {
|
|
24193
|
+
const end = source.indexOf("*/", index + 2);
|
|
24194
|
+
index = end === -1 ? source.length : end + 1;
|
|
24195
|
+
} else {
|
|
24196
|
+
output += char;
|
|
24197
|
+
}
|
|
24198
|
+
}
|
|
24199
|
+
try {
|
|
24200
|
+
return JSON.parse(output.replace(/,(\s*[}\]])/g, "$1"));
|
|
24201
|
+
} catch {
|
|
24202
|
+
return null;
|
|
24203
|
+
}
|
|
24204
|
+
}
|
|
24205
|
+
__name(readJsonWithComments, "readJsonWithComments");
|
|
24040
24206
|
function resolveImportedModuleSourcePath(importerPath, specifier, root) {
|
|
24041
24207
|
if (!specifier.startsWith(".") && !specifier.startsWith("/")) {
|
|
24042
24208
|
return resolvePackageModuleSourcePath(importerPath, specifier, root);
|
|
@@ -29503,7 +29669,7 @@ _setFarmThemeServerSnapshotResolver(() => {
|
|
|
29503
29669
|
});
|
|
29504
29670
|
|
|
29505
29671
|
// package.json
|
|
29506
|
-
var version = "0.1.
|
|
29672
|
+
var version = "0.1.15";
|
|
29507
29673
|
|
|
29508
29674
|
// src/version.ts
|
|
29509
29675
|
var FARM_VERSION = version;
|
package/dist/server.mjs
CHANGED
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
farmPlugin,
|
|
41
41
|
farmServerOnlyEntriesPlugin,
|
|
42
42
|
mergeFarmViteConfig
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-JRF3C33L.mjs";
|
|
44
44
|
import "./chunk-27JNCYEK.mjs";
|
|
45
45
|
import {
|
|
46
46
|
readSchemaTables
|
|
@@ -188,7 +188,7 @@ import {
|
|
|
188
188
|
} from "./chunk-Z2RZJZIZ.mjs";
|
|
189
189
|
import {
|
|
190
190
|
FARM_VERSION
|
|
191
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-UE75PB52.mjs";
|
|
192
192
|
import "./chunk-54UPOYFS.mjs";
|
|
193
193
|
import "./chunk-WNSDDRNU.mjs";
|
|
194
194
|
import "./chunk-JPLUGGRV.mjs";
|
package/dist/version.cjs
CHANGED
package/dist/version.mjs
CHANGED
package/dist/vite.cjs
CHANGED
|
@@ -19260,9 +19260,10 @@ function collectIsolatedClientBoundaries(ownerPath, root, options = {}) {
|
|
|
19260
19260
|
const importedBindings = getStaticImportBindings(content);
|
|
19261
19261
|
let estimatedBoundaryCount2 = 0;
|
|
19262
19262
|
for (const specifier of new Set(getImportSpecifiers(content))) {
|
|
19263
|
-
const
|
|
19263
|
+
const imported = resolveImportedModule(moduleSourcePath, specifier, root);
|
|
19264
|
+
const importedPath = imported.path;
|
|
19264
19265
|
if (!importedPath) continue;
|
|
19265
|
-
if (!
|
|
19266
|
+
if (!imported.local) {
|
|
19266
19267
|
const packageMetadata = inspectPackageClientBoundary(importedPath, root, /* @__PURE__ */ new Set());
|
|
19267
19268
|
if (packageMetadata.shouldHydrate) {
|
|
19268
19269
|
if (options.staticPackageBoundaries) {
|
|
@@ -19331,8 +19332,8 @@ function inspectClientModuleMetadata(resolvedPath, root, visited, inspectIslandE
|
|
|
19331
19332
|
let importsClientBoundary = false;
|
|
19332
19333
|
let importedIslandStrategy = null;
|
|
19333
19334
|
for (const specifier of getImportSpecifiers(content)) {
|
|
19334
|
-
const
|
|
19335
|
-
const importedMetadata =
|
|
19335
|
+
const imported = resolveImportedModule(resolvedPath, specifier, root);
|
|
19336
|
+
const importedMetadata = imported.local ? inspectClientModuleMetadata(imported.path, root, visited, false) : inspectPackageClientBoundary(imported.path, root, visited);
|
|
19336
19337
|
if (importedMetadata.isClientComponent || importedMetadata.shouldHydrate) {
|
|
19337
19338
|
importsClientBoundary = true;
|
|
19338
19339
|
if (importedIslandStrategy === null) {
|
|
@@ -19461,6 +19462,171 @@ function isTypeOnlyNamedClause(tokens, startIndex, endIndex) {
|
|
|
19461
19462
|
return true;
|
|
19462
19463
|
}
|
|
19463
19464
|
__name(isTypeOnlyNamedClause, "isTypeOnlyNamedClause");
|
|
19465
|
+
function resolveImportedModule(importerPath, specifier, root) {
|
|
19466
|
+
if (specifier.startsWith(".") || specifier.startsWith("/")) {
|
|
19467
|
+
return { path: resolveImportedModuleSourcePath(importerPath, specifier, root), local: true };
|
|
19468
|
+
}
|
|
19469
|
+
const aliased = resolveProjectAliasSourcePath(specifier, root);
|
|
19470
|
+
if (aliased !== void 0) return { path: aliased, local: true };
|
|
19471
|
+
return { path: resolvePackageModuleSourcePath(importerPath, specifier, root), local: false };
|
|
19472
|
+
}
|
|
19473
|
+
__name(resolveImportedModule, "resolveImportedModule");
|
|
19474
|
+
var projectImportAliasCache = /* @__PURE__ */ new Map();
|
|
19475
|
+
var PROJECT_ALIAS_FILES = ["tsconfig.json", "jsconfig.json", "package.json"];
|
|
19476
|
+
function resolveProjectAliasSourcePath(specifier, root) {
|
|
19477
|
+
if (!root) return void 0;
|
|
19478
|
+
const projectRoot = import_path4.default.resolve(root);
|
|
19479
|
+
let match;
|
|
19480
|
+
for (const alias of getProjectImportAliases(projectRoot)) {
|
|
19481
|
+
const captured = matchProjectImportAlias(alias, specifier);
|
|
19482
|
+
if (captured === null) continue;
|
|
19483
|
+
if (!match || alias.prefix.length > match.alias.prefix.length) match = { alias, captured };
|
|
19484
|
+
}
|
|
19485
|
+
if (!match) return void 0;
|
|
19486
|
+
return resolveSourceCandidate(
|
|
19487
|
+
match.alias.targets.map(
|
|
19488
|
+
(target) => import_path4.default.normalize(match.alias.wildcard ? target.replace("*", match.captured) : target)
|
|
19489
|
+
)
|
|
19490
|
+
);
|
|
19491
|
+
}
|
|
19492
|
+
__name(resolveProjectAliasSourcePath, "resolveProjectAliasSourcePath");
|
|
19493
|
+
function matchProjectImportAlias(alias, specifier) {
|
|
19494
|
+
if (!alias.wildcard) return specifier === alias.prefix ? "" : null;
|
|
19495
|
+
if (specifier.length < alias.prefix.length + alias.suffix.length || !specifier.startsWith(alias.prefix) || !specifier.endsWith(alias.suffix)) {
|
|
19496
|
+
return null;
|
|
19497
|
+
}
|
|
19498
|
+
return specifier.slice(alias.prefix.length, specifier.length - alias.suffix.length);
|
|
19499
|
+
}
|
|
19500
|
+
__name(matchProjectImportAlias, "matchProjectImportAlias");
|
|
19501
|
+
function getProjectImportAliases(projectRoot) {
|
|
19502
|
+
const stamp = PROJECT_ALIAS_FILES.map((file) => {
|
|
19503
|
+
try {
|
|
19504
|
+
return String(import_fs2.default.statSync(import_path4.default.join(projectRoot, file)).mtimeMs);
|
|
19505
|
+
} catch {
|
|
19506
|
+
return "-";
|
|
19507
|
+
}
|
|
19508
|
+
}).join(":");
|
|
19509
|
+
const cached = projectImportAliasCache.get(projectRoot);
|
|
19510
|
+
if (cached?.stamp === stamp) return cached.aliases;
|
|
19511
|
+
const aliases = [
|
|
19512
|
+
...readTsconfigPathAliases(projectRoot),
|
|
19513
|
+
...readPackageImportAliases(projectRoot)
|
|
19514
|
+
];
|
|
19515
|
+
if (!aliases.some((alias) => alias.prefix === "@/")) {
|
|
19516
|
+
aliases.push({
|
|
19517
|
+
prefix: "@/",
|
|
19518
|
+
suffix: "",
|
|
19519
|
+
wildcard: true,
|
|
19520
|
+
targets: [import_path4.default.join(projectRoot, "src", "*")]
|
|
19521
|
+
});
|
|
19522
|
+
}
|
|
19523
|
+
projectImportAliasCache.set(projectRoot, { stamp, aliases });
|
|
19524
|
+
return aliases;
|
|
19525
|
+
}
|
|
19526
|
+
__name(getProjectImportAliases, "getProjectImportAliases");
|
|
19527
|
+
function readTsconfigPathAliases(projectRoot) {
|
|
19528
|
+
for (const name2 of ["tsconfig.json", "jsconfig.json"]) {
|
|
19529
|
+
const configPath = import_path4.default.join(projectRoot, name2);
|
|
19530
|
+
if (!import_fs2.default.existsSync(configPath)) continue;
|
|
19531
|
+
const resolved = readTsconfigPaths(configPath, /* @__PURE__ */ new Set());
|
|
19532
|
+
if (!resolved?.paths) return [];
|
|
19533
|
+
const base = resolved.baseUrl ?? resolved.pathsDirectory;
|
|
19534
|
+
return Object.entries(resolved.paths).flatMap(([pattern, targets]) => {
|
|
19535
|
+
if (!Array.isArray(targets)) return [];
|
|
19536
|
+
const wildcardIndex = pattern.indexOf("*");
|
|
19537
|
+
return [
|
|
19538
|
+
{
|
|
19539
|
+
prefix: wildcardIndex === -1 ? pattern : pattern.slice(0, wildcardIndex),
|
|
19540
|
+
suffix: wildcardIndex === -1 ? "" : pattern.slice(wildcardIndex + 1),
|
|
19541
|
+
wildcard: wildcardIndex !== -1,
|
|
19542
|
+
targets: targets.filter((target) => typeof target === "string").map((target) => import_path4.default.resolve(base, target))
|
|
19543
|
+
}
|
|
19544
|
+
];
|
|
19545
|
+
});
|
|
19546
|
+
}
|
|
19547
|
+
return [];
|
|
19548
|
+
}
|
|
19549
|
+
__name(readTsconfigPathAliases, "readTsconfigPathAliases");
|
|
19550
|
+
function readTsconfigPaths(configPath, visited) {
|
|
19551
|
+
if (visited.has(configPath)) return null;
|
|
19552
|
+
visited.add(configPath);
|
|
19553
|
+
const config = readJsonWithComments(configPath);
|
|
19554
|
+
if (!config) return null;
|
|
19555
|
+
const directory = import_path4.default.dirname(configPath);
|
|
19556
|
+
const parents = (Array.isArray(config.extends) ? config.extends : [config.extends]).filter(
|
|
19557
|
+
(parent) => typeof parent === "string" && parent.startsWith(".")
|
|
19558
|
+
);
|
|
19559
|
+
let inherited = null;
|
|
19560
|
+
for (const parent of parents) {
|
|
19561
|
+
const parentPath = import_path4.default.resolve(
|
|
19562
|
+
directory,
|
|
19563
|
+
parent.endsWith(".json") ? parent : `${parent}.json`
|
|
19564
|
+
);
|
|
19565
|
+
inherited = readTsconfigPaths(parentPath, visited) ?? inherited;
|
|
19566
|
+
}
|
|
19567
|
+
const options = config.compilerOptions ?? {};
|
|
19568
|
+
const baseUrl = typeof options.baseUrl === "string" ? import_path4.default.resolve(directory, options.baseUrl) : inherited?.baseUrl;
|
|
19569
|
+
if (options.paths && typeof options.paths === "object") {
|
|
19570
|
+
return { paths: options.paths, pathsDirectory: directory, baseUrl };
|
|
19571
|
+
}
|
|
19572
|
+
return inherited ? { ...inherited, baseUrl } : { pathsDirectory: directory, baseUrl };
|
|
19573
|
+
}
|
|
19574
|
+
__name(readTsconfigPaths, "readTsconfigPaths");
|
|
19575
|
+
function readPackageImportAliases(projectRoot) {
|
|
19576
|
+
const imports = readPackageJson(import_path4.default.join(projectRoot, "package.json"))?.imports;
|
|
19577
|
+
if (!imports || typeof imports !== "object") return [];
|
|
19578
|
+
return Object.entries(imports).flatMap(([pattern, value]) => {
|
|
19579
|
+
const target = resolveConditionalExportTarget(value);
|
|
19580
|
+
if (!pattern.startsWith("#") || !target?.startsWith("./")) return [];
|
|
19581
|
+
const wildcardIndex = pattern.indexOf("*");
|
|
19582
|
+
return [
|
|
19583
|
+
{
|
|
19584
|
+
prefix: wildcardIndex === -1 ? pattern : pattern.slice(0, wildcardIndex),
|
|
19585
|
+
suffix: wildcardIndex === -1 ? "" : pattern.slice(wildcardIndex + 1),
|
|
19586
|
+
wildcard: wildcardIndex !== -1,
|
|
19587
|
+
targets: [import_path4.default.resolve(projectRoot, target)]
|
|
19588
|
+
}
|
|
19589
|
+
];
|
|
19590
|
+
});
|
|
19591
|
+
}
|
|
19592
|
+
__name(readPackageImportAliases, "readPackageImportAliases");
|
|
19593
|
+
function readJsonWithComments(filePath) {
|
|
19594
|
+
let source;
|
|
19595
|
+
try {
|
|
19596
|
+
source = import_fs2.default.readFileSync(filePath, "utf8");
|
|
19597
|
+
} catch {
|
|
19598
|
+
return null;
|
|
19599
|
+
}
|
|
19600
|
+
let output = "";
|
|
19601
|
+
let inString = false;
|
|
19602
|
+
for (let index = 0; index < source.length; index++) {
|
|
19603
|
+
const char = source[index];
|
|
19604
|
+
if (inString) {
|
|
19605
|
+
output += char;
|
|
19606
|
+
if (char === "\\") output += source[++index] ?? "";
|
|
19607
|
+
else if (char === '"') inString = false;
|
|
19608
|
+
continue;
|
|
19609
|
+
}
|
|
19610
|
+
if (char === '"') {
|
|
19611
|
+
inString = true;
|
|
19612
|
+
output += char;
|
|
19613
|
+
} else if (char === "/" && source[index + 1] === "/") {
|
|
19614
|
+
while (index < source.length && source[index] !== "\n") index++;
|
|
19615
|
+
output += "\n";
|
|
19616
|
+
} else if (char === "/" && source[index + 1] === "*") {
|
|
19617
|
+
const end = source.indexOf("*/", index + 2);
|
|
19618
|
+
index = end === -1 ? source.length : end + 1;
|
|
19619
|
+
} else {
|
|
19620
|
+
output += char;
|
|
19621
|
+
}
|
|
19622
|
+
}
|
|
19623
|
+
try {
|
|
19624
|
+
return JSON.parse(output.replace(/,(\s*[}\]])/g, "$1"));
|
|
19625
|
+
} catch {
|
|
19626
|
+
return null;
|
|
19627
|
+
}
|
|
19628
|
+
}
|
|
19629
|
+
__name(readJsonWithComments, "readJsonWithComments");
|
|
19464
19630
|
function resolveImportedModuleSourcePath(importerPath, specifier, root) {
|
|
19465
19631
|
if (!specifier.startsWith(".") && !specifier.startsWith("/")) {
|
|
19466
19632
|
return resolvePackageModuleSourcePath(importerPath, specifier, root);
|
|
@@ -24913,7 +25079,7 @@ _setFarmThemeServerSnapshotResolver(() => {
|
|
|
24913
25079
|
});
|
|
24914
25080
|
|
|
24915
25081
|
// package.json
|
|
24916
|
-
var version = "0.1.
|
|
25082
|
+
var version = "0.1.15";
|
|
24917
25083
|
|
|
24918
25084
|
// src/version.ts
|
|
24919
25085
|
var FARM_VERSION = version;
|
package/dist/vite.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
shouldEmitFarmClientRootHmr,
|
|
10
10
|
transformIsolatedClientBoundaryModule,
|
|
11
11
|
withFarmRequestTracing
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JRF3C33L.mjs";
|
|
13
13
|
import "./chunk-27JNCYEK.mjs";
|
|
14
14
|
import "./chunk-DHDVMXYK.mjs";
|
|
15
15
|
import "./chunk-ZMSZZXOR.mjs";
|
|
@@ -76,7 +76,7 @@ import "./chunk-YMCXWPWK.mjs";
|
|
|
76
76
|
import "./chunk-KI3MESHB.mjs";
|
|
77
77
|
import "./chunk-QVKYGNVM.mjs";
|
|
78
78
|
import "./chunk-Z2RZJZIZ.mjs";
|
|
79
|
-
import "./chunk-
|
|
79
|
+
import "./chunk-UE75PB52.mjs";
|
|
80
80
|
import "./chunk-54UPOYFS.mjs";
|
|
81
81
|
import "./chunk-WNSDDRNU.mjs";
|
|
82
82
|
import "./chunk-JPLUGGRV.mjs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farm.js/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Core Farm.js framework for modern integrated apps",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@farm.js/core",
|
|
@@ -675,8 +675,8 @@
|
|
|
675
675
|
},
|
|
676
676
|
"dependencies": {
|
|
677
677
|
"@farming-labs/docs": "^0.2.118",
|
|
678
|
-
"@farming-labs/orm": "0.0.
|
|
679
|
-
"@farming-labs/orm-runtime": "0.0.
|
|
678
|
+
"@farming-labs/orm": "0.0.64",
|
|
679
|
+
"@farming-labs/orm-runtime": "0.0.64",
|
|
680
680
|
"@formatjs/icu-messageformat-parser": "3.5.15",
|
|
681
681
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
682
682
|
"@mdx-js/mdx": "^3.1.1",
|