/
package.json
213 lines (213 loc) · 8.59 KB
/
package.json
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
{
"name": "os-paths",
"version": "5.0.0",
"description": "Generate portable common OS paths (home, temp, ...)",
"license": "MIT",
"repository": "rivy/js.os-paths",
"author": {
"name": "Roy Ivy III",
"email": "rivy.dev@gmail.com"
},
"engines": {
"node": ">= 6.0"
},
"files": [
"dist/cjs",
"dist/types",
"CHANGELOG.mkd",
"LICENSE",
"README.md",
"package.json"
],
"type": "commonjs",
"main": "dist/cjs/index.js",
"module": "dist/cjs/esm-wrapper/index.js",
"types": "dist/types/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": [
{
"import": "./dist/cjs/esm-wrapper/index.js",
"require": "./dist/cjs/index.js",
"types": "./dist/types/index.d.ts"
},
"./dist/cjs/index.js"
]
},
"keywords": [
"common",
"cross-platform",
"directory",
"environment",
"linux",
"mac",
"macos",
"node6",
"node-v6",
"osx",
"path",
"paths",
"portable",
"unix",
"windows"
],
"scripts": {
"# build # build/compile package": "",
"build": "run-s _:regen:build",
"build:cjs": "tsc -p tsconfig/tsconfig.cjs.json",
"build:cjs/esm": "shx mkdir -p build/cjs && shx cp -r src/esm-wrapper build/cjs",
"## build:esm * [2020-12-22; rivy] TS compiles to ESMs are broken due to extension mishandling (use `rollup`)": "tsc -p tsconfig/tsconfig.esm.json",
"build:umd": "tsc -p tsconfig/tsconfig.umd.json",
"build:tests": "tsc -p tsconfig/tsconfig.tests.json",
"build:types": "tsc -p tsconfig/tsconfig.types.json && run-s _:update:dist.types",
"# clean # remove build artifacts": "",
"clean": "rimraf build dist",
"# coverage # calculate and display (or send) code coverage [alias: 'cov']": "",
"coverage": "run-s --silent _:max-node-8 && shx echo \"[coverage] WARN Code coverage skipped [for NodeJS < v10]\" 1>&2 || run-s _:coverage",
"cov": "run-s coverage",
"cov:html": "nyc report --reporter=html",
"cov:send": "nyc report --reporter=text-lcov | codecov --disable=gcov --pipe",
"cov:text": "nyc report",
"cov:view": "run-s cov:html && cd coverage && open-cli index.html",
"# fix # fix package issues (automated/non-interactive)": "",
"fix": "run-s fix:*",
"# fix:lint # fix ESLint issues": "",
"fix:lint": "eslint . --fix",
"# fix:style # fix Prettier formatting issues": "",
"fix:style": "prettier . --write",
"# help # display help": "",
"help": "< package.json node -e \"s = {p:'',e:'npm'}; if (new String(process.env.npm_execpath).match(/yarn.js$/)) { s = {p:'\\n',e:'yarn'}; }; console.log('%susage: \\`%s run TARGET [TARGET..]\\`\\n\\nTARGETs:\\n', s.p, s.e); re = /^.*?\\x22(?:\\W+\\s*)([^#\\x22]+)\\s+#+\\s+([^#\\x22]+?)(\\s+#+)?\\x22.*$/; require('readline').createInterface({ input: process.stdin, output: process.stdout, terminal: false }).on('line', function(line){ if (match = re.exec(line)) { console.log('%s %s', match[1].padEnd(19), match[2]); } });\"",
"# lint # check for package code 'lint'": "",
"lint": "run-s --silent _:max-node-8 && shx echo \"[lint] WARN Lint checks skipped [for NodeJS < v10]\" 1>&2 || run-p lint:*",
"# lint:lint # check for code 'lint' (using `eslint`)": "",
"lint:lint": "eslint .",
"# lint:markdown # check for markdown errors (using `remark`)": "",
"lint:markdown": "remark --quiet .",
"# lint:spell # check for spelling errors (using `cspell`)": "",
"lint:spell": "cspell {eg,examples,src,test}/**/* CHANGELOG{,.md,.mkd} README{,.md,.mkd} --no-summary",
"# lint:style # check for format imperfections (using `prettier`)": "",
"lint:style": "prettier . --list-different",
"# realclean # remove all generated files": "",
"realclean": "run-s clean && rimraf coverage .nyc_output",
"# rebuild # clean and (re-)build project": "",
"rebuild": "run-s clean build",
"# retest # clean and (re-)test project": "",
"retest": "run-s clean test",
"# reset:hard # remove *all* generated files and reinstall dependencies": "",
"reset:hard": "git clean -dfx && git reset --hard && npm install",
"# test # test package": "",
"test": "run-s _:regen:lint/build && run-p test:*",
"# test:code # test package code": "",
"test:code": "run-s --silent _:max-node-8 && (ava || exit 1) || nyc --silent ava",
"# test:types # test for type declaration errors (using `tsd`)": "",
"test:types": "run-s --silent _:max-node-8 && shx echo \"[test:types] WARN Type testing skipped [for NodeJS < v10]\" 1>&2 || tsd",
"# update # update/prepare for distribution": "",
"update": "run-s update:changelog update:dist",
"# update:changelog # update CHANGELOG (using `git changelog ...`)": "",
"update:changelog": "run-s --silent _:update:changelog && (git diff --quiet --exit-code CHANGELOG.mkd || shx echo \"[update] info CHANGELOG updated\")",
"# update:dist # update distribution content": "",
"update:dist": "run-s _:regen:build _:update:dist",
"_:coverage": "run-s _:regen:build+test:code && is-ci && run-s cov:send || run-s cov:view",
"_:exists:git-changelog": "node -e \"if (!require('command-exists').sync('git-changelog')){process.exit(1);};\" || (shx echo \"WARN `git-changelog` missing (try `go get -u github.com/rivy-go/git-changelog/cmd/git-changelog`)\" & exit 1)",
"_:max-node-8": "is-node-not-modern 10",
"_:min-node-10": "is-node-modern 10",
"_:regen:build": "run-p \"build:*\"",
"_:regen:build+test:code": "run-p \"build:*\" && run-s test:code",
"_:regen:lint/build": "run-s lint \"_:regen:build\"",
"_:vcs-clean": "git diff --quiet",
"_:vcs-clean-err": "run-s --silent _:vcs-clean || (shx echo \"[vcs] ERR! Uncommitted changes\" 1>&2 & exit 1)",
"_:vcs-strictly-clean": "git status --porcelain | node -e \"process.stdin.on('data',function(_){process.exit(1);});\"",
"_:vcs-strictly-clean-err": "run-s --silent _:vcs-strictly-clean || (shx echo \"[vcs] ERR! Uncommitted changes and/or untracked files\" 1>&2 & exit 1)",
"_:update:changelog": "run-s --silent _:exists:git-changelog && git changelog > CHANGELOG.mkd || shx echo \"[update] WARN CHANGELOG not updated\" 1>&2",
"_:update:dist": "run-s _:update:dist.build && npm pack && shx mv os-paths-*.tgz dist/os-paths.tgz",
"_:update:dist.build": "shx mkdir -p dist && shx cp -r build/cjs build/types dist",
"_:update:dist.types": "shx mkdir -p dist && shx cp -r build/types dist",
"_:version:update:changelog": "run-s --silent _:exists:git-changelog && node -e \"v=require('./package.json').version; result=require('child_process').spawnSync('git changelog --next-tag v'+v,{shell:true,encoding:'utf-8'}); if (result.status != 0) {console.error('ERR! '+result.stderr); process.exit(1);} else {require('fs').writeFileSync('CHANGELOG.mkd',result.stdout);};\" || shx echo \"[version] WARN CHANGELOG not updated\" 1>&2",
"prepublishOnly": "run-s test _:update:dist.build _:vcs-strictly-clean-err",
"preversion": "run-s test update _:vcs-strictly-clean-err",
"version": "run-s _:version:update:changelog lint:spell _:update:dist && git add CHANGELOG.mkd dist"
},
"dependencies": {},
"devDependencies:#": "* for testing, Node-v6 requires ava < v2 and nyc < v15",
"devDependencies": {
"@ava/typescript": "^1.1.1",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/node": "^14.14.14",
"@typescript-eslint/eslint-plugin": "^4.0.1",
"@typescript-eslint/parser": "^4.0.1",
"ava": "^1.4.1",
"codecov": "^3.5.0",
"command-exists": "^1.2.9",
"coveralls": "^3.0.5",
"cross-spawn": "^6.0.5",
"cspell": "^4.1.2",
"eslint": "^7.11.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-functional": "^3.0.2",
"eslint-plugin-import": "^2.22.0",
"is-ci": "^2.0.0",
"is-node-modern": "^1.0.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"open-cli": "^6.0.1",
"prettier": "^2.1.1",
"remark-cli": "^9.0.0",
"remark-footnotes": "^3.0.0",
"remark-preset-lint-recommended": "^5.0.0",
"rimraf": "^3.0.2",
"shx": "^0.3.3",
"ts-node": "^9.0.0",
"tsd": "^0.13.1",
"typescript": "^4.1.3"
},
"optionalDependencies": {},
"ava": {
"typescript": {
"rewritePaths": {
"src/": "build/cjs+tests/"
}
}
},
"nyc": {
"extends": "@istanbuljs/nyc-config-typescript",
"exclude": [
"eg/**",
"test/**",
"**/*.spec.js",
"**/*.test.js",
"**/*.spec.ts",
"**/*.test.ts"
],
"reporter": [
"html",
"text"
],
"lines": "100",
"branches": "96",
"statements": "100"
},
"prettier # overrides/[*.markdown]/tabWidth": "// set to 4 when https://github.com/prettier/prettier/issues/5019 is fixed",
"prettier": {
"printWidth": 100,
"singleQuote": true,
"useTabs": true,
"tabWidth": 2,
"overrides": [
{
"files": [
"*.md",
"*.mkd",
"*.markdown"
],
"options": {
"tabWidth": 2,
"useTabs": false
}
}
]
},
"tsd": {
"directory": "test"
}
}