Giter Club home page Giter Club logo

coffee-script-brunch's Introduction

coffee-script-brunch

Adds CoffeeScript support to Brunch.

Installation

Install the plugin via npm with npm install -S coffee-script-brunch.

Configuration

You can set the bare option in your brunch config (such as brunch-config.js):

modules.exports = {
  // ...
  plugins: {
    coffeescript: {
      bare: true
    }
  }
};

Transpilation is also supported. You can set transpile to true to let babel find its configuration in the normal way or you can pass a configuration directly. Make sure you have @babel/core and any relevant plugins installed.

modules.exports = {
  // ...
  plugins: {
    coffeescript: {
      transpile: true,
      // or:
      // transpile: {presets: ["@babel/env"]}
    }
  }
};

License

The MIT License

coffee-script-brunch's People

Contributors

denysdovhan avatar dependabot[bot] avatar es128 avatar flisky avatar goshacmd avatar huafu avatar jakesjews avatar kenhkan avatar maxlath avatar mizchi avatar paulmillr avatar psagers avatar shvaikalesh avatar smalluban avatar trojanowski avatar vishwassharma avatar yveslange avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

coffee-script-brunch's Issues

sourceMaps issues

[email protected] node_modules/coffee-script-brunch
└── [email protected]
exports.config =
  sourceMaps: yes
  # ...
