@foundrykit/cli 2.0.7 → 2.0.9

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @foundrykit/cli
2
2
 
3
+ ## 2.0.9
4
+
5
+ ### Patch Changes
6
+
7
+ - updates
8
+ - Updated dependencies
9
+ - @foundrykit/types@2.0.4
10
+
11
+ ## 2.0.8
12
+
13
+ ### Patch Changes
14
+
15
+ - updates to add
16
+
3
17
  ## 2.0.7
4
18
 
5
19
  ### Patch Changes
package/dist/cli.js CHANGED
@@ -1618,6 +1618,9 @@ function getConfiguredImportPaths(config) {
1618
1618
  };
1619
1619
  }
1620
1620
  function resolveImportBasePath(filePath, config, options = {}) {
1621
+ if (isPackageImportSpecifier(filePath)) {
1622
+ return filePath.replace(/\/$/, "");
1623
+ }
1621
1624
  const normalizedPath = normalizeConfigPath(filePath).replace(
1622
1625
  /\.(ts|js)x?$/,
1623
1626
  ""
@@ -1647,6 +1650,9 @@ function resolveImportBasePath(filePath, config, options = {}) {
1647
1650
  function normalizeConfigPath(filePath) {
1648
1651
  return filePath.replace(/\\/g, "/").replace(/^\.\//, "").replace(/^\.\/?$/, "").replace(/\/$/, "");
1649
1652
  }
1653
+ function isPackageImportSpecifier(importPath) {
1654
+ return importPath.startsWith("@") && !importPath.startsWith("@/");
1655
+ }
1650
1656
  function joinImportPath(basePath, childPath) {
1651
1657
  const normalizedBase = basePath.replace(/\/$/, "");
1652
1658
  const normalizedChild = childPath.replace(/^\//, "").replace(/\/$/, "");
@@ -1661,12 +1667,18 @@ function transformRegistryBarrelImports(content, sources, destinationBasePath, c
1661
1667
  `import\\s+{([^}]+)}\\s+from\\s+["'](${sourcePattern})["'];?`,
1662
1668
  "g"
1663
1669
  );
1664
- return content.replace(importPattern, (match, imports) => {
1665
- const groupedImports = groupImportsByComponent(imports, config, category);
1666
- return Array.from(groupedImports.entries()).map(([componentPath, specifiers]) => {
1667
- return `import { ${specifiers.join(", ")} } from "${destinationBasePath}/${componentPath}";`;
1668
- }).join("\n");
1669
- });
1670
+ return content.replace(
1671
+ importPattern,
1672
+ (match, imports, source) => {
1673
+ if (isPackageImportSpecifier(destinationBasePath)) {
1674
+ return match.replace(source, destinationBasePath);
1675
+ }
1676
+ const groupedImports = groupImportsByComponent(imports, config, category);
1677
+ return Array.from(groupedImports.entries()).map(([componentPath, specifiers]) => {
1678
+ return `import { ${specifiers.join(", ")} } from "${destinationBasePath}/${componentPath}";`;
1679
+ }).join("\n");
1680
+ }
1681
+ );
1670
1682
  }
1671
1683
  function groupImportsByComponent(imports, config, category) {
1672
1684
  const groupedImports = /* @__PURE__ */ new Map();