Skip to content

Commit

Permalink
Allow asset installation without requiring npm
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Nov 2, 2020
1 parent 4c9eaa3 commit 0b47468
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 23 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Expand Up @@ -68,6 +68,7 @@ jobs:
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Install dependencies with composer php 7.4
if: matrix.php == '7.4'
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mutation.yml
Expand Up @@ -45,6 +45,7 @@ jobs:
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/static.yml
Expand Up @@ -42,6 +42,7 @@ jobs:
key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php }}-composer-
- name: Install dependencies with composer
run: composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

Expand Down
21 changes: 19 additions & 2 deletions composer.json
Expand Up @@ -20,7 +20,10 @@
"prefer-stable": true,
"require": {
"php": "^7.4|^8.0",
"foxy/foxy": "^1.1@dev",
"npm-asset/vizuaalog--bulmajs": "^0.11.0",
"npm-asset/bulma": "^0.9.1",
"npm-asset/bulma-helpers": "^0.3.12",
"oomphinc/composer-installers-extender": "^2.0.0",
"yiisoft/assets": "@dev",
"yiisoft/arrays": "@dev",
"yiisoft/html": "@dev",
Expand All @@ -45,9 +48,23 @@
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
},
"installer-types": [
"npm-asset"
],
"installer-paths": {
"./node_modules/{$name}": [
"type:npm-asset"
]
}
},
"config": {
"sort-packages": true
}
},
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
]
}
15 changes: 0 additions & 15 deletions package.json

This file was deleted.

6 changes: 3 additions & 3 deletions src/Asset/BulmaAsset.php
Expand Up @@ -10,15 +10,15 @@ final class BulmaAsset extends AssetBundle
{
public ?string $basePath = '@assets';
public ?string $baseUrl = '@assetsUrl';
public ?string $sourcePath = '@npm/bulma/css';
public ?string $sourcePath = '@npm/bulma/';

public array $css = [
'bulma.css',
'css/bulma.css',
];

public array $publishOptions = [
'only' => [
'bulma.css',
'css/bulma.css',
],
];
}
2 changes: 1 addition & 1 deletion src/Asset/BulmaJsAsset.php
Expand Up @@ -10,7 +10,7 @@ final class BulmaJsAsset extends AssetBundle
{
public ?string $basePath = '@assets';
public ?string $baseUrl = '@assetsUrl';
public ?string $sourcePath = '@npm/@vizuaalog/bulmajs';
public ?string $sourcePath = '@npm/vizuaalog--bulmajs';

public array $js = [
'dist/bulma.js',
Expand Down
2 changes: 1 addition & 1 deletion src/Asset/FilePluginAsset.php
Expand Up @@ -10,7 +10,7 @@ final class FilePluginAsset extends AssetBundle
{
public ?string $basePath = '@assets';
public ?string $baseUrl = '@assetsUrl';
public ?string $sourcePath = '@npm/@vizuaalog/bulmajs';
public ?string $sourcePath = '@npm/vizuaalog--bulmajs';

public array $js = [
'dist/file.js',
Expand Down
2 changes: 1 addition & 1 deletion src/Asset/MessagePluginAsset.php
Expand Up @@ -10,7 +10,7 @@ final class MessagePluginAsset extends AssetBundle
{
public ?string $basePath = '@assets';
public ?string $baseUrl = '@assetsUrl';
public ?string $sourcePath = '@npm/@vizuaalog/bulmajs';
public ?string $sourcePath = '@npm/vizuaalog--bulmajs';

public array $js = [
'dist/message.js',
Expand Down

0 comments on commit 0b47468

Please sign in to comment.