ES6/Typescript Build and Development system for Oportun.
once set up run
npm start to begin working with a module
npm run build will produce a version of the module that can be imported into a legacy app exactly as is done today. ( builds are still a work in progress )
Process to convert a modules.
From within a module you wish to upgarde you will need to do the following
npm install -save-dev @oportun/op-build-tools
Next you can choose to run the op-build-tools installer. This is recomended and automates some of the conversion process, such as setting up your entry point, adding tsconfigs, and removing unused packages/configs
once this is done you should run
npm install to make sure dependencies added by the installer are installed. TODO automate this step in the installer
While your module is still being used in a legacy app you will want to run
grunt serve -l from the legacy app container.
Then from within your module, run
npm start this command will prompt you for the Name of the app your working with, select this and press enter. From here you browser will open, and will hot reload as you make changes to the module.
process to convert a module are as follows
Open ./src/index.ts there are some instructions in there if you used the installer, that will help you get your entry point configured.
For all your src files, one by one move them into the ./src directory.
import as needed in your entry file.
Remove the IIFE, and add an
export default as apropiate for each file
For angular modules we export the .name, for services and factories export the function, for components you export the config object.
rince and repeat until the whole module is converted. In most cases this can be done in a day or two...its easy, but boring and tedius. op-common is a psecial case that will take some time to convert.