import-js

A tool to simplify importing JS modules

MIT License

Downloads
1.2K
Stars
525
Committers
31

Bot releases are hidden (Show)

import-js - v6.0.0 Latest Release

Published by lencioni 4 months ago

What's Changed

Breaking

Features

Other

New Contributors

Full Changelog: https://github.com/Galooshi/import-js/compare/v5.1.0...v6.0.0

import-js - v5.1.0

Published by lencioni 9 months ago

Features

  • Configuration to also look for .importjs.cjs and .importjs.mjs (#589, thanks @mikabytes!)

Dev

  • Updated eslint dependencies
import-js -

Published by trotzig almost 3 years ago

Breaking changes:

  • importjsd command has been removed. Use importjs instead.

Other changes:

  • Updated sqlite to v5. This fixes installation issues (see #574)
import-js -

Published by trotzig almost 5 years ago

This release contains a bug fix for files using array destructuring with omitted variables. E.g.

const [, bar] = foo();

Before this release, we would throw an error when parsing this code.

import-js -

Published by trotzig almost 5 years ago

Fix missing @babel/runtime dependency in published npm lib.

import-js -

Published by trotzig almost 5 years ago

The main breaking change in this release is that we no longer officially support Node v6 and v7. We've also updated @babel dependencies, which could also cause different behavior (plus fix a few bugs).

New feature:
If you don't have a package.json file in your project, you can drop an .importjs-root file in the root of the project to indicate to import-js where to resolve imports from. (#547 by @mikabytes)

import-js - v3.2.0

Published by trotzig about 6 years ago

Adds support for isRoot in package.json files. From the README:

Specifying alternate package directory

ImportJS looks for the package.json file in the closest ancestor directory for the file you're editing to find node modules to import. However, sometimes it might pull dependencies from a directory further up the chain. For example, your directory structure might look like this:

.
|-- package.json
|-- components
|     |-- button.js
|     |-- icon.js
|-- node_modules
|     |-- react
|-- subpackage
|     |-- package.json
|     |-- components
|           |-- bulletin.js

If you were to use ImportJS on subpackage/components/bulletin.js which imports React, ImportJS would not know that react is a valid dependency.

To tell ImportJS to skip a directory and keep searching upwards to find the root package directory, specify "importjs": { "isRoot": false } in the package.json of the directory to ignore. In this case, you would want something like this:

{
  "name": "subpackage",
  ...
  "importjs": {
    "isRoot": false
  }
}
import-js - v3.1.1

Published by trotzig about 6 years ago

This patch release should fix issues people have been seeing related to a 'decorators' plugin.

import-js - v3.1.0

Published by trotzig about 6 years ago

This version adds support for Typescript files. As a result of that, we're now also on Babel 7. Even though this is a big change for the project, we believe it should be backwards compatible. That's why this version is a minor version bump and not a major.

import-js - v3.0.0

Published by trotzig over 6 years ago

Breaking changes:

  • Drop support for Node v4 and v5.

(hopefully) Non-breaking changes:

  • Add util to node environment's namedExports
  • Upgrade to sqlite3 v4

Bug fixes:

  • Resolving "toString" name causes a crash (0024cdc)
import-js - v2.10.1

Published by trotzig over 6 years ago

Thanks to @kahless for helping out in getting this patch release ready.

Changes

  • Un-deprecate namedExports config option. It has become clear that it's hard to make every usecase detected automatically. Instead of confusing people with a useful config option being removed soon, we should just keep supporting it. I don't see it going away any time soon anyway.
  • Fix incorrectly treating deconstructed variables with a custom name as undefined.
import-js - v2.10.0

Published by trotzig almost 7 years ago

  • add danglingCommas option
  • add emptyLinesBetweenGroups option
import-js - v2.9.0

Published by trotzig almost 7 years ago

import-js - v2.8.0

Published by trotzig almost 7 years ago

  • Allow global config in home directory (5fba7f5 by @TrySound)
import-js - v2.7.1

Published by trotzig about 7 years ago

  • Fixes to make goto more robust
import-js - v2.7.0

Published by trotzig about 7 years ago

Changes:

  • Support flow type imports (including finding the exports) (@rndmerle)
  • Improve messaging when imports are added
  • Update Meteor environment to support api.mainModule (@coagmano)
  • Allow coexistence of homonymous named and default exports in same module (@rndmerle) (requires updates to editor plugins, which will come later)
  • Take variable hoisting into account when finding undefined variables
  • Add sortImports to known configuration options (@dabbott)
import-js - v2.6.0

Published by lencioni over 7 years ago

  • Add sortImports option to enable or disable import sorting
  • Added support for:
    • Recursive export from file export * from './foo'
    • namespace exports export * as ns from './foo' (uses babylon exportExtensions plugin)
    • Renaming as default export { foo, bar as default }
    • Renaming during destructure export const { foo, bar: baz } = someObject
    • Default values export const { foo, bar = {a:1, b:2} } = someObject
    • Rename during destructure with defaults:
      export const {
        foo,
        bar: baz = {a: 1, b: 2}
      } = someObject
      
    • Rest parameter export const { foo, ...bar } = someObject
    • Array destructure export const [ foo, bar ] = someObject
    • Array rest parameter export const [ foo, ...bar ] = someObject

Big thanks to @dabbott and @coagmano for their work that went into this release!

import-js - v2.5.0

Published by lencioni over 7 years ago

  • Recognize default parameter assignment (e.g. function foo(bar = 123) {}) and array destructuring (e.g. const [foo] = bar;) when finding undefined identifiers.
  • The list of unresolved imports now uses the import statement (e.g. import foo from 'foo'; instead of the module name and full absolute path (e.g. foo /Users/someone/path/to/repo/node_modules/foo).
  • The list of unresolved imports is now sorted by path distance to the current file.
  • The excludes configuration can now be used to exclude packages in the node_modules directory.
  • Fixed crash when encountering dynamic import syntax.

Thanks to @dabbott for most of the work that went into this release!

import-js - v2.4.0

Published by trotzig over 7 years ago

  • Fix broken paths on Windows machines (#413 by @rndmerle)
  • Add full text search, making it possible to use import-js in autocomplete plugins (see https://github.com/billyvg/deoplete-import-js) (#414 by @billyvg)
  • Fix finding exports when using conditional exporting (e.g. module.exports a ? require('b') : require('c');).

Because the schema was changed for the exports storage, you'll see a message (once) after installing this version:

ImportJS is initializing for /path/to/project. Results will be more accurate in a few moments. 

The storage will then be re-initialized, but you'll be good to go soon after.

import-js - v2.3.1

Published by trotzig over 7 years ago

  • Fix incorrectly removing local names for named imports (import { a as b } from 'c'; became import { b } from 'c';)
Package Rankings
Top 4.84% on Npmjs.org
Top 6.68% on Proxy.golang.org
Badges
Extracted from project README
npm Version License Build Status Test Coverage