detype 1.1.2 → 2.0.0
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/README.md +4 -0
- package/dist/{chunk-ESFGC2T7.js → chunk-VYED23Y7.js} +1 -3
- package/dist/cli.js +23 -20
- package/dist/index.cjs +0 -2
- package/dist/index.js +1 -1
- package/package.json +15 -16
package/README.md
CHANGED
|
@@ -146,6 +146,10 @@ export async function removeMagicCommentsFromFile(
|
|
|
146
146
|
|
|
147
147
|
## Change log
|
|
148
148
|
|
|
149
|
+
### 2.0
|
|
150
|
+
|
|
151
|
+
- BREAKING CHANGE: Drop support for Node < 20
|
|
152
|
+
|
|
149
153
|
### 1.0
|
|
150
154
|
|
|
151
155
|
- BREAKING CHANGE: `removeMagicComments` is now async due to Prettier's API change
|
|
@@ -13,8 +13,6 @@ import {
|
|
|
13
13
|
isComponentNode as isVueComponentNode
|
|
14
14
|
} from "@vuedx/template-ast-types";
|
|
15
15
|
import babelTs from "@babel/preset-typescript";
|
|
16
|
-
import { shim } from "string.prototype.replaceall";
|
|
17
|
-
shim();
|
|
18
16
|
function getDefinePropsObject(content) {
|
|
19
17
|
const matched = /\sprops:\s*\{/m.exec(content);
|
|
20
18
|
if (matched) {
|
|
@@ -225,7 +223,7 @@ async function removeMagicComments(code, fileName, prettierOptions) {
|
|
|
225
223
|
}
|
|
226
224
|
|
|
227
225
|
// src/transformFile.ts
|
|
228
|
-
import fs from "
|
|
226
|
+
import fs from "fs";
|
|
229
227
|
import { resolveConfig } from "prettier";
|
|
230
228
|
var { readFile, writeFile } = fs.promises;
|
|
231
229
|
async function transformFile(inputFileName, outputFileName, options = {}) {
|
package/dist/cli.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
removeMagicCommentsFromFile,
|
|
3
3
|
transformFile
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-VYED23Y7.js";
|
|
5
5
|
|
|
6
6
|
// src/cli-lib.ts
|
|
7
|
-
import fs from "
|
|
8
|
-
import path from "
|
|
7
|
+
import fs from "fs";
|
|
8
|
+
import path from "path";
|
|
9
9
|
import fastGlob from "fast-glob";
|
|
10
10
|
|
|
11
11
|
// package.json
|
|
12
12
|
var package_default = {
|
|
13
13
|
name: "detype",
|
|
14
|
-
version: "
|
|
14
|
+
version: "2.0.0",
|
|
15
15
|
description: "Removes TypeScript type annotations but keeps the formatting",
|
|
16
16
|
type: "module",
|
|
17
17
|
exports: {
|
|
@@ -44,27 +44,26 @@ var package_default = {
|
|
|
44
44
|
"index.d.ts"
|
|
45
45
|
],
|
|
46
46
|
dependencies: {
|
|
47
|
-
"@babel/core": "^7.
|
|
48
|
-
"@babel/preset-typescript": "^7.
|
|
49
|
-
"@babel/traverse": "^7.
|
|
50
|
-
"@vue/compiler-dom": "^3.5.
|
|
51
|
-
"@vue/compiler-sfc": "^3.5.
|
|
47
|
+
"@babel/core": "^7.28.5",
|
|
48
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
49
|
+
"@babel/traverse": "^7.28.5",
|
|
50
|
+
"@vue/compiler-dom": "^3.5.26",
|
|
51
|
+
"@vue/compiler-sfc": "^3.5.26",
|
|
52
52
|
"@vuedx/compiler-sfc": "0.7.1",
|
|
53
53
|
"@vuedx/template-ast-types": "0.7.1",
|
|
54
54
|
"fast-glob": "^3.3.3",
|
|
55
|
-
prettier: "^3.
|
|
56
|
-
"string.prototype.replaceall": "^1.0.10"
|
|
55
|
+
prettier: "^3.7.4"
|
|
57
56
|
},
|
|
58
57
|
devDependencies: {
|
|
59
|
-
"@cyco130/eslint-config": "^
|
|
58
|
+
"@cyco130/eslint-config": "^6.1.1",
|
|
60
59
|
"@types/babel__core": "^7.20.5",
|
|
61
|
-
"@types/babel__traverse": "^7.
|
|
62
|
-
"@types/node": "
|
|
63
|
-
eslint: "^9.
|
|
64
|
-
rimraf: "^6.
|
|
65
|
-
tsup: "^8.
|
|
66
|
-
typescript: "^5.
|
|
67
|
-
vitest: "
|
|
60
|
+
"@types/babel__traverse": "^7.28.0",
|
|
61
|
+
"@types/node": "25.0.3",
|
|
62
|
+
eslint: "^9.39.2",
|
|
63
|
+
rimraf: "^6.1.2",
|
|
64
|
+
tsup: "^8.5.1",
|
|
65
|
+
typescript: "^5.9.3",
|
|
66
|
+
vitest: "4.0.16"
|
|
68
67
|
},
|
|
69
68
|
repository: {
|
|
70
69
|
type: "git",
|
|
@@ -83,7 +82,11 @@ var package_default = {
|
|
|
83
82
|
},
|
|
84
83
|
homepage: "https://github.com/cyco130/detype#readme",
|
|
85
84
|
pnpm: {
|
|
86
|
-
overrides: {}
|
|
85
|
+
overrides: {},
|
|
86
|
+
onlyBuiltDependencies: [
|
|
87
|
+
"esbuild",
|
|
88
|
+
"unrs-resolver"
|
|
89
|
+
]
|
|
87
90
|
}
|
|
88
91
|
};
|
|
89
92
|
|
package/dist/index.cjs
CHANGED
|
@@ -44,8 +44,6 @@ var import_compiler_sfc = require("@vuedx/compiler-sfc");
|
|
|
44
44
|
var import_compiler_sfc2 = require("@vue/compiler-sfc");
|
|
45
45
|
var import_template_ast_types = require("@vuedx/template-ast-types");
|
|
46
46
|
var import_preset_typescript = __toESM(require("@babel/preset-typescript"), 1);
|
|
47
|
-
var import_string_prototype = require("string.prototype.replaceall");
|
|
48
|
-
(0, import_string_prototype.shim)();
|
|
49
47
|
function getDefinePropsObject(content) {
|
|
50
48
|
const matched = /\sprops:\s*\{/m.exec(content);
|
|
51
49
|
if (matched) {
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "detype",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Removes TypeScript type annotations but keeps the formatting",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -21,27 +21,26 @@
|
|
|
21
21
|
"index.d.ts"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@babel/core": "^7.
|
|
25
|
-
"@babel/preset-typescript": "^7.
|
|
26
|
-
"@babel/traverse": "^7.
|
|
27
|
-
"@vue/compiler-dom": "^3.5.
|
|
28
|
-
"@vue/compiler-sfc": "^3.5.
|
|
24
|
+
"@babel/core": "^7.28.5",
|
|
25
|
+
"@babel/preset-typescript": "^7.28.5",
|
|
26
|
+
"@babel/traverse": "^7.28.5",
|
|
27
|
+
"@vue/compiler-dom": "^3.5.26",
|
|
28
|
+
"@vue/compiler-sfc": "^3.5.26",
|
|
29
29
|
"@vuedx/compiler-sfc": "0.7.1",
|
|
30
30
|
"@vuedx/template-ast-types": "0.7.1",
|
|
31
31
|
"fast-glob": "^3.3.3",
|
|
32
|
-
"prettier": "^3.
|
|
33
|
-
"string.prototype.replaceall": "^1.0.10"
|
|
32
|
+
"prettier": "^3.7.4"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
|
-
"@cyco130/eslint-config": "^
|
|
35
|
+
"@cyco130/eslint-config": "^6.1.1",
|
|
37
36
|
"@types/babel__core": "^7.20.5",
|
|
38
|
-
"@types/babel__traverse": "^7.
|
|
39
|
-
"@types/node": "
|
|
40
|
-
"eslint": "^9.
|
|
41
|
-
"rimraf": "^6.
|
|
42
|
-
"tsup": "^8.
|
|
43
|
-
"typescript": "^5.
|
|
44
|
-
"vitest": "
|
|
37
|
+
"@types/babel__traverse": "^7.28.0",
|
|
38
|
+
"@types/node": "25.0.3",
|
|
39
|
+
"eslint": "^9.39.2",
|
|
40
|
+
"rimraf": "^6.1.2",
|
|
41
|
+
"tsup": "^8.5.1",
|
|
42
|
+
"typescript": "^5.9.3",
|
|
43
|
+
"vitest": "4.0.16"
|
|
45
44
|
},
|
|
46
45
|
"repository": {
|
|
47
46
|
"type": "git",
|