-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[editor][wip] Packaging AIConfigEditor Component with Vite #830
Draft
rholinshead
wants to merge
1
commit into
main
Choose a base branch
from
pr830
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rholinshead
force-pushed
the
pr830
branch
6 times, most recently
from
January 10, 2024 20:55
bb45a46
to
554cdc2
Compare
rholinshead
changed the title
[editor][wip] Packaging AIConfigEditor Component
[editor][wip] Packaging AIConfigEditor Component with Vite
Jan 18, 2024
This was referenced Jan 18, 2024
rholinshead
force-pushed
the
pr830
branch
3 times, most recently
from
February 1, 2024 03:16
6e6b474
to
9894720
Compare
rholinshead
force-pushed
the
pr830
branch
2 times, most recently
from
February 6, 2024 22:02
69546b7
to
101dcdf
Compare
rholinshead
force-pushed
the
pr830
branch
5 times, most recently
from
February 16, 2024 16:52
8f43f4d
to
e271706
Compare
rholinshead
force-pushed
the
pr830
branch
4 times, most recently
from
February 26, 2024 20:33
70ae6a5
to
e70bf3c
Compare
rholinshead
force-pushed
the
pr830
branch
2 times, most recently
from
March 18, 2024 16:54
ecd575f
to
52c44f3
Compare
# [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 the `aiconfig-editor` dir and run `yarn && yarn build` before running `npm 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 1. Rebase onto main. Fix merge conflicts and any other merge scenarios, especially: - Handling core editor files that were added or moved (e.g. utils, components) — make sure they are properly moved to the right place under `aiconfig-editor` dir instead of being top-level alongside `LocalEditor` - Handling `package.json` changes — this one is a huge pain to deal with. Make sure the change is in the correct `package.json` (i.e. if package added for editor core, should be in `aiconfig-editor package.json`). This might require a bit of finagling to be able to `yarn` and `yarn 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-level `package.json` for `yarn` to work there, then `yarn` and `yarn build` in `aiconfig-editor`, then point top-level package back to local `aiconfig-editor` and then `yarn` again If all files are good, the following order should work: 2. In `/client`, run `yarn` 3. In `client/aiconfig-editor`, run `yarn && yarn build` 4. In `/client`, run `rm -rf node_modules && yarn && yarn build` 5. Make sure there are no errors in `LocalEditor` or `AIConfigEditor`. Then, test the local editor in dev and prod mode to make sure they are still good. 6. If all is good, go back to `client/aiconfig-editor` and bump the package version number and then `yarn build` 7. Finally, can run `npm publish` from `client/aiconfig-editor`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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