-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The main goal of this contribution is to make possible to bundle app with stylesheets with Vite. Vite expects the main entrypoint to define the stylesheets to load so it excludes them from the manifets files as root entries. This is fine for most cases where we can tell the app to load the stylesheets. There is a few cases in Tuleap where this is not possible (mostly global themes/"framework") which we will need additional work to be built with Vite. There is however no need at this point but it could be handled in a similar way than what vite_ruby does with a custom manifest plugin [0]. The warning that is now visible when buiding the API Explorer is due to a IE7 workaround and will be removed the next time we update swagger-ui [1] (and they rebuild their distributed files). No functionnal changes expected. Part of request #23415: Allow to bundle app with Vite [0] https://github.com/ElMassimo/vite_ruby/blob/vite-plugin-ruby%403.0.3/vite-plugin-ruby/src/manifest.ts [1] swagger-api/swagger-ui#7526 Change-Id: I5e6b13756d3c4fbff99439b470fdb795a8ab7b72
- Loading branch information
Showing
28 changed files
with
453 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
/** | ||
* Copyright (c) Enalean, 2021-Present. All Rights Reserved. | ||
* | ||
* This file is a part of Tuleap. | ||
* | ||
* Tuleap is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* Tuleap is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Tuleap. If not, see <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tuleap\Layout; | ||
|
||
final class CssViteAsset implements CssAssetGeneric | ||
{ | ||
private function __construct(private string $file_url) | ||
{ | ||
} | ||
|
||
public static function buildCollectionFromMainFileName(IncludeViteAssets $include_assets, string $file_name): CssAssetCollection | ||
{ | ||
return new CssAssetCollection( | ||
array_map( | ||
static fn (string $file_url) => new self($file_url), | ||
$include_assets->getStylesheetsURLs($file_name) | ||
) | ||
); | ||
} | ||
|
||
public function getFileURL(ThemeVariation $variant): string | ||
{ | ||
return $this->file_url; | ||
} | ||
|
||
public function getIdentifier(): string | ||
{ | ||
return basename($this->file_url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.