browserify / browserify/static-module
Transform which ran with v1 not working with v3
- Dominant language
- JavaScript
- Stars
- 75
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
Hi! [cwise](https://github.com/scijs/cwise) has had some long-running issues/PRs to upgrade its usage of static-module and get rid of some security warnings, but it seems that the particular usage static-module is no longer functioning under static-module 3.*.
The [cwise transform](https://github.com/scijs/cwise/blob/master/lib/cwise-transform.js) finds references to `var cwise = require('cwise'); cwise({...})` and replaces them with evaluated code.
I'm guessing a bit, but it seems like maybe the usage as a bare function require as opposed to properties on the require (i.e. `require('cwise')(...)` as opposed to `require('fs).readFileSync(...)`) are not working.
FWIW, the transform has not changed and so _does_ still function and get triggered correctly.
I've detailed a test case [here](https://github.com/scijs/cwise/pull/25#issuecomment-442942342).
Glad to debug a bit further, but I'd thought I'd check to see if this might just need a small API usage update instead of involved debugging. Thanks!
/cc @archmoj @etpinard
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with lib/cwise-transform.js and the test case described in cwise pull request #25, then compare how the transform handles the bare function require under static-module 3. Confirm whether the transform still triggers and identify the relevant static-module API behavior. Done means the linked cwise case works with static-module 3 without security warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100