[editor][wip] Packaging AIConfigEditor Component with Vite #830
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[editor][wip] Packaging AIConfigEditor Component with Vite
[editor][wip] Packaging AIConfigEditor Component with Vite
This PR separates our current editor implementation into a root package containing the LocalEditor and a library package containing the AIConfigEditor and its associated code. When we want to publish the
@lastmileai/aiconfig-editor
package, just cd into theaiconfig-editor
dir and runyarn && yarn build
before runningnpm publish
.yarn build
will compile the react code to commonjs and esm format files & source maps (separated by specific folders) and the appropriate type declarations. This will allow the package to be used in most js projects.We can't land this as-is because it essentially breaks the dev x, preventing HMR from working. The next couple diffs should fix that.
For now, we can still use this for publishing the package, with the following steps:
Steps to Publish @lastmileai/aiconfig-editor
aiconfig-editor
dir instead of being top-level alongsideLocalEditor
package.json
changes — this one is a huge pain to deal with. Make sure the change is in the correctpackage.json
(i.e. if package added for editor core, should be inaiconfig-editor package.json
). This might require a bit of finagling to be able toyarn
andyarn build
both packages afterwards. Last time this happened (due to bump of aiconfig package version), I had to hard-code the aiconfig-editor to the latest version number in the top-levelpackage.json
foryarn
to work there, thenyarn
andyarn build
inaiconfig-editor
, then point top-level package back to localaiconfig-editor
and thenyarn
againIf all files are good, the following order should work:
/client
, runyarn
client/aiconfig-editor
, runyarn && yarn build
/client
, runrm -rf node_modules && yarn && yarn build
LocalEditor
orAIConfigEditor
. Then, test the local editor in dev and prod mode to make sure they are still good.client/aiconfig-editor
and bump the package version number and thenyarn build
npm publish
fromclient/aiconfig-editor