longmo-unplugin-info 1.0.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 (49) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +508 -0
  3. package/client.d.ts +106 -0
  4. package/dist/astro.cjs +25 -0
  5. package/dist/astro.d.cts +11 -0
  6. package/dist/astro.d.mts +11 -0
  7. package/dist/astro.d.ts +11 -0
  8. package/dist/astro.mjs +23 -0
  9. package/dist/esbuild.cjs +16 -0
  10. package/dist/esbuild.d.cts +7 -0
  11. package/dist/esbuild.d.mts +7 -0
  12. package/dist/esbuild.d.ts +7 -0
  13. package/dist/esbuild.mjs +14 -0
  14. package/dist/index.cjs +16 -0
  15. package/dist/index.d.cts +7 -0
  16. package/dist/index.d.mts +7 -0
  17. package/dist/index.d.ts +7 -0
  18. package/dist/index.mjs +10 -0
  19. package/dist/nuxt.cjs +43 -0
  20. package/dist/nuxt.d.cts +16 -0
  21. package/dist/nuxt.d.mts +16 -0
  22. package/dist/nuxt.d.ts +16 -0
  23. package/dist/nuxt.mjs +41 -0
  24. package/dist/rollup.cjs +16 -0
  25. package/dist/rollup.d.cts +7 -0
  26. package/dist/rollup.d.mts +7 -0
  27. package/dist/rollup.d.ts +7 -0
  28. package/dist/rollup.mjs +14 -0
  29. package/dist/rspack.cjs +16 -0
  30. package/dist/rspack.d.cts +7 -0
  31. package/dist/rspack.d.mts +7 -0
  32. package/dist/rspack.d.ts +7 -0
  33. package/dist/rspack.mjs +14 -0
  34. package/dist/shared/longmo-unplugin-info.B4uHFilH.mjs +609 -0
  35. package/dist/shared/longmo-unplugin-info.D5mpeSYM.cjs +619 -0
  36. package/dist/shared/longmo-unplugin-info.zS6I--Tu.d.cts +69 -0
  37. package/dist/shared/longmo-unplugin-info.zS6I--Tu.d.mts +69 -0
  38. package/dist/shared/longmo-unplugin-info.zS6I--Tu.d.ts +69 -0
  39. package/dist/vite.cjs +16 -0
  40. package/dist/vite.d.cts +7 -0
  41. package/dist/vite.d.mts +7 -0
  42. package/dist/vite.d.ts +7 -0
  43. package/dist/vite.mjs +14 -0
  44. package/dist/webpack.cjs +16 -0
  45. package/dist/webpack.d.cts +7 -0
  46. package/dist/webpack.d.mts +7 -0
  47. package/dist/webpack.d.ts +7 -0
  48. package/dist/webpack.mjs +14 -0
  49. package/package.json +168 -0
