Commit graph

1134 commits

Author SHA1 Message Date
Peter Ovchyn
ae3104c46d Allow skins to override mediawiki.page.ready initialisation
Add 'ready.config.json' to resource
Add 'collapsible', 'sortable'  field to be possible override via hook.
In order to override setting, new hook ResourceLoaderPageReadyConfigHook has been introduced.

A new config field for search will follow.

Bug: T250851
Change-Id: I041d4a4b9114f1190f28e0283d96cd33b81f9850
2020-07-28 20:08:27 +00:00
jenkins-bot
e9ad97eead Merge "Add watchlist expiry support to applicable APIs" 2020-07-14 04:37:44 +00:00
MusikAnimal
6a898faed2 Add watchlist expiry support to applicable APIs
This introduces an ApiWatchlistTrait that refactors out common code
across APIs that allow you to watch pages. Some methods have been
migrated from ApiBase and changed completely, but codesearch suggests
they aren't being used outside the API modules in this patch.

Bug: T248512
Bug: T248514
Change-Id: Ia18627b9824dca81f44f0571e8420d89b7626cf6
2020-07-13 18:18:15 -04:00
DannyS712
c32f1bd419 Add purgeExpiredBlocks maintenance script
In case there aren't enough local block for purging to happen automatically

Bug: T257393
Change-Id: I866ac64219bf5f72a6e41ad32bafc5be9d2c89fa
2020-07-08 15:45:56 +00:00
arttsymbar
b795681612 Language: Make common implementation of findVariantLink functions of Language Converters.
Bug: T254778
Change-Id: Id44539eb6ae2efcb092e871ae149be7235f5ba73
2020-07-02 19:14:45 +03:00
Timo Tijhof
f5644ba904 language: Move converters/ to includes/language/converters
These are easy to move. They contain regular, testable, source code,
are loaded only via the autoloader, and have no references to their
file paths from anywhere else in or outside of core (as far as
Codesearch can see).

Change-Id: Ibe94e541637bb273bd11dba6c2bc5b59f601dd19
2020-07-02 01:57:56 +01:00
Timo Tijhof
3806d1b081 language: Put remaining language Hook interfaces under includes/
Follows-up f5aaf75ad1, which introduced the new Hook interfaces,
with some under includes/language/Hook/ and others under languages/Hook/.
Unify under the former.

Bug: T225756
Change-Id: I887f5037771d96f455cc4d0c8aafe185186b917d
2020-07-02 01:54:08 +01:00
Timo Tijhof
a7d9341d79 language: Move LanguageConverterFactory and TrivialLanguageConverter to includes/
Follows-up 61e0908fa2 (I0e4d77de0), which introduced these new classes
in the old languages/ directory instead of under includes/language.

Bug: T226833
Bug: T225756
Change-Id: Ib19db32303c9e2275a0007a3583820c6b1d5529c
2020-07-02 01:47:46 +01:00
DannyS712
5abd50b925 Add HistoryTools and DiffTools hooks
Bug: T255494
Bug: T255495
Change-Id: Ib2ab2e26a95affdd1dfa6b945f752157580ea2d3
2020-06-23 17:30:22 -07:00
Timo Tijhof
9c7dc9e760 installer: Add intro to Welcome page, add Help/Bug/Contribute links
This removes the readme page embedding in the installer.

Bug: T256062
Change-Id: I453a8e691371266634638e81e54ce18e19cb4467
2020-06-22 21:58:43 +01:00
jenkins-bot
c41566413b Merge "skins: Port SkinFallback and SkinApiOutput to a generic SkinMustache class" 2020-06-15 18:13:50 +00:00
jdlrobson
26d5f78f84 skins: Port SkinFallback and SkinApiOutput to a generic SkinMustache class
The new SkinMustache class is based on the emerging class in Vector.
Having this in core, will allow Vector to make use of this class
immediately and provide a minimal generic mechanism going forward
for rendering skins using Mustache. For now, I've fleshed out the minimum
possible data in getTemplateData which are based on existing functions in
Vector.

The Skin class now takes a generic options parameter which allows
registration of a skin using the SkinMustache class with a templateDirectory
option pointing to the associated template. A `styles` option can be passed
to define stylesheets that should be associated with the skin.

The SkinApi and SkinFallback classes are reduced significantly.

There are no known uses of SkinApiTemplate and it is thus removed.

