Skip to content

Commit

Permalink
chore(crystal-1.0): Update for Crystal 1.0
Browse files Browse the repository at this point in the history
* Crystal and shards >= 1.0 require all external shards to specify
  compatbility via the `crystal` directive in  `shard.yml`.
* Update the coffeescript compiler to the latest 1.X release of
  1.12.8 (sorry, no 2.X support).
* Add a `CoffeeScript::Source.bundled_version` static method that
  can be used to detect the bundled source version of the CS compiler.
* Release version 2.0.

NOTE: we've changed how this shard is versioned - it's still a
      semantic versioning scheme, but we no longer directly replicate
      the bundled coffeescript compiler version. Instead, use
      the `CoffeeScript::Source.bundled_version` to check the compiler
      version.
  • Loading branch information
jessedoyle committed Jun 21, 2021
1 parent 8610a22 commit 02627e0
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 187 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CoffeeScript Source
===================

This repository contains a basic [Crystal](http://crystal-lang.org) shard that contains the raw javascript for the [CoffeeScript](https:/jashkenas/coffeescript) compiler. This shard's version will directly match the version of the corresponding CoffeeScript compiler.
This repository contains a basic [Crystal](http://crystal-lang.org) shard that contains the raw javascript for the [CoffeeScript](https:/jashkenas/coffeescript) compiler.

Most of this code was taken from Ruby's [coffee-script-source](https://rubygems.org/gems/coffee-script-source)'s gem and Crystalized.

Expand All @@ -14,7 +14,7 @@ In your `shard.yml`:
dependencies:
coffee-script-source:
github: jessedoyle/coffee-script-source
version: ~> 1.12.6
version: ~> 2.0
```
the execute `shards install`.
Expand All @@ -25,17 +25,24 @@ Usage
```crystal
require "coffee-script-source"
CoffeeScript::Source.bundled_path # => somewhere...
CoffeeScript::Source.bundled_path # => somewhere...
CoffeeScript::Source.bundled_version # => "X.X.X"
```

Notes
=====

* Currently, this shard supports the 1.X releases of CoffeeScript. PRs are welcome - please see the discussion [here](https:/jessedoyle/coffee-script-source/pull/3#issuecomment-779522699) for context.

Maintenance
===========

For future reference, when a new CoffeeScript version is released:

1. Create a new branch on this repo, then checkout the created branch.
2. From the repo's root directory execute: `bin/build-coffee-script 1.x.x`.
3. Commit and merge as usual. Don't forget to add the correct release tags (eg. `v1.10.0`).
3. Update the `bundled_version` static method in [`src/coffee_script_source.cr`](https:/jessedoyle/coffee-script-source/blob/master/src/coffee_script_source.cr).
4. Commit and merge as usual. Don't forget to add the correct release tags (eg. `v1.10.0`).

License
=======
Expand Down
3 changes: 2 additions & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: coffee-script-source
version: 1.12.6
version: 2.0.0

authors:
- Jesse Doyle <[email protected]>

crystal: '>= 0.35.1'
license: MIT
4 changes: 4 additions & 0 deletions src/coffee_script_source.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@ module CoffeeScript
def self.bundled_path
File.expand_path("../js/coffee-script.js", __FILE__)
end

def self.bundled_version
"1.12.8"
end
end
end
Loading

0 comments on commit 02627e0

Please sign in to comment.