ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

New Build System: Rollup


#1

Hello community,

We are moving our manual build system based on Node.js to a module bundler called Rollup.

This will enable us to write JS in the new ES6 module format.

Frappe’s build system was based on the file build.json which contains the input and output mapping of files. The new system based on rollup will also support build.json but it will be deprecated soon.

Here’s the relevant PR: https://github.com/frappe/frappe/pull/5010

This also required some changes in bench, which explains the recent issues popping up in bench update. :sweat_smile:

Please help me test the new system by updating your bench and checking out my rollup branch, so that we can release it bug free.


Bench Update Error on Production Image
#2

Will this will change the way to include custom js? Actually they are built using build.json


#3

Yes, you can include other JS files using the syntax

import CustomFunction from './custom';

Including files in build.json is not needed.


#4

I hope you meant contributable JS :wink:


#5

yup for sure :grimacing: …doing my best :wink:


#6

Please, try to update documentation also provide examples. :stuck_out_tongue: :slight_smile:
Good luck.


#7

The PR has been merged!


#8

@netchampfaris first thanks for your efforts and shall I change the custom scripts in my instance? I have many custom scripts running with my doctypes. Please advise…


#9

Custom Scripts shouldn’t be affected


#10

@netchampfaris I trying to use multi-bench-setup but I am facing some problem

$ sudo bench get-app https://github.com/frappe/erpnext.git
INFO:bench.app:getting app erpnext
INFO:bench.utils:git clone https://github.com/frappe/erpnext.git  --depth 1 --origin upstream
Cloning into 'erpnext'...
remote: Counting objects: 6645, done.
remote: Compressing objects: 100% (5868/5868), done.
remote: Total 6645 (delta 1303), reused 3374 (delta 611), pack-reused 0
Receiving objects: 100% (6645/6645), 182.10 MiB | 2.37 MiB/s, done.
Resolving deltas: 100% (1303/1303), done.
Checking connectivity... done.
('installing', u'erpnext')
INFO:bench.app:installing erpnext
INFO:bench.utils:./env/bin/pip install -q  -e ./apps/erpnext --no-cache-dir

> frappe@ production /home/mohd/new-bench/apps/frappe
> FRAPPE_ENV=production node rollup/build.js

module.js:557
    throw err;
    ^

Error: Cannot find module 'rollup'
    at Function.Module._resolveFilename (module.js:555:15)
    at Function.Module._load (module.js:482:25)
    at Module.require (module.js:604:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/mohd/new-bench/apps/frappe/rollup/build.js:4:16)
    at Module._compile (module.js:660:30)
    at Object.Module._extensions..js (module.js:671:10)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frappe@ production: `FRAPPE_ENV=production node rollup/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the frappe@ production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

#11

You need to run bench setup requirements first


How to update ERPNEXT fron V8 to V11
#12

From which bench version are we talking? The latest release is 4.1 but with this, I get:

Usage: bench setup [OPTIONS] COMMAND [ARGS]...

Error: No such command "requirements".

#13

Make sure you run the command from the frappe-bench folder. Also, make sure to pull the latest changes of frappe and erpnext.


#14

I have bench 4.1, frappe 10.1.45. I run:

$ bench init /home/frappe/frappe-bench

and then this fails:

$ cd /home/frappe/frappe-bench && bench setup requirements
Usage: bench setup [OPTIONS] COMMAND [ARGS]...

Error: No such command "requirements".

Any suggestions?


#15

@dmorlock

bench setup --requirements


#16
$ bench setup --requirements
Error: no such option: --requirements

You’re sure that I can use the latest bench release 4.1? This release is from 2016: https://github.com/frappe/bench/releases


#17

bench update --requirements


#18

This seems to work. Thank you @shahid!
Is there any reason why there is no recent release for bench?


Unknown column tabPayment Entry.delivery_note after upgrade from v10 to v11