Closed bdemann closed 4 months ago
I didn't end up saving most of the regex for the conversions I think that would have slowed down the process a lot of not a lot of benefit. After a while of writing regex it started to come more naturally and it felt less important to keep a record as I was feeling confident that I could repeat the process again if I needed to and might even produce better regex. With that being said, here are some of the ones I did save, since they are already saved we might as well record them for posterity instead of deleting them.
Here are the steps I used
add name to similar package.json
Copy to new location
Delete node_modules, .dfx, .azle, and test/tests.ts
add "experimentalDecorators": true, "preserveSymlinks": true
to tsconfig
Add coresponding package to package.json ("audio_recorder_end_to_end_test_functional_syntax": "file:../../../../../examples/audio_recorder",)
Add to pretest the linking hack
import { linkAndInstallPatch } from 'azle/test/jest_link'; import { join } from 'path'; linkAndInstallPatch(join('examples', 'query'));
There will be scripts in script/class_migration that will do a lot of these tasks automatically
The do_all_something.js script will run a given script for all of the projects in a directory
so for example I would start in the examples dir and run ../../scripts/class_migration/do_all_something.js ../../script/class_migration/the_script_I_want_to_run.js
and then I would jump down to motoko examples and run it again (with the paths updated to reflect the cd to motoko_examples)