Comments (3)
To create a plugin, there are a few options. The best thing is if the editor already supports plugins written in Ruby. Then you can directly instantiate a ImportJS::Importer
with a custom editor class (e.g. ImportJS::WebStormEditor
). Look at ImportJS::VIMEditor
for inspiration.
If the plugin framework doesn't allow Ruby plugins, then you can do what the Sublime plugin does: use the external import-js
command-line tool (available after installing the import_js
gem, notice differences in dash and underscore between gem and CLI tool - that's unfortunate but intentional). The CLI tool accepts file contents via stdin, and outputs the whole file again (after doing imports) in stdout. In case there are messages to display, or ambiguities to resolve, stderr contains a JSON blob with useful information. See https://github.com/trotzig/import-js/blob/master/import-js.py for how the Sublime plugin is implemented.
The Emacs plugin uses a slightly different approach. It keeps a running Ruby process and passes messages back and forth. See https://github.com/trotzig/import-js/blob/master/plugin/import-js.el .
I'll be happy to provide continued support for whoever makes an attempt at creating a plugin.
from import-js.
Is this still relevant? @trotzig @lencioni
from import-js.
I think we can close this out.
from import-js.
Related Issues (20)
- Use ImportJS without package.json HOT 4
- Add CustomElements support HOT 3
- namedExports solved the 'No JS module to import for Redirect' problem HOT 2
- Specify node_modules directory in .importjs.js HOT 4
- Support for jsconfig.json HOT 7
- Option to import with double quotes instead of single quotes HOT 2
- Lodash alias doesn't work HOT 3
- groupImports ends up grouping namedExports separately. HOT 1
- Import maps HOT 2
- active forks HOT 3
- Unable to import files when using smart pipeline operator HOT 5
- Fails to install: node-pre-gyp? HOT 4
- when i move a personal module file to an other folder, the import suggestion of the personal module propose the old folder and the new folder HOT 2
- Config file can't be loaded inside an ES Module project HOT 1
- Move away from Flow? HOT 14
- Move to Prettier, abandon ESlint HOT 4
- Cleaning up stale issues & PRs HOT 2
- Abandon old node versions, update test matrix HOT 2
- React Imports on JSX HOT 1
- Reintroduce some ESlint rules
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from import-js.