/usr/local/share/npm/lib/node_modules/brunch/lib/helpers.js:151
    return js.replace(/(\\)?\n(?!\n)/g, function($0, $1) {
              ^
TypeError: Object #<Object> has no method 'replace'
    at indent (/usr/local/share/npm/lib/node_modules/brunch/lib/helpers.js:151:15)
    at /usr/local/share/npm/lib/node_modules/brunch/lib/helpers.js:181:139
    at /usr/local/share/npm/lib/node_modules/brunch/lib/fs_utils/source_file.js:96:16
    at updateCache (/usr/local/share/npm/lib/node_modules/brunch/lib/fs_utils/source_file.js:87:22)
    at /usr/local/share/npm/lib/node_modules/brunch/lib/fs_utils/source_file.js:108:9
    at /usr/local/share/npm/lib/node_modules/brunch/lib/fs_utils/source_file.js:66:20
    at getDependencies (/usr/local/share/npm/lib/node_modules/brunch/lib/fs_utils/source_file.js:30:14)
    at /usr/local/share/npm/lib/node_modules/brunch/lib/fs_utils/source_file.js:62:18
    at CoffeeScriptCompiler.module.exports.CoffeeScriptCompiler.compile (/Users/nicck/src/try-brunch/node_modules/coffee-script-brunch/lib/index.js:59:7)
    at /usr/local/share/npm/lib/node_modules/brunch/lib/fs_utils/source_file.js:58:25
    at lint (/usr/local/share/npm/lib/node_modules/brunch/lib/fs_utils/source_file.js:18:14)
    at /usr/local/share/npm/lib/node_modules/brunch/lib/fs_utils/source_file.js:50:14
    at fs.js:266:14
    at Object.oncomplete (fs.js:107:15)

change dependency from coffee-script to coffeescript

coffee-script is deprecated, the last version of the 1 branch is 1.12.8 ATM.
Could you update yout package to import the dependency "coffeescript" instead of "coffee-script", and BTW, bump it's version number to 1.12.8?
BTW, you can then rename your package to coffeescript-brunch as well.. but that would be a bigger impact.

cant install plugin from "npm"

"npm" not link installed library and cant find coffeescript

maybe is "npm" bug

# npm -v
1.2.1

# npm install git+ssh://[email protected]:brunch/coffee-script-brunch.git
npm http GET https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/coffee-script

> [email protected] postinstall /home/matochu/workspace/scope/fotochoice/client/node_modules/coffee-script-brunch
> node setup.js test

Executing node node_modules/.bin/mocha --compilers coffee:coffee-script --require test/common.js --colors

module.js:340
    throw err;
          ^
Error: Cannot find module '/home/matochu/workspace/scope/fotochoice/client/node_modules/coffee-script-brunch/node_modules/.bin/mocha'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
[email protected] node_modules/coffee-script-brunch
└── [email protected]
# cd node_modules/coffee-script-brunch
# npm install

npm http GET https://registry.npmjs.org/chai/1.4.2
npm http GET https://registry.npmjs.org/mocha/1.8.1
npm http 304 https://registry.npmjs.org/mocha/1.8.1
npm http 304 https://registry.npmjs.org/chai/1.4.2
npm http GET https://registry.npmjs.org/commander/0.6.1
npm http GET https://registry.npmjs.org/growl
npm http GET https://registry.npmjs.org/jade/0.26.3
npm http GET https://registry.npmjs.org/diff/1.0.2
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/mkdirp/0.3.3
npm http GET https://registry.npmjs.org/ms/0.3.0
npm http 304 https://registry.npmjs.org/commander/0.6.1
npm http 304 https://registry.npmjs.org/growl
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/jade/0.26.3
npm WARN package.json [email protected] No README.md file found!
npm http 304 https://registry.npmjs.org/diff/1.0.2
npm http 304 https://registry.npmjs.org/mkdirp/0.3.3
npm http 304 https://registry.npmjs.org/ms/0.3.0
npm http GET https://registry.npmjs.org/mkdirp/0.3.0
npm http 304 https://registry.npmjs.org/mkdirp/0.3.0

> [email protected] postinstall /home/matochu/workspace/scope/fotochoice/client/node_modules/coffee-script-brunch
> node setup.js test

Executing node node_modules/.bin/mocha --compilers coffee:coffee-script --require test/common.js --colors

module.js:340
    throw err;
          ^
Error: Cannot find module 'test/common.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Command.<anonymous> (/home/matochu/workspace/scope/fotochoice/client/node_modules/coffee-script-brunch/node_modules/mocha/bin/_mocha:150:3)
    at Command.EventEmitter.emit (events.js:126:20)
    at Command.parseOptions (/home/matochu/workspace/scope/fotochoice/client/node_modules/coffee-script-brunch/node_modules/mocha/node_modules/commander/lib/commander.js:475:14)
    at Command.parse (/home/matochu/workspace/scope/fotochoice/client/node_modules/coffee-script-brunch/node_modules/mocha/node_modules/commander/lib/commander.js:347:21)
    at Object.<anonymous> (/home/matochu/workspace/scope/fotochoice/client/node_modules/coffee-script-brunch/node_modules/mocha/bin/_mocha:169:9)
    at Module._compile (module.js:449:26)

> [email protected] prepublish /home/matochu/workspace/scope/fotochoice/client/node_modules/coffee-script-brunch
> node setup.js prepublish

Executing node node_modules/.bin/coffee -o lib/ src/
File not found: src/.coffee
[email protected] node_modules/chai

[email protected] node_modules/mocha
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected] ([email protected])

Build source maps

With Coffeescript 1.6.1 we can build source maps using the --map directive. It would be incredible to add these automatically to the brunch build process.

Build error

I run into this issue when building brunch:

rejecting for TypeError: Cannot read property 'charCodeAt' of undefined

I'm running Mac OSX 10.11.3 (15D21), node 5.0.0 and coffee-script-brunch 2.0.0.

If I downgrade to coffee-script-brunch 1.8.3 and run with --debug I can see the build process randomly hanging on a different .coffee file every time.

New Release

Could we get a new release with the update to coffee-script 1.9?

CoffeeScript 1.12.z

Hi,

Thanks providing coffeescript for brunch. It's awesome.

Is it possible to specify the coffee-script version (as an environnement variable or a configuration variable) that should be used. But, without doing it manually in the coffee-script-brunch/package.json or without doing a PR everytime there is a new version ?

Best regards.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.