diff --git a/.changeset/beige-steaks-turn.md b/.changeset/beige-steaks-turn.md deleted file mode 100644 index 7f617235..00000000 --- a/.changeset/beige-steaks-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@wpsocio/wpdev": patch ---- - -Update CLI to use current version as the source of truth diff --git a/.changeset/breezy-sloths-add.md b/.changeset/breezy-sloths-add.md new file mode 100644 index 00000000..d4404bd3 --- /dev/null +++ b/.changeset/breezy-sloths-add.md @@ -0,0 +1,5 @@ +--- +"wptelegram": patch +--- + +Fixed the emojis in notifications not being sent. diff --git a/.changeset/config.json b/.changeset/config.json index 62cdab9a..8ebdbd8e 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -2,7 +2,7 @@ "$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json", "changelog": [ "@changesets/changelog-github", - { "repo": "wpsocio/wp-plugins-dev" } + { "repo": "irshadahmad21/wp-plugins-dev-test" } ], "commit": false, "fixed": [], @@ -10,5 +10,9 @@ "access": "restricted", "baseBranch": "main", "updateInternalDependencies": "patch", + "privatePackages": { + "tag": true, + "version": true + }, "ignore": [] } diff --git a/.changeset/plenty-years-jam.md b/.changeset/plenty-years-jam.md deleted file mode 100644 index 3fd8cff4..00000000 --- a/.changeset/plenty-years-jam.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"wptelegram-login": patch -"wptelegram-widget": patch ---- - -Fixed the block CSS not loaded in site editor diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..be092276 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,110 @@ +name: Deploy + +on: + release: + types: [published] + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + tag: + name: New release + needs: [details] + runs-on: ubuntu-latest + if: ${{ fromJson(needs.details.outputs.result).shouldDeploy }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Environment + uses: ./actions/setup + with: + lockfile: pnpm-hashed.lock + enable-wireit-cache: true + + - name: Prepare bundle + run: | + pnpm wpdev bundle ${{ fromJson(needs.details.outputs.result).name }} + + - name: Upload release assets + uses: AButler/upload-release-assets@v3.0 + with: + # e.g. dist/plugin-name-1.0.0.zip + files: "dist/${{ fromJson(needs.details.outputs.result).name }}-${{ fromJson(needs.details.outputs.result).version }}.zip" + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Deploy to WordPress.org + id: deploy + uses: 10up/action-wordpress-plugin-deploy@stable + with: + dry-run: true + env: + SLUG: ${{ fromJson(needs.details.outputs.result).name }} + VERSION: ${{ fromJson(needs.details.outputs.result).version }} + BUILD_DIR: "dist/${{ fromJson(needs.details.outputs.result).name }}" + ASSETS_DIR: "${{ fromJson(needs.details.outputs.result).path }}/.wordpress-org" + SVN_USERNAME: ${{ secrets.SVN_USERNAME }}test + SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}test + + - name: Copy README.md to dist + run: | + cp ${{ fromJson(needs.details.outputs.result).path }}/README.md dist/${{ fromJson(needs.details.outputs.result).name }}/README.md + + - name: Deploy to repo + uses: manzoorwanijk/action-deploy-to-repo@v3 + with: + src_dir: dist/${{ fromJson(needs.details.outputs.result).name }} + target_repo: ${{ github.repository_owner }}/${{ fromJson(needs.details.outputs.result).name }} + target_dir: "." + target_branch: main + access_token: ${{ secrets.GH_ACCESS_TOKEN }} + # Remove everything from the target repo before deploying + cleanup_command: git rm -rf . && git clean -fxd + + details: + name: Get details + runs-on: ubuntu-latest + outputs: + result: ${{ steps.details.outputs.result }} + steps: + - name: Get release details + uses: actions/github-script@v7 + id: details + with: + script: | + const tagRegex = /^(?.+)@(?[^@]+)$/; + + const result = '${{ github.event.release.tag_name }}'.match(tagRegex); + + if (!result) { + throw new Error('Invalid tag name: ${{ github.event.release.tag_name }}'); + } + + const { name, version } = result.groups; + + const plugins = [ + 'wptelegram', + 'wptelegram-comments', + 'wptelegram-login', + 'wptelegram-widget', + ]; + + const themes = []; + + const toDeploy = [...plugins, ...themes]; + + const belongsTo = plugins.includes(name) + ? 'plugins' + : themes.includes(name) + ? 'themes' + : ''; + + const path = [belongsTo, name].filter(Boolean).join('/'); + + const shouldDeploy = toDeploy.includes(name); + + return { name, version, path, shouldDeploy }; + + - name: Print details + run: | + echo "Package details: ${{ steps.details.outputs.result }}" diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index 8f4ac26f..0fa4cac4 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -13,43 +13,15 @@ jobs: matrix: php: ["7.4", "8.0", "8.1", "8.2", "8.3"] steps: - - name: Check out code + - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 2 - - - name: Setup Node.js environment - uses: actions/setup-node@v4 - with: - node-version: lts/* - - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - - uses: actions/cache@v3 - name: Setup pnpm cache - with: - path: | - ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/package.json', '**/pnpm-hashed.lock') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Install dependencies - run: pnpm install - - - name: Setup PHP - uses: shivammathur/setup-php@v2 + - name: Setup Environment + uses: ./actions/setup with: + lockfile: pnpm-hashed.lock php-version: ${{ matrix.php }} - tools: phpcs + enable-wireit-cache: true - name: Check syntax errors # For plugins, we need to check production dependencies as well @@ -59,7 +31,7 @@ jobs: pnpm -r --parallel --filter "./plugins/**" exec composer install --no-dev find ./plugins/*/src ./packages/php/*/src ! -path "*/vendor/*" ! -path "*/node_modules/*" -type f -name '*.php' -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" ) - - name: Setup + - name: Setup PHP run: "pnpm run setup:php" - name: Lint @@ -75,40 +47,14 @@ jobs: runs-on: ubuntu-latest steps: - - name: Check out code + - name: Checkout uses: actions/checkout@v4 - with: - fetch-depth: 2 - - - name: Setup Node.js environment - uses: actions/setup-node@v4 - with: - node-version: lts/* - - - uses: pnpm/action-setup@v2 - with: - version: 8 - run_install: false - - - name: Get pnpm store directory - shell: bash - run: | - echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV - - uses: actions/cache@v3 - name: Setup pnpm cache + - name: Setup Environment + uses: ./actions/setup with: - path: | - ${{ env.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/package.json', '**/pnpm-hashed.lock') }} - restore-keys: | - ${{ runner.os }}-pnpm-store- - - - name: Wireit cache - uses: google/wireit@setup-github-actions-caching/v1 - - - name: Install dependencies - run: pnpm install + lockfile: pnpm-hashed.lock + enable-wireit-cache: true - name: Lint run: "pnpm lint:js" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..7c2cb4b6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +name: Prepare or publish release + +on: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Prepare or publish release + if: github.repository == 'irshadahmad21/wp-plugins-dev-test' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Environment + uses: ./actions/setup + with: + lockfile: pnpm-hashed.lock + enable-wireit-cache: true + + - name: Create Release Pull Request or Publish + uses: changesets/action@v1 + id: changesets + with: + publish: pnpm release + version: pnpm prep-version + title: Prepare for next release + commit: Prepare for next release + env: + GITHUB_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} diff --git a/.gitignore b/.gitignore index 8d1f1a3c..0a354759 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ vendor/ !/.changeset/ !/.github/ !/.vscode/ +!/actions/ !/packages/ !/plugins/ !/tools/ @@ -42,4 +43,5 @@ build/ dist/ .env temp/ -js-translations.pot \ No newline at end of file +js-translations.pot +changeset-status.json \ No newline at end of file diff --git a/actions/setup/action.yml b/actions/setup/action.yml new file mode 100644 index 00000000..18a58f6f --- /dev/null +++ b/actions/setup/action.yml @@ -0,0 +1,87 @@ +name: "Setup Node, pnpm, PHP, WP CLI and install dependencies" +description: "This action checks out the commit, sets up Node, pnpm, PHP, WP CLI and installs dependencies." +author: "wpsocio" +inputs: + cache-key: + required: false + description: "Cache busting key. If this changes, the cache will be busted." + default: "1" + + node-version: + required: false + description: "The version of Node to use." + default: "lts/*" + + php-version: + required: false + description: "The version of PHP to use." + default: "8" + + pnpm-version: + required: false + description: "The version of pnpm to use." + default: "latest" + + lockfile: + required: false + description: "The lockfile to use." + default: "pnpm-lock.yaml" + + enable-wireit-cache: + required: false + description: "Enable Wireit cache." + default: "false" + +runs: + using: "composite" + steps: + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: ${{ inputs.node-version }} + + - uses: pnpm/action-setup@v2 + with: + version: ${{ inputs.pnpm-version }} + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: | + ${{ env.STORE_PATH }} + key: ${{ runner.os }}-modules-${{ inputs.cache-key }}-${{ hashFiles( inputs.lockfile ) }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Wireit cache + if: ${{ inputs.enable-wireit-cache == 'true' }} + uses: google/wireit@setup-github-actions-caching/v1 + + - name: Install dependencies + shell: bash + run: pnpm install + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ inputs.php-version }} + tools: phpcs + + - name: Install gettext + shell: bash + run: sudo apt install gettext + + - name: Setup WP-CLI + shell: bash + run: | + curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar + chmod +x wp-cli.phar + sudo mv wp-cli.phar /usr/local/bin/wp + # Check WP-CLI + wp --info diff --git a/biome.json b/biome.json index 2f40d9ba..42d3a101 100644 --- a/biome.json +++ b/biome.json @@ -2,13 +2,7 @@ "$schema": "https://biomejs.dev/schemas/1.4.1/schema.json", "files": { "include": ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "**/*.json"], - "ignore": [ - "dist/*", - "build/*", - "node_modules/*", - "vendor/*", - ".wireit/*" - ] + "ignore": ["dist/*", "build/*", "node_modules/*", "vendor/*", ".wireit/*"] }, "organizeImports": { "enabled": true diff --git a/package.json b/package.json index 226e0b91..2f92f931 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,8 @@ "lint:js": "wireit", "lint:js:fix": "biome format ./ --write", "lint:php": "wireit", + "prep-version": "changeset status --output=changeset-status.json && changeset version && wpdev bundle --from-release=changeset-status.json", + "release": "changeset publish", "setup:php": "wireit", "test:php": "wireit", "typecheck": "wireit", @@ -96,7 +98,13 @@ } }, "wpdev": { - "repo-type": "monorepo", - "env-file": ".env" + "isRoot": true, + "operationMode": "wp-monorepo", + "projectTypes": [ + "plugins" + ], + "envFiles": [ + ".env" + ] } } diff --git a/packages/js/adapters/package.json b/packages/js/adapters/package.json index 606e3652..f3b2895f 100644 --- a/packages/js/adapters/package.json +++ b/packages/js/adapters/package.json @@ -22,11 +22,13 @@ "react-select": "^5.8.0", "use-debounce": "^10.0.0" }, + "peerDependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, "devDependencies": { "@types/react": "^18.2.48", "@types/react-dom": "^18.2.18", - "react": "^18.2.0", - "react-dom": "^18.2.0", "typescript": "^5.3.3" } } diff --git a/packages/js/components/package.json b/packages/js/components/package.json index 74076613..464bfba2 100644 --- a/packages/js/components/package.json +++ b/packages/js/components/package.json @@ -20,11 +20,13 @@ "@wpsocio/utilities": "workspace:*", "@wpsocio/i18n": "workspace:*" }, + "peerDependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, "devDependencies": { "@types/node": "^20.11.2", "@types/react": "^18.2.48", - "@types/react-dom": "^18.2.18", - "react": "^18.2.0", - "react-dom": "^18.2.0" + "@types/react-dom": "^18.2.18" } } diff --git a/packages/js/form-components/package.json b/packages/js/form-components/package.json index c57ce4f0..5c0e9e27 100644 --- a/packages/js/form-components/package.json +++ b/packages/js/form-components/package.json @@ -22,9 +22,11 @@ "@wpsocio/utilities": "workspace:*", "@wpsocio/i18n": "workspace:*" }, + "peerDependencies": { + "react": "^18.2.0" + }, "devDependencies": { "@types/node": "^20.11.2", - "@types/react": "^18.2.48", - "react": "^18.2.0" + "@types/react": "^18.2.48" } } diff --git a/packages/js/form/package.json b/packages/js/form/package.json index 28b74b9f..0f6a1d8b 100644 --- a/packages/js/form/package.json +++ b/packages/js/form/package.json @@ -19,12 +19,14 @@ "react-hook-form": "^7.49.3", "yup": "^1.3.3" }, + "peerDependencies": { + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, "devDependencies": { "@types/node": "^20.11.2", "@types/ramda": "^0.29.9", "@types/react": "^18.2.48", - "@types/react-dom": "^18.2.18", - "react": "^18.2.0", - "react-dom": "^18.2.0" + "@types/react-dom": "^18.2.18" } } diff --git a/packages/js/icons/package.json b/packages/js/icons/package.json index 6c2d8537..211b35bb 100644 --- a/packages/js/icons/package.json +++ b/packages/js/icons/package.json @@ -9,8 +9,10 @@ "dependencies": { "@chakra-ui/icons": "^2.1.1" }, - "devDependencies": { - "@types/react": "^18.2.48", + "peerDependencies": { "react": "^18.2.0" + }, + "devDependencies": { + "@types/react": "^18.2.48" } } diff --git a/packages/js/services/package.json b/packages/js/services/package.json index 39f2f9b3..ff629988 100644 --- a/packages/js/services/package.json +++ b/packages/js/services/package.json @@ -13,12 +13,14 @@ "ramda": "^0.29.1", "yup": "^1.3.3" }, + "peerDependencies": { + "react": "^18.2.0", + "react-hook-form": "^7.49.3" + }, "devDependencies": { "@types/jquery": "^3.5.29", "@types/node": "^20.11.2", "@types/ramda": "^0.29.9", - "@types/react": "^18.2.48", - "react-hook-form": "^7.49.3", - "react": "^18.2.0" + "@types/react": "^18.2.48" } } diff --git a/packages/js/shared/wptelegram-ui/package.json b/packages/js/shared/wptelegram-ui/package.json index be9d5b60..ce955aa4 100644 --- a/packages/js/shared/wptelegram-ui/package.json +++ b/packages/js/shared/wptelegram-ui/package.json @@ -24,10 +24,12 @@ "ramda": "^0.29.1", "yup": "^1.3.3" }, + "peerDependencies": { + "react": "^18.2.0" + }, "devDependencies": { "@types/node": "^20.11.2", "@types/ramda": "^0.29.9", - "@types/react": "^18.2.48", - "react": "^18.2.0" + "@types/react": "^18.2.48" } } diff --git a/plugins/wptelegram-comments/changelog.md b/plugins/wptelegram-comments/CHANGELOG.md similarity index 100% rename from plugins/wptelegram-comments/changelog.md rename to plugins/wptelegram-comments/CHANGELOG.md diff --git a/plugins/wptelegram-comments/src/changelog.md b/plugins/wptelegram-comments/src/changelog.md deleted file mode 100644 index 6fd85a69..00000000 --- a/plugins/wptelegram-comments/src/changelog.md +++ /dev/null @@ -1,91 +0,0 @@ -# Changelog - -All notable changes to this project are documented in this file. - -## Unreleased - -## [1.1.9 - 2023-12-7](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.1.9) - -- Maintenance release - -## [1.1.8 - 2023-05-20](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.1.8) - -### Bug fixes - -- Fixed translations not loaded for some strings - -## [1.1.7 - 2022-11-1](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.1.7) - -### Bug fixes - -- Fixed warnings in PHP 8.x - -## [1.1.6 - 2022-09-11](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.1.6) - -- Maintenance release - -## [1.1.5 - 2021-12-29](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.1.5) - -- Maintenance release - -## [1.1.4 - 2021-09-15](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.1.4) - -### Improvements - -- Minor UI improvements - -## [1.1.3 - 2021-05-3](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.1.3) - -### Improvements - -- Cleaned up the admin menu for single entry for WP Telegram - -### Bug fixes - -- Fixed the ugly post type list when there are plenty of them - -## [1.1.2 - 2021-04-28](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.1.2) - -### Bug fixes - -- Fixed the issue of settings not saved due to trailing slash redirects - -## [1.1.1 - 2021-04-9](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.1.1) - -### Bug fixes - -- Fixed the wrong widget configuration being saved - -## [1.1.0 - 2021-02-27](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.1.0) - -### Enhancements - -- Switched to PHP namespaces -- Refreshed and improved the UI - -## [1.0.4 - 2021-01-3](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.0.4) - -### Bug fixes - -- Fixed back-end validation for code - -## [1.0.3 - 2021-01-3](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.0.3) - -### Enhancements - -- Add support for channel discussion scripts - -## [1.0.2 - 2020-06-21](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.0.2) - -### Enhancements - -- Updated test up to - -## [1.0.1 - 2019-09-10](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.0.1) - -- Added translations -- Minor fixes - -## [1.0.0 - 2019-09-04](https://github.com/wpsocio/wptelegram-comments/releases/tag/v1.0.0) - -- Initial Release. diff --git a/plugins/wptelegram-login/changelog.md b/plugins/wptelegram-login/CHANGELOG.md similarity index 100% rename from plugins/wptelegram-login/changelog.md rename to plugins/wptelegram-login/CHANGELOG.md diff --git a/plugins/wptelegram-login/src/changelog.md b/plugins/wptelegram-login/src/changelog.md deleted file mode 100644 index c68b67ed..00000000 --- a/plugins/wptelegram-login/src/changelog.md +++ /dev/null @@ -1,403 +0,0 @@ -# Changelog - -All notable changes to this project are documented in this file. - -## Unreleased - -## [1.10.7 - 2023-10-9](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.10.7) - -### Bug fixes - -- Fixed the bug for Telegram Mini Apps which pass HTML encoded query string - -## [1.10.6 - 2023-10-8](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.10.6) - -### Bug fixes - -- Fixed validation for Direct Link Mini Apps with start command - -## [1.10.5 - 2023-10-8](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.10.5) - -### Bug fixes - -- Fixed validation for Direct Link Mini Apps - -## [1.10.4 - 2023-09-23](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.10.4) - -### Enhancements - -- Added Telegram Mini App login support - -## [1.10.3 - 2023-05-20](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.10.3) - -### Bug fixes - -- Fixed translations not loaded for some strings - -## [1.10.2 - 2023-04-1](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.10.2) - -### Enhancements - -- Added Telegram user fields to WooCommerce Account page - -## [1.10.1 - 2023-01-9](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.10.1) - -### Enhancements - -- Added language option for the login widget - -## [1.10.0 - 2022-12-16](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.10.0) - -### Enhancements - -- Added support for Telegram Web App data authorization - -## [1.9.17 - 2022-11-1](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.17) - -### Bug fixes - -- Fixed warnings in PHP 8.x - -## [1.9.16 - 2022-10-31](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.16) - -### Enhancements - -- Added a filter to allow disabling profile update for existing users. - -## [1.9.15 - 2022-08-9](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.15) - -### Improvements - -- Updated options to load Bot Token from WP Telegram by default - -### Bug Fixes - -- Fixed failed login with emoji names when DB does not support multibyte characters - -## [1.9.14 - 2022-06-2](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.14) - -### Improvements - -- Added filters for Telegram avatar usage - -## [1.9.13 - 2021-12-29](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.13) - -- Maintenance release - -## [1.9.12 - 2021-10-24](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.12) - -### Bug Fixes - -- Fixed PHP Fatal Error for Block Widgets - -## [1.9.11 - 2021-10-23](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.11) - -### Bug Fixes - -- Fixed PHP warning for `block_categories` deprecation - -## [1.9.10 - 2021-09-15](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.10) - -### Bug Fixes - -- Fixed the failed login when Telegram name has special characters - -## [1.9.9 - 2021-05-3](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.9) - -### Improvements - -- Cleaned up the admin menu for single entry for WP Telegram - -## [1.9.8 - 2021-04-28](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.8) - -### Bug fixes - -- Fixed the issue of settings not saved due to trailing slash redirects - -## [1.9.7 - 2021-04-24](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.7) - -### Enhancements - -- Improved user REST meta query for Telegram users - -### Bug Fixes - -- Fixed default settings for Gutenberg blocks - -## [1.9.6 - 2021-04-9](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.6) - -### Bug Fixes - -- Fixed Telegram login when login and register are on same page -- Fixed the issue of custom redirect URL not saved - -## [1.9.5 - 2021-03-5](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.5) - -### Bug Fixes - -- Fixed the messed up last update - -## [1.9.4 - 2021-03-5](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.4) - -### Bug Fixes - -- Fixed the hidden login on WP registration page - -## [1.9.3 - 2021-02-28](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.3) - -### Bug Fixes - -- Fixed admin links on settings page -- Fixed translation for plugin title - -## [1.9.2 - 2021-02-16](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.2) - -### Bug Fixes - -- Fixed the missing Telegram ID in user table -- Fixed creation of new user on login - -## [1.9.1 - 2021-02-16](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.1) - -### Bug Fixes - -- Fixed i18n - -## [1.9.0 - 2021-02-16](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.9.0) - -### Bug Fixes - -- Fixed the syntax error for older PHP versions. - -### Enhancements - -- Refreshed the UI -- Switched to PHP namespaces - -## [1.8.4 - 2021-01-31](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.8.4) - -### Bug Fixes - -- Fixed the empty username error for non ASCII names -- Fixed the wrong Telegram username saved to user profile - -### Enhancements - -- Integrated Telegram login details with WP REST API - -## [1.8.3 - 2020-12-8](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.8.3) - -### Bug Fixes - -- Fixed the Telegram ID update from edit profile - -## [1.8.2 - 2020-10-3](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.8.2) - -### Enhancements - -- Added Telegram user ID field to user profile - -## [1.8.1 - 2020-08-13](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.8.1) - -### Bug Fixes - -- Fixed admin styles - -## [1.8.0 - 2020-08-13](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.8.0) - -### Enhancements - -- Updated user id meta key constant name -- Telegram username is now saved to user meta -- Updated compatibility with WP 5.5 - -### Bug Fixes - -- Disabled default WP login redirect to fix unexpected redirects -- Fixed admin menu icon - -## [1.7.1 - 2020-08-4](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.7.1) - -### Enhancements - -- Removed button for already connected users - -## [1.7.0 - 2020-06-14](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.7.0) - -### Enhancements - -- Unified Telegram user ID with WP Telegram - -## [1.6.3 - 2020-06-12](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.6.3) - -### Bug Fixes - -- Fixed the bug in creating random email - -## [1.6.2 - 2020-04-12](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.6.2) - -### Bug Fixes - -- Fixed Admin page JS path - -## [1.6.1 - 2020-04-12](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.6.1) - -### Bug Fixes - -- Fixed version update - -## [1.6.0 - 2020-04-12](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.6.0) - -### Enhancements - -- Added support for random email generation -- Simplified the build process - -## [1.5.4 - 2019-10-23](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.5.4) - -### Enhancements - -- Added some more hooks to login flow -- Updated bot token pattern - -## [1.5.3 - 2019-09-20](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.5.3) - -### Bug Fixes - -- Fixed the issue with default values not shown for fresh installs - -## [1.5.2 - 2019-08-19](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.5.2) - -### Bug Fixes - -- Fixed the wrong shortcode atts -- Fixed the regenerator-runtime issue - -## [1.5.1 - 2019-07-29](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.5.1) - -### Bug Fixes - -- Fixed the 404 for for admin css -- Fixed the ajax error caused by WordFence -- Fixed pending upgrades from last update -- Fixed the hidden login on thememylogin - -### Enhancements - -- Switched to WPCS in JS. - -## [1.5.0 - 2019-07-18](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.5.0) - -### Enhancements - -- Removed the CMB2 dependency -- Migrated to React for settings page - -## [1.4.1 - 2019-03-23](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.4.1) - -### Bug Fixes - -- Fixed the PHP warning on the settings page - -## [1.4.0 - 2019-03-23](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.4.0) - -### Enhancements - -- Added Gutenberg Block for login button - -## 1.3.4 - 2018-11-23 - -### Bug Fixes - -- Fixed 404 issue for WP in sub directory - -## [1.3.3 - 2018-11-11](https://github.com/wpsocio/wptelegram-login/releases/tag/1.3.3) - -### Enhancements - -- Bundled CMB2 to handle the dependency - -### Bug Fixes - -- Fixed UI bugs on login page with errors -- Fixed the shortcode instruction for `show_user_photo` - -## 1.3.2 - 2018-11-02 - -### Enhancements - -- Prepare for WP Telegram 2.0.0 - -## [1.3.1 - 2018-10-20](https://github.com/wpsocio/wptelegram-login/releases/tag/v1.3.1) - -### Enhancements - -- Added Russian Translation. Thanks to @zzart - -### Bug Fixes - -- Fixed the Save Settings errors -- Fixed option class error in old PHP versions - -## 1.3.0 - 2018-10-07 - -### Enhancements - -- Revamped the options to avoid the use of globals -- Added the option to disable the button on default WP login page - -### Bug Fixes - -- Fixed the PHP warnings for first time install -- Fixed the error in user columns in older WP versions - -## 1.2.8 - 2018-09-26 - -### Bug Fixes - -- Fixed some PHP Warnings - -## 1.2.7 - 2018-09-24 - -- Added support for user avatars to be should by default -- Minor fixes - -## 1.2.6 - 2018-09-09 - -- Added the option to disable sign ups -- Minor fixes - -## 1.2.5 - 2018-09-07 - -- Fixed the PHP warnings created by widget visibility options -- Fixed the Errors during widget update -- Other fixes - -## 1.2.4 - 2018-06-28 - -- Fixed the bug related to password recovery button -- Added efficient plugin dependency management - -## 1.2.3 - 2018-05-04 - -- Fixed the issue with integration with WP Telegram Notifications - -## 1.2.2 - 2018-05-04 - -- Fixed the issue with login button not shown to specific roles - -## 1.2.1 - 2018-04-26 - -- Fixed the issue with login button not shown by default - -## 1.2.0 - 2018-04-17 - -- Added the option whom to show the login button - -## 1.0.1 - 2018-04-16 - -- Added integration with WPTelegram Notifications for users - -## 1.0.0 - 2018-04-16 - -- Initial Release. diff --git a/plugins/wptelegram-widget/changelog.md b/plugins/wptelegram-widget/CHANGELOG.md similarity index 100% rename from plugins/wptelegram-widget/changelog.md rename to plugins/wptelegram-widget/CHANGELOG.md diff --git a/plugins/wptelegram-widget/README.md b/plugins/wptelegram-widget/README.md new file mode 100644 index 00000000..8864cc11 --- /dev/null +++ b/plugins/wptelegram-widget/README.md @@ -0,0 +1,142 @@ +# WP Telegram Widget and Join Link + +**Contributors:** [wpsocio](https://github.com/wpsocio), [irshadahmad21](https://github.com/irshadahmad21) +**Tags:** telegram, feed, widget, channel, group +**Requires at least:** 6.1 +**Requires PHP:** 7.4 +**Tested up to:** 6.4.2 +**Stable tag:** 2.1.11 +**License:** GPLv2 or later +**License URI:** [http://www.gnu.org/licenses/gpl-2.0.html](http://www.gnu.org/licenses/gpl-2.0.html) +**Donate link:** [wpsocio.com/donate](https://wpsocio.com/donate) + +[![Wordpress plugin](https://img.shields.io/wordpress/plugin/v/wptelegram-widget.svg)](https://wordpress.org/plugins/wptelegram-widget/) +[![Wordpress](https://img.shields.io/wordpress/plugin/dt/wptelegram-widget.svg)](https://wordpress.org/plugins/wptelegram-widget/) +[![Wordpress rating](https://img.shields.io/wordpress/plugin/r/wptelegram-widget.svg)](https://wordpress.org/plugins/wptelegram-widget/) + +Complete contributors list found here: [github.com/wpsocio/wptelegram-widget/graphs/contributors](https://github.com/wpsocio/wptelegram-widget/graphs/contributors) + +**[Download plugin on wordpress.org](https://wordpress.org/plugins/wptelegram-widget/)** + +## Description + +Display the Telegram Public Channel or Group Feed in a WordPress widget or anywhere you want using a shortcode. + +## Features: + +- Provides an ajax widget to display channel feed +- Ajax widget contains a Join Channel link +- A separate Join Channel Link/Button +- Pulls updates automatically from Telegram +- Uses a responsive widget to display the feed +- Fits anywhere you want it to be +- The received messages can be seen from `/wp-admin` +- Automatically removes deleted messages +- Can be displayed using a shortcode +- Available as a Gutengerg block +- Allows embeding of Telegram public channel messages +- Can be extended with custom code + +## Widget Info + +### Ajax Widget + +Goto **Appearance** > **Widgets** and click/drag **WP Telegram Ajax Widget** and place it where you want it to be. + +Alternately, you can use the below shortcode. + +Inside page or post content: + +`[wptelegram-ajax-widget username="WPTelegram" width="100%" height="500px"]` + +Inside the theme templates + +```php + +``` + +or + +```php + +``` + +### Legacy Widget + +Goto **Appearance** > **Widgets** and click/drag **WP Telegram Legacy Widget** and place it where you want it to be. + +Alternately, you can use the below shortcode. + +Inside page or post content: + +`[wptelegram-widget num_messages="5" width="100%" author_photo="auto"]` + +Inside the theme templates + +```php + 'auto', + // 'num_messages' => 5, + // 'width' => 100, + ); + + wptelegram_widget( $args ); +} +?> +``` + +or + +```php + +``` + +### Join Link + +Goto **Appearance** > **Widgets** and click/drag **WP Telegram Join Channel** and place it where you want it to be. + +Alternately, you can use the below shortcode. + +Inside page or post content: + +`[wptelegram-join-channel link="https://t.me/WPTelegram" text="Join @WPTelegram on Telegram"]` + +Inside the theme templates + +```php + 'https://t.me/WPTelegram', + 'text' => 'Join @WPTelegram on Telegram', + ); + wptelegram_join_channel( $args ); +} +?> +``` + +or + +```php + +``` + +### Contribution + +Development occurs on Github, and all contributions welcome. + +## Translation + +If you are looking to provide language translation files, Please do so via [WordPress Plugin Translations](https://translate.wordpress.org/projects/wp-plugins/wptelegram-widget). + +## Installation + +1. Upload the `wptelegram-widget` folder to the `/wp-content/plugins/` directory +2. Activate the plugin through the Plugins menu in WordPress. After activation, you should see the menu of this plugin the the admin +3. Configure the plugin. diff --git a/plugins/wptelegram-widget/src/changelog.md b/plugins/wptelegram-widget/src/changelog.md deleted file mode 100644 index 2c0e7c1d..00000000 --- a/plugins/wptelegram-widget/src/changelog.md +++ /dev/null @@ -1,318 +0,0 @@ -# Changelog - -All notable changes to this project are documented in this file. - -## Unreleased - -## [2.1.11 - 2023-12-7](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.1.11) - -- Maintenance release - -## [2.1.10 - 2023-05-20](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.1.10) - -### Bug fixes - -- Fixed translations not loaded for some strings - -## [2.1.9 - 2023-03-15](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.1.9) - -### Enhancements - -- Added caching for the widget content - -## [2.1.8 - 2022-11-1](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.1.8) - -### Bug fixes - -- Fixed warnings in PHP 8.x - -## [2.1.7 - 2022-09-11](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.1.7) - -- Maintenance release - -## [2.1.6 - 2021-12-29](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.1.6) - -- Maintenance release - -## [2.1.5 - 2021-11-15](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.1.5) - -### Bug fixes - -- Fixed PHP warning for `block_categories` deprecation - -## [2.1.4 - 2021-10-23](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.1.4) - -### Enhancements - -- Added lazy loading to iframes - -## [2.1.3 - 2021-08-26](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.1.3) - -### Enhancements - -- Added new tab option for join link - -## [2.1.2 - 2021-05-3](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.1.2) - -### Improvements - -- Cleaned up the admin menu for single entry for WP Telegram - -## [2.1.1 - 2021-04-28](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.1.1) - -### Bug fixes - -- Fixed the issue of settings not saved due to trailing slash redirects - -## [2.1.0 - 2021-04-26](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.1.0) - -### Enhancements - -- Added multi-channel support for Ajax Widget - -### Bug Fixes - -- Fixed the ugly URLs filter for widgets - -## [2.0.5 - 2021-04-14](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.0.5) - -### Bug Fixes - -- Fixed the admin menu and settings page icon - -## [2.0.4 - 2021-04-9](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.0.4) - -### Bug Fixes - -- Minor UI fixes for Join Link color picker - -## [2.0.3 - 2021-03-30](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.0.3) - -### Bug Fixes - -- Fixed the last messed up update - -## [2.0.2 - 2021-03-30](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.0.2) - -### Enhancements - -- Added color options to Join Link settings - -## [2.0.1 - 2021-02-25](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.0.1) - -### Bug Fixes - -- Fixed the issue with message order in legacy widget - -## [2.0.0 - 2021-02-22](https://github.com/wpsocio/wptelegram-widget/releases/tag/v2.0.0) - -### Enhancements - -- Switched to PHP namespaces -- Added support for separate ajax and legacy widgets -- Refreshed and improved the UI -- Improved names for hooks and shortcodes - -## [1.9.5 - 2021-01-31](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.9.5) - -### Enhancements - -- Added compatibility with WP 5.6 - -## [1.9.4 - 2020-06-25](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.9.4) - -### Enhancements - -- Added usage guide to join link - -### Bug Fixes - -- Fixed join link defaults - -## [1.9.3 - 2020-06-20](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.9.3) - -### Bug Fixes - -- Fixed 404 on /v - -## [1.9.2 - 2020-05-20](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.9.2) - -### Bug Fixes - -- Fixed error for empty join link - -## [1.9.1 - 2020-05-17](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.9.1) - -### Enhancements - -- Added priority option for join link - -### Bug Fixes - -- Fixed adding of join link if no post type selected - -## [1.9.0 - 2020-05-4](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.9.0) - -### Enhancements - -- Added join link automatically to posts -- Added options to customize join link for posts -- Added WP Telegram Block category -- Improved blocks - -### Bug Fixes - -- Fixed JS bundle path for blocks -- Fixed single post iframe height - -## [1.8.1 - 2020-04-20](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.8.1) - -### Bug Fixes - -- Fix admin .min.js. - -## [1.8.0 - 2020-04-20](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.8.0) - -### Enhancements - -- Added Join Channel widget/block/shortcode - -## [1.7.4 - 2019-11-2](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.7.4) - -### Bug Fixes - -- Updated bot token pattern for test token. - -## [1.7.3 - 2019-10-23](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.7.3) - -### Enhancements - -- Updated bot token pattern. - -## [1.7.2 - 2019-08-12](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.7.2) - -### Bug Fixes - -- Fixed the issue of settings not being saved without Bot Token. - -## [1.7.1 - 2019-08-11](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.7.1) - -### Enhancements - -- Improved compatibility with different browsers. -- Improved the code as per WPCS. - -### Bug Fixes - -- Fixed the issue of settings not being saved without Bot Token. - -## [1.7.0 - 2019-07-23](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.7.0) - -### Enhancements - -- Migrated from CMB2 to React for settings page. -- Added Guternberg block for Ajax Widget. -- Removed Widget Messages list in favour of Ajax Widget. -- Bot Token is no more required for the ajax widget to work. -- Made the ajax widget search form visible again. -- Search form results are now displayed in the same iframe, instead of new tab. - -### Bug Fixes - -- Fixed the Google Script URL not being used. - -## [1.6.2 - 2019-07-6](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.6.2) - -### Enhancements - -- Change Join Link to channel link - -### Bug Fixes - -- Fixed the issue with click on links - -## [1.6.1 - 2019-06-28](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.6.1) - -### Enhancements - -- Fix the upgrade to new rewrite rules - -## [1.6.0 - 2019-06-28](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.6.1) - -### Enhancements - -- Added the new ajax widget with fixed height and infinite scroll -- Added Added support for Google Script to bypass the ban on t.me. -- Added filters to inject custom widget styles. - -## [1.6.0 - 2019-06-28](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.6.0) - -### Enhancements - -- Added the new ajax widget with fixed height and infinite scroll -- Added Added support for Google Script to bypass the ban on t.me. -- Added filters to inject custom widget styles. - -## [1.5.0 - 2019-04-2](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.5.0) - -### Enhancements - -- Added Gutengerg blocks for the channel feed. -- Added Gutenberg block to embed any Telegram Message. -- Moved update trigger URL out of wp-admin. -- Added WP Telegram integration to avoid the need for separate bot - -## [1.4.0 - 2019-01-12](https://github.com/wpsocio/wptelegram-widget/releases/tag/v1.4.0) - -### Bug Fixes - -- Moved the widget message links to front-end -- Added Russian translation -- Fixed the issue with Cyrillic characters in the widget - -## [1.3.4 - 2018-11-11](https://github.com/wpsocio/wptelegram-widget/releases/tag/1.3.4) - -- Bundled CMB2 to handle the dependency - -## [1.3.3 - 2018-11-11](https://github.com/wpsocio/wptelegram-widget/releases/tag/1.3.3) - -- Prepare for WP Telegram 2.0.0 - -## 1.3.2 - -- Fixed the DOMDocument error when allow_url_fopen is off -- Switched to normal HTTP requests to fetch the remote HTML - -## 1.3.1 - -- Fixed the Parse Error in older PHP versions - -## 1.3.0 - -- Major upgrade -- Fixes the static width of widgets -- Auto remove deleted messages -- Performance improvements - -## 1.2.0 - -- Fixed the problem with empty widget title -- Universalized Telegram Bot API Library -- Minor fixes - -## 1.1.2 - -- Fixed the CSS issue with message width - -## 1.1.1 - -- Fixed the CSS issue with narrow sidebars - -## 1.1.0 - -- Added Messages List Table -- Added Manual pulling of the messages - -## 1.0.0 - -- Initial Release. diff --git a/plugins/wptelegram/src/changelog.md b/plugins/wptelegram/CHANGELOG.md similarity index 99% rename from plugins/wptelegram/src/changelog.md rename to plugins/wptelegram/CHANGELOG.md index c07c6f71..f050276e 100644 --- a/plugins/wptelegram/src/changelog.md +++ b/plugins/wptelegram/CHANGELOG.md @@ -1,10 +1,6 @@ # Changelog -All notable changes to this project are documented in this file. - -## Unreleased - -## [4.0.14 - 2023-11-22](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.14) +## 4.0.14 ### Enhancements @@ -105,6 +101,7 @@ All notable changes to this project are documented in this file. - Intelligently trim `{post_excerpt}` to preserve the other parts of Message Template. ### Breaking changes + - Removed support for Markdown formatting in favour of better HTML formatting ### Bug fixes diff --git a/plugins/wptelegram/changelog.md b/plugins/wptelegram/changelog.md deleted file mode 100644 index a3f8b5db..00000000 --- a/plugins/wptelegram/changelog.md +++ /dev/null @@ -1,889 +0,0 @@ -# Changelog - -All notable changes to this project are documented in this file. - -## Unreleased - -### Bug fixes - -- Fixed the emojis in notifications not being sent. - -## [4.0.14 - 2023-11-22](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.14) - -### Enhancements - -- Added support for `
` tag - -## [4.0.13 - 2023-09-17](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.13) - -### Bug fixes - -- Fixed the failure of sending posts with large size images - -## [4.0.12 - 2023-07-7](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.12) - -### Bug fixes - -- Fixed the Yoast Duplicated post not sent to Telegram - -## [4.0.11 - 2023-05-20](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.11) - -### Bug fixes - -- Fixed translations not loaded for some strings - -## [4.0.10 - 2023-05-16](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.10) - -### Bug fixes - -- Fixed the dollar sign getting nuked from excerpt -- Fixed logs to avoid bot token added to URL - -## [4.0.9 - 2023-03-23](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.9) - -### Enhancements - -- Improved message template sanitization to prevent breaking the markup -- Added a new filter `wptelegram_p2tg_post_data_plain_excerpt` to allow sending plain text excerpt - -### Bug fixes - -- Fixed the links added in parenthesis when "Formatting" is set to "None" - -## [4.0.8 - 2023-03-12](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.8) - -### Bug fixes - -- Fixed the broken hyperlinks in Message Template when using custom field link - -## [4.0.7 - 2023-03-3](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.7) - -### Bug fixes - -- Fixed the issue of images being retained in post content links - -## [4.0.6 - 2023-03-2](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.6) - -### Bug fixes - -- Fixed the issue of shortcodes being sent to Telegram - -## [4.0.5 - 2023-03-2](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.5) - -### Bug fixes - -- Fixed the unintended newlines in Post Excerpt and Post Content - -## [4.0.4 - 2023-03-1](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.4) - -### Bug fixes - -- Fixed repeated caption for the image when using the "After the text" option -- Fixed the issue of long texts being truncated - -## [4.0.3 - 2023-02-18](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.3) - -### Enhancements - -- Added support for adding internal note to chat IDs - -## [4.0.2 - 2023-02-16](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.2) - -### Bug fixes - -- Fixed PHP 8.1 issue with HTML conversion - -## [4.0.1 - 2023-02-14](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.1) - -### Bug fixes - -- Fixed the word count issue with non-english locales - -## [4.0.0 - 2023-02-13](https://github.com/wpsocio/wptelegram/releases/tag/v4.0.0) - -### Enhancements - -- Added better support for HTML formatting. -- Added support for `` and `` HTML tags. -- Added support for nested tags. You can now use `` inside `` and vice versa. -- Intelligently trim `{post_excerpt}` to preserve the other parts of Message Template. - -### Breaking changes -- Removed support for Markdown formatting in favour of better HTML formatting - -### Bug fixes - -- Fixed the image not being sent "After the text" when "Send files by URL" is disabled -- Fixed the issue of messages not being sent when the markup is not valid - -## [3.2.2 - 2023-01-24](https://github.com/wpsocio/wptelegram/releases/tag/v3.2.2) - -### Bug fixes - -- Fixed nesting error in experimental HTML converter - -## [3.2.0 - 2023-01-19](https://github.com/wpsocio/wptelegram/releases/tag/v3.2.0) - -### Enhancements - -- Added the new experimental HTML converter for better formatting of email notifications -- The new can be enabled using `add_filter( 'wptelegram_notify_use_experimental_text', '__return_true' );` - -## [3.1.15 - 2023-01-5](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.15) - -### Bug fixes - -- Fixed PHP warning when not using message thread ID - -## [3.1.14 - 2022-12-8](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.14) - -### Enhancements - -- Added support for sending messages to topics with groups - -### Bug fixes - -- Fixed messages not sent when replied-to message is not found - -## [3.1.13 - 2022-11-26](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.13) - -### Improvements - -- Improved the default value for Send to Telegram option on post edit page - -## [3.1.12 - 2022-11-19](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.12) - -### Bug fixes - -- Fixed PHP warnings in logger - -## [3.1.11 - 2022-11-1](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.11) - -### Bug fixes - -- Fixed warnings in PHP 8.x - -## [3.1.10 - 2022-10-31](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.10) - -### Improvements - -- Improved logging for better understanding of errors - -## [3.1.9 - 2022-06-12](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.9) - -### Enhancements - -- Improved logging options to prevent users from mistakes - -## [3.1.8 - 2022-03-26](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.8) - -### Bug fixes - -- Fixed PHP error on plugin update -- Fixed Post to Telegram rule search bug - -## [3.1.7 - 2021-12-31](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.7) - -### Enhancements - -- Added "Protect content" option to Post to Telegram. - -## [3.1.6 - 2021-12-29](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.6) - -### Bug fixes - -- Misc bug fixes -- Fixed some typos - -## [3.1.5 - 2021-10-23](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.5) - -### Enhancements - -- Added override option for Send Featured Image. - -## [3.1.4 - 2021-10-17](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.4) - -### Bug fixes - -- Fixed posts not sent when Formatting is None - -## [3.1.3 - 2021-09-15](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.3) - -### Enhancements - -- Added `{post_slug}` macro - -## [3.1.2 - 2021-07-5](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.2) - -### Bug fixes - -- Fixed admin page not shown just after upgrade -- Fixed multiple empty lines in post content and excerpt - -## [3.1.1 - 2021-06-10](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.1) - -### Bug fixes - -- Fixed file upload for CloudFlare proxy - -## [3.1.0 - 2021-05-30](https://github.com/wpsocio/wptelegram/releases/tag/v3.1.0) - -### Enhancements - -- Added CloudFlare Proxy support 🚀 -- Added `{post_type}` and `{post_type_label}` macros - -## [3.0.11 - 2021-05-7](https://github.com/wpsocio/wptelegram/releases/tag/v3.0.11) - -### Bug fixes - -- Fixed WooCommerce REST API products not sent to Telegram - -## [3.0.10 - 2021-04-28](https://github.com/wpsocio/wptelegram/releases/tag/v3.0.10) - -### Enhancements - -- Added explicit filter for post edit switch -- Further improved logging for better troubleshooting -- Updated FAQ section - -### Bug fixes - -- Fixed the issue of settings not saved due to trailing slash redirects - -## [3.0.9 - 2021-04-18](https://github.com/wpsocio/wptelegram/releases/tag/v3.0.9) - -### Bug fixes - -- Fixed the upgrade for Post to Telegram rules -- Fixed invalid argument error for failed post updates -- Fixed duplicate posts when using bulk import -- Fixed i18n for block editor override settings -- Fixed the Disable Notification settings not being reflected on post edit page - -## [3.0.8 - 2021-04-16](https://github.com/wpsocio/wptelegram/releases/tag/v3.0.8) - -### Bug fixes - -- Fixed saving empty channels crashing the settings page -- Fixed "Changes could not be saved" error for old upgrades - -## [3.0.7 - 2021-04-9](https://github.com/wpsocio/wptelegram/releases/tag/v3.0.7) - -### Bug fixes - -- Fixed the issue of scheduled posts being sent regardless of the overrides. -- Removed "Post edit switch" from post edit page when disabled. -- Minor admin UI fixes. - -## [3.0.6 - 2021-04-7](https://github.com/wpsocio/wptelegram/releases/tag/v3.0.6) - -### Bug fixes - -- Fixed "Send to Telegram" flag not saved for block editor drafts. - -## [3.0.5 - 2021-04-1](https://github.com/wpsocio/wptelegram/releases/tag/v3.0.5) - -### Bug fixes - -- Fixed the issue of posts being sent from block editor regardless of the rules. -- Fixed the issue of disabled Test Token button. -- Fixed the issue of delayed posts not sent. -- Fixed the empty rules being saved, preventing posts from being sent to Telegram. - -## [3.0.4 - 2021-03-30](https://github.com/wpsocio/wptelegram/releases/tag/v3.0.4) - -### Bug fixes - -- Fixed wrong template when using CMB2 override settings. - -## [3.0.3 - 2021-03-29](https://github.com/wpsocio/wptelegram/releases/tag/v3.0.3) - -### Enhancements - -- Improved logging for better diagnosis - -### Bug fixes - -- Fixed the wrong post data when importing posts -- Fixed the issue caused by upgrade for fresh installations -- Fixed the settings not saved issue -- Fixed the Update failed issue in block editor for drafts -- Fixed the fatal error for old block editor posts - -## [3.0.2 - 2021-03-21](https://github.com/wpsocio/wptelegram/releases/tag/v3.0.2) - -### Bug fixes - -- Fixed the issue of posts not sent when using WP CLI - -## [3.0.1 - 2021-03-20](https://github.com/wpsocio/wptelegram/releases/tag/v3.0.1) - -### Bug fixes - -- Fixed the last messed up update - -## [3.0.0 - 2021-03-20](https://github.com/wpsocio/wptelegram/releases/tag/v3.0.0) - -### Enhancements - -- Switched to PHP namespaces -- Removed CMB2 dependency -- Improved and changed admin UI to single page -- Added option for inline button URL source -- Added option to change the inline button icon -- Better support for block editor override settings - -### Bug fixes - -- Fixed the YouTube links being stripped out from the content. -- Minor fixes. - -## [2.2.5 - 2021-01-23](https://github.com/wpsocio/wptelegram/releases/tag/v2.2.5) - -### Enhancements - -- Improved the logic to decide new and existing posts -- Added support for PHP 8 - -### Bug fixes - -- Fixed errors for PHP 8 - -## [2.2.4 - 2021-01-3](https://github.com/wpsocio/wptelegram/releases/tag/v2.2.4) - -### Enhancements - -- Added links to view logs - -### Bug fixes - -- Fixed the bug in notifications when email has multiple recipients. - -## [2.2.3 - 2020-10-3](https://github.com/wpsocio/wptelegram/releases/tag/v2.2.3) - -### Bug fixes - -- Fixed 404 for CSS map files - -### Enhancements - -- Moved Telegram user ID field to WP Telegram Login - -## [2.2.2 - 2020-08-16](https://github.com/wpsocio/wptelegram/releases/tag/v2.2.2) - -### Bug fixes - -- Fixed HTML characters in categories as hashtags. -- Fixed admin menu icon - -## [2.2.1 - 2020-08-1](https://github.com/wpsocio/wptelegram/releases/tag/v2.2.1) - -### Enhancements - -- Update for WP Telegram Pro - -## [2.2.0 - 2020-06-14](https://github.com/wpsocio/wptelegram/releases/tag/v2.2.0) - -### Enhancements - -- Unified Telegram user ID for all plugins - -## [2.1.15 - 2020-04-5](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.15) - -### Enhancements - -- Added all the registered taxonomies to macros for Message Template - -## [2.1.13 - 2020-03-8](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.13) - -### Enhancements - -- Added "Plugin generated posts" option to allow posts not created by humans. - -## [2.1.12 - 2019-12-15](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.12) - -### Bug fixes - -- Fixed double posting by block editor. - -## [2.1.11 - 2019-11-15](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.11) - -### Bug fixes - -- Fixed the text input styles. - -## [2.1.10 - 2019-10-23](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.10) - -### Enhancements - -- Updated bot token pattern to handle the latest change in tokens. - -### Bug fixes - -- Fixed the warning for old log files not found. - -## [2.1.9 - 2019-09-10](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.9) - -### Enhancements - -- Improved and secured logs by hashed names and by switching to wp_filesystem. -- Dropped support for PHP < 5.6 and WP < 4.7 - -### Bug fixes - -- Prevent the notification links being previewed - -## [2.1.8 - 2019-09-1](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.8) - -### Bug fixes - -- Fixed the issue with posts not being sent when published via WP REST API - -## [2.1.7 - 2019-08-19](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.7) - -### Bug fixes - -- Fix the issue of products not being sent when published via WC REST API -- Fix CMB2 field conflict with Rank Math plugin - -## [2.1.6 - 2019-07-1](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.6) - -### Bug fixes - -- Fix the fatal error caused on post edit page. - -## [2.1.5 - 2019-07-1](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.5) - -### Bug fixes - -- Fixed the issue of unintended posts being scheduled for delay - -## [2.1.4 - 2019-06-21](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.4) - -### Bug fixes - -- Fixed the long integer chat ID issue when using Google Script -- Fixed the Notification Chat IDs sanitization issue -- Minor fixes - -## [2.1.3 - 2019-04-13](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.3) - -### Bug fixes - -- Fixed the new lines removed by classic editor - -## [2.1.2 - 2019-04-4](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.2) - -### Enhancements - -- Improved the proxy hooking - -### Bug fixes - -- Fixed the fatal error with helper function -- Fixed the issue with delayed posts - -## [2.1.1 - 2019-03-27](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.1) - -### Bug fixes - -- Fixed the step in delay on post edit page - -## [2.1.0 - 2019-03-26](https://github.com/wpsocio/wptelegram/releases/tag/v2.1.0) - -### Enhancements - -- Improved the template conditional logic -- Made delay to be more granular - can be set in half a minute steps -- Added option to allow newlines in `{post_excerpt` -- Added option to send `{categories}` as hashtags - -### Bug fixes - -- Fixed the issue with scheduled posts not being sent to Telegram - -## 2.0.19 - -- Added the conditional logic for Message Template - -## 2.0.16 - -- Fixed the HTML bug in Notifications - -## 2.0.15 - -- Fixed the PHP fatal error - -## 2.0.14 - -- Fixed the PHP fatal error - -## 2.0.13 - -- Added fixes for WP 5+ -- Fixed double posting by block editor -- Fixed the issue with Override Options not expanding in Block Editor -- Improved the logging to include logs about featured image -- Removed the override metabox from the post types not chosen to be sent -- Added tutorial videos in the sidebar -- Updated CMB2 - -## 2.0.12 - -- Fixed the Notification issue caused by some faulty plugins -- Fixed the issue with Post to Telegram caused by Cron Control -- JS fixes - -## 2.0.11 - -- Fixed the bug when scheduling the posts - -## 2.0.10 - -- Delayed loading of modules to fix the translation issues -- Fixed the HTML entity issue for Markdown -- re-enabled sending password protected posts -- Added support for saving override options for Pending posts -- Minor fixes - -## 2.0.9 - -- Fixed Send to Telegram button for Drafts -- Added support for saving override options for drafts and future posts -- Removed the ugly newline character at the beginning of the message when using Single Message with Image after the text -- Added Disable Notifications in override options -- Fixed the issue with saving of "Send files by URL" option -- Minor fixes - -## 2.0.8 - -- Added the logging feature for debugging -- Added the option to upload the files -- Improved the proxy handling -- Changed the way Bot API creates logs -- Minor fixes - -## 2.0.7 - -- Fixed the 404 CSS error for public.min.css -- Added the delAy options for posts -- Restored the old user profile field for Chat ID -- Added Bot Username field - -## 2.0.6 - -- Fixed the 404 JS error for public.min.js - -## 2.0.5 - -- Fixed the override metabox issue - -## 2.0.4 - -- Fixed the override metabox issue caused by other JS errors - -## 2.0.3 - -- Fixed the issue with image being sent as caption - -## 2.0.2 - -- Fixed the issue caused by is_success() - -## 2.0.0 - -- Major Release with full revamp -- Added modular functionality -- Removed PHP 5.3 requirement to avoid double posting - -## 1.9.4 - -- Fixed the double posting problem caused by the last update -- Added the filter for default inline button - -## 1.9.3 - -- Fixed the issue with Scheduled posts caused by previous update - -## 1.9.2 - -- Fixed the issue of category/author filter for future posts -- Added the filter to explicitly change the Inline URL Button text - -## 1.9.1 - -- Fixed the inline keyboard issue with image posts -- Fixed the double posting problem due to some plugins -- Other fixes - -## 1.9.0 - -- Removed the API validation of bot token upon saving the settings -- Minor fixes - -## 1.8.3 - -- Fixed the fatal error when using Google Script - -## 1.8.2 - -- Added option to add inline button for Post URL -- Added support for WP-CLI -- Fixed the issue with spaces in WP Tags -- Minor fixes - -## 1.8.1 - -- A few more hooks and filters -- Updated German translation, thanks to @robertskiba -- Minor fixes - -## 1.8.0 - -- Added support for sending files along with the post. -- A few more hooks and filters -- Minor fixes - -## 1.7.9 - -- Fixed the issue with sending test messages - -## 1.7.8 - -- Added the support for bypassing blockage using Google App Script. -- Fixed the issue with double quotes in message template -- Minor fixes - -## 1.7.7 - -- Fixed the issue with saving the settings with proxy - -## 1.7.6 - -- Added support for many proxy types - -## 1.7.5 - -- Added the hidden support for proxy -- Added hooks to bot API for modifying curl handle - -## 1.7.4 - -- Added the latest update for Bot API Library -- Increased the default request timeout -- Added few more hooks for bot API request params - -## 1.7.3 - -- Fixed the syntax error in previous update - -## 1.7.2 - -- Some more control for user permissions -- Fixed the issue of bot token loss when saving the settings - -## 1.7.1 - -- Added new filters for controlling the sent message - -## 1.7.0 - -- Revamped Telegram Bot API Library to make it more portable -- Changed a few hooks to avoid confusion -- Added Catalan translation. Thanks to jdellund -- Minor fixes - -## 1.6.5 - -- Enabled `parse_mode` for in image caption - -## 1.6.4 - -- Added few more hooks for more control and customizations - -## 1.6.3 - -- Added Russian translation. Thanks to Oxford -- Updated EmojiOne Area library to v3.2.6 to enable emoji search -- Updated Select2 library to v4.0.5 - -## 1.6.2 - -- Added method for creating API log -- Added method to modify curl handle for file uploads -- More filters to control the process -- Bug fixes - -## 1.6.1 - -- Fixed the Fatal Error caused by WP_Error when saving the settings -- Added Portuguese Brazilian translation. Thanks to HellFive Osborn -- Fixed the issue caused by unending Markdown which stopped notifications - -## 1.6.0 - -- Total revamp of the notification sending mechanism -- Allow users to receive email notifications on Telegram -- Added compatibility with every plugin that uses `wp_mail()` to send emails -- Fixed bugs in notification processing - -## 1.5.7 - -- Fixed the issue of posts not being sent when published by cron -- Fixed the hyperlink issue in content URLs after the previous update -- Added more filters to control the way post_content and post_excerpt are processed - -## 1.5.6 - -- Added German translation. Thanks to [Muffin](https://t.me/Muffin) -- Fixed post_date format and localization issue. -- Fixed shortcode issue in post_content -- Improved processing of post_content and post_excerpt -- Added option to choose the way consecutive messages are sent -- Fixed caption issue when sending image after the text -- Improved plugin strings for easy translations -- Bug fixes and performance improvements - -## 1.5.4 - -- Added Italian translation. Thanks to [Mirko Genovese](http://www.mirkogenovese.it) -- Added Arabic translation. Thanks to @Mohamadbush and Mohammad Taher -- Fixed the HTML parsing issue when using Content before Read More tag as Excerpt Source -- Added hooks before and after sending the message -- Added `{post_date}` and `{post_date_gmt}` macros to be used in Message Template - -## 1.5.3 - -- Added Persian translation. Thanks to [mohammadhero](https://profiles.wordpress.org/mohammadhero/) - -## 1.5.2 - -- Added hooks and filters for post title, author, excerpt, featured_image etc. -- Final support for the search plugin - -## 1.5.1 - -- Fixed the warning for undefined index when not using categories/terms restriction - -## 1.5.0 - -- Added support for Read More tag to be used in Excerpt Source -- Improved Telegram API as a Library for developers to use -- Many upgrades to provide basis for future plugin(s) -- Minor fixes - -## 1.4.3 - -- Fixed the bug with scheduled posts when using override switch - -## 1.4.2 - -- Fixed the unwanted warning about invalid bot token - -## 1.4.1 - -- Fixed warnings when settings not saved -- Added language pack for translations -- Minor fixes - -## 1.4 - -- Introducing Website notifications to Telegram -- Dropped support for WordPress 3.5 and older - -## 1.3.8 - -- Filter posts by author -- Filter posts by categories or terms of custom taxonomies -- You can now explicitly set Excerpt Source -- Performance improvements - -## 1.3.7 - -- Delayed `save_post` hook execution to fix the issue with some custom fields -- Added filters to give you more control over macros and their values -- Added separate filters for modifying the values of individual custom fields and taxonomies -- Minor fixes - -## 1.3.6 - -- Now Featured Image can be sent after the text -- Image and text can be send in a single message - -## 1.3.5 - -- Now Featured Image can be sent with Caption -- Caption source can explicitly be chosen -- Added support for sending only Featured Image -- Minor fixes - -## 1.3.4 - -- Fixed the text issue with scheduled posts - -## 1.3.3 - -- Optimized Settings tabs for small screens -- Added tab icons to fit on small screens -- Minor fixes - -## 1.3.2 - -- Fixed message template issue in post edit screen - -## 1.3.0 - -- Total revamp of the settings page -- Added tabbed interface to reduce scrolling -- Added a beautiful template editor with emojis :) -- Added direct support for Custom Post Type selection -- Added the option to choose Channel/chat at the post edit screen -- Preserve override option for Scheduled (future) Posts -- Bug fixes for older WordPress versions - -## 1.2.0 - -- Added support for PHP 5.2 -- Minor bug fixes - -## 1.1.0 - -- Added direct support for Custom Fields -- Added support for including {taxonomy} in template -- Fixed HTML issue with {content} - -## 1.0.9 - -- Fixed HTML Parse Mode issue -- Fixed URL issue in Markdown style - -## 1.0.8 - -- Added support for scheduled posts -- Fixed HTML Entities issue in the text - -## 1.0.6 - -- Fixed excerpt length bug - -## 1.0.5 - -- Minor fixes - -## 1.0.4 - -- Updated README - -## 1.0.3 - -- Minor fixes - -## 1.0.2 - -- Changed the override option to make it more versatile -- Bug fixes - -## 1.0.0 - -- Initial Release. diff --git a/pnpm-hashed.lock b/pnpm-hashed.lock index 2c4d17a3..e57435c2 100644 --- a/pnpm-hashed.lock +++ b/pnpm-hashed.lock @@ -1 +1 @@ -5a3fd23795ea453547eb9d8a1d9f6b908f6139d9 \ No newline at end of file +0380af5cd2a85662ece79600ffb61f58d0f415c9 \ No newline at end of file diff --git a/tools/vite-wp-react/package.json b/tools/vite-wp-react/package.json index 5ea66570..9f96a7f6 100644 --- a/tools/vite-wp-react/package.json +++ b/tools/vite-wp-react/package.json @@ -12,7 +12,7 @@ "@vitejs/plugin-react": "^4.2.1", "@wordpress/babel-plugin-makepot": "^5.32.0", "esbuild": "^0.19.11", - "rollup": "^4.9.5", + "rollup": "4.9.5", "rollup-plugin-external-globals": "^0.9.1", "sass": "^1.69.7", "vite": "^5.0.11", diff --git a/tools/vite-wp-react/src/plugins/externalize-wp-packages.ts b/tools/vite-wp-react/src/plugins/externalize-wp-packages.ts index 7765af8c..30fd90f6 100644 --- a/tools/vite-wp-react/src/plugins/externalize-wp-packages.ts +++ b/tools/vite-wp-react/src/plugins/externalize-wp-packages.ts @@ -15,13 +15,15 @@ export const externalizeWpPackages = (): PluginOption => { build: { rollupOptions: { external: Object.keys(WP_EXTERNAL_PACKAGES), - /** - * Add the plugin to rollup to ensure react imports don't end up in the bundle - * framer-motion causes the issue by using namespace imports - * - * @see https://github.com/vitejs/vite-plugin-react/issues/3 - */ - plugins: [rollupGlobals(WP_EXTERNAL_PACKAGES)], + plugins: [ + /** + * Add the plugin to rollup to ensure react imports don't end up in the bundle + * framer-motion causes the issue by using namespace imports + * + * @see https://github.com/vitejs/vite-plugin-react/issues/3 + */ + rollupGlobals(WP_EXTERNAL_PACKAGES) + ], }, }, }; diff --git a/tools/wpdev/bin/run.js b/tools/wpdev/bin/run.js old mode 100644 new mode 100755 diff --git a/tools/wpdev/src/base-commands/WithProjects.ts b/tools/wpdev/src/base-commands/WithProjects.ts index f8b12a26..e690f834 100644 --- a/tools/wpdev/src/base-commands/WithProjects.ts +++ b/tools/wpdev/src/base-commands/WithProjects.ts @@ -27,7 +27,11 @@ export abstract class WithProjects< static baseFlags = { ...WithRootDirAsCwd.baseFlags, all: Flags.boolean({ - description: 'Target all projects.', + description: 'Target all projects in monorepo.', + }), + 'from-release': Flags.string({ + description: + 'Target projects in monorepo that are to be released next. Pass the {filePath} given to `changset status --output={filePath}`', }), }; @@ -89,7 +93,11 @@ export abstract class WithProjects< this.args = args as TArgs; if (this.cliConfig.operationMode === 'wp-monorepo') { - if (flags.all) { + if (flags['from-release']) { + this.projects = this.wpMonorepo.getProjectsToRelease( + flags['from-release'], + ); + } else if (flags.all) { this.projects = this.wpMonorepo.getManagedProjects(); } else if (argv.length) { this.projects = this.wpMonorepo.getProjectsByName( diff --git a/tools/wpdev/src/utils/schema.ts b/tools/wpdev/src/utils/schema.ts index 29ef9c23..b2d3b415 100644 --- a/tools/wpdev/src/utils/schema.ts +++ b/tools/wpdev/src/utils/schema.ts @@ -121,10 +121,19 @@ const updateVersionData = z.array( 'readmeFiles', 'pluginMainFile', 'themeStylesheet', - 'sinceTag', ]), }) .merge(targetFilesSchema.partial()), + z + .object({ + type: z.literal('sinceTag'), + onlyIfStable: z + .boolean() + .optional() + .default(true) + .describe('The text patterns to match. Regex can also be used.'), + }) + .merge(targetFilesSchema.partial()), z .object({ type: z.literal('general'), diff --git a/tools/wpdev/src/utils/versions.ts b/tools/wpdev/src/utils/versions.ts index 53aa74dd..0897d6a3 100644 --- a/tools/wpdev/src/utils/versions.ts +++ b/tools/wpdev/src/utils/versions.ts @@ -1,5 +1,6 @@ import fs from 'node:fs'; import path from 'node:path'; +import { prerelease } from 'semver'; import { TaskTarget, globFiles } from './misc.js'; import { UpdateVersionInput } from './schema.js'; @@ -100,6 +101,13 @@ export async function updateVersion( { target, slug }: UpdateVersionConfig, ) { for (const item of target) { + if ( + item.type === 'sinceTag' && + item.onlyIfStable && + !isVersionStable(version) + ) { + continue; + } const patterns = createVersionPatterns(item); const filesToUpdate = getFilesToUpdate(item, slug); @@ -122,3 +130,7 @@ export async function updateVersion( } } } + +export function isVersionStable(version: string) { + return prerelease(version) === null; +} diff --git a/tools/wpdev/src/utils/wp-monorepo.ts b/tools/wpdev/src/utils/wp-monorepo.ts index b2eecb41..c00d0eaa 100644 --- a/tools/wpdev/src/utils/wp-monorepo.ts +++ b/tools/wpdev/src/utils/wp-monorepo.ts @@ -1,6 +1,8 @@ +import fs from 'node:fs'; import path from 'node:path'; import { getPackagesSync } from '@manypkg/get-packages'; import { execaSync } from 'execa'; +import { z } from 'zod'; import { ProjectType, UserConfig, WPProject, fixPackage } from './tools.js'; export type WPMonorepoConfig = { @@ -14,6 +16,16 @@ type IncludeOptions = { [key in ProjectStatus]?: boolean; }; +const ReleaseJsonSchema = z.object({ + releases: z.array( + z.object({ + name: z.string(), + type: z.string().optional(), + changesets: z.array(z.string()), + }), + ), +}); + export class WPMonorepo { config: WPMonorepoConfig; @@ -114,22 +126,27 @@ export class WPMonorepo { return this.getProjects({ connected: true, tracked: true, ignored: true }); } - getProjectsByName(projectNames: Array) { - const projects = this.getManagedProjects(); + getProjectsByName( + projectNames: Array, + { throwIfNotFound = true }: { throwIfNotFound?: boolean } = {}, + ) { + const managedProjects = this.getManagedProjects(); + + const projects = new Map(); - const entries = projectNames.map((projectName) => { - const project = projects.get(projectName); + for (const projectName of projectNames) { + const project = managedProjects.get(projectName); - if (!project) { + if (project) { + projects.set(projectName, project); + } else if (throwIfNotFound) { throw new Error( `Invalid project: Could not find a package with name: "${projectName}"`, ); } + } - return [project.packageJson.name, project] as const; - }); - - return new Map(entries); + return projects; } /** @@ -148,4 +165,19 @@ export class WPMonorepo { return path.join(wpContentDir, wpdev?.belongsTo || '', slug); } + + getProjectsToRelease(changesetJsonFile: string) { + if (!fs.existsSync(changesetJsonFile)) { + throw new Error('Please provide a valid release JSON file.'); + } + const json = JSON.parse(fs.readFileSync(changesetJsonFile, 'utf8')); + + const projectNames = ReleaseJsonSchema.parse(json) + // Get the names of projects that have changesets, ignoring the ones that don't + .releases.filter(({ changesets }) => changesets.length) + // Collect the names + .map((release) => release.name); + + return this.getProjectsByName(projectNames, { throwIfNotFound: false }); + } }