hapipal / hpal-debug Goto Github PK
View Code? Open in Web Editor NEWhapijs debugging tools for the hpal CLI
License: MIT License
hapijs debugging tools for the hpal CLI
License: MIT License
Now that we're all tested on hapi v20 and node v14, it's time to look ahead.
I tried to run the test locally but I get this error when I do:
> [email protected] test /home/jpauthier/workspace/hpal-debug
> lab -a @hapi/code -t 100 -L -I "FinalizationRegistry,WeakRef"
Error requiring file: /home/jpauthier/workspace/hpal-debug/test/closet/repl/pal-plugins/server.js
Cannot find module 'joi'
Require stack:
- /home/jpauthier/workspace/hpal-debug/node_modules/schwifty/lib/index.js
- /home/jpauthier/workspace/hpal-debug/test/closet/repl/pal-plugins/server.js
- /home/jpauthier/workspace/hpal-debug/node_modules/@hapi/lab/lib/cli.js
- /home/jpauthier/workspace/hpal-debug/node_modules/@hapi/lab/bin/lab
Error: Cannot find module 'joi'
Require stack:
- /home/jpauthier/workspace/hpal-debug/node_modules/schwifty/lib/index.js
- /home/jpauthier/workspace/hpal-debug/test/closet/repl/pal-plugins/server.js
- /home/jpauthier/workspace/hpal-debug/node_modules/@hapi/lab/lib/cli.js
- /home/jpauthier/workspace/hpal-debug/node_modules/@hapi/lab/bin/lab
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:965:15)
at Function.Module._load (internal/modules/cjs/loader.js:841:27)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/jpauthier/workspace/hpal-debug/node_modules/schwifty/lib/index.js:6:13)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.require.extensions.<computed> [as .js] (/home/jpauthier/workspace/hpal-debug/node_modules/@hapi/lab/lib/coverage.js:127:28)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/jpauthier/workspace/hpal-debug/test/closet/repl/pal-plugins/server.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.require.extensions.<computed> [as .js] (/home/jpauthier/workspace/hpal-debug/node_modules/@hapi/lab/lib/coverage.js:127:28)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at /home/jpauthier/workspace/hpal-debug/node_modules/@hapi/lab/lib/cli.js:134:13
at Array.forEach (<anonymous>)
at Object.internals.traverse (/home/jpauthier/workspace/hpal-debug/node_modules/@hapi/lab/lib/cli.js:128:15)
at Object.exports.run (/home/jpauthier/workspace/hpal-debug/node_modules/@hapi/lab/lib/cli.js:61:31)
at main (/home/jpauthier/workspace/hpal-debug/node_modules/@hapi/lab/bin/lab:56:48)
at Object.<anonymous> (/home/jpauthier/workspace/hpal-debug/node_modules/@hapi/lab/bin/lab:60:1)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Function.Module._load (internal/modules/cjs/loader.js:878:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47
npm ERR! Test failed. See above for more details.
The problem seems to be coming from Schwifty. In the lib/index.js
we require('joi')
but joi
is a devDependency
and @hapi/joi@16
is in the dependencies
section. That way I guess it works when running Schwifty from the repo itself. I believe devDeps are not installed when installing a package dependency from NPM and as hpal-debug does not have joi in its dependencies but rather joi-17
joi is nowhere to be found in the dependency tree thus it breaks when running hpal-debug
tests.
The next major version of all packages in the org will be published under the @hapipal scope on npm. This module will be published as @hapipal/hpal-debug.
Schwifty models and schmervice services should be accessible without needing to call server.models()
and server.services()
.
Piping the output of routes
and curl
can fail since stdout no longer has a columns
property.
We currently have a compatibility layer in hpal-debug's hpal run debug:curl
to create CLI flags from route validation for both joi v15 and joi v16+. The next version of hpal-debug targets joi v17+ and will degrade gracefully for older versions of joi. Technically this should cover joi v16 too, though official support is for joi v17+.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.