@gjsify/vite-plugin-blueprint 0.4.0 → 0.4.3

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/package.json CHANGED
@@ -1,62 +1,65 @@
1
1
  {
2
- "name": "@gjsify/vite-plugin-blueprint",
3
- "version": "0.4.0",
4
- "description": "Compile GNOME Blueprint .blp templates to XML strings via blueprint-compiler. Vite / Rollup / Rolldown compatible.",
5
- "type": "module",
6
- "main": "lib/index.js",
7
- "module": "lib/index.js",
8
- "types": "lib/index.d.ts",
9
- "exports": {
10
- ".": {
11
- "types": "./lib/index.d.ts",
12
- "default": "./lib/index.js"
2
+ "name": "@gjsify/vite-plugin-blueprint",
3
+ "version": "0.4.3",
4
+ "description": "Compile GNOME Blueprint .blp templates to XML strings via blueprint-compiler. Vite / Rollup / Rolldown compatible.",
5
+ "type": "module",
6
+ "main": "lib/index.js",
7
+ "module": "lib/index.js",
8
+ "types": "lib/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./lib/index.d.ts",
12
+ "default": "./lib/index.js"
13
+ },
14
+ "./types": {
15
+ "types": "./types/blueprint.d.ts"
16
+ }
13
17
  },
14
- "./types": {
15
- "types": "./types/blueprint.d.ts"
16
- }
17
- },
18
- "scripts": {
19
- "clear": "rm -rf lib tsconfig.tsbuildinfo || exit 0",
20
- "check": "tsc --noEmit",
21
- "build": "tsc"
22
- },
23
- "repository": {
24
- "type": "git",
25
- "url": "git+https://github.com/gjsify/gjsify.git"
26
- },
27
- "bugs": {
28
- "url": "https://github.com/gjsify/gjsify/issues"
29
- },
30
- "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/infra/vite-plugin-blueprint#readme",
31
- "keywords": [
32
- "vite",
33
- "rollup",
34
- "rolldown",
35
- "gjs",
36
- "gtk",
37
- "blueprint",
38
- "gnome"
39
- ],
40
- "license": "MIT",
41
- "dependencies": {
42
- "execa": "^9.6.1",
43
- "minify-xml": "^4.5.2"
44
- },
45
- "peerDependencies": {
46
- "rolldown": "^1.0.0-rc.18",
47
- "vite": "^8.0.0"
48
- },
49
- "peerDependenciesMeta": {
50
- "rolldown": {
51
- "optional": true
18
+ "files": [
19
+ "lib"
20
+ ],
21
+ "scripts": {
22
+ "clear": "rm -rf lib tsconfig.tsbuildinfo || exit 0",
23
+ "check": "tsc --noEmit",
24
+ "build": "tsc"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/gjsify/gjsify.git"
29
+ },
30
+ "bugs": {
31
+ "url": "https://github.com/gjsify/gjsify/issues"
32
+ },
33
+ "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/infra/vite-plugin-blueprint#readme",
34
+ "keywords": [
35
+ "vite",
36
+ "rollup",
37
+ "rolldown",
38
+ "gjs",
39
+ "gtk",
40
+ "blueprint",
41
+ "gnome"
42
+ ],
43
+ "license": "MIT",
44
+ "dependencies": {
45
+ "execa": "^9.6.1",
46
+ "minify-xml": "^4.5.2"
47
+ },
48
+ "peerDependencies": {
49
+ "rolldown": "^1.0.0-rc.18",
50
+ "vite": "^8.0.0"
51
+ },
52
+ "peerDependenciesMeta": {
53
+ "rolldown": {
54
+ "optional": true
55
+ },
56
+ "vite": {
57
+ "optional": true
58
+ }
52
59
  },
53
- "vite": {
54
- "optional": true
60
+ "devDependencies": {
61
+ "@types/node": "^25.6.2",
62
+ "typescript": "^6.0.3",
63
+ "vite": "^8.0.11"
55
64
  }
56
- },
57
- "devDependencies": {
58
- "@types/node": "^25.6.2",
59
- "typescript": "^6.0.3",
60
- "vite": "^8.0.11"
61
- }
62
- }
65
+ }
package/src/index.ts DELETED
@@ -1,42 +0,0 @@
1
- import { type Plugin } from "vite";
2
- import { execa } from "execa";
3
- import minifyXML from "minify-xml";
4
-
5
- export interface BlueprintPluginOptions {
6
- minify?: boolean;
7
- verbose?: boolean;
8
- }
9
-
10
- export default function blueprintPlugin(
11
- options: BlueprintPluginOptions = {}
12
- ): Plugin {
13
- const { minify = false, verbose = false } = options;
14
-
15
- return {
16
- name: "vite-plugin-blueprint",
17
-
18
- async load(id) {
19
- if (id.endsWith(".blp")) {
20
- try {
21
- // Compile .blp file and get XML output directly
22
- const { stdout } = await execa("blueprint-compiler", ["compile", id]);
23
- if (verbose) console.log(`Compiled ${id}`);
24
-
25
- let xmlContent = stdout;
26
-
27
- // Minify XML if option is enabled
28
- if (minify) {
29
- xmlContent = minifyXML(xmlContent);
30
- if (verbose) console.log(`Minified XML for ${id}`);
31
- }
32
-
33
- // Return the XML content as a string
34
- return `export default ${JSON.stringify(xmlContent)};`;
35
- } catch (error) {
36
- console.error(`Error processing ${id}:`, error);
37
- throw error;
38
- }
39
- }
40
- },
41
- };
42
- }
package/src/type.d.ts DELETED
@@ -1,4 +0,0 @@
1
- declare module "*.blp" {
2
- const content: string;
3
- export default content;
4
- }
package/tsconfig.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "rootDir": "src",
4
- "outDir": "lib",
5
- "declaration": true,
6
- "target": "ESNext",
7
- "module": "ESNext",
8
- "moduleResolution": "bundler",
9
- "strict": true,
10
- "esModuleInterop": true,
11
- "skipLibCheck": true,
12
- "types": ["node"]
13
- },
14
- "include": ["src/**/*"]
15
- }
@@ -1,4 +0,0 @@
1
- declare module "*.blp" {
2
- const content: string;
3
- export default content;
4
- }