# ska-monorepo

ska-blocks is a package in a monorepo. To run the project from source the monorepo needs to be assembled from the source code files bundled in the plugin.

## Building from wordpress.org source

1. Create a root directory for the monorepo (e.g. `ska-monorepo`).
2. Move files (not folders) from `ska-blocks/src/packages` to the monorepo's root directory.
3. Move the `ska-blocks/packages` directory to the monorepo's root directory.
4. Move `ska-blocks` to the monorepo `packages` directory.
6. In monorepo root run `pnpm i` and then `pnpm run start`.
7. Symlink the `packages/ska-blocks` to your `wp-content/ska-blocks` directory.
8. Building zip: add a `build` directory to the monorepo root, as this is where the plugin zip file will be moved to, then run `pnpm run release`.

## Composer

Optionally, to set up composer packages as well:

1. Move `php-css-parser` from `ska-blocks/vendor/ska` to monorepo's `packages` directory.
2. Move `plugin/includes` from `ska-blocks/vendor/ska` to monorepo's `packages/ska-plugin` directory.
3. Run `composer install` in `packages/php-css-parser`, `packages/ska-plugin` and `packages/ska-blocks` directories.
