@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,5 +1,5 @@
1
1
  <script lang="ts">
2
- import type { Metadata, RobotsDirective } from '../../../types/metadata';
2
+ import type { Metadata, RobotsDirective } from '../../types/metadata';
3
3
 
4
4
  let {
5
5
  title = 'AbsoluteJS',
@@ -1,11 +1,11 @@
1
1
  <script lang="ts">
2
- import type { ImageProps } from '../../../types/image';
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 '../../utils/imageProcessing';
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
- {#if priority}
110
- <svelte:head>
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
- </svelte:head>
120
- {/if}
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,5 +1,5 @@
1
1
  <script lang="ts">
2
- import type { JsonLdSchema, WithContext } from '../../../types/jsonLd';
2
+ import type { JsonLdSchema, WithContext } from '../../types/jsonLd';
3
3
 
4
4
  let { schema }: { schema: JsonLdSchema | JsonLdSchema[] } = $props();
5
5
 
@@ -1,12 +1,12 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref } from 'vue';
3
- import type { ImageProps } from '../../../types/image';
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 '../../utils/imageProcessing';
9
+ } from '../../image-client/imageClient';
10
10
 
11
11
  const props = withDefaults(defineProps<ImageProps>(), {
12
12
  quality: DEFAULT_QUALITY,
package/package.json CHANGED
@@ -208,5 +208,5 @@
208
208
  "typecheck": "bun run vue-tsc --noEmit"
209
209
  },
210
210
  "types": "./dist/src/index.d.ts",
211
- "version": "0.19.0-beta.192"
211
+ "version": "0.19.0-beta.194"
212
212
  }
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 cp(
104
- join("src", "svelte", "components", file),
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 cp(
113
- join("src", "vue", "components", file),
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...");