TBD54566975 / tbdex-pfi-exemplar

4 stars 8 forks source link

Update `package.json` #17

Closed lamchau closed 8 months ago

lamchau commented 8 months ago
michaelneale commented 8 months ago

@lamchau what does the _debug do?

lamchau commented 8 months ago

@michaelneale it's an alias that just adds --enable-source-maps, so upon expansion it should be the equivalent of since the command -- <options> appends it to the very last command in the chain

# npm _debug expands to
npm run clean && 
  npm run compile && 
  node --enable-source-maps <args>

# where as npm _start expands to
npm run clean && 
  npm run compile && 
  node <args>

it does add yet another level of indirection but does make setting additional options easier (e.g. --debug_code or --debugger) for each example setup (something i used to test my refactoring)

what it looks like expanded on output

$ npm run example-issue-credential 'did:key:...'
> tbdex-mock-pfi@1.0.0 example-issue-credential
> npm run _debug -- dist/example/issue-credential.js did:key:...

> tbdex-mock-pfi@1.0.0 _debug
> npm run _start -- --enable-source-maps dist/example/issue-credential.js did:key:...

> tbdex-mock-pfi@1.0.0 _start
> npm run clean && npm run compile && node --enable-source-maps dist/example/issue-credential.js did:key:...

> tbdex-mock-pfi@1.0.0 clean
> rimraf dist

> tbdex-mock-pfi@1.0.0 compile
> tsc

(node:23534) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Copy this signed credential for later use:

<creds>