@@ -0,0 +1,69 @@
1
+ import { SimpleGit } from 'simple-git';
2
+
3
+ type Metadata = Record<string | number, any>;
4
+ type Env = Record<string | number, any>;
5
+ type ConsoleField = string;
6
+ interface Options {
7
+ /**
8
+ * Git repo root path
9
+ */
10
+ root?: string;
11
+ /**
12
+ * Github repo url
13
+ */
14
+ github?: string;
15
+ /**
16
+ * Sepcify build time manually
17
+ */
18
+ time?: Date;
19
+ /**
20
+ * Custom the exported fields in ~build/git
21
+ */
22
+ git?: Record<string, (git: SimpleGit) => Promise<any> | any>;
23
+ /**
24
+ * Custom the exported fields in ~build/svn
25
+ */
26
+ svn?: Record<string, (info: any) => Promise<any> | any>;
27
+ /**
28
+ * Filter exported fields of package.json
29
+ */
30
+ package?: string[] | Record<string, boolean | null | undefined>;
31
+ /**
32
+ * Pass some meta data to Vite app
33
+ *
34
+ * Notice: meta data will be serialized to JSON format
35
+ */
36
+ meta?: Metadata | (() => Metadata | Promise<Metadata>);
37
+ /**
38
+ * Pass environment variables to Vite SSR app
39
+ *
40
+ * For each key / value record
41
+ * - In the SSR environment, it will read the environment variable (e.g. process.env.<key>)
42
+ * - In the client environment, it will return the provided default value
43
+ */
44
+ env?: Metadata | (() => Env | Promise<Env>);
45
+ /**
46
+ * Print help build information
47
+ */
48
+ console?: {
49
+ /**
50
+ * Enable build info log under these NODE_ENV
51
+ *
52
+ * @default ['development','production']
53
+ */
54
+ environment?: string[];
55
+ fields?: ConsoleField[] | Record<string, ConsoleField>;
56
+ };
57
+ /**
58
+ * Custom virtual module prefix
59
+ *
60
+ * @default '~build'
61
+ */
62
+ prefix?: string;
63
+ /**
64
+ * Whether it is bundled for cloudflare worker runtime
65
+ */
66
+ cloudflare?: boolean;
67
+ }
68
+
69
+ export type { Options as O };
@@ -0,0 +1,69 @@
1
+ import { SimpleGit } from 'simple-git';
2
+
3
+ type Metadata = Record<string | number, any>;
4
+ type Env = Record<string | number, any>;
5
+ type ConsoleField = string;
6
+ interface Options {
7
+ /**
8
+ * Git repo root path
9
+ */
10
+ root?: string;
11
+ /**
12
+ * Github repo url
13
+ */
14
+ github?: string;
15
+ /**
16
+ * Sepcify build time manually
17
+ */
18
+ time?: Date;
19
+ /**
20
+ * Custom the exported fields in ~build/git
21
+ */
22
+ git?: Record<string, (git: SimpleGit) => Promise<any> | any>;
23
+ /**
24
+ * Custom the exported fields in ~build/svn
25
+ */
26
+ svn?: Record<string, (info: any) => Promise<any> | any>;
27
+ /**
28
+ * Filter exported fields of package.json
29
+ */
30
+ package?: string[] | Record<string, boolean | null | undefined>;
31
+ /**
32
+ * Pass some meta data to Vite app
33
+ *
34
+ * Notice: meta data will be serialized to JSON format
35
+ */
36
+ meta?: Metadata | (() => Metadata | Promise<Metadata>);
37
+ /**
38
+ * Pass environment variables to Vite SSR app
39
+ *
40
+ * For each key / value record
41
+ * - In the SSR environment, it will read the environment variable (e.g. process.env.<key>)
42
+ * - In the client environment, it will return the provided default value
43
+ */
44
+ env?: Metadata | (() => Env | Promise<Env>);
45
+ /**
46
+ * Print help build information
47
+ */
48
+ console?: {
49
+ /**
50
+ * Enable build info log under these NODE_ENV
51
+ *
52
+ * @default ['development','production']
53
+ */
54
+ environment?: string[];
55
+ fields?: ConsoleField[] | Record<string, ConsoleField>;
56
+ };
57
+ /**
58
+ * Custom virtual module prefix
59
+ *
60
+ * @default '~build'
61
+ */
62
+ prefix?: string;
63
+ /**
64
+ * Whether it is bundled for cloudflare worker runtime
65
+ */
66
+ cloudflare?: boolean;
67
+ }
68
+
69
+ export type { Options as O };
package/dist/vite.cjs ADDED
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ const index = require('./shared/longmo-unplugin-info.D5mpeSYM.cjs');
4
+ require('node:path');
5
+ require('node:process');
6
+ require('unplugin');
7
+ require('ci-info');
8
+ require('simple-git');
9
+ require('git-url-parse');
10
+ require('node:child_process');
11
+ require('node:util');
12
+ require('node:fs');
13
+
14
+ const VitePlugin = index.UnpluginInfo.vite;
15
+
16
+ module.exports = VitePlugin;
@@ -0,0 +1,7 @@
1
+ import * as vite from 'vite';
2
+ import { O as Options } from './shared/longmo-unplugin-info.zS6I--Tu.cjs';
3
+ import 'simple-git';
4
+
5
+ declare const _default: (options?: Options | undefined) => vite.Plugin<any> | vite.Plugin<any>[];
6
+
7
+ export = _default;
@@ -0,0 +1,7 @@
1
+ import * as vite from 'vite';
2
+ import { O as Options } from './shared/longmo-unplugin-info.zS6I--Tu.mjs';
3
+ import 'simple-git';
4
+
5
+ declare const _default: (options?: Options | undefined) => vite.Plugin<any> | vite.Plugin<any>[];
6
+
7
+ export { _default as default };
package/dist/vite.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import * as vite from 'vite';
2
+ import { O as Options } from './shared/longmo-unplugin-info.zS6I--Tu.js';
3
+ import 'simple-git';
4
+
5
+ declare const _default: (options?: Options | undefined) => vite.Plugin<any> | vite.Plugin<any>[];
6
+
7
+ export = _default;
package/dist/vite.mjs ADDED
@@ -0,0 +1,14 @@
1
+ import { U as UnpluginInfo } from './shared/longmo-unplugin-info.B4uHFilH.mjs';
2
+ import 'node:path';
3
+ import 'node:process';
4
+ import 'unplugin';
5
+ import 'ci-info';
6
+ import 'simple-git';
7
+ import 'git-url-parse';
8
+ import 'node:child_process';
9
+ import 'node:util';
10
+ import 'node:fs';
11
+
12
+ const VitePlugin = UnpluginInfo.vite;
13
+
14
+ export { VitePlugin as default };
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ const index = require('./shared/longmo-unplugin-info.D5mpeSYM.cjs');
4
+ require('node:path');
5
+ require('node:process');
6
+ require('unplugin');
7
+ require('ci-info');
8
+ require('simple-git');
9
+ require('git-url-parse');
10
+ require('node:child_process');
11
+ require('node:util');
12
+ require('node:fs');
13
+
14
+ const webpack = index.UnpluginInfo.webpack;
15
+
16
+ module.exports = webpack;
@@ -0,0 +1,7 @@
1
+ import * as webpack from 'webpack';
2
+ import { O as Options } from './shared/longmo-unplugin-info.zS6I--Tu.cjs';
3
+ import 'simple-git';
4
+
5
+ declare const _default: (options?: Options | undefined) => webpack.WebpackPluginInstance;
6
+
7
+ export = _default;
@@ -0,0 +1,7 @@
1
+ import * as webpack from 'webpack';
2
+ import { O as Options } from './shared/longmo-unplugin-info.zS6I--Tu.mjs';
3
+ import 'simple-git';
4
+
5
+ declare const _default: (options?: Options | undefined) => webpack.WebpackPluginInstance;
6
+
7
+ export { _default as default };
@@ -0,0 +1,7 @@
1
+ import * as webpack from 'webpack';
2
+ import { O as Options } from './shared/longmo-unplugin-info.zS6I--Tu.js';
3
+ import 'simple-git';
4
+
5
+ declare const _default: (options?: Options | undefined) => webpack.WebpackPluginInstance;
6
+
7
+ export = _default;
@@ -0,0 +1,14 @@
1
+ import { U as UnpluginInfo } from './shared/longmo-unplugin-info.B4uHFilH.mjs';
2
+ import 'node:path';
3
+ import 'node:process';
4
+ import 'unplugin';
5
+ import 'ci-info';
6
+ import 'simple-git';
7
+ import 'git-url-parse';
8
+ import 'node:child_process';
9
+ import 'node:util';
10
+ import 'node:fs';
11
+
12
+ const webpack = UnpluginInfo.webpack;
13
+
14
+ export { webpack as default };
package/package.json ADDED
@@ -0,0 +1,168 @@
1
+ {
2
+ "name": "longmo-unplugin-info",
3
+ "version": "1.0.0",
4
+ "description": "Export build information as virutal module",
5
+ "keywords": [
6
+ "debug",
7
+ "config",
8
+ "unplugin",
9
+ "build",
10
+ "vite",
11
+ "vite-plugin",
12
+ "webpack",
13
+ "rspack",
14
+ "git",
15
+ "svn",
16
+ "CI"
17
+ ],
18
+ "homepage": "https://yjl9903.github.io/unplugin-info/",
19
+ "bugs": {
20
+ "url": "https://github.com/yjl9903/unplugin-info/issues"
21
+ },
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/yjl9903/unplugin-info.git"
25
+ },
26
+ "license": "MIT",
27
+ "author": "XLor",
28
+ "sideEffects": false,
29
+ "type": "module",
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "import": "./dist/index.mjs",
34
+ "require": "./dist/index.cjs"
35
+ },
36
+ "./*": "./*",
37
+ "./astro": {
38
+ "types": "./dist/astro.d.ts",
39
+ "import": "./dist/astro.mjs",
40
+ "require": "./dist/astro.cjs"
41
+ },
42
+ "./vite": {
43
+ "types": "./dist/vite.d.ts",
44
+ "import": "./dist/vite.mjs",
45
+ "require": "./dist/vite.cjs"
46
+ },
47
+ "./webpack": {
48
+ "types": "./dist/webpack.d.ts",
49
+ "import": "./dist/webpack.mjs",
50
+ "require": "./dist/webpack.cjs"
51
+ },
52
+ "./rollup": {
53
+ "types": "./dist/rollup.d.ts",
54
+ "import": "./dist/rollup.mjs",
55
+ "require": "./dist/rollup.cjs"
56
+ },
57
+ "./esbuild": {
58
+ "types": "./dist/esbuild.d.ts",
59
+ "import": "./dist/esbuild.mjs",
60
+ "require": "./dist/esbuild.cjs"
61
+ },
62
+ "./nuxt": {
63
+ "types": "./dist/nuxt.d.ts",
64
+ "import": "./dist/nuxt.mjs",
65
+ "require": "./dist/nuxt.cjs"
66
+ },
67
+ "./client": {
68
+ "types": "./client.d.ts"
69
+ },
70
+ "./rspack": {
71
+ "types": "./dist/rspack.d.ts",
72
+ "import": "./dist/rspack.mjs",
73
+ "require": "./dist/rspack.cjs"
74
+ }
75
+ },
76
+ "main": "dist/index.cjs",
77
+ "module": "dist/index.mjs",
78
+ "types": "dist/index.d.ts",
79
+ "typesVersions": {
80
+ "*": {
81
+ "*": [
82
+ "./dist/*",
83
+ "./*"
84
+ ]
85
+ }
86
+ },
87
+ "files": [
88
+ "dist",
89
+ "*.d.ts"
90
+ ],
91
+ "scripts": {
92
+ "build": "unbuild",
93
+ "build:nuxt": "pnpm -C examples/nuxt build",
94
+ "build:vite": "pnpm -C examples/vite build",
95
+ "build:webpack": "pnpm -C examples/webpack build",
96
+ "build:rspack": "pnpm -C examples/rspack build",
97
+ "dev": "unbuild --stub",
98
+ "dev:nuxt": "pnpm -C examples/nuxt dev",
99
+ "dev:vite": "pnpm -C examples/vite dev",
100
+ "dev:webpack": "pnpm -C examples/webpack dev",
101
+ "dev:rspack": "pnpm -C examples/rspack dev",
102
+ "format": "prettier --write examples src",
103
+ "release": "bumpp package.json examples/*/package.json --commit --push --tag && pnpm publish",
104
+ "test": "vitest",
105
+ "test:ci": "vitest --run",
106
+ "typecheck": "tsc --noEmit",
107
+ "preversion": "pnpm typecheck && pnpm build"
108
+ },
109
+ "dependencies": {
110
+ "ci-info": "^4.3.1",
111
+ "git-url-parse": "^16.1.0",
112
+ "simple-git": "^3.30.0",
113
+ "unplugin": "^2.3.11"
114
+ },
115
+ "devDependencies": {
116
+ "@nuxt/kit": "^4.2.2",
117
+ "@nuxt/schema": "^4.2.2",
118
+ "@types/git-url-parse": "^16.0.2",
119
+ "@types/node": "^24.10.4",
120
+ "@types/parse-github-url": "^1.0.3",
121
+ "@types/remote-origin-url": "^2.0.4",
122
+ "bumpp": "^10.3.2",
123
+ "chalk": "^5.6.2",
124
+ "date-fns": "^4.1.0",
125
+ "fast-glob": "^3.3.3",
126
+ "prettier": "^3.7.4",
127
+ "rollup": "^4.54.0",
128
+ "tsx": "^4.21.0",
129
+ "typescript": "^5.9.3",
130
+ "unbuild": "^3.6.1",
131
+ "vite": "^7.3.0",
132
+ "vitest": "^4.0.16",
133
+ "webpack": "^5.104.1"
134
+ },
135
+ "peerDependencies": {
136
+ "@nuxt/kit": ">=3",
137
+ "@nuxt/schema": ">=3",
138
+ "esbuild": "*",
139
+ "rollup": "^2 || ^3 || ^4",
140
+ "vite": ">=3.2.7",
141
+ "webpack": "^4 || ^5",
142
+ "@rspack/core": "*"
143
+ },
144
+ "peerDependenciesMeta": {
145
+ "@nuxt/kit": {
146
+ "optional": true
147
+ },
148
+ "@nuxt/schema": {
149
+ "optional": true
150
+ },
151
+ "esbuild": {
152
+ "optional": true
153
+ },
154
+ "rollup": {
155
+ "optional": true
156
+ },
157
+ "vite": {
158
+ "optional": true
159
+ },
160
+ "webpack": {
161
+ "optional": true
162
+ },
163
+ "@rspack/core": {
164
+ "optional": true
165
+ }
166
+ },
167
+ "packageManager": "pnpm@10.27.0"
168
+ }