@gi-tcg/unplugin-gts 0.3.3 → 0.3.5
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/index.js +1 -1
- package/dist/rolldown.js +1 -1
- package/dist/rollup.js +1 -1
- package/dist/rspack.js +1 -1
- package/dist/unloader.d.ts +7 -0
- package/dist/unloader.js +6 -0
- package/dist/unplugin.d.ts +7 -0
- package/dist/unplugin.js +19 -0
- package/package.json +58 -11
- package/src/unloader.ts +7 -0
package/dist/index.js
CHANGED
package/dist/rolldown.js
CHANGED
package/dist/rollup.js
CHANGED
package/dist/rspack.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UnpluginInstance } from "unplugin";
|
|
2
|
+
import { TranspileOption } from "@gi-tcg/gts-transpiler";
|
|
3
|
+
|
|
4
|
+
//#region src/unloader.d.ts
|
|
5
|
+
declare const _default: UnpluginInstance<TranspileOption | undefined>["unloader"];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { _default as default };
|
package/dist/unloader.js
ADDED
package/dist/unplugin.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { resolveGtsConfig, transpile } from "@gi-tcg/gts-transpiler";
|
|
2
|
+
//#region src/unplugin.ts
|
|
3
|
+
const unpluginFactory = (option) => {
|
|
4
|
+
return {
|
|
5
|
+
name: "unplugin-gaming-ts",
|
|
6
|
+
transform: {
|
|
7
|
+
filter: { id: /\.gts$/ },
|
|
8
|
+
async handler(source, id) {
|
|
9
|
+
const { code, sourceMap } = transpile(source, id, await resolveGtsConfig(id, option ?? {}, { readFileFn: (path, encoding) => this.fs.readFile(path, { encoding }) }));
|
|
10
|
+
return {
|
|
11
|
+
code,
|
|
12
|
+
map: sourceMap
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { unpluginFactory };
|
package/package.json
CHANGED
|
@@ -1,49 +1,92 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gi-tcg/unplugin-gts",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"repository":
|
|
3
|
+
"version": "0.3.5",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/piovium/gts.git"
|
|
7
|
+
},
|
|
5
8
|
"license": "Apache-2.0",
|
|
6
9
|
"type": "module",
|
|
7
10
|
"exports": {
|
|
8
11
|
".": {
|
|
9
12
|
"types": "./dist/index.d.ts",
|
|
10
|
-
"development":
|
|
13
|
+
"development": [
|
|
14
|
+
"./src/index.ts",
|
|
15
|
+
"./dist/index.js"
|
|
16
|
+
],
|
|
11
17
|
"default": "./dist/index.js"
|
|
12
18
|
},
|
|
13
19
|
"./bun": {
|
|
14
20
|
"types": "./dist/bun.d.ts",
|
|
15
|
-
"development":
|
|
21
|
+
"development": [
|
|
22
|
+
"./src/bun.ts",
|
|
23
|
+
"./dist/bun.js"
|
|
24
|
+
],
|
|
16
25
|
"default": "./dist/bun.js"
|
|
17
26
|
},
|
|
18
27
|
"./bun/preload": "./src/bun_preload.ts",
|
|
19
28
|
"./esbuild": {
|
|
20
29
|
"types": "./dist/esbuild.d.ts",
|
|
21
|
-
"development":
|
|
30
|
+
"development": [
|
|
31
|
+
"./src/esbuild.ts",
|
|
32
|
+
"./dist/esbuild.js"
|
|
33
|
+
],
|
|
22
34
|
"default": "./dist/esbuild.js"
|
|
23
35
|
},
|
|
24
36
|
"./rolldown": {
|
|
25
37
|
"types": "./dist/rolldown.d.ts",
|
|
26
|
-
"development":
|
|
38
|
+
"development": [
|
|
39
|
+
"./src/rolldown.ts",
|
|
40
|
+
"./dist/rolldown.js"
|
|
41
|
+
],
|
|
27
42
|
"default": "./dist/rolldown.js"
|
|
28
43
|
},
|
|
29
44
|
"./rollup": {
|
|
30
45
|
"types": "./dist/rollup.d.ts",
|
|
31
|
-
"development":
|
|
46
|
+
"development": [
|
|
47
|
+
"./src/rollup.ts",
|
|
48
|
+
"./dist/rollup.js"
|
|
49
|
+
],
|
|
32
50
|
"default": "./dist/rollup.js"
|
|
33
51
|
},
|
|
34
52
|
"./rspack": {
|
|
35
53
|
"types": "./dist/rspack.d.ts",
|
|
36
|
-
"development":
|
|
54
|
+
"development": [
|
|
55
|
+
"./src/rspack.ts",
|
|
56
|
+
"./dist/rspack.js"
|
|
57
|
+
],
|
|
37
58
|
"default": "./dist/rspack.js"
|
|
38
59
|
},
|
|
60
|
+
"./unloader": {
|
|
61
|
+
"types": "./dist/unloader.d.ts",
|
|
62
|
+
"development": [
|
|
63
|
+
"./src/unloader.ts",
|
|
64
|
+
"./dist/unloader.js"
|
|
65
|
+
],
|
|
66
|
+
"default": "./dist/unloader.js"
|
|
67
|
+
},
|
|
68
|
+
"./unplugin": {
|
|
69
|
+
"types": "./dist/unplugin.d.ts",
|
|
70
|
+
"development": [
|
|
71
|
+
"./src/unplugin.ts",
|
|
72
|
+
"./dist/unplugin.js"
|
|
73
|
+
],
|
|
74
|
+
"default": "./dist/unplugin.js"
|
|
75
|
+
},
|
|
39
76
|
"./vite": {
|
|
40
77
|
"types": "./dist/vite.d.ts",
|
|
41
|
-
"development":
|
|
78
|
+
"development": [
|
|
79
|
+
"./src/vite.ts",
|
|
80
|
+
"./dist/vite.js"
|
|
81
|
+
],
|
|
42
82
|
"default": "./dist/vite.js"
|
|
43
83
|
},
|
|
44
84
|
"./webpack": {
|
|
45
85
|
"types": "./dist/webpack.d.ts",
|
|
46
|
-
"development":
|
|
86
|
+
"development": [
|
|
87
|
+
"./src/webpack.ts",
|
|
88
|
+
"./dist/webpack.js"
|
|
89
|
+
],
|
|
47
90
|
"default": "./dist/webpack.js"
|
|
48
91
|
},
|
|
49
92
|
"./package.json": "./package.json"
|
|
@@ -58,6 +101,7 @@
|
|
|
58
101
|
"rollup": ">=3",
|
|
59
102
|
"rolldown": "*",
|
|
60
103
|
"vite": "*",
|
|
104
|
+
"unloader": "*",
|
|
61
105
|
"webpack": "^4 || ^5"
|
|
62
106
|
},
|
|
63
107
|
"peerDependenciesMeta": {
|
|
@@ -73,6 +117,9 @@
|
|
|
73
117
|
"vite": {
|
|
74
118
|
"optional": true
|
|
75
119
|
},
|
|
120
|
+
"unloader": {
|
|
121
|
+
"optional": true
|
|
122
|
+
},
|
|
76
123
|
"webpack": {
|
|
77
124
|
"optional": true
|
|
78
125
|
}
|
|
@@ -80,7 +127,7 @@
|
|
|
80
127
|
"dependencies": {
|
|
81
128
|
"@types/bun": "^1.3.6",
|
|
82
129
|
"unplugin": "npm:@gytx/unplugin@3.1.0-patch.2",
|
|
83
|
-
"@gi-tcg/gts-transpiler": "0.3.
|
|
130
|
+
"@gi-tcg/gts-transpiler": "0.3.5"
|
|
84
131
|
},
|
|
85
132
|
"devDependencies": {
|
|
86
133
|
"@types/node": "^24.3.0"
|
package/src/unloader.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createUnloaderPlugin, type UnpluginInstance } from "unplugin";
|
|
2
|
+
import { unpluginFactory } from "./unplugin.ts";
|
|
3
|
+
import type { TranspileOption } from "@gi-tcg/gts-transpiler";
|
|
4
|
+
|
|
5
|
+
export default createUnloaderPlugin(
|
|
6
|
+
unpluginFactory,
|
|
7
|
+
) as UnpluginInstance<TranspileOption | undefined>["unloader"];
|