Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/wp-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
composer-options: "--no-progress --no-ansi --no-interaction"

- name: Build schema.json
run: npm install && npm run build:schema && cp schema/schema.json src/plugin/
run: npm install && npm run build:schema

- name: Install WordPress test setup
run: bash tests/bin/install-wp-tests.sh wordpress_test root password 127.0.0.1:${{ job.services.mysql.ports[3306] }} latest
Expand Down
7 changes: 6 additions & 1 deletion schema/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { Ajv } from 'ajv';
import { fileURLToPath } from 'url';
import * as path from 'node:path';
import { readFileSync } from 'node:fs';
import { copyFileSync, readFileSync } from 'node:fs';
import * as fs from 'node:fs';

const cwd = path.dirname( fileURLToPath( import.meta.url ) );
Expand Down Expand Up @@ -64,4 +64,9 @@ fs.writeFileSync(
JSON.stringify( outputSchema, null, '\t' )
);

copyFileSync(
outputSchemaPath,
path.join( cwd, '..', 'src', 'plugin', 'schema.json' )
);

console.log( 'Schema file generated successfully:', outputSchemaPath );
2 changes: 0 additions & 2 deletions webpack.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const { copyFileSync } = require( 'node:fs' );
const path = require( 'node:path' );
const { execSync } = require( 'child_process' );
const CopyPlugin = require( 'copy-webpack-plugin' );
Expand Down Expand Up @@ -215,7 +214,6 @@ class EmitSubjectsSchemaPlugin {
},
async ( assets, callback ) => {
execSync( './schema/build.mjs', { stdio: 'inherit' } );
copyFileSync( SCHEMA_SRC, SCHEMA_PLUGIN_PATH );
callback();
}
);
Expand Down
Loading