zotero-plugin-scaffold 0.7.1 → 0.7.2

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/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import process from 'node:process';
2
2
  import { Command } from 'commander';
3
- import { E as ExitSignals, C as Config, B as Build, S as Serve, T as Test, R as Release } from './shared/zotero-plugin-scaffold.BLTrbfUc.mjs';
3
+ import { E as ExitSignals, C as Config, B as Build, S as Serve, T as Test, R as Release } from './shared/zotero-plugin-scaffold.CTJf9uCe.mjs';
4
4
  import { readFile } from 'node:fs/promises';
5
5
  import { pathExists } from 'fs-extra';
6
6
  import { l as logger } from './shared/zotero-plugin-scaffold.CzBjWbS8.mjs';
@@ -36,7 +36,7 @@ import 'node:http';
36
36
  import 'node:readline';
37
37
 
38
38
  const name = "zotero-plugin-scaffold";
39
- const version = "0.7.1";
39
+ const version = "0.7.2";
40
40
  const pkg = {
41
41
  name: name,
42
42
  version: version};
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { B as Build, C as Config, R as Release, S as Serve, T as Test, d as defineConfig } from './shared/zotero-plugin-scaffold.BLTrbfUc.mjs';
1
+ export { B as Build, C as Config, R as Release, S as Serve, T as Test, d as defineConfig } from './shared/zotero-plugin-scaffold.CTJf9uCe.mjs';
2
2
  import 'c12';
3
3
  import 'es-toolkit';
4
4
  import 'fs-extra/esm';
@@ -2732,6 +2732,52 @@ async function getGitDiff(from, to = "HEAD", cwd) {
2732
2732
  return r2;
2733
2733
  });
2734
2734
  }
2735
+ function parseCommits(commits, config) {
2736
+ return commits.map((commit) => parseGitCommit(commit, config)).filter(Boolean);
2737
+ }
2738
+ const ConventionalCommitRegex = /(?<emoji>:.+:|(\uD83C[\uDF00-\uDFFF])|(\uD83D[\uDC00-\uDE4F\uDE80-\uDEFF])|[\u2600-\u2B55])?( *)?(?<type>[a-z]+)(\((?<scope>.+)\))?(?<breaking>!)?: (?<description>.+)/i;
2739
+ const CoAuthoredByRegex = /co-authored-by:\s*(?<name>.+)(<(?<email>.+)>)/gim;
2740
+ const PullRequestRE = /\([ a-z]*(#\d+)\s*\)/gm;
2741
+ const IssueRE = /(#\d+)/gm;
2742
+ function parseGitCommit(commit, config) {
2743
+ const match = commit.message.match(ConventionalCommitRegex);
2744
+ if (!match) {
2745
+ return null;
2746
+ }
2747
+ const type = match.groups.type;
2748
+ const hasBreakingBody = /breaking change:/i.test(commit.body);
2749
+ let scope = match.groups.scope || "";
2750
+ scope = config.scopeMap[scope] || scope;
2751
+ const isBreaking = Boolean(match.groups.breaking || hasBreakingBody);
2752
+ let description = match.groups.description;
2753
+ const references = [];
2754
+ for (const m of description.matchAll(PullRequestRE)) {
2755
+ references.push({ type: "pull-request", value: m[1] });
2756
+ }
2757
+ for (const m of description.matchAll(IssueRE)) {
2758
+ if (!references.some((i) => i.value === m[1])) {
2759
+ references.push({ type: "issue", value: m[1] });
2760
+ }
2761
+ }
2762
+ references.push({ value: commit.shortHash, type: "hash" });
2763
+ description = description.replace(PullRequestRE, "").trim();
2764
+ const authors = [commit.author];
2765
+ for (const match2 of commit.body.matchAll(CoAuthoredByRegex)) {
2766
+ authors.push({
2767
+ name: (match2.groups.name || "").trim(),
2768
+ email: (match2.groups.email || "").trim()
2769
+ });
2770
+ }
2771
+ return {
2772
+ ...commit,
2773
+ authors,
2774
+ description,
2775
+ type,
2776
+ scope,
2777
+ references,
2778
+ isBreaking
2779
+ };
2780
+ }
2735
2781
 
2736
2782
  const providerToRefSpec = {
2737
2783
  github: { "pull-request": "pull", hash: "commit", issue: "issues" },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zotero-plugin-scaffold",
3
3
  "type": "module",
4
- "version": "0.7.1",
4
+ "version": "0.7.2",
5
5
  "description": "A scaffold for Zotero plugin development.",
6
6
  "author": "northword",
7
7
  "license": "AGPL-3.0-or-later",
@@ -55,13 +55,13 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@fluent/syntax": "^0.19.0",
58
- "@swc/core": "^1.12.0",
58
+ "@swc/core": "^1.12.9",
59
59
  "adm-zip": "^0.5.16",
60
- "bumpp": "^10.1.1",
60
+ "bumpp": "^10.2.0",
61
61
  "c12": "^3.0.4",
62
62
  "chokidar": "^4.0.3",
63
63
  "commander": "^14.0.0",
64
- "es-toolkit": "^1.39.3",
64
+ "es-toolkit": "^1.39.5",
65
65
  "esbuild": "^0.25.5",
66
66
  "fs-extra": "^11.3.0",
67
67
  "hookable": "^5.5.3",
@@ -72,22 +72,22 @@
72
72
  "xvfb-ts": "^1.1.0"
73
73
  },
74
74
  "devDependencies": {
75
- "@antfu/eslint-config": "^4.14.1",
75
+ "@antfu/eslint-config": "^4.16.1",
76
76
  "@commander-js/extra-typings": "^14.0.0",
77
77
  "@types/adm-zip": "^0.5.7",
78
78
  "@types/fs-extra": "^11.0.4",
79
- "@types/node": "^22.15.31",
80
- "bumpp": "^10.1.1",
79
+ "@types/node": "^22.15.34",
80
+ "bumpp": "^10.2.0",
81
81
  "changelogen": "^0.6.1",
82
- "eslint": "^9.28.0",
82
+ "eslint": "^9.30.0",
83
83
  "eslint-plugin-format": "^1.0.1",
84
84
  "husky": "^9.1.7",
85
- "lint-staged": "^16.1.0",
85
+ "lint-staged": "^16.1.2",
86
86
  "node-style-text": "^0.0.8",
87
- "tsx": "^4.20.1",
87
+ "tsx": "^4.20.3",
88
88
  "typescript": "^5.8.3",
89
89
  "unbuild": "^3.5.0",
90
- "vitest": "^3.2.3"
90
+ "vitest": "^3.2.4"
91
91
  },
92
92
  "workspaces": [
93
93
  "src",