unplugin-build-meta 1.0.3 → 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.
Files changed (64) hide show
  1. package/dist/astro.cjs +25 -17
  2. package/dist/astro.d.cts +4 -5
  3. package/dist/{astro.d.ts → astro.d.mts} +5 -5
  4. package/dist/astro.mjs +25 -18
  5. package/dist/esbuild.cjs +20 -9
  6. package/dist/esbuild.d.cts +5 -6
  7. package/dist/{esbuild.d.ts → esbuild.d.mts} +7 -6
  8. package/dist/esbuild.mjs +19 -9
  9. package/dist/farm.cjs +20 -9
  10. package/dist/farm.d.cts +3 -4
  11. package/dist/{farm.d.ts → farm.d.mts} +5 -4
  12. package/dist/farm.mjs +19 -9
  13. package/dist/{index.d.ts → index-Crle-EHN.d.cts} +5 -4
  14. package/dist/index-DEDKZAET.d.mts +14 -0
  15. package/dist/index.cjs +4 -8
  16. package/dist/index.d.cts +3 -13
  17. package/dist/index.d.mts +3 -0
  18. package/dist/index.mjs +3 -9
  19. package/dist/module-D-A3G8xU.mjs +14 -0
  20. package/dist/module-DT5DVEPk.cjs +20 -0
  21. package/dist/module.cjs +3 -5
  22. package/dist/module.d.cts +4 -4
  23. package/dist/{module.d.ts → module.d.mts} +4 -4
  24. package/dist/module.mjs +3 -6
  25. package/dist/nuxt.cjs +35 -29
  26. package/dist/nuxt.d.cts +4 -5
  27. package/dist/{nuxt.d.ts → nuxt.d.mts} +6 -5
  28. package/dist/nuxt.mjs +33 -28
  29. package/dist/rolldown.cjs +20 -9
  30. package/dist/rolldown.d.cts +5 -6
  31. package/dist/{rolldown.d.ts → rolldown.d.mts} +7 -6
  32. package/dist/rolldown.mjs +19 -9
  33. package/dist/rollup.cjs +20 -9
  34. package/dist/rollup.d.cts +5 -6
  35. package/dist/{rollup.d.ts → rollup.d.mts} +7 -6
  36. package/dist/rollup.mjs +19 -9
  37. package/dist/rspack.cjs +25 -9
  38. package/dist/rspack.d.cts +5 -5
  39. package/dist/{rspack.d.ts → rspack.d.mts} +7 -5
  40. package/dist/rspack.mjs +24 -9
  41. package/dist/src-BZ8mQVle.cjs +208 -0
  42. package/dist/src-D338eO6B.mjs +150 -0
  43. package/dist/types--sVtB8IG.d.mts +25 -0
  44. package/dist/types-Be8ZD_mp.d.cts +25 -0
  45. package/dist/vite.cjs +20 -6
  46. package/dist/vite.d.cts +5 -6
  47. package/dist/{vite.d.ts → vite.d.mts} +7 -6
  48. package/dist/vite.mjs +21 -8
  49. package/dist/webpack.cjs +18 -6
  50. package/dist/webpack.d.cts +5 -6
  51. package/dist/webpack.d.mts +19 -0
  52. package/dist/webpack.mjs +19 -8
  53. package/package.json +55 -110
  54. package/dist/chunk-7ZTBKMAA.mjs +0 -11
  55. package/dist/chunk-GU2UU6BD.mjs +0 -11
  56. package/dist/chunk-IO4OWFHV.cjs +0 -170
  57. package/dist/chunk-NT6BOYSQ.cjs +0 -11
  58. package/dist/chunk-OAZ3YOGG.mjs +0 -170
  59. package/dist/chunk-RJEZ2A3A.mjs +0 -8
  60. package/dist/chunk-SSXJV7C2.cjs +0 -8
  61. package/dist/chunk-TQTDIF6M.cjs +0 -11
  62. package/dist/types-C-6IiPYY.d.cts +0 -24
  63. package/dist/types-C-6IiPYY.d.ts +0 -24
  64. package/dist/webpack.d.ts +0 -18
