@wise/wds-codemods 1.0.0-experimental-5d002fd → 1.0.0-experimental-a536a63
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/{helpers-CghwwYSg.js → helpers-RWhTD5Is.js} +6 -3
- package/dist/{helpers-CghwwYSg.js.map → helpers-RWhTD5Is.js.map} +1 -1
- package/dist/index.js +24 -29
- package/dist/index.js.map +1 -1
- package/dist/transformer-wd_8jk1P.js +338 -0
- package/dist/transformer-wd_8jk1P.js.map +1 -0
- package/dist/transforms/button/transformer.js +1 -1
- package/dist/transforms/list-item/config.json +6 -0
- package/dist/transforms/list-item/transformer.js +4 -0
- package/package.json +5 -3
|
@@ -1451,6 +1451,7 @@ var require_semver = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7
|
|
|
1451
1451
|
|
|
1452
1452
|
//#endregion
|
|
1453
1453
|
//#region src/controller/helpers/getCodemodConfig.ts
|
|
1454
|
+
/** Retrieves a JSON object from a file path, returning null if the file does not exist */
|
|
1454
1455
|
const getJsonFromPath = (baseDir, fileName) => {
|
|
1455
1456
|
const jsonPath = (0, node_path.join)(baseDir, fileName);
|
|
1456
1457
|
try {
|
|
@@ -1612,10 +1613,12 @@ const assessPrerequisites = (packagePath, codemodPath) => {
|
|
|
1612
1613
|
return false;
|
|
1613
1614
|
}
|
|
1614
1615
|
if (actualPackagePath !== resolvedPackagePath) console.info(`Using package.json from ${actualPackagePath} for dependency checks`);
|
|
1615
|
-
const
|
|
1616
|
+
const packageJson = getJsonFromPath(actualPackagePath, "package.json");
|
|
1617
|
+
if (!packageJson) return false;
|
|
1618
|
+
const { dependencies = {}, peerDependencies = {} } = packageJson;
|
|
1616
1619
|
const comparisons = {};
|
|
1617
1620
|
let isCompliant = true;
|
|
1618
|
-
if (codemodConfig
|
|
1621
|
+
if (codemodConfig?.prerequisites) Object.entries(codemodConfig.prerequisites).forEach(([name, versionRequirement]) => {
|
|
1619
1622
|
const nodeModulesVersion = getVersionFromNodeModules(actualPackagePath, name);
|
|
1620
1623
|
const isDependencySatisfied = isVersionSatisfied(dependencies[name], versionRequirement);
|
|
1621
1624
|
const isPeerDependencySatisfied = isVersionSatisfied(peerDependencies[name], versionRequirement);
|
|
@@ -1999,4 +2002,4 @@ Object.defineProperty(exports, 'runTransformPrompts', {
|
|
|
1999
2002
|
return runTransformPrompts;
|
|
2000
2003
|
}
|
|
2001
2004
|
});
|
|
2002
|
-
//# sourceMappingURL=helpers-
|
|
2005
|
+
//# sourceMappingURL=helpers-RWhTD5Is.js.map
|