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

Blueprints: Remove setPhpIniEntry step #1288

Merged
merged 3 commits into from
Apr 21, 2024
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
23 changes: 22 additions & 1 deletion packages/playground/blueprints/src/lib/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ export function compileBlueprint(
): CompiledBlueprint {
blueprint = {
...blueprint,
steps: (blueprint.steps || []).filter(isStepDefinition),
steps: (blueprint.steps || [])
.filter(isStepDefinition)
.filter(isStepStillSupported),
};
// Convert legacy importFile steps to importWxr
for (const step of blueprint.steps!) {
Expand Down Expand Up @@ -414,6 +416,25 @@ function isStepDefinition(
return !!(typeof step === 'object' && step);
}

/**
* Determines if a step is still supported, or was it deprecated
* and removed.
*
* @param step The step definition to test.
* @returns Whether the step is still supported.
*/
function isStepStillSupported(
step: Record<string, any>
): step is StepDefinition {
if (step['step'] === 'setPhpIniEntry') {
console.warn(
`The "setPhpIniEntry" Blueprint is no longer supported and you can remove it from your Blueprint.`
);
return false;
}
return true;
}

interface CompileStepArgsOptions {
/** Optional semaphore to control access to a shared resource */
semaphore?: Semaphore;
Expand Down
1 change: 0 additions & 1 deletion packages/playground/blueprints/src/lib/steps/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export { activateTheme } from './activate-theme';
export { runPHP } from './run-php';
export { runPHPWithOptions } from './run-php-with-options';
export { runSql } from './run-sql';
export { setPhpIniEntry } from './set-php-ini-entry';
export { request } from './request';
export { enableMultisite } from './enable-multisite';
export { cp } from './cp';
Expand Down
3 changes: 0 additions & 3 deletions packages/playground/blueprints/src/lib/steps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { RmdirStep } from './rmdir';
import { RunSqlStep } from './run-sql';
import { MkdirStep } from './mkdir';
import { MvStep } from './mv';
import { SetPhpIniEntryStep } from './set-php-ini-entry';
import { RunPHPStep } from './run-php';
import { RunPHPWithOptionsStep } from './run-php-with-options';
import { RequestStep } from './request';
Expand Down Expand Up @@ -65,7 +64,6 @@ export type GenericStep<Resource> =
| RunPHPWithOptionsStep
| RunWpInstallationWizardStep
| RunSqlStep<Resource>
| SetPhpIniEntryStep
| SetSiteOptionsStep
| UnzipStep<Resource>
| UpdateUserMetaStep
Expand Down Expand Up @@ -96,7 +94,6 @@ export type {
RunWpInstallationWizardStep,
RunSqlStep,
WordPressInstallationOptions,
SetPhpIniEntryStep,
SetSiteOptionsStep,
UnzipStep,
UpdateUserMetaStep,
Expand Down
32 changes: 0 additions & 32 deletions packages/playground/blueprints/src/lib/steps/set-php-ini-entry.ts

This file was deleted.

Loading