SkinFallbackTemplate is removed and its functions copied across to
SkinFallback

End user changes:
* The fallback skin no longer prints the confusing warning message if the default
  skin is setup incorrectly. Previously viewing the fallback skin with useskin
  indicated that wgDefaultSkin was not set correctly which was misleading and confusing.
* Factory functions now receive skin options as a second parameter and the service as a
  first - this is due to how ObjectFactory handles the extraArgs key for 'factory' key
  - placing it at the beginning.

Bug: T254048
Change-Id: Ibbabd1d0f26efebf8f8ff068966685dc2191c527
2020-06-15 10:51:31 -07:00
jenkins-bot
a2812b8a6a Merge "Rename CoreMagicWords to CoreMagicVariables and update docs" 2020-06-12 19:18:02 +00:00
Tim Starling
a30b328bd4 Rename CoreMagicWords to CoreMagicVariables and update docs
There's already a thing called magic words, and this is not it. These
things are called variables. There are many usages of this term in the
source. The term was introduced by Lee in 2002: originally
OutputPage::replaceVariables() contained only this functionality.

I introduced the term "magic word", meaning a localizable keyword.
Localizable keywords are an abstraction not limited to this use case.

"Magic variables" is a neologism, but I suppose it is permissible, since
it disambiguates. Whereas calling a variable a magic word conflates rather
than disambiguates.

Fix terminology in magicword.md and update the examples.

Change-Id: I621c888e3790a145ca9978f6b30ff1a8f685b64c
2020-06-11 13:28:45 +10:00
mainframe98
4e2897575a Replace BaseTemplateAfterPortlet with SkinAfterPortlet
BaseTemplate should not handle anything but rendering.
In order to allow replacing it with another renderer,
such as Mustache or Vue, its hooks should be moved to
the Skin class instead.

BaseTemplateAfterPortlet is soft deprecated to allow
filtering, preventing the hook from running twice.

Both BaseTemplate::getAfterPortlet and ::renderAfterPortlet
have been deprecated as well, with both now calling
Skin::getAfterPortlet after running the
BaseTemplateAfterPortlet hook.

Bug: T253797
Change-Id: I438daa79d3d97e2518e6258c3213a805bd1f30e8
2020-06-09 21:51:58 +00:00
Petr Pchelko
2704be7df8 Introduce DeprecatablePropertyArray and use it for PageUpdater
Bug: T250638
Change-Id: I53e39be59228ac5a57f34d51d733d1647331889c
2020-06-09 07:09:00 -07:00
jenkins-bot
3f2937810e Merge "mime: Convert built-in MIME mappings to PHP arrays" 2020-05-21 01:01:06 +00:00
Timo Tijhof
b160ffc27f benchmarks: Remove bench_wfIsWindows.php
This was introduced in r75446 based on r75429. This is not a
benchmark of MW code, but rather a static comparison of how
PHP performs. I'm not sure that's useful to keep long-term.

For what it's worth, anecdotally it seems on PHP 7.2, the caching
might actually be slowing it down. I speculate this might be due
to the simpler variant being easier to optimise, but it hardly
matters as this function now has a very different implementation,
and if something were to call this so often that its runtime
is significant, the caller should probably just avoid doing that
in the first place. Lexical caching tends to be easier to reason
about in the long run, compared to static/unreleased/uncontrolled
caches.

> Running PHP version 7.2.30 (x86_64) on Linux 4.19 (Debian 9 Stretch)
> BenchWfIsWindows::wfIsWindows()
>    count: 100
>     rate: 208464.4/s
>    total:     0.48ms
>     mean:     0.00ms
>      max:     0.01ms
>   stddev:     0.00ms
>
> BenchWfIsWindows::wfIsWindowsCached()
>    count: 100
>     rate: 163266.0/s
>    total:     0.61ms
>     mean:     0.01ms
>      max:     0.05ms
>   stddev:     0.01ms

Change-Id: Iedd273705b88268f1f4d2632913983cbd1028649
2020-05-20 03:33:49 +01:00
Ori Livneh
cb44ddf85b mime: Convert built-in MIME mappings to PHP arrays
Currently, MimeAnalyzer builds the internal mappings of MIME types <=> file
extensions by concatenating several string buffers in mime.type format into a
giant string, and then parsing it. The mapping of MIME types to internal
media types is built up in a similar way, except we use a dubious homegrown
format with undocumented conventions. It's a mess, and an expensive one --
~1.5% of api.php CPU time on the WMF cluster is spent building these buffers
and parsing them. Converting the mappings to PHP associative arrays makes
them much cheaper to load and easier to maintain.

Doing this without breaking compatibility with existing behaviors requires
some delicate footwork. The current mime.types buffer is made up of the
following fragments, in order:

  1) MimeAnalyzer::$wellKnownTypes
  2) If $wgMimeTypeFile == 'includes/mime.types' (sic!):
       the contents of includes/libs/mime/mime.types.
     If $wgMimeTypeFile is another file path (e.g., '/etc/mime.types'):
       the contents of that file.
     If !wg$MimeTypeFile, this fragment is blank.
  3) MimeAnalyzer::$extraTypes (populated by extensions via hook).

The mime.info buffer is built up in the exact same way, except it's
MimeAnalyzer::$wellKnownInfo, $wgMimeInfoFile, and MimeAnalyzer::$extraInfo.

What this means in effect is that some built-in MediaWiki MIME mappings are
"baked in" (anything in MimeAnalyzer::$wellKnown*), and others can be
overridden (anything in includes/libs/mime/mime.*).

To avoid breaking backward compatibility, we have to preserve the
distinction.  Thus this change has two MIME mappings, encapsulated in two
classes: 'MimeMapMinimal', which contains just the baked-in mappings, and
'MimeMap' which contains both the baked-in and overridable mappings.  We also
have to keep the code for parsing mime.types and the ad-hoc mime.info format,
at least for now.

In a FUTURE change (i.e., not here), I think we can:

* Deprecate $wgMimeTypeFile in favor of a new config var,
  $wgExtraMimeTypeFile. $wgMimeTypeFile is evil because if you are using to
  add support for additional MIME types, you can end up unwittingly dropping
  support for other types that exist in MediaWiki's mime.types but not your
  file. The new $wgExtraMimeTypeFile would only be used to add new MIME
  mappings on top of the standard MimeMappings, which was probably the
  original intent for $wgMimeTypeFile.
* Deprecate $wgMimeInfoFile. I don't think we need to provide a replacement,
  because extensions can use the hook, and I doubt anyone is using the config
  var. But if we wanted to provide an alternative, we could have a
  $wgExtraMimeInfoMap that has an array of extra mappings.
* Deprecate MimeAnalyzer::addExtraTypes and MimeAnalyzer::addExtraInfo, and
  provide alternative interfaces that take structured input instead of string
  blobs.

I tested this by dumping the internal state of MimeAnalyzer before and after
this CL using the script in Ib856a69fe, using both default and custom values
for $wgMimeInfo(File|Type).

Bug: T252228
Change-Id: I9b2979d3c9c0dee96bb19e0290f680724e718891
2020-05-19 00:59:52 -04:00
Tim Starling
9f7b735e0f Rename SkinAddFooterLinks to SkinAddFooterLinksHook and add HookRunner method
The interface name is the hook name with "Hook" added.

Change-Id: Ic1e98dfbc9f14938ff75645431bc250a08c337cb
2020-05-18 12:18:36 +10:00
jdlrobson
712312f9cb SkinTemplate: Allow modification of the footer directly
Historically skins like MobileFrontend and  WhoIsWatching rely on
the SkinTemplateOutputPageBeforeExec hook.

I want to deprecate this and allow direct manipulation of the footer
prior to rendering.

The new hook is named SkinGetFooterLinks.

The existing getFooterLinks method is modified. Given this is a new
function, is protected and final and currently has no usages, this
can be done safely.

MobileFrontend: Id83ef2f2cba1dce940f89125b5cd26a29421ee48
Usage in Vector: I4e89beb96f6401ed7e51bafdf0aac408f5a2c42f

Bug: T251817
Change-Id: Id258b1ec2ae7008fc4d586d0647a5131ec889fe6
2020-05-13 15:08:47 -07:00
jenkins-bot
dac0f0de1a Merge "Update hook interfaces for recent additions and deprecations" 2020-05-05 06:56:57 +00:00
jenkins-bot
4d9b4ba5fc Merge "maintenance: Remove maintenance/cdb.php" 2020-05-05 02:14:33 +00:00
DannyS712
b361cf7239 Update hook interfaces for recent additions and deprecations
Changes since the interfaces were generated:
5 hooks added:
* RevisionUndeleted
* ParserBeforePreprocess
* RollbackComplete
* HtmlCacheUpdaterAppendUrls
* HtmlCacheUpdaterVaryUrls

