Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone repository setup for wp-now #478

Closed
wants to merge 2 commits into from
Closed

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented May 30, 2023

What?

Removing wp-now from the main repository means it needs a standalone setup where build, tests, and releases all work.

On the first sight, it might seem like a lot of work. However, thanks to the modularity of nx this is as simple as removing all the files that are unrelated to wp-now. It provides a starting point with feature parity as compared to the existing repository setup.

Reviewing

There are too many changes to use the Files changed Github feature. Instead, refer to the wp-now-standalone branch.

Other notes

If wp-now finds that useful, it may now easily remove nx as a build tool. It is not that useful for a single project. In this scenario, it would rely just on vite which is already configured in the wp-now project directory.

As a bonus point, wp-now can now be started directly using node without the need to go through nx preview because all its dependencies are available through node_modules:

; node dist/packages/wp-now/main.js
wp-now <cmd> [args]

Commands:
  wp-now start       Start the server
  wp-now php <file>  Run the php command passing the arguments for php cli

Options:
      --version  Show version number                                   [boolean]
  -h, --help     Show help                                             [boolean]

You must provide a valid command

To confirm that build, tests, etc indeed work, refer to the CI checks below this PR.

Orchestrating wp-now releases

The same old npm run release command continues to work for the standalone version of wp-now:

npm run release                                                                                                                   130 ↵

> [email protected] release
> lerna publish patch --yes --no-private --loglevel=verbose

lerna notice cli v6.6.1
lerna verb rootPath /Users/cloudnik/www/Automattic/core/plugins/playground
lerna verb session 0d92a7c46d571f2d
lerna verb user-agent lerna/6.6.1/[email protected]+arm64 (darwin)
lerna verb rootPath /Users/cloudnik/www/Automattic/core/plugins/playground
lerna info current version 0.1.51
lerna verb isAnythingCommitted 1
lerna verb currentBranch wp-now-standalone
lerna verb hasTags true
lerna info Looking for changed packages since v0.1.51
lerna verb filtered diff [
lerna verb filtered diff   'packages/nx-extensions/package.json',
lerna verb filtered diff   'packages/nx-extensions/src/generators/nx-extensions/generator.ts'
lerna verb filtered diff ]
lerna verb filtered diff [
lerna verb filtered diff   'packages/wp-now/CONTRIBUTING.md',
lerna verb filtered diff   'packages/wp-now/project.json',
lerna verb filtered diff   'packages/wp-now/src/wp-now.ts'
lerna verb filtered diff ]
lerna verb updated nx-extensions
lerna verb updated @wp-now/wp-now
lerna verb git-describe undefined => "v0.1.51-9-g816d98e7"

Changes:
 - @wp-now/wp-now: 0.1.51 => 0.1.52

lerna info auto-confirmed 
lerna info execute Skipping releases
lerna verb version @wp-now/wp-now has no lockfile. Skipping lockfile update.
lerna verb version Updating root package-lock.json
lerna verb git [ 'commit', '-m', 'v0.1.52' ]
lerna verb git [ 'tag', 'v0.1.52', '-m', 'v0.1.52' ]
lerna info git Pushing tags...
lerna info publish Publishing packages to npm...
lerna verb getCurrentSHA 186cfb456b235d7cbe3b56dbbe1698596ede1ab7
lerna info lifecycle [email protected]~prepare: [email protected]

> [email protected] prepare /Users/cloudnik/www/Automattic/core/plugins/playground
> husky install

husky - Git hooks installedpack: info lifecycle [email protected]~prepare: [email protected]
lerna info lifecycle [email protected]~prepublishOnly: [email protected]

> [email protected] prepublishOnly /Users/cloudnik/www/Automattic/core/plugins/playground
> npm run build

Next steps

@adamziel
Copy link
Collaborator Author

I accidentally committed a version bump to v0.1.52 to this repo while testing npm run release. Just ignore it.

@adamziel
Copy link
Collaborator Author

All checks pass, cc @danielbachhuber @sejas @wojtekn

@adamziel adamziel force-pushed the wp-now-standalone branch 3 times, most recently from ac35c5b to f125394 Compare May 30, 2023 20:19
@adamziel
Copy link
Collaborator Author

adamziel commented May 30, 2023

These three PRs are included in this branch, but the version bump to v0.1.56 isn't:

#451
#395
#455

The conflicts are all caused by the version bump and can be ignored for the purposes of the migration.

@sejas
Copy link
Collaborator

sejas commented May 31, 2023

@adamziel , thank you for all the work in separating the projects 🙏 .
I think it was beneficial to have the projects together in the early phases, so we could modify php-wasm without releasing new versions.

@adamziel
Copy link
Collaborator Author

adamziel commented May 31, 2023

The code migration to https://github.com/WordPress/playground-tools is finished so I'm closing this PR

@adamziel adamziel closed this May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants