-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpackage.json
More file actions
97 lines (97 loc) · 6.57 KB
/
package.json
File metadata and controls
97 lines (97 loc) · 6.57 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{
"name": "showify",
"version": "0.2.8",
"private": true,
"description": "Arguably the most comprehensive library for stringifying any JavaScript value into a human-readable format, handling nearly every scenario you might encounter.",
"keywords": [
"string",
"stringify",
"text",
"format",
"formatting",
"human-readable",
"pretty",
"pretty-print",
"log",
"logging",
"color",
"colour",
"colors",
"terminal",
"console",
"tty",
"shell",
"command-line"
],
"homepage": "https://github.com/Snowflyt/showify",
"bugs": {
"url": "https://github.com/Snowflyt/showify/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Snowflyt/showify.git"
},
"license": "MPL-2.0",
"author": "Ge Gao (Snowflyt) <gaoge011022@gmail.com>",
"sideEffects": false,
"type": "module",
"main": "./index.js",
"module": "./index.js",
"types": "./index.d.ts",
"workspaces": [
"packages/*"
],
"scripts": {
"bench": "vitest bench --run",
"bench:watch": "vitest bench",
"build": "rimraf dist && npm 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.workspaces; delete this.scripts; delete this.devDependencies\" && node -e \"import fs from 'node:fs'; ['README.md', 'LICENSE', 'COMMERCIAL_LICENSE.md', 'screenshot.png'].forEach((name) => fs.cpSync(name, 'dist/' + name))\"",
"compile": "tsc --emitDeclarationOnly --composite false -p tsconfig.build.json && node -e \"import fs from 'node:fs'; fs.cpSync('src', 'dist', { recursive: true })\" && 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, / *\\/\\/ @ts-[^\\n]+\\n/g, / *\\/\\*\\* @internal \\*\\/\\n/g].forEach((regex) => replaceInFileSync({ files: 'dist/**/*.js', from: regex, to: '' }))\" && prettier --log-level=silent --print-width 80 --trailing-comma es5 --write \"dist/**/*\" --ignore-path \"!dist/**/*\" && node -e \"import { replaceInFileSync } from 'replace-in-file'; replaceInFileSync({ files: 'dist/**/*.js', from: /^ *\\*\\/\\n\\n/gm, to: '*/\\n' }); let results; do { results = replaceInFileSync({ files: 'dist/**/*.js', from: /(^|\\n) *\\/\\*\\*\\n(( \\*( [^\\n]*)?\\n)+) *\\*\\/\\n(( *\\/)|(\\s*$))/, to: '$' + 1 + '$' + 5 }); } while (results.length && results.some((result) => result.hasChanged))\" && prettier --log-level=silent --print-width 80 --trailing-comma es5 --write \"dist/**/*\" --ignore-path \"!dist/**/*\"",
"format": "prettier --no-error-on-unmatched-pattern --write \"**/*.{js,ts,json,md}\" \"*.{cjs,mjs,cts,mts}\"",
"lint": "eslint \"**/*.{js,ts}\" \"*.{cjs,mjs,cts,mts}\" --no-error-on-unmatched-pattern --report-unused-disable-directives-severity error --max-warnings 0",
"lint:fix": "eslint --fix \"**/*.{js,ts}\" \"*.{cjs,mjs,cts,mts}\" --no-error-on-unmatched-pattern --report-unused-disable-directives-severity error --max-warnings 0",
"measure-size": "rimraf dist && npm run compile && rollup dist/index.js --format esm --file dist/showify.min.js --plugin terser && node -e \"import fs from 'node:fs'; import prettyBytes from 'pretty-bytes'; import { gzipSizeSync } from 'gzip-size'; import brotliSize from 'brotli-size'; const fixed = 3; const content = fs.readFileSync('dist/showify.min.js', 'utf-8'); console.log('gzip: ', `\\x1b[33m${prettyBytes(content.length, { maximumFractionDigits: fixed })}\\x1b[0m (bundled+minified)`, '→', `\\x1b[36m${prettyBytes(gzipSizeSync(content), { maximumFractionDigits: fixed })}\\x1b[0m`); console.log('brotli:', `\\x1b[33m${prettyBytes(content.length, { maximumFractionDigits: fixed })}\\x1b[0m (bundled+minified)`, '→', `\\x1b[36m${prettyBytes(brotliSize.sync(content), { maximumFractionDigits: fixed })}\\x1b[0m`)\" && rimraf dist",
"prepare": "node -e \"import fs from 'node:fs'; import path from 'node: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 --dir test",
"test:cov": "vitest run --dir test --coverage --coverage.reporter=text --coverage.reporter=lcov --coverage.include \"src/**/*.ts\"",
"test:ui": "vitest --ui --dir test --coverage.enabled=true --coverage.include \"src/**/*.ts\"",
"test:watch": "vitest --dir test",
"test:watch-cov": "vitest --dir test --coverage --coverage.reporter=text --coverage.reporter=lcov --coverage.include \"src/**/*.ts\""
},
"devDependencies": {
"@commitlint/cli": "^20.5.0",
"@eslint/js": "^10.0.1",
"@rollup/plugin-terser": "^1.0.0",
"@types/node": "^25.5.2",
"@types/object-inspect": "^1.13.0",
"@types/stringify-object": "^4.0.5",
"@vitest/coverage-v8": "~4.0.18",
"@vitest/ui": "~4.0.18",
"arktype": "^2.2.0",
"brotli-size": "^4.0.0",
"eslint": "^10.2.0",
"eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4",
"eslint-plugin-import-x": "^4.16.2",
"eslint-plugin-jsdoc": "^62.9.0",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-sonarjs": "^4.0.2",
"eslint-plugin-sort-destructure-keys": "^3.0.0",
"globals": "^17.4.0",
"gzip-size": "^7.0.0",
"json": "^11.0.0",
"object-inspect": "^1.13.4",
"prettier": "^3.8.1",
"prettier-plugin-packagejson": "^3.0.2",
"pretty-bytes": "^7.1.0",
"pretty-format": "^30.3.0",
"replace-in-file": "^8.4.0",
"rimraf": "^6.1.3",
"rollup": "^4.60.1",
"stringify-object": "^6.0.0",
"ts-blank-space": "^0.8.0",
"tsc-alias": "^1.8.16",
"typescript": "^6.0.2",
"typescript-eslint": "^8.58.0",
"vitest": "~4.0.18"
}
}