Skip to content

Commit 89fc2b1

Browse files
Merge pull request #2 from codenamephp/main
Initial release
2 parents 458ca2f + 5dab71d commit 89fc2b1

7 files changed

Lines changed: 23 additions & 8 deletions

File tree

.github/workflows/prepare-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ jobs:
1818
needs: calculate_next_version
1919
with:
2020
ref: ${{github.ref_name}}
21-
future_release: ${{ needs.calculate_next_version.outputs.version }}
22-
release_branch: 'release'
21+
future-release: ${{ needs.calculate_next_version.outputs.version }}
22+
release-branch: 'release'

.idea/deployer.npm.iml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@
88
![Packagist Downloads](https://img.shields.io/packagist/dt/codenamephp/deployer.npm)
99
![GitHub](https://img.shields.io/github/license/codenamephp/deployer.npm)
1010

11+
## What is it?
12+
13+
This package provides deployer tasks for npm and a basic command to run npm command line.
14+
1115
## Installation
1216

1317
Easiest way is via composer. Just run `composer require codenamephp/deployer.npm` in your cli which should install the latest version for you.
1418

15-
## Usage
19+
## Usage
20+
21+
Just use the tasks in your deployer file or create your own using the command factory or by extending the `\de\codenamephp\deployer\npm\task\AbstractNpmTask`
22+
class.

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
}
1111
],
1212
"minimum-stability": "dev",
13+
"prefer-stable": true,
1314
"require": {
1415
"php": "^8.1",
15-
"codenamephp/deployer.base": "dev-main",
16-
"codenamephp/deployer.command": "dev-main"
16+
"codenamephp/deployer.base": "^1.0",
17+
"codenamephp/deployer.command": "^1.0"
1718
},
1819
"autoload": {
1920
"psr-4": {

src/command/WithBinaryFromDeployer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ final class WithBinaryFromDeployer implements iNpmCommandFactory {
3232
public function __construct(public iGet $deployer = new All()) {}
3333

3434
public function build(string $command, array $arguments = [], array $envVars = [], bool $sudo = false, iRunConfiguration $runConfiguration = null) : iCommand {
35-
return new Command((string) $this->deployer->get('npm:binary', 'npm'), ['--prefix {{release_path}}', '--fund=false', $command, ...$arguments], $envVars, $sudo, $runConfiguration ?? new SimpleContainer());
35+
return new Command((string) $this->deployer->get('npm:binary', 'npm'), ['--prefix {{release_or_current_path}}', '--fund=false', $command, ...$arguments], $envVars, $sudo, $runConfiguration ?? new SimpleContainer());
3636
}
3737
}

test/command/WithBinaryFromDeployerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testBuild() : void {
6161

6262
self::assertInstanceOf(Command::class, $command);
6363
self::assertEquals('123', $command->binary);
64-
self::assertEquals(['--prefix {{release_path}}', '--fund=false', 'some command', 'arg1', 'arg2'], $command->arguments);
64+
self::assertEquals(['--prefix {{release_or_current_path}}', '--fund=false', 'some command', 'arg1', 'arg2'], $command->arguments);
6565
self::assertEquals(['some' => 'env'], $command->envVars);
6666
self::assertTrue($command->sudo);
6767
self::assertSame($runConfiguration, $command->runConfiguration);
@@ -75,7 +75,7 @@ public function testBuild_withDefaults() : void {
7575

7676
self::assertInstanceOf(Command::class, $command);
7777
self::assertEquals('', $command->binary);
78-
self::assertEquals(['--prefix {{release_path}}', '--fund=false', ''], $command->arguments);
78+
self::assertEquals(['--prefix {{release_or_current_path}}', '--fund=false', ''], $command->arguments);
7979
self::assertEquals([], $command->envVars);
8080
self::assertFalse($command->sudo);
8181
self::assertInstanceOf(SimpleContainer::class, $command->runConfiguration);

0 commit comments

Comments
 (0)