Comparing version 4.4.0 to 5.0.0
131
package.json
{ | ||
"name": "os-paths", | ||
"version": "4.4.0", | ||
"version": "5.0.0", | ||
"description": "Generate portable common OS paths (home, temp, ...)", | ||
@@ -15,9 +15,13 @@ "license": "MIT", | ||
"files": [ | ||
"src/**/*", | ||
"dist/cjs", | ||
"dist/types", | ||
"CHANGELOG.mkd", | ||
"LICENSE", | ||
"README.md" | ||
"README.md", | ||
"package.json" | ||
], | ||
"main": "src/lib/index.js", | ||
"types": "src/lib/index.d.ts", | ||
"type": "commonjs", | ||
"main": "dist/cjs/index.js", | ||
"module": "dist/cjs/esm-wrapper/index.js", | ||
"types": "dist/types/index.d.ts", | ||
"keywords": [ | ||
@@ -32,2 +36,3 @@ "common", | ||
"node6", | ||
"node-v6", | ||
"osx", | ||
@@ -41,4 +46,13 @@ "path", | ||
"scripts": { | ||
"# coverage # calcuate and display (or send) code coverage [alias: 'cov']": "", | ||
"coverage": "run-s --silent _:max-node-8 && echo-cli \"[coverage] WARN Code coverage skipped [for NodeJS < v10]\" 1>&2 || run-s _:coverage", | ||
"# build # build/compile package": "", | ||
"build": "run-s _:regen:build", | ||
"build:cjs": "tsc -p tsconfig/tsconfig.cjs.json", | ||
"## 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", | ||
@@ -51,5 +65,5 @@ "cov:html": "nyc report --reporter=html", | ||
"fix": "run-s fix:*", | ||
"# fix:lint # fix `ESLint` issues": "", | ||
"# fix:lint # fix ESLint issues": "", | ||
"fix:lint": "eslint . --fix", | ||
"# fix:style # fix `Prettier` formatting issues": "", | ||
"# fix:style # fix Prettier formatting issues": "", | ||
"fix:style": "prettier . --write", | ||
@@ -59,30 +73,50 @@ "# help # display help": "", | ||
"# lint # check for package code 'lint'": "", | ||
"lint": "run-s --silent _:max-node-8 && echo-cli \"[lint] WARN Lint checks skipped [for NodeJS < v10]\" 1>&2 || run-p lint:*", | ||
"# lint:lint # check for code 'lint' (using `ESLint`)": "", | ||
"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:spell # check for spelling errors (using `cSpell`)": "", | ||
"# 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 # check for format imperfections (using `prettier`)": "", | ||
"lint:style": "prettier . --list-different", | ||
"# lint:types # check for type declaration errors (using `tsd`)": "", | ||
"lint:types": "tsd", | ||
"# 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 lint && run-p test:*", | ||
"test": "run-s _:regen:lint/build && run-p test:*", | ||
"# test:code # test package code": "", | ||
"test:code": "nyc --silent ava", | ||
"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 && echo-cli \"[update] info CHANGELOG updated\"", | ||
"_:coverage": "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);};\" || (echo-cli \"WARN `git-changelog` missing (try `go get -u github.com/rivy-go/git-changelog/cmd/git-changelog`)\" & exit 1)", | ||
"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 || (echo-cli \"[vcs] ERR! Uncommitted changes\" 1>&2 & exit 1)", | ||
"_: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 || (echo-cli \"[vcs] ERR! Uncommitted changes and/or untracked files\" 1>&2 & exit 1)", | ||
"_:update:changelog": "run-s --silent _:exists:git-changelog && git changelog > CHANGELOG.mkd || echo-cli \"[update] info CHANGELOG not updated\" 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 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);};\" || echo-cli \"[version] WARN CHANGELOG not updated\" 1>&2", | ||
"prepublishOnly": "run-s update:* test _:vcs-strictly-clean-err", | ||
"preversion": "run-s test", | ||
"version": "run-s _:version:update:changelog lint:spell && git add CHANGELOG.mkd" | ||
"_: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" | ||
}, | ||
@@ -92,2 +126,7 @@ "dependencies": {}, | ||
"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", | ||
@@ -99,6 +138,6 @@ "codecov": "^3.5.0", | ||
"cspell": "^4.1.2", | ||
"echo-cli": "^1.0.8", | ||
"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", | ||
@@ -108,8 +147,40 @@ "is-ci": "^2.0.0", | ||
"npm-run-all": "^4.1.5", | ||
"nyc": "^14.1.1", | ||
"nyc": "^15.1.0", | ||
"open-cli": "^6.0.1", | ||
"prettier": "^2.1.1", | ||
"tsd": "^0.13.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", | ||
@@ -116,0 +187,0 @@ "prettier": { |
@@ -7,4 +7,6 @@ <!DOCTYPE markdown><!-- markdownlint-disable no-inline-html --> | ||
<!-- markdownlint-disable heading-increment --> | ||
<!-- spell-checker:ignore (names) rivy Sindre sindresorhus Sorhus --> | ||
<!-- spell-checker:ignore (abbrev/jargon) CICD --> | ||
<!-- spell-checker:ignore (abbrev/jargon) CICD CJS ESM ESMs --> | ||
<!-- spell-checker:ignore (names) Deno --> | ||
<!-- spell-checker:ignore (targets) realclean --> | ||
<!-- spell-checker:ignore (people) rivy sindresorhus Sindre Sorhus --> | ||
@@ -31,2 +33,4 @@ # [os-paths](https://github.com/rivy/js.os-paths) | ||
npm install os-paths | ||
# or... `npm install github:rivy/js.os-paths` | ||
# or... `npm install "https://cdn.jsdelivr.net/gh/rivy/js.os-paths/dist/os-paths.tgz"` | ||
``` | ||
@@ -36,6 +40,8 @@ | ||
> | ||
> NodeJS >= 6.0 | ||
> NodeJS >= 6.0[^*] | ||
<!--{blockquote: .--info style="font-size:75%;"}--> | ||
[^*]: With the conversion to a TypeScript-based project, due to tooling constraints, testing is more difficult and more limited on Node platforms earlier than Node-v10+. However, the generated CommonJS/UMD project code is still fully compatible with Node-v6+. | ||
## Usage | ||
@@ -65,3 +71,3 @@ | ||
The object returned by the module constructor is an `OSPaths` function object, augmented with attached methods. When called directly (eg, `const p = osPaths()`), it returns a newly constructed `OSPaths` object. Since the `OSPaths` object contains no instance state, all constructed objects will be functionally identical. | ||
The object returned by the module constructor is a function object, `OSPaths`, augmented with attached methods. When this object is called directly (eg, `const p = osPaths()`), it returns another newly constructed `OSPaths` object. Since the `OSPaths` object contains no instance state, all constructed objects will be functionally identical. | ||
@@ -72,15 +78,18 @@ ### Methods | ||
The path strings are _not_ guaranteed to already exist on the file system. So, the user is responsible for directory construction, if/when needed. | ||
However, since all of these are _standard_ OS directories, they should all exist without the need for user intervention. | ||
The path strings are _not_ guaranteed to already exist on the file system. So, the user is responsible for directory construction, if/when needed. However, since all of these are _standard_ OS directories, they should all exist without the need for user intervention. | ||
If/when necessary, [`make-dir`](https://www.npmjs.com/package/make-dir) or [`mkdirp`](https://www.npmjs.com/package/mkdirp) can be used to create the directories. | ||
#### `osPaths.home(): string` | ||
#### `osPaths.home(): string | undefined` | ||
Returns the home directory for user | ||
- Returns the home directory for user (or `undefined`) | ||
`undefined` is returned if the home directory is not resolvable. | ||
#### `osPaths.temp(): string` | ||
Returns the directory for temporary files | ||
- Returns the directory for temporary files | ||
_Always_ returns a non-empty path (as sanely as possible). | ||
## Discussion | ||
@@ -94,2 +103,13 @@ | ||
[![Repository][repository-image]][repository-url] | ||
[![Build status][gha-image]][gha-url] | ||
[![Build status][travis-image]][travis-url] | ||
[![Build status][appveyor-image]][appveyor-url] | ||
[![Coverage status][coverage-image]][coverage-url] | ||
<br/> | ||
[![Quality status (CodeClimate)][codeclimate-image]][codeclimate-url] | ||
[![Quality status (CodeFactor)][codacy-image]][codacy-url] | ||
[![Quality status (CodeFactor)][codefactor-image]][codefactor-url] | ||
[![Quality status (Scrutinizer)][scrutinizer-image]][scrutinizer-url] | ||
### Build requirements | ||
@@ -120,15 +140,24 @@ | ||
build build/compile package | ||
clean remove build artifacts | ||
coverage calculate and display (or send) code coverage [alias: 'cov'] | ||
fix fix package issues (automated/non-interactive) | ||
fix:lint fix `ESLint` issues | ||
fix:style fix `Prettier` formatting issues | ||
fix:lint fix ESLint issues | ||
fix:style fix Prettier formatting issues | ||
help display help | ||
lint check for package code 'lint' | ||
lint:lint check for code 'lint' (using `ESLint`) | ||
lint:spell check for spelling errors (using `cSpell`) | ||
lint:style check for format imperfections (using `Prettier`) | ||
lint:types check for type declaration errors (using `tsd`) | ||
lint:lint check for code 'lint' (using `eslint`) | ||
lint:markdown check for markdown errors (using `remark`) | ||
lint:spell check for spelling errors (using `cspell`) | ||
lint:style check for format imperfections (using `prettier`) | ||
realclean remove all generated files | ||
rebuild clean and (re-)build project | ||
retest clean and (re-)test project | ||
reset:hard remove *all* generated files and reinstall dependencies | ||
test test package | ||
test:code test package code | ||
test:types test for type declaration errors (using `tsd`) | ||
update update/prepare for distribution | ||
update:changelog update CHANGELOG (using `git changelog ...`) | ||
update:dist update distribution content | ||
``` | ||
@@ -158,3 +187,3 @@ | ||
[repository-image]: https://img.shields.io/github/v/tag/rivy/js.os-paths?label=%E2%81%A3&logo=github&logoColor=white | ||
[repository-image]: https://img.shields.io/github/package-json/v/rivy/js.os-paths/master?label=%E2%81%A3&logo=github&logoColor=white | ||
[repository-url]: https://github.com/rivy/js.os-paths | ||
@@ -180,2 +209,10 @@ [license-image]: https://img.shields.io/npm/l/os-paths.svg?color=royalblue&style=flat | ||
[coverage-url]: https://codecov.io/gh/rivy/js.os-paths | ||
[codeclimate-url]: https://codeclimate.com/github/rivy/js.os-paths | ||
[codeclimate-image]: https://img.shields.io/codeclimate/maintainability/rivy/js.os-paths?label=codeclimate | ||
[codacy-image]: https://img.shields.io/codacy/grade/4fa161040bcd483890691190293ff950?label=codacy | ||
[codacy-url]: https://app.codacy.com/gh/rivy/js.os-paths/dashboard | ||
[codefactor-image]: https://img.shields.io/codefactor/grade/github/rivy/js.os-paths?label=codefactor | ||
[codefactor-url]: https://www.codefactor.io/repository/github/rivy/js.os-paths | ||
[scrutinizer-image]: https://img.shields.io/scrutinizer/quality/g/rivy/js.os-paths?label=scritunizer | ||
[scrutinizer-url]: https://scrutinizer-ci.com/g/rivy/js.os-paths | ||
@@ -182,0 +219,0 @@ <!-- Distributors/Registries --> |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50467
8
106
235
30
3
1