unplugin-build-meta 0.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 (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +253 -0
  3. package/dist/astro.cjs +21 -0
  4. package/dist/astro.d.cts +20 -0
  5. package/dist/astro.d.ts +20 -0
  6. package/dist/astro.mjs +21 -0
  7. package/dist/chunk-2TPIXTEW.cjs +154 -0
  8. package/dist/chunk-BJB5XFUG.mjs +11 -0
  9. package/dist/chunk-FH2TLW2E.cjs +11 -0
  10. package/dist/chunk-MMKRPHVS.mjs +154 -0
  11. package/dist/chunk-RJEZ2A3A.mjs +8 -0
  12. package/dist/chunk-SSXJV7C2.cjs +8 -0
  13. package/dist/chunk-VL4NLRZW.cjs +11 -0
  14. package/dist/chunk-YRRFFWQG.mjs +11 -0
  15. package/dist/esbuild.cjs +11 -0
  16. package/dist/esbuild.d.cts +20 -0
  17. package/dist/esbuild.d.ts +20 -0
  18. package/dist/esbuild.mjs +11 -0
  19. package/dist/farm.cjs +11 -0
  20. package/dist/farm.d.cts +19 -0
  21. package/dist/farm.d.ts +19 -0
  22. package/dist/farm.mjs +11 -0
  23. package/dist/index.cjs +9 -0
  24. package/dist/index.d.cts +13 -0
  25. package/dist/index.d.ts +13 -0
  26. package/dist/index.mjs +9 -0
  27. package/dist/module.cjs +6 -0
  28. package/dist/module.d.cts +13 -0
  29. package/dist/module.d.ts +13 -0
  30. package/dist/module.mjs +6 -0
  31. package/dist/nuxt.cjs +31 -0
  32. package/dist/nuxt.d.cts +20 -0
  33. package/dist/nuxt.d.ts +20 -0
  34. package/dist/nuxt.mjs +31 -0
  35. package/dist/rolldown.cjs +11 -0
  36. package/dist/rolldown.d.cts +20 -0
  37. package/dist/rolldown.d.ts +20 -0
  38. package/dist/rolldown.mjs +11 -0
  39. package/dist/rollup.cjs +11 -0
  40. package/dist/rollup.d.cts +20 -0
  41. package/dist/rollup.d.ts +20 -0
  42. package/dist/rollup.mjs +11 -0
  43. package/dist/rspack.cjs +11 -0
  44. package/dist/rspack.d.cts +24 -0
  45. package/dist/rspack.d.ts +24 -0
  46. package/dist/rspack.mjs +11 -0
  47. package/dist/types-dRhtxdLo.d.cts +16 -0
  48. package/dist/types-dRhtxdLo.d.ts +16 -0
  49. package/dist/vite.cjs +8 -0
  50. package/dist/vite.d.cts +20 -0
  51. package/dist/vite.d.ts +20 -0
  52. package/dist/vite.mjs +8 -0
  53. package/dist/webpack.cjs +8 -0
  54. package/dist/webpack.d.cts +18 -0
  55. package/dist/webpack.d.ts +18 -0
  56. package/dist/webpack.mjs +8 -0
  57. package/package.json +225 -0
  58. package/types/git.d.ts +19 -0
  59. package/types/index.d.ts +5 -0
package/dist/vite.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ import * as vite from 'vite';
2
+ import { B as BuildMetaOptions } from './types-dRhtxdLo.js';
3
+ import 'unplugin';
4
+
5
+ /**
6
+ * Vite plugin
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * // vite.config.ts
11
+ * import buildMeta from "unplugin-build-meta/vite"
12
+ *
13
+ * export default defineConfig({
14
+ * plugins: [buildMeta()],
15
+ * })
16
+ * ```
17
+ */
18
+ declare const _default: (options?: BuildMetaOptions | undefined) => vite.Plugin<any> | vite.Plugin<any>[];
19
+
20
+ export { _default as default };
package/dist/vite.mjs ADDED
@@ -0,0 +1,8 @@
1
+ import {
2
+ vite_default
3
+ } from "./chunk-YRRFFWQG.mjs";
4
+ import "./chunk-MMKRPHVS.mjs";
5
+ import "./chunk-RJEZ2A3A.mjs";
6
+ export {
7
+ vite_default as default
8
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkVL4NLRZWcjs = require('./chunk-VL4NLRZW.cjs');
4
+ require('./chunk-2TPIXTEW.cjs');
5
+ require('./chunk-SSXJV7C2.cjs');
6
+
7
+
8
+ exports.default = _chunkVL4NLRZWcjs.webpack_default;
@@ -0,0 +1,18 @@
1
+ import * as webpack from 'webpack';
2
+ import { B as BuildMetaOptions } from './types-dRhtxdLo.cjs';
3
+ import 'unplugin';
4
+
5
+ /**
6
+ * Webpack plugin
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * // webpack.config.js
11
+ * module.exports = {
12
+ * plugins: [require("unplugin-build-meta/webpack")()],
13
+ * }
14
+ * ```
15
+ */
16
+ declare const _default: (options?: BuildMetaOptions | undefined) => webpack.WebpackPluginInstance;
17
+
18
+ export { _default as default };
@@ -0,0 +1,18 @@
1
+ import * as webpack from 'webpack';
2
+ import { B as BuildMetaOptions } from './types-dRhtxdLo.js';
3
+ import 'unplugin';
4
+
5
+ /**
6
+ * Webpack plugin
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * // webpack.config.js
11
+ * module.exports = {
12
+ * plugins: [require("unplugin-build-meta/webpack")()],
13
+ * }
14
+ * ```
15
+ */
16
+ declare const _default: (options?: BuildMetaOptions | undefined) => webpack.WebpackPluginInstance;
17
+
18
+ export { _default as default };
@@ -0,0 +1,8 @@
1
+ import {
2
+ webpack_default
3
+ } from "./chunk-BJB5XFUG.mjs";
4
+ import "./chunk-MMKRPHVS.mjs";
5
+ import "./chunk-RJEZ2A3A.mjs";
6
+ export {
7
+ webpack_default as default
8
+ };
package/package.json ADDED
@@ -0,0 +1,225 @@
1
+ {
2
+ "name": "unplugin-build-meta",
3
+ "version": "0.1.0",
4
+ "description": "Provide build metadata (git info, etc.) to your JavaScript/TypeScript projects",
5
+ "type": "module",
6
+ "author": {
7
+ "name": "Lucas Nørgård",
8
+ "email": "lucasnrgaard@gmail.com",
9
+ "url": "https://luxass.dev"
10
+ },
11
+ "license": "MIT",
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/luxass/unplugin-build-meta.git"
15
+ },
16
+ "bugs": "https://github.com/luxass/unplugin-build-meta/issues",
17
+ "keywords": [
18
+ "build-meta",
19
+ "git",
20
+ "sha",
21
+ "unplugin",
22
+ "vite",
23
+ "webpack",
24
+ "rollup",
25
+ "esbuild",
26
+ "nuxt",
27
+ "astro"
28
+ ],
29
+ "workspaces": [
30
+ "playground/*"
31
+ ],
32
+ "exports": {
33
+ ".": {
34
+ "import": {
35
+ "types": "./dist/index.d.ts",
36
+ "default": "./dist/index.mjs"
37
+ },
38
+ "require": {
39
+ "types": "./dist/index.d.cts",
40
+ "default": "./dist/index.cjs"
41
+ }
42
+ },
43
+ "./astro": {
44
+ "import": {
45
+ "types": "./dist/astro.d.ts",
46
+ "default": "./dist/astro.mjs"
47
+ },
48
+ "require": {
49
+ "types": "./dist/astro.d.cts",
50
+ "default": "./dist/astro.cjs"
51
+ }
52
+ },
53
+ "./farm": {
54
+ "import": {
55
+ "types": "./dist/farm.d.ts",
56
+ "default": "./dist/farm.mjs"
57
+ },
58
+ "require": {
59
+ "types": "./dist/farm.d.cts",
60
+ "default": "./dist/farm.cjs"
61
+ }
62
+ },
63
+ "./rspack": {
64
+ "import": {
65
+ "types": "./dist/rspack.d.ts",
66
+ "default": "./dist/rspack.mjs"
67
+ },
68
+ "require": {
69
+ "types": "./dist/rspack.d.cts",
70
+ "default": "./dist/rspack.cjs"
71
+ }
72
+ },
73
+ "./rolldown": {
74
+ "import": {
75
+ "types": "./dist/rolldown.d.ts",
76
+ "default": "./dist/rolldown.mjs"
77
+ },
78
+ "require": {
79
+ "types": "./dist/rolldown.d.cts",
80
+ "default": "./dist/rolldown.cjs"
81
+ }
82
+ },
83
+ "./esbuild": {
84
+ "import": {
85
+ "types": "./dist/esbuild.d.ts",
86
+ "default": "./dist/esbuild.mjs"
87
+ },
88
+ "require": {
89
+ "types": "./dist/esbuild.d.cts",
90
+ "default": "./dist/esbuild.cjs"
91
+ }
92
+ },
93
+ "./nuxt": {
94
+ "import": {
95
+ "types": "./dist/nuxt.d.ts",
96
+ "default": "./dist/nuxt.mjs"
97
+ },
98
+ "require": {
99
+ "types": "./dist/nuxt.d.cts",
100
+ "default": "./dist/nuxt.cjs"
101
+ }
102
+ },
103
+ "./rollup": {
104
+ "import": {
105
+ "types": "./dist/rollup.d.ts",
106
+ "default": "./dist/rollup.mjs"
107
+ },
108
+ "require": {
109
+ "types": "./dist/rollup.d.cts",
110
+ "default": "./dist/rollup.cjs"
111
+ }
112
+ },
113
+ "./vite": {
114
+ "import": {
115
+ "types": "./dist/vite.d.ts",
116
+ "default": "./dist/vite.mjs"
117
+ },
118
+ "require": {
119
+ "types": "./dist/vite.d.cts",
120
+ "default": "./dist/vite.cjs"
121
+ }
122
+ },
123
+ "./webpack": {
124
+ "import": {
125
+ "types": "./dist/webpack.d.ts",
126
+ "default": "./dist/webpack.mjs"
127
+ },
128
+ "require": {
129
+ "types": "./dist/webpack.d.cts",
130
+ "default": "./dist/webpack.cjs"
131
+ }
132
+ },
133
+ "./types": {
134
+ "types": "./types/index.d.ts"
135
+ },
136
+ "./types/*": {
137
+ "types": "./types/*.d.ts"
138
+ },
139
+ "./package.json": "./package.json"
140
+ },
141
+ "main": "dist/index.cjs",
142
+ "module": "dist/index.mjs",
143
+ "types": "dist/index.d.ts",
144
+ "files": [
145
+ "dist",
146
+ "types"
147
+ ],
148
+ "peerDependencies": {
149
+ "@nuxt/kit": ">=3",
150
+ "@nuxt/schema": ">=3",
151
+ "@rspack/core": "^1.0.13",
152
+ "astro": ">=3",
153
+ "esbuild": "*",
154
+ "rolldown": ">=0.14.0",
155
+ "rollup": ">=3",
156
+ "vite": ">=3",
157
+ "webpack": "^4 || ^5"
158
+ },
159
+ "peerDependenciesMeta": {
160
+ "@nuxt/kit": {
161
+ "optional": true
162
+ },
163
+ "@nuxt/schema": {
164
+ "optional": true
165
+ },
166
+ "astro": {
167
+ "optional": true
168
+ },
169
+ "esbuild": {
170
+ "optional": true
171
+ },
172
+ "rollup": {
173
+ "optional": true
174
+ },
175
+ "vite": {
176
+ "optional": true
177
+ },
178
+ "webpack": {
179
+ "optional": true
180
+ },
181
+ "@rspack/core": {
182
+ "optional": true
183
+ },
184
+ "rolldown": {
185
+ "optional": true
186
+ }
187
+ },
188
+ "dependencies": {
189
+ "git-url-parse": "^16.1.0",
190
+ "simple-git": "^3.27.0",
191
+ "unplugin": "^2.2.2"
192
+ },
193
+ "devDependencies": {
194
+ "@luxass/eslint-config": "^4.17.1",
195
+ "@nuxt/kit": "^3.16.1",
196
+ "@nuxt/schema": "^3.16.1",
197
+ "@rspack/core": "^1.3.0",
198
+ "@types/node": "^22.9.0",
199
+ "esbuild": "^0.25.1",
200
+ "eslint": "^9.23.0",
201
+ "rolldown": "1.0.0-beta.7",
202
+ "rollup": "^4.38.0",
203
+ "tsup": "^8.4.0",
204
+ "typescript": "^5.8.2",
205
+ "vite": "^6.2.3",
206
+ "vitest": "^3.0.9",
207
+ "vitest-testdirs": "^2.2.0",
208
+ "webpack": "^5.98.0"
209
+ },
210
+ "scripts": {
211
+ "build": "tsup",
212
+ "dev": "tsup --watch",
213
+ "lint": "eslint .",
214
+ "test": "vitest --run",
215
+ "test:watch": "vitest",
216
+ "typecheck": "tsc --noEmit && pnpm -r typecheck",
217
+ "play:nuxt": "pnpm run --filter @unplugin-build-meta/nuxt dev",
218
+ "play:vite-vue": "pnpm run --filter @unplugin-build-meta/vite-vue dev",
219
+ "play:vite-react": "pnpm run --filter @unplugin-build-meta/vite-react dev",
220
+ "play:nextjs": "pnpm run --filter @unplugin-build-meta/nextjs dev",
221
+ "play:astro": "pnpm run --filter @unplugin-build-meta/astro dev",
222
+ "play:rspack": "pnpm run --filter @unplugin-build-meta/rspack dev",
223
+ "generate-types": "node scripts/generate-types.js"
224
+ }
225
+ }
package/types/git.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ // Auto-generated type definitions for unplugin-build-meta git module
2
+ // Do not edit manually!
3
+
4
+ declare module 'virtual:build-meta/git' {
5
+ declare const branch: string | null;
6
+ declare const sha: string | null;
7
+ declare const shortSha: string | null;
8
+ declare const latestCommitMessage: string | null;
9
+ declare const commitAuthorName: string | null;
10
+ declare const commitAuthorEmail: string | null;
11
+ declare const commitAuthorDate: string | null;
12
+ declare const commitCommitterName: string | null;
13
+ declare const commitCommitterEmail: string | null;
14
+ declare const commitCommitterDate: string | null;
15
+ declare const tag: string | null;
16
+ declare const tags: string[] | null;
17
+ declare const lastTag: string | null;
18
+ declare const repositoryUrl: string | null;
19
+ }
@@ -0,0 +1,5 @@
1
+ // Auto-generated type definitions for unplugin-build-meta
2
+ // Do not edit manually!
3
+
4
+ // Re-export git module types
5
+ import './git';