@shellicar/build-version 0.2.0 → 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.
- package/README.md +11 -57
- package/dist/astro.cjs +1 -1
- package/dist/astro.js +1 -1
- package/dist/chunk-32QWTZ5P.js +1 -0
- package/dist/chunk-32QWTZ5P.js.map +1 -0
- package/dist/chunk-5GXQW5SA.js +1 -0
- package/dist/chunk-5GXQW5SA.js.map +1 -0
- package/dist/chunk-6ZZYXQ3C.cjs +1 -0
- package/dist/chunk-6ZZYXQ3C.cjs.map +1 -0
- package/dist/chunk-DEAFKXO3.cjs +1 -0
- package/dist/chunk-DEAFKXO3.cjs.map +1 -0
- package/dist/chunk-F4P4OA2V.cjs +1 -0
- package/dist/chunk-F4P4OA2V.cjs.map +1 -0
- package/dist/chunk-IPEEM23D.cjs +1 -0
- package/dist/chunk-IPEEM23D.cjs.map +1 -0
- package/dist/chunk-N3C34IHY.js +1 -0
- package/dist/chunk-N3C34IHY.js.map +1 -0
- package/dist/chunk-UP763FPS.js +1 -0
- package/dist/chunk-UP763FPS.js.map +1 -0
- package/dist/chunk-XVJ5STCE.cjs +1 -0
- package/dist/chunk-XVJ5STCE.cjs.map +1 -0
- package/dist/chunk-YO3QEXX7.js +1 -0
- package/dist/chunk-YO3QEXX7.js.map +1 -0
- package/dist/core/defaults.cjs +1 -1
- package/dist/core/defaults.cjs.map +1 -1
- package/dist/core/defaults.d.cts +0 -4
- package/dist/core/defaults.d.ts +0 -4
- package/dist/core/defaults.js +1 -1
- package/dist/core/defaults.js.map +1 -1
- package/dist/core/{version2.cjs → export.cjs} +1 -1
- package/dist/core/export.cjs.map +1 -0
- package/dist/core/{version2.js → export.js} +1 -1
- package/dist/core/export.js.map +1 -0
- package/dist/core/git.cjs +1 -1
- package/dist/core/git.d.cts +3 -3
- package/dist/core/git.d.ts +3 -3
- package/dist/core/git.js +1 -1
- package/dist/core/gitversion.cjs +1 -1
- package/dist/core/gitversion.d.cts +1 -2
- package/dist/core/gitversion.d.ts +1 -2
- package/dist/core/gitversion.js +1 -1
- package/dist/core/index.cjs +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/module.cjs +1 -1
- package/dist/core/module.d.cts +2 -3
- package/dist/core/module.d.ts +2 -3
- package/dist/core/module.js +1 -1
- package/dist/core/types.cjs +1 -1
- package/dist/core/types.d.cts +9 -11
- package/dist/core/types.d.ts +9 -11
- package/dist/core/types.js +1 -1
- package/dist/core/version.cjs +1 -1
- package/dist/core/version.cjs.map +1 -1
- package/dist/core/version.d.cts +3 -3
- package/dist/core/version.d.ts +3 -3
- package/dist/core/version.js +1 -1
- package/dist/core/version.js.map +1 -1
- package/dist/esbuild.cjs +1 -1
- package/dist/esbuild.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/nuxt.cjs +1 -1
- package/dist/nuxt.cjs.map +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/nuxt.js.map +1 -1
- package/dist/rollup.cjs +1 -1
- package/dist/rollup.js +1 -1
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/package.json +142 -50
- package/dist/chunk-2UD32HH3.cjs +0 -1
- package/dist/chunk-2UD32HH3.cjs.map +0 -1
- package/dist/chunk-5IYSST7J.cjs +0 -1
- package/dist/chunk-5IYSST7J.cjs.map +0 -1
- package/dist/chunk-7SSI6LRL.cjs +0 -1
- package/dist/chunk-7SSI6LRL.cjs.map +0 -1
- package/dist/chunk-DASORIFT.cjs +0 -1
- package/dist/chunk-DASORIFT.cjs.map +0 -1
- package/dist/chunk-I2R453FT.cjs +0 -1
- package/dist/chunk-I2R453FT.cjs.map +0 -1
- package/dist/chunk-IQWHUN4G.cjs +0 -1
- package/dist/chunk-IQWHUN4G.cjs.map +0 -1
- package/dist/chunk-MY42VUMY.js +0 -1
- package/dist/chunk-MY42VUMY.js.map +0 -1
- package/dist/chunk-QX3NSNGO.js +0 -1
- package/dist/chunk-QX3NSNGO.js.map +0 -1
- package/dist/chunk-TNW5UA2M.js +0 -1
- package/dist/chunk-TNW5UA2M.js.map +0 -1
- package/dist/chunk-X6ROBIFK.js +0 -1
- package/dist/chunk-X6ROBIFK.js.map +0 -1
- package/dist/chunk-XH5ECEPT.js +0 -1
- package/dist/chunk-XH5ECEPT.js.map +0 -1
- package/dist/chunk-ZOEZKVA6.js +0 -1
- package/dist/chunk-ZOEZKVA6.js.map +0 -1
- package/dist/core/version2.cjs.map +0 -1
- package/dist/core/version2.js.map +0 -1
- /package/dist/core/{version2.d.cts → export.d.cts} +0 -0
- /package/dist/core/{version2.d.ts → export.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,79 +1,33 @@
|
|
|
1
1
|
# @shellicar/build-version
|
|
2
2
|
|
|
3
|
-
Build plugin that calculates and exposes version information through a virtual module import.
|
|
3
|
+
> Build plugin that calculates and exposes version information through a virtual module import.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Usage
|
|
5
|
+
## Installation & Quick Start
|
|
8
6
|
|
|
9
7
|
```sh
|
|
10
|
-
|
|
8
|
+
npm i --save @shellicar/build-version
|
|
11
9
|
```
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
```sh
|
|
12
|
+
pnpm add @shellicar/build-version
|
|
13
|
+
```
|
|
14
14
|
|
|
15
15
|
```ts
|
|
16
|
+
// vite.config.ts
|
|
16
17
|
import VersionPlugin from '@shellicar/build-version/vite'
|
|
17
18
|
|
|
18
19
|
export default defineConfig({
|
|
19
20
|
plugins: [
|
|
20
|
-
VersionPlugin({
|
|
21
|
-
versionCalculator: 'git'
|
|
22
|
-
})
|
|
21
|
+
VersionPlugin({})
|
|
23
22
|
]
|
|
24
23
|
})
|
|
25
24
|
```
|
|
26
25
|
|
|
27
|
-
### Importing Version Information
|
|
28
|
-
|
|
29
|
-
```ts
|
|
30
|
-
interface VersionInfo {
|
|
31
|
-
buildDate: string;
|
|
32
|
-
branch: string;
|
|
33
|
-
sha: string;
|
|
34
|
-
shortSha: string;
|
|
35
|
-
commitDate: string;
|
|
36
|
-
version: string;
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
26
|
```ts
|
|
27
|
+
// main.ts
|
|
41
28
|
import version from '@shellicar/build-version/version'
|
|
42
|
-
|
|
43
|
-
console.log(version)
|
|
44
29
|
```
|
|
45
30
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
#### Git Calculator
|
|
49
|
-
Uses pure git commands to calculate version numbers following mainline versioning:
|
|
50
|
-
- On main branch: increment patch version for each commit after a tag
|
|
51
|
-
- On feature branches: use base version with branch name and commit count suffix
|
|
52
|
-
- On PR branches: use PR number in version suffix
|
|
53
|
-
|
|
54
|
-
Example versions:
|
|
55
|
-
- Tagged commit on main: `1.2.3`
|
|
56
|
-
- Commits after tag on main: `1.2.4`, `1.2.5`
|
|
57
|
-
- Feature branch: `1.2.3-feature-name.2`
|
|
58
|
-
- PR branch: `1.2.3-PullRequest0123.2`
|
|
59
|
-
|
|
60
|
-
#### GitVersion Calculator
|
|
61
|
-
Uses the GitVersion CLI to calculate versions. Requires GitVersion to be installed.
|
|
62
|
-
|
|
63
|
-
#### Custom Calculator
|
|
64
|
-
Provide your own version calculation function:
|
|
65
|
-
|
|
66
|
-
```ts
|
|
67
|
-
VersionPlugin({
|
|
68
|
-
versionCalculator: () => '1.0.0-custom'
|
|
69
|
-
})
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Options
|
|
73
|
-
|
|
74
|
-
See [types.ts](./packages/@shellicar/build-version/src/core/types.ts) for detailed options documentation.
|
|
75
|
-
|
|
76
|
-
## Credits
|
|
31
|
+
## Documentation
|
|
77
32
|
|
|
78
|
-
|
|
79
|
-
- [GitVersion](https://gitversion.net)
|
|
33
|
+
For full documentation, visit [here](https://github.com/shellicar/build-version).
|
package/dist/astro.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./chunk-
|
|
1
|
+
"use strict";var e=require("./chunk-IPEEM23D.cjs");require("./chunk-6ZZYXQ3C.cjs"),require("./chunk-DEAFKXO3.cjs"),require("./chunk-F4P4OA2V.cjs"),require("./chunk-XVJ5STCE.cjs");var u=require("./chunk-PK6SKIKE.cjs"),r=u.__name((r=>({name:"build-version",hooks:{"astro:config:setup":u.__name((async u=>{u.config.vite.plugins||=[],u.config.vite.plugins.push(e.plugin.vite(r))}),"astro:config:setup")}})),"default");module.exports=r,module.exports=exports.default;//# sourceMappingURL=astro.cjs.map
|
package/dist/astro.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{plugin as o}from"./chunk-
|
|
1
|
+
import{plugin as o}from"./chunk-32QWTZ5P.js";import"./chunk-5GXQW5SA.js";import"./chunk-UP763FPS.js";import"./chunk-N3C34IHY.js";import"./chunk-YO3QEXX7.js";import{__name as i}from"./chunk-7QVYU63E.js";var s=i((s=>({name:"build-version",hooks:{"astro:config:setup":i((async i=>{i.config.vite.plugins||=[],i.config.vite.plugins.push(o.vite(s))}),"astro:config:setup")}})),"default");export{s as default};//# sourceMappingURL=astro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{virtualModuleId as r}from"./chunk-5GXQW5SA.js";import{loadVirtualModule as o}from"./chunk-UP763FPS.js";import{__name as e}from"./chunk-7QVYU63E.js";import{createUnplugin as n}from"unplugin";var u=e((r=>`\0${r}`),"resolveVirtualId"),s=n(e((n=>{const s=n.debug?(r,...o)=>console.debug(`[version] ${r}`,...o):()=>{},i={debug:s,error:e(((r,...o)=>console.error(`[version] ${r}`,...o)),"error")};return{name:"unplugin-version",enforce:"pre",resolveId(o){if(o===r)return s("resolveId %s",o),u(r)},load(e){if(e===u(r))return s("load %s",e),o(n,i)}}}),"pluginFactory"));export{s as plugin};//# sourceMappingURL=chunk-32QWTZ5P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/index.ts"],"names":[],"mappings":"qLAKA,IAAM,gBAAmB,mBAAA,MAAA,CAAA,CAAC,EAAe,KAAA,CAAA,EAAA,EAAK,EAAE,CAAvB,CAAA,EAAA,kBAAA,CAAA;AAEzB,IAAM,aAAA,2BAA2C,OAAqB,KAAA;AACpE,EAAA,MAAM,KAAQ,GAAA,OAAA,CAAQ,KAAQ,GAAA,CAAC,YAAsB,cAA8B,KAAA,OAAA,CAAQ,KAAM,CAAA,CAAA,UAAA,EAAa,OAAO,CAAA,CAAA,EAAI,GAAG,cAAc,IAAI,MAAM;AAAA,GAAC;AACrJ,EAAM,MAAA,KAAA,mBAAS,MAAA,CAAA,CAAA,OAAA,EAAA,GAAsB,cAA8B,KAAA,OAAA,CAAQ,KAAM,CAAA,CAAA,UAAA,EAAa,OAAO,CAAA,CAAA,EAAI,GAAG,cAAc,CAA5G,EAAA,OAAA,CAAA;AACd,EAAA,MAAM,MAAkB,GAAA;AAAA,IACtB,KAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,kBAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,IACT,UAAU,EAAI,EAAA;AACZ,MAAA,IAAI,OAAO,eAAiB,EAAA;AAC1B,QAAA,KAAA,CAAM,gBAAgB,EAAE,CAAA;AACxB,QAAA,OAAO,iBAAiB,eAAe,CAAA;AAAA;AACzC,KACF;AAAA,IACA,KAAK,EAAI,EAAA;AACP,MAAI,IAAA,EAAA,KAAO,gBAAiB,CAAA,eAAe,CAAG,EAAA;AAC5C,QAAA,KAAA,CAAM,WAAW,EAAE,CAAA;AACnB,QAAO,OAAA,iBAAA,CAAkB,SAAS,MAAM,CAAA;AAAA;AAC1C;AACF,GACF;AACF,CAxBgD,EAAA,eAAA,CAAA;AA0BnC,IAAA,MAAA,GAAS,eAAe,aAAa","file":"chunk-32QWTZ5P.js","sourcesContent":["import { type UnpluginFactory, createUnplugin } from 'unplugin';\nimport { virtualModuleId } from './module';\nimport type { ILogger, Options } from './types';\nimport { loadVirtualModule } from './version';\n\nconst resolveVirtualId = (id: string) => `\\0${id}`;\n\nconst pluginFactory: UnpluginFactory<Options> = (options: Options) => {\n const debug = options.debug ? (message?: unknown, ...optionalParams: unknown[]) => console.debug(`[version] ${message}`, ...optionalParams) : () => {};\n const error = (message?: unknown, ...optionalParams: unknown[]) => console.error(`[version] ${message}`, ...optionalParams);\n const logger: ILogger = {\n debug,\n error,\n };\n\n return {\n name: 'unplugin-version',\n enforce: 'pre',\n resolveId(id) {\n if (id === virtualModuleId) {\n debug('resolveId %s', id);\n return resolveVirtualId(virtualModuleId);\n }\n },\n load(id) {\n if (id === resolveVirtualId(virtualModuleId)) {\n debug('load %s', id);\n return loadVirtualModule(options, logger);\n }\n },\n };\n};\n\nexport const plugin = createUnplugin(pluginFactory);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var r="@shellicar/build-version/version";export{r as virtualModuleId};//# sourceMappingURL=chunk-5GXQW5SA.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/core/module.ts"],"names":[],"mappings":";AACE,IAAQ,IAAA,GAAA,0BAAA;;;ACCV,IAAM,eAAkB,GAAA,SAAA;AAEjB,IAAM,eAAkB,GAAA,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,eAAe,CAAA","file":"chunk-5GXQW5SA.js","sourcesContent":["{\n \"name\": \"@shellicar/build-version\",\n \"private\": false,\n \"version\": \"1.0.0\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"author\": \"Stephen Hellicar\",\n \"description\": \"Build plugin that calculates and exposes version information through a virtual module import.\",\n \"keywords\": [\"build\", \"plugin\", \"version\", \"esbuild\", \"vite\", \"gitversion\", \"git\"],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/shellicar/build-version.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/shellicar/build-version/issues\"\n },\n \"homepage\": \"https://github.com/shellicar/build-version#readme\",\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"exports\": {\n \"./version\": {\n \"require\": {\n \"types\": \"./dist/core/version.d.cts\",\n \"default\": \"./dist/core/version.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/core/version.d.ts\",\n \"default\": \"./dist/core/version.js\"\n }\n },\n \".\": {\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"./astro\": {\n \"require\": {\n \"types\": \"./dist/astro.d.cts\",\n \"default\": \"./dist/astro.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/astro.d.ts\",\n \"default\": \"./dist/astro.js\"\n }\n },\n \"./rspack\": {\n \"require\": {\n \"types\": \"./dist/rspack.d.cts\",\n \"default\": \"./dist/rspack.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/rspack.d.ts\",\n \"default\": \"./dist/rspack.js\"\n }\n },\n \"./vite\": {\n \"require\": {\n \"types\": \"./dist/vite.d.cts\",\n \"default\": \"./dist/vite.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/vite.d.ts\",\n \"default\": \"./dist/vite.js\"\n }\n },\n \"./webpack\": {\n \"require\": {\n \"types\": \"./dist/webpack.d.cts\",\n \"default\": \"./dist/webpack.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/webpack.d.ts\",\n \"default\": \"./dist/webpack.js\"\n }\n },\n \"./rollup\": {\n \"require\": {\n \"types\": \"./dist/rollup.d.cts\",\n \"default\": \"./dist/rollup.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/rollup.d.ts\",\n \"default\": \"./dist/rollup.js\"\n }\n },\n \"./esbuild\": {\n \"require\": {\n \"types\": \"./dist/esbuild.d.cts\",\n \"default\": \"./dist/esbuild.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/esbuild.d.ts\",\n \"default\": \"./dist/esbuild.js\"\n }\n },\n \"./nuxt\": {\n \"require\": {\n \"types\": \"./dist/nuxt.d.cts\",\n \"default\": \"./dist/nuxt.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/nuxt.d.ts\",\n \"default\": \"./dist/nuxt.js\"\n }\n },\n \"./farm\": {\n \"require\": {\n \"types\": \"./dist/farm.d.cts\",\n \"default\": \"./dist/farm.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/farm.d.ts\",\n \"default\": \"./dist/farm.js\"\n }\n },\n \"./types\": {\n \"require\": {\n \"types\": \"./dist/core/types.d.cts\",\n \"default\": \"./dist/core/types.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/core/types.d.ts\",\n \"default\": \"./dist/core/types.js\"\n }\n },\n \"./package.json\": \"./package.json\"\n },\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"typesVersions\": {\n \"*\": {\n \"version\": [\"./dist/core/export.d.ts\"],\n \"astro\": [\"./dist/astro.d.ts\"],\n \"rspack\": [\"./dist/rspack.d.ts\"],\n \"vite\": [\"./dist/vite.d.ts\"],\n \"webpack\": [\"./dist/webpack.d.ts\"],\n \"rollup\": [\"./dist/rollup.d.ts\"],\n \"esbuild\": [\"./dist/esbuild.d.ts\"],\n \"nuxt\": [\"./dist/nuxt.d.ts\"],\n \"farm\": [\"./dist/farm.d.ts\"],\n \"types\": [\"./dist/core/types.d.ts\"],\n \"*\": [\"./dist/*\"]\n }\n },\n \"files\": [\"dist\"],\n \"scripts\": {\n \"build\": \"tsup\",\n \"dev\": \"tsup --watch src\",\n \"type-check\": \"tsc -p tsconfig.check.json\",\n \"prepublishOnly\": \"run-s build test ci\",\n \"postpublish\": \"pnpm version --no-git-tag-version patch\"\n },\n \"peerDependencies\": {\n \"@farmfe/core\": \">=1\",\n \"@nuxt/kit\": \"^3\",\n \"@nuxt/schema\": \"^3\",\n \"esbuild\": \"*\",\n \"rollup\": \"^3\",\n \"vite\": \"^6\",\n \"webpack\": \"^4 || ^5\"\n },\n \"peerDependenciesMeta\": {\n \"@farmfe/core\": {\n \"optional\": true\n },\n \"@nuxt/kit\": {\n \"optional\": true\n },\n \"@nuxt/schema\": {\n \"optional\": true\n },\n \"esbuild\": {\n \"optional\": true\n },\n \"rollup\": {\n \"optional\": true\n },\n \"vite\": {\n \"optional\": true\n },\n \"webpack\": {\n \"optional\": true\n }\n },\n \"devDependencies\": {\n \"@nuxt/kit\": \"^3.15.1\",\n \"@nuxt/schema\": \"^3.15.1\",\n \"@tsconfig/node20\": \"^20.1.4\",\n \"@types/node\": \"^22.10.5\",\n \"bumpp\": \"^9.9.2\",\n \"chalk\": \"^5.4.1\",\n \"esno\": \"^4.8.0\",\n \"npm-run-all2\": \"^7.0.2\",\n \"rollup\": \"^4.30.0\",\n \"terser\": \"^5.37.0\",\n \"tsup\": \"^8.3.5\",\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^6.0.7\",\n \"vitest\": \"^2.1.8\",\n \"webpack\": \"^5.97.1\"\n },\n \"dependencies\": {\n \"unplugin\": \"^2.1.2\"\n }\n}\n","import { name } from '../../package.json';\n\nconst exportSpecifier = 'version';\n\nexport const virtualModuleId = `${name}/${exportSpecifier}`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";exports.virtualModuleId="@shellicar/build-version/version";//# sourceMappingURL=chunk-6ZZYXQ3C.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/core/module.ts"],"names":[],"mappings":";AACE,IAAQ,IAAA,GAAA,0BAAA;;;ACCV,IAAM,eAAkB,GAAA,SAAA;AAEjB,IAAM,eAAkB,GAAA,CAAA,EAAG,IAAI,CAAA,CAAA,EAAI,eAAe,CAAA","file":"chunk-6ZZYXQ3C.cjs","sourcesContent":["{\n \"name\": \"@shellicar/build-version\",\n \"private\": false,\n \"version\": \"1.0.0\",\n \"type\": \"module\",\n \"license\": \"MIT\",\n \"author\": \"Stephen Hellicar\",\n \"description\": \"Build plugin that calculates and exposes version information through a virtual module import.\",\n \"keywords\": [\"build\", \"plugin\", \"version\", \"esbuild\", \"vite\", \"gitversion\", \"git\"],\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/shellicar/build-version.git\"\n },\n \"bugs\": {\n \"url\": \"https://github.com/shellicar/build-version/issues\"\n },\n \"homepage\": \"https://github.com/shellicar/build-version#readme\",\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"exports\": {\n \"./version\": {\n \"require\": {\n \"types\": \"./dist/core/version.d.cts\",\n \"default\": \"./dist/core/version.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/core/version.d.ts\",\n \"default\": \"./dist/core/version.js\"\n }\n },\n \".\": {\n \"require\": {\n \"types\": \"./dist/index.d.cts\",\n \"default\": \"./dist/index.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/index.d.ts\",\n \"default\": \"./dist/index.js\"\n }\n },\n \"./astro\": {\n \"require\": {\n \"types\": \"./dist/astro.d.cts\",\n \"default\": \"./dist/astro.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/astro.d.ts\",\n \"default\": \"./dist/astro.js\"\n }\n },\n \"./rspack\": {\n \"require\": {\n \"types\": \"./dist/rspack.d.cts\",\n \"default\": \"./dist/rspack.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/rspack.d.ts\",\n \"default\": \"./dist/rspack.js\"\n }\n },\n \"./vite\": {\n \"require\": {\n \"types\": \"./dist/vite.d.cts\",\n \"default\": \"./dist/vite.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/vite.d.ts\",\n \"default\": \"./dist/vite.js\"\n }\n },\n \"./webpack\": {\n \"require\": {\n \"types\": \"./dist/webpack.d.cts\",\n \"default\": \"./dist/webpack.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/webpack.d.ts\",\n \"default\": \"./dist/webpack.js\"\n }\n },\n \"./rollup\": {\n \"require\": {\n \"types\": \"./dist/rollup.d.cts\",\n \"default\": \"./dist/rollup.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/rollup.d.ts\",\n \"default\": \"./dist/rollup.js\"\n }\n },\n \"./esbuild\": {\n \"require\": {\n \"types\": \"./dist/esbuild.d.cts\",\n \"default\": \"./dist/esbuild.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/esbuild.d.ts\",\n \"default\": \"./dist/esbuild.js\"\n }\n },\n \"./nuxt\": {\n \"require\": {\n \"types\": \"./dist/nuxt.d.cts\",\n \"default\": \"./dist/nuxt.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/nuxt.d.ts\",\n \"default\": \"./dist/nuxt.js\"\n }\n },\n \"./farm\": {\n \"require\": {\n \"types\": \"./dist/farm.d.cts\",\n \"default\": \"./dist/farm.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/farm.d.ts\",\n \"default\": \"./dist/farm.js\"\n }\n },\n \"./types\": {\n \"require\": {\n \"types\": \"./dist/core/types.d.cts\",\n \"default\": \"./dist/core/types.cjs\"\n },\n \"import\": {\n \"types\": \"./dist/core/types.d.ts\",\n \"default\": \"./dist/core/types.js\"\n }\n },\n \"./package.json\": \"./package.json\"\n },\n \"main\": \"./dist/index.cjs\",\n \"module\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"typesVersions\": {\n \"*\": {\n \"version\": [\"./dist/core/export.d.ts\"],\n \"astro\": [\"./dist/astro.d.ts\"],\n \"rspack\": [\"./dist/rspack.d.ts\"],\n \"vite\": [\"./dist/vite.d.ts\"],\n \"webpack\": [\"./dist/webpack.d.ts\"],\n \"rollup\": [\"./dist/rollup.d.ts\"],\n \"esbuild\": [\"./dist/esbuild.d.ts\"],\n \"nuxt\": [\"./dist/nuxt.d.ts\"],\n \"farm\": [\"./dist/farm.d.ts\"],\n \"types\": [\"./dist/core/types.d.ts\"],\n \"*\": [\"./dist/*\"]\n }\n },\n \"files\": [\"dist\"],\n \"scripts\": {\n \"build\": \"tsup\",\n \"dev\": \"tsup --watch src\",\n \"type-check\": \"tsc -p tsconfig.check.json\",\n \"prepublishOnly\": \"run-s build test ci\",\n \"postpublish\": \"pnpm version --no-git-tag-version patch\"\n },\n \"peerDependencies\": {\n \"@farmfe/core\": \">=1\",\n \"@nuxt/kit\": \"^3\",\n \"@nuxt/schema\": \"^3\",\n \"esbuild\": \"*\",\n \"rollup\": \"^3\",\n \"vite\": \"^6\",\n \"webpack\": \"^4 || ^5\"\n },\n \"peerDependenciesMeta\": {\n \"@farmfe/core\": {\n \"optional\": true\n },\n \"@nuxt/kit\": {\n \"optional\": true\n },\n \"@nuxt/schema\": {\n \"optional\": true\n },\n \"esbuild\": {\n \"optional\": true\n },\n \"rollup\": {\n \"optional\": true\n },\n \"vite\": {\n \"optional\": true\n },\n \"webpack\": {\n \"optional\": true\n }\n },\n \"devDependencies\": {\n \"@nuxt/kit\": \"^3.15.1\",\n \"@nuxt/schema\": \"^3.15.1\",\n \"@tsconfig/node20\": \"^20.1.4\",\n \"@types/node\": \"^22.10.5\",\n \"bumpp\": \"^9.9.2\",\n \"chalk\": \"^5.4.1\",\n \"esno\": \"^4.8.0\",\n \"npm-run-all2\": \"^7.0.2\",\n \"rollup\": \"^4.30.0\",\n \"terser\": \"^5.37.0\",\n \"tsup\": \"^8.3.5\",\n \"typescript\": \"^5.7.2\",\n \"vite\": \"^6.0.7\",\n \"vitest\": \"^2.1.8\",\n \"webpack\": \"^5.97.1\"\n },\n \"dependencies\": {\n \"unplugin\": \"^2.1.2\"\n }\n}\n","import { name } from '../../package.json';\n\nconst exportSpecifier = 'version';\n\nexport const virtualModuleId = `${name}/${exportSpecifier}`;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./chunk-F4P4OA2V.cjs"),r=require("./chunk-XVJ5STCE.cjs"),t=require("./chunk-PK6SKIKE.cjs"),a=require("child_process"),n=t.__name((e=>a.execSync(e,{encoding:"utf8"}).trim()),"execCommand"),o=t.__name(((t,a)=>"function"==typeof t?.versionCalculator?t.versionCalculator:"git"===t.versionCalculator?e.createGitCalculator(a):r.createGitversionCalculator()),"getCalculator"),i=t.__name((e=>{const r=n("git rev-parse HEAD"),t=r.substring(0,7),a=n("git log -1 --format=%cI"),{version:o,branch:i}=e();return{buildDate:(new Date).toISOString(),branch:i,sha:r,shortSha:t,commitDate:a,version:o}}),"generateVersionInfo"),c=t.__name(((e,r)=>{const t=o(e,r),a=i(t);r.debug("Version info:",a);return`export default ${JSON.stringify(a,null,2)}`}),"loadVirtualModule");exports.loadVirtualModule=c;//# sourceMappingURL=chunk-DEAFKXO3.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/version.ts"],"names":["execSync","__name","createGitCalculator","createGitversionCalculator"],"mappings":"8MAKA,IAAM,WAAA,6CAAe,OAA4B,KAAA;AAC/C,EAAA,OAAOA,uBAAS,OAAS,EAAA,EAAE,UAAU,MAAO,EAAC,EAAE,IAAK,EAAA;AACtD,CAFoB,EAAA,aAAA,CAAA;AAIpB,IAAM,aAAA,mBAAiBC,wBAAA,CAAA,CAAA,OAAA,EAAkB,MAAuC,KAAA;AAC9E,EAAI,IAAA,OAAO,OAAS,EAAA,iBAAA,KAAsB,UAAY,EAAA;AACpD,IAAA,OAAO,OAAQ,CAAA,iBAAA;AAAA;AAGjB,EAAA,QAAQ,QAAQ,iBAAmB;AAAA,IACjC,KAAK,KAAA;AACH,MAAA,OAAOC,sCAAoB,MAAM,CAAA;AAAA,IACnC;AACE,MAAA,OAAOC,4CAA2B,EAAA;AAAA;AAExC,CAXsB,EAAA,eAAA,CAAA;AAatB,IAAM,mBAAA,6CAAuB,UAAkC,KAAA;AAC7D,EAAM,MAAA,GAAA,GAAM,YAAY,oBAAoB,CAAA;AAC5C,EAAA,MAAM,QAAW,GAAA,GAAA,CAAI,SAAU,CAAA,CAAA,EAAG,CAAC,CAAA;AACnC,EAAM,MAAA,UAAA,GAAa,YAAY,yBAAyB,CAAA;AAExD,EAAA,MAAM,EAAE,OAAA,EAAS,MAAO,EAAA,GAAI,UAAW,EAAA;AAEvC,EAAO,OAAA;AAAA,IACL,SAAW,EAAA,iBAAA,IAAI,IAAK,EAAA,EAAE,WAAY,EAAA;AAAA,IAClC,MAAA;AAAA,IACA,GAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF;AACF,CAf4B,EAAA,qBAAA,CAAA;AAiBf,IAAA,iBAAA,mBAAqBF,wBAAA,CAAA,CAAA,OAAA,EAAkB,MAAoB,KAAA;AACtE,EAAM,MAAA,UAAA,GAAa,aAAc,CAAA,OAAA,EAAS,MAAM,CAAA;AAChD,EAAM,MAAA,WAAA,GAAc,oBAAoB,UAAU,CAAA;AAClD,EAAO,MAAA,CAAA,KAAA,CAAM,iBAAiB,WAAW,CAAA;AACzC,EAAA,MAAM,IAAO,GAAA,IAAA,CAAK,SAAU,CAAA,WAAA,EAAa,MAAM,CAAC,CAAA;AAChD,EAAM,MAAA,IAAA,GAAO,kBAAkB,IAAI,CAAA,CAAA;AACnC,EAAO,OAAA,IAAA;AACT,CAPiC,EAAA,mBAAA","file":"chunk-DEAFKXO3.cjs","sourcesContent":["import { execSync } from 'node:child_process';\nimport { createGitCalculator } from './git';\nimport { createGitversionCalculator } from './gitversion';\nimport type { ILogger, Options, VersionCalculator } from './types';\n\nconst execCommand = (command: string): string => {\n return execSync(command, { encoding: 'utf8' }).trim();\n};\n\nconst getCalculator = (options: Options, logger: ILogger): VersionCalculator => {\n if (typeof options?.versionCalculator === 'function') {\n return options.versionCalculator;\n }\n\n switch (options.versionCalculator) {\n case 'git':\n return createGitCalculator(logger);\n default:\n return createGitversionCalculator();\n }\n};\n\nconst generateVersionInfo = (calculator: VersionCalculator) => {\n const sha = execCommand('git rev-parse HEAD');\n const shortSha = sha.substring(0, 7);\n const commitDate = execCommand('git log -1 --format=%cI');\n\n const { version, branch } = calculator();\n\n return {\n buildDate: new Date().toISOString(),\n branch,\n sha,\n shortSha,\n commitDate,\n version,\n };\n};\n\nexport const loadVirtualModule = (options: Options, logger: ILogger) => {\n const calculator = getCalculator(options, logger);\n const versionInfo = generateVersionInfo(calculator);\n logger.debug('Version info:', versionInfo);\n const json = JSON.stringify(versionInfo, null, 2);\n const code = `export default ${json}`;\n return code;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./chunk-PK6SKIKE.cjs"),r=require("child_process"),n="0.1.0",t=e.__name((e=>n=>{try{e.debug(`Executing git command: ${n}`);const t=r.execSync(n,{encoding:"utf8"}).trim();return e.debug(`Command result: ${t}`),t}catch(r){return e.error(`Command failed: ${n}`),console.error(r),null}}),"createExecCommand"),a=e.__name((r=>{const a=t(r),c=e.__name((e=>{const r=e.match(/^(pull|pull\-requests|pr)[/-](\d+)/);return r?r[2].padStart(4,"0"):null}),"getPullRequestNumber"),s=e.__name((()=>{const e=a("git describe --tags --long");if(!e)return{tag:n,distance:0};const r=e.match(/^(.*)-(\d+)-g[0-9a-f]+$/);return r?{tag:r[1],distance:Number.parseInt(r[2],10)}:{tag:n,distance:0}}),"getVersionInfo"),i=e.__name((e=>e.replace(/[^a-zA-Z0-9-]/g,"-")),"sanitizeBranchName"),o=e.__name((e=>{const[r,n="0",t="0"]=e.split(".");return{major:Number.parseInt(r,10)||0,minor:Number.parseInt(n,10)||0,patch:Number.parseInt(t,10)||0}}),"parseVersion"),u=e.__name((()=>{const e=a("git branch --show-current");if(e)return e;const r=a('git branch | grep "\\*"');if(!r)return"unknown";const n=r.match(/HEAD detached at ([^)]+)/);return n?n[1]:r}),"getBranchOrRef");return()=>{const e=u(),{tag:n,distance:t}=s();let a;if("main"===e){const{major:e,minor:c,patch:s}=o(n);a=`${e}.${c}.${s+t}`,r.debug("Using main branch version",{major:e,minor:c,patch:s,distance:t,version:a})}else{const s=c(e),o=s?`PullRequest-${s}`:i(e);a=`${n}-${o}.${t}`,r.debug("Using feature branch version",{branch:e,sanitizedBranch:o,distance:t,version:a})}return{version:a,branch:e}}}),"createGitCalculator");exports.createGitCalculator=a;//# sourceMappingURL=chunk-F4P4OA2V.cjs.map
|
|
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node:child_process';\nimport type { ILogger, VersionCalculator } from './types';\n\nconst FALLBACK_VERSION = '0.1.0';\n\nconst createExecCommand = (logger: ILogger) => {\n return (command: string): string | null => {\n try {\n logger.debug(`Executing git command: ${command}`);\n const result = execSync(command, { encoding: 'utf8' }).trim();\n logger.debug(`Command result: ${result}`);\n return result;\n } catch (error) {\n logger.error(`Command failed: ${command}`);\n console.error(error);\n return null;\n }\n };\n};\n\nexport const createGitCalculator = (logger: ILogger): VersionCalculator => {\n const execCommand = createExecCommand(logger);\n\n const getPullRequestNumber = (branch: string): string | null => {\n const match = branch.match(/^(pull|pull\\-requests|pr)[/-](\\d+)/);\n return match ? match[2].padStart(4, '0') : null;\n };\n\n const getVersionInfo = (): { tag: string; distance: number } => {\n const describe = execCommand('git describe --tags --long');\n if (!describe) {\n return {\n tag: FALLBACK_VERSION,\n distance: 0,\n };\n }\n\n const match = describe.match(/^(.*)-(\\d+)-g[0-9a-f]+$/);\n if (!match) {\n return {\n tag: FALLBACK_VERSION,\n distance: 0,\n };\n }\n\n return {\n tag: match[1],\n distance: Number.parseInt(match[2], 10),\n };\n };\n\n const sanitizeBranchName = (branch: string): string => {\n return branch.replace(/[^a-zA-Z0-9-]/g, '-');\n };\n\n const parseVersion = (tag: string): { major: number; minor: number; patch: number } => {\n const [major, minor = '0', patch = '0'] = tag.split('.');\n return {\n major: Number.parseInt(major, 10) || 0,\n minor: Number.parseInt(minor, 10) || 0,\n patch: Number.parseInt(patch, 10) || 0,\n };\n };\n\n const getBranchOrRef = (): string => {\n const currentBranch = execCommand('git branch --show-current');\n if (currentBranch) {\n return currentBranch;\n }\n\n const detachedHead = execCommand('git branch | grep \"\\\\*\"');\n if (!detachedHead) {\n return 'unknown';\n }\n\n const match = detachedHead.match(/HEAD detached at ([^)]+)/);\n return match ? match[1] : detachedHead;\n };\n\n return () => {\n const branch = getBranchOrRef();\n\n const { tag, distance } = getVersionInfo();\n\n let version: string;\n if (branch === 'main') {\n const { major, minor, patch } = parseVersion(tag);\n version = `${major}.${minor}.${patch + distance}`;\n logger.debug('Using main branch version', { major, minor, patch, distance, version });\n } else {\n const prNumber = getPullRequestNumber(branch);\n const sanitizedBranch = prNumber ? `PullRequest-${prNumber}` : sanitizeBranchName(branch);\n version = `${tag}-${sanitizedBranch}.${distance}`;\n logger.debug('Using feature branch version', { branch, sanitizedBranch, distance, version });\n }\n return {\n version,\n branch,\n };\n };\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./chunk-6ZZYXQ3C.cjs"),r=require("./chunk-DEAFKXO3.cjs"),u=require("./chunk-PK6SKIKE.cjs"),n=require("unplugin"),o=u.__name((e=>`\0${e}`),"resolveVirtualId"),l=u.__name((n=>{const l=n.debug?(e,...r)=>console.debug(`[version] ${e}`,...r):()=>{},i={debug:l,error:u.__name(((e,...r)=>console.error(`[version] ${e}`,...r)),"error")};return{name:"unplugin-version",enforce:"pre",resolveId(r){if(r===e.virtualModuleId)return l("resolveId %s",r),o(e.virtualModuleId)},load(u){if(u===o(e.virtualModuleId))return l("load %s",u),r.loadVirtualModule(n,i)}}}),"pluginFactory"),i=n.createUnplugin(l);exports.plugin=i;//# sourceMappingURL=chunk-IPEEM23D.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/index.ts"],"names":["__name","virtualModuleId","loadVirtualModule","createUnplugin"],"mappings":"oMAKA,IAAM,gBAAmB,mBAAAA,wBAAA,CAAA,CAAC,EAAe,KAAA,CAAA,EAAA,EAAK,EAAE,CAAvB,CAAA,EAAA,kBAAA,CAAA;AAEzB,IAAM,aAAA,6CAA2C,OAAqB,KAAA;AACpE,EAAA,MAAM,KAAQ,GAAA,OAAA,CAAQ,KAAQ,GAAA,CAAC,YAAsB,cAA8B,KAAA,OAAA,CAAQ,KAAM,CAAA,CAAA,UAAA,EAAa,OAAO,CAAA,CAAA,EAAI,GAAG,cAAc,IAAI,MAAM;AAAA,GAAC;AACrJ,EAAM,MAAA,KAAA,mBAASA,wBAAA,CAAA,CAAA,OAAA,EAAA,GAAsB,cAA8B,KAAA,OAAA,CAAQ,KAAM,CAAA,CAAA,UAAA,EAAa,OAAO,CAAA,CAAA,EAAI,GAAG,cAAc,CAA5G,EAAA,OAAA,CAAA;AACd,EAAA,MAAM,MAAkB,GAAA;AAAA,IACtB,KAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAO,OAAA;AAAA,IACL,IAAM,EAAA,kBAAA;AAAA,IACN,OAAS,EAAA,KAAA;AAAA,IACT,UAAU,EAAI,EAAA;AACZ,MAAA,IAAI,OAAOC,iCAAiB,EAAA;AAC1B,QAAA,KAAA,CAAM,gBAAgB,EAAE,CAAA;AACxB,QAAA,OAAO,iBAAiBA,iCAAe,CAAA;AAAA;AACzC,KACF;AAAA,IACA,KAAK,EAAI,EAAA;AACP,MAAI,IAAA,EAAA,KAAO,gBAAiB,CAAAA,iCAAe,CAAG,EAAA;AAC5C,QAAA,KAAA,CAAM,WAAW,EAAE,CAAA;AACnB,QAAO,OAAAC,mCAAA,CAAkB,SAAS,MAAM,CAAA;AAAA;AAC1C;AACF,GACF;AACF,CAxBgD,EAAA,eAAA,CAAA;AA0BnC,IAAA,MAAA,GAASC,wBAAe,aAAa","file":"chunk-IPEEM23D.cjs","sourcesContent":["import { type UnpluginFactory, createUnplugin } from 'unplugin';\nimport { virtualModuleId } from './module';\nimport type { ILogger, Options } from './types';\nimport { loadVirtualModule } from './version';\n\nconst resolveVirtualId = (id: string) => `\\0${id}`;\n\nconst pluginFactory: UnpluginFactory<Options> = (options: Options) => {\n const debug = options.debug ? (message?: unknown, ...optionalParams: unknown[]) => console.debug(`[version] ${message}`, ...optionalParams) : () => {};\n const error = (message?: unknown, ...optionalParams: unknown[]) => console.error(`[version] ${message}`, ...optionalParams);\n const logger: ILogger = {\n debug,\n error,\n };\n\n return {\n name: 'unplugin-version',\n enforce: 'pre',\n resolveId(id) {\n if (id === virtualModuleId) {\n debug('resolveId %s', id);\n return resolveVirtualId(virtualModuleId);\n }\n },\n load(id) {\n if (id === resolveVirtualId(virtualModuleId)) {\n debug('load %s', id);\n return loadVirtualModule(options, logger);\n }\n },\n };\n};\n\nexport const plugin = createUnplugin(pluginFactory);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__name as r}from"./chunk-7QVYU63E.js";import{execSync as e}from"node:child_process";var t="0.1.0",n=r((r=>t=>{try{r.debug(`Executing git command: ${t}`);const n=e(t,{encoding:"utf8"}).trim();return r.debug(`Command result: ${n}`),n}catch(e){return r.error(`Command failed: ${t}`),console.error(e),null}}),"createExecCommand"),a=r((e=>{const a=n(e),c=r((r=>{const e=r.match(/^(pull|pull\-requests|pr)[/-](\d+)/);return e?e[2].padStart(4,"0"):null}),"getPullRequestNumber"),s=r((()=>{const r=a("git describe --tags --long");if(!r)return{tag:t,distance:0};const e=r.match(/^(.*)-(\d+)-g[0-9a-f]+$/);return e?{tag:e[1],distance:Number.parseInt(e[2],10)}:{tag:t,distance:0}}),"getVersionInfo"),o=r((r=>r.replace(/[^a-zA-Z0-9-]/g,"-")),"sanitizeBranchName"),i=r((r=>{const[e,t="0",n="0"]=r.split(".");return{major:Number.parseInt(e,10)||0,minor:Number.parseInt(t,10)||0,patch:Number.parseInt(n,10)||0}}),"parseVersion"),u=r((()=>{const r=a("git branch --show-current");if(r)return r;const e=a('git branch | grep "\\*"');if(!e)return"unknown";const t=e.match(/HEAD detached at ([^)]+)/);return t?t[1]:e}),"getBranchOrRef");return()=>{const r=u(),{tag:t,distance:n}=s();let a;if("main"===r){const{major:r,minor:c,patch:s}=i(t);a=`${r}.${c}.${s+n}`,e.debug("Using main branch version",{major:r,minor:c,patch:s,distance:n,version:a})}else{const s=c(r),i=s?`PullRequest-${s}`:o(r);a=`${t}-${i}.${n}`,e.debug("Using feature branch version",{branch:r,sanitizedBranch:i,distance:n,version:a})}return{version:a,branch:r}}}),"createGitCalculator");export{a as createGitCalculator};//# sourceMappingURL=chunk-N3C34IHY.js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import type { ILogger, VersionCalculator } from './types';\n\nconst FALLBACK_VERSION = '0.1.0';\n\nconst createExecCommand = (logger: ILogger) => {\n return (command: string): string | null => {\n try {\n logger.debug(`Executing git command: ${command}`);\n const result = execSync(command, { encoding: 'utf8' }).trim();\n logger.debug(`Command result: ${result}`);\n return result;\n } catch (error) {\n logger.error(`Command failed: ${command}`);\n console.error(error);\n return null;\n }\n };\n};\n\nexport const createGitCalculator = (logger: ILogger): VersionCalculator => {\n const execCommand = createExecCommand(logger);\n\n const getPullRequestNumber = (branch: string): string | null => {\n const match = branch.match(/^(pull|pull\\-requests|pr)[/-](\\d+)/);\n return match ? match[2].padStart(4, '0') : null;\n };\n\n const getVersionInfo = (): { tag: string; distance: number } => {\n const describe = execCommand('git describe --tags --long');\n if (!describe) {\n return {\n tag: FALLBACK_VERSION,\n distance: 0,\n };\n }\n\n const match = describe.match(/^(.*)-(\\d+)-g[0-9a-f]+$/);\n if (!match) {\n return {\n tag: FALLBACK_VERSION,\n distance: 0,\n };\n }\n\n return {\n tag: match[1],\n distance: Number.parseInt(match[2], 10),\n };\n };\n\n const sanitizeBranchName = (branch: string): string => {\n return branch.replace(/[^a-zA-Z0-9-]/g, '-');\n };\n\n const parseVersion = (tag: string): { major: number; minor: number; patch: number } => {\n const [major, minor = '0', patch = '0'] = tag.split('.');\n return {\n major: Number.parseInt(major, 10) || 0,\n minor: Number.parseInt(minor, 10) || 0,\n patch: Number.parseInt(patch, 10) || 0,\n };\n };\n\n const getBranchOrRef = (): string => {\n const currentBranch = execCommand('git branch --show-current');\n if (currentBranch) {\n return currentBranch;\n }\n\n const detachedHead = execCommand('git branch | grep \"\\\\*\"');\n if (!detachedHead) {\n return 'unknown';\n }\n\n const match = detachedHead.match(/HEAD detached at ([^)]+)/);\n return match ? match[1] : detachedHead;\n };\n\n return () => {\n const branch = getBranchOrRef();\n\n const { tag, distance } = getVersionInfo();\n\n let version: string;\n if (branch === 'main') {\n const { major, minor, patch } = parseVersion(tag);\n version = `${major}.${minor}.${patch + distance}`;\n logger.debug('Using main branch version', { major, minor, patch, distance, version });\n } else {\n const prNumber = getPullRequestNumber(branch);\n const sanitizedBranch = prNumber ? `PullRequest-${prNumber}` : sanitizeBranchName(branch);\n version = `${tag}-${sanitizedBranch}.${distance}`;\n logger.debug('Using feature branch version', { branch, sanitizedBranch, distance, version });\n }\n return {\n version,\n branch,\n };\n };\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createGitCalculator as r}from"./chunk-N3C34IHY.js";import{createGitversionCalculator as o}from"./chunk-YO3QEXX7.js";import{__name as t}from"./chunk-7QVYU63E.js";import{execSync as e}from"node:child_process";var n=t((r=>e(r,{encoding:"utf8"}).trim()),"execCommand"),i=t(((t,e)=>"function"==typeof t?.versionCalculator?t.versionCalculator:"git"===t.versionCalculator?r(e):o()),"getCalculator"),a=t((r=>{const o=n("git rev-parse HEAD"),t=o.substring(0,7),e=n("git log -1 --format=%cI"),{version:i,branch:a}=r();return{buildDate:(new Date).toISOString(),branch:a,sha:o,shortSha:t,commitDate:e,version:i}}),"generateVersionInfo"),s=t(((r,o)=>{const t=i(r,o),e=a(t);o.debug("Version info:",e);return`export default ${JSON.stringify(e,null,2)}`}),"loadVirtualModule");export{s as loadVirtualModule};//# sourceMappingURL=chunk-UP763FPS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/version.ts"],"names":[],"mappings":"sMAKA,IAAM,WAAA,2BAAe,OAA4B,KAAA;AAC/C,EAAA,OAAO,SAAS,OAAS,EAAA,EAAE,UAAU,MAAO,EAAC,EAAE,IAAK,EAAA;AACtD,CAFoB,EAAA,aAAA,CAAA;AAIpB,IAAM,aAAA,mBAAiB,MAAA,CAAA,CAAA,OAAA,EAAkB,MAAuC,KAAA;AAC9E,EAAI,IAAA,OAAO,OAAS,EAAA,iBAAA,KAAsB,UAAY,EAAA;AACpD,IAAA,OAAO,OAAQ,CAAA,iBAAA;AAAA;AAGjB,EAAA,QAAQ,QAAQ,iBAAmB;AAAA,IACjC,KAAK,KAAA;AACH,MAAA,OAAO,oBAAoB,MAAM,CAAA;AAAA,IACnC;AACE,MAAA,OAAO,0BAA2B,EAAA;AAAA;AAExC,CAXsB,EAAA,eAAA,CAAA;AAatB,IAAM,mBAAA,2BAAuB,UAAkC,KAAA;AAC7D,EAAM,MAAA,GAAA,GAAM,YAAY,oBAAoB,CAAA;AAC5C,EAAA,MAAM,QAAW,GAAA,GAAA,CAAI,SAAU,CAAA,CAAA,EAAG,CAAC,CAAA;AACnC,EAAM,MAAA,UAAA,GAAa,YAAY,yBAAyB,CAAA;AAExD,EAAA,MAAM,EAAE,OAAA,EAAS,MAAO,EAAA,GAAI,UAAW,EAAA;AAEvC,EAAO,OAAA;AAAA,IACL,SAAW,EAAA,iBAAA,IAAI,IAAK,EAAA,EAAE,WAAY,EAAA;AAAA,IAClC,MAAA;AAAA,IACA,GAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA;AAAA,GACF;AACF,CAf4B,EAAA,qBAAA,CAAA;AAiBf,IAAA,iBAAA,mBAAqB,MAAA,CAAA,CAAA,OAAA,EAAkB,MAAoB,KAAA;AACtE,EAAM,MAAA,UAAA,GAAa,aAAc,CAAA,OAAA,EAAS,MAAM,CAAA;AAChD,EAAM,MAAA,WAAA,GAAc,oBAAoB,UAAU,CAAA;AAClD,EAAO,MAAA,CAAA,KAAA,CAAM,iBAAiB,WAAW,CAAA;AACzC,EAAA,MAAM,IAAO,GAAA,IAAA,CAAK,SAAU,CAAA,WAAA,EAAa,MAAM,CAAC,CAAA;AAChD,EAAM,MAAA,IAAA,GAAO,kBAAkB,IAAI,CAAA,CAAA;AACnC,EAAO,OAAA,IAAA;AACT,CAPiC,EAAA,mBAAA","file":"chunk-UP763FPS.js","sourcesContent":["import { execSync } from 'node:child_process';\nimport { createGitCalculator } from './git';\nimport { createGitversionCalculator } from './gitversion';\nimport type { ILogger, Options, VersionCalculator } from './types';\n\nconst execCommand = (command: string): string => {\n return execSync(command, { encoding: 'utf8' }).trim();\n};\n\nconst getCalculator = (options: Options, logger: ILogger): VersionCalculator => {\n if (typeof options?.versionCalculator === 'function') {\n return options.versionCalculator;\n }\n\n switch (options.versionCalculator) {\n case 'git':\n return createGitCalculator(logger);\n default:\n return createGitversionCalculator();\n }\n};\n\nconst generateVersionInfo = (calculator: VersionCalculator) => {\n const sha = execCommand('git rev-parse HEAD');\n const shortSha = sha.substring(0, 7);\n const commitDate = execCommand('git log -1 --format=%cI');\n\n const { version, branch } = calculator();\n\n return {\n buildDate: new Date().toISOString(),\n branch,\n sha,\n shortSha,\n commitDate,\n version,\n };\n};\n\nexport const loadVirtualModule = (options: Options, logger: ILogger) => {\n const calculator = getCalculator(options, logger);\n const versionInfo = generateVersionInfo(calculator);\n logger.debug('Version info:', versionInfo);\n const json = JSON.stringify(versionInfo, null, 2);\n const code = `export default ${json}`;\n return code;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e=require("./chunk-PK6SKIKE.cjs"),r=require("child_process"),i=e.__name((()=>({version:r.execSync("gitversion -showvariable SemVer",{encoding:"utf8"}).trim(),branch:r.execSync("gitversion -showvariable BranchName",{encoding:"utf8"}).trim()})),"gitversionCalculator"),a=e.__name((()=>()=>i()),"createGitversionCalculator");exports.createGitversionCalculator=a;//# sourceMappingURL=chunk-XVJ5STCE.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/gitversion.ts"],"names":["__name","execSync"],"mappings":"0GAGA,IAAM,uCAA6BA,wBAAA,CAAA,MAAA;AACjC,EAAM,MAAA,OAAA,GAAUC,uBAAS,iCAAmC,EAAA,EAAE,UAAU,MAAO,EAAC,EAAE,IAAK,EAAA;AACvF,EAAM,MAAA,MAAA,GAASA,uBAAS,qCAAuC,EAAA,EAAE,UAAU,MAAO,EAAC,EAAE,IAAK,EAAA;AAC1F,EAAO,OAAA;AAAA,IACL,OAAA;AAAA,IACA;AAAA,GACF;AACF,CAP6B,EAAA,sBAAA,CAAA;AAStB,IAAM,6CAAsDD,wBAAA,CAAA,MAAA;AACjE,EAAA,OAAO,MAAM;AACX,IAAA,OAAO,oBAAqB,EAAA;AAAA,GAC9B;AACF,CAJ0C,EAAA,4BAAA","file":"chunk-XVJ5STCE.cjs","sourcesContent":["import { execSync } from 'node:child_process';\nimport type { VersionCalculator } from './types';\n\nconst gitversionCalculator = () => {\n const version = execSync('gitversion -showvariable SemVer', { encoding: 'utf8' }).trim();\n const branch = execSync('gitversion -showvariable BranchName', { encoding: 'utf8' }).trim();\n return {\n version,\n branch,\n };\n};\n\nexport const createGitversionCalculator = (): VersionCalculator => {\n return () => {\n return gitversionCalculator();\n };\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{__name as r}from"./chunk-7QVYU63E.js";import{execSync as i}from"node:child_process";var o=r((()=>({version:i("gitversion -showvariable SemVer",{encoding:"utf8"}).trim(),branch:i("gitversion -showvariable BranchName",{encoding:"utf8"}).trim()})),"gitversionCalculator"),e=r((()=>()=>o()),"createGitversionCalculator");export{e as createGitversionCalculator};//# sourceMappingURL=chunk-YO3QEXX7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/gitversion.ts"],"names":[],"mappings":"mFAGA,IAAM,uCAA6B,MAAA,CAAA,MAAA;AACjC,EAAM,MAAA,OAAA,GAAU,SAAS,iCAAmC,EAAA,EAAE,UAAU,MAAO,EAAC,EAAE,IAAK,EAAA;AACvF,EAAM,MAAA,MAAA,GAAS,SAAS,qCAAuC,EAAA,EAAE,UAAU,MAAO,EAAC,EAAE,IAAK,EAAA;AAC1F,EAAO,OAAA;AAAA,IACL,OAAA;AAAA,IACA;AAAA,GACF;AACF,CAP6B,EAAA,sBAAA,CAAA;AAStB,IAAM,6CAAsD,MAAA,CAAA,MAAA;AACjE,EAAA,OAAO,MAAM;AACX,IAAA,OAAO,oBAAqB,EAAA;AAAA,GAC9B;AACF,CAJ0C,EAAA,4BAAA","file":"chunk-YO3QEXX7.js","sourcesContent":["import { execSync } from 'node:child_process';\nimport type { VersionCalculator } from './types';\n\nconst gitversionCalculator = () => {\n const version = execSync('gitversion -showvariable SemVer', { encoding: 'utf8' }).trim();\n const branch = execSync('gitversion -showvariable BranchName', { encoding: 'utf8' }).trim();\n return {\n version,\n branch,\n };\n};\n\nexport const createGitversionCalculator = (): VersionCalculator => {\n return () => {\n return gitversionCalculator();\n };\n};\n"]}
|
package/dist/core/defaults.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";require("../chunk-PK6SKIKE.cjs");exports.defaults={debug:!1};//# sourceMappingURL=defaults.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"defaults.cjs"}
|
|
1
|
+
{"version":3,"sources":["../../src/core/defaults.ts"],"names":[],"mappings":";AAEO,IAAM,QAAW,GAAA;AAAA,EACtB,KAAO,EAAA;AACT","file":"defaults.cjs","sourcesContent":["import type { Options } from './types';\n\nexport const defaults = {\n debug: false,\n} satisfies Options;\n"]}
|
package/dist/core/defaults.d.cts
CHANGED
package/dist/core/defaults.d.ts
CHANGED
package/dist/core/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import"../chunk-7QVYU63E.js";var r={debug:!1};export{r as defaults};//# sourceMappingURL=defaults.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"defaults.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/core/defaults.ts"],"names":[],"mappings":";AAEO,IAAM,QAAW,GAAA;AAAA,EACtB,KAAO,EAAA;AACT","file":"defaults.js","sourcesContent":["import type { Options } from './types';\n\nexport const defaults = {\n debug: false,\n} satisfies Options;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("../chunk-PK6SKIKE.cjs");var e={branch:"",buildDate:"",commitDate:"",sha:"",shortSha:"",version:""};module.exports=e,module.exports=exports.default;//# sourceMappingURL=
|
|
1
|
+
"use strict";require("../chunk-PK6SKIKE.cjs");var e={branch:"",buildDate:"",commitDate:"",sha:"",shortSha:"",version:""};module.exports=e,module.exports=exports.default;//# sourceMappingURL=export.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/export.ts"],"names":[],"mappings":";AAEA,IAAM,WAA2B,GAAA;AAAA,EAC/B,MAAQ,EAAA,EAAA;AAAA,EACR,SAAW,EAAA,EAAA;AAAA,EACX,UAAY,EAAA,EAAA;AAAA,EACZ,GAAK,EAAA,EAAA;AAAA,EACL,QAAU,EAAA,EAAA;AAAA,EACV,OAAS,EAAA;AACX,CAAA;AACA,IAAO,cAAQ,GAAA","file":"export.cjs","sourcesContent":["import type { VersionInfo } from './types';\n\nconst versionInfo: VersionInfo = {\n branch: '',\n buildDate: '',\n commitDate: '',\n sha: '',\n shortSha: '',\n version: '',\n};\nexport default versionInfo;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunk-7QVYU63E.js";var a={branch:"",buildDate:"",commitDate:"",sha:"",shortSha:"",version:""};export{a as default};//# sourceMappingURL=
|
|
1
|
+
import"../chunk-7QVYU63E.js";var a={branch:"",buildDate:"",commitDate:"",sha:"",shortSha:"",version:""};export{a as default};//# sourceMappingURL=export.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/core/export.ts"],"names":[],"mappings":";AAEA,IAAM,WAA2B,GAAA;AAAA,EAC/B,MAAQ,EAAA,EAAA;AAAA,EACR,SAAW,EAAA,EAAA;AAAA,EACX,UAAY,EAAA,EAAA;AAAA,EACZ,GAAK,EAAA,EAAA;AAAA,EACL,QAAU,EAAA,EAAA;AAAA,EACV,OAAS,EAAA;AACX,CAAA;AACA,IAAO,cAAQ,GAAA","file":"export.js","sourcesContent":["import type { VersionInfo } from './types';\n\nconst versionInfo: VersionInfo = {\n branch: '',\n buildDate: '',\n commitDate: '',\n sha: '',\n shortSha: '',\n version: '',\n};\nexport default versionInfo;\n"]}
|
package/dist/core/git.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../chunk-
|
|
1
|
+
"use strict";var e=require("../chunk-F4P4OA2V.cjs");require("../chunk-PK6SKIKE.cjs"),Object.defineProperty(exports,"createGitCalculator",{enumerable:!0,get:function(){return e.createGitCalculator}});//# sourceMappingURL=git.cjs.map
|
package/dist/core/git.d.cts
CHANGED
package/dist/core/git.d.ts
CHANGED
package/dist/core/git.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{createGitCalculator}from"../chunk-
|
|
1
|
+
export{createGitCalculator}from"../chunk-N3C34IHY.js";import"../chunk-7QVYU63E.js";//# sourceMappingURL=git.js.map
|
package/dist/core/gitversion.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../chunk-
|
|
1
|
+
"use strict";var e=require("../chunk-XVJ5STCE.cjs");require("../chunk-PK6SKIKE.cjs"),Object.defineProperty(exports,"createGitversionCalculator",{enumerable:!0,get:function(){return e.createGitversionCalculator}});//# sourceMappingURL=gitversion.cjs.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { VersionCalculator } from './types.cjs';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
declare const createGitversionCalculator: (calculator: GitversionType) => VersionCalculator;
|
|
3
|
+
declare const createGitversionCalculator: () => VersionCalculator;
|
|
5
4
|
|
|
6
5
|
export { createGitversionCalculator };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { VersionCalculator } from './types.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
declare const createGitversionCalculator: (calculator: GitversionType) => VersionCalculator;
|
|
3
|
+
declare const createGitversionCalculator: () => VersionCalculator;
|
|
5
4
|
|
|
6
5
|
export { createGitversionCalculator };
|
package/dist/core/gitversion.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{createGitversionCalculator}from"../chunk-
|
|
1
|
+
export{createGitversionCalculator}from"../chunk-YO3QEXX7.js";import"../chunk-7QVYU63E.js";//# sourceMappingURL=gitversion.js.map
|
package/dist/core/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../chunk-
|
|
1
|
+
"use strict";var e=require("../chunk-IPEEM23D.cjs");require("../chunk-6ZZYXQ3C.cjs"),require("../chunk-DEAFKXO3.cjs"),require("../chunk-F4P4OA2V.cjs"),require("../chunk-XVJ5STCE.cjs"),require("../chunk-PK6SKIKE.cjs"),Object.defineProperty(exports,"plugin",{enumerable:!0,get:function(){return e.plugin}});//# sourceMappingURL=index.cjs.map
|
package/dist/core/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{plugin}from"../chunk-
|
|
1
|
+
export{plugin}from"../chunk-32QWTZ5P.js";import"../chunk-5GXQW5SA.js";import"../chunk-UP763FPS.js";import"../chunk-N3C34IHY.js";import"../chunk-YO3QEXX7.js";import"../chunk-7QVYU63E.js";//# sourceMappingURL=index.js.map
|
package/dist/core/module.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../chunk-
|
|
1
|
+
"use strict";var e=require("../chunk-6ZZYXQ3C.cjs");require("../chunk-PK6SKIKE.cjs"),Object.defineProperty(exports,"virtualModuleId",{enumerable:!0,get:function(){return e.virtualModuleId}});//# sourceMappingURL=module.cjs.map
|
package/dist/core/module.d.cts
CHANGED
package/dist/core/module.d.ts
CHANGED
package/dist/core/module.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{virtualModuleId}from"../chunk-5GXQW5SA.js";import"../chunk-7QVYU63E.js";//# sourceMappingURL=module.js.map
|
package/dist/core/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict"
|
|
1
|
+
"use strict";//# sourceMappingURL=types.cjs.map
|
package/dist/core/types.d.cts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
type VersionCalculator = () =>
|
|
1
|
+
type VersionCalculator = () => {
|
|
2
|
+
version: string;
|
|
3
|
+
branch: string;
|
|
4
|
+
};
|
|
2
5
|
type VersionCalculatorType = 'gitversion' | 'git' | VersionCalculator;
|
|
3
6
|
interface Options {
|
|
4
7
|
/**
|
|
@@ -6,12 +9,7 @@ interface Options {
|
|
|
6
9
|
* @default 'gitversion'
|
|
7
10
|
*/
|
|
8
11
|
versionCalculator?: VersionCalculatorType;
|
|
9
|
-
/**
|
|
10
|
-
* Pattern to match the resolved version path
|
|
11
|
-
*/
|
|
12
|
-
versionPath?: string;
|
|
13
12
|
debug?: boolean;
|
|
14
|
-
debugLevel?: DebugLevel;
|
|
15
13
|
}
|
|
16
14
|
interface VersionInfo {
|
|
17
15
|
buildDate: string;
|
|
@@ -21,9 +19,9 @@ interface VersionInfo {
|
|
|
21
19
|
commitDate: string;
|
|
22
20
|
version: string;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
22
|
+
type ILogger = {
|
|
23
|
+
debug: (typeof console)['debug'];
|
|
24
|
+
error: (typeof console)['error'];
|
|
25
|
+
};
|
|
28
26
|
|
|
29
|
-
export {
|
|
27
|
+
export type { ILogger, Options, VersionCalculator, VersionCalculatorType, VersionInfo };
|
package/dist/core/types.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
type VersionCalculator = () =>
|
|
1
|
+
type VersionCalculator = () => {
|
|
2
|
+
version: string;
|
|
3
|
+
branch: string;
|
|
4
|
+
};
|
|
2
5
|
type VersionCalculatorType = 'gitversion' | 'git' | VersionCalculator;
|
|
3
6
|
interface Options {
|
|
4
7
|
/**
|
|
@@ -6,12 +9,7 @@ interface Options {
|
|
|
6
9
|
* @default 'gitversion'
|
|
7
10
|
*/
|
|
8
11
|
versionCalculator?: VersionCalculatorType;
|
|
9
|
-
/**
|
|
10
|
-
* Pattern to match the resolved version path
|
|
11
|
-
*/
|
|
12
|
-
versionPath?: string;
|
|
13
12
|
debug?: boolean;
|
|
14
|
-
debugLevel?: DebugLevel;
|
|
15
13
|
}
|
|
16
14
|
interface VersionInfo {
|
|
17
15
|
buildDate: string;
|
|
@@ -21,9 +19,9 @@ interface VersionInfo {
|
|
|
21
19
|
commitDate: string;
|
|
22
20
|
version: string;
|
|
23
21
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
22
|
+
type ILogger = {
|
|
23
|
+
debug: (typeof console)['debug'];
|
|
24
|
+
error: (typeof console)['error'];
|
|
25
|
+
};
|
|
28
26
|
|
|
29
|
-
export {
|
|
27
|
+
export type { ILogger, Options, VersionCalculator, VersionCalculatorType, VersionInfo };
|
package/dist/core/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
package/dist/core/version.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("../chunk-
|
|
1
|
+
"use strict";var e=require("../chunk-DEAFKXO3.cjs");require("../chunk-F4P4OA2V.cjs"),require("../chunk-XVJ5STCE.cjs"),require("../chunk-PK6SKIKE.cjs"),Object.defineProperty(exports,"loadVirtualModule",{enumerable:!0,get:function(){return e.loadVirtualModule}});//# sourceMappingURL=version.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"version.cjs"}
|
package/dist/core/version.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Options, ILogger } from './types.cjs';
|
|
2
2
|
|
|
3
|
-
declare const
|
|
3
|
+
declare const loadVirtualModule: (options: Options, logger: ILogger) => string;
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export { loadVirtualModule };
|
package/dist/core/version.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Options, ILogger } from './types.js';
|
|
2
2
|
|
|
3
|
-
declare const
|
|
3
|
+
declare const loadVirtualModule: (options: Options, logger: ILogger) => string;
|
|
4
4
|
|
|
5
|
-
export {
|
|
5
|
+
export { loadVirtualModule };
|
package/dist/core/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export{loadVirtualModule}from"../chunk-UP763FPS.js";import"../chunk-N3C34IHY.js";import"../chunk-YO3QEXX7.js";import"../chunk-7QVYU63E.js";//# sourceMappingURL=version.js.map
|
package/dist/core/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"version.js"}
|
package/dist/esbuild.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("./chunk-
|
|
1
|
+
"use strict";var e=require("./chunk-IPEEM23D.cjs");require("./chunk-6ZZYXQ3C.cjs"),require("./chunk-DEAFKXO3.cjs"),require("./chunk-F4P4OA2V.cjs"),require("./chunk-XVJ5STCE.cjs"),require("./chunk-PK6SKIKE.cjs");var r=e.plugin.esbuild;module.exports=r,module.exports=exports.default;//# sourceMappingURL=esbuild.cjs.map
|
package/dist/esbuild.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{plugin as r}from"./chunk-
|
|
1
|
+
import{plugin as r}from"./chunk-32QWTZ5P.js";import"./chunk-5GXQW5SA.js";import"./chunk-UP763FPS.js";import"./chunk-N3C34IHY.js";import"./chunk-YO3QEXX7.js";import"./chunk-7QVYU63E.js";var o=r.esbuild;export{o as default};//# sourceMappingURL=esbuild.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require("./chunk-H44HDUOM.cjs");var e=require("./chunk-
|
|
1
|
+
"use strict";require("./chunk-H44HDUOM.cjs");var e=require("./chunk-IPEEM23D.cjs");require("./chunk-6ZZYXQ3C.cjs"),require("./chunk-DEAFKXO3.cjs"),require("./chunk-F4P4OA2V.cjs"),require("./chunk-XVJ5STCE.cjs"),require("./chunk-PK6SKIKE.cjs"),module.exports=e.plugin,module.exports=exports.default;//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-QZKD24XZ.js";export{plugin as default}from"./chunk-
|
|
1
|
+
import"./chunk-QZKD24XZ.js";export{plugin as default}from"./chunk-32QWTZ5P.js";import"./chunk-5GXQW5SA.js";import"./chunk-UP763FPS.js";import"./chunk-N3C34IHY.js";import"./chunk-YO3QEXX7.js";import"./chunk-7QVYU63E.js";//# sourceMappingURL=index.js.map
|