Skip to content

Commit c030f2e

Browse files
authored
Merge pull request #25 from nextcloud/enh/noid/vue3
Migrate to vue3 and nc/vue 9
2 parents ad77da8 + 3cf0da9 commit c030f2e

22 files changed

+4281
-1330
lines changed

.github/workflows/lint-eslint.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Lint eslint
10+
11+
on: pull_request
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: lint-eslint-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
changes:
22+
runs-on: ubuntu-latest
23+
permissions:
24+
contents: read
25+
pull-requests: read
26+
27+
outputs:
28+
src: ${{ steps.changes.outputs.src}}
29+
30+
steps:
31+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
32+
id: changes
33+
continue-on-error: true
34+
with:
35+
filters: |
36+
src:
37+
- '.github/workflows/**'
38+
- 'src/**'
39+
- 'appinfo/info.xml'
40+
- 'package.json'
41+
- 'package-lock.json'
42+
- 'tsconfig.json'
43+
- '.eslintrc.*'
44+
- '.eslintignore'
45+
- '**.js'
46+
- '**.ts'
47+
- '**.vue'
48+
49+
lint:
50+
runs-on: ubuntu-latest
51+
52+
needs: changes
53+
if: needs.changes.outputs.src != 'false'
54+
55+
name: NPM lint
56+
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
60+
with:
61+
persist-credentials: false
62+
63+
- name: Read package.json node and npm engines version
64+
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
65+
id: versions
66+
with:
67+
fallbackNode: '^20'
68+
fallbackNpm: '^10'
69+
70+
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
71+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
72+
with:
73+
node-version: ${{ steps.versions.outputs.nodeVersion }}
74+
75+
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
76+
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
77+
78+
- name: Install dependencies
79+
env:
80+
CYPRESS_INSTALL_BINARY: 0
81+
PUPPETEER_SKIP_DOWNLOAD: true
82+
run: npm ci
83+
84+
- name: Lint
85+
run: npm run lint
86+
87+
summary:
88+
permissions:
89+
contents: none
90+
runs-on: ubuntu-latest
91+
needs: [changes, lint]
92+
93+
if: always()
94+
95+
# This is the summary, we just avoid to rename it so that branch protection rules still match
96+
name: eslint
97+
98+
steps:
99+
- name: Summary status
100+
run: if ${{ needs.changes.outputs.src != 'false' && needs.lint.result != 'success' }}; then exit 1; fi

.github/workflows/lint-php-cs.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
6+
name: Lint php-cs
7+
8+
on:
9+
push:
10+
branches: [ main, test ]
11+
paths:
12+
- 'lib/**'
13+
- 'templates/**'
14+
- 'tests/**'
15+
- 'vendor/**'
16+
- 'vendor-bin/**'
17+
- composer.lock
18+
- composer.json
19+
pull_request:
20+
paths:
21+
- 'lib/**'
22+
- 'templates/**'
23+
- 'tests/**'
24+
- 'vendor/**'
25+
- 'vendor-bin/**'
26+
- composer.lock
27+
- composer.json
28+
29+
permissions:
30+
contents: read
31+
32+
concurrency:
33+
group: lint-php-cs-${{ github.head_ref || github.run_id }}
34+
cancel-in-progress: true
35+
36+
jobs:
37+
lint:
38+
runs-on: ubuntu-latest
39+
40+
name: php-cs
41+
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
45+
46+
- name: Set up php
47+
uses: shivammathur/setup-php@c5fc0d8281aba02c7fda07d3a70cc5371548067d # v2
48+
with:
49+
php-version: 8.2
50+
coverage: none
51+
ini-file: development
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
55+
- name: Install dependencies
56+
run: composer i
57+
58+
- name: Lint
59+
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )

