Skip to content
This repository has been archived by the owner on Apr 21, 2021. It is now read-only.

Current senna version function #232

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/amd/metal-path-parser/src/pathParser.js

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

7 changes: 5 additions & 2 deletions build/amd/senna/src/senna.js

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

2 changes: 1 addition & 1 deletion build/amd/senna/src/senna.js.map

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

9 changes: 9 additions & 0 deletions build/amd/senna/src/version.js

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

1 change: 1 addition & 0 deletions build/amd/senna/src/version.js.map

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

8 changes: 7 additions & 1 deletion build/globals/senna-debug.js

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

6 changes: 3 additions & 3 deletions build/globals/senna-min.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion build/globals/senna.js

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

2 changes: 1 addition & 1 deletion build/globals/senna.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions examples/amd/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
});

requirejs(['senna/src/senna'], function(senna) {
console.log('Senna version:', senna.version);
var app = new senna.App();
app.setBasePath('/examples/amd');
app.addSurfaces(['header', 'content', 'footer', 'indexOnlySurface']);
Expand Down
2 changes: 2 additions & 0 deletions examples/blog/js/spa.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ document.addEventListener('DOMContentLoaded', function() {
Creates a new Senna app
========================================================================== */

console.log('Senna version:', senna.version);

var app = new senna.App();
app.setBasePath('/examples/blog');
app.addSurfaces('posts');
Expand Down
12 changes: 11 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ var gulp = require('gulp');
var header = require('gulp-header');
var jsdoc = require('gulp-jsdoc3');
var metal = require('gulp-metal');
var pkg = require('./package.json');
var rename = require('gulp-rename');
var runSequence = require('run-sequence');
var stripDebug = require('gulp-strip-debug');
var template = require('gulp-template');

// Metal -----------------------------------------------------------------------

Expand Down Expand Up @@ -161,10 +163,18 @@ gulp.task('docs', function() {
}));
});

gulp.task('version', function() {
return gulp.src('build/**/*.js')
.pipe(template({
version: pkg.version
}))
.pipe(gulp.dest('build'));
});

// Runner ----------------------------------------------------------------------

gulp.task('default', function(done) {
runSequence('clean', 'css', 'build:globals', 'uglify', 'build:amd', 'banner', 'clean:debug', 'clean:debug:globals', 'clean:debug:amd', done);
runSequence('clean', 'css', 'build:globals', 'uglify', 'build:amd', 'banner', 'clean:debug', 'clean:debug:globals', 'clean:debug:amd', 'version', done);
});

gulp.task('server', ['default'], function() {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"gulp-metal": "^1.0.0",
"gulp-rename": "^1.2.2",
"gulp-strip-debug": "^1.1.0",
"gulp-template": "^4.0.0",
"metal-tools-build-rollup": "^2.0.6",
"run-sequence": "^1.1.5",
"sinon": "1.17.7"
Expand Down
3 changes: 2 additions & 1 deletion src/senna.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import HtmlScreen from './screen/HtmlScreen';
import RequestScreen from './screen/RequestScreen';
import Route from './route/Route';
import Screen from './screen/Screen';
import version from './version';

export default App;
export { dataAttributeHandler, utils, App, HtmlScreen, Route, RequestScreen, Screen };
export { dataAttributeHandler, utils, App, HtmlScreen, Route, RequestScreen, Screen, version };
4 changes: 4 additions & 0 deletions src/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* @returns String current senna version
*/
export default '<%= version %>';