diff --git a/package.json b/package.json index 93cbad8..f7d5ebe 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "preview": "astro preview", "astro": "astro" }, - "dependencies": { + "peerDependencies": { "astro": "^2.8.4" }, "devDependencies": { diff --git a/src/Serialize.astro b/src/Serialize.astro index 99f71f6..19e6690 100644 --- a/src/Serialize.astro +++ b/src/Serialize.astro @@ -22,7 +22,7 @@ try { serializedData = use ? use(data) : JSON.stringify(data); } catch(err) { // extend error for helpful messages and guides - throw Error(err) + throw Error('astro-resume ERR:', err) } --- diff --git a/src/deserialize.ts b/src/deserialize.ts index caefbe2..a9c6867 100644 --- a/src/deserialize.ts +++ b/src/deserialize.ts @@ -32,7 +32,7 @@ export function deserialize(id: string, parser?: (serialized: string)=> if (elements?.length > 0) { if (elements?.length > 1) - console.warn(`WARNING: Multiple matches for "${id}". There are ${elements?.length} matches found for ID: "${id}". The function will parse the first match found.`) + console.warn(`astro-resume WARN: Multiple matches for "${id}". The function will parse the first one.`) const element = elements[0]; @@ -42,7 +42,7 @@ export function deserialize(id: string, parser?: (serialized: string)=> : JSON.parse(element.textContent) } - throw Error(`ERR: No match found. + throw Error(`astro-resume ERR: No match found. "deserialize('${id}')" did not find any data. Check that the following are correct: - The Serialize component is used with correct props