@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/index.mjs CHANGED
@@ -967,46 +967,102 @@ var deplint = ({ pkg }) => {
967
967
  };
968
968
 
969
969
  // src/actions/deploy.ts
970
+ import { readFileSync as readFileSync5 } from "node:fs";
971
+ var privatePackageExcludeList = () => {
972
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
973
+ workspace,
974
+ JSON.parse(readFileSync5(`${workspace.location}/package.json`, { encoding: "utf8" }))
975
+ ]);
976
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
977
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
978
+ return excludeList;
979
+ };
970
980
  var deploy = () => {
981
+ const excludeList = privatePackageExcludeList();
982
+ if (excludeList.length > 0) {
983
+ console.log("Excluding private packages from deployment:", excludeList);
984
+ }
971
985
  return runSteps("Deploy [Patch]", [
972
986
  ["yarn", "workspaces foreach --all version patch --deferred"],
973
987
  ["yarn", "xy clean"],
974
988
  ["yarn", "xy build"],
975
989
  ["yarn", "version apply --all"],
976
- ["yarn", "workspaces foreach --all --parallel npm publish"]
990
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
977
991
  ]);
978
992
  };
979
993
 
980
994
  // src/actions/deploy-major.ts
995
+ import { readFileSync as readFileSync6 } from "node:fs";
996
+ var privatePackageExcludeList2 = () => {
997
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
998
+ workspace,
999
+ JSON.parse(readFileSync6(`${workspace.location}/package.json`, { encoding: "utf8" }))
1000
+ ]);
1001
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1002
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
1003
+ return excludeList;
1004
+ };
981
1005
  var deployMajor = () => {
1006
+ const excludeList = privatePackageExcludeList2();
1007
+ if (excludeList.length > 0) {
1008
+ console.log("Excluding private packages from deployment:", excludeList);
1009
+ }
982
1010
  return runSteps("Deploy [Major]", [
983
1011
  ["yarn", "workspaces foreach --all version major --deferred"],
984
1012
  ["yarn", "xy clean"],
985
1013
  ["yarn", "xy build"],
986
1014
  ["yarn", "version apply --all"],
987
- ["yarn", "workspaces foreach --all --parallel npm publish"]
1015
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
988
1016
  ]);
989
1017
  };
990
1018
 
991
1019
  // src/actions/deploy-minor.ts
1020
+ import { readFileSync as readFileSync7 } from "node:fs";
1021
+ var privatePackageExcludeList3 = () => {
1022
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1023
+ workspace,
1024
+ JSON.parse(readFileSync7(`${workspace.location}/package.json`, { encoding: "utf8" }))
1025
+ ]);
1026
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1027
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
1028
+ return excludeList;
1029
+ };
992
1030
  var deployMinor = () => {
1031
+ const excludeList = privatePackageExcludeList3();
1032
+ if (excludeList.length > 0) {
1033
+ console.log("Excluding private packages from deployment:", excludeList);
1034
+ }
993
1035
  return runSteps("Deploy [Minor]", [
994
1036
  ["yarn", "workspaces foreach --all version minor --deferred"],
995
1037
  ["yarn", "xy clean"],
996
1038
  ["yarn", "xy build"],
997
1039
  ["yarn", "version apply --all"],
998
- ["yarn", "workspaces foreach --all --parallel npm publish"]
1040
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
999
1041
  ]);
1000
1042
  };
1001
1043
 
1002
1044
  // src/actions/deploy-next.ts
1045
+ import { readFileSync as readFileSync8 } from "node:fs";
1046
+ var privatePackageExcludeList4 = () => {
1047
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
1048
+ workspace,
1049
+ JSON.parse(readFileSync8(`${workspace.location}/package.json`, { encoding: "utf8" }))
1050
+ ]);
1051
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
1052
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
1053
+ return excludeList;
1054
+ };
1003
1055
  var deployNext = () => {
1056
+ const excludeList = privatePackageExcludeList4();
1057
+ if (excludeList.length > 0) {
1058
+ console.log("Excluding private packages from deployment:", excludeList);
1059
+ }
1004
1060
  return runSteps("Deploy [Next]", [
1005
1061
  ["yarn", "workspaces foreach --all version minor --deferred"],
1006
1062
  ["yarn", "xy clean"],
1007
1063
  ["yarn", "xy build"],
1008
1064
  ["yarn", "version apply --all --prerelease"],
1009
- ["yarn", "workspaces foreach --all --parallel npm publish --tag next"]
1065
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish --tag next`]
1010
1066
  ]);
1011
1067
  };
1012
1068