Package Exports
- sort-package-json-scripts
- sort-package-json-scripts/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sort-package-json-scripts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
README.md
a better sort package.json scripts, by default is follow npm lifecycle scriptsinstall
yarn add sort-package-json-scripts
yarn-tool add sort-package-json-scriptsimport sortPackageJsonScripts from 'sort-package-json-scripts';
let ret = sortPackageJsonScripts({
"lint": "npx eslint *.ts",
"npm:publish": "npm publish",
"prepublish:lockfile": "npx sync-lockfile .",
"tsc:esm": "tsc -p tsconfig.esm.json",
"ncu": "npx yarn-tool ncu -u",
"sort-package-json": "npx yarn-tool sort",
"test": "jest --coverage",
"coverage": "npx nyc yarn run test",
"test:mocha": "npx mocha --require ts-node/register \"!(node_modules)/*.{test,spec}.{ts,tsx}\"",
"tsc:default": "tsc -p tsconfig.json",
"prepublishOnly": "yarn run ncu && yarn run sort-package-json && yarn run test",
"postpublish_": "git commit -m \"chore(release): publish\" .",
})
console.log(ret)
/*
{
coverage: 'npx nyc yarn run test',
lint: 'npx eslint *.ts',
test: 'jest --coverage',
'test:mocha': 'npx mocha --require ts-node/register "!(node_modules)/*.{test,spec}.{ts,tsx}"',
'npm:publish': 'npm publish',
'prepublish:lockfile': 'npx sync-lockfile .',
prepublishOnly: 'yarn run ncu && yarn run sort-package-json && yarn run test',
postpublish_: 'git commit -m "chore(release): publish" .',
ncu: 'npx yarn-tool ncu -u',
'sort-package-json': 'npx yarn-tool sort',
'tsc:default': 'tsc -p tsconfig.json',
'tsc:esm': 'tsc -p tsconfig.esm.json'
}
*/