forked from Snowflyt/typroof
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.json
More file actions
82 lines (82 loc) · 5.17 KB
/
Copy pathpackage.json
File metadata and controls
82 lines (82 loc) · 5.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
"name": "typroof",
"version": "0.5.5",
"private": true,
"description": "TypeScript type testing with a fast CLI tool and a smooth WYSIWYG editor experience.",
"keywords": [
"typescript",
"typroof",
"test",
"check",
"static analysis"
],
"homepage": "https://github.com/Snowflyt/typroof",
"bugs": {
"url": "https://github.com/Snowflyt/typroof/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/Snowflyt/typroof"
},
"license": "MIT",
"author": "Ge Gao (Snowflyt) <gaoge011022@gmail.com>",
"type": "module",
"main": "./index.js",
"module": "./index.js",
"types": "./index.d.ts",
"bin": {
"typroof": "./cli.js"
},
"scripts": {
"build": "rimraf dist && npm run test-types && npm run test && npm run compile && node -e \"import fs from 'node:fs'; fs.cpSync('package.json', 'dist/package.json')\" && json -I -f dist/package.json -e \"delete this.private; delete this.scripts; delete this.devDependencies\" && node -e \"import fs from 'node:fs'; ['LICENSE', 'README.md'].forEach((name) => fs.cpSync(name, 'dist/' + name))\"",
"compile": "tsc --emitDeclarationOnly -p tsconfig.build.json && node -e \"import fs from 'node:fs'; fs.cpSync('src', 'dist', { recursive: true })\" && rimraf dist/tools && node -e \"import fs from 'node:fs'; fs.readdirSync('src/tools', { recursive: true }).forEach((file) => { if (file.endsWith('ts') && !file.endsWith('.d.ts') && !file.endsWith('.proof.ts')) fs.cpSync('src/tools/' + file, 'dist/tools/' + file.slice(0, -3) + '.d.ts'); })\" && node -e \"import path from 'node:path'; import fs from 'node:fs'; import tsBlankSpace from 'ts-blank-space'; fs.readdirSync('dist', { recursive: true }).map((file) => path.join('dist', file)).filter((file) => file.endsWith('.ts') && !file.endsWith('.d.ts') && fs.statSync(file).isFile()).forEach((file) => { fs.writeFileSync(file.substring(0, file.lastIndexOf('.')) + '.js', tsBlankSpace(fs.readFileSync(file, 'utf-8'))); fs.rmSync(file); })\" && tsc-alias --resolve-full-paths -p tsconfig.build.json && node -e \"import { replaceInFileSync } from 'replace-in-file'; [/ *\\/\\/ eslint-disable-next-line [^\\n]+\\n/g, / *\\/\\* eslint-(disable|enable) [^\\n]+ \\*\\/\\n/g, /^\\s*\\/\\/ @ts-.+$/gm].forEach((regex) => replaceInFileSync({ files: 'dist/**/*.{js,ts}', from: regex, to: '' }))\" && prettier --log-level=silent --print-width 80 --write \"dist/**/*\" --ignore-path \"!dist/**/*\" && node -e \"import { replaceInFileSync } from 'replace-in-file'; replaceInFileSync({ files: 'dist/**/*.js', from: /^ *\\*\\/\\n\\n/gm, to: '*/\\n' }); for (let i = 0; i < 10; i++) replaceInFileSync({ files: 'dist/**/*.js', from: /^ *\\/\\*\\*\\n(( \\*( [^\\n]*)?\\n)+) *\\*\\/\\n( *\\/)/gm, to: '$4' })\" && prettier --log-level=silent --print-width 80 --write \"dist/**/*\" --ignore-path \"!dist/**/*\"",
"format": "prettier --no-error-on-unmatched-pattern --write {src,test}/**/*.{js,ts,json} *.{js,cjs,mjs,ts,cts,mts,json,md}",
"lint": "eslint {src,test}/**/*.{js,ts} *.{js,cjs,mjs,ts,cts,mts} --no-error-on-unmatched-pattern --report-unused-disable-directives-severity error --max-warnings 0",
"lint:fix": "eslint --fix {src,test}/**/*.{js,ts} *.{js,cjs,mjs,ts,cts,mts} --no-error-on-unmatched-pattern --report-unused-disable-directives-severity error --max-warnings 0",
"prepare": "node -e \"import fs from 'fs'; import path from 'path'; const hooksDir = path.join(process.cwd(), '.githooks'); const gitHooksDir = path.join(process.cwd(), '.git/hooks'); if (!fs.existsSync(gitHooksDir)) { console.error('Git hooks directory not found, please run this in a git repository.'); process.exit(1); } fs.readdirSync(hooksDir).forEach(file => { const srcFile = path.join(hooksDir, file); const destFile = path.join(gitHooksDir, file); fs.copyFileSync(srcFile, destFile); if (process.platform !== 'win32' && !file.endsWith('.cmd')) { fs.chmodSync(destFile, 0o755); } })\"",
"test": "vitest run",
"test-types": "tsx src/cli.ts",
"test:cov": "vitest run --coverage",
"test:ui": "vitest --ui --coverage.enabled=true",
"test:watch": "vitest",
"test:watch-cov": "vitest --coverage",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"esbuild": "^0.25.4",
"get-tsconfig": "^4.10.0",
"meow": "^13.2.0",
"tinyglobby": "^0.2.13",
"typescript": "4.x || 5.x"
},
"devDependencies": {
"@commitlint/cli": "^19.8.1",
"@types/node": "^22.15.16",
"@typescript-eslint/parser": "^8.32.0",
"@vitest/coverage-v8": "^3.1.3",
"@vitest/ui": "^3.1.3",
"eslint": "^9.26.0",
"eslint-config-prettier": "^10.1.3",
"eslint-import-resolver-typescript": "^4.3.4",
"eslint-plugin-import-x": "^4.11.0",
"eslint-plugin-jsdoc": "^50.6.11",
"eslint-plugin-prettier": "^5.4.0",
"eslint-plugin-sonarjs": "^3.0.2",
"eslint-plugin-sort-destructure-keys": "^2.0.0",
"globals": "^16.1.0",
"json": "^11.0.0",
"prettier": "^3.5.3",
"prettier-plugin-packagejson": "^2.5.11",
"replace-in-file": "^8.3.0",
"rimraf": "^6.0.1",
"ts-blank-space": "^0.6.1",
"tsc-alias": "^1.8.16",
"tsx": "^4.19.4",
"typescript": "^5.8.3",
"typescript-eslint": "^8.32.0",
"vitest": "^3.1.3"
},
"engines": {
"node": ">=18.0.0"
}
}