diff --git a/.changeset/sweet-gorillas-admire.md b/.changeset/sweet-gorillas-admire.md deleted file mode 100644 index 70c5f7069..000000000 --- a/.changeset/sweet-gorillas-admire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@headstartwp/headstartwp": patch ---- - -Added - New filter available tenup_headless_wp_revalidate_isr_for_post diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 0fee8fb8b..aac067c22 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 cache: npm - name: Install dependencies run: npm install diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml index 0f16de5b4..1eaaea5d4 100644 --- a/.github/workflows/eslint.yml +++ b/.github/workflows/eslint.yml @@ -8,14 +8,14 @@ jobs: strategy: matrix: - node-version: [16.x] + node-version: [20.x] steps: - name: Checkout uses: actions/checkout@v2 - name: Setup Node ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} diff --git a/.github/workflows/nextjs_bundle_analysis.yml b/.github/workflows/nextjs_bundle_analysis.yml index 38c220cba..49f2581d4 100644 --- a/.github/workflows/nextjs_bundle_analysis.yml +++ b/.github/workflows/nextjs_bundle_analysis.yml @@ -19,9 +19,9 @@ jobs: - uses: actions/checkout@v2 - name: Set up node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: - node-version: '16.x' + node-version: '20.x' - name: Install dependencies uses: bahmutov/npm-install@v1 diff --git a/.github/workflows/npm-release-next-version.yml b/.github/workflows/npm-release-next-version.yml index 0f510f27a..f1a7a99ea 100644 --- a/.github/workflows/npm-release-next-version.yml +++ b/.github/workflows/npm-release-next-version.yml @@ -15,10 +15,10 @@ jobs: - name: Checkout Repo uses: actions/checkout@v2 - - name: Setup Node.js 16.x - uses: actions/setup-node@v2 + - name: Setup Node.js + uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 20.x - name: Install Dependencies run: npm ci diff --git a/.github/workflows/release-latest-version.yml b/.github/workflows/release-latest-version.yml index 6ee339125..e928076b3 100644 --- a/.github/workflows/release-latest-version.yml +++ b/.github/workflows/release-latest-version.yml @@ -17,10 +17,10 @@ jobs: - name: Checkout Repo uses: actions/checkout@v2 - - name: Setup Node.js 16.x - uses: actions/setup-node@v2 + - name: Setup Node.js + uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 20.x - name: Install Dependencies run: npm ci diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b517dc359..9f620daa9 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v2 - name: Setup Node ${{ matrix.node-version }} - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile index 8163b6b2e..8c00642d5 100644 --- a/.gitpod.Dockerfile +++ b/.gitpod.Dockerfile @@ -1,5 +1,5 @@ FROM gitpod/workspace-full:latest -RUN bash -c ". .nvm/nvm.sh && nvm install 16 && nvm use 16 && nvm alias default 16" +RUN bash -c ". .nvm/nvm.sh && nvm install 20 && nvm use 20 && nvm alias default 20" RUN echo "nvm use default &>/dev/null" >> ~/.bashrc.d/51-nvm-fix \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index e2e890f37..2ff0281c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21482,7 +21482,7 @@ }, "packages/core": { "name": "@headstartwp/core", - "version": "1.1.2", + "version": "1.2.0", "license": "MIT", "dependencies": { "@justinribeiro/lite-youtube": "^1.3.1", @@ -21873,10 +21873,10 @@ }, "packages/next": { "name": "@headstartwp/next", - "version": "1.1.6", + "version": "1.2.0", "license": "MIT", "dependencies": { - "@headstartwp/core": "^1.1.2", + "@headstartwp/core": "^1.2.0", "deepmerge": "^4.3.1", "loader-utils": "^3.2.0", "schema-utils": "^4.0.0" @@ -21901,7 +21901,7 @@ }, "packages/next-redis-cache-provider": { "name": "@10up/next-redis-cache-provider", - "version": "0.1.5", + "version": "0.2.0", "license": "MIT", "dependencies": { "ioredis": "^5.3.1" @@ -22039,8 +22039,8 @@ "version": "0.2.0", "license": "GPL-2.0-or-later", "dependencies": { - "@headstartwp/core": "^1.1.2", - "@headstartwp/next": "^1.1.6", + "@headstartwp/core": "^1.2.0", + "@headstartwp/next": "^1.2.0", "@linaria/babel-preset": "^4.4.5", "@linaria/core": "^4.2.10", "@linaria/react": "^4.3.8", @@ -22068,8 +22068,8 @@ "version": "0.2.0", "license": "GPL-2.0-or-later", "dependencies": { - "@headstartwp/core": "^1.1.2", - "@headstartwp/next": "^1.1.6", + "@headstartwp/core": "^1.2.0", + "@headstartwp/next": "^1.2.0", "@linaria/babel-preset": "^4.4.5", "@linaria/core": "^4.2.10", "@linaria/react": "^4.3.8", @@ -22097,9 +22097,9 @@ "version": "0.2.0", "license": "GPL-2.0-or-later", "dependencies": { - "@10up/next-redis-cache-provider": "^0.1.5", - "@headstartwp/core": "^1.1.2", - "@headstartwp/next": "^1.1.6", + "@10up/next-redis-cache-provider": "^0.2.0", + "@headstartwp/core": "^1.2.0", + "@headstartwp/next": "^1.2.0", "@linaria/babel-preset": "^4.4.5", "@linaria/core": "^4.2.10", "@linaria/react": "^4.3.8", @@ -22127,8 +22127,8 @@ "version": "0.2.1-next.2", "license": "GPL-2.0-or-later", "dependencies": { - "@headstartwp/core": "^1.1.2", - "@headstartwp/next": "^1.1.6", + "@headstartwp/core": "^1.2.0", + "@headstartwp/next": "^1.2.0", "@linaria/babel-preset": "^4.4.5", "@linaria/core": "^4.2.10", "@linaria/react": "^4.3.8", @@ -22153,7 +22153,7 @@ }, "wp/headless-wp": { "name": "@headstartwp/headstartwp", - "version": "1.0.10", + "version": "1.0.12", "license": "GPL-2.0-or-later", "devDependencies": { "@wordpress/env": "^5.14.0" diff --git a/package.json b/package.json index ad8cad075..c1b5aa9d7 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "build:packages": "turbo run build --filter=./packages/*", "build:wpnextjs": "npm run build:packages && turbo run build --filter=./projects/wp-nextjs", "test": "npm run build:packages && turbo run test", - "lint": "eslint .", + "lint": "turbo run lint", "wp-env": "npm run wp-env:start -w=wp/headless-wp", "nextjs:dev": "turbo run dev --parallel --filter=!./projects/wp-multisite-nextjs --filter=!./projects/wp-multisite-i18n-nextjs --filter=!./projects/wp-nextjs-ts", "nextjs:dev-multisite": "turbo run dev --parallel --filter=!./projects/wp-nextjs", diff --git a/packages/core/.lintstagedrc.json b/packages/core/.lintstagedrc.json new file mode 100644 index 000000000..7a9d31767 --- /dev/null +++ b/packages/core/.lintstagedrc.json @@ -0,0 +1,8 @@ +{ + "*.[tj]s": [ + "eslint" + ], + "*.[tj]sx": [ + "eslint" + ] +} \ No newline at end of file diff --git a/packages/hooks/.lintstagedrc.json b/packages/hooks/.lintstagedrc.json new file mode 100644 index 000000000..7a9d31767 --- /dev/null +++ b/packages/hooks/.lintstagedrc.json @@ -0,0 +1,8 @@ +{ + "*.[tj]s": [ + "eslint" + ], + "*.[tj]sx": [ + "eslint" + ] +} \ No newline at end of file diff --git a/packages/next-redis-cache-provider/.lintstagedrc.json b/packages/next-redis-cache-provider/.lintstagedrc.json new file mode 100644 index 000000000..7a9d31767 --- /dev/null +++ b/packages/next-redis-cache-provider/.lintstagedrc.json @@ -0,0 +1,8 @@ +{ + "*.[tj]s": [ + "eslint" + ], + "*.[tj]sx": [ + "eslint" + ] +} \ No newline at end of file diff --git a/packages/next/.lintstagedrc.json b/packages/next/.lintstagedrc.json new file mode 100644 index 000000000..7a9d31767 --- /dev/null +++ b/packages/next/.lintstagedrc.json @@ -0,0 +1,8 @@ +{ + "*.[tj]s": [ + "eslint" + ], + "*.[tj]sx": [ + "eslint" + ] +} \ No newline at end of file diff --git a/wp/headless-wp/CHANGELOG.md b/wp/headless-wp/CHANGELOG.md index 8893da8e1..1866c96ce 100644 --- a/wp/headless-wp/CHANGELOG.md +++ b/wp/headless-wp/CHANGELOG.md @@ -1,5 +1,17 @@ # @headstartwp/headstartwp +## 1.0.12 + +### Patch Changes + +- f18be490: Ensure htmlspecialchars receives an empty string instead of null to fix deprecation warnings. + +## 1.0.11 + +### Patch Changes + +- 18d09388: Added - New filter available tenup_headless_wp_revalidate_isr_for_post + ## 1.0.10 ### Patch Changes diff --git a/wp/headless-wp/includes/classes/API.php b/wp/headless-wp/includes/classes/API.php index a2ad7dea4..9dbc678b9 100644 --- a/wp/headless-wp/includes/classes/API.php +++ b/wp/headless-wp/includes/classes/API.php @@ -98,7 +98,7 @@ public function modify_rest_params( $args, $request ) { return $args; } - $author = htmlspecialchars( filter_input( INPUT_GET, 'author' ) ); + $author = htmlspecialchars( filter_input( INPUT_GET, 'author' ) ?? '' ); if ( ! empty( $author ) && ! is_numeric( $author ) ) { unset( $args['author__in'] ); @@ -108,10 +108,10 @@ public function modify_rest_params( $args, $request ) { $taxonomies = wp_list_filter( get_object_taxonomies( $args['post_type'], 'objects' ), [ 'show_in_rest' => true ] ); foreach ( $taxonomies as $taxonomy ) { - $term = htmlspecialchars( filter_input( INPUT_GET, $taxonomy->name ) ); + $term = htmlspecialchars( filter_input( INPUT_GET, $taxonomy->name ) ?? '' ); if ( ! $term ) { - $term = htmlspecialchars( filter_input( INPUT_GET, $taxonomy->rest_base ) ); + $term = htmlspecialchars( filter_input( INPUT_GET, $taxonomy->rest_base ) ?? '' ); } if ( ! empty( $term ) && ! is_numeric( $term ) ) { diff --git a/wp/headless-wp/package.json b/wp/headless-wp/package.json index f30ab277b..623b309dc 100644 --- a/wp/headless-wp/package.json +++ b/wp/headless-wp/package.json @@ -1,6 +1,6 @@ { "name": "@headstartwp/headstartwp", - "version": "1.0.10", + "version": "1.0.12", "private": true, "description": "10up Headless WordPress Plugin", "homepage": "https://github.com/10up/headstartwp/blob/develop/wp/headless-wp/README.md", diff --git a/wp/headless-wp/plugin.php b/wp/headless-wp/plugin.php index fa67b7544..e17caa302 100644 --- a/wp/headless-wp/plugin.php +++ b/wp/headless-wp/plugin.php @@ -3,7 +3,7 @@ * Plugin Name: HeadstartWP * Plugin URI: https://github.com/10up/headstartwp-plugin * Description: Adds functionality to the WordPress admin and REST API for 10up's headless framework. - * Version: 1.0.10 + * Version: 1.0.12 * Author: 10up * Author URI: https://10up.com * Text Domain: headstartwp @@ -17,7 +17,7 @@ use HeadlessWP\Preview\PreviewToken; // Useful global constants. -define( 'HEADLESS_WP_PLUGIN_VERSION', '1.0.10' ); +define( 'HEADLESS_WP_PLUGIN_VERSION', '1.0.12' ); define( 'HEADLESS_WP_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); define( 'HEADLESS_WP_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); define( 'HEADLESS_WP_PLUGIN_INC', HEADLESS_WP_PLUGIN_PATH . 'includes/' );