-
Notifications
You must be signed in to change notification settings - Fork 4
[FEAT] Add support for Vite/React #2
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: Publish npm Package to npm | ||
|
|
||
| on: | ||
| release: | ||
| types: [created] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '20' | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: ./ufazien-cli-js | ||
| run: npm ci | ||
|
|
||
| - name: Build package | ||
| working-directory: ./ufazien-cli-js | ||
| run: npm run build | ||
|
|
||
| - name: Publish to npm | ||
| working-directory: ./ufazien-cli-js | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| run: npm publish --access public |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Publish Python Package to PyPI | ||
|
|
||
| on: | ||
| release: | ||
| types: [created] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
|
|
||
| - name: Install build dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install build twine | ||
|
|
||
| - name: Build package | ||
| working-directory: ./ufazien-cli-py | ||
| run: | | ||
| python -m build | ||
|
|
||
| - name: Publish to PyPI | ||
| working-directory: ./ufazien-cli-py | ||
| env: | ||
| TWINE_USERNAME: __token__ | ||
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
| run: | | ||
| python -m twine upload dist/* | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: 'Version to release (e.g., 0.1.0)' | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| release: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Get version from tag or input | ||
| id: get_version | ||
| run: | | ||
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | ||
| echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | ||
| echo "tag=v${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT | ||
| elif [[ "${{ github.ref }}" == refs/tags/* ]]; then | ||
| VERSION=${GITHUB_REF#refs/tags/v} | ||
| echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
| echo "tag=${{ github.ref_name }}" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Get package versions | ||
| id: get_package_versions | ||
| run: | | ||
| if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == refs/tags/* ]]; then | ||
| # Extract versions from package files | ||
| PYTHON_VERSION=$(grep -E '^version\s*=' ufazien-cli-py/pyproject.toml | sed -E 's/.*version\s*=\s*"([^"]+)".*/\1/' | sed -E 's/.*version\s*=\s*([0-9.]+).*/\1/') | ||
martian56 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| NPM_VERSION=$(grep -E '"version"' ufazien-cli-js/package.json | head -1 | sed -E 's/.*"version"\s*:\s*"([^"]+)".*/\1/') | ||
| echo "python_version=$PYTHON_VERSION" >> $GITHUB_OUTPUT | ||
| echo "npm_version=$NPM_VERSION" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "python_version=${{ steps.get_version.outputs.version }}" >> $GITHUB_OUTPUT | ||
| echo "npm_version=${{ steps.get_version.outputs.version }}" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Create Release | ||
| uses: softprops/action-gh-release@v1 | ||
| with: | ||
| tag_name: ${{ steps.get_version.outputs.tag }} | ||
| name: Release ${{ steps.get_version.outputs.tag }} | ||
| body: | | ||
| ## Changes in ${{ steps.get_version.outputs.tag }} | ||
|
|
||
| ### Python Package | ||
| - Version: ${{ steps.get_package_versions.outputs.python_version }} | ||
| - Install: `pip install ufazien-cli==${{ steps.get_package_versions.outputs.python_version }}` | ||
|
|
||
| ### npm Package | ||
| - Version: ${{ steps.get_package_versions.outputs.npm_version }} | ||
| - Install: `npm install -g ufazien-cli@${{ steps.get_package_versions.outputs.npm_version }}` | ||
|
|
||
| ## Installation | ||
|
|
||
| **Python:** | ||
| ```bash | ||
| pip install ufazien-cli | ||
| ``` | ||
|
|
||
| **Node.js:** | ||
| ```bash | ||
| npm install -g ufazien-cli | ||
| ``` | ||
| draft: false | ||
| prerelease: false | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| name: Test npm Package | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - 'ufazien-cli-js/**' | ||
| - '.github/workflows/test_npm_package.yml' | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macos-latest] | ||
| node-version: ['18', '20', '22'] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js ${{ matrix.node-version }} | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node-version }} | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: ./ufazien-cli-js | ||
| run: npm ci | ||
|
|
||
| - name: Build package | ||
| working-directory: ./ufazien-cli-js | ||
| run: npm run build | ||
|
|
||
| - name: Type check | ||
| working-directory: ./ufazien-cli-js | ||
| run: npx tsc --noEmit | ||
|
|
||
| - name: Test package installation | ||
| working-directory: ./ufazien-cli-js | ||
| run: | | ||
| npm pack | ||
| npm install -g ufazien-cli-*.tgz | ||
martian56 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Verify CLI command | ||
| run: | | ||
| ufazienjs --help | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: Test Python Package | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - 'ufazien-cli-py/**' | ||
| - '.github/workflows/test_python_pkg.yml' | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macos-latest] | ||
| python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: ./ufazien-cli-py | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install -e . | ||
|
|
||
| - name: Install test dependencies | ||
| working-directory: ./ufazien-cli-py | ||
| run: | | ||
| pip install pytest pytest-cov black ruff mypy | ||
|
|
||
| - name: Check code formatting with Black | ||
| working-directory: ./ufazien-cli-py | ||
| run: | | ||
| black --check src/ | ||
|
|
||
| - name: Lint with Ruff | ||
| working-directory: ./ufazien-cli-py | ||
| run: | | ||
| ruff check src/ | ||
|
|
||
| - name: Type check with mypy | ||
| working-directory: ./ufazien-cli-py | ||
| run: | | ||
| mypy src/ || true | ||
martian56 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Test package installation | ||
| working-directory: ./ufazien-cli-py | ||
| run: | | ||
| python -m pip install build | ||
| python -m build | ||
| pip install dist/*.whl | ||
martian56 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Verify CLI command | ||
| run: | | ||
| ufazien --help | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ pnpm-lock.yaml | |
|
|
||
| # Build output | ||
| dist/ | ||
| test/ | ||
| *.tsbuildinfo | ||
|
|
||
| # Environment | ||
|
|
||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.