Giter Site home page Giter Site logo

node-module-lookup-amd's Introduction

Dependents

Gitter Package Control

Navigate front-end codebases in Sublime Text 2/3

For updates, follow @getDependents.

Currently supports JavaScript (AMD, CommonJS, and ES6) and CSS Preprocessor (Sass and Stylus) codebases.

  1. Installation
  2. Usage and Settings Details
  3. Bindings
  4. Reporting an Issue
  5. Contributing to Dependents

Installation

You can install Dependents via Package Control.

Don't see it? Try reinstalling Package Control. Alternatively, add the repository and install it:

  1. Package Control -> Add Repository
  2. Enter https://github.com/dependents/Dependents
  3. Package Control -> Install Package
  4. Choose Dependents

Nodejs Dependency

You must have Node.js installed on your system. Anything v0.10 and above is fine.

  • Note: The Node.js windows installer will add the install directory to the PATH variable but you must reboot to reload it.
NVM Users

NVM will install Nodejs outside of the standard binary location. If you encounter an error where your Node executable cannot be found, please override the node_path in User settings:

  • Preferences -> Package Settings -> Dependents -> Settings - User
{
  "node_path": "path/to/the/node/install/directory"
}
  • This will allow Dependents to find the Node binary for every codebase

Bindings

To more swiftly and conveniently trigger the package's commands both key and mouse bindings are provided.

Key bindings

By default, the following key bindings have been supplied:

OSX:

  • Jump to dependency: Command + Option + Right arrow
  • Find Dependents: Command + Option + Up arrow
  • Copy path to clipboard: Command + Shift + C

Windows and Linux:

  • Jump to dependency: Ctrl + Shift + Down arrow
  • Find Dependents: Ctrl + Shift + Up arrow

Mouse bindings

By default, the following key bindings have been supplied:

OSX:

  • Jump to dependency: Command + Option + Click on the dependency item
  • Find Dependents: Command + Shift + Click anywhere in document

Windows and Linux:

  • Jump to dependency: Ctrl + Alt + Click on the dependency item
  • Find Dependents: Ctrl + Shift + Click anywhere in document

Reporting an issue

You can get console logs via View -> Show Console.

Paste those logs into the body of your issue.

Feel free to chat with me on Gitter if you need help or ping me @mrjoelkemp.

License

(Creative Commons Attribution NoDerivs (CC-ND)](https://tldrlegal.com/license/creative-commons-attribution-noderivs-(cc-nd))

The no derivatives creative commons license is straightforward; you can take a work released under this license and re-distribute it but you can’t change it.

node-module-lookup-amd's People

Contributors

damiencassou avatar danez avatar dazinator avatar dependabot[bot] avatar harttle avatar lumnn avatar mrjoelkemp avatar pahen avatar realityking avatar xhmikosr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-module-lookup-amd's Issues

If the resolved partial is extensionless, then find a file like it

When you're importing templates or styles, it's incorrect to assume that they have the same extension as the file importing them.

Consumers shouldn't have to guard against this non-existent result.

  • Since we don't load require plugins, we don't know what the correct file extension should be.
    • The hogan loader hardcodes that it resolves .mustache files. We have no way of knowing that outside of the plugin.
  • Think about minified files that look like they're a real file (they have .min as an extension).
  • Do all partial resolutions result in a path without a file extension?

Update file-exists dependency to my fork..

Original author of file-exists dependency has been unresponsive to my PR: scottcorgan/file-exists#15

So I have had to create a fork of that dependency, with the support required to allow an alternative fs to be specified.

Need to update node-module-lookup-amd to switch to using this new package instead.

tests fail on node >= v12.16.0

I get the error below when running npm test. I verified with multiple node versions and it happens only on versions >= v12.16.0.
This issue happens also on projects that depend on this module, such as filling-cabinet.

➜  node-module-lookup-amd git:(master) ✗ npm test

> [email protected] test /Users/davidfirst/temp/projects/node-module-lookup-amd
> jscs index.js test bin && mocha test/test.js

/Users/davidfirst/temp/projects/node-module-lookup-amd/node_modules/requirejs/bin/r.js:1
(function (exports, require, module, __filename, __dirname) { #!/usr/bin/env node
                                                              ^

SyntaxError: Invalid or unexpected token
    at new Script (vm.js:88:7)
    at createScript (vm.js:263:10)
    at Object.runInThisContext (vm.js:311:10)
    at wrapSafe (internal/modules/cjs/loader.js:1058:15)
    at Module._compile (internal/modules/cjs/loader.js:1121:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
    at Module.load (internal/modules/cjs/loader.js:1001:32)
    at Function.Module._load (internal/modules/cjs/loader.js:900:14)
    at Module.require (internal/modules/cjs/loader.js:1043:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at /Users/davidfirst/temp/projects/node-module-lookup-amd/index.js:9:19
    at Object.<anonymous> (/Users/davidfirst/temp/projects/node-module-lookup-amd/index.js:258:4)

Modules not in the given directory should resolve correctly

/Users/jokemp/repos/behance/pro2-ui/node_modules/poet/vendor/BeFF/ractive/Model.js has the dep nbd/Model' but resolves to/Users/jokemp/repos/behance/pro2-ui/node_modules/poet/src/vendor/nbd/Model.jswhich should not havesrc`.

/src/../vendor/nbd/Model

Full logs:

DEBUG=* node /Users/jokemp/Library/Application\ Support/Sublime\ Text\ 3/Packages/Dependents/node_modules/filing-cabinet/bin/cli.js --filename=/Users/jokemp/repos/behance/pro2-ui/node_modules/poet/vendor/BeFF/ractive/Model.js --directory=src/ --config=/Users/jokemp/repos/behance/pro2-ui/node_modules/poet/config.js nbd/Model
  cabinet found a resolver for .js +0ms
  cabinet using amd resolver +27ms
  lookup given config:  +2ms /Users/jokemp/repos/behance/pro2-ui/node_modules/poet/config.js
  lookup given depPath:  +0ms nbd/Model
  lookup given filepath:  +0ms /Users/jokemp/repos/behance/pro2-ui/node_modules/poet/vendor/BeFF/ractive/Model.js
  lookup given directory:  +0ms src/
  lookup converting given config file to an object +11ms
  lookup normalized the trailing slash +0ms
  lookup baseUrl:  +0ms /src/
  lookup filepath without base /Users/jokemp/repos/behance/pro2-ui/node_modules/poet/vendor/BeFF/ractive/Model.js +0ms
  lookup trimming the filepath to /Users/jokemp/repos/behance/pro2-ui/node_modules/poet/vendor/BeFF/ractive/Model.js +1ms
  lookup stripping off the leading slash to Users/jokemp/repos/behance/pro2-ui/node_modules/poet/vendor/BeFF/ractive/Model.js +0ms
  lookup mapped filepath nbd/Model +0ms
  lookup pathed filepath /src/../vendor/nbd/Model +0ms
  lookup normalized path is /src/../vendor/nbd/Model +0ms
  lookup filepath was not within baseUrl +0ms
  lookup final normalized path is src/vendor/nbd/Model +1ms
src/vendor/nbd/Model

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.