Skip to content

Commit fe7550a

Browse files
authored
Merge pull request #17 from creative-commoners/pulls/2.2/vendoring-machines
NEW Vendorise module, use new exposed Requirements API and update CI config
2 parents 1297645 + dee284b commit fe7550a

7 files changed

Lines changed: 17 additions & 41 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ before_script:
2121

2222
# Install composer dependencies
2323
- composer install --prefer-dist
24-
- composer require --prefer-dist --no-update silverstripe/framework:4.0.x-dev silverstripe/cms:4.0.x-dev silverstripe/admin:1.0.x-dev
24+
- composer require --prefer-dist --no-update silverstripe/recipe-cms 1.0.x-dev
2525
- composer update
2626

2727
script:
2828
- if [[ $PHPUNIT_TEST ]]; then vendor/bin/phpunit; fi
2929
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=coverage.xml; fi
30-
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs src/ tests/; fi
30+
- if [[ $PHPCS_TEST ]]; then vendor/bin/phpcs --standard=vendor/silverstripe/framework/phpcs.xml.dist src/ tests/; fi
3131

3232
after_success:
3333
- if [[ $PHPUNIT_COVERAGE_TEST ]]; then bash <(curl -s https://codecov.io/bash) -f coverage.xml; fi

composer.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "silverstripe/segment-field",
33
"description": "A reusable approach to segment-generating fields",
4-
"type": "silverstripe-module",
4+
"type": "silverstripe-vendormodule",
55
"keywords": ["silverstripe", "segment"],
66
"license": "MIT",
77
"authors": [
@@ -11,20 +11,22 @@
1111
}
1212
],
1313
"require": {
14-
"silverstripe/framework": "^4.0@dev",
15-
"silverstripe/cms": "^4.0@dev"
14+
"silverstripe/cms": "^4.0"
1615
},
1716
"require-dev": {
1817
"phpunit/phpunit": "^5.7",
1918
"mockery/mockery": "^0.9",
20-
"squizlabs/php_codesniffer": "^3",
21-
"silverstripe/reports": "^4.0@dev",
22-
"silverstripe/siteconfig": "^4.0@dev"
19+
"squizlabs/php_codesniffer": "^3.0",
20+
"silverstripe/reports": "^4.0",
21+
"silverstripe/siteconfig": "^4.0"
2322
},
2423
"extra": {
2524
"branch-alias": {
2625
"dev-master": "2.1.x-dev"
27-
}
26+
},
27+
"expose": [
28+
"client/dist"
29+
]
2830
},
2931
"autoload": {
3032
"psr-4": {

phpcs.xml.dist

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/SegmentField.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,10 @@ public function Preview()
7979
*/
8080
public function Field($properties = array())
8181
{
82-
$module = ModuleLoader::getModule('silverstripe/segment-field');
83-
8482
Requirements::javascript('//code.jquery.com/jquery-1.7.2.min.js');
85-
Requirements::javascript(
86-
ModuleLoader::getModule('silverstripe/admin')
87-
->getRelativeResourcePath('thirdparty/jquery-entwine/dist/jquery.entwine-dist.js')
88-
);
89-
Requirements::javascript($module->getRelativeResourcePath('client/dist/js/segment-field.js'));
90-
Requirements::css($module->getRelativeResourcePath('client/dist/styles/segment-field.css'));
83+
Requirements::javascript('silverstripe/admin:thirdparty/jquery-entwine/dist/jquery.entwine-dist.js');
84+
Requirements::javascript('silverstripe/segment-field:client/dist/js/segment-field.js');
85+
Requirements::css('silverstripe/segment-field:client/dist/styles/segment-field.css');
9186

9287
return parent::Field($properties);
9388
}

tests/SegmentFieldModifier/IDSegmentFieldModifierTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class IDSegmentFieldModifierTest extends SapphireTest
1616
/**
1717
* @inheritdoc
1818
*/
19-
public function tearDown()
19+
protected function tearDown()
2020
{
2121
Mockery::close();
2222

tests/SegmentFieldModifier/SlugSegmentFieldModifierTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class SlugSegmentFieldModifierTest extends SapphireTest
1515
/**
1616
* @inheritdoc
1717
*/
18-
public function tearDown()
18+
protected function tearDown()
1919
{
2020
Mockery::close();
2121

tests/SegmentFieldTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class SegmentFieldTest extends SapphireTest
1818
/**
1919
* @inheritdoc
2020
*/
21-
public function tearDown()
21+
protected function tearDown()
2222
{
2323
Mockery::close();
2424

0 commit comments

Comments
 (0)