@storm-software/git-tools 2.130.38 → 2.130.39

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.
@@ -14,7 +14,7 @@ var path__default = /*#__PURE__*/_interopDefault(path);
14
14
  async function prePushHook(config, files) {
15
15
  chunkHVR76UIF_cjs.writeInfo("Running pre-push hook...", config);
16
16
  chunkYHZNDNCW_cjs.checkPackageVersion(files);
17
- chunkHVR76UIF_cjs.writeInfo("\u{1F512}\u{1F512}\u{1F512} Validating lock files \u{1F512}\u{1F512}\u{1F512}\n", config);
17
+ chunkHVR76UIF_cjs.writeInfo("\u{1F512}\u{1F512}\u{1F512} Validating lock files \u{1F512}\u{1F512}\u{1F512}", config);
18
18
  const errors = [];
19
19
  if (fs__default.default.existsSync(path__default.default.join(config.workspaceRoot ?? "./", "package-lock.json"))) {
20
20
  errors.push(
@@ -51,9 +51,9 @@ async function prePushHook(config, files) {
51
51
  "\u274C Lock file validation failed\n" + errors.join("\n")
52
52
  );
53
53
  }
54
- chunkHVR76UIF_cjs.writeSuccess(" \u2714 Lock file is valid for push", config);
54
+ chunkHVR76UIF_cjs.writeSuccess("\u2714 Lock file is valid for push", config);
55
55
  }
56
56
 
57
57
  exports.prePushHook = prePushHook;
58
- //# sourceMappingURL=chunk-OVGMWXXJ.cjs.map
59
- //# sourceMappingURL=chunk-OVGMWXXJ.cjs.map
58
+ //# sourceMappingURL=chunk-WYYIBLO2.cjs.map
59
+ //# sourceMappingURL=chunk-WYYIBLO2.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/hooks/pre-push.ts"],"names":["writeInfo","checkPackageVersion","fs","path","readFile","writeSuccess"],"mappings":";;;;;;;;;;;;;AASA,eAAsB,WAAA,CACpB,QACA,KAAA,EACA;AACA,EAAAA,2BAAA,CAAU,4BAA4B,MAAM,CAAA;AAC5C,EAAAC,qCAAA,CAAoB,KAAK,CAAA;AAEzB,EAAAD,2BAAA,CAAU,iFAAuC,MAAM,CAAA;AAEvD,EAAA,MAAM,SAAS,EAAC;AAChB,EAAA,IACEE,mBAAA,CAAG,WAAWC,qBAAA,CAAK,IAAA,CAAK,OAAO,aAAA,IAAiB,IAAA,EAAM,mBAAmB,CAAC,CAAA,EAC1E;AACA,IAAA,MAAA,CAAO,IAAA;AAAA,MACL;AAAA,KACF;AAAA,EACF;AACA,EAAA,IAAID,mBAAA,CAAG,WAAWC,qBAAA,CAAK,IAAA,CAAK,OAAO,aAAA,IAAiB,IAAA,EAAM,WAAW,CAAC,CAAA,EAAG;AACvE,IAAA,MAAA,CAAO,IAAA;AAAA,MACL;AAAA,KACF;AAAA,EACF;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,UAAU,MAAMC,iBAAA;AAAA,MACpBD,qBAAA,CAAK,IAAA,CAAK,MAAA,CAAO,aAAA,IAAiB,MAAM,gBAAgB,CAAA;AAAA,MACxD;AAAA,QACE,QAAA,EAAU;AAAA;AACZ,KACF;AACA,IAAA,IAAI,OAAA,EAAS,KAAA,CAAM,eAAe,CAAA,EAAG;AACnC,MAAA,MAAA,CAAO,IAAA;AAAA,QACL;AAAA,OACF;AAAA,IACF;AACA,IAAA,IAAI,OAAA,EAAS,KAAA,CAAM,uBAAuB,CAAA,EAAG;AAC3C,MAAA,MAAA,CAAO,IAAA;AAAA,QACL;AAAA,OACF;AAAA,IACF;AAAA,EACF,CAAA,CAAA,MAAQ;AACN,IAAA,MAAA,CAAO,KAAK,uDAAuD,CAAA;AAAA,EACrE;AAEA,EAAA,IAAI,MAAA,CAAO,SAAS,CAAA,EAAG;AACrB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,sCAAA,GAAyC,MAAA,CAAO,IAAA,CAAK,IAAI;AAAA,KAC3D;AAAA,EACF;AAEA,EAAAE,8BAAA,CAAa,sCAAiC,MAAM,CAAA;AAetD","file":"chunk-WYYIBLO2.cjs","sourcesContent":["#!/usr/bin/env node\n\nimport { StormWorkspaceConfig } from \"@storm-software/config\";\nimport { writeInfo, writeSuccess } from \"@storm-software/config-tools\";\nimport fs from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { checkPackageVersion } from \"../utilities/check-package-version\";\n\nexport async function prePushHook(\n config: StormWorkspaceConfig,\n files: string[]\n) {\n writeInfo(\"Running pre-push hook...\", config);\n checkPackageVersion(files);\n\n writeInfo(\"🔒🔒🔒 Validating lock files 🔒🔒🔒\", config);\n\n const errors = [] as string[];\n if (\n fs.existsSync(path.join(config.workspaceRoot ?? \"./\", \"package-lock.json\"))\n ) {\n errors.push(\n 'Invalid occurrence of \"package-lock.json\" file. Please remove it and use only \"pnpm-lock.yaml\"'\n );\n }\n if (fs.existsSync(path.join(config.workspaceRoot ?? \"./\", \"yarn.lock\"))) {\n errors.push(\n 'Invalid occurrence of \"yarn.lock\" file. Please remove it and use only \"pnpm-lock.yaml\"'\n );\n }\n\n try {\n const content = await readFile(\n path.join(config.workspaceRoot ?? \"./\", \"pnpm-lock.yaml\"),\n {\n encoding: \"utf8\"\n }\n );\n if (content?.match(/localhost:487/)) {\n errors.push(\n 'The \"pnpm-lock.yaml\" has reference to local repository (\"localhost:4873\"). Please use ensure you disable local registry before running \"pnpm i\"'\n );\n }\n if (content?.match(/resolution: \\{tarball/)) {\n errors.push(\n 'The \"pnpm-lock.yaml\" has reference to tarball package. Please use npm registry only'\n );\n }\n } catch {\n errors.push('The \"pnpm-lock.yaml\" does not exist or cannot be read');\n }\n\n if (errors.length > 0) {\n throw new Error(\n \"❌ Lock file validation failed\" + \"\\n\" + errors.join(\"\\n\")\n );\n }\n\n writeSuccess(\"✔ Lock file is valid for push\", config);\n\n // run(config, \"git lfs pre-push origin\");\n\n // try {\n // run(config, \"git-lfs version\");\n // } catch (error) {\n // throw new Error(\n // `This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\\nError: ${\n // (error as Error)?.message\n // }`\n // );\n // }\n\n // run(config, \"git lfs pre-push origin\");\n}\n"]}
@@ -7,7 +7,7 @@ import path from 'node:path';
7
7
  async function prePushHook(config, files) {
8
8
  writeInfo("Running pre-push hook...", config);
9
9
  checkPackageVersion(files);
10
- writeInfo("\u{1F512}\u{1F512}\u{1F512} Validating lock files \u{1F512}\u{1F512}\u{1F512}\n", config);
10
+ writeInfo("\u{1F512}\u{1F512}\u{1F512} Validating lock files \u{1F512}\u{1F512}\u{1F512}", config);
11
11
  const errors = [];
12
12
  if (fs.existsSync(path.join(config.workspaceRoot ?? "./", "package-lock.json"))) {
13
13
  errors.push(
@@ -44,9 +44,9 @@ async function prePushHook(config, files) {
44
44
  "\u274C Lock file validation failed\n" + errors.join("\n")
45
45
  );
46
46
  }
47
- writeSuccess(" \u2714 Lock file is valid for push", config);
47
+ writeSuccess("\u2714 Lock file is valid for push", config);
48
48
  }
49
49
 
50
50
  export { prePushHook };
51
- //# sourceMappingURL=chunk-NBAUOCB4.js.map
52
- //# sourceMappingURL=chunk-NBAUOCB4.js.map
51
+ //# sourceMappingURL=chunk-XY4WATTM.js.map
52
+ //# sourceMappingURL=chunk-XY4WATTM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/hooks/pre-push.ts"],"names":[],"mappings":";;;;;;AASA,eAAsB,WAAA,CACpB,QACA,KAAA,EACA;AACA,EAAA,SAAA,CAAU,4BAA4B,MAAM,CAAA;AAC5C,EAAA,mBAAA,CAAoB,KAAK,CAAA;AAEzB,EAAA,SAAA,CAAU,iFAAuC,MAAM,CAAA;AAEvD,EAAA,MAAM,SAAS,EAAC;AAChB,EAAA,IACE,EAAA,CAAG,WAAW,IAAA,CAAK,IAAA,CAAK,OAAO,aAAA,IAAiB,IAAA,EAAM,mBAAmB,CAAC,CAAA,EAC1E;AACA,IAAA,MAAA,CAAO,IAAA;AAAA,MACL;AAAA,KACF;AAAA,EACF;AACA,EAAA,IAAI,EAAA,CAAG,WAAW,IAAA,CAAK,IAAA,CAAK,OAAO,aAAA,IAAiB,IAAA,EAAM,WAAW,CAAC,CAAA,EAAG;AACvE,IAAA,MAAA,CAAO,IAAA;AAAA,MACL;AAAA,KACF;AAAA,EACF;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,UAAU,MAAM,QAAA;AAAA,MACpB,IAAA,CAAK,IAAA,CAAK,MAAA,CAAO,aAAA,IAAiB,MAAM,gBAAgB,CAAA;AAAA,MACxD;AAAA,QACE,QAAA,EAAU;AAAA;AACZ,KACF;AACA,IAAA,IAAI,OAAA,EAAS,KAAA,CAAM,eAAe,CAAA,EAAG;AACnC,MAAA,MAAA,CAAO,IAAA;AAAA,QACL;AAAA,OACF;AAAA,IACF;AACA,IAAA,IAAI,OAAA,EAAS,KAAA,CAAM,uBAAuB,CAAA,EAAG;AAC3C,MAAA,MAAA,CAAO,IAAA;AAAA,QACL;AAAA,OACF;AAAA,IACF;AAAA,EACF,CAAA,CAAA,MAAQ;AACN,IAAA,MAAA,CAAO,KAAK,uDAAuD,CAAA;AAAA,EACrE;AAEA,EAAA,IAAI,MAAA,CAAO,SAAS,CAAA,EAAG;AACrB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,sCAAA,GAAyC,MAAA,CAAO,IAAA,CAAK,IAAI;AAAA,KAC3D;AAAA,EACF;AAEA,EAAA,YAAA,CAAa,sCAAiC,MAAM,CAAA;AAetD","file":"chunk-XY4WATTM.js","sourcesContent":["#!/usr/bin/env node\n\nimport { StormWorkspaceConfig } from \"@storm-software/config\";\nimport { writeInfo, writeSuccess } from \"@storm-software/config-tools\";\nimport fs from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { checkPackageVersion } from \"../utilities/check-package-version\";\n\nexport async function prePushHook(\n config: StormWorkspaceConfig,\n files: string[]\n) {\n writeInfo(\"Running pre-push hook...\", config);\n checkPackageVersion(files);\n\n writeInfo(\"🔒🔒🔒 Validating lock files 🔒🔒🔒\", config);\n\n const errors = [] as string[];\n if (\n fs.existsSync(path.join(config.workspaceRoot ?? \"./\", \"package-lock.json\"))\n ) {\n errors.push(\n 'Invalid occurrence of \"package-lock.json\" file. Please remove it and use only \"pnpm-lock.yaml\"'\n );\n }\n if (fs.existsSync(path.join(config.workspaceRoot ?? \"./\", \"yarn.lock\"))) {\n errors.push(\n 'Invalid occurrence of \"yarn.lock\" file. Please remove it and use only \"pnpm-lock.yaml\"'\n );\n }\n\n try {\n const content = await readFile(\n path.join(config.workspaceRoot ?? \"./\", \"pnpm-lock.yaml\"),\n {\n encoding: \"utf8\"\n }\n );\n if (content?.match(/localhost:487/)) {\n errors.push(\n 'The \"pnpm-lock.yaml\" has reference to local repository (\"localhost:4873\"). Please use ensure you disable local registry before running \"pnpm i\"'\n );\n }\n if (content?.match(/resolution: \\{tarball/)) {\n errors.push(\n 'The \"pnpm-lock.yaml\" has reference to tarball package. Please use npm registry only'\n );\n }\n } catch {\n errors.push('The \"pnpm-lock.yaml\" does not exist or cannot be read');\n }\n\n if (errors.length > 0) {\n throw new Error(\n \"❌ Lock file validation failed\" + \"\\n\" + errors.join(\"\\n\")\n );\n }\n\n writeSuccess(\"✔ Lock file is valid for push\", config);\n\n // run(config, \"git lfs pre-push origin\");\n\n // try {\n // run(config, \"git-lfs version\");\n // } catch (error) {\n // throw new Error(\n // `This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\\nError: ${\n // (error as Error)?.message\n // }`\n // );\n // }\n\n // run(config, \"git lfs pre-push origin\");\n}\n"]}
package/bin/git.cjs CHANGED
@@ -6,7 +6,7 @@ var chunk5Z6RONLO_cjs = require('./chunk-5Z6RONLO.cjs');
6
6
  var chunkLOG3DPPQ_cjs = require('./chunk-LOG3DPPQ.cjs');
7
7
  var chunkL5CIC5RM_cjs = require('./chunk-L5CIC5RM.cjs');
8
8
  require('./chunk-HIBBA263.cjs');
9
- var chunkOVGMWXXJ_cjs = require('./chunk-OVGMWXXJ.cjs');
9
+ var chunkWYYIBLO2_cjs = require('./chunk-WYYIBLO2.cjs');
10
10
  require('./chunk-YHZNDNCW.cjs');
11
11
  var chunkPRWPYXMH_cjs = require('./chunk-PRWPYXMH.cjs');
12
12
  var chunkFH5OSXAJ_cjs = require('./chunk-FH5OSXAJ.cjs');
@@ -4140,7 +4140,7 @@ async function prePushAction({ files }) {
4140
4140
  `${chunkHVR76UIF_cjs.brandIcon(_config)} Running the Storm pre-push git hook for ${files.length} files in the workspace...`,
4141
4141
  _config
4142
4142
  );
4143
- await chunkOVGMWXXJ_cjs.prePushHook(_config, files);
4143
+ await chunkWYYIBLO2_cjs.prePushHook(_config, files);
4144
4144
  chunkHVR76UIF_cjs.writeSuccess("\u2714 Pre-push hook completed successfully!\n", _config);
4145
4145
  } catch (error) {
4146
4146
  chunkHVR76UIF_cjs.writeFatal(
package/bin/git.js CHANGED
@@ -4,7 +4,7 @@ import { postCommitHook } from './chunk-ZSLNAQQG.js';
4
4
  import { postMergeHook } from './chunk-CW2LOJGK.js';
5
5
  import { preCommitHook } from './chunk-WBM5EHOT.js';
6
6
  import './chunk-2RGP4ACE.js';
7
- import { prePushHook } from './chunk-NBAUOCB4.js';
7
+ import { prePushHook } from './chunk-XY4WATTM.js';
8
8
  import './chunk-HBLWPOJV.js';
9
9
  import { prepareHook } from './chunk-2QLTCKJS.js';
10
10
  import { run } from './chunk-G3YPGVPS.js';
package/bin/pre-push.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- var chunkOVGMWXXJ_cjs = require('./chunk-OVGMWXXJ.cjs');
4
+ var chunkWYYIBLO2_cjs = require('./chunk-WYYIBLO2.cjs');
5
5
  require('./chunk-YHZNDNCW.cjs');
6
6
  var chunkHVR76UIF_cjs = require('./chunk-HVR76UIF.cjs');
7
7
 
@@ -9,7 +9,7 @@ var chunkHVR76UIF_cjs = require('./chunk-HVR76UIF.cjs');
9
9
  void (async () => {
10
10
  const config = await chunkHVR76UIF_cjs.getConfig();
11
11
  try {
12
- await chunkOVGMWXXJ_cjs.prePushHook(config, process.argv.slice(2));
12
+ await chunkWYYIBLO2_cjs.prePushHook(config, process.argv.slice(2));
13
13
  chunkHVR76UIF_cjs.exitWithSuccess(config);
14
14
  } catch (error) {
15
15
  chunkHVR76UIF_cjs.writeFatal(
package/bin/pre-push.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { prePushHook } from './chunk-NBAUOCB4.js';
2
+ import { prePushHook } from './chunk-XY4WATTM.js';
3
3
  import './chunk-HBLWPOJV.js';
4
4
  import { getConfig, exitWithSuccess, writeFatal, exitWithError } from './chunk-5VMV7N3G.js';
5
5
 
@@ -14,7 +14,7 @@ var path__default = /*#__PURE__*/_interopDefault(path);
14
14
  async function prePushHook(config, files) {
15
15
  chunkOZEUXY3F_cjs.writeInfo("Running pre-push hook...", config);
16
16
  chunkQCNDIFYQ_cjs.checkPackageVersion(files);
17
- chunkOZEUXY3F_cjs.writeInfo("\u{1F512}\u{1F512}\u{1F512} Validating lock files \u{1F512}\u{1F512}\u{1F512}\n", config);
17
+ chunkOZEUXY3F_cjs.writeInfo("\u{1F512}\u{1F512}\u{1F512} Validating lock files \u{1F512}\u{1F512}\u{1F512}", config);
18
18
  const errors = [];
19
19
  if (fs__default.default.existsSync(path__default.default.join(config.workspaceRoot ?? "./", "package-lock.json"))) {
20
20
  errors.push(
@@ -51,7 +51,7 @@ async function prePushHook(config, files) {
51
51
  "\u274C Lock file validation failed\n" + errors.join("\n")
52
52
  );
53
53
  }
54
- chunkOZEUXY3F_cjs.writeSuccess(" \u2714 Lock file is valid for push", config);
54
+ chunkOZEUXY3F_cjs.writeSuccess("\u2714 Lock file is valid for push", config);
55
55
  }
56
56
 
57
57
  exports.prePushHook = prePushHook;
@@ -7,7 +7,7 @@ import path from 'node:path';
7
7
  async function prePushHook(config, files) {
8
8
  writeInfo("Running pre-push hook...", config);
9
9
  checkPackageVersion(files);
10
- writeInfo("\u{1F512}\u{1F512}\u{1F512} Validating lock files \u{1F512}\u{1F512}\u{1F512}\n", config);
10
+ writeInfo("\u{1F512}\u{1F512}\u{1F512} Validating lock files \u{1F512}\u{1F512}\u{1F512}", config);
11
11
  const errors = [];
12
12
  if (fs.existsSync(path.join(config.workspaceRoot ?? "./", "package-lock.json"))) {
13
13
  errors.push(
@@ -44,7 +44,7 @@ async function prePushHook(config, files) {
44
44
  "\u274C Lock file validation failed\n" + errors.join("\n")
45
45
  );
46
46
  }
47
- writeSuccess(" \u2714 Lock file is valid for push", config);
47
+ writeSuccess("\u2714 Lock file is valid for push", config);
48
48
  }
49
49
 
50
50
  export { prePushHook };
package/dist/index.cjs CHANGED
@@ -6,7 +6,7 @@ require('./chunk-CT6VGZZS.cjs');
6
6
  require('./chunk-4VPJA7YJ.cjs');
7
7
  var chunkYBAE6I5L_cjs = require('./chunk-YBAE6I5L.cjs');
8
8
  require('./chunk-ENL3GCXS.cjs');
9
- var chunkO56OC5QZ_cjs = require('./chunk-O56OC5QZ.cjs');
9
+ var chunk2R2374NN_cjs = require('./chunk-2R2374NN.cjs');
10
10
  var chunkMC3B4RZP_cjs = require('./chunk-MC3B4RZP.cjs');
11
11
  var chunkHZMRQVJW_cjs = require('./chunk-HZMRQVJW.cjs');
12
12
  var chunkHDNOJ6YK_cjs = require('./chunk-HDNOJ6YK.cjs');
@@ -57,7 +57,7 @@ Object.defineProperty(exports, "DEFAULT_COMMIT_PROMPT_MESSAGES", {
57
57
  });
58
58
  Object.defineProperty(exports, "prePushHook", {
59
59
  enumerable: true,
60
- get: function () { return chunkO56OC5QZ_cjs.prePushHook; }
60
+ get: function () { return chunk2R2374NN_cjs.prePushHook; }
61
61
  });
62
62
  Object.defineProperty(exports, "prepareHook", {
63
63
  enumerable: true,
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import './chunk-WCAKLYL2.js';
4
4
  import './chunk-3GGWHKRP.js';
5
5
  export { DEFAULT_COMMIT_PROMPT_MESSAGES } from './chunk-5XU2KBM6.js';
6
6
  import './chunk-Q47SPRY7.js';
7
- export { prePushHook } from './chunk-7YZQR2LH.js';
7
+ export { prePushHook } from './chunk-4RAEKSGE.js';
8
8
  export { prepareHook } from './chunk-GEBZ74NA.js';
9
9
  export { postCheckoutHook } from './chunk-JXKM22DX.js';
10
10
  export { postCommitHook } from './chunk-ZRFCAV5X.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/git-tools",
3
- "version": "2.130.38",
3
+ "version": "2.130.39",
4
4
  "private": false,
5
5
  "description": "Tools for managing Git repositories within a Nx workspace.",
6
6
  "keywords": [
@@ -225,5 +225,5 @@
225
225
  "packageManager": "pnpm@10.3.0",
226
226
  "engines": { "node": ">=22.4.0", "pnpm": ">=10.3.0" },
227
227
  "publishConfig": { "access": "public" },
228
- "gitHead": "07683ca13c988d45253edcd947640ab1a7f31e25"
228
+ "gitHead": "3cc40acb6729318059f54dc4c6b494d14ca887ee"
229
229
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/hooks/pre-push.ts"],"names":[],"mappings":";;;;;;AASA,eAAsB,WAAA,CACpB,QACA,KAAA,EACA;AACA,EAAA,SAAA,CAAU,4BAA4B,MAAM,CAAA;AAC5C,EAAA,mBAAA,CAAoB,KAAK,CAAA;AAEzB,EAAA,SAAA,CAAU,mFAAyC,MAAM,CAAA;AAEzD,EAAA,MAAM,SAAS,EAAC;AAChB,EAAA,IACE,EAAA,CAAG,WAAW,IAAA,CAAK,IAAA,CAAK,OAAO,aAAA,IAAiB,IAAA,EAAM,mBAAmB,CAAC,CAAA,EAC1E;AACA,IAAA,MAAA,CAAO,IAAA;AAAA,MACL;AAAA,KACF;AAAA,EACF;AACA,EAAA,IAAI,EAAA,CAAG,WAAW,IAAA,CAAK,IAAA,CAAK,OAAO,aAAA,IAAiB,IAAA,EAAM,WAAW,CAAC,CAAA,EAAG;AACvE,IAAA,MAAA,CAAO,IAAA;AAAA,MACL;AAAA,KACF;AAAA,EACF;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,UAAU,MAAM,QAAA;AAAA,MACpB,IAAA,CAAK,IAAA,CAAK,MAAA,CAAO,aAAA,IAAiB,MAAM,gBAAgB,CAAA;AAAA,MACxD;AAAA,QACE,QAAA,EAAU;AAAA;AACZ,KACF;AACA,IAAA,IAAI,OAAA,EAAS,KAAA,CAAM,eAAe,CAAA,EAAG;AACnC,MAAA,MAAA,CAAO,IAAA;AAAA,QACL;AAAA,OACF;AAAA,IACF;AACA,IAAA,IAAI,OAAA,EAAS,KAAA,CAAM,uBAAuB,CAAA,EAAG;AAC3C,MAAA,MAAA,CAAO,IAAA;AAAA,QACL;AAAA,OACF;AAAA,IACF;AAAA,EACF,CAAA,CAAA,MAAQ;AACN,IAAA,MAAA,CAAO,KAAK,uDAAuD,CAAA;AAAA,EACrE;AAEA,EAAA,IAAI,MAAA,CAAO,SAAS,CAAA,EAAG;AACrB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,sCAAA,GAAyC,MAAA,CAAO,IAAA,CAAK,IAAI;AAAA,KAC3D;AAAA,EACF;AAEA,EAAA,YAAA,CAAa,uCAAkC,MAAM,CAAA;AAevD","file":"chunk-NBAUOCB4.js","sourcesContent":["#!/usr/bin/env node\n\nimport { StormWorkspaceConfig } from \"@storm-software/config\";\nimport { writeInfo, writeSuccess } from \"@storm-software/config-tools\";\nimport fs from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { checkPackageVersion } from \"../utilities/check-package-version\";\n\nexport async function prePushHook(\n config: StormWorkspaceConfig,\n files: string[]\n) {\n writeInfo(\"Running pre-push hook...\", config);\n checkPackageVersion(files);\n\n writeInfo(\"🔒🔒🔒 Validating lock files 🔒🔒🔒\\n\", config);\n\n const errors = [] as string[];\n if (\n fs.existsSync(path.join(config.workspaceRoot ?? \"./\", \"package-lock.json\"))\n ) {\n errors.push(\n 'Invalid occurrence of \"package-lock.json\" file. Please remove it and use only \"pnpm-lock.yaml\"'\n );\n }\n if (fs.existsSync(path.join(config.workspaceRoot ?? \"./\", \"yarn.lock\"))) {\n errors.push(\n 'Invalid occurrence of \"yarn.lock\" file. Please remove it and use only \"pnpm-lock.yaml\"'\n );\n }\n\n try {\n const content = await readFile(\n path.join(config.workspaceRoot ?? \"./\", \"pnpm-lock.yaml\"),\n {\n encoding: \"utf8\"\n }\n );\n if (content?.match(/localhost:487/)) {\n errors.push(\n 'The \"pnpm-lock.yaml\" has reference to local repository (\"localhost:4873\"). Please use ensure you disable local registry before running \"pnpm i\"'\n );\n }\n if (content?.match(/resolution: \\{tarball/)) {\n errors.push(\n 'The \"pnpm-lock.yaml\" has reference to tarball package. Please use npm registry only'\n );\n }\n } catch {\n errors.push('The \"pnpm-lock.yaml\" does not exist or cannot be read');\n }\n\n if (errors.length > 0) {\n throw new Error(\n \"❌ Lock file validation failed\" + \"\\n\" + errors.join(\"\\n\")\n );\n }\n\n writeSuccess(\" ✔ Lock file is valid for push\", config);\n\n // run(config, \"git lfs pre-push origin\");\n\n // try {\n // run(config, \"git-lfs version\");\n // } catch (error) {\n // throw new Error(\n // `This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\\nError: ${\n // (error as Error)?.message\n // }`\n // );\n // }\n\n // run(config, \"git lfs pre-push origin\");\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/hooks/pre-push.ts"],"names":["writeInfo","checkPackageVersion","fs","path","readFile","writeSuccess"],"mappings":";;;;;;;;;;;;;AASA,eAAsB,WAAA,CACpB,QACA,KAAA,EACA;AACA,EAAAA,2BAAA,CAAU,4BAA4B,MAAM,CAAA;AAC5C,EAAAC,qCAAA,CAAoB,KAAK,CAAA;AAEzB,EAAAD,2BAAA,CAAU,mFAAyC,MAAM,CAAA;AAEzD,EAAA,MAAM,SAAS,EAAC;AAChB,EAAA,IACEE,mBAAA,CAAG,WAAWC,qBAAA,CAAK,IAAA,CAAK,OAAO,aAAA,IAAiB,IAAA,EAAM,mBAAmB,CAAC,CAAA,EAC1E;AACA,IAAA,MAAA,CAAO,IAAA;AAAA,MACL;AAAA,KACF;AAAA,EACF;AACA,EAAA,IAAID,mBAAA,CAAG,WAAWC,qBAAA,CAAK,IAAA,CAAK,OAAO,aAAA,IAAiB,IAAA,EAAM,WAAW,CAAC,CAAA,EAAG;AACvE,IAAA,MAAA,CAAO,IAAA;AAAA,MACL;AAAA,KACF;AAAA,EACF;AAEA,EAAA,IAAI;AACF,IAAA,MAAM,UAAU,MAAMC,iBAAA;AAAA,MACpBD,qBAAA,CAAK,IAAA,CAAK,MAAA,CAAO,aAAA,IAAiB,MAAM,gBAAgB,CAAA;AAAA,MACxD;AAAA,QACE,QAAA,EAAU;AAAA;AACZ,KACF;AACA,IAAA,IAAI,OAAA,EAAS,KAAA,CAAM,eAAe,CAAA,EAAG;AACnC,MAAA,MAAA,CAAO,IAAA;AAAA,QACL;AAAA,OACF;AAAA,IACF;AACA,IAAA,IAAI,OAAA,EAAS,KAAA,CAAM,uBAAuB,CAAA,EAAG;AAC3C,MAAA,MAAA,CAAO,IAAA;AAAA,QACL;AAAA,OACF;AAAA,IACF;AAAA,EACF,CAAA,CAAA,MAAQ;AACN,IAAA,MAAA,CAAO,KAAK,uDAAuD,CAAA;AAAA,EACrE;AAEA,EAAA,IAAI,MAAA,CAAO,SAAS,CAAA,EAAG;AACrB,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,sCAAA,GAAyC,MAAA,CAAO,IAAA,CAAK,IAAI;AAAA,KAC3D;AAAA,EACF;AAEA,EAAAE,8BAAA,CAAa,uCAAkC,MAAM,CAAA;AAevD","file":"chunk-OVGMWXXJ.cjs","sourcesContent":["#!/usr/bin/env node\n\nimport { StormWorkspaceConfig } from \"@storm-software/config\";\nimport { writeInfo, writeSuccess } from \"@storm-software/config-tools\";\nimport fs from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { checkPackageVersion } from \"../utilities/check-package-version\";\n\nexport async function prePushHook(\n config: StormWorkspaceConfig,\n files: string[]\n) {\n writeInfo(\"Running pre-push hook...\", config);\n checkPackageVersion(files);\n\n writeInfo(\"🔒🔒🔒 Validating lock files 🔒🔒🔒\\n\", config);\n\n const errors = [] as string[];\n if (\n fs.existsSync(path.join(config.workspaceRoot ?? \"./\", \"package-lock.json\"))\n ) {\n errors.push(\n 'Invalid occurrence of \"package-lock.json\" file. Please remove it and use only \"pnpm-lock.yaml\"'\n );\n }\n if (fs.existsSync(path.join(config.workspaceRoot ?? \"./\", \"yarn.lock\"))) {\n errors.push(\n 'Invalid occurrence of \"yarn.lock\" file. Please remove it and use only \"pnpm-lock.yaml\"'\n );\n }\n\n try {\n const content = await readFile(\n path.join(config.workspaceRoot ?? \"./\", \"pnpm-lock.yaml\"),\n {\n encoding: \"utf8\"\n }\n );\n if (content?.match(/localhost:487/)) {\n errors.push(\n 'The \"pnpm-lock.yaml\" has reference to local repository (\"localhost:4873\"). Please use ensure you disable local registry before running \"pnpm i\"'\n );\n }\n if (content?.match(/resolution: \\{tarball/)) {\n errors.push(\n 'The \"pnpm-lock.yaml\" has reference to tarball package. Please use npm registry only'\n );\n }\n } catch {\n errors.push('The \"pnpm-lock.yaml\" does not exist or cannot be read');\n }\n\n if (errors.length > 0) {\n throw new Error(\n \"❌ Lock file validation failed\" + \"\\n\" + errors.join(\"\\n\")\n );\n }\n\n writeSuccess(\" ✔ Lock file is valid for push\", config);\n\n // run(config, \"git lfs pre-push origin\");\n\n // try {\n // run(config, \"git-lfs version\");\n // } catch (error) {\n // throw new Error(\n // `This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting .git/hooks/pre-push.\\nError: ${\n // (error as Error)?.message\n // }`\n // );\n // }\n\n // run(config, \"git lfs pre-push origin\");\n}\n"]}