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

Feature/add more flexibility #413

Merged
merged 29 commits into from
Aug 21, 2024
Merged

Feature/add more flexibility #413

merged 29 commits into from
Aug 21, 2024

Conversation

dustinrue
Copy link
Contributor

Related Issue/RFC: None but all changes are related to the project sub command.

Description of the Change

  • Improves the init process to provide support for two different repository layouts. One rooted in wp-content and another more appropriate for mono repo setups. This is achieved with the use of a currently hidden option called --layout=modern
  • Updates the build system to support either repository layout automatically
  • Ports over a lot of logic to differentiate between a local and CI builds
  • Forces true environment variables to be passed to the downstream build scripts
  • Provides an example build script for people to build off of but builds are otherwise "free" when using this tool to perform builds.
  • Poorly rewrote create-payload.js to just be build.js with a different command sent to build backend. The payload is just a build put into a new directory and ready to be shipped off
  • Removed "deploy-excludes" in favor of "rsync-excludes".

Alternate Designs

Possible Drawbacks

Verification Process

Create repositories using the original design as well as updated design and then performed builds in each. Verified that builds for UIKit based projects complete with out any issue for both the build and create-payload commands.

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.
  • I have added a changeset to my PR. See CONTRIBUTING document for instructions

Copy link

changeset-bot bot commented Jul 5, 2024

🦋 Changeset detected

Latest commit: 8587947

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
10up-toolkit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

packages/toolkit/scripts/project/build.js Fixed Show fixed Hide fixed
}
});
// Copy contents of toolkitPath/project/local into cliPath
execSync(`rsync -rc "${toolkitPath}/project/local/" "${cliPath}"`);

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.
This shell command depends on an uncontrolled
absolute path
.
process.chdir(cliPath);

if (template !== 'none' && !skipComposer) {
execSync(`bash -l ${__dirname}/bash/scripts.sh update-composer`, {

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.
});
}

execSync(`bash -l ${__dirname}/bash/scripts.sh initialize-git`, {

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.

setEnvVariables(variables);

execSync(`bash -l ${__dirname}/bash/scripts.sh package`, {

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.

setEnvVariables(variables);

execSync(`bash -l ${__dirname}/bash/scripts.sh update-composer`, {

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.
log(chalk.red('No build script found.'));
process.exit(1);
}
execSync(`${process.env.SHELL} ${__dirname}/bash/scripts.sh ${buildType}`, {

Check warning

Code scanning / CodeQL

Shell command built from environment values Medium

This shell command depends on an uncontrolled
absolute path
.
@tlovett1 tlovett1 merged commit 8b74e5a into develop Aug 21, 2024
7 checks passed
tlovett1 added a commit that referenced this pull request Aug 21, 2024
commit 8b74e5a
Author: Dustin Rue <[email protected]>
Date:   Wed Aug 21 14:36:32 2024 -0500

    Feature/add more flexibility (#413)

    Co-authored-by: Taylor Lovett <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants