Skip to content

Commit

Permalink
chore(sample): Update example
Browse files Browse the repository at this point in the history
  • Loading branch information
klinki committed Mar 24, 2018
1 parent 75ab11a commit 785acaa
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 14 deletions.
2 changes: 1 addition & 1 deletion sample/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"license": "MIT",
"dependencies": {
"au-datetime-picker": "0.0.0-development",
"au-datetime-picker": "0.0.8",
"aurelia-animator-css": "^1.0.2",
"aurelia-bootstrap-datetimepicker": "^1.1.1",
"aurelia-bootstrapper": "^2.1.1",
Expand Down
5 changes: 3 additions & 2 deletions sample/src/app.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<template>
<require from="bootstrap/dist/css/bootstrap.css"></require>
<h1>${message}</h1>
<h1>${message} - ${appInfo.version}</h1>

<div class="col-sm-3">
<form>
<div class="form-group">
<date-time-picker model.bind="payment.date"></date-time-picker>
<label>Simple datetime picker</label>
<au-date-time-picker model.bind="date"></au-date-time-picker>
</div>
</form>
</div>
Expand Down
15 changes: 14 additions & 1 deletion sample/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
/** Load variables from DefinePlugin */
declare const ENV_VERSION: string;
declare const ENV_COMMITHASH: string;
declare const ENV_DATE: string;
declare const ENV_BRANCH: string;

export class App {
protected appInfo = {
version: ENV_VERSION,
commitHash: ENV_COMMITHASH,
date: ENV_DATE,
branch: ENV_BRANCH
};

protected message: string;
protected date: Date;

constructor() {
this.message = 'Hello World!';
this.message = 'au-datetime-picker example';
}
}
13 changes: 12 additions & 1 deletion sample/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const GitRevisionPlugin = require('git-revision-webpack-plugin');
const { AureliaPlugin, ModuleDependenciesPlugin } = require('aurelia-webpack-plugin');
const { ProvidePlugin, ContextReplacementPlugin, IgnorePlugin,
SourceMapDevToolPlugin, NormalModuleReplacementPlugin, DefinePlugin } = require('webpack');
Expand All @@ -17,6 +18,10 @@ const { ProvidePlugin, ContextReplacementPlugin, IgnorePlugin,
const project = require('./aurelia_project/aurelia.json');
const projectJSON = require('./package.json');

const gitRevisionPlugin = new GitRevisionPlugin({
versionCommand: 'describe --always --tags'
});

const tsLoader = 'ts-loader';

// config helpers:
Expand Down Expand Up @@ -127,6 +132,12 @@ module.exports = ({production, server, extractCss, coverage} = {}) => ({
...when(extractCss, new ExtractTextPlugin({
filename: `css/${production ? '[contenthash].css' : '[id].css'}`,
allChunks: true
}))
})),
new DefinePlugin({
'ENV_VERSION': JSON.stringify(gitRevisionPlugin.version()),
'ENV_COMMITHASH': JSON.stringify(gitRevisionPlugin.commithash()),
'ENV_DATE': JSON.stringify((new Date()).getTime()),
'ENV_BRANCH': JSON.stringify(gitRevisionPlugin.branch())
}),
]
});
24 changes: 15 additions & 9 deletions sample/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -560,15 +560,12 @@ atob@~1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/atob/-/atob-1.1.3.tgz#95f13629b12c3a51a5d215abdce2aa9f32f80773"

[email protected].0-development:
version "0.0.0-development"
resolved "https://registry.yarnpkg.com/au-datetime-picker/-/au-datetime-picker-0.0.0-development.tgz#2a680987bf10b5c51c8a692ae6cef6b477c3e009"
[email protected].8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/au-datetime-picker/-/au-datetime-picker-0.0.8.tgz#91c36500ed6331d5ff643b2ee7f39461090d3cd9"
dependencies:
aurelia-bootstrap-datetimepicker "^1.1.1"
aurelia-framework "^1.1.5"
aurelia-pal "^1.7.0"
date-fns "^2.0.0-alpha.7"
popper.js "^1.14.1"
aurelia-bootstrap-datetimepicker "^1.1.0"
eonasdan-bootstrap-datetimepicker "^4.17.47"

aurelia-animator-css@^1.0.2:
version "1.0.4"
Expand All @@ -587,6 +584,15 @@ aurelia-binding@^1.0.0, aurelia-binding@^1.3.0, aurelia-binding@^1.5.0:
aurelia-pal "^1.0.0"
aurelia-task-queue "^1.0.0"

aurelia-bootstrap-datetimepicker@^1.1.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/aurelia-bootstrap-datetimepicker/-/aurelia-bootstrap-datetimepicker-1.1.2.tgz#3731c0cd7a2d0471b1b77a4ba63f8ba389e271d6"
dependencies:
bootstrap "^3.3.7"
eonasdan-bootstrap-datetimepicker "^4.17.47"
jquery "^3.1.1"
moment "^2.18.1"

aurelia-bootstrap-datetimepicker@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/aurelia-bootstrap-datetimepicker/-/aurelia-bootstrap-datetimepicker-1.1.1.tgz#6e294e0a6f3282747dfe7142e323b96a1987fb05"
Expand Down Expand Up @@ -724,7 +730,7 @@ aurelia-pal-browser@^1.0.0:
dependencies:
aurelia-pal "^1.4.0"

aurelia-pal@^1.0.0, aurelia-pal@^1.1.1, aurelia-pal@^1.3.0, aurelia-pal@^1.4.0, aurelia-pal@^1.7.0:
aurelia-pal@^1.0.0, aurelia-pal@^1.1.1, aurelia-pal@^1.3.0, aurelia-pal@^1.4.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/aurelia-pal/-/aurelia-pal-1.7.0.tgz#443fd75c72a0b3e1daa3181f655ea770a579dd88"

Expand Down

0 comments on commit 785acaa

Please sign in to comment.