@pure-ds/core 0.5.59 → 0.5.61

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.
@@ -3,6 +3,8 @@
3
3
  * Kept separate to avoid pulling live-only logic into the base runtime bundle.
4
4
  */
5
5
 
6
+ import { validateDesignConfig, validateInitConfig } from "./pds-config.js";
7
+
6
8
  const __ABSOLUTE_URL_PATTERN__ = /^[a-z][a-z0-9+\-.]*:\/\//i;
7
9
  const __MODULE_URL__ = (() => {
8
10
  try {
@@ -130,6 +132,11 @@ export function stripFunctions(obj) {
130
132
 
131
133
  // Internal: normalize first-arg config to a full generator config and extract enhancers if provided inline
132
134
  export function normalizeInitConfig(inputConfig = {}, options = {}, { presets, defaultLog }) {
135
+ const logFn =
136
+ inputConfig && typeof inputConfig.log === "function"
137
+ ? inputConfig.log
138
+ : defaultLog;
139
+
133
140
  // If caller passed a plain design config (legacy), keep as-is
134
141
  const hasDesignKeys =
135
142
  typeof inputConfig === "object" &&
@@ -167,10 +174,17 @@ export function normalizeInitConfig(inputConfig = {}, options = {}, { presets, d
167
174
  "design" in (inputConfig || {}) ||
168
175
  "enhancers" in (inputConfig || {});
169
176
 
177
+ if (inputConfig && typeof inputConfig === "object") {
178
+ validateInitConfig(inputConfig, { log: logFn, context: "PDS.start" });
179
+ }
180
+
170
181
  let generatorConfig;
171
182
  let presetInfo = null;
172
183
 
173
184
  if (hasNewShape) {
185
+ if (designOverrides && typeof designOverrides === "object") {
186
+ validateDesignConfig(designOverrides, { log: logFn, context: "PDS.start" });
187
+ }
174
188
  // Always resolve a preset; default if none provided
175
189
  const effectivePreset = String(presetId || "default").toLowerCase();
176
190
  const found =
@@ -228,6 +242,7 @@ export function normalizeInitConfig(inputConfig = {}, options = {}, { presets, d
228
242
  log: userLog || defaultLog,
229
243
  };
230
244
  } else if (hasDesignKeys) {
245
+ validateDesignConfig(inputConfig, { log: logFn, context: "PDS.start" });
231
246
  // Back-compat: treat the provided object as the full design, wrap it
232
247
  const { log: userLog, ...designConfig } = inputConfig;
233
248
  generatorConfig = {
package/src/js/pds.d.ts CHANGED
@@ -286,7 +286,6 @@ export class PDS extends EventTarget {
286
286
  // live-only
287
287
  preloadStyles?: boolean;
288
288
  criticalLayers?: string[];
289
- applyConfiguratorStyles?: boolean;
290
289
  managerURL?: string;
291
290
  // static-only
292
291
  staticPaths?: Record<string, string>;