-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5f319e9
commit 41bae67
Showing
26 changed files
with
481 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/i18n/ | ||
/node_modules/ | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"root": true, | ||
"extends": [ | ||
"wikimedia/server" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "composer" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
- "!**dependabot/**" | ||
- "!**release-please--**" | ||
pull_request: | ||
branches: | ||
- "**" | ||
- "!**dependabot/**" | ||
- "!**release-please--**" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: /home/runner/cache | ||
key: ${{ runner.os }}-${{ hashFiles('**/*.lock') }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer validate | ||
composer install --prefer-dist --no-progress | ||
npm install --save-dev | ||
# Check for changed files | ||
- name: Check for PHP changes | ||
id: changed-php | ||
uses: tj-actions/changed-files@v45 | ||
with: | ||
since_last_remote_commit: "true" | ||
files: | | ||
includes/**/*.php | ||
- name: Check for script changes | ||
id: changed-script | ||
uses: tj-actions/changed-files@v45 | ||
with: | ||
since_last_remote_commit: "true" | ||
files: | | ||
resources/**/*.js | ||
- name: Check for stylesheet changes | ||
id: changed-stylesheet | ||
uses: tj-actions/changed-files@v45 | ||
with: | ||
since_last_remote_commit: "true" | ||
files: | | ||
resources/**/*.css | ||
resources/**/*.less | ||
- name: Check for i18n changes | ||
id: changed-i18n | ||
uses: tj-actions/changed-files@v45 | ||
with: | ||
since_last_remote_commit: "true" | ||
files: | | ||
i18n/*.json | ||
# Bypass the phpcbf non-standard exit code | ||
- name: Lint PHP | ||
if: steps.changed-php.outputs.any_changed == 'true' | ||
continue-on-error: true | ||
run: | | ||
sh ./bin/phpcbf.sh | ||
composer fix | ||
composer test | ||
- name: Lint script | ||
if: steps.changed-script.outputs.any_changed == 'true' | ||
continue-on-error: true | ||
run: | | ||
npm run lint:fix:js | ||
npm run lint:js | ||
- name: Lint stylesheet | ||
if: steps.changed-stylesheet.outputs.any_changed == 'true' | ||
continue-on-error: true | ||
run: | | ||
npm run lint:fix:styles | ||
npm run lint:styles | ||
- name: Lint i18n | ||
if: steps.changed-i18n.outputs.any_changed == 'true' | ||
continue-on-error: true | ||
run: | | ||
npm run lint:i18n | ||
# Only patch code when it is a push event | ||
- name: Push the changes | ||
if: github.event_name == 'push' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
if ! git diff --exit-code --quiet; then | ||
git config --global user.name "github-actions" | ||
git config --global user.email "[email protected]" | ||
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" | ||
git add . | ||
git commit -am "ci: 👷 lint code to MediaWiki standards" -m "Check commit and GitHub actions for more details" | ||
git pull --rebase | ||
git push | ||
else | ||
echo "No changes to commit" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
name: release-please | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: googleapis/release-please-action@v4 | ||
with: | ||
token: ${{ secrets.WORKFLOW_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/composer.lock | ||
/vendor | ||
/node_modules | ||
.eslintcache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?php | ||
|
||
return require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0"?> | ||
<ruleset> | ||
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" /> | ||
<file>.</file> | ||
<arg name="extensions" value="php"/> | ||
<arg name="encoding" value="UTF-8"/> | ||
<exclude-pattern>*/vendor/*</exclude-pattern> | ||
<exclude-pattern>*/out/*</exclude-pattern> | ||
</ruleset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
".": "0.0.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": [ | ||
"stylelint-config-idiomatic-order", | ||
"stylelint-config-wikimedia" | ||
], | ||
"rules": { | ||
"selector-max-id": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The development of this software is covered by a [Code of Conduct](https://www.mediawiki.org/wiki/Special:MyLanguage/Code_of_Conduct). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?php | ||
$magicWords = []; | ||
|
||
/** English (English) */ | ||
$magicWords['en'] = [ | ||
'floatingui' => [ 0, 'floatingui' ] | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# FloatingUI | ||
|
||
The FloatingUI extension implements [Floating UI](https://floating-ui.com) library in MediaWiki. | ||
|
||
[Extension:FloatingUI on MediaWiki](https://www.mediawiki.org/wiki/Extension:FloatingUI). | ||
|
||
## Requirements | ||
* [MediaWiki](https://www.mediawiki.org) 1.39 or later | ||
|
||
## Installation | ||
You can get the extension via Git (specifying FloatingUI as the destination directory): | ||
|
||
git clone https://github.com/StarCitizenTools/mediawiki-extensions-FloatingUI.git FloatingUI | ||
|
||
Or [download it as zip archive](https://github.com/StarCitizenTools/mediawiki-extensions-FloatingUI/archive/main.zip). | ||
|
||
In either case, the "FloatingUI" extension should end up in the "extensions" directory | ||
of your MediaWiki installation. If you got the zip archive, you will need to put it | ||
into a directory called FloatingUI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Force phpcbf to exit with zero | ||
# See https://github.com/squizlabs/PHP_CodeSniffer/issues/1818#issuecomment-354420927 | ||
|
||
root=$( dirname $0 )/.. | ||
|
||
$root/vendor/bin/phpcbf | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{ | ||
"name": "starcitizentools/floating-ui", | ||
"type": "mediawiki-extension", | ||
"description": "Implements the FloatingUI Javascript library.", | ||
"keywords": [ | ||
"MediaWiki", | ||
"FloatingUI", | ||
"extension" | ||
], | ||
"homepage": "https://www.mediawiki.org/wiki/Extension:FloatingUI", | ||
"readme": "README.md", | ||
"license": "GPL-3.0-or-later", | ||
"authors": [ | ||
{ | ||
"name": "alistair3149", | ||
"email": "[email protected]", | ||
"role": "Developer" | ||
} | ||
], | ||
"support": { | ||
"forum": "https://www.mediawiki.org/wiki/Extension_talk:FloatingUI", | ||
"wiki": "https://www.mediawiki.org/wiki/Extension:FloatingUI", | ||
"source": "https://github.com/StarCitizenTools/mediawiki-extensions-FloatingUI" | ||
}, | ||
"require": { | ||
"composer/installers": ">=1.0.1" | ||
}, | ||
"require-dev": { | ||
"mediawiki/mediawiki-codesniffer": "44.0.0", | ||
"mediawiki/mediawiki-phan-config": "0.14.0", | ||
"mediawiki/minus-x": "1.1.3", | ||
"php-parallel-lint/php-console-highlighter": "1.0.0", | ||
"php-parallel-lint/php-parallel-lint": "1.4.0" | ||
}, | ||
"scripts": { | ||
"fix": [ | ||
"minus-x fix .", | ||
"phpcbf" | ||
], | ||
"test": [ | ||
"parallel-lint . --exclude vendor --exclude node_modules", | ||
"phpcs --config-set ignore_warnings_on_exit 1", | ||
"phpcs -p -s", | ||
"minus-x check ." | ||
], | ||
"phan": "phan -d . --long-progress-bar" | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"composer/installers": true, | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
{ | ||
"name": "FloatingUI", | ||
"version": "0.0.1", | ||
"author": [ | ||
"alistair3149" | ||
], | ||
"url": "https://www.mediawiki.org/wiki/Extension:FloatingUI", | ||
"descriptionmsg": "floatingui-desc", | ||
"type": "parserhook", | ||
"license-name": "GPL-3.0-or-later", | ||
"requires": { | ||
"MediaWiki": ">= 1.39.0" | ||
}, | ||
"MessagesDirs": { | ||
"FloatingUI": [ | ||
"/i18n" | ||
] | ||
}, | ||
"ExtensionMessagesFiles": { | ||
"FloatingUIMagic": "FloatingUI.magic.php" | ||
}, | ||
"AutoloadNamespaces": { | ||
"MediaWiki\\Extension\\FloatingUI\\": "includes/" | ||
}, | ||
"ResourceModules": { | ||
"ext.floatingUI.lib": { | ||
"scripts": [ | ||
"ext.floatingUI.lib/core.js", | ||
"ext.floatingUI.lib/dom.js" | ||
] | ||
} | ||
}, | ||
"ResourceFileModulePaths": { | ||
"localBasePath": "modules", | ||
"remoteExtPath": "FloatingUI/modules" | ||
}, | ||
"Hooks": { | ||
"ParserFirstCallInit": "parser" | ||
}, | ||
"HookHandlers": { | ||
"parser": { | ||
"class": "MediaWiki\\Extension\\FloatingUI\\Hooks" | ||
} | ||
}, | ||
"attributes": { | ||
"CodeMirror": { | ||
"TagModes": { | ||
"floatingui": "text/mediawiki" | ||
} | ||
} | ||
}, | ||
"manifest_version": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"@metadata": { | ||
"authors": [ | ||
"alistair3149" | ||
] | ||
}, | ||
"floatingui-desc": "Implements the FloatingUI Javascript library." | ||
} |
Oops, something went wrong.