- Setup a working React in Ember app
- Ember components with only templates
- Run ai gemini script
- Come up with a sample app. Docusign app with lots of markup might be good.
- Update title from super rental in package.json name and other places
- Generate loads of components with markdown
- Line up the existing scripts to run in sequence
- Migrate component files as well as templates
- Migrate parent dom components
gcloud auth login
export ACCESS_TOKEN="$(gcloud auth print-access-token)"
export PROJECT_ID=""
-> your project id from gcpnpm start
npm run migrate:create-template-only-ember-components
npm run migrate:find-potential-ember-components
npm run migrate:call-ai-model
npm run migrate:ember-components
Serves Ember.js with React components inside. Watches files and updates with file changes.
Uses ASTs to look through all Ember.js components and their respective JavaScript files if available. Has a prettier post-migrate run to update changed hbs and scs files. Removes and migrates "empty shell" components that have component.js
files and template.hbs
files, but the component.js files aren't needed to describe the behavior with template.hbs
components. template.hbs
files are easier to migrate 1:1 with presentational React jsx
files.
There's also functionality for migrating pod styles out of Ember components into global scss styles. "Near empty" components have classnames that are migrated out.
Empty component files: 1
Near empty ember component file count: 0
Found pod styles count: 0
Uses ASTs to find if the template has addons that can't be migrated yet. For instance, if there's a package that is still in use in other Ember components like a table library.
This writes to an array:
const TEMPLATE_ONLY_EMBER_COMPONENTS_WITHOUT_EMBER_CHILDREN = [
'app/components/greeting/template.hbs',
];
Migrating all Ember components would not only take a long time for the AI model. But it would also be too chaotic to review with a human.
There's a post-run call that runs prettier on this updated file.
Calls target Vertex AI model. Includes prompt engineering instructions. Also includes few-shot learning with example migrations.
This writes to a file to see the output.
Updates the target output to the designated files. Deletes the Handlebar template file and replaces it with an index.jsx
file.
The post-run script also runs lint fix and prettier to fix any standards that came up.