@verdaccio/package-filter 14.0.0-next-9.30

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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +277 -0
  3. package/build/_virtual/_rolldown/runtime.js +23 -0
  4. package/build/config/parser.d.ts +2 -0
  5. package/build/config/parser.js +56 -0
  6. package/build/config/parser.js.map +1 -0
  7. package/build/config/parser.mjs +54 -0
  8. package/build/config/parser.mjs.map +1 -0
  9. package/build/config/types.d.ts +39 -0
  10. package/build/filtering/matcher.d.ts +8 -0
  11. package/build/filtering/matcher.js +71 -0
  12. package/build/filtering/matcher.js.map +1 -0
  13. package/build/filtering/matcher.mjs +69 -0
  14. package/build/filtering/matcher.mjs.map +1 -0
  15. package/build/filtering/packageVersion.d.ts +20 -0
  16. package/build/filtering/packageVersion.js +129 -0
  17. package/build/filtering/packageVersion.js.map +1 -0
  18. package/build/filtering/packageVersion.mjs +127 -0
  19. package/build/filtering/packageVersion.mjs.map +1 -0
  20. package/build/filtering/publishDate.d.ts +6 -0
  21. package/build/filtering/publishDate.js +33 -0
  22. package/build/filtering/publishDate.js.map +1 -0
  23. package/build/filtering/publishDate.mjs +31 -0
  24. package/build/filtering/publishDate.mjs.map +1 -0
  25. package/build/filtering/types.d.ts +24 -0
  26. package/build/filtering/types.js +11 -0
  27. package/build/filtering/types.js.map +1 -0
  28. package/build/filtering/types.mjs +11 -0
  29. package/build/filtering/types.mjs.map +1 -0
  30. package/build/index.d.ts +3 -0
  31. package/build/index.js +12 -0
  32. package/build/index.js.map +1 -0
  33. package/build/index.mjs +7 -0
  34. package/build/index.mjs.map +1 -0
  35. package/build/packageFilter.d.ts +10 -0
  36. package/build/packageFilter.js +80 -0
  37. package/build/packageFilter.js.map +1 -0
  38. package/build/packageFilter.mjs +78 -0
  39. package/build/packageFilter.mjs.map +1 -0
  40. package/build/utils/jsonUtils.d.ts +1 -0
  41. package/build/utils/jsonUtils.js +12 -0
  42. package/build/utils/jsonUtils.js.map +1 -0
  43. package/build/utils/jsonUtils.mjs +11 -0
  44. package/build/utils/jsonUtils.mjs.map +1 -0
  45. package/build/utils/manifestUtils.d.ts +36 -0
  46. package/build/utils/manifestUtils.js +115 -0
  47. package/build/utils/manifestUtils.js.map +1 -0
  48. package/build/utils/manifestUtils.mjs +107 -0
  49. package/build/utils/manifestUtils.mjs.map +1 -0
  50. package/package.json +73 -0
