Skip to content

Commit

Permalink
chore(package): reformat files on commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eventualbuddha committed Sep 11, 2019
1 parent 2671956 commit a075b5e
Show file tree
Hide file tree
Showing 3 changed files with 900 additions and 75 deletions.
81 changes: 40 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# decaffeinate [![npm](https://img.shields.io/npm/v/decaffeinate.svg)](https://www.npmjs.com/package/decaffeinate) [![Join the chat at https://gitter.im/decaffeinate](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/decaffeinate/Lobby)


Goodbye CoffeeScript, hello JavaScript!

JavaScript is the future, in part thanks to CoffeeScript. Now that it has served
Expand Down Expand Up @@ -38,6 +37,7 @@ cleaning up the converted JavaScript code and other things to keep in mind.

Feel free to join the [gitter chat room](https://gitter.im/decaffeinate/Lobby)
to ask questions, or you can file an issue on the [issues] page:

- [report a crash][crash-issue]
- [report incorrect output][wrong-issue]
- [request a feature][feature-issue]
Expand All @@ -53,22 +53,23 @@ Here are some popular open source CoffeeScript projects and their current status
when run through decaffeinate. Each project has a decaffeinate-specific fork
that is re-created from the original repo once per day.

Project | Lines of CoffeeScript | Conversion status | Test status
-------------------------------------------------------- |:---------------------:|:---------------------------------: |:---------------------------:
[chroma.js] | 3.3K | ![chromajs-conversion-status] | ![chromajs-test-status]
[hubot][hubot] [\[1\]](#converted-note) | 3.7K | ![hubot-conversion-status] | ![hubot-test-status]
[autoprefixer][autoprefixer] [\[1\]](#converted-note) | 4.8K | ![autoprefixer-conversion-status] | ![autoprefixer-test-status]
[coffeelint] | 8.8K | ![coffeelint-conversion-status] | ![coffeelint-test-status]
[vimium][vimium] [\[2\]](#correctness-note) | 11K | ![vimium-conversion-status] | ![vimium-test-status]
[coffeescript][coffeescript] [\[2\]](#correctness-note) | 17K | ![coffeescript-conversion-status] | ![coffeescript-test-status]
[coffeescript2][coffeescript2] [\[2\]](#correctness-note) | 17K | ![coffeescript2-conversion-status] | ![coffeescript2-test-status]
[atom][atom] [\[1\]](#converted-note) | 51K | ![atom-conversion-status] | ![atom-test-status]
[atom-org] | 170K | ![atom-org-conversion-status] | ![atom-org-test-status]
[codecombat] | 230K | ![codecombat-conversion-status] | ![codecombat-test-status]
| Project | Lines of CoffeeScript | Conversion status | Test status |
| --------------------------------------------------------- | :-------------------: | :--------------------------------: | :--------------------------: |
| [chroma.js] | 3.3K | ![chromajs-conversion-status] | ![chromajs-test-status] |
| [hubot][hubot] [\[1\]](#converted-note) | 3.7K | ![hubot-conversion-status] | ![hubot-test-status] |
| [autoprefixer][autoprefixer] [\[1\]](#converted-note) | 4.8K | ![autoprefixer-conversion-status] | ![autoprefixer-test-status] |
| [coffeelint] | 8.8K | ![coffeelint-conversion-status] | ![coffeelint-test-status] |
| [vimium][vimium] [\[2\]](#correctness-note) | 11K | ![vimium-conversion-status] | ![vimium-test-status] |
| [coffeescript][coffeescript] [\[2\]](#correctness-note) | 17K | ![coffeescript-conversion-status] | ![coffeescript-test-status] |
| [coffeescript2][coffeescript2] [\[2\]](#correctness-note) | 17K | ![coffeescript2-conversion-status] | ![coffeescript2-test-status] |
| [atom][atom] [\[1\]](#converted-note) | 51K | ![atom-conversion-status] | ![atom-test-status] |
| [atom-org] | 170K | ![atom-org-conversion-status] | ![atom-org-test-status] |
| [codecombat] | 230K | ![codecombat-conversion-status] | ![codecombat-test-status] |

**Project builder status:** [![Build Status](https://travis-ci.org/decaffeinate/decaffeinate-example-builder.svg?branch=master)](https://travis-ci.org/decaffeinate/decaffeinate-example-builder)

**Notes:**

1. <a id='converted-note'></a>Hubot and Autoprefixer have fully moved to
JavaScript using decaffeinate. This build runs on the last commit before the
switch to JS. Atom has mostly moved to JavaScript using decaffeinate, so this
Expand All @@ -86,9 +87,10 @@ In addition, decaffeinate has been used on private codebases within various
companies, such as Square, Benchling, Bugsnag, and DataFox.

Some blog posts on using decaffeinate:
* [From 200K lines of CoffeeScript to zero: making decaffeinate super-stable][benchling-blog-post]
* [Converting a large React Codebase from Coffeescript to ES6][bugsnag-blog-post]
* [Decaffeinating a Large CoffeeScript Codebase Without Losing Sleep][datafox-blog-post]

- [From 200K lines of CoffeeScript to zero: making decaffeinate super-stable][benchling-blog-post]
- [Converting a large React Codebase from Coffeescript to ES6][bugsnag-blog-post]
- [Decaffeinating a Large CoffeeScript Codebase Without Losing Sleep][datafox-blog-post]

If you run into crashes or correctness issues, or you have suggestions on how
decaffeinate could be improved, feel free to file an issue on the [issues] page.
Expand All @@ -103,9 +105,7 @@ decaffeinate could be improved, feel free to file an issue on the [issues] page.
[atom]: https://github.com/decaffeinate-examples/atom
[atom-org]: https://github.com/decaffeinate-examples/atom-org
[codecombat]: https://github.com/decaffeinate-examples/codecombat

[decaffeinate-examples]: https://github.com/decaffeinate/decaffeinate-examples

[chromajs-conversion-status]: https://decaffeinate-examples.github.io/chroma.js/conversion-status.svg
[chromajs-test-status]: https://decaffeinate-examples.github.io/chroma.js/test-status.svg
[hubot-conversion-status]: https://decaffeinate-examples.github.io/hubot/conversion-status.svg
Expand All @@ -126,60 +126,59 @@ decaffeinate could be improved, feel free to file an issue on the [issues] page.
[atom-org-test-status]: https://decaffeinate-examples.github.io/atom-org/test-status.svg
[codecombat-conversion-status]: https://decaffeinate-examples.github.io/codecombat/conversion-status.svg
[codecombat-test-status]: https://decaffeinate-examples.github.io/codecombat/test-status.svg

[benchling-blog-post]: https://benchling.engineering/from-200k-lines-of-coffeescript-to-zero-making-decaffeinate-super-stable-4de0ca68d9bc
[bugsnag-blog-post]: https://blog.bugsnag.com/converting-a-large-react-codebase-from-coffeescript-to-es6/
[datafox-blog-post]: https://eng.datafox.com/javascript/2017/07/18/decaffeinating-large-coffeescript-codebase/

## Goals

* Fully automated conversion of the CoffeeScript language to modern JavaScript.
* Preserve whitespace, formatting, and comments as much as possible to allow
- Fully automated conversion of the CoffeeScript language to modern JavaScript.
- Preserve whitespace, formatting, and comments as much as possible to allow
a full one-time conversion of your CoffeeScript source code.
* Focus on correctness as the first priority, with some options to generate
- Focus on correctness as the first priority, with some options to generate
nicer code at the expense of 100% correctness.
* Provide helpful error messages when it encounters an unsupported language
- Provide helpful error messages when it encounters an unsupported language
construct.

## Common options

* `--use-cs2`: Treat the input as CoffeeScript 2 code. CoffeeScript 2 has some
- `--use-cs2`: Treat the input as CoffeeScript 2 code. CoffeeScript 2 has some
small breaking changes and differences in behavior compared with CS1, so
decaffeinate assumes CS1 by default and allows CS2 via this flag.
* `--use-js-modules`: Convert `require` and `module.exports` to `import` and
- `--use-js-modules`: Convert `require` and `module.exports` to `import` and
`export`. Note that this may result in incorrect import statements because
decaffeinate does not know the export style used by the other file. To
generate correct imports, use [bulk-decaffeinate][bulk-decaffeinate] and
enable the `useJSModules` option.

## Other options

* `--modernize-js`: Treat the input as JavaScript and only run the
- `--modernize-js`: Treat the input as JavaScript and only run the
JavaScript-to-JavaScript transforms, modifying the file(s) in-place.
* `--literate`: Treat the input file as Literate CoffeeScript.
* `--disable-suggestion-comment`: Do not include a comment with followup
- `--literate`: Treat the input file as Literate CoffeeScript.
- `--disable-suggestion-comment`: Do not include a comment with followup
suggestions at the top of the output file.
* `--no-array-includes`: Do not use `Array.prototype.includes` in generated
- `--no-array-includes`: Do not use `Array.prototype.includes` in generated
code.
* `--use-optional-chaining`: Use the upcoming
- `--use-optional-chaining`: Use the upcoming
[optional chaining](https://github.com/tc39/proposal-optional-chaining) syntax
for operators like `?.` [**NOTE:** this is disabled and has no effect].
* `--safe-import-function-identifiers`: Comma-separated list of function names
- `--safe-import-function-identifiers`: Comma-separated list of function names
that may safely be in the `import`/`require` section of the file. All other
function calls will disqualify later `require`s from being converted to
`import`s.
* `--prefer-let`: Use `let` instead of `const` for most variables in output
- `--prefer-let`: Use `let` instead of `const` for most variables in output
code.
* `--loose`: Enable all `--loose...` options.
* `--loose-default-params`: Convert CS default params to JS default params.
* `--loose-for-expressions`: Do not wrap expression loop targets in `Array.from`.
* `--loose-for-of`: Do not wrap JS `for...of` loop targets in `Array.from`.
* `--loose-includes`: Do not wrap in `Array.from` when converting `in` to `includes`.
* `--loose-comparison-negation`: Allow unsafe simplifications like `!(a > b)` to `a <= b`.
* `--loose-js-modules`: Allow named exports when converting to JS modules.
* `--disable-babel-constructor-workaround`: Never include the Babel/TypeScript
- `--loose`: Enable all `--loose...` options.
- `--loose-default-params`: Convert CS default params to JS default params.
- `--loose-for-expressions`: Do not wrap expression loop targets in `Array.from`.
- `--loose-for-of`: Do not wrap JS `for...of` loop targets in `Array.from`.
- `--loose-includes`: Do not wrap in `Array.from` when converting `in` to `includes`.
- `--loose-comparison-negation`: Allow unsafe simplifications like `!(a > b)` to `a <= b`.
- `--loose-js-modules`: Allow named exports when converting to JS modules.
- `--disable-babel-constructor-workaround`: Never include the Babel/TypeScript
workaround code to allow `this` before `super` in constructors.
* `--disallow-invalid-constructors`: Give an error when constructors use `this`
- `--disallow-invalid-constructors`: Give an error when constructors use `this`
before `super` or omit the `super` call in a subclass.

For more usage details, see the output of `decaffeinate --help`.
Expand Down
78 changes: 48 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,59 @@
{
"name": "decaffeinate",
"description": "Move your CoffeeScript source to modern JavaScript.",
"version": "0.0.0-development",
"description": "Move your CoffeeScript source to modern JavaScript.",
"keywords": [
"coffee",
"coffee-script",
"convert",
"es3",
"es6",
"esnext"
],
"repository": {
"type": "git",
"url": "https://github.com/decaffeinate/decaffeinate.git"
},
"license": "MIT",
"author": "Brian Donovan",
"contributors": [
"Alan Pierce <alangpierce@gmail.com>"
],
"files": [
"bin",
"dist"
],
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"bin": {
"decaffeinate": "./bin/decaffeinate"
},
"scripts": {
"prebuild": "rimraf dist && mkdirp dist && yarn lint",
"build": "script/build",
"lint": "eslint --report-unused-disable-directives --ext .ts src script test",
"lint-fix": "yarn lint --fix",
"prepublish": "yarn build",
"pretest": "yarn build",
"test": "mocha 'test/**/*.ts'",
"prebuild": "rimraf dist && mkdirp dist && yarn lint",
"build": "script/build",
"prepublish": "yarn build",
"update-website": "ts-node ./script/update-website.ts"
},
"repository": {
"type": "git",
"url": "https://github.com/decaffeinate/decaffeinate.git"
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{ts,js,md,json}": [
"prettier --write",
"git add"
],
"package.json": [
"sort-package-json",
"git add"
]
},
"keywords": [
"coffee",
"coffee-script",
"convert",
"es3",
"es6",
"esnext"
],
"author": "Brian Donovan",
"contributors": [
"Alan Pierce <alangpierce@gmail.com>"
],
"license": "MIT",
"dependencies": {
"@codemod/core": "^1.0.0",
"@codemod/parser": "^1.0.0",
Expand All @@ -57,13 +76,6 @@
"mz": "^2.7.0",
"tslib": "^1.9.3"
},
"engines": {
"node": ">=8"
},
"files": [
"bin",
"dist"
],
"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/preset-env": "^7.3.1",
Expand All @@ -83,13 +95,22 @@
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-prettier": "^3.1.0",
"fs-extra": "^8.1.0",
"husky": "^3.0.5",
"lint-staged": "^9.2.5",
"mkdirp": "^0.5.1",
"mocha": "^6.2.0",
"prettier": "^1.16.4",
"rimraf": "^3.0.0",
"sort-package-json": "^1.22.1",
"ts-node": "^8.0.2",
"typescript": "^3.5.3"
},
"resolutions": {
"**/@resugar/helper-comments": "^1.0.2"
},
"engines": {
"node": ">=8"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
Expand All @@ -99,8 +120,5 @@
"magic-string",
"detect-indent"
]
},
"resolutions": {
"**/@resugar/helper-comments": "^1.0.2"
}
}
Loading

0 comments on commit a075b5e

Please sign in to comment.