.github/workflows/phpunit.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: PHPUnit
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/phpunit.yml
7+
- appinfo/**
8+
- composer.*
9+
- lib/**
10+
- templates/**
11+
- tests/**
12+
push:
13+
branches:
14+
- main
15+
- stable*
16+
- test
17+
paths:
18+
- .github/workflows/phpunit.yml
19+
- appinfo/**
20+
- composer.*
21+
- lib/**
22+
- templates/**
23+
- tests/**
24+
25+
env:
26+
APP_NAME: users_picker
27+
28+
jobs:
29+
php:
30+
runs-on: ubuntu-latest
31+
32+
strategy:
33+
# do not stop on another job's failure
34+
fail-fast: false
35+
matrix:
36+
php-versions: ['8.3']
37+
databases: ['sqlite']
38+
server-versions: ['master']
39+
40+
name: php${{ matrix.php-versions }}-${{ matrix.databases }}-${{ matrix.server-versions }}
41+
42+
steps:
43+
- name: Checkout server
44+
uses: actions/checkout@v2
45+
with:
46+
repository: nextcloud/server
47+
ref: ${{ matrix.server-versions }}
48+
submodules: true
49+
50+
- name: Checkout app
51+
uses: actions/checkout@v2
52+
with:
53+
path: apps/${{ env.APP_NAME }}
54+
55+
- name: Set up php ${{ matrix.php-versions }}
56+
uses: shivammathur/setup-php@v2
57+
with:
58+
php-version: ${{ matrix.php-versions }}
59+
tools: phpunit
60+
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, gd, zip
61+
62+
- name: Set up PHPUnit
63+
working-directory: apps/${{ env.APP_NAME }}
64+
run: composer i
65+
66+
- name: Set up Nextcloud
67+
run: |
68+
mkdir data
69+
./occ maintenance:install --verbose --database=sqlite --admin-user admin --admin-pass admin
70+
./occ app:enable --force ${{ env.APP_NAME }}
71+
72+
- name: PHPUnit
73+
working-directory: apps/${{ env.APP_NAME }}
74+
run: composer run test:unit

.github/workflows/psalm-matrix.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2022-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Static analysis
10+
11+
on: pull_request
12+
13+
concurrency:
14+
group: psalm-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
matrix:
22+
runs-on: ubuntu-latest-low
23+
outputs:
24+
ocp-matrix: ${{ steps.versions.outputs.ocp-matrix }}
25+
steps:
26+
- name: Checkout app
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
with:
29+
persist-credentials: false
30+
31+
- name: Get version matrix
32+
id: versions
33+
uses: icewind1991/nextcloud-version-matrix@58becf3b4bb6dc6cef677b15e2fd8e7d48c0908f # v1.3.1
34+
35+
- name: Check enforcement of minimum PHP version ${{ steps.versions.outputs.php-min }} in psalm.xml
36+
run: grep 'phpVersion="${{ steps.versions.outputs.php-min }}' psalm.xml
37+
38+
static-analysis:
39+
runs-on: ubuntu-latest
40+
needs: matrix
41+
strategy:
42+
# do not stop on another job's failure
43+
fail-fast: false
44+
matrix: ${{ fromJson(needs.matrix.outputs.ocp-matrix) }}
45+
46+
name: static-psalm-analysis ${{ matrix.ocp-version }}
47+
steps:
48+
- name: Checkout
49+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
50+
with:
51+
persist-credentials: false
52+
53+
- name: Set up php${{ matrix.php-min }}
54+
uses: shivammathur/setup-php@ec406be512d7077f68eed36e63f4d91bc006edc4 # v2.35.4
55+
with:
56+
php-version: ${{ matrix.php-min }}
57+
extensions: bz2, ctype, curl, dom, fileinfo, gd, iconv, intl, json, libxml, mbstring, openssl, pcntl, posix, session, simplexml, xmlreader, xmlwriter, zip, zlib, sqlite, pdo_sqlite
58+
coverage: none
59+
ini-file: development
60+
# Temporary workaround for missing pcntl_* in PHP 8.3
61+
ini-values: disable_functions=
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
65+
- name: Install dependencies
66+
run: |
67+
composer remove nextcloud/ocp --dev --no-scripts
68+
composer i
69+
70+
- name: Check for vulnerable PHP dependencies
71+
run: composer require --dev roave/security-advisories:dev-latest
72+
73+
- name: Install dependencies # zizmor: ignore[template-injection]
74+
run: composer require --dev 'nextcloud/ocp:${{ matrix.ocp-version }}' --ignore-platform-reqs --with-dependencies
75+
76+
- name: Run coding standards check
77+
run: composer run psalm -- --threads=1 --monochrome --no-progress --output-format=github
78+
79+
summary:
80+
runs-on: ubuntu-latest-low
81+
needs: static-analysis
82+
83+
if: always()
84+
85+
name: static-psalm-analysis-summary
86+
87+
steps:
88+
- name: Summary status
89+
run: if ${{ needs.static-analysis.result != 'success' }}; then exit 1; fi

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
.vscode/
66
.vscode-upload.json
77
.*.sw*
8-
node_modules
8+
node_modules
9+
/vendor
10+
/.php*.cache

.php-cs-fixer.dist.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
require_once './vendor/autoload.php';
5+
6+
use Nextcloud\CodingStandard\Config;
7+
8+
$config = new Config();
9+
$config
10+
->getFinder()
11+
->notPath('build')
12+
->notPath('l10n')
13+
->notPath('src')
14+
->notPath('node_modules')
15+
->notPath('vendor')
16+
->in(__DIR__);
17+
return $config;

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
<screenshot>https://raw.githubusercontent.com/nextcloud/users_picker/main/screenshots/users_picker_2.png</screenshot>
2020
<screenshot>https://raw.githubusercontent.com/nextcloud/users_picker/main/screenshots/users_picker_3.png</screenshot>
2121
<dependencies>
22-
<nextcloud min-version="30" max-version="32"/>
22+
<nextcloud min-version="30" max-version="33"/>
2323
</dependencies>
2424
</info>

composer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "nextcloud/users_picker",
3+
"authors": [
4+
{
5+
"name": "Julien Veyssier",
6+
"email": "julien-nc@posteo.net"
7+
}
8+
],
9+
"require": {
10+
"php": "^8.2"
11+
},
12+
"scripts": {
13+
"lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l",
14+
"cs:check": "php-cs-fixer fix --dry-run --diff",
15+
"cs:fix": "php-cs-fixer fix",
16+
"psalm": "psalm.phar --no-cache",
17+
"psalm:update-baseline": "psalm.phar --threads=1 --update-baseline",
18+
"psalm:update-baseline:force": "psalm.phar --threads=1 --update-baseline --set-baseline=tests/psalm-baseline.xml",
19+
"test:unit": "phpunit --config tests/phpunit.xml"
20+
},
21+
"require-dev": {
22+
"nextcloud/coding-standard": "^1.1",
23+
"nextcloud/ocp": "dev-master",
24+
"phpunit/phpunit": "^9.5",
25+
"psalm/phar": "^6.13"
26+
},
27+
"config": {
28+
"sort-packages": true,
29+
"optimize-autoloader": true,
30+
"platform": {
31+
"php": "8.2"
32+
},
33+
"autoloader-suffix": "UsersPicker"
34+
}
35+
}

0 commit comments

Comments
 (0)