@absolutejs/absolute 0.19.0-beta.690 → 0.19.0-beta.691
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 +46 -38
- package/dist/angular/index.js.map +3 -3
- package/dist/angular/server.js +46 -38
- package/dist/angular/server.js.map +3 -3
- package/dist/build.js +163 -155
- package/dist/build.js.map +3 -3
- package/dist/index.js +190 -182
- package/dist/index.js.map +3 -3
- package/dist/islands/index.js +24 -16
- package/dist/islands/index.js.map +3 -3
- package/dist/react/index.js +24 -16
- package/dist/react/index.js.map +3 -3
- package/dist/svelte/index.js +27 -19
- package/dist/svelte/index.js.map +3 -3
- package/dist/svelte/server.js +24 -16
- package/dist/svelte/server.js.map +3 -3
- package/dist/vue/index.js +24 -16
- package/dist/vue/index.js.map +3 -3
- package/package.json +7 -7
package/dist/svelte/index.js
CHANGED
|
@@ -361,8 +361,9 @@ var init_lowerAwaitSlotSyntax = __esm(() => {
|
|
|
361
361
|
// src/build/stylePreprocessor.ts
|
|
362
362
|
import { readFileSync as readFileSync2 } from "fs";
|
|
363
363
|
import { readFile } from "fs/promises";
|
|
364
|
-
import {
|
|
365
|
-
|
|
364
|
+
import { createRequire } from "module";
|
|
365
|
+
import { dirname, extname, join as join2 } from "path";
|
|
366
|
+
var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATTERN, importOptionalPeer, requireOptionalPeer, requireFromCwd, isPreprocessableStylePath = (filePath) => STYLE_EXTENSION_PATTERN.test(filePath), isStyleModulePath = (filePath) => STYLE_MODULE_EXTENSION_PATTERN.test(filePath), isStylePath = (filePath) => /\.(css|s[ac]ss|less)$/i.test(filePath), getStyleBaseName = (filePath) => filePath.replace(/\.(css|s[ac]ss|less)$/i, ""), getStyleLanguage = (filePathOrLanguage) => {
|
|
366
367
|
const normalized = filePathOrLanguage.toLowerCase();
|
|
367
368
|
if (normalized === "scss" || normalized.endsWith(".scss"))
|
|
368
369
|
return "scss";
|
|
@@ -371,7 +372,13 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
|
|
|
371
372
|
if (normalized === "less" || normalized.endsWith(".less"))
|
|
372
373
|
return "less";
|
|
373
374
|
return null;
|
|
374
|
-
}, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`),
|
|
375
|
+
}, missingDependencyError = (name, filePath) => new Error(`Unable to compile ${filePath}: install optional dependency "${name}" to use this stylesheet preprocessor.`), requireOptionalPeerSync = (specifier) => {
|
|
376
|
+
try {
|
|
377
|
+
return requireFromCwd(specifier);
|
|
378
|
+
} catch {
|
|
379
|
+
return requireOptionalPeer(specifier);
|
|
380
|
+
}
|
|
381
|
+
}, compileStyleSource = async (filePath, source, languageHint) => {
|
|
375
382
|
const language = getStyleLanguage(languageHint ?? filePath);
|
|
376
383
|
const contents = source ?? await readFile(filePath, "utf-8");
|
|
377
384
|
if (language === "scss" || language === "sass") {
|
|
@@ -432,7 +439,7 @@ var STYLE_EXTENSION_PATTERN, STYLE_MODULE_EXTENSION_PATTERN, STYLE_LANGUAGE_PATT
|
|
|
432
439
|
if (language === "scss" || language === "sass") {
|
|
433
440
|
let sass;
|
|
434
441
|
try {
|
|
435
|
-
sass =
|
|
442
|
+
sass = requireOptionalPeerSync("sass");
|
|
436
443
|
} catch {
|
|
437
444
|
throw missingDependencyError("sass", filePath);
|
|
438
445
|
}
|
|
@@ -454,6 +461,7 @@ var init_stylePreprocessor = __esm(() => {
|
|
|
454
461
|
STYLE_LANGUAGE_PATTERN = /^(s[ac]ss|less)$/i;
|
|
455
462
|
importOptionalPeer = new Function("specifier", "return import(specifier)");
|
|
456
463
|
requireOptionalPeer = new Function("specifier", "return require(specifier)");
|
|
464
|
+
requireFromCwd = createRequire(join2(process.cwd(), "package.json"));
|
|
457
465
|
stylePreprocessorPlugin = {
|
|
458
466
|
name: "absolute-style-preprocessor",
|
|
459
467
|
setup(build) {
|
|
@@ -492,13 +500,13 @@ var init_stylePreprocessor = __esm(() => {
|
|
|
492
500
|
|
|
493
501
|
// src/core/svelteServerModule.ts
|
|
494
502
|
import { mkdir, readdir } from "fs/promises";
|
|
495
|
-
import { basename, dirname as dirname2, extname as extname2, join as
|
|
503
|
+
import { basename, dirname as dirname2, extname as extname2, join as join3, relative, resolve as resolve2 } from "path";
|
|
496
504
|
var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, ensureRelativeImportPath = (from, target) => {
|
|
497
505
|
const importPath = relative(dirname2(from), target).replace(/\\/g, "/");
|
|
498
506
|
return importPath.startsWith(".") ? importPath : `./${importPath}`;
|
|
499
507
|
}, processDirectoryEntries = (entries, dir, targetFileName, stack) => {
|
|
500
508
|
for (const entry of entries) {
|
|
501
|
-
const entryPath =
|
|
509
|
+
const entryPath = join3(dir, entry.name);
|
|
502
510
|
if (entry.isDirectory())
|
|
503
511
|
stack.push(entryPath);
|
|
504
512
|
if (entry.isFile() && entry.name === targetFileName) {
|
|
@@ -528,11 +536,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
528
536
|
if (cachedPath !== undefined) {
|
|
529
537
|
return cachedPath;
|
|
530
538
|
}
|
|
531
|
-
if (!sourcePath.includes(`${
|
|
539
|
+
if (!sourcePath.includes(`${join3(process.cwd(), "build")}${process.platform === "win32" ? "" : "/"}`) && !sourcePath.includes("/build/")) {
|
|
532
540
|
originalSourcePathCache.set(sourcePath, sourcePath);
|
|
533
541
|
return sourcePath;
|
|
534
542
|
}
|
|
535
|
-
const resolvedSourcePath = await findSourceFileByBasename(
|
|
543
|
+
const resolvedSourcePath = await findSourceFileByBasename(join3(process.cwd(), "src"), normalizeBuiltSvelteFileName(sourcePath));
|
|
536
544
|
const nextPath = resolvedSourcePath ?? sourcePath;
|
|
537
545
|
originalSourcePathCache.set(sourcePath, nextPath);
|
|
538
546
|
return nextPath;
|
|
@@ -548,11 +556,11 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
548
556
|
`${basePath}.mjs`,
|
|
549
557
|
`${basePath}.cjs`,
|
|
550
558
|
`${basePath}.json`,
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
559
|
+
join3(basePath, "index.ts"),
|
|
560
|
+
join3(basePath, "index.js"),
|
|
561
|
+
join3(basePath, "index.mjs"),
|
|
562
|
+
join3(basePath, "index.cjs"),
|
|
563
|
+
join3(basePath, "index.json")
|
|
556
564
|
];
|
|
557
565
|
const existResults = await Promise.all(candidates.map((candidate) => Bun.file(candidate).exists()));
|
|
558
566
|
const foundIndex = existResults.indexOf(true);
|
|
@@ -560,7 +568,7 @@ var serverCacheRoot, compiledModuleCache, originalSourcePathCache, transpiler, e
|
|
|
560
568
|
}, getCachedModulePath = (sourcePath) => {
|
|
561
569
|
const relativeSourcePath = relative(process.cwd(), sourcePath).replace(/\\/g, "/");
|
|
562
570
|
const normalizedSourcePath = relativeSourcePath.startsWith("..") ? sourcePath.replace(/[:\\/]/g, "_") : relativeSourcePath;
|
|
563
|
-
return
|
|
571
|
+
return join3(serverCacheRoot, `${normalizedSourcePath}.server.js`);
|
|
564
572
|
}, resolveSvelteImport = async (spec, from) => {
|
|
565
573
|
if (!spec.startsWith(".") && !spec.startsWith("/")) {
|
|
566
574
|
const resolved = resolvePackageImport(spec);
|
|
@@ -661,7 +669,7 @@ var init_svelteServerModule = __esm(() => {
|
|
|
661
669
|
init_lowerIslandSyntax();
|
|
662
670
|
init_lowerAwaitSlotSyntax();
|
|
663
671
|
init_stylePreprocessor();
|
|
664
|
-
serverCacheRoot =
|
|
672
|
+
serverCacheRoot = join3(process.cwd(), ".absolutejs", "islands", "svelte");
|
|
665
673
|
compiledModuleCache = new Map;
|
|
666
674
|
originalSourcePathCache = new Map;
|
|
667
675
|
transpiler = new Bun.Transpiler({
|
|
@@ -2303,7 +2311,7 @@ var init_pageHandler = __esm(() => {
|
|
|
2303
2311
|
|
|
2304
2312
|
// src/angular/injectorPatch.ts
|
|
2305
2313
|
import { existsSync as existsSync2, readFileSync as readFileSync3, writeFileSync } from "fs";
|
|
2306
|
-
import { dirname as dirname3, join as
|
|
2314
|
+
import { dirname as dirname3, join as join4, resolve as resolve3 } from "path";
|
|
2307
2315
|
var applyInjectorPatch = (chunkPath, content) => {
|
|
2308
2316
|
if (content.includes('Symbol.for("angular.currentInjector")')) {
|
|
2309
2317
|
return;
|
|
@@ -2340,14 +2348,14 @@ var applyInjectorPatch = (chunkPath, content) => {
|
|
|
2340
2348
|
writeFileSync(chunkPath, patched, "utf-8");
|
|
2341
2349
|
}, resolveAngularCoreDir = () => {
|
|
2342
2350
|
const fromProject = resolve3(process.cwd(), "node_modules/@angular/core");
|
|
2343
|
-
if (existsSync2(
|
|
2351
|
+
if (existsSync2(join4(fromProject, "package.json"))) {
|
|
2344
2352
|
return fromProject;
|
|
2345
2353
|
}
|
|
2346
2354
|
return dirname3(__require.resolve("@angular/core/package.json"));
|
|
2347
2355
|
}, patchAngularInjectorSingleton = () => {
|
|
2348
2356
|
try {
|
|
2349
2357
|
const coreDir = resolveAngularCoreDir();
|
|
2350
|
-
const chunkPath =
|
|
2358
|
+
const chunkPath = join4(coreDir, "fesm2022", "_not_found-chunk.mjs");
|
|
2351
2359
|
const content = readFileSync3(chunkPath, "utf-8");
|
|
2352
2360
|
applyInjectorPatch(chunkPath, content);
|
|
2353
2361
|
} catch {}
|
|
@@ -3180,5 +3188,5 @@ export {
|
|
|
3180
3188
|
createTypedIsland
|
|
3181
3189
|
};
|
|
3182
3190
|
|
|
3183
|
-
//# debugId=
|
|
3191
|
+
//# debugId=4EA8C6EB5ADD129764756E2164756E21
|
|
3184
3192
|
//# sourceMappingURL=index.js.map
|