@mnci/cli 4.13.0 → 4.13.1

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/cli.js CHANGED
@@ -2162,17 +2162,20 @@ function renameScaffoldPlaceholder(projectRoot, name) {
2162
2162
  (0, import_node_fs3.renameSync)(spec, renamed);
2163
2163
  writeFileEnsured(
2164
2164
  renamed,
2165
- (0, import_node_fs3.readFileSync)(renamed, "utf8").replaceAll(`./${name}'`, () => `./${name}.use-case'`)
2165
+ repointSpecifier((0, import_node_fs3.readFileSync)(renamed, "utf8"), `./${name}`, `./${name}.use-case`)
2166
2166
  );
2167
2167
  }
2168
2168
  const barrel = (0, import_node_path3.join)(projectRoot, "src", "index.ts");
2169
2169
  if ((0, import_node_fs3.existsSync)(barrel)) {
2170
2170
  writeFileEnsured(
2171
2171
  barrel,
2172
- (0, import_node_fs3.readFileSync)(barrel, "utf8").replaceAll(`./lib/${name}'`, () => `./lib/${name}.use-case'`)
2172
+ repointSpecifier((0, import_node_fs3.readFileSync)(barrel, "utf8"), `./lib/${name}`, `./lib/${name}.use-case`)
2173
2173
  );
2174
2174
  }
2175
2175
  }
2176
+ function repointSpecifier(source, from, to) {
2177
+ return source.replaceAll(`${from}'`, () => `${to}'`).replaceAll(`${from}.js'`, () => `${to}.js'`);
2178
+ }
2176
2179
  function ensureNxPeerOverrides(workspaceRoot) {
2177
2180
  const manifestPath = (0, import_node_path3.join)(workspaceRoot, "package.json");
2178
2181
  if (!(0, import_node_fs3.existsSync)(manifestPath)) {