fix(build): add shared-schema to prepare script for CI builds

The shared-schema package was not being built before lint and test
steps in CI, causing "Cannot find module '@sp/shared-schema'" errors.

Changes:
- Add shared-schema:build script to package.json
- Update prepare script to build shared-schema first
- Add shared-schema to build-packages.js for completeness
This commit is contained in:
Johannes Millan 2026-01-11 16:11:36 +01:00
parent 0e92baeb8b
commit 9d77aa2d3f
2 changed files with 12 additions and 3 deletions

View file

@ -22,7 +22,7 @@
"assemble:android:prod": "cd android && ./gradlew assembleRelease && cd ..",
"assemble:android:stage": "cd android && ./gradlew assembleDebug && cd ..",
"prebuild": "npm run env && node ./tools/git-version.js && npm run build:packages",
"prepare": "husky && ts-patch install && npm run plugin-api:build",
"prepare": "husky && ts-patch install && npm run shared-schema:build && npm run plugin-api:build",
"build": "npm run buildAllElectron:noTests:prod",
"build:packages": "node ./packages/build-packages.js",
"buildAllElectron:noTests:prod": "npm run lint && npm run buildFrontend:prod:es6 && npm run electron:build",
@ -125,6 +125,7 @@
"checkFile": "node tools/check-file.js",
"clean:translations": "node ./tools/clean-translations.js",
"plugin-api:build": "cd packages/plugin-api && npm run build",
"shared-schema:build": "cd packages/shared-schema && npm run build",
"plugin-api:build:watch": "cd packages/plugin-api && npm run build:watch",
"vite-plugin:build": "cd packages/vite-plugin && npm run build",
"plugins:build": "npm run vite-plugin:build && cd packages/plugin-dev && npm run build:all",

View file

@ -38,7 +38,15 @@ async function getPlugins() {
const plugins = [];
// Add plugin-api first as it's a dependency
// Add shared-schema first as it's needed for type resolution
plugins.push({
name: 'shared-schema',
path: 'packages/shared-schema',
buildCommand: 'npm run build',
skipCopy: true,
});
// Add plugin-api as it's a dependency for plugins
plugins.push({
name: 'plugin-api',
path: 'packages/plugin-api',
@ -46,7 +54,7 @@ async function getPlugins() {
skipCopy: true,
});
// Add vite-plugin second as it's a build dependency
// Add vite-plugin as it's a build dependency
plugins.push({
name: 'vite-plugin',
path: 'packages/vite-plugin',