@gjsify/vite-plugin-blueprint 0.2.9 → 0.3.14
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/{dist → lib}/index.js +0 -2
- package/package.json +46 -19
- package/tsconfig.json +13 -20
- package/types/blueprint.d.ts +4 -0
- package/README.md +0 -88
- package/dist/index.js.map +0 -1
- /package/{dist → lib}/index.d.ts +0 -0
package/{dist → lib}/index.js
RENAMED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import {} from "vite";
|
|
2
1
|
import { execa } from "execa";
|
|
3
2
|
import minifyXML from "minify-xml";
|
|
4
3
|
export default function blueprintPlugin(options = {}) {
|
|
@@ -30,4 +29,3 @@ export default function blueprintPlugin(options = {}) {
|
|
|
30
29
|
},
|
|
31
30
|
};
|
|
32
31
|
}
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,35 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gjsify/vite-plugin-blueprint",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Vite
|
|
5
|
-
"main": "dist/index.js",
|
|
3
|
+
"version": "0.3.14",
|
|
4
|
+
"description": "Compile GNOME Blueprint .blp templates to XML strings via blueprint-compiler. Vite / Rollup / Rolldown compatible.",
|
|
6
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
|
+
}
|
|
17
|
+
},
|
|
7
18
|
"scripts": {
|
|
8
|
-
"
|
|
9
|
-
"clear": "rm -rf dist",
|
|
19
|
+
"clear": "rm -rf lib tsconfig.tsbuildinfo || exit 0",
|
|
10
20
|
"check": "tsc --noEmit",
|
|
11
|
-
"build": "tsc
|
|
21
|
+
"build": "tsc"
|
|
12
22
|
},
|
|
13
|
-
"author": "Pascal Garber <pascal@mailfreun.de>",
|
|
14
|
-
"license": "MIT",
|
|
15
23
|
"repository": {
|
|
16
24
|
"type": "git",
|
|
17
|
-
"url": "git+https://github.com/gjsify/
|
|
25
|
+
"url": "git+https://github.com/gjsify/gjsify.git"
|
|
18
26
|
},
|
|
19
27
|
"bugs": {
|
|
20
|
-
"url": "https://github.com/gjsify/
|
|
21
|
-
},
|
|
22
|
-
"homepage": "https://github.com/gjsify/vite/tree/main/packages/vite-plugin-blueprint",
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@types/node": "^24.5.2",
|
|
25
|
-
"typescript": "^5.9.2",
|
|
26
|
-
"vite": "^7.1.7"
|
|
27
|
-
},
|
|
28
|
-
"peerDependencies": {
|
|
29
|
-
"vite": "*"
|
|
28
|
+
"url": "https://github.com/gjsify/gjsify/issues"
|
|
30
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",
|
|
31
41
|
"dependencies": {
|
|
32
42
|
"execa": "^9.6.0",
|
|
33
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
|
|
52
|
+
},
|
|
53
|
+
"vite": {
|
|
54
|
+
"optional": true
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/node": "^25.6.0",
|
|
59
|
+
"typescript": "^6.0.3",
|
|
60
|
+
"vite": "^8.0.0"
|
|
34
61
|
}
|
|
35
62
|
}
|
package/tsconfig.json
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
"sourceMap": true,
|
|
16
|
-
"diagnostics": true,
|
|
17
|
-
"verbatimModuleSyntax": true,
|
|
18
|
-
"isolatedModules": true
|
|
19
|
-
},
|
|
20
|
-
"include": ["src/**/*.ts"],
|
|
21
|
-
"exclude": ["node_modules", "dist"]
|
|
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/**/*"]
|
|
22
15
|
}
|
package/README.md
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
# vite-plugin-blueprint
|
|
2
|
-
|
|
3
|
-
A Vite plugin for compiling Blueprint UI files (`.blp`) to XML and importing them as strings in your JavaScript/TypeScript code.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- Automatically compiles `.blp` files to XML when imported
|
|
8
|
-
- Optionally minifies the generated XML
|
|
9
|
-
- Seamlessly integrates with your Vite build process
|
|
10
|
-
|
|
11
|
-
## Installation
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
npm install @gjsify/vite-plugin-blueprint --save-dev
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
or if you use Yarn:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
yarn add @gjsify/vite-plugin-blueprint -D
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
Add the plugin to your Vite configuration:
|
|
26
|
-
|
|
27
|
-
```javascript
|
|
28
|
-
// vite.config.js / vite.config.ts
|
|
29
|
-
import { defineConfig } from "vite";
|
|
30
|
-
import blueprintPlugin from "@gjsify/vite-plugin-blueprint";
|
|
31
|
-
|
|
32
|
-
export default defineConfig({
|
|
33
|
-
plugins: [
|
|
34
|
-
blueprintPlugin({
|
|
35
|
-
minify: true, // optional, defaults to false
|
|
36
|
-
}),
|
|
37
|
-
],
|
|
38
|
-
// ... other configurations
|
|
39
|
-
});
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
Then, you can import `.blp` files directly in your code:
|
|
43
|
-
|
|
44
|
-
```javascript
|
|
45
|
-
import myUIXML from "./path/to/my-ui.blp";
|
|
46
|
-
console.log(myUIXML); // This will log the compiled XML content as a string
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### TypeScript
|
|
50
|
-
|
|
51
|
-
To use the plugin with TypeScript, you need to declare the module for `.blp` files in a `.d.ts` file:
|
|
52
|
-
|
|
53
|
-
```typescript
|
|
54
|
-
declare module "*.blp" {
|
|
55
|
-
const content: string;
|
|
56
|
-
export default content;
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
Then, you can import `.blp` files in your TypeScript code:
|
|
61
|
-
|
|
62
|
-
```typescript
|
|
63
|
-
import myUIXML from "./path/to/my-ui.blp";
|
|
64
|
-
console.log(myUIXML); // This will log the compiled XML content as a string
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
## Options
|
|
68
|
-
|
|
69
|
-
The plugin accepts an options object with the following properties:
|
|
70
|
-
|
|
71
|
-
- `minify` (boolean, optional): If set to `true`, the plugin will minify the generated XML. Default is `false`.
|
|
72
|
-
|
|
73
|
-
## Requirements
|
|
74
|
-
|
|
75
|
-
- Vite 2.x or higher
|
|
76
|
-
- Node.js 12.x or higher
|
|
77
|
-
- `blueprint-compiler` must be installed and available in your system's PATH
|
|
78
|
-
|
|
79
|
-
## How it Works
|
|
80
|
-
|
|
81
|
-
1. When a `.blp` file is imported, the plugin intercepts the import.
|
|
82
|
-
2. It runs the `blueprint-compiler` to compile the `.blp` file to XML.
|
|
83
|
-
3. If minification is enabled, the XML is minified.
|
|
84
|
-
4. The resulting XML is returned as a string, which can be used in your JavaScript/TypeScript code.
|
|
85
|
-
|
|
86
|
-
## Contributing
|
|
87
|
-
|
|
88
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,SAAS,MAAM,YAAY,CAAC;AAOnC,MAAM,CAAC,OAAO,UAAU,eAAe,CACrC,UAAkC,EAAE;IAEpC,MAAM,EAAE,MAAM,GAAG,KAAK,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IAEpD,OAAO;QACL,IAAI,EAAE,uBAAuB;QAE7B,KAAK,CAAC,IAAI,CAAC,EAAE;YACX,IAAI,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;gBACxB,IAAI,CAAC;oBACH,gDAAgD;oBAChD,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,CAAC,oBAAoB,EAAE,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC;oBACtE,IAAI,OAAO;wBAAE,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;oBAE3C,IAAI,UAAU,GAAG,MAAM,CAAC;oBAExB,kCAAkC;oBAClC,IAAI,MAAM,EAAE,CAAC;wBACX,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;wBACnC,IAAI,OAAO;4BAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;oBACrD,CAAC;oBAED,qCAAqC;oBACrC,OAAO,kBAAkB,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC;gBACzD,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,KAAK,CAAC,oBAAoB,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;oBAChD,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
|
/package/{dist → lib}/index.d.ts
RENAMED
|
File without changes
|