Skip to content

Commit

Permalink
Rust (#38)
Browse files Browse the repository at this point in the history
* start

* rust++

* remove travis
  • Loading branch information
rickycodes authored Nov 2, 2020
1 parent 615ec31 commit ff356d3
Show file tree
Hide file tree
Showing 12 changed files with 205 additions and 186 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
moonmoji.*
node_modules*


# Added by cargo

/target
4 changes: 0 additions & 4 deletions .travis.yml

This file was deleted.

171 changes: 171 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[package]
name = "moonmoji"
version = "0.1.0"
authors = ["rickycodes <[email protected]>"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
timemoji = "0.2.0"
4 changes: 4 additions & 0 deletions bin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node
// 👆 Used to tell Node.js that this is a CLI tool

require("./moonmoji")
31 changes: 0 additions & 31 deletions cli.js

This file was deleted.

6 changes: 0 additions & 6 deletions example.js

This file was deleted.

22 changes: 0 additions & 22 deletions help.js

This file was deleted.

52 changes: 0 additions & 52 deletions index.js

This file was deleted.

24 changes: 7 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
{
"name": "moonmoji",
"version": "1.1.10",
"version": "2.0.0",
"description": "Return an emoji representing the current moon phase.",
"main": "index.js",
"dependencies": {
"meow": "^6.0.0",
"suncalc": "^1.7.0"
},
"devDependencies": {
"faucet": "0.0.1",
"standard": "^14.0.0",
"tape": "^4.6.3"
},
"main": "bin.js",
"scripts": {
"lint": "standard -v",
"tape": "tape test.js | faucet",
"test": "npm run lint && npm run tape"
"cargo:build": "cargo build --target=wasm32-unknown-emscripten --release",
"mv": "mv ./target/wasm32-unknown-emscripten/release/moonmoji.* .",
"build": "yarn cargo:build && yarn mv"
},
"bin": {
"moonmoji": "cli.js"
"moonmoji": "bin.js"
},
"repository": {
"type": "git",
Expand All @@ -35,6 +26,5 @@
"bugs": {
"url": "https://github.com/rickycodes/moonmoji/issues"
},
"homepage": "https://github.com/rickycodes/moonmoji",
"tonicExampleFilename": "example.js"
"homepage": "https://github.com/rickycodes/moonmoji"
}
7 changes: 7 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extern crate timemoji;

use timemoji::moonmoji;

fn main() {
println!("{}", moonmoji::get_emoji(&None));
}
Loading

0 comments on commit ff356d3

Please sign in to comment.