Skip to content

Latest commit

 

History

History
119 lines (91 loc) · 4.01 KB

File metadata and controls

119 lines (91 loc) · 4.01 KB

Contributing - adobe-brackets-encode-decode

Contributions and suggestions are very welcome and wanted. I try to respond to pull requests within 48 hours. To contribute simply

  1. Fork the repository.

    How do I do this?

  2. Open your extensions folder by selecting Help > Show Extensions Folder in Brackets

  3. Clone your forked repository inside the user folder in the folder from step 2

    git clone https://github.com/YOUR-USERNAME/adobe-brackets-encode-decode
    cd adobe-brackets-encode-decode
    

    Resources:

  4. Setup the development environment

    npm install
    

    Resources:

  5. Make the fix or add features to src/main.js. (See detailed instructions below)

    Detailed Instructions: How to add a new encoder or decoder In order to keep the code clean and readable, implement the encoders/decoders in the `src/convertors` folder, as a RequireJS module:
    	/**
    	*  File: YourFormat.js
    	*  Author: Your Name <your@email.com>
    	*  Description:  Encodes and decodes String <--> YourFormat
    	*/
    
    	define(function(require, exports) {
    	const encodeToYourFormat = (input) => {
    	//write your decoding implementation here
    	return result; // result must be a String
    	};
    	
    	const decodeFromYourFormat = (input) => {
    	//write your encoding implementation here
    	return result; // result must be a String
    	 };
    	exports.encodeToYourFormat = encodeToYourFormat;
    	exports.decodeFromYourFormat = decodeFromYourFormat;
    	});
    

    Import the module to src/main.js and register it using the following format:

    	const encodeToYourFormat = require('convertors/YourFormat').encodeToYourFormat;
    	const encodeFromYourFormat = require('convertors/YourFormat').encodeFromYourFormat;
    

    Register your encoder/decoder with the Context Menu, by adding it to const ENCODERS_DECODERS in the following format:

    	  const ENCODERS_DECODERS = [{
    	    title: 'YourFormat',
    	    encodeTitle: 'String to YourFormat',  //optional
    	    encoder: encodeToYourFormat, //The encoder function you imported
    	    decodeTitle: 'YourFormat to String', //optional
    	    decoder: decodeFromYourFormat,  //The encoder function you imported. If there is non, set value as 'null'
    	  }
    

    Compile the extension to use/test it in Brackets using npm run build

    Restart Brackets via Debug > Reload With Extensions to see your changes.

    To debug problems, use Debug > Show Developer Tools. You can use console.log(), set breakpoints, etc.

    Resources:

  6. Before committing your work, remember to run

npm test

to make sure there are no build or lint errors. If you are having issues with eslint errors, such as CRLF or LF or indentation, try the following

  • Consider using EditorConfig. (This contains a .editorconfig)

  • Run the command npm run-script lintfix or eslint --fix src/main.js

  1. Sync your fork to make sure you have the latest changes.

    # Fetch upstream master and merge with your repo's master branch
    git fetch upstream
    git checkout master
    git merge upstream/master
    
    # If there were any new commits, rebase your development branch
    git checkout newfeature
    git rebase master
    

    Resources:

  2. Create a pull request.

    Resources:

  3. Wait for the maintainer to respond.

Thank you for you for your awesome contribution :-)