9 hooks deprecated:
* ArticleRevisionUndeleted
* ArticleRollbackComplete (soft deprecation)
* UndeleteShowRevision
* InternalParseBeforeSanitize
* ParserFetchTemplate
* ParserSectionCreate
* ParserPreSaveTransformComplete
* BeforeParserrenderImageGallery
* ParserBeforeTidy

Bug: T240307
Change-Id: Ib91b1d8e519e6cb3c74a6fe174fe2fd0103d6d30
2020-05-05 11:22:04 +10:00
Timo Tijhof
6854834ca4 maintenance: Remove maintenance/cdb.php
There are almost no CDB files left in MediaWiki, and that ones
that remain (commonpasswords.cdb and LCStore support) are
sufficiently large, automated or rarely changed that one wouldn't
be expected to debug them regularly enough to warrant a whole
interactive REPL script dedicated to it.

Note that one can still read these with relative ease using
the eval.php REPL, e.g. using Cdb\Reader::open() and then
calling get($key), firstkey(), or nextkey() etc.

And as of I858dbd5746, a simplified version of this CLI
exists in the wikimedia/cdb library as well.

Change-Id: I20654b91cf15cad512cedeab659ab0dcce5d85f0
2020-05-04 23:36:08 +00:00
Amir Sarabadani
8a4c400412 Introduce maintenance/generateSchemaSql.php
A new script to generate SQL schema from abstract json files.

Bug: T230421
Change-Id: I52f36ed40fc8aac6ff44f046169ae59dbb8f888a
2020-05-04 23:23:19 +00:00
Timo Tijhof
b7ac554304 resourceloader: Move RL hooks to own namespace, use PSR-4
Follows-up f5aaf75ad1.

* Improve some docs for these hooks.
* Add type hints.
* Add them as a subgroup within the ResourceLoader docgroup
  for easy navigation.

Bug: T246855
Change-Id: I52f31e2b63dcf265b27e68ba8fd4f885d82088ac
2020-05-04 22:42:00 +00:00
jenkins-bot
eb88d78c3a Merge "Refactor magic word implementations out of Parser.php" 2020-04-22 08:34:54 +00:00
jenkins-bot
4199c80783 Merge "maintenance: Move FakeMaintenance and LoggedUpdateMaintenance to their own files" 2020-04-21 17:26:59 +00:00
Daimona Eaytoy
870743489b maintenance: Move FakeMaintenance and LoggedUpdateMaintenance to their own files
Originally submitted as commit 2cdeb26d0c.

This patch is fully backwards compatible. The Maintenance.php entry
point is now a true entry point (i.e. no classes defined), and it requires
all the *Maintenance classes.

Bug: T246780
Change-Id: I75b22f54b19fe560ab71349189598245af1c5693
2020-04-21 16:42:01 +00:00
jenkins-bot
cc89a81451 Merge "Automatically generated hook interfaces" 2020-04-21 00:07:41 +00:00
jenkins-bot
1421ca6b65 Merge "Optimize email sending on password reset" 2020-04-20 17:03:09 +00:00
Tim Starling
f5aaf75ad1 Automatically generated hook interfaces
Add hook interfaces which were generated by a script which parses
hooks.txt and identifies caller namespaces and directories.

Hook interfaces are mostly placed in a Hook/ subdirectory
relative to the caller location. When there are callers in multiple
directories, a "primary" caller was manually selected. The exceptions to
this are:

* The source root, maintenance and tests, which use includes/Hook. Test
  hooks need to be autoloadable in a non-test request so that
  implementing test interfaces in a generic handler will not fail.
* resources uses includes/resourceloader/Hook
* The following third-level subdirectories had their hooks placed in
  the parent ../Hook:
    * includes/filerepo/file
    * includes/search/searchwidgets
    * includes/specials/forms
    * includes/specials/helpers
    * includes/specials/pagers

Parameters marked as legacy references in hooks.txt are passed
by value in the interfaces.

Bug: T240307
Change-Id: I6efe2e7dd1f0c6a3d0f4d100a4c34e41f8428720
2020-04-20 13:31:05 +10:00
jenkins-bot
260403b83a Merge "Add findBadBlobs script." 2020-04-17 13:32:17 +00:00
daniel
071ce36abd Add findBadBlobs script.
This script scans for content blobs that can't be loaded due to
database corruption, and can change their entry in the content table
to an address starting with "bad:". Such addresses cause the content
to be read as empty, with no log entry. This is useful to avoid
errors and log spam due to known bad revisions.

