@xylabs/ts-scripts-yarn3 6.4.6 → 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/bin/xy.mjs CHANGED
@@ -877,46 +877,102 @@ var deplint = ({ pkg }) => {
877
877
  };
878
878
 
879
879
  // src/actions/deploy.ts
880
+ import { readFileSync as readFileSync3 } from "node:fs";
881
+ var privatePackageExcludeList = () => {
882
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
883
+ workspace,
884
+ JSON.parse(readFileSync3(`${workspace.location}/package.json`, { encoding: "utf8" }))
885
+ ]);
886
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
887
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
888
+ return excludeList;
889
+ };
880
890
  var deploy = () => {
891
+ const excludeList = privatePackageExcludeList();
892
+ if (excludeList.length > 0) {
893
+ console.log("Excluding private packages from deployment:", excludeList);
894
+ }
881
895
  return runSteps("Deploy [Patch]", [
882
896
  ["yarn", "workspaces foreach --all version patch --deferred"],
883
897
  ["yarn", "xy clean"],
884
898
  ["yarn", "xy build"],
885
899
  ["yarn", "version apply --all"],
886
- ["yarn", "workspaces foreach --all --parallel npm publish"]
900
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
887
901
  ]);
888
902
  };
889
903
 
890
904
  // src/actions/deploy-major.ts
905
+ import { readFileSync as readFileSync4 } from "node:fs";
906
+ var privatePackageExcludeList2 = () => {
907
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
908
+ workspace,
909
+ JSON.parse(readFileSync4(`${workspace.location}/package.json`, { encoding: "utf8" }))
910
+ ]);
911
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
912
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
913
+ return excludeList;
914
+ };
891
915
  var deployMajor = () => {
916
+ const excludeList = privatePackageExcludeList2();
917
+ if (excludeList.length > 0) {
918
+ console.log("Excluding private packages from deployment:", excludeList);
919
+ }
892
920
  return runSteps("Deploy [Major]", [
893
921
  ["yarn", "workspaces foreach --all version major --deferred"],
894
922
  ["yarn", "xy clean"],
895
923
  ["yarn", "xy build"],
896
924
  ["yarn", "version apply --all"],
897
- ["yarn", "workspaces foreach --all --parallel npm publish"]
925
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
898
926
  ]);
899
927
  };
900
928
 
901
929
  // src/actions/deploy-minor.ts
930
+ import { readFileSync as readFileSync5 } from "node:fs";
931
+ var privatePackageExcludeList3 = () => {
932
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
933
+ workspace,
934
+ JSON.parse(readFileSync5(`${workspace.location}/package.json`, { encoding: "utf8" }))
935
+ ]);
936
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
937
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
938
+ return excludeList;
939
+ };
902
940
  var deployMinor = () => {
941
+ const excludeList = privatePackageExcludeList3();
942
+ if (excludeList.length > 0) {
943
+ console.log("Excluding private packages from deployment:", excludeList);
944
+ }
903
945
  return runSteps("Deploy [Minor]", [
904
946
  ["yarn", "workspaces foreach --all version minor --deferred"],
905
947
  ["yarn", "xy clean"],
906
948
  ["yarn", "xy build"],
907
949
  ["yarn", "version apply --all"],
908
- ["yarn", "workspaces foreach --all --parallel npm publish"]
950
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
909
951
  ]);
910
952
  };
911
953
 
912
954
  // src/actions/deploy-next.ts
955
+ import { readFileSync as readFileSync6 } from "node:fs";
956
+ var privatePackageExcludeList4 = () => {
957
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
958
+ workspace,
959
+ JSON.parse(readFileSync6(`${workspace.location}/package.json`, { encoding: "utf8" }))
960
+ ]);
961
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
962
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
963
+ return excludeList;
964
+ };
913
965
  var deployNext = () => {
966
+ const excludeList = privatePackageExcludeList4();
967
+ if (excludeList.length > 0) {
968
+ console.log("Excluding private packages from deployment:", excludeList);
969
+ }
914
970
  return runSteps("Deploy [Next]", [
915
971
  ["yarn", "workspaces foreach --all version minor --deferred"],
916
972
  ["yarn", "xy clean"],
917
973
  ["yarn", "xy build"],
918
974
  ["yarn", "version apply --all --prerelease"],
919
- ["yarn", "workspaces foreach --all --parallel npm publish --tag next"]
975
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish --tag next`]
920
976
  ]);
921
977
  };
922
978