Skip to content

Commit

Permalink
* Point frappejs version to modified git repo
Browse files Browse the repository at this point in the history
* npm script to start server
* Fix es6 module
  • Loading branch information
harish2704 committed Jul 12, 2020
1 parent a49eb4b commit d946af6
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 8 deletions.
2 changes: 1 addition & 1 deletion accounting/exchangeRate.js
@@ -1,6 +1,6 @@
let { DateTime } = require('luxon');

export async function getExchangeRate({ fromCurrency, toCurrency, date }) {
exports.getExchangeRate = async function getExchangeRate({ fromCurrency, toCurrency, date }) {
if (!date) {
date = DateTime.local().toISODate();
}
Expand Down
21 changes: 21 additions & 0 deletions fix-require.js
@@ -0,0 +1,21 @@
const Module = require('module');
const originalRequire = Module.prototype.require;

Module.prototype.require = function(moduleName) {
let target = moduleName;
if (moduleName === '@/router') {
return {
default: {
push: () => console.log('Router.push called on server')
}
};
} else if (moduleName.endsWith('.vue')) {
console.log(`Requiring vue file ${moduleName}. should be fixed.`);
return {};
} else if (moduleName.indexOf('@/') === 0) {
target = process.env.PWD + '/src' + moduleName.slice(1);
} else if (moduleName.indexOf('~/') === 0) {
target = process.env.PWD + moduleName.slice(1);
}
return originalRequire.call(this, target);
};
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -8,6 +8,7 @@
},
"scripts": {
"serve": "vue-cli-service serve",
"server": "node -r ./fix-require.js server/",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"electron:build": "vue-cli-service electron:build",
Expand All @@ -21,7 +22,7 @@
"core-js": "^3.4.3",
"electron-store": "^5.1.0",
"frappe-charts": "^1.3.0",
"frappejs": "https://github.com/frappe/frappejs",
"frappejs": "https://github.com/harish2704/frappejs#cleanup-for-client-server",
"knex": "https://github.com/harish2704/knex#fix-escape-single-quotes-in-defalutto",
"lodash": "^4.17.15",
"luxon": "^1.21.3",
Expand Down
53 changes: 47 additions & 6 deletions yarn.lock
Expand Up @@ -2950,6 +2950,11 @@ color@^3.0.0:
color-convert "^1.9.1"
color-string "^1.5.2"

colorette@1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.1.0.tgz#1f943e5a357fac10b4e0f5aaef3b14cdc1af6ec7"
integrity sha512-6S062WDQUXi6hOfkO/sBPVwE5ASXY4G2+b4atvhJfSsuUUhIaUKlkjLe9692Ipyt5/a+IPF5aVTu3V5gvXq5cg==

colorette@1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b"
Expand All @@ -2972,6 +2977,11 @@ commander@^2.13.0, commander@^2.18.0, commander@^2.20.0, commander@~2.20.3:
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==

commander@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068"
integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==

commander@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae"
Expand Down Expand Up @@ -5177,9 +5187,9 @@ frappe-charts@^1.3.0:
resolved "https://registry.yarnpkg.com/frappe-charts/-/frappe-charts-1.3.0.tgz#9ed033fa64833906bba16554187fa2f8a3a54ef6"
integrity sha512-hdLv4fOIVgIL5eV9KYlsQaEpxkcJvuEVVDJewJL8PG0ySPy5EEiG5KZGL2uj7YegVWbtsqJ4Oq/74mjgQoMdag==

"frappejs@https://github.com/frappe/frappejs":
"frappejs@https://github.com/harish2704/frappejs#cleanup-for-client-server":
version "0.0.10"
resolved "https://github.com/frappe/frappejs#80dd922e157e1cba5ed81503141e4ef65eabb489"
resolved "https://github.com/harish2704/frappejs#a6952b809055e450084d7b582f590898b673a598"
dependencies:
autoprefixer "9.6.1"
babel-core "^6.26.3"
Expand Down Expand Up @@ -6209,7 +6219,7 @@ internal-ip@^4.3.0:
default-gateway "^4.2.0"
ipaddr.js "^1.9.0"

interpret@^2.2.0:
interpret@^2.0.0, interpret@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/interpret/-/interpret-2.2.0.tgz#1a78a0b5965c40a5416d007ad6f50ad27c417df9"
integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==
Expand Down Expand Up @@ -6901,7 +6911,28 @@ kind-of@^6.0.0, kind-of@^6.0.2:
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.2.tgz#01146b36a6218e64e58f3a8d66de5d7fc6f6d051"
integrity sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==

knex@^0.20.3, "knex@https://github.com/harish2704/knex#fix-escape-single-quotes-in-defalutto":
knex@^0.20.3:
version "0.20.15"
resolved "https://registry.yarnpkg.com/knex/-/knex-0.20.15.tgz#b7e9e1efd9cf35d214440d9439ed21153574679d"
integrity sha512-WHmvgfQfxA5v8pyb9zbskxCS1L1WmYgUbwBhHojlkmdouUOazvroUWlCr6KIKMQ8anXZh1NXOOtIUMnxENZG5Q==
dependencies:
colorette "1.1.0"
commander "^4.1.1"
debug "4.1.1"
esm "^3.2.25"
getopts "2.2.5"
inherits "~2.0.4"
interpret "^2.0.0"
liftoff "3.1.0"
lodash "^4.17.15"
mkdirp "^0.5.1"
pg-connection-string "2.1.0"
tarn "^2.0.0"
tildify "2.0.0"
uuid "^7.0.1"
v8flags "^3.1.3"

"knex@https://github.com/harish2704/knex#fix-escape-single-quotes-in-defalutto":
version "0.21.2"
resolved "https://github.com/harish2704/knex#22ace70277df1073e6974026d56cb4216e7a3a29"
dependencies:
Expand Down Expand Up @@ -8612,6 +8643,11 @@ performance-now@^2.1.0:
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=

pg-connection-string@2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.1.0.tgz#e07258f280476540b24818ebb5dca29e101ca502"
integrity sha512-bhlV7Eq09JrRIvo1eKngpwuqKtJnNhZdpdOlvrPrA4dxqXPjxSrbNrfnIDmTpwMyRszrcV4kU5ZA4mMsQUrjdg==

pg-connection-string@2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/pg-connection-string/-/pg-connection-string-2.3.0.tgz#c13fcb84c298d0bfa9ba12b40dd6c23d946f55d6"
Expand Down Expand Up @@ -10911,6 +10947,11 @@ tar@^4:
safe-buffer "^5.1.2"
yallist "^3.0.3"

tarn@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/tarn/-/tarn-2.0.0.tgz#c68499f69881f99ae955b4317ca7d212d942fdee"
integrity sha512-7rNMCZd3s9bhQh47ksAQd92ADFcJUjjbyOvyFjNLwTPpGieFHMC84S+LOzw0fx1uh6hnDz/19r8CPMnIjJlMMA==

tarn@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/tarn/-/tarn-3.0.0.tgz#a4082405216c0cce182b8b4cb2639c52c1e870d4"
Expand Down Expand Up @@ -11542,12 +11583,12 @@ uuid@^3.0.1, uuid@^3.3.2:
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.3.tgz#4568f0216e78760ee1dbf3a4d2cf53e224112866"
integrity sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==

uuid@^7.0.3:
uuid@^7.0.1, uuid@^7.0.3:
version "7.0.3"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b"
integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==

v8flags@^3.2.0:
v8flags@^3.1.3, v8flags@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-3.2.0.tgz#b243e3b4dfd731fa774e7492128109a0fe66d656"
integrity sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==
Expand Down

0 comments on commit d946af6

Please sign in to comment.