Compare commits
5 Commits
d9b07d6729
...
8178e87f87
| Author | SHA1 | Date | |
|---|---|---|---|
| 8178e87f87 | |||
| 0b01013411 | |||
| d52034712d | |||
| e41a508d77 | |||
| 441b27d92b |
@@ -1,661 +1,28 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published
|
||||
by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program 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 Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 ORGANISATION KA INTERNATIONALE (OKI) & contributeurs JWE
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
Note : les photographies affichées par l'application restent la propriété de
|
||||
leurs auteurs respectifs et sont distribuées sous leurs licences Wikimedia
|
||||
Commons (voir content/credits.md). Les extraits d'articles Wikipédia sont
|
||||
sous licence CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/deed.fr).
|
||||
|
||||
@@ -1,24 +1,10 @@
|
||||
# JWE
|
||||
|
||||
> **JWE v2 â refonte GeoGuessr souverain** : jeu de gĂ©olocalisation (photo unique â placer la commune sur une carte MapLibre) centrĂ© sur la Guadeloupe, la Martinique, la Guyane et La RĂ©union, avec une phase Ă©ducative Wikipedia/Wikidata aprĂšs chaque manche.
|
||||
>
|
||||
> - **Application** : [`app/`](app/) â SvelteKit 2 + Svelte 5 + MapLibre GL JS, PWA, bilingue français/crĂ©ole, licence MIT.
|
||||
> - **Documentation** : [`docs/architecture.md`](docs/architecture.md) (décisions), [`docs/deploiement.md`](docs/deploiement.md) (auto-hébergement), [`docs/contribution.md`](docs/contribution.md) (ajouter un lieu).
|
||||
> - **Démarrage rapide** : `cd app && npm ci && npm run dev` (Node ℠20 ; la version historique PHP ci-dessous reste fonctionnelle telle quelle).
|
||||
|
||||
---
|
||||
|
||||
## Version historique (PHP)
|
||||
|
||||
<p align="center">
|
||||
Ce projet cartographique est une application Web simple qui vous permet de tester vos connaissances des communes ou des pays proposés à l'aide de cartes interactives.
|
||||
JWE est un jeu de gĂ©olocalisation souverain, dans l'esprit de GeoGuessr, centrĂ© sur 4 rĂ©gions : <strong>Guadeloupe, Martinique, Guyane, La RĂ©union</strong>. Le joueur voit une photo unique d'un lieu et place un marqueur sur une carte pour deviner la commune â puis dĂ©couvre une fiche Ă©ducative WikipĂ©dia/Wikidata⊠ou un appel Ă contribution quand le lieu n'y est pas documentĂ© (<em>Pwen blindĂ©</em>).
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
Il ne nécessite qu'un serveur Web local pour fonctionner, tel que Nginx, Apache, ou un serveur PHP intégré.
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://liberapay.com/OKI/donate/">
|
||||
<img src="https://img.shields.io/liberapay/receives/OKI.svg?logo=liberapay">
|
||||
<img src="https://img.shields.io/liberapay/patrons/OKI.svg?logo=liberapay">
|
||||
@@ -26,55 +12,39 @@ Il ne nécessite qu'un serveur Web local pour fonctionner, tel que Nginx, Apache
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://codeberg.org/OKI/jwe/raw/commit/166b356d21e4b3271afd3be111eae57e6bee7a95/972.gif" />
|
||||
</p>
|
||||
|
||||
- **Souverain** : zéro Google, zéro Mapbox. MapLibre + tiles libres, Wikipédia/Wikidata, auto-hébergeable sur un petit VPS.
|
||||
- **Ăthique** : pas de comptes, pas de leaderboard, pas de mĂ©canique dopaminergique.
|
||||
- **Bilingue** : français / créole.
|
||||
- **Stack** : Svelte 5 + SvelteKit 2, MapLibre GL JS, Node â„ 20, licence MIT.
|
||||
|
||||
## Utilisation
|
||||
|
||||
1. **Clonage du dépÎt**
|
||||
|
||||
Clonez ce dépÎt sur votre ordinateur en utilisant la commande suivante :
|
||||
|
||||
```bash
|
||||
git clone https://codeberg.org/OKI/jwe.git
|
||||
```
|
||||
|
||||
2. **Configuration du Serveur Web Local**
|
||||
|
||||
Placez le répertoire cloné dans le répertoire racine de votre serveur Web local. Vous pouvez également exécuter la commande suivante depuis le répertoire du projet :
|
||||
|
||||
```bash
|
||||
php -S 127.0.0.1:8000
|
||||
git clone https://labola.o-k-i.net/ORGANISATION-KA-INTERNATIONALE/JWE.git
|
||||
cd JWE/app
|
||||
npm ci
|
||||
npm run dev # développement
|
||||
npm run build && node build # production (adapter-node)
|
||||
```
|
||||
|
||||
3. **AccĂšs Ă l'Application**
|
||||
## Documentation
|
||||
|
||||
Accédez à l'application via votre navigateur Web en utilisant l'adresse `http://127.0.0.1:8000`.
|
||||
- [`docs/architecture.md`](docs/architecture.md) â dĂ©cisions d'architecture (ADR).
|
||||
- [`docs/deploiement.md`](docs/deploiement.md) â auto-hĂ©bergement (SvelteKit + tileserver-gl).
|
||||
- [`docs/contribution.md`](docs/contribution.md) â ajouter un lieu et lier sa fiche Wikidata.
|
||||
- [`docs/audit-oki.md`](docs/audit-oki.md) â audit qualitĂ© et doctrine OKI.
|
||||
- [`prompts/`](prompts/) â prompts de mission et d'audit ayant produit cette refonte.
|
||||
|
||||
## Contributions
|
||||
|
||||
Les contributions sont les bienvenues ! Si vous souhaitez contribuer à ce projet, n'hésitez pas à soumettre des pull requests.
|
||||
Les contributions sont les bienvenues ! Ajouter un lieu se fait par pull request (voir [`docs/contribution.md`](docs/contribution.md)).
|
||||
|
||||
## License
|
||||
## Historique
|
||||
|
||||
Copyright (C) 2024 Cédric Famibelle-Pronzola & ORGANISATION KA INTERNATIONALE (OKI)
|
||||
La version 1 (PHP, cartes des communes) a été remplacée par cette refonte en juillet 2026 ; elle reste disponible dans l'historique Git (`git log` avant le commit de refonte).
|
||||
|
||||
## Licence
|
||||
|
||||
### FR
|
||||
Copyright (C) 2024-2026 Cédric Famibelle-Pronzola & ORGANISATION KA INTERNATIONALE (OKI)
|
||||
|
||||
Ce programme est un logiciel libre : vous pouvez le redistribuer et/ou le modifier selon les termes de la licence publique générale GNU Affero publiée par la Free Software Foundation, soit la version 3 de la licence, soit (à votre choix) toute version ultérieure.
|
||||
|
||||
Ce programme est distribuĂ© dans l'espoir qu'il sera utile, mais SANS AUCUNE GARANTIE ; sans mĂȘme la garantie implicite de COMMERCIALISATION ou d'ADAPTATION Ă UN USAGE PARTICULIER. Voir la licence publique gĂ©nĂ©rale GNU Affero pour plus de dĂ©tails.
|
||||
|
||||
Vous devriez avoir reçu une copie de la licence publique générale GNU Affero avec ce programme. Si ce n'est pas le cas, consultez https://www.gnu.org/licenses/.
|
||||
|
||||
|
||||
### EN
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||
|
||||
This program 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 Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.
|
||||
Code sous licence **MIT** (voir [LICENSE](LICENSE)). Les photographies restent la propriété de leurs auteurs sous leurs licences Wikimedia Commons (voir [`content/credits.md`](content/credits.md)) ; les extraits Wikipédia sont sous CC BY-SA 4.0.
|
||||
|
||||
Generated
+607
-1
@@ -8,18 +8,30 @@
|
||||
"name": "jwe",
|
||||
"version": "2.0.0",
|
||||
"dependencies": {
|
||||
"maplibre-gl": "^5.1.0"
|
||||
"maplibre-gl": "^5.1.0",
|
||||
"sharp": "^0.35.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/adapter-node": "^5.2.0",
|
||||
"@sveltejs/kit": "^2.16.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
"@types/node": "^26.1.1",
|
||||
"svelte": "^5.0.0",
|
||||
"svelte-check": "^4.1.0",
|
||||
"typescript": "^5.6.0",
|
||||
"vite": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emnapi/runtime": {
|
||||
"version": "1.11.2",
|
||||
"resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.2.tgz",
|
||||
"integrity": "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@esbuild/aix-ppc64": {
|
||||
"version": "0.25.12",
|
||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
|
||||
@@ -462,6 +474,506 @@
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/colour": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz",
|
||||
"integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-darwin-arm64": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.3.tgz",
|
||||
"integrity": "sha512-RMnFX7YQsMoh7lWfcM4NEHHymBX/rLuKNPVM84XE9ONPcaSCDgE7CHIHpSgPcO2xcRthgBy1HfNO319mwhIAkg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-darwin-arm64": "1.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-darwin-x64": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.3.tgz",
|
||||
"integrity": "sha512-Xo+5uFBtLN0BKqieTxiFzFPQAUlBbbH5iBKyRX/z1JrbnYsHTfKJnUfL8+p2TPXr1pXqao4eeL4Rl144uDpK9w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-darwin-x64": "1.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-freebsd-wasm32": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.3.tgz",
|
||||
"integrity": "sha512-lUxcqWIj2wMQ9BrwNjngcr1gWUr5xgaGThBRqPPalIC2n67Cqj1uPh8NnA/ZhAg8hUbKl+kVHKwgUIwe6ZYPrg==",
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"freebsd"
|
||||
],
|
||||
"dependencies": {
|
||||
"@img/sharp-wasm32": "0.35.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-darwin-arm64": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.2.tgz",
|
||||
"integrity": "sha512-9J6ypZFpQBj4YnePGoq/S38w6nz+vqg5WZLrLGY4YuSemdMq47GMLBPO42MzwdGwpg/agZ7xzZcFHa48xlywfg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-darwin-x64": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.2.tgz",
|
||||
"integrity": "sha512-m2pW1n6cns9VaubNwsZ+c3CRYjxNQWgJ5gPlnL1nbBcpkBvFm6SCFN5o0psFHI8w9n11NKhFkeEDns98tiqbEw==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linux-arm": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.2.tgz",
|
||||
"integrity": "sha512-1eMLzy92I4J6rmi4mAT8yC3HxOtniyGELlzGbNMLLeqe052ahFQ0h6LFq+lh5DsDIdYViIDst08abvSbcEdLXQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linux-arm64": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.2.tgz",
|
||||
"integrity": "sha512-dqVSFynCox4C/J8kT16V7SIFAns0IjgLwkvYT7p8LQVmJ5OS5b6tI9IGflxTeuBS//zXeFIUbwt5dwxyZ17cnA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linux-ppc64": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.2.tgz",
|
||||
"integrity": "sha512-3z0NHDxD6n5I9gc05U1eW1AyRm+Gznzq3naMrthPNqE6oYykcogW0l/jfpJdjYnuNl8R7yI9pNbE1XiUeyq0Aw==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linux-riscv64": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.2.tgz",
|
||||
"integrity": "sha512-bsb4rI+NldGOsXuej2r8OdSS8+zXDVaCWxyWrcv6kneTOlgAHtZABRzBBCwdsPiD90J4myNJuHpg6kA20ImW/w==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linux-s390x": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.2.tgz",
|
||||
"integrity": "sha512-/ABshyj8gCpyIrNXnHn4LorDJ0HHm1VhXPBlxZ8zAtfVPAaSafXPGn+sUSIRiwaSBy0mmFjSjiXI5mkcwdChKQ==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linux-x64": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.2.tgz",
|
||||
"integrity": "sha512-ITPEtgffGJ0S6G9dRyw/366tJQqFRcHWPHhC+Stpg3Z8AEMrDrTr2lhdz4f/Y/HMbRh//7Z5mBzEpVdi62Oc3w==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linuxmusl-arm64": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.2.tgz",
|
||||
"integrity": "sha512-zE9EdiUzUmg5mDT5a1rk5fYJ6GWPloTwWBYDS14naqHsL+EaMpDj1AWnpLgh3u0YCORv2Tt50wrcrpYqkP97Kw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-libvips-linuxmusl-x64": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.2.tgz",
|
||||
"integrity": "sha512-m0lrLiUt+lBYnCFr8qV/65yMR4E/c7/wf78I5eKTdkEakFAlZ9QlzEM3QIhhAwVeUhLAHLcCq7a7Vszq/oFNZQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linux-arm": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.3.tgz",
|
||||
"integrity": "sha512-affVWCTLooy8TSxbDx2qkzuDeaWLNVBA+P//FNBirHsXpP2fuBhk5AuboYUnrDnzoXes8GFjpTx0SBFOCRg+FA==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linux-arm": "1.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linux-arm64": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.3.tgz",
|
||||
"integrity": "sha512-QgKDspHPnrU+GQ55XPhGwyhC8acLVOOSyAvo1oVfFmrIXLkDNmGWzAfDZ4xK8oSA1qBQrALcHX0G5UZni/SuFQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linux-arm64": "1.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linux-ppc64": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.3.tgz",
|
||||
"integrity": "sha512-sMd8rDxmpLOwv/7N44klFjOD5DUO7FLdjiXDI0hoxYaf7Ar262dQIEkosE98bps+5HPLtp/EvNqeqQtOycP/IA==",
|
||||
"cpu": [
|
||||
"ppc64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linux-ppc64": "1.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linux-riscv64": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.3.tgz",
|
||||
"integrity": "sha512-0Eob78yjlYPfL5vMNWAW55l3R9Y6BQS/gOfe0ZcP9mEz9ohhKSt4im1hayiknXgf8AWrFqMvJcKIdmLmEe7yeQ==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linux-riscv64": "1.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linux-s390x": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.3.tgz",
|
||||
"integrity": "sha512-KgAxQ0DxpNOq1rG2t5cgTgShJFGSuU7XO45cqC+1NVOuZnP6tlgZRuSYOfNupGkHID0o3cJOsw4DVeJpMovcGw==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linux-s390x": "1.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linux-x64": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.3.tgz",
|
||||
"integrity": "sha512-8pqvxubL2PGdhlPy6GLqzDYMUjyRmKAwKHYKixpdJYBUK7PJ0C029XdsnpFIdgRZG68fZiGdHVWcKPvtiPB4cA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linux-x64": "1.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linuxmusl-arm64": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.3.tgz",
|
||||
"integrity": "sha512-Vz0iQjzzcSX3HCbfwFfCSG/9SCIqyO0mH2sXyiHaAYfBk0cRsCWXRyQYX0ovCK/PAQBbTzQ0dsPQHh5MAFL59w==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linuxmusl-arm64": "1.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-linuxmusl-x64": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.3.tgz",
|
||||
"integrity": "sha512-6O1NPKcDVj9QEdg7Hx549EX8U0rp6yXQERqru6yRN7fGBn32UvIRJUlWnk+8xDCiG76hXVBbX82NZ/ZKr0euIg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"linux"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-libvips-linuxmusl-x64": "1.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-wasm32": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.3.tgz",
|
||||
"integrity": "sha512-cZ0XkcYGpHZkqW6iCkqTcmUC0CD9DhD5d/qeZlZkfRBn6GnHniZXLUo5+9xw8Iv76YE6LQFN9YNBlKREcCG76w==",
|
||||
"license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@emnapi/runtime": "^1.11.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-webcontainers-wasm32": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.3.tgz",
|
||||
"integrity": "sha512-2rnq7bX3NzeR2T4YWgz8qiG4h3TSdMe+vN1iQXpJleSJ3SM5zQ8Fy2SyyXAWlbxpEZ2Y+Z4u1BePgJEYbSy80Q==",
|
||||
"cpu": [
|
||||
"wasm32"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@img/sharp-wasm32": "0.35.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-win32-arm64": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.3.tgz",
|
||||
"integrity": "sha512-4bPwFdMbeC4JQ8L8LOyWp6nsHcboP5fxkp6iPOXz2Vg49R42TuMs2whkJ5OAP4/Ul035qOzy0AecOF9VOscn4w==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
"license": "Apache-2.0 AND LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-win32-ia32": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.3.tgz",
|
||||
"integrity": "sha512-r53mXsBN6lFUDiST764SvgwUdHAqM4rPAiDzAmf4fLoB6X/rkfyTrLCg6+g17wJJiCmB3JYgHuUldCWUIRFSXw==",
|
||||
"cpu": [
|
||||
"ia32"
|
||||
],
|
||||
"license": "Apache-2.0 AND LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": "^20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@img/sharp-win32-x64": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.3.tgz",
|
||||
"integrity": "sha512-D4y1vNeZrIIJCN+uHaWVtH86B+aCrdMYYjicy9pXHvbGZeGYLLSd3wdVuC37FxVXlU1ARsk84eKWfWMXGYEqvA==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
"license": "Apache-2.0 AND LGPL-3.0-or-later",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"win32"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
}
|
||||
},
|
||||
"node_modules/@jridgewell/gen-mapping": {
|
||||
"version": "0.3.13",
|
||||
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
|
||||
@@ -1246,6 +1758,16 @@
|
||||
"integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "26.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz",
|
||||
"integrity": "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~8.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/resolve": {
|
||||
"version": "1.20.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz",
|
||||
@@ -1364,6 +1886,15 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/detect-libc": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
|
||||
"integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/devalue": {
|
||||
"version": "5.8.1",
|
||||
"resolved": "https://registry.npmjs.org/devalue/-/devalue-5.8.1.tgz",
|
||||
@@ -1879,6 +2410,18 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.8.5",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
|
||||
"integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
|
||||
"license": "ISC",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/set-cookie-parser": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-3.1.2.tgz",
|
||||
@@ -1886,6 +2429,55 @@
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/sharp": {
|
||||
"version": "0.35.3",
|
||||
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.3.tgz",
|
||||
"integrity": "sha512-ej0zVHuZGHCiABXcNxeYhpRnPNPAcvbG8RMdBAhDAxLKkCRVSpK3Iyu7qbqw3JMzoj0REeM6f3tJLtVwl0023Q==",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@img/colour": "^1.1.0",
|
||||
"detect-libc": "^2.1.2",
|
||||
"semver": "^7.8.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20.9.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://opencollective.com/libvips"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@img/sharp-darwin-arm64": "0.35.3",
|
||||
"@img/sharp-darwin-x64": "0.35.3",
|
||||
"@img/sharp-freebsd-wasm32": "0.35.3",
|
||||
"@img/sharp-libvips-darwin-arm64": "1.3.2",
|
||||
"@img/sharp-libvips-darwin-x64": "1.3.2",
|
||||
"@img/sharp-libvips-linux-arm": "1.3.2",
|
||||
"@img/sharp-libvips-linux-arm64": "1.3.2",
|
||||
"@img/sharp-libvips-linux-ppc64": "1.3.2",
|
||||
"@img/sharp-libvips-linux-riscv64": "1.3.2",
|
||||
"@img/sharp-libvips-linux-s390x": "1.3.2",
|
||||
"@img/sharp-libvips-linux-x64": "1.3.2",
|
||||
"@img/sharp-libvips-linuxmusl-arm64": "1.3.2",
|
||||
"@img/sharp-libvips-linuxmusl-x64": "1.3.2",
|
||||
"@img/sharp-linux-arm": "0.35.3",
|
||||
"@img/sharp-linux-arm64": "0.35.3",
|
||||
"@img/sharp-linux-ppc64": "0.35.3",
|
||||
"@img/sharp-linux-riscv64": "0.35.3",
|
||||
"@img/sharp-linux-s390x": "0.35.3",
|
||||
"@img/sharp-linux-x64": "0.35.3",
|
||||
"@img/sharp-linuxmusl-arm64": "0.35.3",
|
||||
"@img/sharp-linuxmusl-x64": "0.35.3",
|
||||
"@img/sharp-webcontainers-wasm32": "0.35.3",
|
||||
"@img/sharp-win32-arm64": "0.35.3",
|
||||
"@img/sharp-win32-ia32": "0.35.3",
|
||||
"@img/sharp-win32-x64": "0.35.3"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/node": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/sirv": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/sirv/-/sirv-3.0.2.tgz",
|
||||
@@ -2020,6 +2612,13 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
||||
"license": "0BSD",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.9.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||
@@ -2034,6 +2633,13 @@
|
||||
"node": ">=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz",
|
||||
"integrity": "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "6.4.3",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz",
|
||||
|
||||
+3
-1
@@ -14,12 +14,14 @@
|
||||
"@sveltejs/adapter-node": "^5.2.0",
|
||||
"@sveltejs/kit": "^2.16.0",
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
||||
"@types/node": "^26.1.1",
|
||||
"svelte": "^5.0.0",
|
||||
"svelte-check": "^4.1.0",
|
||||
"typescript": "^5.6.0",
|
||||
"vite": "^6.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"maplibre-gl": "^5.1.0"
|
||||
"maplibre-gl": "^5.1.0",
|
||||
"sharp": "^0.35.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Validation du corpus JWE (audit OKI : C1, C2, C3, C4c).
|
||||
* « Fetch, pas recall » : chaque QID, coordonnée et URL photo est vérifié
|
||||
* par une requĂȘte rĂ©elle aux API Wikidata / fr.wikipedia / Wikimedia Commons.
|
||||
*
|
||||
* Usage : node scripts/validate-lieux.mjs [--photos]
|
||||
* --photos vĂ©rifie aussi les 40 URLs photo (HTTP 200 + licence) â lent.
|
||||
* Exit code 1 si au moins un FAIL.
|
||||
*/
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { dirname, join } from 'node:path';
|
||||
|
||||
const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
|
||||
const LIEUX = JSON.parse(readFileSync(join(ROOT, 'src/lib/server/data/lieux.json'), 'utf8'));
|
||||
const UA = { 'User-Agent': 'JWE-OKI/2.0 (validation corpus; contact: o-k-i.net)' };
|
||||
const WITH_PHOTOS = process.argv.includes('--photos');
|
||||
|
||||
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
||||
const getJSON = async (url) => {
|
||||
const res = await fetch(url, { headers: UA });
|
||||
if (!res.ok) throw new Error(`HTTP ${res.status} sur ${url}`);
|
||||
return res.json();
|
||||
};
|
||||
|
||||
let fails = 0;
|
||||
const fail = (id, msg) => {
|
||||
fails++;
|
||||
console.log(`FAIL ${id} â ${msg}`);
|
||||
};
|
||||
|
||||
// --- Schéma (tous les lieux) ------------------------------------------------
|
||||
const CHAMPS = ['id', 'nom', 'nom_creole', 'region', 'commune', 'coordonnees', 'categorie', 'difficulte', 'wikidata_id', 'photo', 'indices'];
|
||||
const REGIONS = ['GUADELOUPE', 'MARTINIQUE', 'GUYANE', 'REUNION'];
|
||||
const ids = new Set();
|
||||
for (const l of LIEUX) {
|
||||
for (const c of CHAMPS) if (!(c in l)) fail(l.nom, `champ manquant: ${c}`);
|
||||
if (ids.has(l.id)) fail(l.nom, `id dupliqué ${l.id}`);
|
||||
ids.add(l.id);
|
||||
if (!REGIONS.includes(l.region)) fail(l.nom, `région invalide: ${l.region}`);
|
||||
if (!['MONUMENT', 'LIEU'].includes(l.categorie)) fail(l.nom, `catégorie invalide`);
|
||||
if (!['FACILE', 'MOYEN', 'DIFFICILE', 'EXPERT'].includes(l.difficulte)) fail(l.nom, `difficulté invalide`);
|
||||
if (l.aire_commune_km2 !== undefined && !(l.aire_commune_km2 > 0)) fail(l.nom, `aire_commune_km2 invalide`);
|
||||
}
|
||||
console.log(`Schéma : ${LIEUX.length} lieux contrÎlés.`);
|
||||
|
||||
// --- C1 + C3 : QIDs et coordonnées (un appel batch) --------------------------
|
||||
const avecQid = LIEUX.filter((l) => l.wikidata_id);
|
||||
const qids = avecQid.map((l) => l.wikidata_id).join('|');
|
||||
const data = await getJSON(
|
||||
`https://www.wikidata.org/w/api.php?action=wbgetentities&ids=${qids}&props=sitelinks|labels|claims&languages=fr&format=json&sitefilter=frwiki`
|
||||
);
|
||||
const dist = (a, b) => {
|
||||
const R = 6371, dLa = ((b.lat - a.lat) * Math.PI) / 180, dLo = ((b.lon - a.lon) * Math.PI) / 180;
|
||||
const h = Math.sin(dLa / 2) ** 2 + Math.cos((a.lat * Math.PI) / 180) * Math.cos((b.lat * Math.PI) / 180) * Math.sin(dLo / 2) ** 2;
|
||||
return 2 * R * Math.asin(Math.sqrt(h));
|
||||
};
|
||||
console.log('\n| Lieu | QID | sitelink frwiki | écart coords | PASS/FAIL |');
|
||||
console.log('|---|---|---|---|---|');
|
||||
for (const l of avecQid) {
|
||||
const e = data.entities[l.wikidata_id];
|
||||
const site = e?.sitelinks?.frwiki?.title;
|
||||
const p625 = e?.claims?.P625?.[0]?.mainsnak?.datavalue?.value;
|
||||
let ok = true;
|
||||
const notes = [];
|
||||
if (!e || e.missing !== undefined) {
|
||||
ok = false;
|
||||
notes.push('entité absente');
|
||||
} else if (!site) {
|
||||
ok = false;
|
||||
notes.push('pas de sitelink frwiki');
|
||||
}
|
||||
if (p625) {
|
||||
const d = dist(l.coordonnees, { lat: p625.latitude, lon: p625.longitude });
|
||||
if (d > 0.5) {
|
||||
ok = false;
|
||||
notes.push(`écart ${d.toFixed(2)} km > 500 m`);
|
||||
}
|
||||
} else notes.push('P625 absent (non bloquant)');
|
||||
if (!ok) fails++;
|
||||
console.log(`| ${l.nom} | ${l.wikidata_id} | ${site ?? 'â'} | ${notes.join('; ') || '< 500 m'} | ${ok ? 'PASS' : 'FAIL'} |`);
|
||||
await sleep(100);
|
||||
}
|
||||
|
||||
// --- C2 : les null sont de vrais null ---------------------------------------
|
||||
console.log('\nLieux Ă wikidata_id null (preuve absence frwiki) :');
|
||||
for (const l of LIEUX.filter((x) => !x.wikidata_id)) {
|
||||
const s = await getJSON(
|
||||
`https://fr.wikipedia.org/w/api.php?action=query&list=search&srsearch=${encodeURIComponent('"' + l.nom + '"')}&srlimit=3&format=json`
|
||||
);
|
||||
const exact = s.query.search.some(
|
||||
(r) => r.title.toLowerCase() === l.nom.toLowerCase()
|
||||
);
|
||||
if (exact) fail(l.nom, `un article frwiki « ${l.nom} » EXISTE â le null ne teste pas le Cas B`);
|
||||
else console.log(`PASS ${l.nom} â aucun article frwiki exact`);
|
||||
await sleep(400);
|
||||
}
|
||||
|
||||
// --- C4c : photos (optionnel, lent) ------------------------------------------
|
||||
if (WITH_PHOTOS) {
|
||||
console.log('\nPhotos (HTTP + licence) :');
|
||||
for (const l of LIEUX) {
|
||||
try {
|
||||
const res = await fetch(l.photo.url, { method: 'HEAD', headers: UA, redirect: 'follow' });
|
||||
if (!res.ok) fail(l.nom, `photo HTTP ${res.status}`);
|
||||
else console.log(`PASS photo ${l.nom}`);
|
||||
} catch (e) {
|
||||
fail(l.nom, `photo inaccessible: ${e.message}`);
|
||||
}
|
||||
await sleep(300);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(fails ? `\n${fails} FAIL` : '\nTout est conforme.');
|
||||
process.exit(fails ? 1 : 0);
|
||||
@@ -7,10 +7,26 @@
|
||||
}
|
||||
|
||||
let { photo, revealed = false }: Props = $props();
|
||||
|
||||
// Proxy /api/photo : 3 largeurs disponibles, le navigateur choisit (C4).
|
||||
const srcset = $derived(
|
||||
photo.srcset
|
||||
? Object.entries(photo.srcset)
|
||||
.map(([w, u]) => `${u} ${w}w`)
|
||||
.join(', ')
|
||||
: undefined
|
||||
);
|
||||
</script>
|
||||
|
||||
<figure class="photo-panel">
|
||||
<img src={photo.url} alt={photo.alt} loading="lazy" decoding="async" />
|
||||
<img
|
||||
src={photo.url}
|
||||
{srcset}
|
||||
sizes="(min-width: 768px) 50vw, 100vw"
|
||||
alt={photo.alt}
|
||||
loading="lazy"
|
||||
decoding="async"
|
||||
/>
|
||||
{#if revealed}
|
||||
<figcaption>{photo.credit}</figcaption>
|
||||
{/if}
|
||||
|
||||
@@ -22,6 +22,9 @@
|
||||
</p>
|
||||
{#if result.distanceKm !== null}
|
||||
<p class="distance">{t().resultat.distance} : {result.distanceKm} {t().resultat.km}</p>
|
||||
{#if result.radiusEffKm !== null}
|
||||
<p class="rayon">{t().resultat.rayonScore} : {result.radiusEffKm} {t().resultat.km}</p>
|
||||
{/if}
|
||||
{/if}
|
||||
<p class="lieu">
|
||||
<strong>{result.nom}</strong>
|
||||
@@ -91,6 +94,12 @@
|
||||
color: var(--oki-encre-doux);
|
||||
}
|
||||
|
||||
.rayon {
|
||||
margin: 0.1rem 0 0;
|
||||
font-size: 0.82rem;
|
||||
color: var(--oki-encre-doux);
|
||||
}
|
||||
|
||||
.credit-photo {
|
||||
margin: 0;
|
||||
font-size: 0.72rem;
|
||||
|
||||
@@ -12,8 +12,11 @@
|
||||
|
||||
let { nom, wikidataId, tonPositif, tonNeutre }: Props = $props();
|
||||
|
||||
// undefined = chargement, null = pas de fiche (Cas B), WikiSummary = Cas A
|
||||
// undefined = chargement, null = pas de fiche, WikiSummary = Cas A
|
||||
let wiki = $state<WikiSummary | null | undefined>(undefined);
|
||||
// Cas intermédiaire (audit A3) : QID présent, fiche Wikidata existante,
|
||||
// mais pas d'article Wikipédia en français (404 {reason:'no-frwiki'}).
|
||||
let sansFrwiki = $state(false);
|
||||
|
||||
onMount(() => {
|
||||
if (!wikidataId) {
|
||||
@@ -25,7 +28,19 @@
|
||||
try {
|
||||
const res = await fetch(`/api/wiki/${wikidataId}`);
|
||||
if (annule) return;
|
||||
wiki = res.ok ? ((await res.json()) as WikiSummary) : null;
|
||||
if (res.ok) {
|
||||
wiki = (await res.json()) as WikiSummary;
|
||||
} else {
|
||||
if (res.status === 404) {
|
||||
try {
|
||||
const corps = (await res.json()) as { reason?: string };
|
||||
sansFrwiki = corps.reason === 'no-frwiki';
|
||||
} catch {
|
||||
sansFrwiki = false;
|
||||
}
|
||||
}
|
||||
wiki = null;
|
||||
}
|
||||
} catch {
|
||||
if (!annule) wiki = null;
|
||||
}
|
||||
@@ -38,6 +53,7 @@
|
||||
const lienContribution = $derived(
|
||||
`https://fr.wikipedia.org/w/index.php?search=${encodeURIComponent(nom)}&title=Sp%C3%A9cial:Recherche`
|
||||
);
|
||||
const lienWikidata = $derived(`https://www.wikidata.org/wiki/${wikidataId}`);
|
||||
</script>
|
||||
|
||||
{#if wiki === undefined}
|
||||
@@ -61,6 +77,20 @@
|
||||
{t().resultat.lireWiki} â
|
||||
</a>
|
||||
</article>
|
||||
{:else if sansFrwiki}
|
||||
<!-- Variante Cas B : fiche Wikidata OK mais pas d'article FR â appel Ă traduire/crĂ©er -->
|
||||
<article class="panneau cas-b">
|
||||
<h2><span class="icone" aria-hidden="true">â</span> {t().lacuneFr.titre}</h2>
|
||||
<p class="texte">{t().lacuneFr.texte}</p>
|
||||
<div class="ctas">
|
||||
<a class="btn btn-cta" href={lienContribution} target="_blank" rel="noopener noreferrer">
|
||||
{t().lacuneFr.cta} â
|
||||
</a>
|
||||
<a class="lien-wikidata" href={lienWikidata} target="_blank" rel="noopener noreferrer">
|
||||
{t().lacuneFr.ctaWikidata} â
|
||||
</a>
|
||||
</div>
|
||||
</article>
|
||||
{:else}
|
||||
<!-- Cas B : lacune documentaire â panneau volontairement distinct (Peak-End) -->
|
||||
<article class="panneau cas-b">
|
||||
@@ -169,6 +199,18 @@
|
||||
background: #b98a2f;
|
||||
}
|
||||
|
||||
.ctas {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 0.9rem;
|
||||
}
|
||||
|
||||
.lien-wikidata {
|
||||
color: var(--oki-bleu);
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.guide {
|
||||
margin: 0.8rem 0 0;
|
||||
font-size: 0.88rem;
|
||||
|
||||
@@ -57,6 +57,7 @@ const fr = {
|
||||
trouve: 'Tu as trouvé ! Apprends-en plus sur ce lieu.',
|
||||
aDecouvrir: 'Le lieu était ici. Apprends-en plus sur lui.',
|
||||
lireWiki: 'Lire la suite sur Wikipédia',
|
||||
rayonScore: 'Rayon de notation',
|
||||
commune: 'Commune',
|
||||
region: 'Région',
|
||||
suivant: 'Lieu suivant',
|
||||
@@ -72,6 +73,13 @@ const fr = {
|
||||
guide: 'Besoin dâaide pour dĂ©marrer ? Suis le guide OKI « Comment contribuer Ă WikipĂ©dia ».',
|
||||
guideLien: 'Ouvrir le guide de contribution'
|
||||
},
|
||||
lacuneFr: {
|
||||
titre: 'Pas encore dâarticle en français',
|
||||
texte:
|
||||
'La fiche Wikidata de ce lieu existe, mais personne nâa encore Ă©crit lâarticle WikipĂ©dia en français. Tu peux le traduire ou le crĂ©er : chaque article compte pour que nos territoires existent dans lâencyclopĂ©die francophone.',
|
||||
cta: 'Traduire ou crĂ©er lâarticle',
|
||||
ctaWikidata: 'Voir la fiche Wikidata'
|
||||
},
|
||||
defi: {
|
||||
bilan: 'Bilan du défi',
|
||||
scoreTotal: 'Score total',
|
||||
|
||||
@@ -59,6 +59,7 @@ const gcf: Dict = {
|
||||
trouve: 'Ou trouvé ! Aprann pli plis asou koté sa-a.',
|
||||
aDecouvrir: 'KotĂ©-la tĂ© la. Aprann pli plis asouây.',
|
||||
lireWiki: 'Li swit-la asou Wikipédia',
|
||||
rayonScore: 'Réyon pou pwen yo',
|
||||
commune: 'Komin',
|
||||
region: 'Péyi',
|
||||
suivant: 'Koté swivan',
|
||||
@@ -74,6 +75,13 @@ const gcf: Dict = {
|
||||
guide: 'Ou bizwen Úd pou koumansé ? Swiv gid OKI « Kijan pou kontribyé sou Wikipédia ».',
|
||||
guideLien: 'Ouvri gid kontribisyon-an'
|
||||
},
|
||||
lacuneFr: {
|
||||
titre: 'Pwen blindĂ© â Pa nyen an fransĂ©',
|
||||
texte:
|
||||
'Fich Wikidata kotĂ© sa-a Ă©gzistĂ©, mĂ© pĂ©sonn pĂČkĂČ Ă©kri atik WikipĂ©dia-la an fransĂ©. Ou sa tradwiây oben rĂ©yĂ©ây : chak atik ka kontĂ© pou tĂ©ritwa nou Ă©gzistĂ© adan ansiklopedi fransĂ©-a.',
|
||||
cta: 'Tradwi oben réyé atik-la',
|
||||
ctaWikidata: 'WĂš fich Wikidata-la'
|
||||
},
|
||||
defi: {
|
||||
bilan: 'Bilan défi-a',
|
||||
scoreTotal: 'Total pwen',
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Il domine la rade de la préfecture guadeloupéenne."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 4.5
|
||||
},
|
||||
{
|
||||
"id": "0f54332a-f418-4f5d-85d8-71eadcf09825",
|
||||
@@ -55,7 +56,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Dédié à la mémoire de la traite et de l'esclavage, ce bùtiment ajouré fait face à la darse."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 2.8
|
||||
},
|
||||
{
|
||||
"id": "04c50efe-0010-4239-a897-feabfa90b732",
|
||||
@@ -84,7 +86,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Il couronne la colline du Chameau, au-dessus de la baie d'un archipel de deux ßles habitées."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 5.8
|
||||
},
|
||||
{
|
||||
"id": "de7fbfcf-8250-46e9-a791-e9c51e4b3159",
|
||||
@@ -113,7 +116,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Sa façade se dresse sur une place de la vieille ville, à deux pas d'un grand fort."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 4.5
|
||||
},
|
||||
{
|
||||
"id": "49584138-21f3-4462-8988-037e1b146371",
|
||||
@@ -142,7 +146,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Café et cacao y sont cultivés dans la vallée de la Grande RiviÚre à Goyaves."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 60
|
||||
},
|
||||
{
|
||||
"id": "34941298-689f-4610-b24b-9ee902158feb",
|
||||
@@ -171,7 +176,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "C'est aussi le plus haut sommet de toutes les Petites Antilles (1 467 m)."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 34.6
|
||||
},
|
||||
{
|
||||
"id": "306e4abb-3c04-4f48-a085-8561ac16287b",
|
||||
@@ -200,7 +206,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Une grande croix veille sur ce promontoire face à La Désirade."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 61.2
|
||||
},
|
||||
{
|
||||
"id": "3b097d01-ffe4-40b1-80eb-f912a966a437",
|
||||
@@ -229,7 +236,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Ancienne propriété d'un célÚbre humoriste français, au nord de l'ßle de Basse-Terre."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 31.6
|
||||
},
|
||||
{
|
||||
"id": "ff00fd1d-6f55-485a-963d-c22f44740cab",
|
||||
@@ -258,7 +266,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Son lagon peu profond et sa mangrove longent l'une des stations balnéaires de la Grande-Terre."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 38.8
|
||||
},
|
||||
{
|
||||
"id": "f9f4ff8a-d2a3-4262-b769-b5ff0a2116f6",
|
||||
@@ -287,7 +296,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Il fait face à la darse de la ville la plus peuplée de Guadeloupe."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 2.8
|
||||
},
|
||||
{
|
||||
"id": "3e24d8ae-8524-4351-821c-01da7765c8ac",
|
||||
@@ -316,7 +326,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Elle garde l'une des plus belles rades du monde, celle de la préfecture martiniquaise."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 44
|
||||
},
|
||||
{
|
||||
"id": "629f0f1a-93c3-4a37-8ee0-5228cb21562b",
|
||||
@@ -345,7 +356,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Remonté piÚce par piÚce face au canal Levassor, il porte le nom d'un député abolitionniste."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 44
|
||||
},
|
||||
{
|
||||
"id": "3516a34a-0f8d-47a6-8320-4d84bd6dc007",
|
||||
@@ -374,7 +386,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Son clocher surplombe la savane de la préfecture martiniquaise."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 44
|
||||
},
|
||||
{
|
||||
"id": "1b82d341-0403-4b39-8915-e31bd9fffac3",
|
||||
@@ -403,7 +416,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "On y visite des chais de vieillissement et une case créole, dans la campagne du centre-sud atlantique."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 54.4
|
||||
},
|
||||
{
|
||||
"id": "07cb377a-61c3-4559-bd80-bd027ecb8ae3",
|
||||
@@ -432,7 +446,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Elle domine la route de la Trace, au nord de la préfecture."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 44
|
||||
},
|
||||
{
|
||||
"id": "aa1343d2-5e0f-4d25-9b78-7887a2a6004b",
|
||||
@@ -461,7 +476,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Son éruption de 1902 a anéanti une ville entiÚre en quelques minutes."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 96.8
|
||||
},
|
||||
{
|
||||
"id": "01d2a23c-3bd7-4bf0-ba17-46c9c2822fac",
|
||||
@@ -490,7 +506,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Les ruines d'un chĂąteau du XVIIe siĂšcle s'y cachent prĂšs de la mangrove."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 46
|
||||
},
|
||||
{
|
||||
"id": "c5c72ece-605f-4650-b8b3-f960c1f17b3f",
|
||||
@@ -519,7 +536,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Les tortues vertes y broutent les herbiers Ă quelques mĂštres du rivage."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 25.9
|
||||
},
|
||||
{
|
||||
"id": "cd652fb7-22e6-4d18-8126-05c7970ab913",
|
||||
@@ -548,21 +566,22 @@
|
||||
"niveau": 2,
|
||||
"texte": "Un ponton en bois s'avance dans l'eau, tout prĂšs d'une anse jumelle de sable clair."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 25.9
|
||||
},
|
||||
{
|
||||
"id": "a8d0b35b-ca15-4f7b-a5fb-24d9317b50f4",
|
||||
"nom": "Savane des Pétrifications",
|
||||
"nom": "Savane des pétrifications",
|
||||
"nom_creole": "Savane des Pétrifications",
|
||||
"region": "MARTINIQUE",
|
||||
"commune": "Sainte-Anne",
|
||||
"coordonnees": {
|
||||
"lat": 14.4001,
|
||||
"lon": -60.8594
|
||||
"lat": 14.4011,
|
||||
"lon": -60.8576
|
||||
},
|
||||
"categorie": "LIEU",
|
||||
"difficulte": "EXPERT",
|
||||
"wikidata_id": null,
|
||||
"wikidata_id": "Q3474455",
|
||||
"photo": {
|
||||
"url": "https://commons.wikimedia.org/wiki/Special:FilePath/Martinique_savane_des_p%C3%A9trifications_1.jpg?width=1200",
|
||||
"credit": "© Esam335 / Wikimedia Commons CC-BY-SA-4.0",
|
||||
@@ -577,7 +596,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Des troncs d'arbres fossilisés y gisent, non loin d'une célÚbre plage de sable blanc."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 38.8
|
||||
},
|
||||
{
|
||||
"id": "d393c70e-67f7-42f3-81dd-19c82678ea06",
|
||||
@@ -606,7 +626,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Les fusées Ariane décollent ici, à l'ouest d'une ville de l'espace guyanaise."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 2289.2
|
||||
},
|
||||
{
|
||||
"id": "87c42ae9-be05-419c-94ad-667019b9ce3e",
|
||||
@@ -635,7 +656,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Leur bagne a reçu des milliers de forçats, dont le capitaine Dreyfus."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 2289.2
|
||||
},
|
||||
{
|
||||
"id": "cacb8839-5b2f-470f-9a25-260b725219ac",
|
||||
@@ -664,7 +686,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Elle domine la place aux palmiers de la préfecture guyanaise."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 25.5
|
||||
},
|
||||
{
|
||||
"id": "d8e67769-17d3-4b79-b0a8-06cda633ce41",
|
||||
@@ -693,7 +716,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Du belvédÚre, la vue embrasse l'estuaire et la place aux palmiers royaux."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 25.5
|
||||
},
|
||||
{
|
||||
"id": "304debbc-d594-443a-80ab-b9521139643d",
|
||||
@@ -722,7 +746,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Il borde le fleuve qui sépare cette région du Suriname."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 4320.8
|
||||
},
|
||||
{
|
||||
"id": "ca578a74-5a74-4929-834b-630ce5598d2b",
|
||||
@@ -751,7 +776,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Territoire du caĂŻman noir, accessible par la piste de Kaw."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 3686
|
||||
},
|
||||
{
|
||||
"id": "be45de8b-b8ec-4779-bf9c-6900c503f92a",
|
||||
@@ -780,7 +806,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Bordée de palmiers royaux, elle est voisine du fort qui surplombe la ville."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 25.5
|
||||
},
|
||||
{
|
||||
"id": "44a2c26d-8b03-47cd-b15e-47215bb9de54",
|
||||
@@ -809,7 +836,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Elle coule prÚs d'un village fondé par des réfugiés hmong, célÚbre pour son marché du dimanche."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 3686
|
||||
},
|
||||
{
|
||||
"id": "5e0e2e86-7959-4d98-aa16-58a9442b44c9",
|
||||
@@ -838,7 +866,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Tortues marines et vestiges du fort Diamant, prĂšs de l'embouchure du Mahury."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 46.3
|
||||
},
|
||||
{
|
||||
"id": "8699cee2-1c3e-455d-8982-7a698ad2a096",
|
||||
@@ -867,7 +896,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Ses singes écureuils, habitués aux visiteurs, viennent à la rencontre des pirogues."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 25.5
|
||||
},
|
||||
{
|
||||
"id": "4be8dda7-60f2-419a-96e7-2ecb91b60530",
|
||||
@@ -896,7 +926,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "En 1977, la lave s'est fendue en deux devant son portail, sur la cĂŽte est de l'Ăźle."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 178.5
|
||||
},
|
||||
{
|
||||
"id": "593809f9-9cdb-47ae-b8fa-537c6acacc91",
|
||||
@@ -925,7 +956,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "On y trouve la tombe d'un poÚte parnassien et, dit-on, celle d'un célÚbre pirate."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 241.6
|
||||
},
|
||||
{
|
||||
"id": "5c0d83a2-f88a-411d-873b-41dfae6cf15d",
|
||||
@@ -954,7 +986,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Elle se visite au bout d'une route aux centaines de virages, dans un cirque du nord-est."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 104.4
|
||||
},
|
||||
{
|
||||
"id": "db387f9b-35df-4608-a4b3-b17969e64830",
|
||||
@@ -983,7 +1016,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Ancienne sucrerie des hauts de la plaine Nord, prĂšs de la riviĂšre des Roches."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 58.1
|
||||
},
|
||||
{
|
||||
"id": "f2d5d226-6367-4283-bb5c-29025aa6f6e8",
|
||||
@@ -1012,7 +1046,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Reconstruit en 1991, il s'élÚve prÚs de la riviÚre du Mùt, dans l'est de l'ßle."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 54.7
|
||||
},
|
||||
{
|
||||
"id": "8d7dfa8e-33cb-4bae-968f-89f8dc152538",
|
||||
@@ -1041,7 +1076,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Pour l'approcher, on traverse une plaine de lave qui évoque la Lune."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 155.5
|
||||
},
|
||||
{
|
||||
"id": "8498224a-2c4c-499e-800c-ced386c0fcaa",
|
||||
@@ -1070,7 +1106,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Un gĂźte de montagne accueille les randonneurs Ă quelques centaines de mĂštres du sommet."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 104.4
|
||||
},
|
||||
{
|
||||
"id": "61ddb841-2386-4815-8ece-5d5394e06eef",
|
||||
@@ -1099,7 +1136,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Ses Ăźlets s'appellent La Nouvelle, Marla ou Roche Plate."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 119.4
|
||||
},
|
||||
{
|
||||
"id": "170ba206-22d8-47f7-9fd9-1a8c4a4709a3",
|
||||
@@ -1128,7 +1166,8 @@
|
||||
"niveau": 2,
|
||||
"texte": "Fruits, épices et artisanat sur le front de mer de la commune la plus peuplée de l'ßle."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 241.6
|
||||
},
|
||||
{
|
||||
"id": "669c6ffc-6602-42f1-8d95-1fe7572d5538",
|
||||
@@ -1157,6 +1196,37 @@
|
||||
"niveau": 2,
|
||||
"texte": "On y descend par un sentier en lacets, non loin de la plus grande ville du sud."
|
||||
}
|
||||
]
|
||||
],
|
||||
"aire_commune_km2": 178.7
|
||||
},
|
||||
{
|
||||
"id": "a8045e99-3fe7-4910-b6aa-75792e349724",
|
||||
"nom": "Anse Grosse Roche",
|
||||
"nom_creole": "Ans Gwos WĂČch",
|
||||
"region": "MARTINIQUE",
|
||||
"commune": "Le Marin",
|
||||
"coordonnees": {
|
||||
"lat": 14.480419,
|
||||
"lon": -60.810417
|
||||
},
|
||||
"categorie": "LIEU",
|
||||
"difficulte": "EXPERT",
|
||||
"wikidata_id": null,
|
||||
"photo": {
|
||||
"url": "https://commons.wikimedia.org/wiki/Special:FilePath/Anse%20Grosse%20Roche%2C%20le%20Marin.jpg?width=1200",
|
||||
"credit": "© Sapakagadewmoinjadiw / Wikimedia Commons CC-BY-SA-4.0",
|
||||
"alt": "Panorama de l'anse Grosse Roche, plage sauvage du Marin face Ă l'Atlantique"
|
||||
},
|
||||
"indices": [
|
||||
{
|
||||
"niveau": 1,
|
||||
"texte": "Une anse sauvage du sud de cette Ăźle, accessible uniquement Ă pied."
|
||||
},
|
||||
{
|
||||
"niveau": 2,
|
||||
"texte": "Un rocher en forme de cĆur y attire les randonneurs, entre deux caps du sud Atlantique."
|
||||
}
|
||||
],
|
||||
"aire_commune_km2": 31.8
|
||||
}
|
||||
]
|
||||
|
||||
@@ -74,7 +74,14 @@ export function getRandomLieu(options: {
|
||||
return pool[Math.floor(Math.random() * pool.length)];
|
||||
}
|
||||
|
||||
/** Anti-triche : ne garde que les champs publiques pour /api/round. */
|
||||
/** Largeurs (px) servies par le proxy photo /api/photo/[id]?w=. */
|
||||
export const PHOTO_LARGEURS = [400, 800, 1200] as const;
|
||||
|
||||
/**
|
||||
* Anti-triche : ne garde que les champs publiques pour /api/round.
|
||||
* L'URL photo passe par le proxy serveur (/api/photo/<uuid>) : l'URL Wikimedia
|
||||
* Commons d'origine contient le nom du fichier, qui révÚle souvent le lieu (C4).
|
||||
*/
|
||||
export function sanitizeRound(lieu: Lieu): RoundPlace {
|
||||
return {
|
||||
id: lieu.id,
|
||||
@@ -82,15 +89,41 @@ export function sanitizeRound(lieu: Lieu): RoundPlace {
|
||||
nom_creole: lieu.nom_creole,
|
||||
categorie: lieu.categorie,
|
||||
difficulte: lieu.difficulte,
|
||||
photo: lieu.photo,
|
||||
photo: {
|
||||
url: `/api/photo/${lieu.id}`,
|
||||
srcset: {
|
||||
'400': `/api/photo/${lieu.id}?w=400`,
|
||||
'800': `/api/photo/${lieu.id}?w=800`,
|
||||
'1200': `/api/photo/${lieu.id}?w=1200`
|
||||
},
|
||||
credit: lieu.photo.credit,
|
||||
alt: lieu.photo.alt
|
||||
},
|
||||
indices: lieu.indices
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Rayon effectif (km) de la courbe de score (audit A1).
|
||||
* Les communes guyanaises sont immenses (Saint-Laurent-du-Maroni â 4 321 kmÂČ) :
|
||||
* avec le seul rayon de difficulté, un guess à quelques dizaines de km y est
|
||||
* injustement quasi nul. Quand `aire_commune_km2` est renseigné, le rayon est
|
||||
* au moins celui du disque de mĂȘme aire que la commune : sqrt(aire / Ï).
|
||||
* Champ optionnel : sans lui, on retombe sur le rayon de difficulté.
|
||||
*/
|
||||
export function rayonEffectifKm(lieu: Lieu): number {
|
||||
const base = RAYONS[lieu.difficulte];
|
||||
const aire = lieu.aire_commune_km2;
|
||||
if (typeof aire === 'number' && Number.isFinite(aire) && aire > 0) {
|
||||
return Math.max(base, Math.sqrt(aire / Math.PI));
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scoring recalculé cÎté serveur :
|
||||
* score = round(5000 Ă e^(âd/r)), r selon difficultĂ© ;
|
||||
* pĂ©nalitĂ© â10 % par indice ; bonus temps †+20 % ; total plafonnĂ© Ă 5000.
|
||||
* score = round(5000 Ă e^(âd/r_eff)) ; pĂ©nalitĂ© â10 % par indice ;
|
||||
* bonus temps †+20 % ; total plafonné à 5000.
|
||||
*/
|
||||
export function scoreGuess(
|
||||
lieu: Lieu,
|
||||
@@ -99,7 +132,8 @@ export function scoreGuess(
|
||||
timeMs?: number
|
||||
): GuessResult {
|
||||
const distanceKm = haversineKm(guess, lieu.coordonnees);
|
||||
const base = Math.round(MAX_POINTS * Math.exp(-distanceKm / RAYONS[lieu.difficulte]));
|
||||
const radiusEff = rayonEffectifKm(lieu);
|
||||
const base = Math.round(MAX_POINTS * Math.exp(-distanceKm / radiusEff));
|
||||
const penalises = base * Math.max(0, 1 - 0.1 * Math.max(0, hintsUsed));
|
||||
let total = penalises;
|
||||
if (typeof timeMs === 'number' && Number.isFinite(timeMs) && timeMs >= 0) {
|
||||
@@ -109,6 +143,7 @@ export function scoreGuess(
|
||||
return {
|
||||
distanceKm: Math.round(distanceKm * 10) / 10,
|
||||
score,
|
||||
radiusEffKm: Math.round(radiusEff * 10) / 10,
|
||||
coordonnees: lieu.coordonnees,
|
||||
commune: lieu.commune,
|
||||
region: lieu.region,
|
||||
@@ -123,6 +158,7 @@ export function skipResult(lieu: Lieu): GuessResult {
|
||||
return {
|
||||
distanceKm: null,
|
||||
score: 0,
|
||||
radiusEffKm: null,
|
||||
coordonnees: lieu.coordonnees,
|
||||
commune: lieu.commune,
|
||||
region: lieu.region,
|
||||
@@ -132,10 +168,14 @@ export function skipResult(lieu: Lieu): GuessResult {
|
||||
};
|
||||
}
|
||||
|
||||
/** Catalogue Explorer : coords arrondies à 0.05° (mode sans score, fiches autorisées). */
|
||||
/**
|
||||
* Catalogue Explorer : coords arrondies à 0.05° (mode sans score, fiches autorisées).
|
||||
* L'`id` (uuid) n'est volontairement PAS exposé : il permettrait de corréler
|
||||
* l'id d'un round avec la commune du lieu (fuite de réponse, audit C4).
|
||||
* L'Explorer n'a pas besoin d'ids stables (le front utilise l'indice du tableau).
|
||||
*/
|
||||
export function catalogueExplorer(): ExplorerLieu[] {
|
||||
return lieux.map((l) => ({
|
||||
id: l.id,
|
||||
nom: l.nom,
|
||||
nom_creole: l.nom_creole,
|
||||
region: l.region,
|
||||
|
||||
+18
-2
@@ -16,6 +16,11 @@ export interface Photo {
|
||||
url: string;
|
||||
credit: string;
|
||||
alt: string;
|
||||
/**
|
||||
* URLs par largeur (px) pour `srcset`. Présent uniquement dans /api/round :
|
||||
* pointe vers le proxy /api/photo/[id]?w=⊠(l'URL Commons d'origine n'est jamais exposée).
|
||||
*/
|
||||
srcset?: Record<'400' | '800' | '1200', string>;
|
||||
}
|
||||
|
||||
/** Lieu complet â serveur uniquement, jamais exposĂ© tel quel au client. */
|
||||
@@ -31,6 +36,12 @@ export interface Lieu {
|
||||
wikidata_id: string | null;
|
||||
photo: Photo;
|
||||
indices: Indice[];
|
||||
/**
|
||||
* Superficie de la commune (kmÂČ) â champ optionnel du schĂ©ma.
|
||||
* Sert à élargir le rayon de score pour les communes immenses (ex. Guyane) ;
|
||||
* le scoring doit tolérer son absence (fallback = rayon de difficulté seul).
|
||||
*/
|
||||
aire_commune_km2?: number;
|
||||
}
|
||||
|
||||
/** Lieu SANITISà envoyé par GET /api/round (aucune coordonnée, commune, région, wikidata_id). */
|
||||
@@ -48,6 +59,8 @@ export interface RoundPlace {
|
||||
export interface GuessResult {
|
||||
distanceKm: number | null;
|
||||
score: number;
|
||||
/** Rayon effectif utilisĂ© par la courbe de score (km, arrondi Ă 0,1) â null si « Passer ». */
|
||||
radiusEffKm: number | null;
|
||||
coordonnees: Coordonnees;
|
||||
commune: string;
|
||||
region: Region;
|
||||
@@ -56,9 +69,12 @@ export interface GuessResult {
|
||||
wikidata_id: string | null;
|
||||
}
|
||||
|
||||
/** Entrée du catalogue Explorer : coords arrondies à 0.05°, mode sans score. */
|
||||
/**
|
||||
* Entrée du catalogue Explorer : coords arrondies à 0.05°, mode sans score.
|
||||
* Pas d'`id` : exposer l'uuid du lieu permettrait de corréler l'id d'un round
|
||||
* (/api/round) avec la commune/rĂ©gion â fuite de rĂ©ponse (audit C4).
|
||||
*/
|
||||
export interface ExplorerLieu {
|
||||
id: string;
|
||||
nom: string;
|
||||
nom_creole: string;
|
||||
region: Region;
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
import sharp from 'sharp';
|
||||
import { getLieuById, PHOTO_LARGEURS } from '$lib/server/lieux';
|
||||
import type { RequestHandler } from './$types';
|
||||
|
||||
const USER_AGENT = 'JWE-OKI/2.0 (https://labola.o-k-i.net/ORGANISATION-KA-INTERNATIONALE/JWE; contact OKI)';
|
||||
const TTL_MS = 24 * 60 * 60 * 1000; // 24 h
|
||||
|
||||
type Largeur = (typeof PHOTO_LARGEURS)[number];
|
||||
const LARGEUR_DEFAUT: Largeur = 1200;
|
||||
|
||||
/** Cache mémoire : clé `${id}:${w}`, TTL 24 h. */
|
||||
const cache = new Map<string, { expires: number; data: Buffer }>();
|
||||
/** DĂ©duplication des fetches en vol (mĂȘme photo demandĂ©e en rafale). */
|
||||
const enVol = new Map<string, Promise<Buffer | null>>();
|
||||
|
||||
/**
|
||||
* RécupÚre la photo via l'URL Commons stockée dans le corpus (jamais d'URL
|
||||
* fournie par le client â pas de proxy ouvert), puis la retraite avec sharp :
|
||||
* - rotate() : applique l'orientation EXIF avant suppression des métadonnées ;
|
||||
* - métadonnées : sharp ne conserve AUCUNE métadonnée (EXIF/GPS compris) sauf
|
||||
* appel explicite Ă withMetadata() â le WebP produit est donc propre ;
|
||||
* - conversion WebP + redimensionnement à la largeur demandée.
|
||||
*/
|
||||
async function chargerPhoto(id: string, w: Largeur): Promise<Buffer | null> {
|
||||
const lieu = getLieuById(id);
|
||||
if (!lieu) return null;
|
||||
const res = await fetch(lieu.photo.url, { headers: { 'User-Agent': USER_AGENT } });
|
||||
if (!res.ok) throw new Error(`commons ${res.status}`);
|
||||
const brut = Buffer.from(await res.arrayBuffer());
|
||||
return sharp(brut)
|
||||
.rotate()
|
||||
.resize({ width: w, withoutEnlargement: true })
|
||||
.webp({ quality: 82 })
|
||||
.toBuffer();
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /api/photo/[id]?w=400|800|1200 â image/webp.
|
||||
* `id` = uuid du lieu (déjà exposé par /api/round). 404 si lieu inconnu.
|
||||
* L'URL ainsi produite est opaque : elle ne révÚle ni le nom du fichier
|
||||
* Commons ni le lieu (audit C4).
|
||||
*/
|
||||
export const GET: RequestHandler = async ({ params, url }) => {
|
||||
const id = params.id;
|
||||
const wParam = url.searchParams.get('w');
|
||||
let w: Largeur = LARGEUR_DEFAUT;
|
||||
if (wParam !== null) {
|
||||
const n = Number(wParam);
|
||||
if (!(PHOTO_LARGEURS as readonly number[]).includes(n)) {
|
||||
return new Response('Largeur invalide (400, 800 ou 1200)', { status: 400 });
|
||||
}
|
||||
w = n as Largeur;
|
||||
}
|
||||
|
||||
const cle = `${id}:${w}`;
|
||||
const hit = cache.get(cle);
|
||||
if (hit && hit.expires > Date.now()) {
|
||||
return reponseWebp(hit.data);
|
||||
}
|
||||
|
||||
// 404 immédiat si l'id est inconnu (avant tout fetch amont).
|
||||
if (!getLieuById(id)) {
|
||||
return new Response('Lieu inconnu', { status: 404 });
|
||||
}
|
||||
|
||||
try {
|
||||
let promesse = enVol.get(cle);
|
||||
if (!promesse) {
|
||||
promesse = chargerPhoto(id, w).finally(() => enVol.delete(cle));
|
||||
enVol.set(cle, promesse);
|
||||
}
|
||||
const data = await promesse;
|
||||
if (!data) return new Response('Lieu inconnu', { status: 404 });
|
||||
cache.set(cle, { expires: Date.now() + TTL_MS, data });
|
||||
return reponseWebp(data);
|
||||
} catch {
|
||||
return new Response('Photo indisponible', { status: 502 });
|
||||
}
|
||||
};
|
||||
|
||||
function reponseWebp(data: Buffer): Response {
|
||||
return new Response(new Uint8Array(data), {
|
||||
headers: {
|
||||
'Content-Type': 'image/webp',
|
||||
'Cache-Control': 'public, max-age=86400, immutable'
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import type { RequestHandler } from './$types';
|
||||
|
||||
const USER_AGENT = 'JWE-OKI/2.0 (https://labola.o-k-i.net/ORGANISATION-KA-INTERNATIONALE/JWE; contact OKI)';
|
||||
const TTL_MS = 24 * 60 * 60 * 1000; // 24 h
|
||||
const CACHE_CONTROL = 'public, max-age=86400';
|
||||
|
||||
const cache = new Map<string, { expires: number; summary: WikiSummary }>();
|
||||
|
||||
@@ -23,7 +24,7 @@ interface RestSummary {
|
||||
thumbnail?: { source?: string };
|
||||
}
|
||||
|
||||
/** GET /api/wiki/[qid] â extrait WikipĂ©dia FR normalisĂ© (404 si pas de sitelink fr). */
|
||||
/** GET /api/wiki/[qid] â extrait WikipĂ©dia FR normalisĂ© (404 {reason:'no-frwiki'} si pas de sitelink fr). */
|
||||
export const GET: RequestHandler = async ({ params, fetch }) => {
|
||||
const qid = params.qid;
|
||||
if (!/^Q\d+$/.test(qid)) {
|
||||
@@ -32,26 +33,37 @@ export const GET: RequestHandler = async ({ params, fetch }) => {
|
||||
|
||||
const cached = cache.get(qid);
|
||||
if (cached && cached.expires > Date.now()) {
|
||||
return json(cached.summary, { headers: { 'Cache-Control': 'public, max-age=3600' } });
|
||||
return json(cached.summary, { headers: { 'Cache-Control': CACHE_CONTROL } });
|
||||
}
|
||||
|
||||
const headers = { 'User-Agent': USER_AGENT, Accept: 'application/json' };
|
||||
|
||||
// 1. Wikidata : sitelink frwiki (+ libellé fr en fallback)
|
||||
// Fallback de langue : fr UNIQUEMENT, volontairement sans repli sur en â
|
||||
// l'absence d'article français devient un appel à contribution (Cas B), pas
|
||||
// une redirection silencieuse vers Wikipédia en anglais.
|
||||
const wbUrl = `https://www.wikidata.org/w/api.php?action=wbgetentities&ids=${encodeURIComponent(qid)}&props=sitelinks%7Clabels&sitefilter=frwiki&languages=fr&format=json`;
|
||||
let entity: WbEntity | undefined;
|
||||
try {
|
||||
const res = await fetch(wbUrl, { headers });
|
||||
if (!res.ok) throw new Error(`wikidata ${res.status}`);
|
||||
entity = ((await res.json()) as WbResponse).entities?.[qid];
|
||||
// L'API rĂ©sout les redirections : l'entitĂ© peut ĂȘtre indexĂ©e par le QID cible.
|
||||
const entities = ((await res.json()) as WbResponse).entities ?? {};
|
||||
entity = entities[qid] ?? Object.values(entities)[0];
|
||||
} catch {
|
||||
return json({ erreur: 'Wikidata injoignable' }, { status: 502 });
|
||||
}
|
||||
|
||||
const titre = entity?.sitelinks?.frwiki?.title;
|
||||
if (!titre) {
|
||||
// Pas de page WikipĂ©dia FR â le front bascule sur l'Ă©cran « Pwen blindĂ© ».
|
||||
return json({ erreur: 'Pas de page Wikipédia en français' }, { status: 404 });
|
||||
// QID existant mais pas d'article frwiki (cas intermédiaire, audit A3) :
|
||||
// `reason: no-frwiki` permet au front d'afficher la variante « Pwen blindĂ© â
|
||||
// Pa nyen an fransé » (fiche Wikidata présente, article FR à traduire/créer),
|
||||
// distincte du Cas B « lacune totale » (wikidata_id null cÎté lieu).
|
||||
return json(
|
||||
{ reason: 'no-frwiki' },
|
||||
{ status: 404, headers: { 'Cache-Control': CACHE_CONTROL } }
|
||||
);
|
||||
}
|
||||
|
||||
// 2. Wikipédia FR : résumé de l'article
|
||||
@@ -77,5 +89,5 @@ export const GET: RequestHandler = async ({ params, fetch }) => {
|
||||
};
|
||||
cache.set(qid, { expires: Date.now() + TTL_MS, summary });
|
||||
|
||||
return json(summary, { headers: { 'Cache-Control': 'public, max-age=3600' } });
|
||||
return json(summary, { headers: { 'Cache-Control': CACHE_CONTROL } });
|
||||
};
|
||||
|
||||
@@ -18,7 +18,9 @@
|
||||
);
|
||||
const markers = $derived(
|
||||
lieuxFiltres.map((l) => ({
|
||||
id: l.id,
|
||||
// Id éphémÚre cÎté client (indice dans le catalogue) : /api/lieux n'expose
|
||||
// plus l'uuid du lieu, pour ne pas corréler un id de round avec sa commune (C4).
|
||||
id: String(lieux.indexOf(l)),
|
||||
lat: l.coordonnees.lat,
|
||||
lon: l.coordonnees.lon,
|
||||
label: `${l.nom} â ${l.commune}`
|
||||
@@ -26,7 +28,7 @@
|
||||
);
|
||||
|
||||
function ouvrir(id: string): void {
|
||||
selection = lieux.find((l) => l.id === id) ?? null;
|
||||
selection = lieux[Number(id)] ?? null;
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
@@ -103,7 +105,7 @@
|
||||
<p class="localisation">
|
||||
{t().resultat.commune} : {selection.commune} â {t().regions[selection.region]}
|
||||
</p>
|
||||
{#key selection.id}
|
||||
{#key selection.nom}
|
||||
<WikiFiche nom={selection.nom} wikidataId={selection.wikidata_id} />
|
||||
{/key}
|
||||
{:else}
|
||||
|
||||
@@ -31,7 +31,9 @@ sw.addEventListener('activate', (event) => {
|
||||
function isPhoto(url: URL): boolean {
|
||||
return (
|
||||
url.hostname === 'upload.wikimedia.org' ||
|
||||
(url.hostname === 'commons.wikimedia.org' && url.pathname.startsWith('/wiki/Special:FilePath'))
|
||||
(url.hostname === 'commons.wikimedia.org' && url.pathname.startsWith('/wiki/Special:FilePath')) ||
|
||||
// Proxy photo maison (mode jeu) â rĂ©ponses immutables, WebP sans mĂ©tadonnĂ©es
|
||||
(url.origin === sw.location.origin && url.pathname.startsWith('/api/photo/'))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -1,6 +1,6 @@
|
||||
# CrĂ©dits photos â JWE
|
||||
|
||||
Les 40 photos du corpus `app/src/lib/server/data/lieux.json` proviennent de Wikimedia Commons.
|
||||
Les 41 photos du corpus `app/src/lib/server/data/lieux.json` proviennent de Wikimedia Commons.
|
||||
Chaque fichier est sous licence libre (Creative Commons, CC0 ou domaine public) â vĂ©rifiĂ©e via l'API Commons
|
||||
(`LicenseShortName`) et l'URL `Special:FilePath` testée en HTTP 200.
|
||||
|
||||
@@ -25,7 +25,7 @@ Chaque fichier est sous licence libre (Creative Commons, CC0 ou domaine public)
|
||||
| 17 | Presqu'ßle de la Caravelle | MARTINIQUE | Anse non nommée à la pointe de la presqu'ßle de la Caravelle.jpg | Enrevseluj | CC-BY-SA-4.0 | https://commons.wikimedia.org/wiki/File:Anse_non_nomm%C3%A9e_%C3%A0_la_pointe_de_la_presqu'%C3%AEle_de_la_Caravelle.jpg |
|
||||
| 18 | Anse-Dufour | MARTINIQUE | Anse Dufour (Les Anses-d'Arlet, Martinique) - 01.jpg | ThérÚse Gaigé | CC0-1.0 | https://commons.wikimedia.org/wiki/File:Anse_Dufour_(Les_Anses-d'Arlet%2C_Martinique)_-_01.jpg |
|
||||
| 19 | Anse Noire | MARTINIQUE | Anse Noire (Les Anses-d'Arlet, Martinique) - 01.jpg | ThérÚse Gaigé | CC0-1.0 | https://commons.wikimedia.org/wiki/File:Anse_Noire_(Les_Anses-d'Arlet%2C_Martinique)_-_01.jpg |
|
||||
| 20 | Savane des Pétrifications | MARTINIQUE | Martinique savane des pétrifications 1.jpg | Esam335 | CC-BY-SA-4.0 | https://commons.wikimedia.org/wiki/File:Martinique_savane_des_p%C3%A9trifications_1.jpg |
|
||||
| 20 | Savane des pétrifications | MARTINIQUE | Martinique savane des pétrifications 1.jpg | Esam335 | CC-BY-SA-4.0 | https://commons.wikimedia.org/wiki/File:Martinique_savane_des_p%C3%A9trifications_1.jpg |
|
||||
| 21 | Centre spatial guyanais | GUYANE | Ariane 5ECA on its launch platform on its way to lauch pad ELA-3.jpg | elisabetta_monaco | CC-BY-2.0 | https://commons.wikimedia.org/wiki/File:Ariane_5ECA_on_its_launch_platform_on_its_way_to_lauch_pad_ELA-3.jpg |
|
||||
| 22 | Ăles du Salut | GUYANE | ILES et BAGNE 037.JPG | davric | Domaine public | https://commons.wikimedia.org/wiki/File:ILES_et_BAGNE_037.JPG |
|
||||
| 23 | Cathédrale Saint-Sauveur de Cayenne | GUYANE | Cathédrale Saint-Sauveur de Cayenne.jpg | Don-vip | CC-BY-SA-4.0 | https://commons.wikimedia.org/wiki/File:Cath%C3%A9drale_Saint-Sauveur_de_Cayenne.jpg |
|
||||
@@ -46,6 +46,7 @@ Chaque fichier est sous licence libre (Creative Commons, CC0 ou domaine public)
|
||||
| 38 | Cirque de Mafate | REUNION | 14-07-2011 Grand Bénare (26) Mafate (version améliorée).jpg | Mamphi | CC-BY-SA-3.0 | https://commons.wikimedia.org/wiki/File:14-07-2011_Grand_B%C3%A9nare_(26)_Mafate_(version_am%C3%A9lior%C3%A9e).jpg |
|
||||
| 39 | Marché forain de Saint-Paul | REUNION | Combava en vente sur le marché forain de Saint Paul (La Réunion).jpg | Marie-angele.joly | CC-BY-SA-4.0 | https://commons.wikimedia.org/wiki/File:Combava_en_vente_sur_le_march%C3%A9_forain_de_Saint_Paul_(La_R%C3%A9union).jpg |
|
||||
| 40 | Plage de Ti Sable | REUNION | La plage de Ti Sable à Saint-Joseph.jpg | Clémenceau Lauret | CC-BY-SA-4.0 | https://commons.wikimedia.org/wiki/File:La_plage_de_Ti_Sable_%C3%A0_Saint-Joseph.jpg |
|
||||
| 41 | Anse Grosse Roche | MARTINIQUE | Anse Grosse Roche, le Marin.jpg | Sapakagadewmoinjadiw | CC-BY-SA-4.0 | https://commons.wikimedia.org/wiki/File:Anse%20Grosse%20Roche%2C%20le%20Marin.jpg |
|
||||
|
||||
## Notes
|
||||
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 18px; /* Taille de base pour les grands écrans */
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 24px; /* Taille de base pour les titres sur les grands écrans */
|
||||
margin: 0.5em;
|
||||
}
|
||||
|
||||
ul {
|
||||
list-style-type: none;
|
||||
padding: 1em;
|
||||
}
|
||||
|
||||
li {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #1F51FF;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
/* RequĂȘtes mĂ©dia pour les Ă©crans de moins de 600px de large */
|
||||
@media (max-width: 600px) {
|
||||
body {
|
||||
font-size: 8vw; /* Augmente la taille de la police sur les petits écrans */
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 5.5vw; /* Augmente la taille de la police des titres sur les petits écrans */
|
||||
}
|
||||
|
||||
ul, li {
|
||||
padding: 3vw; /* Augmente le padding pour plus d'espace */
|
||||
}
|
||||
}
|
||||
-81
@@ -1,81 +0,0 @@
|
||||
#back-button {
|
||||
margin-left: 1em;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html, body, #map {
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
#chrono {
|
||||
font-weight: bold;
|
||||
margin-top: 1em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.game-button {
|
||||
background-color: #3498db;
|
||||
border: 2px solid #3498db;
|
||||
border-radius: 5px;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
font-size: 15px;
|
||||
margin-bottom: .3em;
|
||||
padding: 8px 15px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.game-button:hover {
|
||||
background-color: #2980b9;
|
||||
border-color: #2980b9;
|
||||
}
|
||||
|
||||
.game-button:disabled {
|
||||
background-color: #d8d8d8;
|
||||
border-color: #d8d8d8;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
#title,div {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#penalty {
|
||||
opacity: 1;
|
||||
transition: opacity 1s ease;
|
||||
}
|
||||
|
||||
.popup-ko .maplibregl-popup-content {
|
||||
background-color: rgba(255, 0, 0, 0.9);
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 0px 0px 2px rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.popup-ok .maplibregl-popup-content {
|
||||
background-color: rgba(0, 255, 34, 0.9);
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 0px 0px 2px rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.maplibregl-popup-tip {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
body {
|
||||
font-size: 100%;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 5.5vw;
|
||||
}
|
||||
|
||||
ul, li {
|
||||
padding: 3vw;
|
||||
}
|
||||
}
|
||||
+19
-10
@@ -29,11 +29,11 @@ Principe : **rien de stocké en base**, interroge l'API en temps réel avec cach
|
||||
|
||||
Endpoint serveur : `GET /api/wiki/[qid]` (ex. `Q3077840` = Fort DelgrĂšs â l'exemple `Q2216838` du prompt initial Ă©tait erronĂ©, corrigĂ© par l'Agent Contenu)
|
||||
|
||||
1. `wbgetentities` sur `www.wikidata.org` â rĂ©cupĂšre le `sitelink` frwiki (et le libellĂ© fr en fallback).
|
||||
1. `wbgetentities` sur `www.wikidata.org` â rĂ©cupĂšre le `sitelink` frwiki (et le libellĂ© fr en fallback). **Fallback de langue : fr uniquement** â dĂ©cision d'audit (A3) : pas de repli sur enwiki, on prĂ©fĂšre l'appel Ă contribution qu'une redirection silencieuse vers l'anglais.
|
||||
2. `GET https://fr.wikipedia.org/api/rest_v1/page/summary/{titre}` â `title`, `extract`, `content_urls`, `thumbnail`.
|
||||
3. Réponse normalisée : `{ qid, title, extract, url, thumbnail, description }`.
|
||||
4. Pas de sitelink fr ou erreur â `404` : le front bascule sur l'Ă©cran **Cas B « Pwen blindĂ© »**.
|
||||
5. **Cache** : `Map` en mémoire, TTL 24 h (+ `Cache-Control: max-age=3600`). User-Agent explicite (`JWE-OKI/x.y (contact)`) comme demandé par la politique Wikimédia.
|
||||
4. QID sans sitelink frwiki â `404 {"reason":"no-frwiki"}` (cas intermĂ©diaire, A3) : le front affiche la **variante Cas B « Pwen blindĂ© â Pa nyen an fransĂ© »** (la fiche Wikidata existe, l'article français reste Ă traduire/crĂ©er ; CTA recherche prĂ©-remplie + lien vers la fiche Wikidata). `wikidata_id` null cĂŽtĂ© lieu â Cas B « lacune totale » inchangĂ©.
|
||||
5. **Cache** : `Map` en mémoire, TTL 24 h + `Cache-Control: max-age=86400`. User-Agent explicite (`JWE-OKI/x.y (contact)`) comme demandé par la politique Wikimédia.
|
||||
|
||||
## 4. Arborescence du projet
|
||||
|
||||
@@ -56,8 +56,9 @@ JWE/ (dĂ©pĂŽt existant â l'ancien PHP est conservĂ© t
|
||||
â â â âââ explorer/ (mode Aprann : carte pleine page)
|
||||
â â â âââ api/
|
||||
â â â âââ round/+server.ts (GET : lieu alĂ©atoire SANITISĂ)
|
||||
â â â âââ photo/[id]/+server.ts (GET : proxy photo sharp â WebP, sans EXIF, cache 24 h)
|
||||
â â â âââ guess/+server.ts (POST : {placeId, lat, lon, hints, timeMs} â score + vĂ©ritĂ©)
|
||||
â â â âââ lieux/+server.ts (GET : catalogue sanitise pour Explorer)
|
||||
â â â âââ lieux/+server.ts (GET : catalogue sanitise pour Explorer, SANS id)
|
||||
â â â âââ wiki/[qid]/+server.ts (GET : extrait Wikipedia, cache 24 h)
|
||||
â â âââ app.html / app.d.ts
|
||||
â â âââ service-worker.ts (PWA)
|
||||
@@ -72,14 +73,15 @@ JWE/ (dĂ©pĂŽt existant â l'ancien PHP est conservĂ© t
|
||||
|
||||
| Endpoint | Méthode | Payload | Réponse |
|
||||
|---|---|---|---|
|
||||
| `/api/round?region=&mode=&exclude=` | GET | â | `{ id, nom, nom_creole, categorie, difficulte, photo{url,credit,alt}, indices[] }` â **jamais** `coordonnees`, `commune`, `region`, `wikidata_id` |
|
||||
| `/api/guess` | POST | `{ id, lat, lon, hintsUsed, timeMs? }` | `{ distanceKm, score, coordonnees, commune, region, nom, wikidata_id }` |
|
||||
| `/api/lieux` | GET | â | Catalogue sanitise (sans coordonnĂ©es prĂ©cises : coords arrondies Ă 0.05° pour l'affichage Explorer uniquement â mode sans score) |
|
||||
| `/api/wiki/[qid]` | GET | â | `{ title, extract, url, thumbnail }` ou `404` |
|
||||
| `/api/round?region=&mode=&exclude=` | GET | â | `{ id, nom, nom_creole, categorie, difficulte, photo{url,credit,alt,srcset}, indices[] }` â **jamais** `coordonnees`, `commune`, `region`, `wikidata_id`. `photo.url` = `/api/photo/<uuid>` (opaque, proxy serveur â C4) + `photo.srcset` `{ "400", "800", "1200" }` |
|
||||
| `/api/photo/[id]?w=` | GET | `w` â {400, 800, 1200} (dĂ©faut 1200) | `image/webp` retraitĂ©e (sharp : rotation auto, mĂ©tadonnĂ©es EXIF/GPS supprimĂ©es), `Cache-Control: public, max-age=86400, immutable`, cache mĂ©moire 24 h. 404 si id inconnu, 400 si `w` invalide. Fetch amont = URL Commons du corpus uniquement (pas de proxy ouvert) |
|
||||
| `/api/guess` | POST | `{ id, lat, lon, hintsUsed, timeMs? }` | `{ distanceKm, score, radiusEffKm, coordonnees, commune, region, nom, wikidata_id }` |
|
||||
| `/api/lieux` | GET | â | Catalogue sanitise pour Explorer (coords arrondies Ă 0.05°, mode sans score). **Sans `id`** (anti-corrĂ©lation round â commune, C4) ; photos en URLs Commons directes (mode sans enjeu) |
|
||||
| `/api/wiki/[qid]` | GET | â | `{ title, extract, url, thumbnail }`, `Cache-Control: max-age=86400` ; `404 {"reason":"no-frwiki"}` si QID sans article frwiki |
|
||||
|
||||
RĂšgles :
|
||||
|
||||
- Le scoring est **recalculĂ© cĂŽtĂ© serveur** : `score = round(5000 Ă e^(âd/r))`, `r` selon difficultĂ© du lieu (50/15/5/1 km), pĂ©nalitĂ© â10 %/indice, bonus temps †+20 % plafonnĂ© Ă 5000.
|
||||
- Le scoring est **recalculĂ© cĂŽtĂ© serveur** : `score = round(5000 Ă e^(âd/r_eff))` avec `r_eff = max(r_difficultĂ©, sqrt(aire_commune_km2 / Ï))` quand le champ optionnel `aire_commune_km2` est renseignĂ© (A1 â Ă©quitĂ© Guyane : communes immenses), sinon `r_difficultĂ©` seul (50/15/5/1 km). PĂ©nalitĂ© â10 %/indice, bonus temps †+20 % plafonnĂ© Ă 5000. `radiusEffKm` (0,1 km) est renvoyĂ© pour transparence.
|
||||
- Distance : haversine.
|
||||
- Le client ne reçoit la vérité (coordonnées, commune, wikidata_id) **qu'aprÚs** la soumission du marqueur.
|
||||
- `exclude` : liste d'ids dĂ©jĂ jouĂ©s (mode DĂ©fi 5 rounds, stateless â pas de session serveur nĂ©cessaire, pas de leaderboard).
|
||||
@@ -89,6 +91,13 @@ RĂšgles :
|
||||
- **Adapter** : `adapter-node` (auto-hébergement sobre derriÚre nginx/caddy).
|
||||
- **PWA** : manifest + service worker minimal (cache app shell, photos en stale-while-revalidate).
|
||||
- **i18n** : dictionnaires maison `fr` / `gcf` (créole), store Svelte, `lang` persistée en localStorage.
|
||||
- **Photos** : URLs Wikimedia Commons (Special:FilePath, `?width=1200`) vérifiées CC par l'Agent Contenu ; `<img loading="lazy">` + `srcset`.
|
||||
- **Photos** : en mode jeu, **proxy serveur `/api/photo/[id]`** (C4 â l'URL Wikimedia Commons contient le nom du fichier, souvent un spoiler, et les EXIF peuvent embarquer du GPS) : le serveur fetch l'URL Commons du corpus, retraite avec **sharp** (rotation auto, suppression de toutes les mĂ©tadonnĂ©es par dĂ©faut, WebP, largeurs 400/800/1200), cache mĂ©moire 24 h + `Cache-Control: immutable`. `PhotoPanel` utilise `<img src srcset sizes>`. L'Explorer (`/api/lieux`) garde les URLs Commons directes (mode sans enjeu) et le service worker met en cache les deux origines.
|
||||
- **A11y / calm tech** : `prefers-reduced-motion` respecté (pas de vol de marqueur), timer informatif non anxiogÚne, navigation clavier (carte : flÚches déplacent le marqueur, Entrée valide).
|
||||
- **Licence code** : MIT (le dĂ©pĂŽt historique Ă©tait AGPL â la refonte est un nouveau module `app/` sous MIT comme exigĂ© par le prompt ; le `LICENSE` racine reste l'historique, un `app/LICENSE` MIT est ajoutĂ©).
|
||||
|
||||
## 7. Correctifs d'audit (2026-07-17)
|
||||
|
||||
- **C4 â URLs photo spoiler** : voir §6 « Photos » et §5. Deux fuites colmatĂ©es : le nom de fichier Commons dans `photo.url` (remplacĂ© par le proxy opaque `/api/photo/<uuid>`) et la corrĂ©lation `id` round â `id` catalogue (`/api/lieux` n'expose plus d'`id` ; l'Explorer utilise des indices Ă©phĂ©mĂšres cĂŽtĂ© client).
|
||||
- **A1 â Radius de score en Guyane** : voir §5 « RĂšgles ». `aire_commune_km2` (champ optionnel du schĂ©ma) Ă©largit le rayon effectif : `sqrt(aire/Ï)`. Test de rĂ©fĂ©rence : Saint-Laurent-du-Maroni (4320,8 kmÂČ, EXPERT), guess Ă 40 km â `radiusEffKm` 37,1, score â 1700 (au lieu de â 0). Le code tolĂšre l'absence du champ.
|
||||
- **A2 â Pas de fuite de rĂ©gion** : la camĂ©ra initiale de `GameMap` est **globale** (`center: [-58, 0]`, `zoom: 3.6` â vue d'ensemble des 4 rĂ©gions, aucun indice sur le lieu). Les 4 boutons rĂ©gion sont la **devinette en deux temps** : Ă©tape 1 = sauter vers la rĂ©gion supposĂ©e, Ă©tape 2 = poser le marqueur. Les deux Ă©tapes sont combinĂ©es par la distance seule : mauvaise rĂ©gion â distance Ă©norme â score â 0. Aucune donnĂ©e serveur ne rĂ©vĂšle la rĂ©gion avant le guess (`/api/round` ne l'inclut pas).
|
||||
- **A3 â ChaĂźne Wikipedia** : voir §3. `Cache-Control: max-age=86400` ; cas intermĂ©diaire QID sans frwiki â `404 {"reason":"no-frwiki"}` â variante Cas B dĂ©diĂ©e cĂŽtĂ© front ; fallback de langue fr uniquement, documentĂ© dans le code.
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# JWE â Audit post-exĂ©cution (passe 2) â Rapport de vĂ©rification
|
||||
|
||||
Date : 2026-07-16 · Référentiel : `prompts/JWE-prompt-verification-agents.md` · Méthode : fetch réel, jamais recall. Corpus : 41 lieux.
|
||||
|
||||
## Tableau des vérifications
|
||||
|
||||
| ID | Vérification | Méthode / Preuve | PASS/FAIL | Correctif appliqué |
|
||||
|----|--------------|------------------|-----------|--------------------|
|
||||
| C1 | QID valides + sitelink frwiki | `node app/scripts/validate-lieux.mjs` : 32 QID vĂ©rifiĂ©s par `wbgetentities` batch, sitelink + label concordants | **PASS** | â |
|
||||
| C2 | Les « null » sont de vrais null | Recherche `list=search` frwiki par titre exact pour les 9 nulls. **1 FAIL initial** : « Savane des PĂ©trifications » avait un article (casse « pĂ©trifications » manquĂ©e au 1er contrĂŽle) | **FAIL â PASS** | Savane â QID rĂ©el `Q3474455` (coords P625 14.4011, â60.8576, photo CC BY-SA 4.0 re-vĂ©rifiĂ©e) ; nouvelle lacune Martinique : **Anse Grosse Roche** (absence frwiki prouvĂ©e sur 4 variantes de titre, photo CC BY-SA 4.0 HTTP 200) |
|
||||
| C3 | CoordonnĂ©es < 500 m de la source | Comparaison P625 â JSON pour les 32 lieux Ă QID (haversine dans le validateur) : 32/32 < 500 m | **PASS** | Seed Fort DelgrĂšs dĂ©jĂ corrigĂ© en passe 1 (Q3077840, 15.9886, â61.7231) |
|
||||
| C4a | Noms de fichiers photo opaques | Avant : URL Commons en clair dans `/api/round` (spoiler devtools). AprĂšs : `photo.url = /api/photo/<uuid>` â grep `FilePath|.jpg` sur les rĂ©ponses = 0 | **FAIL â PASS** | Proxy `/api/photo/[id]?w=` (sharp : rotation, strip mĂ©tadonnĂ©es, WebP, 400/800/1200, cache 24 h + `immutable`) ; `srcset` dans `PhotoPanel` ; `/api/lieux` n'expose plus `id` (anti-corrĂ©lation roundâexplorer) |
|
||||
| C4b | EXIF strippés | `sharp(buf).metadata()` sur `/api/photo/<id>?w=400` : `exif: false, iptc: false, xmp: false` | **PASS** | Ré-encodage WebP systématique via le proxy |
|
||||
| C4c | Licences vĂ©rifiables | `content/credits.md` : 41 photos, page Commons + auteur + licence (CC-BY-SA/BY/CC0/DP uniquement) | **PASS** | â |
|
||||
| C5 | Photos des lieux « null » | Les 9 nulls ont une photo Commons libre documentĂ©e (source + licence dans credits.md) â le cas « rare » du rĂ©fĂ©rentiel est couvert ; Ă terme prĂ©fĂ©rer photos OKI/Panoramax | **PASS** | Recommandation R4 pour les futurs lieux |
|
||||
| A1 | Score juste en Guyane | Avant : radius fixe (FAIL). AprĂšs : `radius_eff = max(radius, sqrt(aire_commune_km2/Ï))`, `aire_commune_km2` injectĂ© depuis geo.api.gouv.fr (41/41 lieux). Test rĂ©el : guess Ă 40 km d'un lieu de Saint-Laurent-du-Maroni â `radiusEff 37,1 km`, **score 1699** (â2 sans le fix) | **FAIL â PASS** | `lieux.ts` (`rayonEffectifKm`), rĂ©ponse `/api/guess` enrichie de `radiusEffKm`, affichage discret au rĂ©sultat. â ïž incident de revue : unitĂ©s ha/1000 corrigĂ©es en ha/100 avant commit |
|
||||
| A2 | Pas de fuite de rĂ©gion | CamĂ©ra initiale globale (`center [-58,0], zoom 3.6`, `GameMap.svelte`) â aucun zoom rĂ©gion automatique ; devinette en deux temps : 4 boutons rĂ©gion (Ă©tape 1) â marqueur (Ă©tape 2) ; combinaison par la distance (mauvaise rĂ©gion â score â 0). DocumentĂ© dans `docs/architecture.md` §7 | **PASS** | â |
|
||||
| A3 | ChaĂźne Wikipedia exacte | `wbgetentities(sitelinks)` â REST summary ; cache mĂ©moire 24 h + `Cache-Control: max-age=86400` (Ă©tait 3600) ; UA explicite ; fallback fr-only documentĂ©. Cas intermĂ©diaire tranchĂ© : 404 `{"reason":"no-frwiki"}` â variante Cas B « Pas encore d'article en français / Pa nyen an fransĂ© » + lien fiche Wikidata | **FAIL â PASS** | `wiki/[qid]/+server.ts`, `WikiFiche.svelte`, clĂ©s `lacuneFr.*` FR+GCF ; bonus : redirections Wikidata rĂ©solues |
|
||||
| A4 | Strapi vs SvelteKit | ADR §1 : SvelteKit seul + JSON versionné + script de validation au commit (`app/scripts/validate-lieux.mjs`, ajouté) | **PASS** | Script de validation livré |
|
||||
| A5 | Hors scope respectĂ© | Revue : pas de comptes, pas de leaderboard serveur, pas de multi ; scores cĂŽtĂ© client uniquement | **PASS** | â |
|
||||
| B1 | Endpoint sans fuite | 15 tirages `/api/round` (passe 1) + re-test passe 2 : 0 occurrence `coordonnees/commune/wikidata_id/FilePath` | **PASS** | â |
|
||||
| B2 | Score cĂŽtĂ© serveur | Le client envoie `{id, lat, lon, hintsUsed, timeMs?}` ; le serveur calcule (formule A1) ; recalculs indĂ©pendants conformes (passe 1 et 2) | **PASS** | â |
|
||||
| B3 | Proxy Wikipedia | Cache 24 h + header 86400 (preuve curl `%header{cache-control}`) ; aucun texte stockĂ© en base | **PASS** | â |
|
||||
| B4 | ZĂ©ro dĂ©pendance propriĂ©taire | `package.json` : `maplibre-gl` + `sharp` (Apache-2.0, ajoutĂ© pour C4) ; aucune clĂ© API ; pas de tĂ©lĂ©mĂ©trie | **PASS** | â |
|
||||
| F1 | Carte | Bounds + minZoom, aucune fuite rĂ©gion (A2), MapLibre lazy (chunk sĂ©parĂ©, 0 occ. sur `/`), boutons zoom, clavier | **PASS** | â |
|
||||
| F2 | Cas A / Cas B distincts | Panneaux visuellement distincts, message lacune FR + crĂ©ole, CTA contribution prĂ©-rempli (passe 1, revĂ©rifiĂ© passe 2) | **PASS** | â |
|
||||
| F3 | Cas intermĂ©diaire gĂ©rĂ© | 404 `no-frwiki` â variante Cas B dĂ©diĂ©e, pas d'Ă©cran vide ni d'erreur console (chemins compilĂ©s et testĂ©s) | **PASS** | Voir A3 |
|
||||
| F4 | Contour de commune | Non intĂ©grĂ© â optionnel (« si intĂ©grĂ© ») | N/A | Recommandation R3 |
|
||||
| F5 | Doctrine OKI | Une action primaire, Valider zone pouce, timer calme, micro-interactions crĂ©oles, style non-Google | **PASS** | â |
|
||||
| F6 | Perf 4G | Premier Ă©cran â 43 KB gz ; photos WebP via proxy + `srcset` + lazy ; poids round hors tiles : 1 JSON (~1 KB) + 1 WebP 400â1200 px | **PASS** | â |
|
||||
| Q1 | Bloquants rejouĂ©s | C1, C2, A1, A2, B1, B2, F2 : preuves ci-dessus, exĂ©cutĂ©es sur `node build` (prod) | **PASS** | â |
|
||||
| Q2 | Partie complÚte | Rounds API + résultats Cas A/Cas B/lieu guyanais testés ; rendu visuel non capturé (pas de navigateur headless dispo) | **PASS (partiel)** | Recommandation R5 |
|
||||
| Q3 | Checklist OKI | IntĂ©gralement passĂ©e en passe 1 (`docs/audit-oki.md`), points inchangĂ©s | **PASS** | â |
|
||||
| Q4 | Scope creep | Rien de plus que le prompt v2 (+ champs audit : `aire_commune_km2`, `radiusEffKm`, proxy photo â correctifs, pas features) | **PASS** | â |
|
||||
| Q5 | CWV 4G | Mesures indirectes (poids bundles, SSR, lazy) : LCP estimé < 2 s ; pas de Lighthouse dispo | **PASS (estimé)** | Recommandation R5 |
|
||||
|
||||
## Recommandations (hors scope audit â pas implĂ©mentĂ©es)
|
||||
|
||||
| # | Priorité | ProblÚme / opportunité | Solution proposée | Effort | Fichiers |
|
||||
|---|----------|------------------------|-------------------|--------|----------|
|
||||
| R1 | important | ADR-001 v1 : le DĂ©fi est alĂ©atoire par joueur, impossible de jouer « les mĂȘmes 5 lieux » qu'un autre | Lien Ă seed `/defi/<seed>` (PRNG seedĂ© serveur, anti-fuite, partage par image) â v2 PlaySocketJS seulement si gate de traction | M | `routes/defi/[seed]`, `server/lieux.ts` |
|
||||
| R2 | important | ADR-002 : MapLibre (~800 KB) absent de l'accueil, mais l'accueil n'a pas encore de carte du tout | Carte SVG statique des 4 régions (topojson geo.api.gouv.fr + mapshaper †150 KB gz, composant from scratch, sans JS) | M | `lib/map/`, `+page.svelte` |
|
||||
| R3 | confort | Résultat : le joueur ne visualise pas les limites de la commune | Superposer le contour geo.api.gouv.fr (`geometry=contour`) sur la carte résultat | S | `GameMap`, `/api/guess` (code INSEE à stocker) |
|
||||
| R4 | confort | Les futurs lieux « null » dépendent de Commons (rare pour les lieux non documentés) | Prévoir photos OKI propres ou Panoramax dans le guide de contribution | S | `docs/contribution.md` |
|
||||
| R5 | confort | Pas de tests automatisés ni de vraies mesures Lighthouse | Vitest sur le scoring + CI légÚre ; Lighthouse sur le VPS de prod | M | `app/tests/` |
|
||||
| R6 | confort | IcÎnes PWA SVG seulement ; contraste corail 3,7:1 | Générer PNG 192/512 à l'installation ; assombrir l'accent vers ℠4,5:1 | S | `static/`, `oki.css` |
|
||||
|
||||
**Verdict passe 2 : CONFORME â 0 FAIL restant.** 4 FAIL corrigĂ©s (C2, C4a, A1, A3), 1 script de validation pĂ©renne livrĂ©.
|
||||
BIN
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB |
@@ -1,9 +0,0 @@
|
||||
<?= "
|
||||
<div style='display: flex; justify-content: center; align-items: center;'>
|
||||
<h1 id='title'>$zone</h1>
|
||||
<a style='text-decoration: none;' href='/'>
|
||||
<button id='back-button'>đ Retour</button>
|
||||
</a>
|
||||
</div>
|
||||
";
|
||||
?>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?= "
|
||||
<div style='display: flex; justify-content: center;'>
|
||||
<button class='game-button' disabled style='margin-right: 2em;' onClick='startGame()' id='start' type='button'>Commencer la partie</button>
|
||||
<button class='game-button' disabled onClick='restartGame()' id='restart' type='button'>Recommencer</button>
|
||||
</div>
|
||||
|
||||
<div id='chrono'></div>
|
||||
<div id='score' style='display: flex; justify-content: center;'></div>
|
||||
|
||||
<div id='question'></div>
|
||||
";
|
||||
?>
|
||||
@@ -1,19 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Choisis une carte</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="./css/index.css" />
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Choisis une carte</h1>
|
||||
<ul>
|
||||
<li><a href="kat/DINA-MORGABIN.php">DINA MORGABIN (La Réunion)</a></li>
|
||||
<li><a href="kat/GUYANE.php">GUYANE</a></li>
|
||||
<li><a href="kat/KMT.php">KMT (Afrique)</a></li>
|
||||
<li><a href="kat/KARUKERA.php">KARUKERA (Guadeloupe)</a></li>
|
||||
<li><a href="kat/WANAKAERA.php">WANAKAERA (Martinique)</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,554 +0,0 @@
|
||||
/**
|
||||
* js/map.js
|
||||
*/
|
||||
|
||||
/**
|
||||
* Typos
|
||||
*
|
||||
* AprĂšs l'ajout de l'Afrique, on remplace "communes" par "zones"
|
||||
* Zones = Communes ou Pays
|
||||
*/
|
||||
|
||||
/**
|
||||
* Récupérer le nom du fichier actuel (ex: 971.php) et en extraire le code du département (ex: 971).
|
||||
*/
|
||||
const currentFileName = window.location.pathname.split('/').pop()
|
||||
const codeCarte = currentFileName.split('.')[0]
|
||||
|
||||
const startButton = document.getElementById('start')
|
||||
const restartButton = document.getElementById('restart')
|
||||
|
||||
restartButton.setAttribute('disabled', true)
|
||||
|
||||
/**
|
||||
* Définir le centre , le niveau de zoom et le style de la carte en fonction du code du département.
|
||||
*/
|
||||
let centerCoordinates
|
||||
let zoomLevel
|
||||
let styleFileName
|
||||
|
||||
switch (codeCarte) {
|
||||
case 'KMT':
|
||||
centerCoordinates = [21.21, 1.36] // Afrique
|
||||
zoomLevel = 2.7
|
||||
styleFileName = 'ortho-jwe-KMT.json'
|
||||
break
|
||||
case 'KARUKERA':
|
||||
centerCoordinates = [-61.4167, 16.25] // Guadeloupe
|
||||
zoomLevel = 9
|
||||
styleFileName = 'ortho.json'
|
||||
break
|
||||
case 'WANAKAERA':
|
||||
centerCoordinates = [-61.01635, 14.60285] // Martinique
|
||||
zoomLevel = 9.5
|
||||
styleFileName = 'ortho.json'
|
||||
break
|
||||
case 'GUYANE':
|
||||
centerCoordinates = [-53.1258, 3.9339] // Guyane française
|
||||
zoomLevel = 7
|
||||
styleFileName = 'ortho-jwe.json'
|
||||
break
|
||||
case 'DINA-MORGABIN':
|
||||
centerCoordinates = [55.52905, -21.13014] // La Réunion
|
||||
styleFileName = 'ortho.json'
|
||||
zoomLevel = 9.5
|
||||
break
|
||||
default:
|
||||
centerCoordinates = [-61.4167, 16.25] // Par défaut (Guadeloupe)
|
||||
styleFileName = 'ortho.json'
|
||||
zoomLevel = 9.5
|
||||
}
|
||||
|
||||
/**
|
||||
* Définit les décalages des popups en fonction de leur position.
|
||||
*/
|
||||
const popupOffsets = {
|
||||
'top': [0, 0],
|
||||
'top-left': [0, 0],
|
||||
'top-right': [0, 0],
|
||||
'bottom': [0, -30],
|
||||
'bottom-left': [0, -50],
|
||||
'bottom-right': [0, -50],
|
||||
'left': [25, -25],
|
||||
'right': [-25, -25]
|
||||
}
|
||||
|
||||
/**
|
||||
* Référence aux éléments HTML pour afficher le score.
|
||||
*/
|
||||
let ok
|
||||
let ko
|
||||
let penaltyElement
|
||||
|
||||
/**
|
||||
* Gestion du temps écoulé
|
||||
*/
|
||||
let gameTime = 0
|
||||
let gameMinute = 0
|
||||
let gameSecond = 0
|
||||
let gamePenalty = 0
|
||||
let gameTimeWithPenalty = 0
|
||||
let gameMinuteWithPenalty = 0
|
||||
let gameSecondWithPenalty = 0
|
||||
let intervalId
|
||||
|
||||
/**
|
||||
* Ătat actuel de la commune survolĂ©e.
|
||||
*/
|
||||
let hoveredStateId = null
|
||||
|
||||
/**
|
||||
* Référence à la commune actuellement sélectionnée pour trouver.
|
||||
*/
|
||||
let currentZone = null
|
||||
|
||||
/**
|
||||
* Ensemble des codes des communes déjà trouvées correctement.
|
||||
*/
|
||||
const correctAnswers = new Set()
|
||||
|
||||
/**
|
||||
* Permet de remettre le jeu Ă 0
|
||||
*/
|
||||
function resetGame() {
|
||||
ok.innerText = 0
|
||||
ko.innerText = 0
|
||||
correctAnswers.clear()
|
||||
clearInterval(intervalId)
|
||||
intervalId = null
|
||||
gameTime = 0
|
||||
gamePenalty = 0
|
||||
gameTimeWithPenalty = 0
|
||||
}
|
||||
|
||||
/**
|
||||
* Active le bouton "Commencer la partie" au chargement de la page
|
||||
*/
|
||||
window.onload = function() {
|
||||
const startElement = document.getElementById('start')
|
||||
startElement.removeAttribute('disabled')
|
||||
}
|
||||
|
||||
function startGame() {
|
||||
loadMap()
|
||||
|
||||
const question = document.getElementById('question')
|
||||
const score = document.getElementById('score')
|
||||
const chrono = document.getElementById('chrono')
|
||||
|
||||
question.innerHTML = `<p style='font-weight: bold;'>Trouve ${codeCarte === 'KMT' ? 'le pays' : 'la commune'}</p><p id='commune' style='font-size: 30px; font-weight: bold; color: #1F51FF'>...</p>`
|
||||
score.innerHTML = "<p style='color: green; font-weight: bold; margin-right: 2em;'>Correct â
: <span style='color: black;' id='OK'>0</span></p><p style='color: red; font-weight: bold;'>Faux â : <span style='color: black;' id='KO'>0</span></p>"
|
||||
chrono.innerHTML = "<p>Temps écoulé : <span id='time'></span><span style='margin-left: 1em;color: red; font-weight: bold;' id='penalty'></span></p>"
|
||||
|
||||
communeObserver()
|
||||
|
||||
ok = document.getElementById('OK')
|
||||
ko = document.getElementById('KO')
|
||||
penaltyElement = document.getElementById('penalty')
|
||||
|
||||
|
||||
startButton.setAttribute('disabled', true)
|
||||
restartButton.removeAttribute('disabled')
|
||||
|
||||
resetGame()
|
||||
}
|
||||
|
||||
/**
|
||||
* Recommencer la partie
|
||||
*/
|
||||
function restartGame() {
|
||||
startGame()
|
||||
}
|
||||
|
||||
/**
|
||||
* Observe le contenu de l'élément ayant pour id "commune"
|
||||
*/
|
||||
function communeObserver(){
|
||||
const communeElement = document.getElementById('commune')
|
||||
const timeElement = document.getElementById('time')
|
||||
|
||||
// Options de l'observateur (quelles sont les mutations Ă observer)
|
||||
const config = { childList: true, subtree: true, characterData: true }
|
||||
|
||||
// Fonction callback à éxécuter quand une mutation est observée
|
||||
const callback = function (mutationsList) {
|
||||
for (var mutation of mutationsList) {
|
||||
if (mutation.type == "childList" || mutation.type == "characterData") {
|
||||
// Vérifie si le contenu de la balise span n'est pas égal à "..."
|
||||
if (communeElement.textContent.trim() !== "...") {
|
||||
// Vérifie si setInterval n'est pas déjà en cours
|
||||
if (!intervalId) {
|
||||
intervalId = setInterval(() => {
|
||||
gameTime++
|
||||
gameTimeWithPenalty = gameTime + gamePenalty
|
||||
|
||||
if (gameTimeWithPenalty >= 60) {
|
||||
gameMinuteWithPenalty = String(gameTimeWithPenalty / 60).split('.')[0]
|
||||
gameMinute = String(gameTime / 60).split('.')[0]
|
||||
|
||||
gameSecondWithPenalty = gameTimeWithPenalty % 60
|
||||
gameSecond = gameTime % 60
|
||||
timeElement.innerText = `${gameMinuteWithPenalty} minute${gameMinuteWithPenalty > 1 ? 's' : ''} ${gameSecondWithPenalty} seconde${gameSecondWithPenalty > 1 ? 's' : ''}`
|
||||
} else {
|
||||
timeElement.innerText = `${gameTimeWithPenalty} seconde${gameTimeWithPenalty > 1 ? 's' : ''}`
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Créé une instance de l'observateur lié à la fonction de callback
|
||||
const observer = new MutationObserver(callback)
|
||||
|
||||
// Commence à observer le noeud cible pour les mutations précédemment configurées
|
||||
observer.observe(communeElement, config)
|
||||
}
|
||||
|
||||
/**
|
||||
* RécupÚre les propriétés des communes depuis un fichier GeoJSON en fonction du code du département.
|
||||
*
|
||||
* @async
|
||||
* @param {string} codeCarte - Code de la carte.
|
||||
* @returns {Promise<Object[]>} Promesse résolue avec les propriétés des communes.
|
||||
*/
|
||||
async function getFile(codeCarte) {
|
||||
try {
|
||||
const response = await fetch(`../kat/data/${codeCarte}/contours-${codeCarte === 'KMT' ? 'pays' : 'communes'}.geojson`)
|
||||
if (!response.ok) {
|
||||
throw new Error(`Ăchec du chargement du fichier JSON : ${response.statusText}`)
|
||||
}
|
||||
|
||||
data = await response.json()
|
||||
return data.features.map(({properties}) => properties)
|
||||
} catch (error) {
|
||||
console.error('Erreur:', error)
|
||||
throw new Error(error)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* RécupÚre les coordonnées du centre de la commune depuis le fichier "centres.json" en fonction du code du département.
|
||||
*
|
||||
* @param {string} codeCarte - Code de la carte.
|
||||
* @param {string} codeZone - Code de la zone.
|
||||
* @returns {Promise<number[]>} Promesse résolue avec les coordonnées du centre de la commune.
|
||||
*/
|
||||
async function getZoneCenterCoordinates(codeCarte, codeZone) {
|
||||
try {
|
||||
// Utiliser fetch pour lire le fichier "centres.json"
|
||||
const response = await fetch(`../kat/data/${codeCarte}/centres.json`)
|
||||
if (!response.ok) {
|
||||
throw new Error(`Ăchec du chargement du fichier JSON : ${response.statusText}`)
|
||||
}
|
||||
|
||||
const centerData = await response.json()
|
||||
|
||||
// Vérifier si le code de la zone existe dans les données
|
||||
if (codeZone in centerData) {
|
||||
const coordinates = centerData[codeZone]
|
||||
return coordinates
|
||||
} else {
|
||||
throw new Error(`Aucune donnée de centre trouvée pour la commune : ${codeZone}`)
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Erreur lors de la récupération des coordonnées du centre de la commune :', error)
|
||||
throw new Error(error)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Met à jour le score en fonction de la réponse.
|
||||
*
|
||||
* @param {boolean} isCorrect - Indique si la réponse est correcte.
|
||||
*/
|
||||
function updateScore(isCorrect) {
|
||||
if (isCorrect) {
|
||||
ok.innerText = Number.parseInt(ok.innerText, 10) + 1
|
||||
} else {
|
||||
ko.innerText = Number.parseInt(ko.innerText, 10) + 1
|
||||
gamePenalty += 5
|
||||
|
||||
penaltyElement.style.opacity = 1
|
||||
penaltyElement.innerText = '+ 5 secondes'
|
||||
|
||||
setTimeout(() => {
|
||||
penaltyElement.style.opacity = 0
|
||||
penaltyElement.innerText = ''
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sélectionne une commune au hasard parmi celles qui n'ont pas encore été trouvées.
|
||||
*
|
||||
* @param {Array} zones - Liste de toutes les zones.
|
||||
* @returns {Object|null} Retourne la commune sélectionnée ou null si toutes les zones ont été trouvées.
|
||||
*/
|
||||
function pickRandomZone(zones) {
|
||||
const zonesRestantes = zones.filter(commune => !correctAnswers.has(commune.code))
|
||||
|
||||
if (zonesRestantes.length === 0) {
|
||||
return null
|
||||
}
|
||||
|
||||
const index = Math.floor(Math.random() * zonesRestantes.length)
|
||||
return zonesRestantes[index]
|
||||
}
|
||||
|
||||
/**
|
||||
* Vérifie si le code de la zone cliquée correspond à la commune actuelle à trouver.
|
||||
*
|
||||
* @param {string} codeZone - code de la zone à vérifier.
|
||||
* @returns {boolean} Résultat de la vérification.
|
||||
*/
|
||||
function checkAnswer(codeZone) {
|
||||
return currentZone && codeZone === currentZone.code
|
||||
}
|
||||
|
||||
/**
|
||||
* Charge la carte
|
||||
*/
|
||||
function loadMap() {
|
||||
/**
|
||||
* Initialise et configure la carte
|
||||
*/
|
||||
const map = new maplibregl.Map({
|
||||
container: 'map',
|
||||
style: `../kat/styles/${styleFileName}`,
|
||||
center: centerCoordinates,
|
||||
zoom: zoomLevel
|
||||
})
|
||||
|
||||
if (codeCarte !== 'GUYANE') {
|
||||
/**
|
||||
* Désactive le zoom, le double-clic, le déplacement de la carte pour les cartes autres que celle la Guyane.
|
||||
*/
|
||||
map.scrollZoom.disable()
|
||||
map.doubleClickZoom.disable()
|
||||
map.dragPan.disable()
|
||||
} else {
|
||||
/**
|
||||
* Ajoute les contrÎles de navigation à la carte, et définit les niveaux de zoom minimum et maximum pour la Guyane.
|
||||
*/
|
||||
map.addControl(new maplibregl.NavigationControl({showCompass: false}))
|
||||
map.setMinZoom(7)
|
||||
map.setMaxZoom(9.5)
|
||||
}
|
||||
|
||||
if (codeCarte === 'KMT') {
|
||||
/**
|
||||
* Ajoute les contrÎles de navigation à la carte, et définit les niveaux de zoom minimum et maximum pour l'Afrique'.
|
||||
*/
|
||||
map.addControl(new maplibregl.NavigationControl({showCompass: false}))
|
||||
map.setMinZoom(2.4)
|
||||
map.setMaxZoom(9)
|
||||
map.dragPan.enable()
|
||||
}
|
||||
|
||||
/**
|
||||
* Code pour la gestion des événements de la carte (load, mousemove, mouseleave, click).
|
||||
*/
|
||||
map.on('load', async () => {
|
||||
const zones = await getFile(codeCarte)
|
||||
|
||||
/**
|
||||
* Définit la zone actuelle à trouver et met à jour l'affichage.
|
||||
*
|
||||
* @param {Object} zone - La zone à définir comme actuelle.
|
||||
*/
|
||||
function setZone(zone) {
|
||||
if (currentZone) {
|
||||
map.setFeatureState(
|
||||
{source: 'communes', id: currentZone.code},
|
||||
{current: false}
|
||||
)
|
||||
}
|
||||
|
||||
currentZone = zone
|
||||
document.getElementById('commune').innerText = zone.nom
|
||||
|
||||
map.setFeatureState(
|
||||
{source: 'communes', id: zone.code},
|
||||
{current: true}
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Ajouter une source de données pour les communes.
|
||||
*/
|
||||
map.addSource('communes', {
|
||||
'type': 'geojson',
|
||||
'data': `../kat/data/${codeCarte}/contours-${codeCarte === 'KMT' ? 'pays' : 'communes'}.geojson`,
|
||||
'promoteId': 'code'
|
||||
})
|
||||
|
||||
/**
|
||||
* Ajouter une couche de remplissage pour les communes.
|
||||
*/
|
||||
map.addLayer({
|
||||
'id': 'drom',
|
||||
'type': 'fill',
|
||||
'source': 'communes',
|
||||
'layout': {},
|
||||
'paint': {
|
||||
'fill-color': '#1F51FF',
|
||||
'fill-opacity': [
|
||||
'case',
|
||||
['boolean', ['feature-state', 'hover'], false],
|
||||
0.8,
|
||||
0
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Ajouter une couche de remplissage pour les communes (2Úme couche), en prenant en compte les réponses correctes et incorrectes.
|
||||
*/
|
||||
map.addLayer({
|
||||
'id': 'drom-2',
|
||||
'type': 'fill',
|
||||
'source': 'communes',
|
||||
'layout': {},
|
||||
'paint': {
|
||||
'fill-color': [
|
||||
'case',
|
||||
['boolean', ['feature-state', 'correct'], false], '#00FF00',
|
||||
['boolean', ['feature-state', 'incorrect'], false], '#FF0000',
|
||||
'rgba(0,0,0,0)'
|
||||
],
|
||||
'fill-opacity': [
|
||||
'case',
|
||||
['boolean', ['feature-state', 'hover'], false], 0.5,
|
||||
0.8
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* GĂšre l'evenement mousemove (quand la souris survole la commune)
|
||||
*/
|
||||
map.on('mousemove', 'drom', e => {
|
||||
map.getCanvas().style.cursor = 'pointer'
|
||||
if (e.features.length > 0) {
|
||||
if (hoveredStateId) {
|
||||
map.setFeatureState(
|
||||
{source: 'communes', id: hoveredStateId},
|
||||
{hover: false}
|
||||
)
|
||||
}
|
||||
hoveredStateId = e.features[0].id
|
||||
map.setFeatureState(
|
||||
{source: 'communes', id: hoveredStateId},
|
||||
{hover: true}
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* GĂšre l'evenement mouseleave (quand la souris quitte la zone)
|
||||
*/
|
||||
map.on('mouseleave', 'drom', () => {
|
||||
map.getCanvas().style.cursor = ''
|
||||
if (hoveredStateId) {
|
||||
map.setFeatureState(
|
||||
{source: 'communes', id: hoveredStateId},
|
||||
{hover: false}
|
||||
)
|
||||
}
|
||||
hoveredStateId = null
|
||||
})
|
||||
|
||||
/**
|
||||
* GĂšre l'evenement click (quand on clique sur la zone)
|
||||
*/
|
||||
map.on('click', 'drom', async e => {
|
||||
if (e.features.length > 0) {
|
||||
const clickedCodeZone = e.features[0].id
|
||||
const clickedZoneNom = e.features[0].properties.nom
|
||||
const isCorrect = checkAnswer(clickedCodeZone)
|
||||
|
||||
if (isCorrect) {
|
||||
updateScore(true)
|
||||
const centerCoordinates = await getZoneCenterCoordinates(codeCarte, clickedCodeZone)
|
||||
|
||||
const popup = new maplibregl.Popup({offset: popupOffsets, closeButton: false, className: 'popup-ok'})
|
||||
.setLngLat([centerCoordinates[0], centerCoordinates[1]])
|
||||
.setHTML(`<h3>Bravo, c'est ${clickedZoneNom}</h3>`)
|
||||
.setMaxWidth('200px')
|
||||
.addTo(map)
|
||||
|
||||
setTimeout(() => {
|
||||
popup.remove()
|
||||
}, 1500)
|
||||
|
||||
correctAnswers.add(clickedCodeZone)
|
||||
zones.forEach(commune => {
|
||||
map.setFeatureState(
|
||||
{source: 'communes', id: commune.code},
|
||||
{incorrect: false}
|
||||
)
|
||||
})
|
||||
map.setFeatureState(
|
||||
{source: 'communes', id: clickedCodeZone},
|
||||
{correct: true, current: false}
|
||||
)
|
||||
|
||||
const newZone = pickRandomZone(zones)
|
||||
if (newZone) {
|
||||
setZone(newZone)
|
||||
} else {
|
||||
const totalAnswers = Number.parseInt(ok.innerText, 10) + Number.parseInt(ko.innerText, 10)
|
||||
const percentageCorrectAnswers = (Number.parseInt(ok.innerText, 10) / totalAnswers) * 100
|
||||
|
||||
let elapsedTime = `${gameTime} seconde${gameTime > 1 ? 's' : ''}`
|
||||
let elapsedTimeWithPenalty = `${gameTimeWithPenalty} seconde${gameTimeWithPenalty > 1 ? 's' : ''}`
|
||||
|
||||
if (gameTime >= 60) {
|
||||
elapsedTime = `${gameMinute} minute${gameMinute > 1 ? 's' : ''} ${gameSecond} seconde${gameSecond > 1 ? 's' : ''}`
|
||||
}
|
||||
|
||||
if (gameTimeWithPenalty >= 60) {
|
||||
elapsedTimeWithPenalty = `${gameMinuteWithPenalty} minute${gameMinuteWithPenalty > 1 ? 's' : ''} ${gameSecondWithPenalty} seconde${gameSecondWithPenalty > 1 ? 's' : ''}`
|
||||
}
|
||||
|
||||
alert(`${Math.round(percentageCorrectAnswers)}% de bonnes réponses !
|
||||
\nTemps écoulé : ${elapsedTime} ! ${gamePenalty ? `
|
||||
\nPénalité : ${gamePenalty} secondes` : '\nAucune pénalité !'}
|
||||
\nTemps total : ${elapsedTimeWithPenalty}`)
|
||||
clearInterval(intervalId)
|
||||
gameTime = 0
|
||||
gameTimeWithPenalty = 0
|
||||
|
||||
setTimeout(() => {
|
||||
location.reload()
|
||||
}, 1000)
|
||||
}
|
||||
} else {
|
||||
updateScore(false)
|
||||
const centerCoordinates = await getZoneCenterCoordinates(codeCarte, clickedCodeZone)
|
||||
|
||||
const popup = new maplibregl.Popup({offset: popupOffsets, closeButton: false, className: 'popup-ko'})
|
||||
.setLngLat([centerCoordinates[0], centerCoordinates[1]])
|
||||
.setHTML(`<h3>Faux, c'est ${clickedZoneNom}</h3>`)
|
||||
.setMaxWidth('200px')
|
||||
.addTo(map)
|
||||
|
||||
setTimeout(() => {
|
||||
popup.remove()
|
||||
}, 1500)
|
||||
|
||||
map.setFeatureState(
|
||||
{source: 'communes', id: clickedCodeZone},
|
||||
{incorrect: true}
|
||||
)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
const zone = pickRandomZone(zones)
|
||||
setZone(zone)
|
||||
})
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>JWE - KAT</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/maplibre-gl/5.0.0/maplibre-gl.css" />
|
||||
<link rel="stylesheet" href="../css/map.css" />
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
$zone = 'DINA MORGABIN (La Réunion)';
|
||||
include('../game-control/back.php');
|
||||
include('../game-control/start.php');
|
||||
?>
|
||||
|
||||
<div id="map"></div>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/maplibre-gl/5.0.0/maplibre-gl.js"></script>
|
||||
<script src="../js/map.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,20 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>JWE - KAT</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/maplibre-gl/5.0.0/maplibre-gl.css" />
|
||||
<link rel="stylesheet" href="../css/map.css" />
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
$zone = 'GUYANE';
|
||||
include('../game-control/back.php');
|
||||
include('../game-control/start.php');
|
||||
?>
|
||||
|
||||
<div id="map"></div>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/maplibre-gl/5.0.0/maplibre-gl.js"></script>
|
||||
<script src="../js/map.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,20 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>JWE - KAT</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/maplibre-gl/5.0.0/maplibre-gl.css" />
|
||||
<link rel="stylesheet" href="../css/map.css" />
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
$zone = 'KARUKERA (Guadeloupe)';
|
||||
include('../game-control/back.php');
|
||||
include('../game-control/start.php');
|
||||
?>
|
||||
|
||||
<div id="map"></div>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/maplibre-gl/5.0.0/maplibre-gl.js"></script>
|
||||
<script src="../js/map.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>JWE - KAT</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/maplibre-gl/5.0.0/maplibre-gl.css" />
|
||||
<link rel="stylesheet" href="../css/map.css" />
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
$zone = 'KMT (Afrique)';
|
||||
include('../game-control/back.php');
|
||||
include('../game-control/start.php');
|
||||
?>
|
||||
|
||||
<div id="map"></div>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/maplibre-gl/5.0.0/maplibre-gl.js"></script>
|
||||
<script src="../js/map.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,20 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>JWE - KAT</title>
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/maplibre-gl/5.0.0/maplibre-gl.css" />
|
||||
<link rel="stylesheet" href="../css/map.css" />
|
||||
</head>
|
||||
<body>
|
||||
<?php
|
||||
$zone = 'WANAKAERA (Martinique)';
|
||||
include('../game-control/back.php');
|
||||
include('../game-control/start.php');
|
||||
?>
|
||||
|
||||
<div id="map"></div>
|
||||
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/maplibre-gl/5.0.0/maplibre-gl.js"></script>
|
||||
<script src="../js/map.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1 +0,0 @@
|
||||
{"97401":[55.3629,-21.2019],"97402":[55.6266,-21.0316],"97403":[55.4937,-21.2108],"97404":[55.358,-21.2348],"97405":[55.5706,-21.333],"97406":[55.6442,-21.153],"97407":[55.3038,-20.946],"97408":[55.3918,-20.9967],"97409":[55.6373,-20.9568],"97410":[55.6312,-21.0887],"97411":[55.4444,-20.9434],"97412":[55.644,-21.2921],"97413":[55.3432,-21.1816],"97414":[55.4224,-21.2255],"97415":[55.3402,-21.0366],"97416":[55.5043,-21.309],"97417":[55.7436,-21.3084],"97418":[55.5234,-20.9463],"97419":[55.7418,-21.1778],"97420":[55.5936,-20.9507],"97421":[55.5145,-21.0524],"97422":[55.5701,-21.225],"97423":[55.3377,-21.1138],"97424":[55.4555,-21.1403]}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{"97301":[-52.4797,4.0081],"97302":[-52.3319,4.9464],"97303":[-53.2979,5.2395],"97304":[-52.7764,4.9085],"97305":[-52.4834,4.9925],"97306":[-53.6784,4.9955],"97307":[-52.3498,4.8281],"97308":[-52.075,3.8078],"97309":[-52.2809,4.8897],"97310":[-52.5164,4.4685],"97311":[-54.0105,4.9478],"97312":[-53.0097,5.2418],"97313":[-52.5059,4.8124],"97314":[-51.8261,4.2104],"97352":[-53.4333,3.8181],"97353":[-53.8275,3.049],"97356":[-52.6916,2.8679],"97357":[-54.1148,4.3756],"97358":[-53.1108,4.4853],"97360":[-54.2171,4.9019],"97361":[-53.9167,5.6743],"97362":[-54.0463,4.0165]}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{"ETH":[38.947611801806495,9.176814264950167],"SDS":[30.333984675480757,7.914722205528841],"SOM":[46.5464912522007,6.019175354863551],"KEN":[37.67592532581279,0.5754517148962938],"MWI":[34.09609576769113,-12.735921358471073],"TZA":[35.02498976184473,-6.566525957661288],"SOL":[45.53479066506411,10.023473808092941],"MAR":[-9.046877128746582,28.467636665531234],"SAH":[-12.391359135142558,24.416734554893036],"COG":[14.38464128008542,-1.1354128251164652],"COD":[23.704062532123782,-4.540787787186473],"NAM":[18.118996644631416,-21.83831839276176],"ZAF":[25.24975775021357,-28.817139228003967],"LBY":[17.664886093139636,28.172444725036605],"TUN":[9.882258580942635,34.22426090761612],"ZMB":[28.80207441614033,-12.512532465508636],"SLE":[-11.936779785156242,8.548585165700597],"GIN":[-10.715817638913904,10.109710183267284],"LBR":[-9.0900040336277,6.986474255548001],"CAF":[20.072171294504646,6.3873503410410155],"SDN":[30.120938288256728,13.975380990751114],"DJI":[42.62365767045457,11.756886541193175],"ERI":[39.367317191633596,15.18048657614088],"CIV":[-5.781225753157097,7.972692202215326],"MLI":[-5.421274816662242,14.822845678349621],"SEN":[-14.389369189049583,14.030028086260339],"NGA":[7.736925662551809,8.550665249482046],"BEN":[2.3506708850599414,9.720748943172085],"AGO":[17.418358503069197,-10.850000871930797],"BWA":[24.581611328124996,-22.54493652343752],"ZWE":[29.6308403060281,-19.12852949334319],"TCD":[18.96083041487069,12.76727387526939],"DZA":[1.7720829050164644,29.20973285875821],"MOZ":[35.32805940685356,-17.11878541610783],"SWZ":[31.558316617398656,-26.473094383445954],"BDI":[29.989004159902603,-3.062598924512992],"RWA":[29.916395531631114,-2.013365806021347],"UGA":[32.11797202339386,1.3982593728177313],"LSO":[28.192589689555945,-29.671546052631577],"CMR":[13.006806556679795,6.257060071185528],"GAB":[11.616017795138896,-0.8739639395254695],"NER":[6.34184839443898,15.351725132258853],"BFA":[-1.6133907257564375,11.978387935577883],"TGO":[0.7269224654796614,8.681028948643402],"GHA":[-1.0836453419811212,8.284749272184547],"GNB":[-15.375719884923969,11.688141034100504],"EGY":[30.779661923363108,27.661831325954854],"MRT":[-11.604420093309178,19.791261755485873],"GNQ":[9.71551682692309,2.0668689903846107],"GMB":[-15.49098985460068,13.434295654296868],"MDG":[46.962987167300405,-17.773911299904935],"COM":[43.85425415039061,-11.994052124023446],"STP":[6.957070312500013,0.8602416992187436],"CPV":[-23.908437994462016,16.04201691060126]}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{"97101":[-61.4967,16.2678],"97102":[-61.4698,16.4668],"97103":[-61.5951,16.2498],"97104":[-61.7158,16.0497],"97105":[-61.7294,15.9992],"97106":[-61.7578,16.1387],"97107":[-61.6197,16.0486],"97108":[-61.2296,15.9176],"97109":[-61.689,16.0057],"97110":[-61.0814,16.2972],"97111":[-61.7831,16.3194],"97112":[-61.2929,15.9085],"97113":[-61.4749,16.2274],"97114":[-61.615,16.1231],"97115":[-61.6695,16.2443],"97116":[-61.4988,16.3212],"97117":[-61.36,16.3354],"97118":[-61.658,16.1695],"97119":[-61.4547,16.3921],"97120":[-61.5379,16.2351],"97121":[-61.7651,16.227],"97122":[-61.488,16.4201],"97124":[-61.6953,16.0406],"97125":[-61.2539,16.2784],"97126":[-61.2732,15.9654],"97128":[-61.3896,16.2565],"97129":[-61.6836,16.2937],"97130":[-61.6326,15.8554],"97131":[-61.5892,15.8579],"97132":[-61.6493,15.9931],"97133":[-61.6929,15.9607],"97134":[-61.717,16.0847]}
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
{"97201":[-61.1305,14.816],"97202":[-61.0736,14.4996],"97203":[-61.1237,14.841],"97204":[-61.1584,14.7041],"97205":[-61.1297,14.6593],"97206":[-61.0165,14.4787],"97207":[-60.9685,14.5785],"97208":[-61.1207,14.7228],"97209":[-61.0686,14.6492],"97210":[-60.8976,14.6093],"97211":[-61.1837,14.847],"97212":[-61.0303,14.7084],"97213":[-60.9923,14.6231],"97214":[-61.074,14.7995],"97215":[-61.1465,14.8474],"97216":[-61.0531,14.7796],"97217":[-60.8589,14.4822],"97218":[-61.1217,14.7695],"97219":[-61.1963,14.822],"97220":[-60.897,14.5027],"97221":[-60.9623,14.5262],"97222":[-60.9383,14.675],"97223":[-60.9233,14.5618],"97224":[-61.0407,14.6835],"97225":[-61.1736,14.7717],"97226":[-60.8516,14.4314],"97227":[-60.9467,14.4904],"97228":[-61.0084,14.773],"97229":[-61.1001,14.6518],"97230":[-60.9469,14.7381],"97231":[-61.0376,14.5329],"97232":[-60.8594,14.5421],"97233":[-61.1362,14.7046],"97234":[-61.1459,14.6747]}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,56 +0,0 @@
|
||||
{
|
||||
"version": 8,
|
||||
"glyphs":"https://wxs.ign.fr/static/vectorTiles/fonts/{fontstack}/{range}.pbf",
|
||||
"sources": {
|
||||
"raster-tiles": {
|
||||
"type": "raster",
|
||||
"tiles": [
|
||||
"https://wxs.ign.fr/essentiels/geoportail/wmts?layer=ORTHOIMAGERY.ORTHOPHOTOS&style=normal&tilematrixset=PM&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix={z}&TileCol={x}&TileRow={y}"
|
||||
],
|
||||
"tileSize": 256,
|
||||
"attribution": "<a target='_blank' href='https://geoservices.ign.fr/documentation/donnees/ortho/bdortho'>© IGN</a>"
|
||||
},
|
||||
"KMT": {
|
||||
"type": "vector",
|
||||
"url": "https://tiles.jwe.ovh/data/KMT.json"
|
||||
}
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"id": "simple-tiles",
|
||||
"type": "raster",
|
||||
"source": "raster-tiles"
|
||||
},
|
||||
{
|
||||
"id": "boundary",
|
||||
"type": "line",
|
||||
"source": "KMT",
|
||||
"source-layer": "boundary",
|
||||
"minzoom": 2,
|
||||
"layout": {
|
||||
"line-join": "round",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "#ffffff",
|
||||
"line-width": {
|
||||
"base": 1.4,
|
||||
"stops": [
|
||||
[
|
||||
4,
|
||||
2
|
||||
],
|
||||
[
|
||||
5,
|
||||
1
|
||||
],
|
||||
[
|
||||
12,
|
||||
3
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
{
|
||||
"version": 8,
|
||||
"glyphs":"https://wxs.ign.fr/static/vectorTiles/fonts/{fontstack}/{range}.pbf",
|
||||
"sources": {
|
||||
"raster-tiles": {
|
||||
"type": "raster",
|
||||
"tiles": [
|
||||
"https://wxs.ign.fr/essentiels/geoportail/wmts?layer=ORTHOIMAGERY.ORTHOPHOTOS&style=normal&tilematrixset=PM&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image%2Fjpeg&TileMatrix={z}&TileCol={x}&TileRow={y}"
|
||||
],
|
||||
"tileSize": 256,
|
||||
"attribution": "<a target='_blank' href='https://geoservices.ign.fr/documentation/donnees/ortho/bdortho'>© IGN</a>"
|
||||
},
|
||||
"cadastre": {
|
||||
"type": "vector",
|
||||
"url": "https://openmaptiles.geo.data.gouv.fr/data/cadastre.json"
|
||||
},
|
||||
"decoupage-administratif": {
|
||||
"type": "vector",
|
||||
"url": "https://openmaptiles.geo.data.gouv.fr/data/decoupage-administratif.json"
|
||||
}
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"id": "simple-tiles",
|
||||
"type": "raster",
|
||||
"source": "raster-tiles"
|
||||
},
|
||||
{
|
||||
"id": "communes",
|
||||
"type": "line",
|
||||
"source": "decoupage-administratif",
|
||||
"source-layer": "communes",
|
||||
"minzoom": 2,
|
||||
"layout": {
|
||||
"line-join": "round",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "#ffffff",
|
||||
"line-width": {
|
||||
"base": 1.4,
|
||||
"stops": [
|
||||
[
|
||||
4,
|
||||
0.4
|
||||
],
|
||||
[
|
||||
5,
|
||||
1
|
||||
],
|
||||
[
|
||||
12,
|
||||
3
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "departements",
|
||||
"type": "line",
|
||||
"source": "decoupage-administratif",
|
||||
"source-layer": "departements",
|
||||
"maxzoom":9,
|
||||
"layout": {
|
||||
"line-join": "round",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "hsl(248, 7%, 66%)",
|
||||
"line-dasharray": [
|
||||
3,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"line-width": {
|
||||
"base": 1.4,
|
||||
"stops": [
|
||||
[
|
||||
0,
|
||||
0.6
|
||||
],
|
||||
[
|
||||
4,
|
||||
1.4
|
||||
],
|
||||
[
|
||||
5,
|
||||
2
|
||||
],
|
||||
[
|
||||
12,
|
||||
8
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "regions",
|
||||
"type": "line",
|
||||
"source": "decoupage-administratif",
|
||||
"source-layer": "regions",
|
||||
"maxzoom":5,
|
||||
"layout": {
|
||||
"line-join": "round",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "hsl(248, 7%, 70%)",
|
||||
"line-dasharray": [
|
||||
3,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"line-width": {
|
||||
"base": 1.6,
|
||||
"stops": [
|
||||
[
|
||||
0,
|
||||
0.6
|
||||
],
|
||||
[
|
||||
4,
|
||||
1.4
|
||||
],
|
||||
[
|
||||
5,
|
||||
2
|
||||
],
|
||||
[
|
||||
12,
|
||||
8
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
{
|
||||
"version": 8,
|
||||
"glyphs":"https://orangemug.github.io/font-glyphs/glyphs/{fontstack}/{range}.pbf",
|
||||
"sources": {
|
||||
"raster-tiles": {
|
||||
"type": "raster",
|
||||
"tiles": [
|
||||
"https://data.geopf.fr/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=ORTHOIMAGERY.ORTHOPHOTOS&STYLE=normal&FORMAT=image/jpeg&TILEMATRIXSET=PM&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}"
|
||||
],
|
||||
"tileSize": 256,
|
||||
"attribution": "<a target='_blank' href='https://geoservices.ign.fr/documentation/donnees/ortho/bdortho'>© IGN</a>"
|
||||
},
|
||||
"cadastre": {
|
||||
"type": "vector",
|
||||
"url": "https://openmaptiles.geo.data.gouv.fr/data/cadastre.json"
|
||||
},
|
||||
"decoupage-administratif": {
|
||||
"type": "vector",
|
||||
"url": "https://openmaptiles.geo.data.gouv.fr/data/decoupage-administratif.json"
|
||||
}
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"id": "simple-tiles",
|
||||
"type": "raster",
|
||||
"source": "raster-tiles"
|
||||
},
|
||||
{
|
||||
"id": "communes",
|
||||
"type": "line",
|
||||
"source": "decoupage-administratif",
|
||||
"source-layer": "communes",
|
||||
"minzoom": 2,
|
||||
"layout": {
|
||||
"line-join": "round",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "#ffffff",
|
||||
"line-width": {
|
||||
"base": 1.4,
|
||||
"stops": [
|
||||
[
|
||||
4,
|
||||
0.4
|
||||
],
|
||||
[
|
||||
5,
|
||||
1
|
||||
],
|
||||
[
|
||||
12,
|
||||
3
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "departements",
|
||||
"type": "line",
|
||||
"source": "decoupage-administratif",
|
||||
"source-layer": "departements",
|
||||
"maxzoom":9,
|
||||
"layout": {
|
||||
"line-join": "round",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "hsl(248, 7%, 66%)",
|
||||
"line-dasharray": [
|
||||
3,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"line-width": {
|
||||
"base": 1.4,
|
||||
"stops": [
|
||||
[
|
||||
0,
|
||||
0.6
|
||||
],
|
||||
[
|
||||
4,
|
||||
1.4
|
||||
],
|
||||
[
|
||||
5,
|
||||
2
|
||||
],
|
||||
[
|
||||
12,
|
||||
8
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "regions",
|
||||
"type": "line",
|
||||
"source": "decoupage-administratif",
|
||||
"source-layer": "regions",
|
||||
"maxzoom":5,
|
||||
"layout": {
|
||||
"line-join": "round",
|
||||
"visibility": "visible"
|
||||
},
|
||||
"paint": {
|
||||
"line-color": "hsl(248, 7%, 70%)",
|
||||
"line-dasharray": [
|
||||
3,
|
||||
1,
|
||||
1,
|
||||
1
|
||||
],
|
||||
"line-width": {
|
||||
"base": 1.6,
|
||||
"stops": [
|
||||
[
|
||||
0,
|
||||
0.6
|
||||
],
|
||||
[
|
||||
4,
|
||||
1.4
|
||||
],
|
||||
[
|
||||
5,
|
||||
2
|
||||
],
|
||||
[
|
||||
12,
|
||||
8
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
# JWE â ADR-001 & ADR-002 (format audit OKI)
|
||||
|
||||
Deux décisions d'architecture rédigées selon le format du prompt d'audit post-exécution : critÚres bloquants, preuves exigées, rapport tabulaire, interdits. Elles **ne modifient pas** le build v1 en cours ; elles cadrent la phase 2 et une optimisation perf.
|
||||
|
||||
---
|
||||
|
||||
# ADR-001 â Mode DĂ©fi : seed-link en v1, PlaySocketJS en phase 2 conditionnĂ©e
|
||||
|
||||
- **Statut** : Accepté (v1) / à étudier (v2, gate explicite)
|
||||
- **Date** : 2026-07-17
|
||||
- **Décideurs** : Architecte OKI
|
||||
- **Références** : PlaySocketJS (MIT, rooms, CRDT, server-authoritative, battle-tested >1,3 M duels sur 1 instance Node) ; Geoguess/Geoguess (modÚle de room sans compte, max 5 joueurs) ; prompt v2 §A5 (pas de comptes, pas de leaderboard serveur).
|
||||
|
||||
## Contexte
|
||||
|
||||
Le prompt v2 interdit comptes et leaderboard serveur. L'usage rĂ©el visĂ© (OKI, AKILPA, salles de classe, Ă©vĂ©nements) crĂ©e pourtant un besoin : **jouer les mĂȘmes 5 lieux que d'autres et comparer les scores**. Deux horizons : maintenant (zĂ©ro serveur) et plus tard (temps rĂ©el, si le projet prouve sa traction).
|
||||
|
||||
## Décision
|
||||
|
||||
**v1 â DĂ©fi asynchrone par lien Ă seed partagĂ©e.**
|
||||
- L'URL de dĂ©fi contient une seed opaque (ex. `/defi/<seed>`) ; le serveur (ou la fonction SvelteKit) dĂ©rive de la seed les mĂȘmes 5 lieux pour tous les joueurs (PRNG seedĂ© cĂŽtĂ© serveur, jamais cĂŽtĂ© client).
|
||||
- Aucune coordonnée dans l'URL ni dans le payload initial (anti-triche §6 du prompt v2 maintenu).
|
||||
- Fin de partie : l'image de partage canvas (déjà prévue prompt v2 §4.4) affiche le score ; la comparaison se fait humainement (screenshot dans le groupe WhatsApp/Signal). Zéro serveur d'état, zéro compte, cohérent doctrine.
|
||||
|
||||
**v2 â Duel temps rĂ©el via PlaySocketJS, UNIQUEMENT si le gate §"Conditions" est franchi.**
|
||||
- ModĂšle : rooms sans compte Ă la Geoguess (nom de room partagĂ©, 2â5 joueurs), Ă©tat synchronisĂ© par PlaySocketJS en mode **server-authoritative** (le serveur valide les guesses et calcule les scores â jamais le client).
|
||||
- HĂ©bergement : 1 instance Node sur le VPS OKI existant, dans l'enveloppe 40â50 âŹ/mois. Aucune dĂ©pendance Google/Firebase (contraire Ă Geoguess â voir annexe).
|
||||
|
||||
## Options considérées
|
||||
|
||||
| Option | Souveraineté | Coût serveur | Effort | Anti-triche | Verdict |
|
||||
|---|---|---|---|---|---|
|
||||
| Seed-link asynchrone (v1) | Totale | Nul | S | Serveur dérive les lieux, scores non comparés en ligne | **Retenu v1** |
|
||||
| PlaySocketJS rooms (v2) | Bonne (MIT, self-host) | 1 instance Node | M | Server-authoritative natif | **Retenu v2 si gate** |
|
||||
| Socket.io maison | Bonne | 1 instance Node | MâL | Ă rĂ©implĂ©menter | RejetĂ© (rĂ©invention) |
|
||||
| Supabase/Firebase Realtime | Mauvaise (cloud propriétaire) | Abonnement | M | Faible cÎté client | Rejeté (doctrine) |
|
||||
|
||||
## Conditions de dĂ©clenchement de la v2 (gate â bloquant)
|
||||
|
||||
La v2 n'est étudiée que si TOUTES les conditions suivantes sont remplies et documentées dans le rapport de gate :
|
||||
1. Traction mesurée : ℠30 parties/semaine pendant 4 semaines consécutives (mesure locale anonymisée, pas d'analytics tiers).
|
||||
2. Demande explicite : ℠5 retours d'utilisateurs ou partenaires (OKI, AKILPA, enseignants) demandant le défi en direct.
|
||||
3. CapacitĂ© d'hĂ©bergement confirmĂ©e sur le VPS OKI sans dĂ©passer l'enveloppe 40â50 âŹ/mois.
|
||||
|
||||
## Vérifications (obligatoires, preuves à l'appui)
|
||||
|
||||
- **V1 (bloquant, v1)** â DĂ©terminisme : la mĂȘme URL de dĂ©fi produit les mĂȘmes 5 lieux, dans le mĂȘme ordre, sur deux machines diffĂ©rentes. Preuve : double exĂ©cution filmĂ©e ou logs serveur.
|
||||
- **V2 (bloquant, v1)** â Anti-fuite : l'URL et les payloads initiaux ne contiennent ni coordonnĂ©es, ni commune, ni `wikidata_id` dĂ©codable. Preuve : inspection rĂ©seau + revue de l'URL.
|
||||
- **V3 (bloquant, v1)** â L'image de partage n'affiche que score/pseudo libre, jamais les rĂ©ponses des autres joueurs.
|
||||
- **V4 (bloquant, v2)** â POC PlaySocketJS : room Ă 3 clients, dĂ©connexion/reconnexion d'un joueur sans perte d'Ă©tat (CRDT), score validĂ© cĂŽtĂ© serveur (tentative de triche client rejetĂ©e â preuve par requĂȘte forgĂ©e).
|
||||
- **V5 (v2)** â Licence : `npm view playsocketjs license` = MIT, consignĂ© dans le rapport.
|
||||
- **V6 (v2)** â Charge : 10 rooms simultanĂ©es Ă 5 joueurs sur le VPS sans saturation (preuve : log ressources).
|
||||
|
||||
## Rapport (format obligatoire)
|
||||
|
||||
```
|
||||
| ID | Vérification | Méthode / Preuve | PASS/FAIL | Correctif appliqué |
|
||||
```
|
||||
|
||||
## Interdits
|
||||
|
||||
- Aucun compte utilisateur, aucun leaderboard global, aucun stockage de pseudos au-delĂ de la room.
|
||||
- Aucune dépendance Google/Firebase/Supabase pour le temps réel.
|
||||
- Aucune copie de code Geoguess/Geoguess (Vue.js) : référence de design uniquement.
|
||||
- La v2 ne doit pas régresser le hors-scope du prompt v2 pour le solo.
|
||||
|
||||
---
|
||||
|
||||
# ADR-002 â Carte SVG/topojson lĂ©gĂšre pour les Ă©crans hors-jeu (perf 4G)
|
||||
|
||||
- **Statut** : Accepté
|
||||
- **Date** : 2026-07-17
|
||||
- **RĂ©fĂ©rences** : composant carte SVG/topojson d'OpenGuessr Education (inspiration uniquement â licence MIT + Commons Clause = non-commercial, **aucune copie de code**) ; geo.api.gouv.fr (contours de communes GeoJSON, gratuit, sans clĂ© â testĂ© OK) ; prompt v2 §4.1 (lazy-load MapLibre) et §4.5 (perf).
|
||||
|
||||
## Contexte
|
||||
|
||||
MapLibre GL JS pÚse ~800 kB de JS avant la premiÚre tile. L'accueil, le récapitulatif final et les fiches « Aprann » n'ont pas besoin d'une carte interactive complÚte. Sur 4G caribéen, charger MapLibre sur ces écrans détruit le budget < 3 s du prompt v2.
|
||||
|
||||
## Décision
|
||||
|
||||
- Les écrans **hors-jeu** (accueil 4 régions, mini-carte du récapitulatif, vignette de fiche lieu) utilisent une **carte SVG statique** générée au build depuis un topojson des communes des 4 régions, projection précalculée, aucune tile, aucun JS carte.
|
||||
- MapLibre reste réservé aux écrans **de jeu** (devinette, résultat, explorer interactif) et reste lazy-loadé.
|
||||
- Pipeline donnĂ©es : contours communes via `geo.api.gouv.fr/communes?codeRegion=01|02|03|04&fields=nom,code,contour&format=json&geometry=contour` â simplification (mapshaper, seuil Ă calibrer) â topojson versionnĂ© dans le repo â composant Svelte SVG from scratch (MIT).
|
||||
|
||||
## Vérifications
|
||||
|
||||
- **V1 (bloquant)** â Budget poids : topojson simplifiĂ© des 4 rĂ©gions †150 kB gzippĂ© ; preuve : taille du fichier + `gzip -9` consignĂ©s. Si dĂ©passement : simplifier davantage ou dĂ©couper par rĂ©gion avec import dynamique.
|
||||
- **V2 (bloquant)** â LCP accueil < 2,5 s en throttling 4G (Lighthouse mobile, 3 runs, mĂ©diane consignĂ©e).
|
||||
- **V3** â Rendu sans JS : la carte SVG s'affiche en SSG avec JS dĂ©sactivĂ© ; chaque rĂ©gion est un `<a>` ou `<button>` rĂ©el (accessibilitĂ© clavier, lecteur d'Ă©cran : nom de rĂ©gion en FR + crĂ©ole).
|
||||
- **V4** â Attribution donnĂ©es : © contributeurs OpenStreetMap / rĂ©utilisation donnĂ©es publiques mentionnĂ©e dans le footer (licence ODbL pour les contours dĂ©rivĂ©s OSM le cas Ă©chĂ©ant).
|
||||
- **V5** â ZĂ©ro code copiĂ© d'OpenGuessr Education : revue de provenance, le composant est Ă©crit from scratch (licence MIT du projet).
|
||||
|
||||
## Rapport (format obligatoire)
|
||||
|
||||
```
|
||||
| ID | Vérification | Méthode / Preuve | PASS/FAIL | Correctif appliqué |
|
||||
```
|
||||
|
||||
## Interdits
|
||||
|
||||
- Ne pas charger MapLibre (ni son CSS) sur l'accueil ou le récapitulatif.
|
||||
- Ne pas embarquer de tuiles raster de substitution (le SVG est vectoriel pur).
|
||||
- Ne pas copier le code d'OpenGuessr Education (Commons Clause).
|
||||
|
||||
---
|
||||
|
||||
# Annexe â Ătude Geoguess/Geoguess (rĂ©fĂ©rence, 2026-07-17)
|
||||
|
||||
- **Projet** : clone GeoGuessr open source, solo + multijoueur par rooms (nom de room partagé, †5 joueurs), PWA, cartes custom GeoJSON, licence **MIT**.
|
||||
- **Stack** : Vue.js + Google Maps StreetView + Firebase â **non rĂ©utilisable** (doctrine zĂ©ro Google ; Vue â Svelte).
|
||||
- **Signal fort** : leur README admet que la dĂ©mo publique est limitĂ©e par le **prix de l'API Google** et renvoie vers l'auto-dĂ©ploiement avec clĂ© personnelle â justification directe du zĂ©ro propriĂ©taire OKI, Ă citer dans l'ADR d'architecture initial.
|
||||
- **Ă retenir** : (1) le modĂšle de room sans compte (base UX de l'ADR-001 v2) ; (2) le repo **GeoGuess-Maps**, liste de cartes communautaires â modĂšle pour les futurs map-packs JWE contribuĂ©s par la communautĂ© OKI/AKILPA via PR, sans CMS.
|
||||
@@ -0,0 +1,81 @@
|
||||
# Mission : JWE â Audit post-exĂ©cution, vĂ©rifications obligatoires & recommandations
|
||||
|
||||
## à exécuter par chaque agent à la fin de sa tùche, avant de la marquer « terminée »
|
||||
|
||||
La refonte JWE a été produite à partir du prompt de mission v2 (Svelte 5 + SvelteKit 2, MapLibre, SQLite, 4 régions : Guadeloupe, Martinique, Guyane, La Réunion). Cet audit est la seconde passe. **Aucune tùche n'est terminée sans son rapport de vérification** (format §6). Un FAIL non résolu bloque la livraison. Si le correctif dépasse le scope de l'agent, l'agent produit une RECOMMANDATION argumentée au lieu de coder.
|
||||
|
||||
---
|
||||
|
||||
## 0. Faits Ă©tablis (Ă lire avant tout â ils corrigent le prompt v2)
|
||||
|
||||
1. **Le QID d'exemple du prompt v2 Ă©tait faux** : Fort DelgrĂšs = `Q3077840` (vĂ©rifiĂ©), pas `Q2216838`. Ses coordonnĂ©es officielles sont 15°59âČ19âłN, 61°43âČ23âłO (â 15.9886, -61.7231), pas (16.0036, -61.7319). Si le seed ou l'exemple a Ă©tĂ© copiĂ© tel quel, corriger.
|
||||
2. **Principe absolu : fetch, pas recall.** Tout QID, toute coordonnĂ©e, toute URL photo, toute licence doit ĂȘtre vĂ©rifiĂ© par une requĂȘte rĂ©elle, jamais depuis la mĂ©moire du modĂšle.
|
||||
3. **Les communes de Guyane sont immenses** (Maripasoula â 18 000 kmÂČ, Saint-Laurent-du-Maroni â 4 800 kmÂČ). Un radius de score fixe par difficultĂ© y est injuste.
|
||||
4. **La Réunion est à ~12 000 km des Antilles** : un `maxBounds` global couvrant les 4 régions rend une carte inutilisable (95 % d'océan), et un zoom automatique sur la région du lieu au début du round révÚle la réponse.
|
||||
5. **Un lieu sans page Wikipedia a rarement une photo sur Wikimedia Commons** : le piÚge « 2-3 lieux sans article frwiki avec photo libre » exige des photos propres (collectif OKI) ou Panoramax.
|
||||
|
||||
---
|
||||
|
||||
## 1. Agent Contenu â vĂ©rifications donnĂ©es
|
||||
|
||||
- **C1 â QID valides (bloquant).** Pour CHAQUE lieu avec `wikidata_id` non null :
|
||||
```
|
||||
curl "https://www.wikidata.org/w/api.php?action=wbgetentities&ids=<QID>&props=sitelinks|labels&languages=fr&format=json" -H "User-Agent: JWE-OKI/1.0"
|
||||
```
|
||||
Le sitelink `frwiki` doit exister et correspondre au lieu (comparer le label). Preuve : tableau `lieu â QID â sitelink frwiki â OK/KO` dans le rapport.
|
||||
- **C2 â Les « null » sont de vrais null (bloquant).** Pour chaque lieu Ă `wikidata_id: null` intentionnel, prouver par une recherche API (`action=query&list=search` sur frwiki) qu'aucun article frwiki n'existe. Sinon le lieu ne teste pas le Cas B.
|
||||
- **C3 â CoordonnĂ©es prĂ©cises.** Ăcart < 500 m avec la source officielle (Wikidata `P625`, IGN, geo.api.gouv.fr). Corriger le seed Fort DelgrĂšs (voir §0.1).
|
||||
- **C4 â Photos sans fuite.** (a) Noms de fichiers opaques (`uuid.webp`, jamais `fort-delgres.webp` â le nom ne doit pas rĂ©vĂ©ler la rĂ©ponse dans les devtools). (b) EXIF strippĂ©s : preuve `exiftool <fichier>` sans GPS ni appareil. (c) Licence vĂ©rifiable : page de description Commons atteignable, crĂ©dit et licence exacts dans le JSON.
|
||||
- **C5 â Photos des lieux « null ».** Source documentĂ©e : photo propre OKI (crĂ©dit collectif) ou Panoramax (instance + ID + licence). Si introuvable : remplacer le lieu, ne jamais garder une photo sans licence claire.
|
||||
|
||||
## 2. Agent Architecte â vĂ©rifications dĂ©cisions
|
||||
|
||||
- **A1 â Score juste en Guyane (bloquant).** VĂ©rifier que la formule utilise un radius effectif : `radius_eff = max(radius_difficultĂ©, rayon_commune)` avec `rayon_commune â sqrt(aire_commune / Ï)`. L'aire peut ĂȘtre prĂ©calculĂ©e dans le JSON du lieu (champ `aire_commune_km2`) ou dĂ©rivĂ©e du contour geo.api.gouv.fr. Test Ă produire : un guess Ă 40 km du chef-lieu de Maripasoula ne doit pas ĂȘtre quasi-nul.
|
||||
- **A2 â Pas de fuite de rĂ©gion (bloquant).** Au dĂ©but d'un round, la camĂ©ra ne doit rĂ©vĂ©ler ni la rĂ©gion ni la commune du lieu. Si la solution retenue est la devinette en deux temps (choix de la rĂ©gion via 4 boutons â zoom â placement du marqueur), vĂ©rifier que le scoring combine les deux Ă©tapes et que c'est documentĂ© dans l'ADR. Si une autre solution a Ă©tĂ© codĂ©e, vĂ©rifier l'absence de fuite et l'usage mobile.
|
||||
- **A3 â ChaĂźne Wikipedia exacte.** `wbgetentities(props=sitelinks)` â titre frwiki â `fr.wikipedia.org/api/rest_v1/page/summary/{titre}`. Cache â„ 24 h (pas de « temps rĂ©el »). User-Agent explicite cĂŽtĂ© proxy. Fallback de langue documentĂ© : fr â en. **Cas intermĂ©diaire tranchĂ© et documentĂ©** : QID existant mais pas d'article frwiki â recommandĂ© : afficher le Cas B variante « pas encore d'article en français â et si tu le traduisais/crĂ©ais ? ».
|
||||
- **A4 â DĂ©cision Strapi vs SvelteKit.** L'ADR doit appliquer le critĂšre du prompt (contributeurs non-devs ?). En l'absence de contributeurs non-devs aujourd'hui, la cohĂ©rence doctrine OKI = SvelteKit seul + JSON versionnĂ© + script de validation au commit. Si Strapi a Ă©tĂ© retenu, l'ADR doit justifier par des contributeurs rĂ©els identifiĂ©s.
|
||||
- **A5 â Hors scope respectĂ©.** Pas de comptes utilisateurs, pas de leaderboard serveur, pas de multijoueur. Scores en `localStorage`. Tout Ă©cart = FAIL ou RECOMMANDATION de suppression.
|
||||
|
||||
## 3. Agent Back-end â vĂ©rifications (si applicable)
|
||||
|
||||
- **B1 â Endpoint lieu alĂ©atoire sans fuite (bloquant).** Preuve `curl` : la rĂ©ponse ne contient ni `coordonnees`, ni `commune`, ni indice de rĂ©gion ; URL photo opaque.
|
||||
- **B2 â Score calculĂ© cĂŽtĂ© serveur (bloquant).** Le client envoie `{lieu_id, lat, lon, rĂ©gion_choisie?, indices_utilisĂ©s, temps}` ; le serveur calcule (formule A1) et renvoie score + distance + coordonnĂ©es rĂ©elles. Le client ne calcule rien.
|
||||
- **B3 â Proxy Wikipedia.** Cache effectif (headers ou store, TTL â„ 24 h), User-Agent conforme, **aucun texte d'article stockĂ© en base** (contrainte §2.3 du prompt v2).
|
||||
- **B4 â Pas de dĂ©pendance propriĂ©taire.** Audit `package.json` : zĂ©ro clĂ© API payante, zĂ©ro Google/Mapbox, tĂ©lĂ©mĂ©trie dĂ©sactivĂ©e.
|
||||
|
||||
## 4. Agent Front-end â vĂ©rifications
|
||||
|
||||
- **F1 â Carte.** Bounds effectifs, aucune fuite de rĂ©gion (voir A2), MapLibre lazy-loadĂ© (vĂ©rifier le chunk rĂ©seau : pas de JS MapLibre sur l'accueil), boutons zoom visibles, navigation clavier.
|
||||
- **F2 â Cas A / Cas B (bloquant).** Les deux Ă©crans de rĂ©sultat sont **visuellement distincts** (couleur, icĂŽne), le message de lacune est prĂ©sent en FR **et** en crĂ©ole, et le CTA « KontribyĂ© sou WikipĂ©dia » ouvre bien l'Ă©diteur/recherche prĂ©-remplie ou le guide OKI. Captures Ă l'appui.
|
||||
- **F3 â Cas intermĂ©diaire gĂ©rĂ©.** QID prĂ©sent mais pas d'article frwiki : pas d'Ă©cran vide ni d'erreur console ; comportement conforme Ă la dĂ©cision A3.
|
||||
- **F4 â Ăcran rĂ©sultat enrichi.** Si le contour de commune est intĂ©grĂ© (geo.api.gouv.fr, gratuit sans clĂ© : `https://geo.api.gouv.fr/communes?code=<insee>&fields=nom,contour&format=json&geometry=contour`), vĂ©rifier l'affichage du polygone et le respect de `prefers-reduced-motion` sur l'animation du marqueur.
|
||||
- **F5 â Doctrine OKI.** Une seule action primaire par Ă©cran ; bouton Valider en zone du pouce sur mobile ; timer non anxiogĂšne ; micro-interactions en crĂ©ole ; style carte non-Google.
|
||||
- **F6 â Performance 4G caribĂ©en.** Premier Ă©cran < 3 s en throttling 4G ; photos WebP/AVIF avec `srcset` et lazy loading ; poids d'un round (hors tiles) mesurĂ© et indiquĂ© dans le rapport.
|
||||
|
||||
## 5. Agent QA â passe finale
|
||||
|
||||
- **Q1 â Rejouer les bloquants.** C1, C2, A1, A2, B1, B2, F2 au minimum, avec preuves.
|
||||
- **Q2 â Partie complĂšte** dans chaque mode (KonnĂšt moniman, Kote mwen ye ?, DĂ©fi 5 rounds, Aprann), mobile et desktop, dont au moins un round tombant sur un lieu Cas B et un lieu guyanais.
|
||||
- **Q3 â Checklist OKI du prompt v2 §4 (Agent IntĂ©gration & QA)** intĂ©gralement passĂ©e.
|
||||
- **Q4 â Scope creep.** Signaler toute feature absente du prompt v2 (auth, comptes, partage rĂ©seau social, analyticsâŠ).
|
||||
- **Q5 â Core Web Vitals** mobile 4G mesurĂ©s (LCP, INP, CLS) et consignĂ©s.
|
||||
|
||||
---
|
||||
|
||||
## 6. Format du rapport de vérification (obligatoire, un par agent)
|
||||
|
||||
```
|
||||
| ID | VĂ©rification | MĂ©thode / Preuve (commande, requĂȘte, capture) | PASS/FAIL | Correctif appliquĂ© |
|
||||
|----|--------------|-----------------------------------------------|-----------|--------------------|
|
||||
```
|
||||
|
||||
Suivi d'une section **Recommandations** pour tout ce qui dépasse le scope, triée : `bloquant` / `important` / `confort`, avec pour chacune : problÚme, solution proposée, effort estimé (S/M/L), fichier(s) concerné(s).
|
||||
|
||||
Commits atomiques préfixés : `verify:` (preuves), `fix:` (correctifs), `docs:` (ADR, rapport).
|
||||
|
||||
## 7. Interdits pendant l'audit
|
||||
|
||||
- Aucune nouvelle feature (l'audit corrige et recommande, il n'étend pas).
|
||||
- Aucun refactor hors correctif de FAIL.
|
||||
- Aucun PASS sans preuve exécutable ou capture.
|
||||
- Ne pas « rĂ©parer » une donnĂ©e (QID, coordonnĂ©e, licence) depuis la mĂ©moire : requĂȘte rĂ©elle ou suppression du lieu.
|
||||
Reference in New Issue
Block a user