Skip to content

Commit

Permalink
feat(php): add the new php language plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Jan 9, 2025
1 parent 8d17c0f commit fc5ba39
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 2 deletions.
14 changes: 14 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"@form8ion/nuxt": "2.0.0",
"@form8ion/octoherd-script": "1.0.0",
"@form8ion/ossf-scorecard": "1.2.1",
"@form8ion/php": "1.0.0",
"@form8ion/probot-scaffolder": "1.0.0-alpha.5",
"@form8ion/project": "20.0.0",
"@form8ion/react-components-scaffolder": "3.0.3",
Expand Down
8 changes: 7 additions & 1 deletion src/common/plugins.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as dependabotPlugin from '@form8ion/dependabot-scaffolder';
import * as renovatePlugin from '@form8ion/renovate-scaffolder';
import * as rubyPlugin from '@form8ion/ruby-scaffolder';
import * as phpPlugin from '@form8ion/php';
import * as githubPlugin from '@form8ion/github';
import * as gitlabPlugin from '@travi/gitlab-scaffolder';

Expand All @@ -12,7 +13,12 @@ export function project(decisions) {
Dependabot: dependabotPlugin,
Renovate: renovatePlugin
},
languages: {JavaScript: javascriptPluginFactory(decisions), Ruby: rubyPlugin, Shell: shellPluginFactory()},
languages: {
JavaScript: javascriptPluginFactory(decisions),
Ruby: rubyPlugin,
Shell: shellPluginFactory(),
PHP: phpPlugin
},
vcsHosts: {
GitHub: githubPlugin,
GitLab: gitlabPlugin
Expand Down
8 changes: 7 additions & 1 deletion src/common/plugins.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as dependabotPlugin from '@form8ion/dependabot-scaffolder';
import * as renovatePlugin from '@form8ion/renovate-scaffolder';
import * as rubyPlugin from '@form8ion/ruby-scaffolder';
import * as phpPlugin from '@form8ion/php';
import * as githubPlugin from '@form8ion/github';
import * as gitlabPlugin from '@travi/gitlab-scaffolder';

Expand All @@ -27,7 +28,12 @@ describe('plugins', () => {
Dependabot: dependabotPlugin,
Renovate: renovatePlugin
},
languages: {JavaScript: jsPlugin, Ruby: rubyPlugin, Shell: shellPlugin},
languages: {
JavaScript: jsPlugin,
Ruby: rubyPlugin,
Shell: shellPlugin,
PHP: phpPlugin
},
vcsHosts: {
GitHub: githubPlugin,
GitLab: gitlabPlugin
Expand Down
8 changes: 8 additions & 0 deletions test/integration/features/php.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Feature: PHP Project

Scenario: Scaffold
Given the project should be versioned in git
And the GitHub token is valid
And the project language should be PHP
When the project is scaffolded
Then the core PHP files are present
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import {fileExists} from '@form8ion/core';

import {Before, Given, Then} from '@cucumber/cucumber';
import assert from 'node:assert';

let questionNames;

Before(async function () {
({questionNames} = await import('@form8ion/project'));
});

Given('the project language should be PHP', async function () {
this.setAnswerFor(questionNames.PROJECT_LANGUAGE, 'PHP');
});

Then('the core PHP files are present', async function () {
assert(await fileExists(`${this.projectRoot}/composer.json`));
});

0 comments on commit fc5ba39

Please sign in to comment.