The script is designed to scan a limited number of revisions from a
given start date. The assumption is that database corruption is
generally caused by an intermedia bug or system failure which will
affect many revisions over a short period of time.

Bug: T205936
Change-Id: I6f513133e90701bee89d63efa618afc3f91c2d2b
2020-04-17 15:04:59 +02:00
suecarmol
632fa50065 Optimize email sending on password reset
Improve performance of sending emails when a user resets a password.

Bug: T247017
Change-Id: I9edb0e4c8845f7a9082035de66f5965c3f9b762d
2020-04-16 13:59:08 -05:00
C. Scott Ananian
37dc40c5df Remove ParserDiffTest
This class was last used in ~2008 as @tstarling was developing the
original wikitext Parser.  It has since code-rotted and wouldn't work
as a drop in for the Parser class any more anyway.  We'll probably
(re)invent something similar when we eventually switch Message
rendering from the legacy parser to Parsoid, but this existing code
isn't a good starting point for that; we'll need to tackle T236812
(splitting Parser into a base class) first.

Last meaningful change to ParserDiffTest:
350b498b9f

Code search:
https://codesearch.wmflabs.org/search/?q=ParserDiffTest&i=nope&files=&repos=

Bug: T236811
Change-Id: I98f1ef8ad296791a810bd8b10343f8640fd23c5e
2020-04-16 14:40:05 -04:00
Niklas Laxström
cdfd1e1891 language: Remove maintenance/language/languages.inc
Nothing uses this file or its classes anymore
according to MediaWiki code search.

Change-Id: Ie165ff887b43304ea519d8b7c0a99a2187a9137e
2020-04-16 16:45:34 +00:00
Niklas Laxström
3af1ef9c0e language: Remove maintenance/language/checkLanguage.php
Translation checks are done in translatewiki.net these days.

Change-Id: I9c9b962a3accc50e875a53cec6ef458e4bb2a6a5
2020-04-15 17:17:07 +00:00
Niklas Laxström
93e06ca81b language: Remove maintenance/language/checkExtensions.php
Broken:
ArgumentCountError from line 43 of /home/developer/mediawiki/workdir/
extensions/Translate/ffs/MediaWikiExtensions.php: Too few arguments to
function PremadeMediawikiExtensionGroups::__construct(), 0 passed in
/home/developer/mediawiki/workdir/maintenance/language/checkLanguage.inc
on line 609 and exactly 2 expected

No point fixing this, checks are done on translatewiki.net side.

Change-Id: I9f39684c2ef8479ea35ad1d60e3f1f86d88a8067
2020-04-15 17:14:35 +00:00
Aaron Schulz
3c7f29a6b9 Add small HtmlCacheUpdater service class to normalize purging code (2)
This is a re-submit of 35da1bbd7c, which was accidentally merged before
CR (and reverted with aa4da3c2e8).

The purge() method handles purging of both file cache and CDN, using
a PRESEND deferred update. This avoids code duplication and missing
file cache purge calls.

Also:
* Migrate HTMLCacheUpdate callers to just directly using HTMLCacheUpdateJob
* Add HtmlFileCacheUpdate class and defer such updates just like with CDN
* Simplify HTMLCacheUpdate constructor parameters
* Remove BacklinkCache::clear() calls which do nothing since the backlink
  query does not actually happen until the job runs

Bug: T230025
Change-Id: Ic1005e70e2c22d5bd1ca36dcdb618108ebe290f3
2020-04-14 03:19:07 +00:00
C. Scott Ananian
0a53c9725a Refactor magic word implementations out of Parser.php
This allows them to be more easily reused by other Parser implementations
(ie, Parsoid), and helps keep Parser.php compact.

Bug: T236813
Change-Id: I68fb1e786374e445b7df047934c532d7e10b8e94
2020-04-10 14:43:40 -04:00
Tim Starling
3c59969f9e Revert "maintenance: Remove sql.php temporarily"
I confirmed that the LoadExtensionSchemaUpdates hook no longer runs
after the parent patch to fix T249584 is merged, in either sql.php or
patchSql.php.

Note that sql.php is not just a "debugging script", it's intended for
use in production, and was used in production, hence T249565.

