|
| 1 | +# I like using `just` instead of `npm run` or `yarn`. |
| 2 | +# If you're like me, this justfile is for you. |
| 3 | +# If you are not, you can safely ignore this file. |
| 4 | + |
| 5 | +set positional-arguments |
| 6 | +export PATH := justfile_directory() + "/node_modules/.bin:" + env_var('PATH') |
| 7 | + |
| 8 | +default: test-local |
| 9 | + |
| 10 | +regenerate: |
| 11 | + #!/usr/bin/env sh |
| 12 | + node -e ' |
| 13 | + const fs = require("fs"); |
| 14 | + let acc = fs.readFileSync("justfile", "utf8").replace(/(# CUT\n)[\s\S]+/, "$1\n"); |
| 15 | + for(const [key, value] of Object.entries(require("./package.json").scripts)) { |
| 16 | + acc += `${key} *ARGS:\n ${value.replace(/npm run /g, "just ").replace(/ --$/, "")} "$@"\n`; |
| 17 | + } |
| 18 | + fs.writeFileSync("justfile", acc); |
| 19 | + ' |
| 20 | + |
| 21 | +install: |
| 22 | + npm install |
| 23 | + |
| 24 | +# EVERYTHING BELOW THIS LINE IS AUTO-GENERATED FROM PACKAGE.JSON |
| 25 | +# DO NOT MODIFY BY HAND |
| 26 | + |
| 27 | +# CUT |
| 28 | + |
| 29 | +lint *ARGS: |
| 30 | + prettier --check . "$@" |
| 31 | +lint-fix *ARGS: |
| 32 | + prettier --write . "$@" |
| 33 | +clean *ARGS: |
| 34 | + rimraf dist tsconfig.schema.json tsconfig.schemastore-schema.json tsconfig.tsbuildinfo tests/ts-node-packed.tgz "$@" |
| 35 | +rebuild *ARGS: |
| 36 | + just clean && just build "$@" |
| 37 | +build *ARGS: |
| 38 | + just build-nopack && just build-pack "$@" |
| 39 | +build-nopack *ARGS: |
| 40 | + just build-tsc && just build-configSchema "$@" |
| 41 | +build-tsc *ARGS: |
| 42 | + tsc "$@" |
| 43 | +build-configSchema *ARGS: |
| 44 | + typescript-json-schema --topRef --refs --validationKeywords allOf --out tsconfig.schema.json tsconfig.build-schema.json TsConfigSchema && node --require ./register ./scripts/create-merged-schema "$@" |
| 45 | +build-pack *ARGS: |
| 46 | + node ./scripts/build-pack.js "$@" |
| 47 | +test-spec *ARGS: |
| 48 | + ava "$@" |
| 49 | +test-cov *ARGS: |
| 50 | + nyc ava "$@" |
| 51 | +test *ARGS: |
| 52 | + just build && just lint && just test-cov "$@" |
| 53 | +test-local *ARGS: |
| 54 | + just lint-fix && just build-tsc && just build-pack && just test-spec "$@" |
| 55 | +pre-debug *ARGS: |
| 56 | + just build-tsc && just build-pack "$@" |
| 57 | +coverage-report *ARGS: |
| 58 | + nyc report --reporter=lcov "$@" |
| 59 | +prepare *ARGS: |
| 60 | + just clean && just build-nopack "$@" |
| 61 | +api-extractor *ARGS: |
| 62 | + api-extractor run --local --verbose "$@" |
| 63 | +esm-usage-example *ARGS: |
| 64 | + just build-tsc && cd esm-usage-example && node --experimental-specifier-resolution node --loader ../esm.mjs ./index "$@" |
| 65 | +esm-usage-example2 *ARGS: |
| 66 | + just build-tsc && cd tests && TS_NODE_PROJECT=./module-types/override-to-cjs/tsconfig.json node --loader ../esm.mjs ./module-types/override-to-cjs/test.cjs "$@" |
0 commit comments