@xylabs/ts-scripts-yarn3 6.4.5 → 6.5.0

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/xy/index.mjs CHANGED
@@ -691,13 +691,14 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
691
691
  );
692
692
  const imports = [];
693
693
  const typeImports = [];
694
+ const isDeclarationFile = filePath.endsWith(".d.ts");
694
695
  function visit(node) {
695
696
  if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) {
696
697
  const moduleSpecifier = node.moduleSpecifier?.getFullText();
697
698
  const isTypeImport = ts.isImportDeclaration(node) ? node.importClause?.isTypeOnly ?? false : false;
698
699
  if (moduleSpecifier) {
699
700
  const trimmed = moduleSpecifier.split("'").at(1) ?? moduleSpecifier;
700
- if (isTypeImport) {
701
+ if (isTypeImport && !isDeclarationFile) {
701
702
  typeImports.push(trimmed);
702
703
  } else {
703
704
  imports.push(trimmed);
@@ -874,46 +875,102 @@ var deplint = ({ pkg }) => {
874
875
  };
875
876
 
876
877
  // src/actions/deploy.ts
878
+ import { readFileSync as readFileSync3 } from "node:fs";
879
+ var privatePackageExcludeList = () => {
880
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
881
+ workspace,
882
+ JSON.parse(readFileSync3(`${workspace.location}/package.json`, { encoding: "utf8" }))
883
+ ]);
884
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
885
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
886
+ return excludeList;
887
+ };
877
888
  var deploy = () => {
889
+ const excludeList = privatePackageExcludeList();
890
+ if (excludeList.length > 0) {
891
+ console.log("Excluding private packages from deployment:", excludeList);
892
+ }
878
893
  return runSteps("Deploy [Patch]", [
879
894
  ["yarn", "workspaces foreach --all version patch --deferred"],
880
895
  ["yarn", "xy clean"],
881
896
  ["yarn", "xy build"],
882
897
  ["yarn", "version apply --all"],
883
- ["yarn", "workspaces foreach --all --parallel npm publish"]
898
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
884
899
  ]);
885
900
  };
886
901
 
887
902
  // src/actions/deploy-major.ts
903
+ import { readFileSync as readFileSync4 } from "node:fs";
904
+ var privatePackageExcludeList2 = () => {
905
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
906
+ workspace,
907
+ JSON.parse(readFileSync4(`${workspace.location}/package.json`, { encoding: "utf8" }))
908
+ ]);
909
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
910
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
911
+ return excludeList;
912
+ };
888
913
  var deployMajor = () => {
914
+ const excludeList = privatePackageExcludeList2();
915
+ if (excludeList.length > 0) {
916
+ console.log("Excluding private packages from deployment:", excludeList);
917
+ }
889
918
  return runSteps("Deploy [Major]", [
890
919
  ["yarn", "workspaces foreach --all version major --deferred"],
891
920
  ["yarn", "xy clean"],
892
921
  ["yarn", "xy build"],
893
922
  ["yarn", "version apply --all"],
894
- ["yarn", "workspaces foreach --all --parallel npm publish"]
923
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
895
924
  ]);
896
925
  };
897
926
 
898
927
  // src/actions/deploy-minor.ts
928
+ import { readFileSync as readFileSync5 } from "node:fs";
929
+ var privatePackageExcludeList3 = () => {
930
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
931
+ workspace,
932
+ JSON.parse(readFileSync5(`${workspace.location}/package.json`, { encoding: "utf8" }))
933
+ ]);
934
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
935
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
936
+ return excludeList;
937
+ };
899
938
  var deployMinor = () => {
939
+ const excludeList = privatePackageExcludeList3();
940
+ if (excludeList.length > 0) {
941
+ console.log("Excluding private packages from deployment:", excludeList);
942
+ }
900
943
  return runSteps("Deploy [Minor]", [
901
944
  ["yarn", "workspaces foreach --all version minor --deferred"],
902
945
  ["yarn", "xy clean"],
903
946
  ["yarn", "xy build"],
904
947
  ["yarn", "version apply --all"],
905
- ["yarn", "workspaces foreach --all --parallel npm publish"]
948
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
906
949
  ]);
907
950
  };
908
951
 
909
952
  // src/actions/deploy-next.ts
953
+ import { readFileSync as readFileSync6 } from "node:fs";
954
+ var privatePackageExcludeList4 = () => {
955
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
956
+ workspace,
957
+ JSON.parse(readFileSync6(`${workspace.location}/package.json`, { encoding: "utf8" }))
958
+ ]);
959
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
960
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
961
+ return excludeList;
962
+ };
910
963
  var deployNext = () => {
964
+ const excludeList = privatePackageExcludeList4();
965
+ if (excludeList.length > 0) {
966
+ console.log("Excluding private packages from deployment:", excludeList);
967
+ }
911
968
  return runSteps("Deploy [Next]", [
912
969
  ["yarn", "workspaces foreach --all version minor --deferred"],
913
970
  ["yarn", "xy clean"],
914
971
  ["yarn", "xy build"],
915
972
  ["yarn", "version apply --all --prerelease"],
916
- ["yarn", "workspaces foreach --all --parallel npm publish --tag next"]
973
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish --tag next`]
917
974
  ]);
918
975
  };
919
976