Skip to content

Commit

Permalink
Pre-release 1.0.0-alpha.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Wimmer committed Sep 24, 2016
0 parents commit 3613bca
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/.idea/
/build/
/test/
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright (c) 2016, Team Mion

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# TM.js Core (tmjs-core)

TM.js Core is used in all TM.js modules
9 changes: 9 additions & 0 deletions bin/build
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

version="$(nodejs <<< "console.log(require(\"./package\").version);")"
test -d build && rm -dr build
mkdir build
cp tmjs-core.js build/tmjs-core.js
sed -i "s#\${version}#${version}#" build/tmjs-core.js
9 changes: 9 additions & 0 deletions bin/publish
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

version="$(nodejs <<< "console.log(require(\"./package\").version);")"
test -d files || mkdir files
cp "build/tmjs-core.js" "files/tmjs-core_${version}.js"
git tag "${version}"
26 changes: 26 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "tmjs-core",
"version": "1.0.0-alpha.1",
"description": "TM.js Core is used in all TM.js modules",
"main": "tmjs-core.js",
"scripts": {
"build": "bin/build",
"publish": "bin/publish"
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/teammion/tmjs-core.git"
},
"keywords": [
"tmjs-core",
"tmjs",
"core",
"tm.js"
],
"author": "Stefan Wimmer <[email protected]>",
"license": "ISC",
"bugs": {
"url": "https://github.com/teammion/tmjs-core/issues"
},
"homepage": "https://github.com/teammion/tmjs-core#readme"
}
34 changes: 34 additions & 0 deletions tmjs-core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2016, Team Mion
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

/**
* TM.js Core (tmjs-core) ${version}
* @author Stefan Wimmer <[email protected]>
*/

let g = typeof window !== "undefined" ? window : global;

g.tmjs = g.tmjs || {};

g.tmjs.__defineGetter__("core", () => "${version}");

g.tmjs.module = (name, version, getter) =>
g.tmjs.__defineGetter__(name, () =>
{
let module = getter(g.tmjs);
module.__defineGetter__("version", () => version);
return module;
});

0 comments on commit 3613bca

Please sign in to comment.