Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Commit

Permalink
Update to remove deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
darlesson committed May 27, 2015
1 parent b31692f commit 1c7aec2
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 16 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 0.0.1 - First Release
## 0.2.0 - First Release
* Update to use latest ReactTools
* Update to fix deprecation warnings

## 0.1.0 - First Release
* Compile through the menus
* Setting "Compile On Save"
* Setting "Compile Without Notation"
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014 Darlesson Oliveira
Copyright (c) 2015 Darlesson Oliveira

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand Down
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,26 @@

This [Atom](https://atom.io/) package allows the transformation of JSX files on save or on demand through the menus.

If you want to know more about JSX, please take a look at [React](http://facebook.github.io/react/).

* [atom-jsx-transform package](https://atom.io/packages/atom-jsx-transform/) at Atom.io.
* [atom-jsx-transform repository](https://github.com/darlesson/atom-jsx-transform/) at GitHub.
* [atom-jsx-transform package](https://www.npmjs.com/package/atom-jsx-transform/) at NPM.

## The Configuration

Go to File > Settings.
You may choose to allow JSX compilation on save of JSX files.

Go to File > Settings > Packages and search for atom-jsx-transform. Go to the package settings.

## Compiling on Demand

You can compile the selected open JSX file using the shortcut `ctrl-alt-j` `c`, use the top menu Packages > JSX Transform > Compile JSX File
or the context menu item Compile JSX File to JS.

## Contribution

If you would like to make contributions to this package, you are welcome.

## License
Copyright (c) 2014 Darlesson Oliveira. Licensed under the MIT license.
Copyright (c) 2015. Licensed under the MIT license.
18 changes: 11 additions & 7 deletions lib/atom-jsx-transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var helpers = {
},

transform: function () {
var activeEditor = atom.workspace.getActiveEditor();
var activeEditor = atom.workspace.getActiveTextEditor();

if (activeEditor) {
var filePath = activeEditor.getPath();
Expand All @@ -79,9 +79,15 @@ var initialConfig = {
};

module.exports = {
configDefaults: {
compileOnSave: initialConfig.compileOnSave,
compileWithoutNotation: initialConfig.compileWithoutNotation
config: {
compileOnSave: {
type: 'boolean',
default: initialConfig.compileOnSave
},
compileWithoutNotation: {
type: 'boolean',
default: initialConfig.compileWithoutNotation
}
},

subscriptions: null,
Expand Down Expand Up @@ -112,16 +118,14 @@ module.exports = {
window.localStorage.setItem('jsx-compileWithoutNotation', value);

}.bind(this));

console.log('atom-jsx-transform was activated');
},

compile: function () {
helpers.transform();
},

subscribeOnSave: function () {
this.onSaveSubscription = atom.workspaceView.command('core:save', this.compile);
this.onSaveSubscription = atom.commands.add('atom-workspace', 'core:save', this.compile);
this.subscriptions.add(this.onSaveSubscription);
},

Expand Down
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
{
"name": "atom-jsx-transform",
"main": "./lib/atom-jsx-transform",
"version": "0.1.0",
"description": "Compile JSX files to JS",
"activationCommands": [],
"version": "0.2.0",
"description": "A convenient compiler of React JSX files to javascript.",
"repository": "https://github.com/darlesson/atom-jsx-transform",
"license": "MIT",
"engines": {
"atom": "*"
"atom": ">=0.174.0"
},
"dependencies": {
"react-tools": "=0.10.0"
"react-tools": ">0.10.0"
}
}

0 comments on commit 1c7aec2

Please sign in to comment.