Skip to content

Latest commit

 

History

History
84 lines (72 loc) · 4.79 KB

File metadata and controls

84 lines (72 loc) · 4.79 KB

Pre-requisites

  • Ensure the backend of the service has been set up
  • Install VSCode, this app can only be run via VS Code.

Getting Started

  • In the ./codex-vscode folder:
    • Create a .env file under ./environments/.env
    • Install dependencies npm i
  • In the root folder, build the css bundle: npm run build:css
  • Run the application listening for changes:
    • npm run watch
    • This will run both the codex-webview and codex-vscode watch commands
  • Launch the application by navigating to Run > Debug, or hitting F5

Private Packages in VSCode

GitHub-produced packages

  • To use the GitHub produced packages you'll need a GitHub Personal Access Token

    • Export the token into zshenv
     echo "export GITHUB_TOKEN=<your-token-here>" >> ~/.zshenv
     source ~/.zshenv
    
  • The CCL repo produces new packages, tagged with latest on each merge into its development branch

  • To use the latest package produced by CCL, run the following command:

    npm install @usecodex/common-library@latest

  • CCL also produces alpha builds based on CI runs of any topic branch

    • These are useful to install in your vscode topic branch if you're making changes to both repos at the same time and want to use your CCL changes in vscode as you work
      • One place to find the alpha package is to look at the CCL packages page and copy the version number
      • Update your local vscode branch using npm install @usecodex/common-library@1.4.1-alpha-25804fb8.0, for example
      • 💡 Alpha builds should not be merged into vscode development branch
  • Codex UI (prompt-ui) produces 2 packages, @usecodex/prompt-ui-core & @usecodex/prompt-ui-svelte; a new beta release is published upon merge to development. These packages are consumed in the codex-webview package.

Local private package instance (example: CCL)

  • Alternatively, you can link your locally built instance of CCL in your VSCode branch if you don't have a CI-produced package to link to your VSCode branch
    • Build the CCL repo
    • In VSCode package.json file, change the @usecodex/common-library entry to read something like:
      • @usecodex/common-library: "file:../codex-common-library/build/ccl"
      • npm i to resolve the new package you want
    • Alternatively you can do the following:
      • npm i ../codex-common-library/build/ccl
  • You can follow similar steps for the other private packages you may need to consume.

Running against local API server

  • Ensure you have the following property set up correctly in your .env file here: API_URL="https://dev.usecodex.com/api/"
  • Follow the README instructions in the codex-api repo
  • Your locally running VSCode extension should now be issuing API requests against your locally running API server instance

Packaging VS Code Extension

  • Ensure you install the latest CCL package -> npm update @usecodex/common-library
    • Double check your package-lock file to ensure this is pointing to a releaseable version (i.e. not alpha)
  • Package vscode:
    • Select which environment you want to build for by changing the suffix on the webpack config in the npm run package command.
      • Options: dev = config, staging = stag, production = prod
    • vsce package
      • You may need to run npm i -g vsce to install it globally.
    • Hit 'y' a few times
  • To install, follow the installation video - https://codexbuild.notion.site/Onboarding-Guide-FAQs-30bb0a79b1e54afa98ea197f6aa95981

Marketplace Details

  • README.md & CHANGELOG.md both show up in the marketplace
  • Updating README.md:
    • Assets need to be uploaded into our S3 bucket
    • Update the baseImagesUrl argument in the vsce:package command

Running A Second Extension Window

  • Open a second VS Code instance in the dummy-folder
    • i.e. code ./dummy-folder
  • Launch the second window like we launch the first, by navigating to Run > Debug, or hitting F5

Debugging the client version checker

  • in your .env file, add the following entry: FORCE_CLIENT_CHECK=true
    • This will allow you to override the check where we skip the client verification if NODE_ENV is set to development
  • Set a version below our currently supported minimum version, like VERSION=1.3.1 in your .env file
  • Tip: you may also want to reduce the delay between checks in clientVersionChecker.helper.ts#ONE_HOUR_IN_MS to something like every second (1000)
  • Start the debugger

Useful Tips

  • Reload the application with Cmd+R
  • Open the debug console in the development window with Cmd+Shft+P, enter in Codex: Debug