@@ -0,0 +1,78 @@
1
+ import { parseConfig } from "./config/parser.mjs";
2
+ import { filterBlockedVersions } from "./filtering/packageVersion.mjs";
3
+ import { filterVersionsByPublishDate } from "./filtering/publishDate.mjs";
4
+ import { jsonLogReplacer } from "./utils/jsonUtils.mjs";
5
+ import { cleanupDistFiles, cleanupTags, cleanupTime, getManifestClone, setupCreatedAndModified, setupLatestTag } from "./utils/manifestUtils.mjs";
6
+ import buildDebug from "debug";
7
+ import { pluginUtils } from "@verdaccio/core";
8
+ //#region src/packageFilter.ts
9
+ var debug = buildDebug("verdaccio:plugin:package-filter");
10
+ var PackageFilterPlugin = class extends pluginUtils.Plugin {
11
+ config;
12
+ parsedConfig;
13
+ logger;
14
+ constructor(config, options) {
15
+ super(config, options);
16
+ this.config = config ?? {};
17
+ this.logger = options.logger;
18
+ this.parsedConfig = parseConfig(this.config);
19
+ debug("plugin loaded: block rules: %d, allow rules: %d", this.parsedConfig.blockRules.size, this.parsedConfig.allowRules.size);
20
+ this.logger.debug({ config: JSON.stringify(this.parsedConfig, jsonLogReplacer) }, "package-filter loaded with config: @{config}");
21
+ this.logger.trace({
22
+ blockRules: this.parsedConfig.blockRules.size,
23
+ allowRules: this.parsedConfig.allowRules.size
24
+ }, "package-filter plugin initialized: @{blockRules} block rules, @{allowRules} allow rules");
25
+ if (this.parsedConfig.dateThreshold) {
26
+ debug("date threshold: %s", this.parsedConfig.dateThreshold.toISOString());
27
+ this.logger.trace({ dateThreshold: this.parsedConfig.dateThreshold.toISOString() }, "package-filter date threshold: @{dateThreshold}");
28
+ }
29
+ if (this.parsedConfig.minAgeMs) {
30
+ const minAgeDays = this.parsedConfig.minAgeMs / (1440 * 60 * 1e3);
31
+ debug("min age: %d days", minAgeDays);
32
+ this.logger.trace({ minAgeDays }, "package-filter min age: @{minAgeDays} days");
33
+ }
34
+ }
35
+ async filter_metadata(manifest) {
36
+ const { dateThreshold, minAgeMs, blockRules, allowRules } = this.parsedConfig;
37
+ const versionCount = Object.keys(manifest.versions ?? {}).length;
38
+ debug("filtering manifest for %s (%d versions)", manifest.name, versionCount);
39
+ this.logger.trace({
40
+ name: manifest.name,
41
+ versionCount
42
+ }, "package-filter processing @{name} (@{versionCount} versions)");
43
+ let newManifest = getManifestClone(manifest);
44
+ if (blockRules.size > 0) newManifest = filterBlockedVersions(newManifest, blockRules, allowRules, this.logger);
45
+ let earliestDateThreshold = null;
46
+ if (minAgeMs) earliestDateThreshold = new Date(Date.now() - minAgeMs);
47
+ if (dateThreshold && (!earliestDateThreshold || dateThreshold < earliestDateThreshold)) earliestDateThreshold = dateThreshold;
48
+ if (earliestDateThreshold) {
49
+ debug("applying date filter for %s, threshold: %s", manifest.name, earliestDateThreshold.toISOString());
50
+ this.logger.trace({
51
+ name: manifest.name,
52
+ threshold: earliestDateThreshold.toISOString()
53
+ }, "applying date filter for @{name}, cutoff: @{threshold}");
54
+ newManifest = filterVersionsByPublishDate(newManifest, earliestDateThreshold, allowRules);
55
+ }
56
+ cleanupTags(newManifest);
57
+ setupLatestTag(newManifest);
58
+ cleanupTime(newManifest);
59
+ setupCreatedAndModified(newManifest);
60
+ cleanupDistFiles(newManifest);
61
+ const filteredCount = Object.keys(newManifest.versions).length;
62
+ const removedCount = versionCount - filteredCount;
63
+ if (filteredCount !== versionCount) {
64
+ debug("filtered %s: %d -> %d versions (%d removed)", manifest.name, versionCount, filteredCount, removedCount);
65
+ this.logger.trace({
66
+ name: manifest.name,
67
+ before: versionCount,
68
+ after: filteredCount,
69
+ removed: removedCount
70
+ }, "package-filter @{name}: @{before} -> @{after} versions (@{removed} removed)");
71
+ } else debug("no versions filtered for %s", manifest.name);
72
+ return newManifest;
73
+ }
74
+ };
75
+ //#endregion
76
+ export { PackageFilterPlugin };
77
+
78
+ //# sourceMappingURL=packageFilter.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"packageFilter.mjs","names":[],"sources":["../src/packageFilter.ts"],"sourcesContent":["import buildDebug from 'debug';\n\nimport { pluginUtils } from '@verdaccio/core';\nimport type { Logger, Manifest } from '@verdaccio/types';\n\nimport { parseConfig } from './config/parser';\nimport type { ParsedConfig, PluginConfig } from './config/types';\nimport { filterBlockedVersions } from './filtering/packageVersion';\nimport { filterVersionsByPublishDate } from './filtering/publishDate';\nimport { jsonLogReplacer } from './utils/jsonUtils';\nimport {\n cleanupDistFiles,\n cleanupTags,\n cleanupTime,\n getManifestClone,\n setupCreatedAndModified,\n setupLatestTag,\n} from './utils/manifestUtils';\n\nconst debug = buildDebug('verdaccio:plugin:package-filter');\n\nexport class PackageFilterPlugin\n extends pluginUtils.Plugin<PluginConfig>\n implements pluginUtils.ManifestFilter<PluginConfig>\n{\n public readonly config: PluginConfig;\n private readonly parsedConfig: ParsedConfig;\n protected readonly logger: Logger;\n\n public constructor(config: PluginConfig, options: pluginUtils.PluginOptions) {\n super(config, options);\n this.config = config ?? {};\n this.logger = options.logger;\n this.parsedConfig = parseConfig(this.config);\n\n debug(\n 'plugin loaded: block rules: %d, allow rules: %d',\n this.parsedConfig.blockRules.size,\n this.parsedConfig.allowRules.size\n );\n this.logger.debug(\n { config: JSON.stringify(this.parsedConfig, jsonLogReplacer) },\n 'package-filter loaded with config: @{config}'\n );\n this.logger.trace(\n {\n blockRules: this.parsedConfig.blockRules.size,\n allowRules: this.parsedConfig.allowRules.size,\n },\n 'package-filter plugin initialized: @{blockRules} block rules, @{allowRules} allow rules'\n );\n if (this.parsedConfig.dateThreshold) {\n debug('date threshold: %s', this.parsedConfig.dateThreshold.toISOString());\n this.logger.trace(\n { dateThreshold: this.parsedConfig.dateThreshold.toISOString() },\n 'package-filter date threshold: @{dateThreshold}'\n );\n }\n if (this.parsedConfig.minAgeMs) {\n const minAgeDays = this.parsedConfig.minAgeMs / (24 * 60 * 60 * 1000);\n debug('min age: %d days', minAgeDays);\n this.logger.trace({ minAgeDays }, 'package-filter min age: @{minAgeDays} days');\n }\n }\n\n public async filter_metadata(manifest: Readonly<Manifest>): Promise<Manifest> {\n const { dateThreshold, minAgeMs, blockRules, allowRules } = this.parsedConfig;\n const versionCount = Object.keys(manifest.versions ?? {}).length;\n debug('filtering manifest for %s (%d versions)', manifest.name, versionCount);\n this.logger.trace(\n { name: manifest.name, versionCount },\n 'package-filter processing @{name} (@{versionCount} versions)'\n );\n\n let newManifest = getManifestClone(manifest);\n if (blockRules.size > 0) {\n newManifest = filterBlockedVersions(newManifest, blockRules, allowRules, this.logger);\n }\n\n let earliestDateThreshold: Date | null = null;\n if (minAgeMs) {\n earliestDateThreshold = new Date(Date.now() - minAgeMs);\n }\n\n if (dateThreshold && (!earliestDateThreshold || dateThreshold < earliestDateThreshold)) {\n earliestDateThreshold = dateThreshold;\n }\n\n if (earliestDateThreshold) {\n debug(\n 'applying date filter for %s, threshold: %s',\n manifest.name,\n earliestDateThreshold.toISOString()\n );\n this.logger.trace(\n { name: manifest.name, threshold: earliestDateThreshold.toISOString() },\n 'applying date filter for @{name}, cutoff: @{threshold}'\n );\n newManifest = filterVersionsByPublishDate(newManifest, earliestDateThreshold, allowRules);\n }\n\n cleanupTags(newManifest);\n setupLatestTag(newManifest);\n cleanupTime(newManifest);\n setupCreatedAndModified(newManifest);\n cleanupDistFiles(newManifest);\n\n const filteredCount = Object.keys(newManifest.versions).length;\n const removedCount = versionCount - filteredCount;\n if (filteredCount !== versionCount) {\n debug(\n 'filtered %s: %d -> %d versions (%d removed)',\n manifest.name,\n versionCount,\n filteredCount,\n removedCount\n );\n this.logger.trace(\n { name: manifest.name, before: versionCount, after: filteredCount, removed: removedCount },\n 'package-filter @{name}: @{before} -> @{after} versions (@{removed} removed)'\n );\n } else {\n debug('no versions filtered for %s', manifest.name);\n }\n\n return newManifest;\n }\n}\n"],"mappings":";;;;;;;;AAmBA,IAAM,QAAQ,WAAW,kCAAkC;AAE3D,IAAa,sBAAb,cACU,YAAY,OAEtB;CACE;CACA;CACA;CAEA,YAAmB,QAAsB,SAAoC;AAC3E,QAAM,QAAQ,QAAQ;AACtB,OAAK,SAAS,UAAU,EAAE;AAC1B,OAAK,SAAS,QAAQ;AACtB,OAAK,eAAe,YAAY,KAAK,OAAO;AAE5C,QACE,mDACA,KAAK,aAAa,WAAW,MAC7B,KAAK,aAAa,WAAW,KAC9B;AACD,OAAK,OAAO,MACV,EAAE,QAAQ,KAAK,UAAU,KAAK,cAAc,gBAAgB,EAAE,EAC9D,+CACD;AACD,OAAK,OAAO,MACV;GACE,YAAY,KAAK,aAAa,WAAW;GACzC,YAAY,KAAK,aAAa,WAAW;GAC1C,EACD,0FACD;AACD,MAAI,KAAK,aAAa,eAAe;AACnC,SAAM,sBAAsB,KAAK,aAAa,cAAc,aAAa,CAAC;AAC1E,QAAK,OAAO,MACV,EAAE,eAAe,KAAK,aAAa,cAAc,aAAa,EAAE,EAChE,kDACD;;AAEH,MAAI,KAAK,aAAa,UAAU;GAC9B,MAAM,aAAa,KAAK,aAAa,YAAY,OAAU,KAAK;AAChE,SAAM,oBAAoB,WAAW;AACrC,QAAK,OAAO,MAAM,EAAE,YAAY,EAAE,6CAA6C;;;CAInF,MAAa,gBAAgB,UAAiD;EAC5E,MAAM,EAAE,eAAe,UAAU,YAAY,eAAe,KAAK;EACjE,MAAM,eAAe,OAAO,KAAK,SAAS,YAAY,EAAE,CAAC,CAAC;AAC1D,QAAM,2CAA2C,SAAS,MAAM,aAAa;AAC7E,OAAK,OAAO,MACV;GAAE,MAAM,SAAS;GAAM;GAAc,EACrC,+DACD;EAED,IAAI,cAAc,iBAAiB,SAAS;AAC5C,MAAI,WAAW,OAAO,EACpB,eAAc,sBAAsB,aAAa,YAAY,YAAY,KAAK,OAAO;EAGvF,IAAI,wBAAqC;AACzC,MAAI,SACF,yBAAwB,IAAI,KAAK,KAAK,KAAK,GAAG,SAAS;AAGzD,MAAI,kBAAkB,CAAC,yBAAyB,gBAAgB,uBAC9D,yBAAwB;AAG1B,MAAI,uBAAuB;AACzB,SACE,8CACA,SAAS,MACT,sBAAsB,aAAa,CACpC;AACD,QAAK,OAAO,MACV;IAAE,MAAM,SAAS;IAAM,WAAW,sBAAsB,aAAa;IAAE,EACvE,yDACD;AACD,iBAAc,4BAA4B,aAAa,uBAAuB,WAAW;;AAG3F,cAAY,YAAY;AACxB,iBAAe,YAAY;AAC3B,cAAY,YAAY;AACxB,0BAAwB,YAAY;AACpC,mBAAiB,YAAY;EAE7B,MAAM,gBAAgB,OAAO,KAAK,YAAY,SAAS,CAAC;EACxD,MAAM,eAAe,eAAe;AACpC,MAAI,kBAAkB,cAAc;AAClC,SACE,+CACA,SAAS,MACT,cACA,eACA,aACD;AACD,QAAK,OAAO,MACV;IAAE,MAAM,SAAS;IAAM,QAAQ;IAAc,OAAO;IAAe,SAAS;IAAc,EAC1F,8EACD;QAED,OAAM,+BAA+B,SAAS,KAAK;AAGrD,SAAO"}
@@ -0,0 +1 @@
1
+ export declare function jsonLogReplacer(_key: string, value: unknown): any;
@@ -0,0 +1,12 @@
1
+ require("../_virtual/_rolldown/runtime.js");
2
+ let semver = require("semver");
3
+ //#region src/utils/jsonUtils.ts
4
+ function jsonLogReplacer(_key, value) {
5
+ if (value instanceof Map) return Object.fromEntries(value);
6
+ if (value instanceof semver.Range) return value.range;
7
+ return value;
8
+ }
9
+ //#endregion
10
+ exports.jsonLogReplacer = jsonLogReplacer;
11
+
12
+ //# sourceMappingURL=jsonUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonUtils.js","names":[],"sources":["../../src/utils/jsonUtils.ts"],"sourcesContent":["import { Range } from 'semver';\n\nexport function jsonLogReplacer(_key: string, value: unknown) {\n if (value instanceof Map) {\n return Object.fromEntries(value);\n }\n\n if (value instanceof Range) {\n return value.range;\n }\n\n return value;\n}\n"],"mappings":";;;AAEA,SAAgB,gBAAgB,MAAc,OAAgB;AAC5D,KAAI,iBAAiB,IACnB,QAAO,OAAO,YAAY,MAAM;AAGlC,KAAI,iBAAiB,OAAA,MACnB,QAAO,MAAM;AAGf,QAAO"}
@@ -0,0 +1,11 @@
1
+ import { Range } from "semver";
2
+ //#region src/utils/jsonUtils.ts
3
+ function jsonLogReplacer(_key, value) {
4
+ if (value instanceof Map) return Object.fromEntries(value);
5
+ if (value instanceof Range) return value.range;
6
+ return value;
7
+ }
8
+ //#endregion
9
+ export { jsonLogReplacer };
10
+
11
+ //# sourceMappingURL=jsonUtils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonUtils.mjs","names":[],"sources":["../../src/utils/jsonUtils.ts"],"sourcesContent":["import { Range } from 'semver';\n\nexport function jsonLogReplacer(_key: string, value: unknown) {\n if (value instanceof Map) {\n return Object.fromEntries(value);\n }\n\n if (value instanceof Range) {\n return value.range;\n }\n\n return value;\n}\n"],"mappings":";;AAEA,SAAgB,gBAAgB,MAAc,OAAgB;AAC5D,KAAI,iBAAiB,IACnB,QAAO,OAAO,YAAY,MAAM;AAGlC,KAAI,iBAAiB,MACnB,QAAO,MAAM;AAGf,QAAO"}
@@ -0,0 +1,36 @@
1
+ import { Manifest } from '@verdaccio/types';
2
+ /**
3
+ * Delete `dist-tags` entries corresponding to missing versions.
4
+ */
5
+ export declare function cleanupTags(manifest: Manifest): void;
6
+ /**
7
+ * Delete `time` entries corresponding to missing versions.
8
+ */
9
+ export declare function cleanupTime(manifest: Manifest): void;
10
+ /**
11
+ * Get the latest version from a list of versions,
12
+ * ordered by time of their publication stored in the manifest.
13
+ */
14
+ export declare function getLatestVersion(manifest: Manifest, versions: string[]): string | undefined;
15
+ /**
16
+ * Set the latest tag if dist-tags/latest is missing.
17
+ * The last stable version available is used when possible.
18
+ * Otherwise, it uses the latest version not found in dist-tags.
19
+ */
20
+ export declare function setupLatestTag(manifest: Manifest): void;
21
+ /**
22
+ * Set the created and modified times.
23
+ */
24
+ export declare function setupCreatedAndModified(manifest: Manifest): void;
25
+ /**
26
+ * Remove `_distfiles` entries which are not used by any version.
27
+ */
28
+ export declare function cleanupDistFiles(manifest: Manifest): void;
29
+ /**
30
+ * Creates a copy of a manifest suitable for safe, localized mutation.
31
+ *
32
+ * The returned object is shallow-cloned, except for `versions`, `dist-tags`,
33
+ * `time`, and `_distfiles`, which are cloned as independent maps so they can be
34
+ * filtered or modified without affecting the original manifest.
35
+ */
36
+ export declare function getManifestClone(manifest: Readonly<Manifest>): Manifest;
@@ -0,0 +1,115 @@
1
+ const require_runtime = require("../_virtual/_rolldown/runtime.js");
2
+ let debug = require("debug");
3
+ debug = require_runtime.__toESM(debug);
4
+ let _verdaccio_core = require("@verdaccio/core");
5
+ let semver = require("semver");
6
+ semver = require_runtime.__toESM(semver);
7
+ //#region src/utils/manifestUtils.ts
8
+ var debug$1 = (0, debug.default)("verdaccio:plugin:package-filter:manifest");
9
+ /**
10
+ * Delete `dist-tags` entries corresponding to missing versions.
11
+ */
12
+ function cleanupTags(manifest) {
13
+ const distTags = manifest[_verdaccio_core.DIST_TAGS];
14
+ Object.entries(distTags).forEach(([tag, tagVersion]) => {
15
+ if (!manifest.versions[tagVersion]) {
16
+ debug$1("removing orphaned dist-tag %s -> %s from %s", tag, tagVersion, manifest.name);
17
+ delete distTags[tag];
18
+ }
19
+ });
20
+ }
21
+ /**
22
+ * Delete `time` entries corresponding to missing versions.
23
+ */
24
+ function cleanupTime(manifest) {
25
+ const time = manifest.time;
26
+ if (!time) return;
27
+ Object.keys(time).forEach((version) => {
28
+ if (!manifest.versions[version]) delete time[version];
29
+ });
30
+ }
31
+ /**
32
+ * Get the latest version from a list of versions,
33
+ * ordered by time of their publication stored in the manifest.
34
+ */
35
+ function getLatestVersion(manifest, versions) {
36
+ const time = manifest.time;
37
+ if (!time) return versions.sort(semver.default.rcompare)[0];
38
+ const timedVersions = versions.map((v) => ({
39
+ version: v,
40
+ time: time[v]
41
+ })).filter((v) => v.time);
42
+ if (timedVersions.length === 0) return;
43
+ return timedVersions.sort((a, b) => new Date(b.time).getTime() - new Date(a.time).getTime())[0].version;
44
+ }
45
+ /**
46
+ * Set the latest tag if dist-tags/latest is missing.
47
+ * The last stable version available is used when possible.
48
+ * Otherwise, it uses the latest version not found in dist-tags.
49
+ */
50
+ function setupLatestTag(manifest) {
51
+ const distTags = manifest[_verdaccio_core.DIST_TAGS];
52
+ if (distTags.latest) return;
53
+ const versions = Object.keys(manifest.versions);
54
+ if (versions.length === 0) return;
55
+ const distTagsVersions = Object.values(distTags);
56
+ const untaggedVersions = versions.filter((v) => semver.default.valid(v) && !distTagsVersions.includes(v));
57
+ if (untaggedVersions.length === 0) return;
58
+ const latestStableVersion = getLatestVersion(manifest, untaggedVersions.filter((v) => !semver.default.prerelease(v)));
59
+ if (latestStableVersion) {
60
+ debug$1("reassigned latest tag to stable version %s for %s", latestStableVersion, manifest.name);
61
+ distTags.latest = latestStableVersion;
62
+ return;
63
+ }
64
+ const latestVersion = getLatestVersion(manifest, untaggedVersions);
65
+ if (!latestVersion) return;
66
+ debug$1("reassigned latest tag to pre-release version %s for %s", latestVersion, manifest.name);
67
+ distTags.latest = latestVersion;
68
+ }
69
+ /**
70
+ * Set the created and modified times.
71
+ */
72
+ function setupCreatedAndModified(manifest) {
73
+ const time = manifest.time;
74
+ if (!time) return;
75
+ const times = Object.values(time);
76
+ if (times.length === 0) return;
77
+ const sortedTimes = times.sort((a, b) => new Date(a).getTime() - new Date(b).getTime());
78
+ time.created = sortedTimes[0];
79
+ time.modified = sortedTimes[sortedTimes.length - 1];
80
+ }
81
+ /**
82
+ * Remove `_distfiles` entries which are not used by any version.
83
+ */
84
+ function cleanupDistFiles(manifest) {
85
+ const distFiles = manifest._distfiles;
86
+ Object.entries(distFiles).forEach(([key, file]) => {
87
+ const fileUrl = file.url;
88
+ if (!Object.values(manifest.versions).find((v) => v.dist?.tarball === fileUrl)) delete distFiles[key];
89
+ });
90
+ }
91
+ /**
92
+ * Creates a copy of a manifest suitable for safe, localized mutation.
93
+ *
94
+ * The returned object is shallow-cloned, except for `versions`, `dist-tags`,
95
+ * `time`, and `_distfiles`, which are cloned as independent maps so they can be
96
+ * filtered or modified without affecting the original manifest.
97
+ */
98
+ function getManifestClone(manifest) {
99
+ return {
100
+ ...manifest,
101
+ versions: { ...manifest.versions },
102
+ [_verdaccio_core.DIST_TAGS]: { ...manifest[_verdaccio_core.DIST_TAGS] },
103
+ time: { ...manifest.time },
104
+ _distfiles: { ...manifest._distfiles }
105
+ };
106
+ }
107
+ //#endregion
108
+ exports.cleanupDistFiles = cleanupDistFiles;
109
+ exports.cleanupTags = cleanupTags;
110
+ exports.cleanupTime = cleanupTime;
111
+ exports.getManifestClone = getManifestClone;
112
+ exports.setupCreatedAndModified = setupCreatedAndModified;
113
+ exports.setupLatestTag = setupLatestTag;
114
+
115
+ //# sourceMappingURL=manifestUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifestUtils.js","names":[],"sources":["../../src/utils/manifestUtils.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport semver from 'semver';\n\nimport { DIST_TAGS } from '@verdaccio/core';\nimport type { Manifest } from '@verdaccio/types';\n\nconst debug = buildDebug('verdaccio:plugin:package-filter:manifest');\n\n/**\n * Delete `dist-tags` entries corresponding to missing versions.\n */\nexport function cleanupTags(manifest: Manifest): void {\n const distTags = manifest[DIST_TAGS];\n Object.entries(distTags).forEach(([tag, tagVersion]) => {\n if (!manifest.versions[tagVersion]) {\n debug('removing orphaned dist-tag %s -> %s from %s', tag, tagVersion, manifest.name);\n delete distTags[tag];\n }\n });\n}\n\n/**\n * Delete `time` entries corresponding to missing versions.\n */\nexport function cleanupTime(manifest: Manifest): void {\n const time = manifest.time;\n if (!time) {\n return;\n }\n\n Object.keys(time).forEach((version) => {\n if (!manifest.versions[version]) {\n delete time[version];\n }\n });\n}\n\n/**\n * Get the latest version from a list of versions,\n * ordered by time of their publication stored in the manifest.\n */\nexport function getLatestVersion(manifest: Manifest, versions: string[]): string | undefined {\n const time = manifest.time;\n if (!time) {\n // No time information, it's the best we can do\n const sortedVersions = versions.sort(semver.rcompare);\n return sortedVersions[0];\n }\n\n const timedVersions = versions\n .map((v) => ({\n version: v,\n time: time[v],\n }))\n .filter((v) => v.time);\n\n if (timedVersions.length === 0) {\n return undefined;\n }\n\n const timeOrderedVersions = timedVersions.sort(\n (a, b) => new Date(b.time).getTime() - new Date(a.time).getTime()\n );\n return timeOrderedVersions[0].version;\n}\n\n/**\n * Set the latest tag if dist-tags/latest is missing.\n * The last stable version available is used when possible.\n * Otherwise, it uses the latest version not found in dist-tags.\n */\nexport function setupLatestTag(manifest: Manifest): void {\n const distTags = manifest[DIST_TAGS];\n if (distTags.latest) {\n // Tag 'latest' must only be fixed when latest version was blocked\n return;\n }\n\n const versions = Object.keys(manifest.versions);\n if (versions.length === 0) {\n return;\n }\n\n const distTagsVersions = Object.values(distTags);\n const untaggedVersions = versions.filter((v) => semver.valid(v) && !distTagsVersions.includes(v));\n if (untaggedVersions.length === 0) {\n return;\n }\n\n // Try stable versions first (no \"-next\" or \"-beta\", etc.)\n const stableVersions = untaggedVersions.filter((v) => !semver.prerelease(v));\n const latestStableVersion = getLatestVersion(manifest, stableVersions);\n if (latestStableVersion) {\n debug('reassigned latest tag to stable version %s for %s', latestStableVersion, manifest.name);\n distTags.latest = latestStableVersion;\n return;\n }\n\n // Fallback to all untagged versions\n const latestVersion = getLatestVersion(manifest, untaggedVersions);\n if (!latestVersion) {\n return;\n }\n\n debug('reassigned latest tag to pre-release version %s for %s', latestVersion, manifest.name);\n distTags.latest = latestVersion;\n}\n\n/**\n * Set the created and modified times.\n */\nexport function setupCreatedAndModified(manifest: Manifest): void {\n const time = manifest.time;\n if (!time) {\n return;\n }\n\n const times = Object.values(time);\n if (times.length === 0) {\n return;\n }\n\n const sortedTimes = times.sort((a, b) => new Date(a).getTime() - new Date(b).getTime());\n time.created = sortedTimes[0];\n time.modified = sortedTimes[sortedTimes.length - 1];\n}\n\n/**\n * Remove `_distfiles` entries which are not used by any version.\n */\nexport function cleanupDistFiles(manifest: Manifest): void {\n const distFiles = manifest._distfiles;\n Object.entries(distFiles).forEach(([key, file]) => {\n const fileUrl = file.url;\n const versionPointingToFile = Object.values(manifest.versions).find(\n (v) => v.dist?.tarball === fileUrl\n );\n\n if (!versionPointingToFile) {\n delete distFiles[key];\n }\n });\n}\n\n/**\n * Creates a copy of a manifest suitable for safe, localized mutation.\n *\n * The returned object is shallow-cloned, except for `versions`, `dist-tags`,\n * `time`, and `_distfiles`, which are cloned as independent maps so they can be\n * filtered or modified without affecting the original manifest.\n */\nexport function getManifestClone(manifest: Readonly<Manifest>): Manifest {\n return {\n ...manifest,\n versions: {\n ...manifest.versions,\n },\n [DIST_TAGS]: {\n ...manifest[DIST_TAGS],\n },\n time: {\n ...manifest.time,\n },\n _distfiles: {\n ...manifest._distfiles,\n },\n };\n}\n"],"mappings":";;;;;;;AAMA,IAAM,WAAA,GAAA,MAAA,SAAmB,2CAA2C;;;;AAKpE,SAAgB,YAAY,UAA0B;CACpD,MAAM,WAAW,SAAS,gBAAA;AAC1B,QAAO,QAAQ,SAAS,CAAC,SAAS,CAAC,KAAK,gBAAgB;AACtD,MAAI,CAAC,SAAS,SAAS,aAAa;AAClC,WAAM,+CAA+C,KAAK,YAAY,SAAS,KAAK;AACpF,UAAO,SAAS;;GAElB;;;;;AAMJ,SAAgB,YAAY,UAA0B;CACpD,MAAM,OAAO,SAAS;AACtB,KAAI,CAAC,KACH;AAGF,QAAO,KAAK,KAAK,CAAC,SAAS,YAAY;AACrC,MAAI,CAAC,SAAS,SAAS,SACrB,QAAO,KAAK;GAEd;;;;;;AAOJ,SAAgB,iBAAiB,UAAoB,UAAwC;CAC3F,MAAM,OAAO,SAAS;AACtB,KAAI,CAAC,KAGH,QADuB,SAAS,KAAK,OAAA,QAAO,SAAS,CAC/B;CAGxB,MAAM,gBAAgB,SACnB,KAAK,OAAO;EACX,SAAS;EACT,MAAM,KAAK;EACZ,EAAE,CACF,QAAQ,MAAM,EAAE,KAAK;AAExB,KAAI,cAAc,WAAW,EAC3B;AAMF,QAH4B,cAAc,MACvC,GAAG,MAAM,IAAI,KAAK,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,KAAK,EAAE,KAAK,CAAC,SAAS,CAClE,CAC0B,GAAG;;;;;;;AAQhC,SAAgB,eAAe,UAA0B;CACvD,MAAM,WAAW,SAAS,gBAAA;AAC1B,KAAI,SAAS,OAEX;CAGF,MAAM,WAAW,OAAO,KAAK,SAAS,SAAS;AAC/C,KAAI,SAAS,WAAW,EACtB;CAGF,MAAM,mBAAmB,OAAO,OAAO,SAAS;CAChD,MAAM,mBAAmB,SAAS,QAAQ,MAAM,OAAA,QAAO,MAAM,EAAE,IAAI,CAAC,iBAAiB,SAAS,EAAE,CAAC;AACjG,KAAI,iBAAiB,WAAW,EAC9B;CAKF,MAAM,sBAAsB,iBAAiB,UADtB,iBAAiB,QAAQ,MAAM,CAAC,OAAA,QAAO,WAAW,EAAE,CAAC,CACN;AACtE,KAAI,qBAAqB;AACvB,UAAM,qDAAqD,qBAAqB,SAAS,KAAK;AAC9F,WAAS,SAAS;AAClB;;CAIF,MAAM,gBAAgB,iBAAiB,UAAU,iBAAiB;AAClE,KAAI,CAAC,cACH;AAGF,SAAM,0DAA0D,eAAe,SAAS,KAAK;AAC7F,UAAS,SAAS;;;;;AAMpB,SAAgB,wBAAwB,UAA0B;CAChE,MAAM,OAAO,SAAS;AACtB,KAAI,CAAC,KACH;CAGF,MAAM,QAAQ,OAAO,OAAO,KAAK;AACjC,KAAI,MAAM,WAAW,EACnB;CAGF,MAAM,cAAc,MAAM,MAAM,GAAG,MAAM,IAAI,KAAK,EAAE,CAAC,SAAS,GAAG,IAAI,KAAK,EAAE,CAAC,SAAS,CAAC;AACvF,MAAK,UAAU,YAAY;AAC3B,MAAK,WAAW,YAAY,YAAY,SAAS;;;;;AAMnD,SAAgB,iBAAiB,UAA0B;CACzD,MAAM,YAAY,SAAS;AAC3B,QAAO,QAAQ,UAAU,CAAC,SAAS,CAAC,KAAK,UAAU;EACjD,MAAM,UAAU,KAAK;AAKrB,MAAI,CAJ0B,OAAO,OAAO,SAAS,SAAS,CAAC,MAC5D,MAAM,EAAE,MAAM,YAAY,QAC5B,CAGC,QAAO,UAAU;GAEnB;;;;;;;;;AAUJ,SAAgB,iBAAiB,UAAwC;AACvE,QAAO;EACL,GAAG;EACH,UAAU,EACR,GAAG,SAAS,UACb;GACA,gBAAA,YAAY,EACX,GAAG,SAAS,gBAAA,YACb;EACD,MAAM,EACJ,GAAG,SAAS,MACb;EACD,YAAY,EACV,GAAG,SAAS,YACb;EACF"}
@@ -0,0 +1,107 @@
1
+ import buildDebug from "debug";
2
+ import { DIST_TAGS } from "@verdaccio/core";
3
+ import semver from "semver";
4
+ //#region src/utils/manifestUtils.ts
5
+ var debug = buildDebug("verdaccio:plugin:package-filter:manifest");
6
+ /**
7
+ * Delete `dist-tags` entries corresponding to missing versions.
8
+ */
9
+ function cleanupTags(manifest) {
10
+ const distTags = manifest[DIST_TAGS];
11
+ Object.entries(distTags).forEach(([tag, tagVersion]) => {
12
+ if (!manifest.versions[tagVersion]) {
13
+ debug("removing orphaned dist-tag %s -> %s from %s", tag, tagVersion, manifest.name);
14
+ delete distTags[tag];
15
+ }
16
+ });
17
+ }
18
+ /**
19
+ * Delete `time` entries corresponding to missing versions.
20
+ */
21
+ function cleanupTime(manifest) {
22
+ const time = manifest.time;
23
+ if (!time) return;
24
+ Object.keys(time).forEach((version) => {
25
+ if (!manifest.versions[version]) delete time[version];
26
+ });
27
+ }
28
+ /**
29
+ * Get the latest version from a list of versions,
30
+ * ordered by time of their publication stored in the manifest.
31
+ */
32
+ function getLatestVersion(manifest, versions) {
33
+ const time = manifest.time;
34
+ if (!time) return versions.sort(semver.rcompare)[0];
35
+ const timedVersions = versions.map((v) => ({
36
+ version: v,
37
+ time: time[v]
38
+ })).filter((v) => v.time);
39
+ if (timedVersions.length === 0) return;
40
+ return timedVersions.sort((a, b) => new Date(b.time).getTime() - new Date(a.time).getTime())[0].version;
41
+ }
42
+ /**
43
+ * Set the latest tag if dist-tags/latest is missing.
44
+ * The last stable version available is used when possible.
45
+ * Otherwise, it uses the latest version not found in dist-tags.
46
+ */
47
+ function setupLatestTag(manifest) {
48
+ const distTags = manifest[DIST_TAGS];
49
+ if (distTags.latest) return;
50
+ const versions = Object.keys(manifest.versions);
51
+ if (versions.length === 0) return;
52
+ const distTagsVersions = Object.values(distTags);
53
+ const untaggedVersions = versions.filter((v) => semver.valid(v) && !distTagsVersions.includes(v));
54
+ if (untaggedVersions.length === 0) return;
55
+ const latestStableVersion = getLatestVersion(manifest, untaggedVersions.filter((v) => !semver.prerelease(v)));
56
+ if (latestStableVersion) {
57
+ debug("reassigned latest tag to stable version %s for %s", latestStableVersion, manifest.name);
58
+ distTags.latest = latestStableVersion;
59
+ return;
60
+ }
61
+ const latestVersion = getLatestVersion(manifest, untaggedVersions);
62
+ if (!latestVersion) return;
63
+ debug("reassigned latest tag to pre-release version %s for %s", latestVersion, manifest.name);
64
+ distTags.latest = latestVersion;
65
+ }
66
+ /**
67
+ * Set the created and modified times.
68
+ */
69
+ function setupCreatedAndModified(manifest) {
70
+ const time = manifest.time;
71
+ if (!time) return;
72
+ const times = Object.values(time);
73
+ if (times.length === 0) return;
74
+ const sortedTimes = times.sort((a, b) => new Date(a).getTime() - new Date(b).getTime());
75
+ time.created = sortedTimes[0];
76
+ time.modified = sortedTimes[sortedTimes.length - 1];
77
+ }
78
+ /**
79
+ * Remove `_distfiles` entries which are not used by any version.
80
+ */
81
+ function cleanupDistFiles(manifest) {
82
+ const distFiles = manifest._distfiles;
83
+ Object.entries(distFiles).forEach(([key, file]) => {
84
+ const fileUrl = file.url;
85
+ if (!Object.values(manifest.versions).find((v) => v.dist?.tarball === fileUrl)) delete distFiles[key];
86
+ });
87
+ }
88
+ /**
89
+ * Creates a copy of a manifest suitable for safe, localized mutation.
90
+ *
91
+ * The returned object is shallow-cloned, except for `versions`, `dist-tags`,
92
+ * `time`, and `_distfiles`, which are cloned as independent maps so they can be
93
+ * filtered or modified without affecting the original manifest.
94
+ */
95
+ function getManifestClone(manifest) {
96
+ return {
97
+ ...manifest,
98
+ versions: { ...manifest.versions },
99
+ [DIST_TAGS]: { ...manifest[DIST_TAGS] },
100
+ time: { ...manifest.time },
101
+ _distfiles: { ...manifest._distfiles }
102
+ };
103
+ }
104
+ //#endregion
105
+ export { cleanupDistFiles, cleanupTags, cleanupTime, getManifestClone, setupCreatedAndModified, setupLatestTag };
106
+
107
+ //# sourceMappingURL=manifestUtils.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifestUtils.mjs","names":[],"sources":["../../src/utils/manifestUtils.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport semver from 'semver';\n\nimport { DIST_TAGS } from '@verdaccio/core';\nimport type { Manifest } from '@verdaccio/types';\n\nconst debug = buildDebug('verdaccio:plugin:package-filter:manifest');\n\n/**\n * Delete `dist-tags` entries corresponding to missing versions.\n */\nexport function cleanupTags(manifest: Manifest): void {\n const distTags = manifest[DIST_TAGS];\n Object.entries(distTags).forEach(([tag, tagVersion]) => {\n if (!manifest.versions[tagVersion]) {\n debug('removing orphaned dist-tag %s -> %s from %s', tag, tagVersion, manifest.name);\n delete distTags[tag];\n }\n });\n}\n\n/**\n * Delete `time` entries corresponding to missing versions.\n */\nexport function cleanupTime(manifest: Manifest): void {\n const time = manifest.time;\n if (!time) {\n return;\n }\n\n Object.keys(time).forEach((version) => {\n if (!manifest.versions[version]) {\n delete time[version];\n }\n });\n}\n\n/**\n * Get the latest version from a list of versions,\n * ordered by time of their publication stored in the manifest.\n */\nexport function getLatestVersion(manifest: Manifest, versions: string[]): string | undefined {\n const time = manifest.time;\n if (!time) {\n // No time information, it's the best we can do\n const sortedVersions = versions.sort(semver.rcompare);\n return sortedVersions[0];\n }\n\n const timedVersions = versions\n .map((v) => ({\n version: v,\n time: time[v],\n }))\n .filter((v) => v.time);\n\n if (timedVersions.length === 0) {\n return undefined;\n }\n\n const timeOrderedVersions = timedVersions.sort(\n (a, b) => new Date(b.time).getTime() - new Date(a.time).getTime()\n );\n return timeOrderedVersions[0].version;\n}\n\n/**\n * Set the latest tag if dist-tags/latest is missing.\n * The last stable version available is used when possible.\n * Otherwise, it uses the latest version not found in dist-tags.\n */\nexport function setupLatestTag(manifest: Manifest): void {\n const distTags = manifest[DIST_TAGS];\n if (distTags.latest) {\n // Tag 'latest' must only be fixed when latest version was blocked\n return;\n }\n\n const versions = Object.keys(manifest.versions);\n if (versions.length === 0) {\n return;\n }\n\n const distTagsVersions = Object.values(distTags);\n const untaggedVersions = versions.filter((v) => semver.valid(v) && !distTagsVersions.includes(v));\n if (untaggedVersions.length === 0) {\n return;\n }\n\n // Try stable versions first (no \"-next\" or \"-beta\", etc.)\n const stableVersions = untaggedVersions.filter((v) => !semver.prerelease(v));\n const latestStableVersion = getLatestVersion(manifest, stableVersions);\n if (latestStableVersion) {\n debug('reassigned latest tag to stable version %s for %s', latestStableVersion, manifest.name);\n distTags.latest = latestStableVersion;\n return;\n }\n\n // Fallback to all untagged versions\n const latestVersion = getLatestVersion(manifest, untaggedVersions);\n if (!latestVersion) {\n return;\n }\n\n debug('reassigned latest tag to pre-release version %s for %s', latestVersion, manifest.name);\n distTags.latest = latestVersion;\n}\n\n/**\n * Set the created and modified times.\n */\nexport function setupCreatedAndModified(manifest: Manifest): void {\n const time = manifest.time;\n if (!time) {\n return;\n }\n\n const times = Object.values(time);\n if (times.length === 0) {\n return;\n }\n\n const sortedTimes = times.sort((a, b) => new Date(a).getTime() - new Date(b).getTime());\n time.created = sortedTimes[0];\n time.modified = sortedTimes[sortedTimes.length - 1];\n}\n\n/**\n * Remove `_distfiles` entries which are not used by any version.\n */\nexport function cleanupDistFiles(manifest: Manifest): void {\n const distFiles = manifest._distfiles;\n Object.entries(distFiles).forEach(([key, file]) => {\n const fileUrl = file.url;\n const versionPointingToFile = Object.values(manifest.versions).find(\n (v) => v.dist?.tarball === fileUrl\n );\n\n if (!versionPointingToFile) {\n delete distFiles[key];\n }\n });\n}\n\n/**\n * Creates a copy of a manifest suitable for safe, localized mutation.\n *\n * The returned object is shallow-cloned, except for `versions`, `dist-tags`,\n * `time`, and `_distfiles`, which are cloned as independent maps so they can be\n * filtered or modified without affecting the original manifest.\n */\nexport function getManifestClone(manifest: Readonly<Manifest>): Manifest {\n return {\n ...manifest,\n versions: {\n ...manifest.versions,\n },\n [DIST_TAGS]: {\n ...manifest[DIST_TAGS],\n },\n time: {\n ...manifest.time,\n },\n _distfiles: {\n ...manifest._distfiles,\n },\n };\n}\n"],"mappings":";;;;AAMA,IAAM,QAAQ,WAAW,2CAA2C;;;;AAKpE,SAAgB,YAAY,UAA0B;CACpD,MAAM,WAAW,SAAS;AAC1B,QAAO,QAAQ,SAAS,CAAC,SAAS,CAAC,KAAK,gBAAgB;AACtD,MAAI,CAAC,SAAS,SAAS,aAAa;AAClC,SAAM,+CAA+C,KAAK,YAAY,SAAS,KAAK;AACpF,UAAO,SAAS;;GAElB;;;;;AAMJ,SAAgB,YAAY,UAA0B;CACpD,MAAM,OAAO,SAAS;AACtB,KAAI,CAAC,KACH;AAGF,QAAO,KAAK,KAAK,CAAC,SAAS,YAAY;AACrC,MAAI,CAAC,SAAS,SAAS,SACrB,QAAO,KAAK;GAEd;;;;;;AAOJ,SAAgB,iBAAiB,UAAoB,UAAwC;CAC3F,MAAM,OAAO,SAAS;AACtB,KAAI,CAAC,KAGH,QADuB,SAAS,KAAK,OAAO,SAAS,CAC/B;CAGxB,MAAM,gBAAgB,SACnB,KAAK,OAAO;EACX,SAAS;EACT,MAAM,KAAK;EACZ,EAAE,CACF,QAAQ,MAAM,EAAE,KAAK;AAExB,KAAI,cAAc,WAAW,EAC3B;AAMF,QAH4B,cAAc,MACvC,GAAG,MAAM,IAAI,KAAK,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,KAAK,EAAE,KAAK,CAAC,SAAS,CAClE,CAC0B,GAAG;;;;;;;AAQhC,SAAgB,eAAe,UAA0B;CACvD,MAAM,WAAW,SAAS;AAC1B,KAAI,SAAS,OAEX;CAGF,MAAM,WAAW,OAAO,KAAK,SAAS,SAAS;AAC/C,KAAI,SAAS,WAAW,EACtB;CAGF,MAAM,mBAAmB,OAAO,OAAO,SAAS;CAChD,MAAM,mBAAmB,SAAS,QAAQ,MAAM,OAAO,MAAM,EAAE,IAAI,CAAC,iBAAiB,SAAS,EAAE,CAAC;AACjG,KAAI,iBAAiB,WAAW,EAC9B;CAKF,MAAM,sBAAsB,iBAAiB,UADtB,iBAAiB,QAAQ,MAAM,CAAC,OAAO,WAAW,EAAE,CAAC,CACN;AACtE,KAAI,qBAAqB;AACvB,QAAM,qDAAqD,qBAAqB,SAAS,KAAK;AAC9F,WAAS,SAAS;AAClB;;CAIF,MAAM,gBAAgB,iBAAiB,UAAU,iBAAiB;AAClE,KAAI,CAAC,cACH;AAGF,OAAM,0DAA0D,eAAe,SAAS,KAAK;AAC7F,UAAS,SAAS;;;;;AAMpB,SAAgB,wBAAwB,UAA0B;CAChE,MAAM,OAAO,SAAS;AACtB,KAAI,CAAC,KACH;CAGF,MAAM,QAAQ,OAAO,OAAO,KAAK;AACjC,KAAI,MAAM,WAAW,EACnB;CAGF,MAAM,cAAc,MAAM,MAAM,GAAG,MAAM,IAAI,KAAK,EAAE,CAAC,SAAS,GAAG,IAAI,KAAK,EAAE,CAAC,SAAS,CAAC;AACvF,MAAK,UAAU,YAAY;AAC3B,MAAK,WAAW,YAAY,YAAY,SAAS;;;;;AAMnD,SAAgB,iBAAiB,UAA0B;CACzD,MAAM,YAAY,SAAS;AAC3B,QAAO,QAAQ,UAAU,CAAC,SAAS,CAAC,KAAK,UAAU;EACjD,MAAM,UAAU,KAAK;AAKrB,MAAI,CAJ0B,OAAO,OAAO,SAAS,SAAS,CAAC,MAC5D,MAAM,EAAE,MAAM,YAAY,QAC5B,CAGC,QAAO,UAAU;GAEnB;;;;;;;;;AAUJ,SAAgB,iBAAiB,UAAwC;AACvE,QAAO;EACL,GAAG;EACH,UAAU,EACR,GAAG,SAAS,UACb;GACA,YAAY,EACX,GAAG,SAAS,YACb;EACD,MAAM,EACJ,GAAG,SAAS,MACb;EACD,YAAY,EACV,GAAG,SAAS,YACb;EACF"}
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@verdaccio/package-filter",
3
+ "version": "14.0.0-next-9.30",
4
+ "description": "Package filter plugin for Verdaccio that allows blocking packages by name, scope, version or date",
5
+ "keywords": [
6
+ "private",
7
+ "package",
8
+ "repository",
9
+ "registry",
10
+ "enterprise",
11
+ "modules",
12
+ "proxy",
13
+ "server",
14
+ "verdaccio",
15
+ "plugin",
16
+ "filter"
17
+ ],
18
+ "author": "Vitalii Sugrobov <vsugrob@hotmail.com>",
19
+ "contributors": [
20
+ "Ansile <ansilet@yandex.ru> (original project)"
21
+ ],
22
+ "license": "MIT",
23
+ "homepage": "https://verdaccio.org",
24
+ "repository": {
25
+ "type": "https",
26
+ "url": "https://github.com/verdaccio/verdaccio",
27
+ "directory": "packages/plugins/package-filter"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/verdaccio/verdaccio/issues"
31
+ },
32
+ "main": "build/index.js",
33
+ "types": "build/src/index.d.ts",
34
+ "engines": {
35
+ "node": ">=24"
36
+ },
37
+ "dependencies": {
38
+ "@verdaccio/core": "9.0.0-next-9.6",
39
+ "debug": "4.4.3",
40
+ "semver": "7.7.4"
41
+ },
42
+ "devDependencies": {
43
+ "@types/debug": "4.1.12",
44
+ "@verdaccio/config": "9.0.0-next-9.6",
45
+ "@verdaccio/logger": "9.0.0-next-9.6",
46
+ "@verdaccio/plugin-verifier": "1.0.0-next-9.2",
47
+ "@verdaccio/types": "14.0.0-next-9.3"
48
+ },
49
+ "funding": {
50
+ "type": "opencollective",
51
+ "url": "https://opencollective.com/verdaccio"
52
+ },
53
+ "module": "./build/index.mjs",
54
+ "exports": {
55
+ ".": {
56
+ "import": {
57
+ "types": "./build/index.d.ts",
58
+ "default": "./build/index.mjs"
59
+ },
60
+ "require": {
61
+ "types": "./build/index.d.ts",
62
+ "default": "./build/index.js"
63
+ }
64
+ },
65
+ "./build/*": "./build/*"
66
+ },
67
+ "scripts": {
68
+ "clean": "rimraf ./build",
69
+ "build": "vite build",
70
+ "watch": "vite build --watch",
71
+ "test": "vitest run"
72
+ }
73
+ }