@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.
- package/dist/types/pds.config.d.ts +4 -8
- package/dist/types/pds.config.d.ts.map +1 -1
- package/dist/types/pds.d.ts +0 -1
- package/dist/types/public/assets/js/pds-manager.d.ts +429 -144
- package/dist/types/public/assets/js/pds-manager.d.ts.map +1 -1
- package/dist/types/public/assets/js/pds.d.ts +4 -3
- package/dist/types/public/assets/js/pds.d.ts.map +1 -1
- package/dist/types/src/js/pds-core/pds-config.d.ts +454 -0
- package/dist/types/src/js/pds-core/pds-config.d.ts.map +1 -1
- package/dist/types/src/js/pds-core/pds-live.d.ts.map +1 -1
- package/dist/types/src/js/pds-core/pds-start-helpers.d.ts.map +1 -1
- package/package.json +1 -1
- package/packages/pds-cli/bin/templates/bootstrap/pds.config.js +9 -2
- package/public/assets/js/app.js +20 -20
- package/public/assets/js/pds-manager.js +75 -75
- package/public/assets/js/pds.js +8 -8
- package/src/js/pds-core/pds-config.js +686 -0
- package/src/js/pds-core/pds-live.js +366 -426
- package/src/js/pds-core/pds-start-helpers.js +15 -0
- package/src/js/pds.d.ts +0 -1
|
@@ -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