package/dist/nuxt.mjs CHANGED
@@ -1,31 +1,36 @@
1
- import {
2
- vite_default
3
- } from "./chunk-GU2UU6BD.mjs";
4
- import {
5
- webpack_default
6
- } from "./chunk-7ZTBKMAA.mjs";
7
- import {
8
- NUXT_CONFIG_KEY,
9
- PLUGIN_NAME
10
- } from "./chunk-OAZ3YOGG.mjs";
11
- import "./chunk-RJEZ2A3A.mjs";
12
-
13
- // src/nuxt.ts
1
+ import { i as PLUGIN_NAME, r as NUXT_CONFIG_KEY } from "./src-D338eO6B.mjs";
2
+ import vite_default from "./vite.mjs";
3
+ import webpack_default from "./webpack.mjs";
14
4
  import { addVitePlugin, addWebpackPlugin, defineNuxtModule } from "@nuxt/kit";
5
+
6
+ //#region src/nuxt.ts
7
+ /**
8
+ * Nuxt plugin
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * // nuxt.config.ts
13
+ * import buildMeta from "unplugin-build-meta/nuxt"
14
+ *
15
+ * export default defineNuxtConfig({
16
+ * plugins: [buildMeta()],
17
+ * })
18
+ * ```
19
+ */
15
20
  var nuxt_default = defineNuxtModule({
16
- meta: {
17
- name: PLUGIN_NAME,
18
- configKey: NUXT_CONFIG_KEY
19
- },
20
- setup(options, nuxt) {
21
- nuxt.options.typescript.tsConfig ||= {};
22
- nuxt.options.typescript.tsConfig.compilerOptions ||= {};
23
- nuxt.options.typescript.tsConfig.compilerOptions.types ||= [];
24
- nuxt.options.typescript.tsConfig.compilerOptions.types.push("unplugin-build-meta/types");
25
- addWebpackPlugin(() => webpack_default(options));
26
- addVitePlugin(() => vite_default(options));
27
- }
21
+ meta: {
22
+ name: PLUGIN_NAME,
23
+ configKey: NUXT_CONFIG_KEY
24
+ },
25
+ setup(options, nuxt) {
26
+ nuxt.options.typescript.tsConfig ||= {};
27
+ nuxt.options.typescript.tsConfig.compilerOptions ||= {};
28
+ nuxt.options.typescript.tsConfig.compilerOptions.types ||= [];
29
+ nuxt.options.typescript.tsConfig.compilerOptions.types.push("unplugin-build-meta/types");
30
+ addWebpackPlugin(() => webpack_default(options));
31
+ addVitePlugin(() => vite_default(options));
32
+ }
28
33
  });
29
- export {
30
- nuxt_default as default
31
- };
34
+
35
+ //#endregion
36
+ export { nuxt_default as default };
package/dist/rolldown.cjs CHANGED
@@ -1,11 +1,22 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_src = require('./src-BZ8mQVle.cjs');
3
+ let unplugin = require("unplugin");
2
4
 
3
- var _chunkIO4OWFHVcjs = require('./chunk-IO4OWFHV.cjs');
4
- require('./chunk-SSXJV7C2.cjs');
5
+ //#region src/rolldown.ts
6
+ /**
7
+ * Rolldown plugin
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * // rolldown.config.js
12
+ * import buildMeta from "unplugin-build-meta/rolldown"
13
+ *
14
+ * export default {
15
+ * plugins: [buildMeta()],
16
+ * }
17
+ * ```
18
+ */
19
+ var rolldown_default = (0, unplugin.createRolldownPlugin)(require_src.unpluginFactory);
5
20
 
