Apex 4X and NPM, a ChatGPT AI Experiment

Apex 4X and NPM, a ChatGPT AI Experiment


This is sort of exciting! (In a nerdy sort of way…)


First, here’s the boring part, Apex 4X now supports NPM direct install into any project, making it available into any such project as part of the project dependencies after that.


Example:


·??????Open Git CMD and navigate to your project directory.

·??????Enter “npm install apex4x”

·??????Import 4X including all available accessible widget modules using: import “apex4x”;

·??????Use window.$A including all of the widget setup configurations as desired.


Also, you can customize the accessible modules that you wish to import by doing the following.


·??????Open the file: node_modules/apex4x/BuildBundle.js

·??????Comment out any modules that you don’t wish to use within your project.

·??????Run “BuildBundleInstall.sh” to add the dev dependencies so you can generate a new bundle.

·??????Then run “BuildBundle.sh” to build a new bundle using the new build configuration you specified.


(You can do this last part even if you simply clone/download the Git repo.)


Now, that’s out of the way, here’s the cool part!


This was actually based on a 4X issue that was recently submitted, which I had no idea how to actually do, so I decided to see if ChatGPT could teach me how to do it.


I’ve played with ChatGPT off and on, asking it interesting things like using x y and z ingredients what can I cook using an air fryer in less than an hour, or how do I change a lightbulb with my hands tied behind my back, or write me a poem that is 20 lines long about love using imagery from a goat, etc.


So I figured, if I could get the AI to write romantic goat poetry, it should be able to teach me something equally useful!


I won’t bore you with the many pages of back and forth questions and answers starting with “How do I convert a github project into an NPM project that can be installed without changing the folder structure of the original git project by importing multiple js and multiple css files in the correct order and generate a single bundled js file that can be imported into any javascript project?”


The process was interesting, because it really was like a conversation. The above question generated a high level stub, and for each step I asked for further details about “step by step instructions for doing x” and it would provide code examples and explain what the meanings were for specific actions and so on. At times the instructions didn’t work, so when I said this it would provide an alternative way of doing it instead, and eventually I had the whole project built and published on NPM!


I know that if I tried to work out how to do all of this on my own from scratch, it would have required at least a couple of weeks to read up on the architecture and different bundler packages and associated config files and the syntax for working with each and so on and on while doing other necessary stuff each day at the same time.


Instead, using ChatGPT, it took me 1 day to do all of this. It really was amazingly helpful, and I actually learned some new skills that are as useful as knowing how to write goat poetry! (Almost)


要查看或添加评论,请登录

Bryan Garaventa的更多文章

社区洞察

其他会员也浏览了