Browse Source

node v0.10 support

pull/1/head
rozetko 7 years ago
parent
commit
a7dc1a7e18
  1. 8
      server/.babelrc
  2. 14
      server/build/webpack.base.conf.js
  3. 2251
      server/package-lock.json
  4. 8
      server/package.json
  5. 14
      server/src/services/notification.ts
  6. 2
      server/tsconfig.json

8
server/.babelrc

@ -0,0 +1,8 @@
{
"presets": [
"es2015"
],
"plugins": [
"transform-runtime"
]
}

14
server/build/webpack.base.conf.js

@ -41,11 +41,17 @@ module.exports = {
extensions: [".ts", ".js"]
},
module: {
rules: [
loaders: [
{
test: /\.ts$/,
loader: "ts-loader",
exclude: /node_modules/
test: /\.ts?$/,
loaders: ['babel-loader', 'ts-loader'],
exclude: [ /node_modules/ ]
},
// babel-loader for pure javascript (es6) => javascript (es5)
{
test: /\.(jsx?)$/,
loaders: ['babel'],
exclude: [ /node_modules/ ]
}
]
}

2251
server/package-lock.json generated

File diff suppressed because it is too large Load Diff

8
server/package.json

@ -24,6 +24,14 @@
},
"devDependencies": {
"@types/express": "^4.11.1",
"babel-core": "^6.26.3",
"babel-loader": "^6.4.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-polyfill": "^6.26.0",
"babel-preset-es2015": "^6.24.1",
"babel-runtime": "^6.26.0",
"nodemon": "^1.17.3",
"ts-loader": "^3.5.0",
"typescript": "^2.8.3",

14
server/src/services/notification.ts

@ -117,21 +117,21 @@ function removeNotification(ctx) {
}
}
const Telegraf = require('telegraf');
// const Telegraf = require('telegraf');
let botConfig: BotConfig;
let bot;
function tgBotInit() {
try {
botConfig = loadBotConfig();
bot = new Telegraf(botConfig.token);
// botConfig = loadBotConfig();
// bot = new Telegraf(botConfig.token);
bot.use(commandArgs);
// bot.use(commandArgs);
bot.command('addNotification', addNotification);
bot.command('removeNotification', removeNotification);
// bot.command('addNotification', addNotification);
// bot.command('removeNotification', removeNotification);
bot.startPolling();
// bot.startPolling();
} catch(e) {
// TODO: handle exception
}

2
server/tsconfig.json

@ -4,7 +4,7 @@
"sourceMap": true,
"noImplicitAny": false,
"module": "commonjs",
"target": "es2015",
"target": "es6",
"allowJs": true
}
}

Loading…
Cancel
Save