6
- // src/rolldown.ts
7
- var _unplugin = require('unplugin');
8
- var rolldown_default = _unplugin.createRolldownPlugin.call(void 0, _chunkIO4OWFHVcjs.unpluginFactory);
9
-
10
-
11
- exports.default = rolldown_default;
21
+ //#endregion
22
+ exports.default = rolldown_default;
@@ -1,7 +1,7 @@
1
- import * as rolldown from 'rolldown';
2
- import { B as BuildMetaOptions } from './types-C-6IiPYY.cjs';
3
- import 'unplugin';
1
+ import { n as BuildMetaOptions } from "./types-Be8ZD_mp.cjs";
2
+ import * as rolldown0 from "rolldown";
4
3
 
4
+ //#region src/rolldown.d.ts
5
5
  /**
6
6
  * Rolldown plugin
7
7
  *
@@ -15,6 +15,5 @@ import 'unplugin';
15
15
  * }
16
16
  * ```
17
17
  */
18
- declare const _default: (options?: BuildMetaOptions | undefined) => rolldown.Plugin<any> | rolldown.Plugin<any>[];
19
-
20
- export { _default as default };
18
+ declare const _default: (options?: BuildMetaOptions | undefined) => rolldown0.Plugin<any> | rolldown0.Plugin<any>[];
19
+ export = _default;
@@ -1,7 +1,8 @@
1
- import * as rolldown from 'rolldown';
2
- import { B as BuildMetaOptions } from './types-C-6IiPYY.js';
3
- import 'unplugin';
1
+ import { n as BuildMetaOptions } from "./types--sVtB8IG.mjs";
2
+ import "./index-DEDKZAET.mjs";
3
+ import * as rolldown0 from "rolldown";
4
4
 
5
+ //#region src/rolldown.d.ts
5
6
  /**
6
7
  * Rolldown plugin
7
8
  *
@@ -15,6 +16,6 @@ import 'unplugin';
15
16
  * }
16
17
  * ```
17
18
  */
18
- declare const _default: (options?: BuildMetaOptions | undefined) => rolldown.Plugin<any> | rolldown.Plugin<any>[];
19
-
20
- export { _default as default };
19
+ declare const _default: (options?: BuildMetaOptions | undefined) => rolldown0.Plugin<any> | rolldown0.Plugin<any>[];
20
+ //#endregion
21
+ export { _default as default };
package/dist/rolldown.mjs CHANGED
@@ -1,11 +1,21 @@
1
- import {
2
- unpluginFactory
3
- } from "./chunk-OAZ3YOGG.mjs";
4
- import "./chunk-RJEZ2A3A.mjs";
5
-
6
- // src/rolldown.ts
1
+ import { n as unpluginFactory } from "./src-D338eO6B.mjs";
7
2
  import { createRolldownPlugin } from "unplugin";
3
+
4
+ //#region src/rolldown.ts
5
+ /**
6
+ * Rolldown plugin
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * // rolldown.config.js
11
+ * import buildMeta from "unplugin-build-meta/rolldown"
12
+ *
13
+ * export default {
14
+ * plugins: [buildMeta()],
15
+ * }
16
+ * ```
17
+ */
8
18
  var rolldown_default = createRolldownPlugin(unpluginFactory);
9
- export {
10
- rolldown_default as default
11
- };
19
+
20
+ //#endregion
21
+ export { rolldown_default as default };
package/dist/rollup.cjs CHANGED
@@ -1,11 +1,22 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_src = require('./src-BZ8mQVle.cjs');
3
+ let unplugin = require("unplugin");
2
4
 
3
- var _chunkIO4OWFHVcjs = require('./chunk-IO4OWFHV.cjs');
4
- require('./chunk-SSXJV7C2.cjs');
5
+ //#region src/rollup.ts
6
+ /**
7
+ * Rollup plugin
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * // rollup.config.js
12
+ * import buildMeta from "unplugin-build-meta/rollup"
13
+ *
14
+ * export default {
15
+ * plugins: [buildMeta()],
16
+ * }
17
+ * ```
18
+ */
19
+ var rollup_default = (0, unplugin.createRollupPlugin)(require_src.unpluginFactory);
5
20
 
