diff --git a/apps/hebrew_calendar/app.js b/apps/hebrew_calendar/app.js index 074c22988..ff30920e7 100644 --- a/apps/hebrew_calendar/app.js +++ b/apps/hebrew_calendar/app.js @@ -1,27 +1 @@ -g.clear(); - -let now = new Date(); -let today = require("hebrewDate")(now); - -var mainmenu = { - "" : { - "title" : "Hebrew Date" - }, - cal: { - value: require('locale').date(now,1), - onchange : () => {} - }, - date: { - value : today.date, - onchange : () => {} - }, - month: { - value : today.month_name, - onchange : () => {} - }, - year: { - value : today.year, - onchange : () => {} - } -}; -E.showMenu(mainmenu); +!function(){"use strict";g.clear();let e=new Date,a=require("hebrewDate")(e);var n={"":{title:"Hebrew Date"},cal:{value:require("locale").date(e,1),onchange:()=>{}},date:{value:a.date,onchange:()=>{}},month:{value:a.month_name,onchange:()=>{}},year:{value:a.year,onchange:()=>{}}};E.showMenu(n)}(); diff --git a/apps/hebrew_calendar/package.json b/apps/hebrew_calendar/package.json new file mode 100644 index 000000000..c509b70bb --- /dev/null +++ b/apps/hebrew_calendar/package.json @@ -0,0 +1,23 @@ +{ + "name": "hebrew_calendar", + "version": "0.0.1", + "description": "Bangle.js app for seeing hebrew calendar", + "main": "app.js", + "types": "app.d.ts", + "scripts": { + "build": "rollup -c" + }, + "author": { + "name": "Michael Salaverry", + "url": "https://github.com/barakplasma" + }, + "license": "MIT", + "devDependencies": { + "@rollup/plugin-typescript": "^4.1.1", + "rollup": "^2.10.2", + "rollup-plugin-terser": "^5.3.0", + "terser": "^4.7.0", + "tslib": "^2.0.0", + "typescript": "^3.9.2" + } +} diff --git a/apps/hebrew_calendar/rollup.config.js b/apps/hebrew_calendar/rollup.config.js new file mode 100644 index 000000000..5f7f0746f --- /dev/null +++ b/apps/hebrew_calendar/rollup.config.js @@ -0,0 +1,15 @@ +import typescript from '@rollup/plugin-typescript'; +import { terser } from 'rollup-plugin-terser'; + +export default { + input: './src/app.ts', + output: { + dir: '.', + format: 'iife', + name: 'hebrew_calendar' + }, + plugins: [ + typescript(), + terser(), + ] +}; diff --git a/apps/hebrew_calendar/src/app.ts b/apps/hebrew_calendar/src/app.ts new file mode 100644 index 000000000..111f47184 --- /dev/null +++ b/apps/hebrew_calendar/src/app.ts @@ -0,0 +1,32 @@ +declare var Bangle: any; +declare var g: any; +declare var E: any; +declare var require: any; + +g.clear(); + +let now = new Date(); +let today = require("hebrewDate")(now); + +var mainmenu = { + "" : { + "title" : "Hebrew Date" + }, + cal: { + value: require('locale').date(now,1), + onchange : () => {} + }, + date: { + value : today.date, + onchange : () => {} + }, + month: { + value : today.month_name, + onchange : () => {} + }, + year: { + value : today.year, + onchange : () => {} + } +}; +E.showMenu(mainmenu); diff --git a/apps/hebrew_calendar/hebrewDate.js b/apps/hebrew_calendar/src/hebrewDate.js similarity index 100% rename from apps/hebrew_calendar/hebrewDate.js rename to apps/hebrew_calendar/src/hebrewDate.js diff --git a/apps/hebrew_calendar/tsconfig.json b/apps/hebrew_calendar/tsconfig.json new file mode 100644 index 000000000..a341a5a5e --- /dev/null +++ b/apps/hebrew_calendar/tsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "module": "es2015", + "noImplicitAny": true, + "target": "es2015" + }, + "include": [ + "src" + ] +}