@open-xchange/vite-plugin-project-meta 1.4.0 → 1.4.1
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/CHANGELOG.md +6 -2
- package/README.md +1 -2
- package/dist/index.d.mts +3 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## `1.4.1` – 2026-Sep-13
|
|
4
|
+
|
|
5
|
+
- chore: migrate to gitlab.com
|
|
6
|
+
|
|
3
7
|
## `1.4.0` – 2026-May-14
|
|
4
8
|
|
|
5
9
|
- changed: require NodeJS v22.18
|
|
@@ -23,8 +27,8 @@
|
|
|
23
27
|
|
|
24
28
|
## `1.1.0` – 2025-Jun-26
|
|
25
29
|
|
|
26
|
-
- added: support
|
|
27
|
-
- chore: drop support
|
|
30
|
+
- added: support for Vite 7
|
|
31
|
+
- chore: drop support for Vite 5
|
|
28
32
|
|
|
29
33
|
## `1.0.2` – 2025-Feb-24
|
|
30
34
|
|
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { Plugin } from "vite";
|
|
2
|
-
|
|
3
2
|
//#region src/index.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Configuration options for the plugin '@open-xchange/vite-plugin-project-meta'.
|
|
6
5
|
*/
|
|
7
|
-
interface VitePluginProjectMetaOptions {
|
|
6
|
+
export interface VitePluginProjectMetaOptions {
|
|
8
7
|
/**
|
|
9
8
|
* The display name of the project.
|
|
10
9
|
*/
|
|
11
10
|
projectName: string;
|
|
12
11
|
}
|
|
13
|
-
declare const PROJECT_NAME = "@open-xchange/vite-plugin-project-meta";
|
|
12
|
+
export declare const PROJECT_NAME = "@open-xchange/vite-plugin-project-meta";
|
|
14
13
|
/**
|
|
15
14
|
* Vite plugin that provides a virtual module 'virtual:metadata' exporting a
|
|
16
15
|
* metadata object with project build information (timestamp, commit ID, etc.).
|
|
@@ -21,7 +20,6 @@ declare const PROJECT_NAME = "@open-xchange/vite-plugin-project-meta";
|
|
|
21
20
|
* @returns
|
|
22
21
|
* The Vite plugin object.
|
|
23
22
|
*/
|
|
24
|
-
|
|
23
|
+
export default function vitePluginProjectMeta(options: VitePluginProjectMetaOptions): Plugin;
|
|
25
24
|
//#endregion
|
|
26
|
-
export { PROJECT_NAME, VitePluginProjectMetaOptions, vitePluginProjectMeta as default };
|
|
27
25
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;iBAeiB;;;;EAKf;;qBAKW;;;;;;;;;;;wBAcW,sBAAsB,SAAS,+BAA+B"}
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["\nimport { join } from 'node:path'\nimport { readFileSync } from 'node:fs'\nimport { createHash } from 'node:crypto'\n\nimport type { Plugin } from 'vite'\nimport { exactRegex, createJsonModule } from '@open-xchange/rolldown-utils'\n\nimport type { VirtualProjectMetadata } from 'virtual:metadata'\n\n// types ======================================================================\n\n/**\n * Configuration options for the plugin '@open-xchange/vite-plugin-project-meta'.\n */\nexport interface VitePluginProjectMetaOptions {\n\n /**\n * The display name of the project.\n */\n projectName: string\n}\n\n// constants ==================================================================\n\nexport const PROJECT_NAME = '@open-xchange/vite-plugin-project-meta'\n\n// plugin =====================================================================\n\n/**\n * Vite plugin that provides a virtual module 'virtual:metadata' exporting a\n * metadata object with project build information (timestamp, commit ID, etc.).\n *\n * @param options\n * Plugin configuration.\n *\n * @returns\n * The Vite plugin object.\n */\nexport default function vitePluginProjectMeta(options: VitePluginProjectMetaOptions): Plugin {\n\n const MODULE_NAME = 'virtual:metadata'\n const MODULE_ID = `\\0${PROJECT_NAME}/${MODULE_NAME}`\n\n let metadata: VirtualProjectMetadata\n\n return {\n name: PROJECT_NAME,\n\n configResolved(config) {\n /** @ignore */\n interface Package {\n name: string\n version: string\n }\n const pkg = JSON.parse(readFileSync(join(config.root, 'package.json'), { encoding: 'utf8' })) as Package\n metadata = {\n id: pkg.name,\n name: options.projectName,\n version: pkg.version,\n builddate: new Date().toISOString(),\n commitsha: process.env.CI_COMMIT_SHA,\n }\n },\n\n resolveId: {\n filter: { id: exactRegex(MODULE_NAME) },\n handler: () => MODULE_ID,\n },\n\n load: {\n filter: { id: exactRegex(MODULE_ID) },\n handler: () => createJsonModule(metadata),\n },\n\n transformIndexHtml(_html, context) {\n if (!context.bundle) return\n const hash = createHash('md5').update(metadata.builddate).digest('hex')\n const len = Number.parseInt(hash.slice(0, 4), 16) % 99 + 42\n const count = Math.ceil(len / hash.length)\n const content = hash.repeat(count).slice(0, len)\n const attrs = { name: 'etag-fix', content }\n // inject a <meta> element into the <head>\n return [{ tag: 'meta', attrs, injectTo: 'head' }]\n },\n }\n}\n"],"mappings":";;;;;AAyBA,MAAa,eAAe;;;;;;;;;;;AAc5B,SAAwB,sBAAsB,SAA+C;CAE3F,MAAM,cAAc;CACpB,MAAM,YAAY,KAAK,aAAa,GAAG;CAEvC,IAAI;CAEJ,OAAO;EACL,MAAM;EAEN,eAAe,QAAQ;GAMrB,MAAM,MAAM,KAAK,MAAM,aAAa,KAAK,OAAO,MAAM,cAAc,GAAG,EAAE,UAAU,OAAO,CAAC,CAAC;GAC5F,WAAW;IACT,IAAI,IAAI;IACR,MAAM,QAAQ;IACd,SAAS,IAAI;IACb,4BAAW,IAAI,KAAK,
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["\nimport { join } from 'node:path'\nimport { readFileSync } from 'node:fs'\nimport { createHash } from 'node:crypto'\n\nimport type { Plugin } from 'vite'\nimport { exactRegex, createJsonModule } from '@open-xchange/rolldown-utils'\n\nimport type { VirtualProjectMetadata } from 'virtual:metadata'\n\n// types ======================================================================\n\n/**\n * Configuration options for the plugin '@open-xchange/vite-plugin-project-meta'.\n */\nexport interface VitePluginProjectMetaOptions {\n\n /**\n * The display name of the project.\n */\n projectName: string\n}\n\n// constants ==================================================================\n\nexport const PROJECT_NAME = '@open-xchange/vite-plugin-project-meta'\n\n// plugin =====================================================================\n\n/**\n * Vite plugin that provides a virtual module 'virtual:metadata' exporting a\n * metadata object with project build information (timestamp, commit ID, etc.).\n *\n * @param options\n * Plugin configuration.\n *\n * @returns\n * The Vite plugin object.\n */\nexport default function vitePluginProjectMeta(options: VitePluginProjectMetaOptions): Plugin {\n\n const MODULE_NAME = 'virtual:metadata'\n const MODULE_ID = `\\0${PROJECT_NAME}/${MODULE_NAME}`\n\n let metadata: VirtualProjectMetadata\n\n return {\n name: PROJECT_NAME,\n\n configResolved(config) {\n /** @ignore */\n interface Package {\n name: string\n version: string\n }\n const pkg = JSON.parse(readFileSync(join(config.root, 'package.json'), { encoding: 'utf8' })) as Package\n metadata = {\n id: pkg.name,\n name: options.projectName,\n version: pkg.version,\n builddate: new Date().toISOString(),\n commitsha: process.env.CI_COMMIT_SHA,\n }\n },\n\n resolveId: {\n filter: { id: exactRegex(MODULE_NAME) },\n handler: () => MODULE_ID,\n },\n\n load: {\n filter: { id: exactRegex(MODULE_ID) },\n handler: () => createJsonModule(metadata),\n },\n\n transformIndexHtml(_html, context) {\n if (!context.bundle) return\n const hash = createHash('md5').update(metadata.builddate).digest('hex')\n const len = Number.parseInt(hash.slice(0, 4), 16) % 99 + 42\n const count = Math.ceil(len / hash.length)\n const content = hash.repeat(count).slice(0, len)\n const attrs = { name: 'etag-fix', content }\n // inject a <meta> element into the <head>\n return [{ tag: 'meta', attrs, injectTo: 'head' }]\n },\n }\n}\n"],"mappings":";;;;;AAyBA,MAAa,eAAe;;;;;;;;;;;AAc5B,SAAwB,sBAAsB,SAA+C;CAE3F,MAAM,cAAc;CACpB,MAAM,YAAY,KAAK,aAAa,GAAG;CAEvC,IAAI;CAEJ,OAAO;EACL,MAAM;EAEN,eAAe,QAAQ;GAMrB,MAAM,MAAM,KAAK,MAAM,aAAa,KAAK,OAAO,MAAM,cAAc,GAAG,EAAE,UAAU,OAAO,CAAC,CAAC;GAC5F,WAAW;IACT,IAAI,IAAI;IACR,MAAM,QAAQ;IACd,SAAS,IAAI;IACb,4BAAW,IAAI,KAAK,EAAA,CAAE,YAAY;IAClC,WAAW,QAAQ,IAAI;GACzB;EACF;EAEA,WAAW;GACT,QAAQ,EAAE,IAAI,WAAW,WAAW,EAAE;GACtC,eAAe;EACjB;EAEA,MAAM;GACJ,QAAQ,EAAE,IAAI,WAAW,SAAS,EAAE;GACpC,eAAe,iBAAiB,QAAQ;EAC1C;EAEA,mBAAmB,OAAO,SAAS;GACjC,IAAI,CAAC,QAAQ,QAAQ;GACrB,MAAM,OAAO,WAAW,KAAK,CAAC,CAAC,OAAO,SAAS,SAAS,CAAC,CAAC,OAAO,KAAK;GACtE,MAAM,MAAM,OAAO,SAAS,KAAK,MAAM,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK;GACzD,MAAM,QAAQ,KAAK,KAAK,MAAM,KAAK,MAAM;GAIzC,OAAO,CAAC;IAAE,KAAK;IAAQ,OAAA;KAFP,MAAM;KAAY,SADlB,KAAK,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,GACJ;IAEb;IAAG,UAAU;GAAO,CAAC;EAClD;CACF;AACF"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-xchange/vite-plugin-project-meta",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Vite plugin providing a virtual import for project metadata",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
|
-
"url": "git+https://gitlab.
|
|
7
|
+
"url": "git+https://gitlab.com/openxchange/appsuite/documents/commons/plugins.git",
|
|
8
8
|
"directory": "packages/vite-plugin-project-meta"
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
@@ -19,17 +19,20 @@
|
|
|
19
19
|
"types": "./dist/virtual.d.ts"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
22
25
|
"files": [
|
|
23
26
|
"dist",
|
|
24
27
|
"CHANGELOG.*"
|
|
25
28
|
],
|
|
26
29
|
"dependencies": {
|
|
27
|
-
"@open-xchange/rolldown-utils": "^1.2.
|
|
30
|
+
"@open-xchange/rolldown-utils": "^1.2.1"
|
|
28
31
|
},
|
|
29
32
|
"devDependencies": {
|
|
30
|
-
"
|
|
31
|
-
"@open-xchange/tsconfig": "^0.
|
|
32
|
-
"
|
|
33
|
+
"@open-xchange/linter-presets": "^1.30.4",
|
|
34
|
+
"@open-xchange/tsconfig": "^0.2.3",
|
|
35
|
+
"vite": "^8.2.2"
|
|
33
36
|
},
|
|
34
37
|
"peerDependencies": {
|
|
35
38
|
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
|