@gjsify/vite-plugin-blueprint 0.4.0 → 0.4.4
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 +61 -58
- package/src/index.ts +0 -42
- package/src/type.d.ts +0 -4
- package/tsconfig.json +0 -15
- package/types/blueprint.d.ts +0 -4
package/package.json
CHANGED
|
@@ -1,62 +1,65 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
"name": "@gjsify/vite-plugin-blueprint",
|
|
3
|
+
"version": "0.4.4",
|
|
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
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
"
|
|
54
|
-
|
|
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
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
|
-
}
|
package/types/blueprint.d.ts
DELETED