Giter Site home page Giter Site logo

kersysgediminas / api-tools-asset-manager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from laminas-api-tools/api-tools-asset-manager

0.0 0.0 0.0 229 KB

Composer plugin for copying module assets into application document roots.

Home Page: https://api-tools.getlaminas.org/documentation

License: BSD 3-Clause "New" or "Revised" License

JavaScript 0.12% PHP 99.76% CSS 0.13%

api-tools-asset-manager's Introduction

api-tools-asset-manager

Build Status

🇷🇺 Русским гражданам

Мы, участники Laminas, родились и живем в разных странах. У многих из нас есть друзья, родственники и коллеги как в России, так и в Украине. Некоторые из нас родились в России. Некоторые из нас живут в России. У некоторых бабушки и дедушки сражались с фашистами во Второй мировой войне. Здесь никто не поддерживает фашизм.

У одного из нас есть украинская родственница, которая спаслась из дома вместе с сыном. Поезд задержался из-за бомбежки на дороге впереди. У нас есть друзья, которые прячутся в бомбоубежищах. Мы с тревогой ждем весточки от них после воздушных налетов, которые беспорядочно наносят удары и попадают по больницам, школам, детским садам и домам. Мы не берем это из каких-либо СМИ. Мы наблюдаем это напрямую.

Вы доверяете нам достаточно, чтоб использовать наши программы, и мы просим вас довериться нам вновь. Мы нуждаемся в помощи. Выходите и протестуйте против этой бесполезной войны. Остановите кровопролитие. Скажите "Нет войне!"

🇺🇸 To Citizens of Russia

We at Laminas come from all over the world. Many of us have friends, family and colleagues in both Russia and Ukraine. Some of us were born in Russia. Some of us currently live in Russia. Some have grandparents who fought Nazis in World War II. Nobody here supports fascism.

One team member has a Ukrainian relative who fled her home with her son. The train was delayed due to bombing on the road ahead. We have friends who are hiding in bomb shelters. We anxiously follow up on them after the air raids, which indiscriminately fire at hospitals, schools, kindergartens and houses. We're not taking this from any media. These are our actual experiences.

You trust us enough to use our software. We ask that you trust us to say the truth on this. We need your help. Go out and protest this unnecessary war. Stop the bloodshed. Say "stop the war!"

api-tools-asset-manager is a composer plugin that will copy configured web-accessible assets into the public document root of your Laminas application. It uses the configuration format of rwoverdijk/AssetManager, and specifically the subset:

'asset_manager' => [
    'resolver_configs' => [
        'paths' => [
            /* paths containing asset directories */
        ],
    ],
],

Each configured path is iterated, and every path under it is then copied into the public tree.

Installation

$ composer require --dev laminas-api-tools/api-tools-asset-manager

Recommended for development

We recommend usage of this module primarily for development purposes. In most cases, assets from third-party modules should be overridden with project-specific assets when preparing for production. To emphasize this, the assets are excluded from your git repository by default. (You may add them manually later, as explained below.)

Example

As an example, given the following directory structure inside a package:

./
- asset/
  - README.md
  - gruntfile.js
  - package.json
  - api-tools/
    - css/
      - bootstrap.min.css
    - img/
      - logo.png
    - js/
      - bootstrap.min.js
      - jquery.min.js
  - api-tools-welcome/
    - css/
      - main.min.css
    - img/
      - ag-hero.png
- config/
  - module.config.php

where module.config.php defines (minimally) the following:

return [
    'asset_manager' => [
        'resolver_configs' => [
            'paths' => [
                __DIR__ . '/../asset/'
            ],
        ],
    ],
]

When you install the package, the asset manager will copy each of the asset/api-tools/ and asset/api-tools-welcome/ trees to the project's public/ path. The individual files asset/README.md, asset/gruntfile.js, and asset/package.json are omitted from the install, as they are not directories.

Additionally, during installation, the plugin adds a .gitignore file to the public/ path, listing each of the new directories:

# public/.gitignore
api-tools/
api-tools-welcome/

After installation, you may access any of the assets installed relative to the public root.

Uninstallation

When you remove the module, the plugin will:

  • Remove any asset trees configured for the module from the public tree.
  • Remove the .gitignore entries associated with those asset trees from the public/.gitignore file.

Keeping assets

Assets are marked by Git to ignore by default. The intention of this module is primarily for development purposes; it was developed to allow installation of assets related to the Apiglity admin UI, welcome screen, and documentation, most of which are relevant in development mode only.

However, if you wish to keep the assets in your public tree, you can do so as follows:

  • Edit the public/.gitignore file to remove the entry for the asset tree(s) you wish to keep.
  • Add the asset tree(s) to your repository (git add public/{tree}).

Removing the entry from public/.gitignore is enough to prevent the uninstaller from removing the assets when you remove a module.

api-tools-asset-manager's People

Contributors

alexdenvir avatar boesing avatar geerteltink avatar michalbundyra avatar ocramius avatar rogervila avatar samsonasik avatar snapshotpl avatar weierophinney avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.