kriss/foxy-yii2-convert

Installs: 2 905

Dependents: 2

Suggesters: 0

Security: 0

Stars: 8

Watchers: 3

Forks: 3

Open Issues: 0

Type:composer-plugin

v1.5 2022-03-30 01:29 UTC

This package is auto-updated.

Last update: 2024-10-29 05:28:39 UTC


README

covert Yii2 npm-asset or bower-asset to package.json, so that Foxy can install.

install

composer require kriss/foxy-yii2-convert -vvv

usage

中文

  1. add provide to composer.json to skip install npm-asset or bower-asset

like this:

{
    "provide": {
        "bower-asset/bootstrap": "*",
        "bower-asset/jquery": "*",
        "bower-asset/inputmask": "*",
        "bower-asset/punycode": "*",
        "bower-asset/yii2-pjax": "*",
        "npm-asset/wangeditor": "*",
        "npm-asset/webuploader": "*",
        "bower-asset/typeahead.js": "*"
    },
}
  1. remove composer-asset-plugin or asset-packagist if you used in project

  2. composer install

  3. chage Yii2 npm and bower aliase

like this

'aliases' => [
    '@bower' => '@project/node_modules',
    '@npm' => '@project/node_modules',
],

FAQ

Q: If one package I dont want to install view npm?

A: Like almasaeed2010/adminlte, it can be installed by composer, you can config this in composer.json like:

  "config": {
    "foxy": {
      "enabled": true,
      "manager": "yarn",
      "enable-packages": {
        "almasaeed2010/adminlte": false, // this tip
        "*": true // must be added to the last
      }
    }
  },

Q: If one package has package.json,and just use for develop?

A: Like kartik-v/dependent-dropdown, you can config this in composer.json like:

  "config": {
    "foxy": {
      "enabled": true,
      "manager": "yarn",
      "enable-packages": {
        "kartik-v/dependent-dropdown": false, // this tip
        "*": true // must be added to the last
      }
    }
  },

Q: If one package is dont have same npm package name in bower?

A: see Issue: Not macthed asset in bower and npm