xdg-app-paths
v7.1.0 appdir application cache common config cross-platform data directory environment and 18 more...
# build # build/compile package
build
run-s --silent "build:*"
build:cjs
exec-if-updated --source package.json --source tsconfig.json --source "tsconfig/**" --source "rollup.*.config.js" --source "src/**" --target build/.targets/build-cjs.succeeded "run-s -n rebuild:cjs"
build:esm
exec-if-updated --source package.json --source tsconfig.json --source "tsconfig/**" --source "rollup.*.config.js" --source "src/**" --target build/.targets/build-esm.succeeded "run-s -n rebuild:esm"
build:umd
exec-if-updated --source package.json --source tsconfig.json --source "tsconfig/**" --source "rollup.*.config.js" --source "src/**" --target build/.targets/build-umd.succeeded "run-s -n rebuild:umd"
build:testbed
exec-if-updated --source package.json --source tsconfig.json --source "tsconfig/**" --source "rollup.*.config.js" --source "src/**" --target build/.targets/build-tests.succeeded "run-s -n rebuild:testbed"
build:types
exec-if-updated --source package.json --source tsconfig.json --source "tsconfig/**" --source "rollup.*.config.js" --source "src/**" --target build/.targets/build-types.succeeded "run-s -n rebuild: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
dist
run-s update
# 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
run-s --silent _:help
# 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 --print-name "lint:*"
# lint:commits # check for commit flaws (using `commitlint` and `cspell`)
lint:commits
run-s --silent _:v_tag:missing || run-p --silent "_:lint:commits.new:*"
# lint:editorconfig # check for EditorConfig format flaws (using `editorconfig-checker`)
lint:editorconfig
editorconfig-checker -disable-max-line-length -exclude "(build|dist|vendor)/.*"
# 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 --config ".vscode/cspell.json"
# 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
# rebuild:all # clean and fully reconstruct project distribution
rebuild:all
run-s clean update
rebuild:cjs
shx rm -fr build/cjs && tsc -p tsconfig/tsconfig.cjs.json && shx cp -r src/esm-wrapper build/cjs/src && shx mkdir -p build/.targets && shx touch build/.targets/build-cjs.succeeded
rebuild:esm
shx rm -fr build/esm && tsc -p tsconfig/tsconfig.esm.json && shx cp src/esm-wrapper/package.json build/esm/src && shx mkdir -p build/.targets && shx touch build/.targets/build-esm.succeeded
rebuild:umd
shx rm -fr build/umd && tsc -p tsconfig/tsconfig.umd.json && shx mkdir -p build/.targets && shx touch build/.targets/build-umd.succeeded
rebuild:testbed
shx rm -fr build/testbed && tsc -p tsconfig/tsconfig.testbed.json && shx cp -r src/esm-wrapper build/testbed/src && shx mkdir -p build/.targets && shx touch build/.targets/build-tests.succeeded
rebuild:types
shx rm -fr build/types && tsc -p tsconfig/tsconfig.types.json && shx mkdir -p build/.targets && shx touch build/.targets/build-types.succeeded
# 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
# show:deps # show package dependencies
show:deps
run-s --silent _:show:deps:prod _:show:deps:dev || shx true
# test # test package
test
run-s --silent lint update:dist && run-p test:*
# test:code # test package code
test:code
run-s --silent +:max-node-8 && ava || ( run-s --silent +:min-node-10 && 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 [alias: 'dist']
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 --silent build && exec-if-updated --source "build/**" --target "dist/**" --target dist/.targets/update-dist.succeeded "run-s --silent _:update:dist:rebuild"
## +:... == sub-scripts (may run 'visibly', but not user-facing)
+:coverage
run-s build test:code && is-ci && run-s cov:send || run-s cov:view
+:max-node-8
is-node-not-modern 10
+:min-node-10
is-node-modern 10
## _:... == sub-scripts ('hidden'; generally should be run 'silently' using `run-s/run-p --silent ...`
_: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 )
_: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\` or \`npx run-s 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:commits.all:spell
node -e "result=require('child_process').spawnSync('git log --color=never | cspell stdin --no-summary --config ".vscode/cspell.json"',{shell:true,encoding:'utf-8'}); if (result.status != 0) {console.error('[cspell] ERR! Unknown words in commit(s)\n'+result.stdout+'\n'+result.stderr); process.exit(1);} else {console.log(result.stdout);};"
_:lint:commits.new:commitlint
node -e "v=require('./package.json').version; result=require('child_process').spawnSync('commitlint --config .commitlint.config.js --from v'+v,{shell:true,encoding:'utf-8'}); if (result.status != 0) {console.error('[commitlint] ERR! Flawed commit(s) found\n'+result.stdout+'\n'+result.stderr); process.exit(1);} else {console.log(result.stdout);};"
_:lint:commits.new:spell
node -e "v=require('./package.json').version; result=require('child_process').spawnSync('git log v'+v+'.. --color=never | cspell stdin --no-summary --config ".vscode/cspell.json"',{shell:true,encoding:'utf-8'}); if (result.status != 0) {console.error('[cspell] ERR! Unknown words in commit(s)\n'+result.stdout+'\n'+result.stderr); process.exit(1);} else {console.log(result.stdout);};"
_:show:deps:dev
npm --silent ls --only development || shx true
_:show:deps:prod
npm --silent ls --only production || shx true
_: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 )
_:v_tag:exists
node -e "v=require('./package.json').version; result=require('child_process').spawnSync('git rev-list refs/tags/v'+v,{shell:true,encoding:'utf-8'}); if (result.status != 0) {console.error('[lint] WARN Missing commit tag v'+v); process.exit(1);}"
_:v_tag:missing
run-s --silent _:v_tag:exists && exit 1 || exit 0
_:update:changelog
run-s --silent _:exists:git-changelog && git changelog > CHANGELOG.mkd || shx echo "[update] WARN CHANGELOG not updated" 1>&2
_:update:dist.build
shx rm -fr dist/cjs dist/esm && shx mkdir -p dist/cjs dist/esm && shx cp -r build/cjs/src/* dist/cjs && shx cp -r build/esm/src/* dist/esm
_:update:dist.normalizeEOL
eolConverter lf dist/**/*.{cjs,js,mjs,ts,json}
_:update:dist.pack
node -e "delete process.env.NPM_CONFIG_DRY_RUN; name=require('./package.json').name; result=require('child_process').spawnSync('npm pack && shx mkdir -p dist && shx mv '+name+'-*.tgz dist/'+name+'.tgz',{shell:true,encoding:'utf-8'}); if (result.status != 0) {console.error('[update] ERR! Unable to package (into *.tgz) for distribution\n'+result.stdout+'\n'+result.stderr); process.exit(1);} else {console.log(result.stdout);};"
_:update:dist.types
shx mkdir -p dist && shx rm -fr dist/types && rollup --config .rollup.config.types.js && shx mkdir -p dist/cjs && shx cp dist/types/*.cjs.d.ts dist/cjs
_:update:dist:rebuild
shx rm -fr dist && run-s --silent _:update:dist.build _:update:dist.types _:update:dist.normalizeEOL _:update:dist.pack && shx mkdir -p dist/.targets && shx touch dist/.targets/update-dist.succeeded
_:version:spell:changelog_update
run-s --silent _:exists:git-changelog && git changelog -u | cspell stdin --config ".vscode/cspell.json" || shx echo "[lint] WARN CHANGELOG update `cspell` exception" 1>&2
_: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-now --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
## npm lifecycle scripts ##
prepublishOnly
npm run clean && npm run test --test-dist && run-s --silent update _:vcs-strictly-clean-err
## npm-version scripts ##
preversion
run-s --silent _:version:spell:changelog_update && npm run test --test-dist
version
run-s --silent _:version:update:changelog && run-s lint:spell && run-s --silent update:dist && git add CHANGELOG.mkd dist