sveltekit-data-plugin 1.4.3 → 1.5.0

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/plugin.js CHANGED
@@ -74,12 +74,10 @@
74
74
  depth: depth + 1
75
75
  });
76
76
  return {
77
- attributes: {
78
- ...attributes,
79
- _internal: {
80
- id: path.basename(obj),
81
- absolute: obj
82
- }
77
+ ...attributes,
78
+ _internal: {
79
+ id: path.basename(obj),
80
+ absolute: obj
83
81
  },
84
82
  body: data.body
85
83
  };
@@ -137,7 +135,13 @@
137
135
  relative: relativeFolder
138
136
  });
139
137
  return `
140
- ${Object.entries(attributes).map(([key, value]) => `export const ${key} = ${JSON.stringify(value)};`).join("\n")}
138
+ ${Object.entries({
139
+ ...attributes,
140
+ _internal: {
141
+ id: path.basename(id),
142
+ absolute: id
143
+ }
144
+ }).map(([key, value]) => `export const ${key} = ${JSON.stringify(value)};`).join("\n")}
141
145
  export const body = ${JSON.stringify(d.body)};`;
142
146
  }
143
147
  }
package/dist/plugin.mjs CHANGED
@@ -73,12 +73,10 @@ async function convert(opts, obj, { base, relative, depth = 1 } = {}) {
73
73
  depth: depth + 1
74
74
  });
75
75
  return {
76
- attributes: {
77
- ...attributes,
78
- _internal: {
79
- id: path.basename(obj),
80
- absolute: obj
81
- }
76
+ ...attributes,
77
+ _internal: {
78
+ id: path.basename(obj),
79
+ absolute: obj
82
80
  },
83
81
  body: data.body
84
82
  };
@@ -136,7 +134,13 @@ function importDataPlugin(imagetools_plugin, { base = "./src/data" } = {}) {
136
134
  relative: relativeFolder
137
135
  });
138
136
  return `
139
- ${Object.entries(attributes).map(([key, value]) => `export const ${key} = ${JSON.stringify(value)};`).join("\n")}
137
+ ${Object.entries({
138
+ ...attributes,
139
+ _internal: {
140
+ id: path.basename(id),
141
+ absolute: id
142
+ }
143
+ }).map(([key, value]) => `export const ${key} = ${JSON.stringify(value)};`).join("\n")}
140
144
  export const body = ${JSON.stringify(d.body)};`;
141
145
  }
142
146
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sveltekit-data-plugin",
3
- "version": "1.4.3",
3
+ "version": "1.5.0",
4
4
  "author": {
5
5
  "name": "Jonny Thaw",
6
6
  "url": "https://jthaw.me"