Skip to content

Commit

Permalink
[#606] Convert codebase to external modules (#734)
Browse files Browse the repository at this point in the history
Closes #606, Closes #733, Closes #717 

## Changes:

- Changed internal Excalibur code into modules (ES6 style)
- Excalibur uses UMD module style for distribution (supports CommonJS, AMD, and window global)
- Bundled AMD modules using Almond.js micro loader
- Added two declaration files to dist, `excalibur.d.ts` and `excalibur.amd.d.ts`
- Added AMD bundle to distribution `excalibur.amd.js`
- Added inlined source maps for browser debugging
- Cleaned up Gruntfile and various compilation tasks
  • Loading branch information
kamranayub authored and eonarheim committed Jan 2, 2017
1 parent 613d04a commit a542faf
Show file tree
Hide file tree
Showing 171 changed files with 16,028 additions and 23,988 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/src/engine/*.js
/src/engine/*.map
/sandbox/web/**/*.js
/sandbox/web/excalibur.d.ts
/sandbox/web/*.d.ts
/src/spec/*.js
_SpecRunner.html
TestsSpec.js
Expand All @@ -13,6 +13,7 @@ node_cache/
/bower_components/
coverage/
.grunt/
.tscache/

# Logs and databases #
######################
Expand Down
11 changes: 3 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
sudo: false
language: node_js
node_js:
- '4'
before_script:
install: true
- '6'
cache:
directories:
- node_modules
- node_cache
- node_shrinkwrap
- $HOME/.npm
script:
- npm install npm -g
- npm install grunt-cli -g
- npm install
- grunt travis
- node_modules/.bin/grunt travis
after_success:
- node deploy-docs.js
- if [ "$TRAVIS_BRANCH" = "master" ]; then grunt bumpup dists; fi
- if [ "$TRAVIS_BRANCH" = "master" ]; then node_modules/.bin/grunt bumpup dists; fi
notifications:
slack:
secure: aQXFk2/MxX5eR2JM90xWAA9YX03QArY1ejUmnP/NkFHbB4zzKZblACjEeDTDTDCThZpXhrganX2nDWrWFrrXbOG28wKrRhEZSULPAgyiWGpfkMoT44fKmgh+eZ5C/isMF2eeQCrYo3EQCMxfCKxNaBhyLc+jr/Sm232zU2LaXo8=
3 changes: 1 addition & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
"name": "Attach to test",
"type": "phantomjs",
"request": "launch",
"preLaunchTask": "compiledebug",
"preLaunchTask": "debug",
//"verboseDiagnosticLogging": true,
"port": 8888,
"file": "${workspaceRoot}\\TestsSpec.js",
"webRoot": "${workspaceRoot}",
"runtimeExecutable": "${workspaceRoot}\\node_modules\\phantomjs-prebuilt\\lib\\phantom\\bin\\phantomjs.exe",
"runtimeArgs": [],
"scriptArgs": [],
//"sourceMapPathOverrides": ["${workspaceRoot}\\src\\spec\\TestsSpec.js"],
"sourceMaps": true
},
{
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@
"files.exclude": {
"**/.git": true,
".grunt/": true,
".tscache": true,
"**/.DS_Store": true,
"**/node_modules": true,
"**/node_shrinkwrap": true,
"**/bin": true,
"**/obj": true,
"src/engine/*.js": true
"_SpecRunner.html": true,
"TestsSpec.js*": true,
"src/engine/*.js": true,
"src/spec/*.js": true,
"src/spec/*.map": true
},
"typescript.tsdk": "./node_modules/typescript/lib"
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- `ex.Detector.getBrowserFeatures()` to retrieve the support matrix of the current browser
- `ex.Detector.logBrowserFeatures()` to log the support matrix to the console (runs at startup when in Debug mode)
- Added @obsolete decorator to help give greater visibility to deprecated methods ([#684](https://github.com/excaliburjs/Excalibur/issues/684))
- Added better support for module loaders and TypeScript importing. See [Installation](http://docs.excaliburjs.com/en/latest/installation.html) docs for more info. ([#606](https://github.com/excaliburjs/Excalibur/issues/606))

### Changed
- Changed Util.clamp to use math libraries ([#536](https://github.com/excaliburjs/Excalibur/issues/536))
Expand Down
7 changes: 3 additions & 4 deletions Excalibur.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@
<description>Excalibur.js is a simple JavaScript game engine with TypeScript bindings for making 2D games in HTML5 Canvas. Our mission is to make web game development as simple as possible.</description>
</metadata>
<files>
<file src="build\dist\excalibur.d.ts" target="content\Scripts" />
<file src="build\dist\excalibur.js" target="content\Scripts" />
<file src="build\dist\excalibur.min.js" target="content\Scripts" />
<file src="build\dist\excalibur.min.js.map" target="content\Scripts" />
<file src="build\dist\*.ts" target="content\Scripts" />
<file src="build\dist\*.js" target="content\Scripts" />
<file src="build\dist\*.map" target="content\Scripts" />
</files>
</package>
Loading

0 comments on commit a542faf

Please sign in to comment.