Skip to content

Commit

Permalink
Merge branch 'trunk' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
szepeviktor authored Nov 14, 2024
2 parents 59763a6 + 837fe0c commit fd9ff39
Show file tree
Hide file tree
Showing 154 changed files with 3,982 additions and 2,050 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ jobs:
url: https://www.npmjs.com/package/wp-json-schemas
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: https://registry.npmjs.org/
Expand All @@ -38,9 +38,9 @@ jobs:
url: https://www.npmjs.com/package/wp-types
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
registry-url: https://registry.npmjs.org/
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ jobs:
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Composer cache
uses: actions/cache@v3
uses: actions/cache@v4
env:
cache-name: cache-composer-dependencies
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-8.0-composer-${{ hashFiles('composer.json') }}

- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
20 changes: 13 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@
"ergebnis/json-printer": "^3.5",
"johnbillion/args": "1.7.0",
"roots/wordpress-core-installer": "^1.0.0",
"roots/wordpress-full": "6.6-RC3",
"roots/wordpress-full": "6.6",
"wp-cli/core-command": "^2",
"wp-cli/db-command": "^2",
"wp-cli/language-command": "^2",
"wpackagist-plugin/sqlite-database-integration": "^2.1"
"wpackagist-plugin/sqlite-database-integration": "^2.1",
"wpackagist-theme/twentytwentyfour": "^1",
"wpackagist-theme/twentytwentyone": "^2"
},
"config": {
"allow-plugins": {
Expand All @@ -45,7 +47,10 @@
"extra": {
"installer-paths": {
"tests/wordpress/wp-content/plugins/{$name}/": [
"wpackagist-plugin/sqlite-database-integration"
"type:wordpress-plugin"
],
"tests/wordpress/wp-content/themes/{$name}/": [
"type:wordpress-theme"
]
},
"wordpress-install-dir": "tests/wordpress"
Expand All @@ -54,15 +59,16 @@
"test": [
"@php -r \"file_exists( 'tests/wordpress/wp-content/db.php' ) || copy( 'tests/wordpress/wp-content/plugins/sqlite-database-integration/db.copy', 'tests/wordpress/wp-content/db.php' );\"",

"npm run validate",
"npm run build-wp-types",
"npm run test-wp-types",

"rm -f tests/wordpress/wp-content/database/.ht.sqlite",
"wp core multisite-install --url=example.org --title=Example --admin_user=admin [email protected] --skip-email",
"wp language core install de_DE it_IT ar he_IL",

"wp json-dump --theme=twentytwentyone",
"wp json-dump",

"npm run validate",
"./tests/bin/build-wp-types.sh",
"npm run test-wp-types",
"./tests/bin/test.sh"
]
},
Expand Down
15 changes: 7 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wp-json-schemas",
"version": "3.66.0",
"version": "4.66.1",
"description": "JSON schemas for WordPress PHP objects and REST API responses",
"main": "schema.json",
"files": [
Expand All @@ -20,15 +20,14 @@
"license": "MIT",
"devDependencies": {
"ajv-cli": "^5.0",
"ajv-formats": "^2.0",
"json-schema-to-typescript": "^12.0",
"node-jq": "^2.3.5",
"typescript": ">=3"
"ajv-formats": "^3.0",
"json-schema-to-typescript": "^15.0",
"node-jq": "^6.0",
"typescript": ">=4"
},
"scripts": {
"version": "cd packages/wp-types && npm version $(node -p -e \"require('../../package.json').version\") && git add .",
"build-wp-types": "json2ts -i schema.json -o packages/wp-types/index.ts --style.trailingComma=all --style.useTabs && cat packages/wp-types/append.ts >> packages/wp-types/index.ts",
"test-wp-types": "tsc packages/wp-types/tests/test.ts --noEmit --strict",
"validate": "ajv compile --strict --strict-schema=false -c ajv-formats -m tests/external-schemas/hyper-schema.json -s schema.json -r \"schemas/**/*.json\""
"test-wp-types": "tsc packages/wp-types/tests/test.ts --noEmit --strict --target es2015",
"validate": "ajv compile --spec=draft2019 --strict --strict-schema=false -c ajv-formats -m tests/external-schemas/hyper-schema.json -s schema.json -r \"schemas/**/*.json\""
}
}
Loading

0 comments on commit fd9ff39

Please sign in to comment.