screw-up 0.17.0 → 1.1.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.
@@ -1,11 +1,11 @@
1
1
  /*!
2
2
  * name: screw-up
3
- * version: 0.17.0
3
+ * version: 1.1.0
4
4
  * description: Simply package metadata inserter on Vite plugin
5
5
  * author: Kouji Matsui (@kekyo@mi.kekyo.net)
6
6
  * license: MIT
7
7
  * repository.url: https://github.com/kekyo/screw-up.git
8
- * git.commit.hash: 6ca2d4183d3123c9e0cf7aa444bdb85c1e60e9fb
8
+ * git.commit.hash: 379e392faba0e8bd008ed386eb113cdee3c79de9
9
9
  */
10
10
  "use strict";
11
11
  const fs = require("fs");
@@ -1760,7 +1760,15 @@ const getRelatedTags = async (repositoryPath, commitHash) => {
1760
1760
  for (const tagName of tags) {
1761
1761
  try {
1762
1762
  const tagOid = await git__namespace.resolveRef({ fs: fs__namespace, dir: repositoryPath, ref: `refs/tags/${tagName}` });
1763
- if (tagOid === commitHash) {
1763
+ let targetCommitOid = tagOid;
1764
+ try {
1765
+ const tagObject = await git__namespace.readTag({ fs: fs__namespace, dir: repositoryPath, oid: tagOid });
1766
+ if (tagObject && tagObject.tag.object) {
1767
+ targetCommitOid = tagObject.tag.object;
1768
+ }
1769
+ } catch (e) {
1770
+ }
1771
+ if (targetCommitOid === commitHash) {
1764
1772
  const version = parseVersion(tagName);
1765
1773
  if (version && isValidVersion(version)) {
1766
1774
  tagInfos.push({
@@ -1791,7 +1799,15 @@ const getRelatedTagsForVersioning = async (repositoryPath, commitHash) => {
1791
1799
  for (const tagName of tags) {
1792
1800
  try {
1793
1801
  const tagOid = await git__namespace.resolveRef({ fs: fs__namespace, dir: repositoryPath, ref: `refs/tags/${tagName}` });
1794
- if (tagOid === commitHash) {
1802
+ let targetCommitOid = tagOid;
1803
+ try {
1804
+ const tagObject = await git__namespace.readTag({ fs: fs__namespace, dir: repositoryPath, oid: tagOid });
1805
+ if (tagObject && tagObject.tag.object) {
1806
+ targetCommitOid = tagObject.tag.object;
1807
+ }
1808
+ } catch (e) {
1809
+ }
1810
+ if (targetCommitOid === commitHash) {
1795
1811
  const version = parseVersion(tagName);
1796
1812
  if (version && isValidVersion(version)) {
1797
1813
  tagInfos.push({
@@ -1956,4 +1972,4 @@ exports.getFetchGitMetadata = getFetchGitMetadata;
1956
1972
  exports.replacePeerDependenciesWildcards = replacePeerDependenciesWildcards;
1957
1973
  exports.resolvePackageMetadata = resolvePackageMetadata;
1958
1974
  exports.resolveRawPackageJsonObject = resolveRawPackageJsonObject;
1959
- //# sourceMappingURL=analyzer-BxxtJjNH.cjs.map
1975
+ //# sourceMappingURL=analyzer-DtoN0my1.cjs.map