@ttsc/unplugin 0.8.0 → 0.8.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/LICENSE +21 -0
- package/README.md +9 -7
- package/lib/api.js +12 -18
- package/lib/api.js.map +1 -1
- package/lib/api.mjs +4 -0
- package/lib/api.mjs.map +1 -0
- package/lib/bun.js +12 -11
- package/lib/bun.js.map +1 -1
- package/lib/bun.mjs +31 -0
- package/lib/bun.mjs.map +1 -0
- package/lib/core/index.js +22 -17
- package/lib/core/index.js.map +1 -1
- package/lib/core/index.mjs +42 -0
- package/lib/core/index.mjs.map +1 -0
- package/lib/core/options.js +5 -5
- package/lib/core/options.js.map +1 -1
- package/lib/core/options.mjs +14 -0
- package/lib/core/options.mjs.map +1 -0
- package/lib/core/transform.js +62 -73
- package/lib/core/transform.js.map +1 -1
- package/lib/core/transform.mjs +272 -0
- package/lib/core/transform.mjs.map +1 -0
- package/lib/esbuild.js +9 -8
- package/lib/esbuild.js.map +1 -1
- package/lib/esbuild.mjs +6 -0
- package/lib/esbuild.mjs.map +1 -0
- package/lib/farm.js +9 -8
- package/lib/farm.js.map +1 -1
- package/lib/farm.mjs +6 -0
- package/lib/farm.mjs.map +1 -0
- package/lib/index.js +10 -8
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +6 -0
- package/lib/index.mjs.map +1 -0
- package/lib/next.js +10 -9
- package/lib/next.js.map +1 -1
- package/lib/next.mjs +18 -0
- package/lib/next.mjs.map +1 -0
- package/lib/rolldown.js +9 -8
- package/lib/rolldown.js.map +1 -1
- package/lib/rolldown.mjs +6 -0
- package/lib/rolldown.mjs.map +1 -0
- package/lib/rollup.js +9 -8
- package/lib/rollup.js.map +1 -1
- package/lib/rollup.mjs +6 -0
- package/lib/rollup.mjs.map +1 -0
- package/lib/rspack.js +9 -8
- package/lib/rspack.js.map +1 -1
- package/lib/rspack.mjs +6 -0
- package/lib/rspack.mjs.map +1 -0
- package/lib/vite.js +9 -8
- package/lib/vite.js.map +1 -1
- package/lib/vite.mjs +6 -0
- package/lib/vite.mjs.map +1 -0
- package/lib/webpack.js +9 -8
- package/lib/webpack.js.map +1 -1
- package/lib/webpack.mjs +6 -0
- package/lib/webpack.mjs.map +1 -0
- package/package.json +31 -16
- package/src/core/index.ts +2 -0
- package/src/core/transform.ts +5 -1
package/lib/vite.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const vite =
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index = require('./core/index.js');
|
|
6
|
+
|
|
7
|
+
const vite = index.default.vite;
|
|
8
|
+
|
|
8
9
|
exports.default = vite;
|
|
9
|
-
//# sourceMappingURL=vite.js.map
|
|
10
|
+
//# sourceMappingURL=vite.js.map
|
package/lib/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","
|
|
1
|
+
{"version":3,"file":"vite.js","sources":["../src/vite.ts"],"sourcesContent":[null],"names":["unplugin"],"mappings":";;;;;;AAEA,MAAM,IAAI,GAAyBA,aAAQ,CAAC;;;;"}
|
package/lib/vite.mjs
ADDED
package/lib/vite.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.mjs","sources":["../src/vite.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA,MAAM,IAAI,GAAyB,QAAQ,CAAC;;;;"}
|
package/lib/webpack.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const webpack =
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var index = require('./core/index.js');
|
|
6
|
+
|
|
7
|
+
const webpack = index.default.webpack;
|
|
8
|
+
|
|
8
9
|
exports.default = webpack;
|
|
9
|
-
//# sourceMappingURL=webpack.js.map
|
|
10
|
+
//# sourceMappingURL=webpack.js.map
|
package/lib/webpack.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.js","
|
|
1
|
+
{"version":3,"file":"webpack.js","sources":["../src/webpack.ts"],"sourcesContent":[null],"names":["unplugin"],"mappings":";;;;;;AAEA,MAAM,OAAO,GAA4BA,aAAQ,CAAC;;;;"}
|
package/lib/webpack.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webpack.mjs","sources":["../src/webpack.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAEA,MAAM,OAAO,GAA4B,QAAQ,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,52 +1,64 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttsc/unplugin",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Bundler adapters for ttsc plugins.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
|
+
"module": "lib/index.mjs",
|
|
6
7
|
"types": "lib/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
9
10
|
"types": "./lib/index.d.ts",
|
|
11
|
+
"import": "./lib/index.mjs",
|
|
10
12
|
"default": "./lib/index.js"
|
|
11
13
|
},
|
|
12
14
|
"./api": {
|
|
13
15
|
"types": "./lib/api.d.ts",
|
|
16
|
+
"import": "./lib/api.mjs",
|
|
14
17
|
"default": "./lib/api.js"
|
|
15
18
|
},
|
|
16
19
|
"./bun": {
|
|
17
20
|
"types": "./lib/bun.d.ts",
|
|
21
|
+
"import": "./lib/bun.mjs",
|
|
18
22
|
"default": "./lib/bun.js"
|
|
19
23
|
},
|
|
20
24
|
"./esbuild": {
|
|
21
25
|
"types": "./lib/esbuild.d.ts",
|
|
26
|
+
"import": "./lib/esbuild.mjs",
|
|
22
27
|
"default": "./lib/esbuild.js"
|
|
23
28
|
},
|
|
24
29
|
"./farm": {
|
|
25
30
|
"types": "./lib/farm.d.ts",
|
|
31
|
+
"import": "./lib/farm.mjs",
|
|
26
32
|
"default": "./lib/farm.js"
|
|
27
33
|
},
|
|
28
34
|
"./next": {
|
|
29
35
|
"types": "./lib/next.d.ts",
|
|
36
|
+
"import": "./lib/next.mjs",
|
|
30
37
|
"default": "./lib/next.js"
|
|
31
38
|
},
|
|
32
39
|
"./rolldown": {
|
|
33
40
|
"types": "./lib/rolldown.d.ts",
|
|
41
|
+
"import": "./lib/rolldown.mjs",
|
|
34
42
|
"default": "./lib/rolldown.js"
|
|
35
43
|
},
|
|
36
44
|
"./rollup": {
|
|
37
45
|
"types": "./lib/rollup.d.ts",
|
|
46
|
+
"import": "./lib/rollup.mjs",
|
|
38
47
|
"default": "./lib/rollup.js"
|
|
39
48
|
},
|
|
40
49
|
"./rspack": {
|
|
41
50
|
"types": "./lib/rspack.d.ts",
|
|
51
|
+
"import": "./lib/rspack.mjs",
|
|
42
52
|
"default": "./lib/rspack.js"
|
|
43
53
|
},
|
|
44
54
|
"./vite": {
|
|
45
55
|
"types": "./lib/vite.d.ts",
|
|
56
|
+
"import": "./lib/vite.mjs",
|
|
46
57
|
"default": "./lib/vite.js"
|
|
47
58
|
},
|
|
48
59
|
"./webpack": {
|
|
49
60
|
"types": "./lib/webpack.d.ts",
|
|
61
|
+
"import": "./lib/webpack.mjs",
|
|
50
62
|
"default": "./lib/webpack.js"
|
|
51
63
|
},
|
|
52
64
|
"./package.json": "./package.json"
|
|
@@ -54,10 +66,6 @@
|
|
|
54
66
|
"publishConfig": {
|
|
55
67
|
"access": "public"
|
|
56
68
|
},
|
|
57
|
-
"scripts": {
|
|
58
|
-
"build": "rimraf lib && tsgo",
|
|
59
|
-
"test": "pnpm run build && node --test --test-reporter=spec ../../tests/unplugin/**/*.test.cjs"
|
|
60
|
-
},
|
|
61
69
|
"keywords": [
|
|
62
70
|
"ttsc",
|
|
63
71
|
"unplugin",
|
|
@@ -78,18 +86,22 @@
|
|
|
78
86
|
"magic-string": "^0.30.21",
|
|
79
87
|
"unplugin": "^2.3.11"
|
|
80
88
|
},
|
|
81
|
-
"peerDependencies": {
|
|
82
|
-
"@typescript/native-preview": ">=7.0.0-dev.0",
|
|
83
|
-
"ttsc": "^0.8.0"
|
|
84
|
-
},
|
|
85
89
|
"devDependencies": {
|
|
86
|
-
"@
|
|
87
|
-
"@
|
|
90
|
+
"@rollup/plugin-commonjs": "^29.0.2",
|
|
91
|
+
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
92
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
93
|
+
"@types/node": "^25.3.0",
|
|
94
|
+
"@typescript/native-preview": "7.0.0-dev.20260506.1",
|
|
88
95
|
"esbuild": "^0.25.12",
|
|
89
|
-
"rimraf": "
|
|
96
|
+
"rimraf": "^6.1.2",
|
|
90
97
|
"rollup": "^4.60.3",
|
|
91
|
-
"
|
|
92
|
-
"
|
|
98
|
+
"rollup-plugin-auto-external": "^2.0.0",
|
|
99
|
+
"rollup-plugin-node-externals": "^9.0.1",
|
|
100
|
+
"tinyglobby": "^0.2.16",
|
|
101
|
+
"tslib": "^2.8.1",
|
|
102
|
+
"typescript": "^6.0.3",
|
|
103
|
+
"vite": "^7.1.12",
|
|
104
|
+
"ttsc": "0.8.1"
|
|
93
105
|
},
|
|
94
106
|
"repository": {
|
|
95
107
|
"type": "git",
|
|
@@ -102,5 +114,8 @@
|
|
|
102
114
|
},
|
|
103
115
|
"homepage": "https://github.com/samchon/ttsc/tree/master/packages/unplugin#readme",
|
|
104
116
|
"sideEffects": false,
|
|
105
|
-
"
|
|
106
|
-
|
|
117
|
+
"scripts": {
|
|
118
|
+
"build": "rimraf lib && tsgo --emitDeclarationOnly && rollup -c",
|
|
119
|
+
"test": "pnpm --dir ../.. --filter ttsc build && pnpm run build && node --test --test-reporter=spec ../../tests/unplugin/**/*.test.cjs"
|
|
120
|
+
}
|
|
121
|
+
}
|
package/src/core/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { isDeclarationFile, stripQuery, transformTtsc } from "./transform";
|
|
|
8
8
|
const name = "ttsc-unplugin";
|
|
9
9
|
const sourceFilePattern = /\.[cm]?[jt]sx?$/;
|
|
10
10
|
const nodeModulesPattern = /(?:^|[/\\])node_modules(?:[/\\]|$)/;
|
|
11
|
+
const virtualModulePattern = /\0/;
|
|
11
12
|
|
|
12
13
|
const unpluginFactory: UnpluginFactory<
|
|
13
14
|
TtscUnpluginOptions | undefined,
|
|
@@ -55,6 +56,7 @@ export default unplugin;
|
|
|
55
56
|
function isTransformTarget(id: string): boolean {
|
|
56
57
|
return (
|
|
57
58
|
sourceFilePattern.test(id) &&
|
|
59
|
+
!virtualModulePattern.test(id) &&
|
|
58
60
|
!isDeclarationFile(id) &&
|
|
59
61
|
!nodeModulesPattern.test(id)
|
|
60
62
|
);
|
package/src/core/transform.ts
CHANGED
|
@@ -27,7 +27,11 @@ export async function transformTtsc(
|
|
|
27
27
|
options: ResolvedTtscUnpluginOptions,
|
|
28
28
|
aliases?: unknown,
|
|
29
29
|
): Promise<TtscTransformResult | undefined> {
|
|
30
|
-
const
|
|
30
|
+
const clean = stripQuery(id);
|
|
31
|
+
if (clean.includes("\0")) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
const file = path.resolve(clean);
|
|
31
35
|
if (isDeclarationFile(file)) {
|
|
32
36
|
return undefined;
|
|
33
37
|
}
|