6
- // src/rollup.ts
7
- var _unplugin = require('unplugin');
8
- var rollup_default = _unplugin.createRollupPlugin.call(void 0, _chunkIO4OWFHVcjs.unpluginFactory);
9
-
10
-
11
- exports.default = rollup_default;
21
+ //#endregion
22
+ exports.default = rollup_default;
package/dist/rollup.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import * as rollup from 'rollup';
2
- import { B as BuildMetaOptions } from './types-C-6IiPYY.cjs';
3
- import 'unplugin';
1
+ import { n as BuildMetaOptions } from "./types-Be8ZD_mp.cjs";
2
+ import * as rollup0 from "rollup";
4
3
 
4
+ //#region src/rollup.d.ts
5
5
  /**
6
6
  * Rollup plugin
7
7
  *
@@ -15,6 +15,5 @@ import 'unplugin';
15
15
  * }
16
16
  * ```
17
17
  */
18
- declare const _default: (options?: BuildMetaOptions | undefined) => rollup.Plugin<any> | rollup.Plugin<any>[];
19
-
20
- export { _default as default };
18
+ declare const _default: (options?: BuildMetaOptions | undefined) => rollup0.Plugin<any> | rollup0.Plugin<any>[];
19
+ export = _default;
@@ -1,7 +1,8 @@
1
- import * as rollup from 'rollup';
2
- import { B as BuildMetaOptions } from './types-C-6IiPYY.js';
3
- import 'unplugin';
1
+ import { n as BuildMetaOptions } from "./types--sVtB8IG.mjs";
2
+ import "./index-DEDKZAET.mjs";
3
+ import * as rollup0 from "rollup";
4
4
 
5
+ //#region src/rollup.d.ts
5
6
  /**
6
7
  * Rollup plugin
7
8
  *
@@ -15,6 +16,6 @@ import 'unplugin';
15
16
  * }
16
17
  * ```
17
18
  */
18
- declare const _default: (options?: BuildMetaOptions | undefined) => rollup.Plugin<any> | rollup.Plugin<any>[];
19
-
20
- export { _default as default };
19
+ declare const _default: (options?: BuildMetaOptions | undefined) => rollup0.Plugin<any> | rollup0.Plugin<any>[];
20
+ //#endregion
21
+ export { _default as default };
package/dist/rollup.mjs CHANGED
@@ -1,11 +1,21 @@
1
- import {
2
- unpluginFactory
3
- } from "./chunk-OAZ3YOGG.mjs";
4
- import "./chunk-RJEZ2A3A.mjs";
5
-
6
- // src/rollup.ts
1
+ import { n as unpluginFactory } from "./src-D338eO6B.mjs";
7
2
  import { createRollupPlugin } from "unplugin";
3
+
4
+ //#region src/rollup.ts
5
+ /**
6
+ * Rollup plugin
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * // rollup.config.js
11
+ * import buildMeta from "unplugin-build-meta/rollup"
12
+ *
13
+ * export default {
14
+ * plugins: [buildMeta()],
15
+ * }
16
+ * ```
17
+ */
8
18
  var rollup_default = createRollupPlugin(unpluginFactory);
9
- export {
10
- rollup_default as default
11
- };
19
+
20
+ //#endregion
21
+ export { rollup_default as default };
package/dist/rspack.cjs CHANGED
@@ -1,11 +1,27 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_src = require('./src-BZ8mQVle.cjs');
3
+ let unplugin = require("unplugin");
2
4
 
