feat(cli): add initial CLI implementation with argument parsing and prompt handling
- Created package.json and package-lock.json for CLI package. - Implemented argument parsing in args.ts to handle various flags and commands. - Developed main CLI logic in cli.ts to execute commands and handle errors. - Added configuration loading from a JSON file in config.ts, with environment variable support. - Implemented prompt resolution and provider interaction in prompt.ts. - Added usage documentation for the CLI. - Configured TypeScript settings in tsconfig.json for the CLI package. - Updated README in vscode package to reflect the new CLI functionality. - Refactored root tsconfig.json to streamline project structure.
This commit is contained in:
@@ -29,32 +29,30 @@ jobs:
|
||||
git checkout ${{ gitea.sha }}
|
||||
fi
|
||||
|
||||
- name: Install dependencies
|
||||
- name: Install Chrome package dependencies
|
||||
run: npm ci --prefer-offline --no-audit --no-fund
|
||||
working-directory: /tmp/lexai
|
||||
working-directory: /tmp/lexai/packages/chrome
|
||||
|
||||
# Generates .wxt/types (ImportMeta.env etc.) required by typecheck.
|
||||
# Also runs via the postinstall hook — kept explicit so a future
|
||||
# --ignore-scripts install can't silently break the typecheck step.
|
||||
- name: Prepare WXT types
|
||||
run: npx wxt prepare
|
||||
working-directory: /tmp/lexai
|
||||
working-directory: /tmp/lexai/packages/chrome
|
||||
|
||||
- name: Type check
|
||||
run: npm run typecheck
|
||||
working-directory: /tmp/lexai
|
||||
working-directory: /tmp/lexai/packages/chrome
|
||||
|
||||
- name: Run unit tests
|
||||
run: npm test -- --run
|
||||
working-directory: /tmp/lexai
|
||||
working-directory: /tmp/lexai/packages/chrome
|
||||
|
||||
- name: Build extension
|
||||
run: npm run build
|
||||
working-directory: /tmp/lexai
|
||||
working-directory: /tmp/lexai/packages/chrome
|
||||
|
||||
- name: Verify build output
|
||||
run: ls -la .output/chrome-mv3/
|
||||
working-directory: /tmp/lexai
|
||||
working-directory: /tmp/lexai/packages/chrome
|
||||
|
||||
- name: Package as ZIP
|
||||
run: |
|
||||
@@ -64,7 +62,7 @@ jobs:
|
||||
zip -r /tmp/lexai-chrome-mv3-${VERSION}.zip .output/chrome-mv3/
|
||||
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
|
||||
echo "✅ Packaged: lexai-chrome-mv3-${VERSION}.zip"
|
||||
working-directory: /tmp/lexai
|
||||
working-directory: /tmp/lexai/packages/chrome
|
||||
|
||||
- name: Publish to Gitea Package Registry
|
||||
if: gitea.event_name == 'push'
|
||||
|
||||
@@ -30,24 +30,29 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
working-directory: packages/chrome
|
||||
|
||||
# Same gates as CI — a release must never check less than a push.
|
||||
- name: Prepare WXT types
|
||||
run: npx wxt prepare
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Type check
|
||||
run: npm run typecheck
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Run tests
|
||||
run: npm test -- --run
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Build extension
|
||||
run: npm run build
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Package as ZIP
|
||||
run: |
|
||||
VERSION=${{ gitea.ref_name || 'manual' }}
|
||||
ZIPFILE="$(pwd)/lexai-chrome-mv3-${VERSION}.zip"
|
||||
ZIPFILE="$(cd ../.. && pwd)/lexai-chrome-mv3-${VERSION}.zip"
|
||||
# Verify manifest exists and check version
|
||||
node -e "console.log('Manifest version:', require('./.output/chrome-mv3/manifest.json').version)"
|
||||
# Zip from inside the chrome-mv3 dir so manifest.json is at root
|
||||
@@ -55,6 +60,7 @@ jobs:
|
||||
echo "ZIP_FILE=${ZIPFILE}" >> $GITHUB_ENV
|
||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
||||
echo "✅ Packaged: lexai-chrome-mv3-${VERSION}.zip"
|
||||
working-directory: packages/chrome
|
||||
|
||||
|
||||
- name: Get Chrome Web Store OAuth2 Token
|
||||
|
||||
@@ -23,21 +23,26 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Type check
|
||||
run: npm run typecheck
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Run unit tests
|
||||
run: npm test -- --run
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Build extension
|
||||
run: npm run build
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Package preview ZIP
|
||||
run: |
|
||||
PR_NUM=${{ gitea.event.pull_request.number }}
|
||||
zip -r lexai-pr-${PR_NUM}-preview.zip .output/chrome-mv3/
|
||||
zip -r ../../lexai-pr-${PR_NUM}-preview.zip .output/chrome-mv3/
|
||||
echo "✅ PR #${PR_NUM} build successful"
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Comment on PR
|
||||
run: |
|
||||
|
||||
@@ -23,20 +23,24 @@ jobs:
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Run tests
|
||||
run: npm test -- --run
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Build extension
|
||||
run: npm run build
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Package as ZIP
|
||||
run: |
|
||||
VERSION=${{ gitea.ref_name }}
|
||||
ZIPFILE="$(pwd)/lexai-chrome-mv3-${VERSION}.zip"
|
||||
ZIPFILE="$(cd ../.. && pwd)/lexai-chrome-mv3-${VERSION}.zip"
|
||||
# Zip from inside the chrome-mv3 dir so manifest.json is at root of the archive
|
||||
cd .output/chrome-mv3 && zip -r "$ZIPFILE" . && cd -
|
||||
echo "ZIP_FILE=${ZIPFILE}" >> $GITHUB_ENV
|
||||
working-directory: packages/chrome
|
||||
|
||||
- name: Create Release
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user