@jay-framework/compiler-shared 0.16.2 → 0.16.4
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 +3 -1
- package/dist/index.js +9 -9
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -562,7 +562,9 @@ interface DynamicContractConfig {
|
|
|
562
562
|
generator: string;
|
|
563
563
|
/** Path to the headless component (relative to plugin root) */
|
|
564
564
|
component: string;
|
|
565
|
-
/** Prefix for generated contract names
|
|
565
|
+
/** Prefix for generated contract names.
|
|
566
|
+
* When the generator returns multiple contracts: used as prefix (e.g., "list" → "list/recipes").
|
|
567
|
+
* When the generator returns a single contract: the name can be omitted, using just the prefix as the contract name (e.g., "product-page"). */
|
|
566
568
|
prefix: string;
|
|
567
569
|
}
|
|
568
570
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1347,13 +1347,13 @@ function findDynamicContract(manifest, contractName) {
|
|
|
1347
1347
|
if (!manifest.dynamic_contracts) {
|
|
1348
1348
|
return null;
|
|
1349
1349
|
}
|
|
1350
|
+
const dynamicConfigs = Array.isArray(manifest.dynamic_contracts) ? manifest.dynamic_contracts : [manifest.dynamic_contracts];
|
|
1350
1351
|
const slashIndex = contractName.indexOf("/");
|
|
1351
|
-
if (slashIndex
|
|
1352
|
-
|
|
1352
|
+
if (slashIndex !== -1) {
|
|
1353
|
+
const prefix = contractName.substring(0, slashIndex);
|
|
1354
|
+
return dynamicConfigs.find((config) => config.prefix === prefix) || null;
|
|
1353
1355
|
}
|
|
1354
|
-
|
|
1355
|
-
const dynamicConfigs = Array.isArray(manifest.dynamic_contracts) ? manifest.dynamic_contracts : [manifest.dynamic_contracts];
|
|
1356
|
-
return dynamicConfigs.find((config) => config.prefix === prefix) || null;
|
|
1356
|
+
return dynamicConfigs.find((config) => config.prefix === contractName) || null;
|
|
1357
1357
|
}
|
|
1358
1358
|
function resolveLocalPluginManifest(projectRoot, pluginName) {
|
|
1359
1359
|
const localPluginPath = path.join(projectRoot, LOCAL_PLUGIN_PATH, pluginName);
|
|
@@ -1418,8 +1418,8 @@ function resolveLocalPlugin(projectRoot, pluginName, contractName) {
|
|
|
1418
1418
|
);
|
|
1419
1419
|
}
|
|
1420
1420
|
const availableContracts = manifest.contracts?.map((c2) => c2.name) || [];
|
|
1421
|
-
const
|
|
1422
|
-
const allAvailable = [...availableContracts, ...
|
|
1421
|
+
const dynamicLabels = manifest.dynamic_contracts ? (Array.isArray(manifest.dynamic_contracts) ? manifest.dynamic_contracts : [manifest.dynamic_contracts]).map((c2) => `${c2.prefix}/*`) : [];
|
|
1422
|
+
const allAvailable = [...availableContracts, ...dynamicLabels].join(", ");
|
|
1423
1423
|
return new WithValidations(null, [
|
|
1424
1424
|
`Contract "${contractName}" not found in local plugin "${pluginName}". Available: ${allAvailable}`
|
|
1425
1425
|
]);
|
|
@@ -1538,8 +1538,8 @@ function resolveNpmPlugin(projectRoot, pluginName, contractName) {
|
|
|
1538
1538
|
);
|
|
1539
1539
|
}
|
|
1540
1540
|
const availableContracts = manifest.contracts?.map((c2) => c2.name) || [];
|
|
1541
|
-
const
|
|
1542
|
-
const allAvailable = [...availableContracts, ...
|
|
1541
|
+
const dynamicLabels = manifest.dynamic_contracts ? (Array.isArray(manifest.dynamic_contracts) ? manifest.dynamic_contracts : [manifest.dynamic_contracts]).map((c2) => `${c2.prefix}/*`) : [];
|
|
1542
|
+
const allAvailable = [...availableContracts, ...dynamicLabels].join(", ");
|
|
1543
1543
|
return new WithValidations(null, [
|
|
1544
1544
|
`Contract "${contractName}" not found in NPM package "${pluginName}". Available: ${allAvailable}`
|
|
1545
1545
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jay-framework/compiler-shared",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"author": "",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@jay-framework/component": "^0.16.
|
|
29
|
-
"@jay-framework/runtime": "^0.16.
|
|
30
|
-
"@jay-framework/secure": "^0.16.
|
|
31
|
-
"@jay-framework/typescript-bridge": "^0.16.
|
|
28
|
+
"@jay-framework/component": "^0.16.4",
|
|
29
|
+
"@jay-framework/runtime": "^0.16.4",
|
|
30
|
+
"@jay-framework/secure": "^0.16.4",
|
|
31
|
+
"@jay-framework/typescript-bridge": "^0.16.4",
|
|
32
32
|
"@types/js-yaml": "^4.0.9",
|
|
33
33
|
"change-case": "^4.1.2",
|
|
34
34
|
"js-beautify": "^1.14.11",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@caiogondim/strip-margin": "^1.0.0",
|
|
44
|
-
"@jay-framework/dev-environment": "^0.16.
|
|
44
|
+
"@jay-framework/dev-environment": "^0.16.4",
|
|
45
45
|
"@testing-library/jest-dom": "^6.2.0",
|
|
46
46
|
"@types/js-beautify": "^1",
|
|
47
47
|
"@types/node": "^20.11.5",
|