3
- var _chunkIO4OWFHVcjs = require('./chunk-IO4OWFHV.cjs');
4
- require('./chunk-SSXJV7C2.cjs');
5
+ //#region src/rspack.ts
6
+ /**
7
+ * This entry file is for Rspack plugin.
8
+ *
9
+ * @module
10
+ */
11
+ /**
12
+ * Rspack plugin
13
+ *
14
+ * @example
15
+ * ```ts
16
+ * // rspack.config.ts
17
+ * import buildMeta from "unplugin-build-meta/rspack"
18
+ *
19
+ * export default defineConfig({
20
+ * plugins: [buildMeta()],
21
+ * })
22
+ * ```
23
+ */
24
+ var rspack_default = (0, unplugin.createRspackPlugin)(require_src.unpluginFactory);
5
25
 
6
- // src/rspack.ts
7
- var _unplugin = require('unplugin');
8
- var rspack_default = _unplugin.createRspackPlugin.call(void 0, _chunkIO4OWFHVcjs.unpluginFactory);
9
-
10
-
11
- exports.default = rspack_default;
26
+ //#endregion
27
+ exports.default = rspack_default;
package/dist/rspack.d.cts CHANGED
@@ -1,6 +1,7 @@
1
- import * as unplugin from 'unplugin';
2
- import { B as BuildMetaOptions } from './types-C-6IiPYY.cjs';
1
+ import { n as BuildMetaOptions } from "./types-Be8ZD_mp.cjs";
2
+ import * as unplugin0 from "unplugin";
3
3
 
4
+ //#region src/rspack.d.ts
4
5
  /**
5
6
  * This entry file is for Rspack plugin.
6
7
  *
@@ -19,6 +20,5 @@ import { B as BuildMetaOptions } from './types-C-6IiPYY.cjs';
19
20
  * })
20
21
  * ```
21
22
  */
22
- declare const _default: (options?: BuildMetaOptions | undefined) => unplugin.RspackPluginInstance;
23
-
24
- export { _default as default };
23
+ declare const _default: (options?: BuildMetaOptions | undefined) => unplugin0.RspackPluginInstance;
24
+ export = _default;
@@ -1,6 +1,8 @@
1
- import * as unplugin from 'unplugin';
2
- import { B as BuildMetaOptions } from './types-C-6IiPYY.js';
1
+ import { n as BuildMetaOptions } from "./types--sVtB8IG.mjs";
2
+ import "./index-DEDKZAET.mjs";
3
+ import * as unplugin0 from "unplugin";
3
4
 
5
+ //#region src/rspack.d.ts
4
6
  /**
5
7
  * This entry file is for Rspack plugin.
6
8
  *
@@ -19,6 +21,6 @@ import { B as BuildMetaOptions } from './types-C-6IiPYY.js';
19
21
  * })
20
22
  * ```
21
23
  */
22
- declare const _default: (options?: BuildMetaOptions | undefined) => unplugin.RspackPluginInstance;
23
-
24
- export { _default as default };
24
+ declare const _default: (options?: BuildMetaOptions | undefined) => unplugin0.RspackPluginInstance;
25
+ //#endregion
26
+ export { _default as default };
package/dist/rspack.mjs CHANGED
@@ -1,11 +1,26 @@
1
- import {
2
- unpluginFactory
3
- } from "./chunk-OAZ3YOGG.mjs";
4
- import "./chunk-RJEZ2A3A.mjs";
5
-
6
- // src/rspack.ts
1
+ import { n as unpluginFactory } from "./src-D338eO6B.mjs";
7
2
  import { createRspackPlugin } from "unplugin";
3
+
4
+ //#region src/rspack.ts
5
+ /**
6
+ * This entry file is for Rspack plugin.
7
+ *
8
+ * @module
9
+ */
10
+ /**
11
+ * Rspack plugin
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * // rspack.config.ts
16
+ * import buildMeta from "unplugin-build-meta/rspack"
17
+ *
18
+ * export default defineConfig({
19
+ * plugins: [buildMeta()],
20
+ * })
21
+ * ```
22
+ */
8
23
  var rspack_default = createRspackPlugin(unpluginFactory);
