@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.
@@ -707,13 +707,14 @@ function getImportsFromFile(filePath, importPaths, typeImportPaths) {
707
707
  );
708
708
  const imports = [];
709
709
  const typeImports = [];
710
+ const isDeclarationFile = filePath.endsWith(".d.ts");
710
711
  function visit(node) {
711
712
  if (ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) {
712
713
  const moduleSpecifier = node.moduleSpecifier?.getFullText();
713
714
  const isTypeImport = ts.isImportDeclaration(node) ? node.importClause?.isTypeOnly ?? false : false;
714
715
  if (moduleSpecifier) {
715
716
  const trimmed = moduleSpecifier.split("'").at(1) ?? moduleSpecifier;
716
- if (isTypeImport) {
717
+ if (isTypeImport && !isDeclarationFile) {
717
718
  typeImports.push(trimmed);
718
719
  } else {
719
720
  imports.push(trimmed);
@@ -890,46 +891,102 @@ var deplint = ({ pkg }) => {
890
891
  };
891
892
 
892
893
  // src/actions/deploy.ts
894
+ import { readFileSync as readFileSync3 } from "node:fs";
895
+ var privatePackageExcludeList = () => {
896
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
897
+ workspace,
898
+ JSON.parse(readFileSync3(`${workspace.location}/package.json`, { encoding: "utf8" }))
899
+ ]);
900
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
901
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
902
+ return excludeList;
903
+ };
893
904
  var deploy = () => {
905
+ const excludeList = privatePackageExcludeList();
906
+ if (excludeList.length > 0) {
907
+ console.log("Excluding private packages from deployment:", excludeList);
908
+ }
894
909
  return runSteps("Deploy [Patch]", [
895
910
  ["yarn", "workspaces foreach --all version patch --deferred"],
896
911
  ["yarn", "xy clean"],
897
912
  ["yarn", "xy build"],
898
913
  ["yarn", "version apply --all"],
899
- ["yarn", "workspaces foreach --all --parallel npm publish"]
914
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
900
915
  ]);
901
916
  };
902
917
 
903
918
  // src/actions/deploy-major.ts
919
+ import { readFileSync as readFileSync4 } from "node:fs";
920
+ var privatePackageExcludeList2 = () => {
921
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
922
+ workspace,
923
+ JSON.parse(readFileSync4(`${workspace.location}/package.json`, { encoding: "utf8" }))
924
+ ]);
925
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
926
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
927
+ return excludeList;
928
+ };
904
929
  var deployMajor = () => {
930
+ const excludeList = privatePackageExcludeList2();
931
+ if (excludeList.length > 0) {
932
+ console.log("Excluding private packages from deployment:", excludeList);
933
+ }
905
934
  return runSteps("Deploy [Major]", [
906
935
  ["yarn", "workspaces foreach --all version major --deferred"],
907
936
  ["yarn", "xy clean"],
908
937
  ["yarn", "xy build"],
909
938
  ["yarn", "version apply --all"],
910
- ["yarn", "workspaces foreach --all --parallel npm publish"]
939
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
911
940
  ]);
912
941
  };
913
942
 
914
943
  // src/actions/deploy-minor.ts
944
+ import { readFileSync as readFileSync5 } from "node:fs";
945
+ var privatePackageExcludeList3 = () => {
946
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
947
+ workspace,
948
+ JSON.parse(readFileSync5(`${workspace.location}/package.json`, { encoding: "utf8" }))
949
+ ]);
950
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
951
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
952
+ return excludeList;
953
+ };
915
954
  var deployMinor = () => {
955
+ const excludeList = privatePackageExcludeList3();
956
+ if (excludeList.length > 0) {
957
+ console.log("Excluding private packages from deployment:", excludeList);
958
+ }
916
959
  return runSteps("Deploy [Minor]", [
917
960
  ["yarn", "workspaces foreach --all version minor --deferred"],
918
961
  ["yarn", "xy clean"],
919
962
  ["yarn", "xy build"],
920
963
  ["yarn", "version apply --all"],
921
- ["yarn", "workspaces foreach --all --parallel npm publish"]
964
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish`]
922
965
  ]);
923
966
  };
924
967
 
925
968
  // src/actions/deploy-next.ts
969
+ import { readFileSync as readFileSync6 } from "node:fs";
970
+ var privatePackageExcludeList4 = () => {
971
+ const possibleDeployablePackages = yarnWorkspaces().map((workspace) => [
972
+ workspace,
973
+ JSON.parse(readFileSync6(`${workspace.location}/package.json`, { encoding: "utf8" }))
974
+ ]);
975
+ const privatePackages = possibleDeployablePackages.filter(([_, pkg]) => pkg.private).map(([workspace]) => workspace);
976
+ const excludeList = privatePackages.map((workspace) => `--exclude ${workspace.name}`);
977
+ return excludeList;
978
+ };
926
979
  var deployNext = () => {
980
+ const excludeList = privatePackageExcludeList4();
981
+ if (excludeList.length > 0) {
982
+ console.log("Excluding private packages from deployment:", excludeList);
983
+ }
927
984
  return runSteps("Deploy [Next]", [
928
985
  ["yarn", "workspaces foreach --all version minor --deferred"],
929
986
  ["yarn", "xy clean"],
930
987
  ["yarn", "xy build"],
931
988
  ["yarn", "version apply --all --prerelease"],
932
- ["yarn", "workspaces foreach --all --parallel npm publish --tag next"]
989
+ ["yarn", `workspaces foreach --all ${excludeList.join(" ")} --parallel npm publish --tag next`]
933
990
  ]);
934
991
  };
935
992