Code Monkey home page Code Monkey logo

jspm-resolve's Introduction

JSPM CLI

JSPM CLI is the package management of the JSPM project, supporting import map package management.

Getting Started | Documentation | FAQ


  • Resolution against node_modules for local development workflows.
  • Versioned, locked dependency management against the local package.json.
  • Tracing and installing the full dependency tree of an application.
  • Complete NPM-like module resolution that supports conditional environments and package entry points.
  • Support for a wide range of CDNs, such as jspm.io, jsDeliver, esm.sh and unpkg.
  • Import map extraction/injection into HTML files, with module preloading and integrity attributes.

See the documentation and getting started guide on jspm.org.

Contributing

Build and test workflows use Chomp.

License

Apache-2.0

jspm-resolve's People

Contributors

fusionstrings avatar guybedford avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jspm-resolve's Issues

exports support

Now that this is implemented in Node.js --experimental-modules we should be able to support package.json "exports". Once we have "aliases", we should be able to deprecate "map" for "exports" and "aliases".

One hard thing will be supporting the "browser" field properly under this model. It's still debateable whether the "browser" field object form should support mapping modules if we have differential exports and aliases. Perhaps "map" can remain the greater abstraction, or perhaps we can directly unify on a "browser" desugar into aliasing and exports.

Convert algorithm and spec to path space

Rather just handle URL space as a encodeURI step at the end to store in the registry.

This will improve performance, as with cases like relative maps we end up encoding and decoding URIs multiple times which is just plain silly.

Wrong module resolution

Could be related with #10 .
Following is a simple reproduction
https://github.com/fusionstrings/jspm-resolve-test
https://glitch.com/~jspm-resolve-test

Here https://github.com/fusionstrings/jspm-resolve-test/blob/master/test.js I am trying to get resolved module type and despite being package.json.type : "module", /module.js is resolving to commonjs and missing module is not throwing error.

Based on my understanding is type is set to "module" it should resolve to js files as module.

Cache coalescing

For the async case, the cache should be awaited on, with promises stored in it.

Map config verification

Map configuration should be verified according to the rules in the apply_map spec. This verifyMap function could either be applied in the main resolver after packageResolve, or it could be delegated to packageResolve. verifyMap should be shared as a lib if delegated, otherwise at least hookable for the exception cases.

Remove relativeFallback

This seems a bad idea in retrospect, would be better to leave to be handled externally again, and remove this.

Custom exists hook

Would be nice to be able to abstract from fs with a custom fileExists hook.

Extensions option

It would be useful for eg TypeScript workflows to be able to add custom extensions to the list through a resolver option.

For example to extend with .ts, .tsx, d.ts, .js, and .jsx.

It's worth also considering if TypeScript precedence before js would be important here or not.

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.