9
- export {
10
- rspack_default as default
11
- };
24
+
25
+ //#endregion
26
+ export { rspack_default as default };
@@ -0,0 +1,208 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+ const require_module = require('./module-DT5DVEPk.cjs');
29
+ let unplugin = require("unplugin");
30
+ let git_url_parse = require("git-url-parse");
31
+ git_url_parse = __toESM(git_url_parse);
32
+ let simple_git = require("simple-git");
33
+ let node_process = require("node:process");
34
+ node_process = __toESM(node_process);
35
+
36
+ //#region src/core/constants.ts
37
+ const PLUGIN_NAME = "unplugin-build-meta";
38
+ const NUXT_CONFIG_KEY = "buildMeta";
39
+
40
+ //#endregion
41
+ //#region src/core/modules/git.ts
42
+ var git_default = require_module.defineBuildMetaModule({
43
+ name: "git",
44
+ load: async () => {
45
+ const git = (0, simple_git.simpleGit)();
46
+ const info = {};
47
+ function generateOutput(data) {
48
+ return [
49
+ "repositoryUrl",
50
+ "sha",
51
+ "shortSha",
52
+ "branch",
53
+ "tag",
54
+ "tags",
55
+ "lastTag",
56
+ "commitAuthorName",
57
+ "commitAuthorEmail",
58
+ "commitAuthorDate",
59
+ "commitCommitterName",
60
+ "commitCommitterEmail",
61
+ "commitCommitterDate",
62
+ "latestCommitMessage"
63
+ ].map((key) => `export const ${key} = ${data && data[key] !== void 0 ? JSON.stringify(data[key]) : "null"}`).join("\n");
64
+ }
65
+ try {
66
+ if (!await git.checkIsRepo()) return generateOutput();
67
+ } catch (error) {
68
+ console.error("failed to check if directory is a git repository:", error);
69
+ return generateOutput();
70
+ }
71
+ try {
72
+ info.branch = (await git.branch([])).current;
73
+ } catch (error) {
74
+ console.error("failed to fetch branch information:", error);
75
+ }
76
+ try {
77
+ const log = await git.log(["-1"]);
78
+ if (log.latest) {
79
+ info.sha = log.latest.hash;
80
+ info.shortSha = log.latest.hash?.slice(0, 10);
81
+ info.latestCommitMessage = log.latest.message;
82
+ info.commitAuthorName = log.latest.author_name;
83
+ info.commitAuthorEmail = log.latest.author_email;
84
+ info.commitAuthorDate = log.latest.date;
85
+ }
86
+ } catch (error) {
87
+ console.error("failed to fetch commit information:", error);
88
+ }
89
+ try {
90
+ const committerLines = (await git.show(["-s", "--format=%cn%n%ce%n%cd"])).split("\n").map((line) => line.trim());
91
+ if (committerLines.length >= 3) {
92
+ info.commitCommitterName = committerLines[0];
93
+ info.commitCommitterEmail = committerLines[1];
94
+ info.commitCommitterDate = committerLines[2];
95
+ }
96
+ } catch (error) {
97
+ console.error("failed to fetch committer information:", error);
98
+ }
99
+ try {
100
+ const hash = await git.revparse(["HEAD"]);
101
+ const tagsResult = await git.tags(["--points-at", hash]);
102
+ const allTags = await git.tags();
103
+ info.tags = tagsResult.all;
104
+ info.tag = tagsResult.all[tagsResult.all.length - 1];
105
+ info.lastTag = allTags.latest;
106
+ } catch (error) {
107
+ console.error("failed to fetch tags information:", error);
108
+ }
109
+ try {
110
+ const origin = (await git.getRemotes(true)).find((remote) => remote.name === "origin");
111
+ if (origin?.refs.fetch) {
112
+ const parsed = (0, git_url_parse.default)(origin.refs.fetch);
113
+ if (parsed.resource === "github.com" && parsed.full_name) info.repositoryUrl = `https://github.com/${parsed.full_name}`;
114
+ }
115
+ } catch (error) {
116
+ console.error("failed to fetch GitHub URL:", error);
117
+ }
118
+ return generateOutput(info);
119
+ }
120
+ });
121
+
122
+ //#endregion
123
+ //#region src/core/modules/runtime.ts
124
+ const runtimeModule = {
125
+ name: "runtime",
126
+ load: async () => {
127
+ const runtime = {
128
+ platform: node_process.default.platform,
129
+ arch: node_process.default.arch,
130
+ versions: node_process.default.versions
131
+ };
132
+ return [
133
+ `export const platform = ${JSON.stringify(runtime.platform)}`,
134
+ `export const arch = ${JSON.stringify(runtime.arch)}`,
135
+ `export const versions = ${JSON.stringify(runtime.versions, null, 2)}`
136
+ ].join("\n");
137
+ }
138
+ };
139
+
140
+ //#endregion
141
+ //#region src/core/index.ts
142
+ const PREFIX = "virtual:build-meta/";
143
+ const PREFIX_WITH_NULL = `\0${PREFIX}`;
144
+ /**
145
+ * A unplugin factory, used by Unplugin to create a new plugin instance.
146
+ */
147
+ const unpluginFactory = (options = {}) => {
148
+ const { git = true, extraModules = [], runtime = true } = options;
149
+ const modules = [];
150
+ if (git) modules.push(git_default);
151
+ if (runtime) modules.push(runtimeModule);
152
+ modules.push(...extraModules);
153
+ return {
154
+ name: PLUGIN_NAME,
155
+ enforce: "pre",
156
+ resolveId(id) {
157
+ if (!id.startsWith(PREFIX)) return;
158
+ id = id.slice(19);
159
+ if (!modules.map((m) => m.name).includes(id)) return;
160
+ return `${PREFIX_WITH_NULL}${id}`;
161
+ },
162
+ loadInclude(id) {
163
+ if (!id.startsWith(PREFIX_WITH_NULL)) return false;
164
+ return modules.map((m) => m.name).includes(id.slice(PREFIX_WITH_NULL.length));
165
+ },
166
+ async load(id) {
167
+ if (!id.startsWith(PREFIX_WITH_NULL)) return;
168
+ id = id.slice(PREFIX_WITH_NULL.length);
169
+ for (const mod of Object.values(modules)) if (id === mod.name) return mod.load(this, id);
170
+ }
171
+ };
172
+ };
173
+ /**
174
+ * The main unplugin instance.
175
+ */
176
+ const unplugin$1 = /* @__PURE__ */ (0, unplugin.createUnplugin)(unpluginFactory);
177
+
178
+ //#endregion
179
+ Object.defineProperty(exports, 'NUXT_CONFIG_KEY', {
180
+ enumerable: true,
181
+ get: function () {
182
+ return NUXT_CONFIG_KEY;
183
+ }
184
+ });
185
+ Object.defineProperty(exports, 'PLUGIN_NAME', {
186
+ enumerable: true,
187
+ get: function () {
188
+ return PLUGIN_NAME;
189
+ }
190
+ });
191
+ Object.defineProperty(exports, '__toESM', {
192
+ enumerable: true,
193
+ get: function () {
194
+ return __toESM;
195
+ }
196
+ });
197
+ Object.defineProperty(exports, 'unplugin', {
198
+ enumerable: true,
199
+ get: function () {
200
+ return unplugin$1;
201
+ }
202
+ });
203
+ Object.defineProperty(exports, 'unpluginFactory', {
204
+ enumerable: true,
205
+ get: function () {
206
+ return unpluginFactory;
207
+ }
208
+ });