@absolutejs/absolute 0.19.0-beta.192 → 0.19.0-beta.194
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { ImageProps } from '
|
|
2
|
+
import type { ImageProps } from '../../types/image';
|
|
3
3
|
import {
|
|
4
4
|
DEFAULT_QUALITY,
|
|
5
5
|
buildOptimizedUrl,
|
|
6
6
|
generateBlurSvg,
|
|
7
7
|
generateSrcSet
|
|
8
|
-
} from '../../
|
|
8
|
+
} from '../../image-client/imageClient';
|
|
9
9
|
|
|
10
10
|
let {
|
|
11
11
|
src,
|
|
@@ -106,8 +106,8 @@
|
|
|
106
106
|
};
|
|
107
107
|
</script>
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
<svelte:head>
|
|
110
|
+
{#if priority}
|
|
111
111
|
<link
|
|
112
112
|
rel="preload"
|
|
113
113
|
as="image"
|
|
@@ -116,8 +116,8 @@
|
|
|
116
116
|
imagesizes={resolvedSizes}
|
|
117
117
|
crossorigin={crossOrigin}
|
|
118
118
|
/>
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
{/if}
|
|
120
|
+
</svelte:head>
|
|
121
121
|
|
|
122
122
|
{#if fill}
|
|
123
123
|
<span style="position:relative;overflow:hidden;display:block;width:100%;height:100%">
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, ref } from 'vue';
|
|
3
|
-
import type { ImageProps } from '
|
|
3
|
+
import type { ImageProps } from '../../types/image';
|
|
4
4
|
import {
|
|
5
5
|
DEFAULT_QUALITY,
|
|
6
6
|
buildOptimizedUrl,
|
|
7
7
|
generateBlurSvg,
|
|
8
8
|
generateSrcSet
|
|
9
|
-
} from '../../
|
|
9
|
+
} from '../../image-client/imageClient';
|
|
10
10
|
|
|
11
11
|
const props = withDefaults(defineProps<ImageProps>(), {
|
|
12
12
|
quality: DEFAULT_QUALITY,
|
package/package.json
CHANGED
package/scripts/build.ts
CHANGED
|
@@ -97,22 +97,32 @@ async function build() {
|
|
|
97
97
|
await mkdir(join(DIST, "dev"), { recursive: true });
|
|
98
98
|
await cp("src/dev/client", join(DIST, "dev", "client"), { recursive: true });
|
|
99
99
|
|
|
100
|
+
// Copy .svelte and .vue SFC files, rewriting relative imports to match
|
|
101
|
+
// dist/ layout. Source files import from e.g. "../../utils/imageProcessing"
|
|
102
|
+
// which resolves in src/ but not in dist/ (where JS lands under dist/src/).
|
|
103
|
+
const rewriteSfcImports = (content: string) =>
|
|
104
|
+
content
|
|
105
|
+
.replace(
|
|
106
|
+
/from\s+(['"])\.\.\/\.\.\/utils\/imageProcessing['"]/g,
|
|
107
|
+
"from $1../../image-client/imageClient$1",
|
|
108
|
+
)
|
|
109
|
+
.replace(
|
|
110
|
+
/from\s+(['"])\.\.\/\.\.\/\.\.\/types\//g,
|
|
111
|
+
"from $1../../types/",
|
|
112
|
+
);
|
|
113
|
+
|
|
100
114
|
await mkdir(join(DIST, "svelte", "components"), { recursive: true });
|
|
101
115
|
const svelteFiles = await readdir("src/svelte/components");
|
|
102
116
|
for (const file of svelteFiles.filter((f) => f.endsWith(".svelte"))) {
|
|
103
|
-
await
|
|
104
|
-
|
|
105
|
-
join(DIST, "svelte", "components", file),
|
|
106
|
-
);
|
|
117
|
+
const content = await Bun.file(join("src", "svelte", "components", file)).text();
|
|
118
|
+
await Bun.write(join(DIST, "svelte", "components", file), rewriteSfcImports(content));
|
|
107
119
|
}
|
|
108
120
|
|
|
109
121
|
await mkdir(join(DIST, "vue", "components"), { recursive: true });
|
|
110
122
|
const vueFiles = await readdir("src/vue/components");
|
|
111
123
|
for (const file of vueFiles.filter((f) => f.endsWith(".vue"))) {
|
|
112
|
-
await
|
|
113
|
-
|
|
114
|
-
join(DIST, "vue", "components", file),
|
|
115
|
-
);
|
|
124
|
+
const content = await Bun.file(join("src", "vue", "components", file)).text();
|
|
125
|
+
await Bun.write(join(DIST, "vue", "components", file), rewriteSfcImports(content));
|
|
116
126
|
}
|
|
117
127
|
|
|
118
128
|
console.log("Verifying exports...");
|