@absolutejs/absolute 0.19.0-beta.274 → 0.19.0-beta.276
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/angular/index.js +24 -5
- package/dist/angular/index.js.map +3 -3
- package/dist/build.js +4 -3
- package/dist/build.js.map +4 -4
- package/dist/index.js +31 -11
- package/dist/index.js.map +5 -5
- package/dist/islands/index.js +24 -5
- package/dist/islands/index.js.map +3 -3
- package/dist/islands/server.js +24 -5
- package/dist/islands/server.js.map +3 -3
- package/dist/react/index.js +24 -5
- package/dist/react/index.js.map +3 -3
- package/dist/svelte/index.js +24 -5
- package/dist/svelte/index.js.map +3 -3
- package/dist/vue/index.js +24 -5
- package/dist/vue/index.js.map +3 -3
- package/package.json +1 -1
package/dist/angular/index.js
CHANGED
|
@@ -39142,7 +39142,9 @@ var renderVueIslandToHtml = (component, props) => {
|
|
|
39142
39142
|
};
|
|
39143
39143
|
|
|
39144
39144
|
// src/core/svelteServerModule.ts
|
|
39145
|
-
import {
|
|
39145
|
+
import { mkdir } from "fs/promises";
|
|
39146
|
+
import { dirname as dirname2, extname, join as join2, relative, resolve as resolve3 } from "path";
|
|
39147
|
+
var serverCacheRoot = join2(process.cwd(), ".absolutejs", "islands", "svelte");
|
|
39146
39148
|
var compiledModuleCache = new Map;
|
|
39147
39149
|
var transpiler = new Bun.Transpiler({
|
|
39148
39150
|
loader: "ts",
|
|
@@ -39152,6 +39154,11 @@ var ensureRelativeImportPath = (from, to) => {
|
|
|
39152
39154
|
const importPath = relative(dirname2(from), to).replace(/\\/g, "/");
|
|
39153
39155
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
39154
39156
|
};
|
|
39157
|
+
var getCachedModulePath = (sourcePath) => {
|
|
39158
|
+
const relativeSourcePath = relative(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
39159
|
+
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
39160
|
+
return join2(serverCacheRoot, `${normalizedSourcePath}.server.js`);
|
|
39161
|
+
};
|
|
39155
39162
|
var resolveSvelteImport = async (spec, from) => {
|
|
39156
39163
|
if (spec.startsWith("/")) {
|
|
39157
39164
|
return spec;
|
|
@@ -39169,6 +39176,17 @@ var resolveSvelteImport = async (spec, from) => {
|
|
|
39169
39176
|
}
|
|
39170
39177
|
return null;
|
|
39171
39178
|
};
|
|
39179
|
+
var writeIfChanged = async (path, content) => {
|
|
39180
|
+
const targetFile = Bun.file(path);
|
|
39181
|
+
const exists = await targetFile.exists();
|
|
39182
|
+
if (exists) {
|
|
39183
|
+
const currentContent = await targetFile.text();
|
|
39184
|
+
if (currentContent === content) {
|
|
39185
|
+
return;
|
|
39186
|
+
}
|
|
39187
|
+
}
|
|
39188
|
+
await Bun.write(path, content);
|
|
39189
|
+
};
|
|
39172
39190
|
var compileSvelteServerModule = async (sourcePath) => {
|
|
39173
39191
|
const cachedModulePath = compiledModuleCache.get(sourcePath);
|
|
39174
39192
|
if (cachedModulePath) {
|
|
@@ -39195,10 +39213,11 @@ var compileSvelteServerModule = async (sourcePath) => {
|
|
|
39195
39213
|
generate: "server"
|
|
39196
39214
|
}).js.code;
|
|
39197
39215
|
for (const [spec, compiledChildPath] of childModulePaths) {
|
|
39198
|
-
compiledCode = compiledCode.replaceAll(spec, ensureRelativeImportPath(
|
|
39216
|
+
compiledCode = compiledCode.replaceAll(spec, ensureRelativeImportPath(getCachedModulePath(sourcePath), compiledChildPath));
|
|
39199
39217
|
}
|
|
39200
|
-
const compiledModulePath =
|
|
39201
|
-
await
|
|
39218
|
+
const compiledModulePath = getCachedModulePath(sourcePath);
|
|
39219
|
+
await mkdir(dirname2(compiledModulePath), { recursive: true });
|
|
39220
|
+
await writeIfChanged(compiledModulePath, compiledCode);
|
|
39202
39221
|
compiledModuleCache.set(sourcePath, compiledModulePath);
|
|
39203
39222
|
return compiledModulePath;
|
|
39204
39223
|
};
|
|
@@ -39416,5 +39435,5 @@ export {
|
|
|
39416
39435
|
IslandState
|
|
39417
39436
|
};
|
|
39418
39437
|
|
|
39419
|
-
//# debugId=
|
|
39438
|
+
//# debugId=ED511B5062F52F9E64756E2164756E21
|
|
39420
39439
|
//# sourceMappingURL=index.js.map
|