@velastack/patterns 0.0.46 → 0.0.47

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/index.d.ts CHANGED
@@ -10,7 +10,7 @@ export declare const byCategory: Record<"auth" | "content" | "generators" | "api
10
10
  auth: false;
11
11
  api: false;
12
12
  apiKeys: false;
13
- backend: true;
13
+ backend: false;
14
14
  i18n: false;
15
15
  teams: false;
16
16
  payments: false;
@@ -1177,7 +1177,7 @@ export declare const patterns: ({
1177
1177
  auth: false;
1178
1178
  api: false;
1179
1179
  apiKeys: false;
1180
- backend: true;
1180
+ backend: false;
1181
1181
  i18n: false;
1182
1182
  teams: false;
1183
1183
  payments: false;
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ var le = Object.create, ue = Object.defineProperty, de = Object.getOwnPropertyDe
26
26
  throw Error("Calling `require` for \"" + e + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
27
27
  }), ye = {
28
28
  name: "@velastack/patterns",
29
- version: "0.0.46",
29
+ version: "0.0.47",
30
30
  description: "Registry of VelaStack patterns: generators and modifications applied to SvelteKit projects by the VelaStack CLI.",
31
31
  type: "module",
32
32
  private: !1,
@@ -1895,25 +1895,26 @@ async function Kt(e) {
1895
1895
  let { getPreviewCollections: t } = await import("./chunks/env.preview-u7rnWI2E.js");
1896
1896
  return t(e);
1897
1897
  }
1898
- async function z(e, t, n) {
1899
- lt(t);
1900
- let r = A(t, e), i = await Kt(e);
1901
- if (n.length > 0) {
1902
- let { fields: t, auth: a } = kt(n, r, i, e);
1898
+ async function z(t, n, r) {
1899
+ lt(n);
1900
+ let i = A(n, t), a = t.features.backend ? await Kt(t) : [];
1901
+ if (r.length > 0) {
1902
+ let { fields: e, auth: n } = kt(r, i, a, t);
1903
1903
  return {
1904
- model: r,
1905
- fields: t,
1906
- auth: a,
1904
+ model: i,
1905
+ fields: e,
1906
+ auth: n,
1907
1907
  shouldCreateCollection: !0,
1908
- collections: i
1908
+ collections: a
1909
1909
  };
1910
1910
  }
1911
+ if (!t.features.backend) throw new e("Cannot derive fields from a collection without a backend. Pass field definitions (e.g. `name:text email:email`) or run `vela enable backend` first.");
1911
1912
  return {
1912
- model: r,
1913
- fields: Jt(r, i, e),
1913
+ model: i,
1914
+ fields: Jt(i, a, t),
1914
1915
  auth: void 0,
1915
1916
  shouldCreateCollection: !1,
1916
- collections: i
1917
+ collections: a
1917
1918
  };
1918
1919
  }
1919
1920
  function B(e, n, r) {
@@ -2220,7 +2221,7 @@ var fn = {
2220
2221
  auth: !1,
2221
2222
  api: !1,
2222
2223
  apiKeys: !1,
2223
- backend: !0,
2224
+ backend: !1,
2224
2225
  i18n: !1,
2225
2226
  teams: !1,
2226
2227
  payments: !1,