Bug: T249565
Bug: T157651
Change-Id: Ia4d99e00e6455eec9cf0fa486ec5e4b83c9cf25d
2020-04-09 00:46:49 +00:00
Timo Tijhof
b5f95da54b maintenance: Remove sql.php temporarily
It's dangerously broken.

This is supposed to be a read-only ad-hoc debugging script but in actually
triggers 'LoadExtensionSchemaUpdates', which is effectively update.php, but
without any of the safe guards, and at a time where you least expect write
queries to happen, let alone administrative queries that drop tables and
run other schema migrations.

Bug: T157651
Change-Id: I8d18a7f5b1731333aa40a9d04dafdb7176cf1d52
2020-04-07 00:04:37 +00:00
Sam Wilson
83804ade46 Purge expired watchlist items
Add two methods to remove expired watchlist items:
1. A job that's triggered on about 10% of page edits; and
2. A new maintenance script.

Bug: T244804
Change-Id: Ica8ab92837c38fa4d484726c94d5181c08387e28
2020-03-26 07:54:20 +08:00
Aaron Schulz
97fa6ff265 Move Xml* classes under /xml
Change-Id: I012648c9a860611a7cd809119073803e82429fc3
2020-03-19 19:23:47 -07:00
jenkins-bot
303d97c5da Merge "resourceloader: Merge 'user.tokens' module into 'user.options'" 2020-03-18 04:07:21 +00:00
Timo Tijhof
e1c88d2fcb resourceloader: Merge 'user.tokens' module into 'user.options'
For back-compat, keep 'user.tokens' as deprecated alias to 'user.options'
for one release cycle (to be removed in MW 1.36).

== user.options ==

As before, 'user.options' arrives immediately on every page view,
embedded in the HTML. It has an async dependency on 'user.defaults',
which is not downloaded until there is a known demand on
'user.options'. Once that arrives, the implementation closure
of 'user.options' will execute, and the module becomes 'ready'.

== user.options "empty" ==

Before this change, UserOptionsModule used isKnownEmpty to consider the
module "empty" for logged-out users (as well as for logged-in users that
haven't yet set any preferences).

This was a mistake. It is invalid in ResourceLoader to mark a module as
"empty" if that module has dependencies (see also T191596 and c3f200849).

This broke the state machine. The impact was minimal given that it is unlikely
for features to read keys from mw.user.options for logged-out users, which
if attempted would have simply returned null for all keys.

== New HTML ==

The user.options module is always embedded (never empty), and always
has a dependency on user.defaults.

== Cached HTML ==

The cached HTML for anons sets user.options's state to ready without
waiting for any dependency. Per the above, this was already causing
subtle bugs with mw.user.options.get() likely returning null for anons,
which was fairly innocent. For tokens a bottom value of null would be
problematic as the default for tokens must be "+\" instead. To make
sure that is available for cached page views, set this directly
in mediawiki.base.js. The cached HTML does contain an implement call for
'user.tokens' that contains the same defaults, but new code will not
be asking for or waiting for user.tokens, so that is unused.

Bug: T235457
Change-Id: I51e01d6fa604578cd2906337bde5a4760633c027
2020-03-17 20:51:15 -07:00
Peter Ovchyn
176531d8c7 Introduce Emailer as service
In order to test functionality dependant on sending emails
Emailer should be introduced as service

Bug: T247229
Change-Id: I4fcceb7860a9a4dda091fb4cffcd2f6950fffaf8
2020-03-17 21:41:34 +02:00
Roan Kattouw
ca46126e98 resourceloader: Support single-file component .vue files
Allows .vue files to be used in package modules as if they were .js
files: they can be added to the 'packageFiles' array in module
definitions, and require()d from JS files.

In the load.php output, each .vue file is transformed to a function that
contains the JS from the <script> tag, then a line that sets
module.exports.template to the contents of the <template> tag (encoded
as a string). The contents of the <style> tag are added to the module's
styles.

Internally, the type of a .vue file is inferred as 'script-vue', and the
file is parsed with VueComponentParser, which extracts the three parts.
After the transformation, the file's type is set to 'script+style', and
files of this type contribute to both getScript() and getStyles().

This change also adds caching to getPackageFiles(), because it now needs
to be called twice (in getScript() and getStyles()).

Change-Id: Ic0a5c771901450a518eb7d24456053956507e1ed
2020-03-12 14:32:41 -07:00