diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 86b67ce..5882018 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,7 +34,6 @@ jobs: - name: Build Client run: | npm run build - npm run minify - name: Patch templates run: | mkdir -p adminsortable2/templates/adminsortable2/edit_inline diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f0b4e3c..718e1a7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,7 +45,6 @@ jobs: - name: Build Client run: | npm run build - npm run minify - name: Patch templates run: | mkdir -p adminsortable2/templates/adminsortable2/edit_inline @@ -59,4 +58,5 @@ jobs: done - name: Test with pytest run: | + mkdir -p workdir python -m pytest testapp diff --git a/.gitignore b/.gitignore index 704d99d..2416619 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,6 @@ *.pot *.pyc *.egg-info -*.sqlite3 *.coverage *.tsbuildinfo *~ @@ -17,6 +16,7 @@ build docs/_build dist node_modules/ +workdir/* htmlcov adminsortable2/static/adminsortable2/js/adminsortable2.* adminsortable2/templates/adminsortable2/edit_inline diff --git a/CHANGELOG.md b/CHANGELOG.md index 647b26f..2e1221e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Release history of [django-admin-sortable2](https://github.com/jrief/django-admin-sortable2/) +### 2.1.11 +- Upgrade all external dependencies to their latest versions. +- Adopt E2E tests to use Playwright's `locator`. + ### 2.1.10 - Do not create sourcemaps in production build. diff --git a/adminsortable2/__init__.py b/adminsortable2/__init__.py index 3087de1..cc222ab 100644 --- a/adminsortable2/__init__.py +++ b/adminsortable2/__init__.py @@ -1 +1 @@ -__version__ = '2.1.10' +__version__ = '2.1.11' diff --git a/client/build.cjs b/client/build.cjs index 63a7898..7741774 100644 --- a/client/build.cjs +++ b/client/build.cjs @@ -1,11 +1,14 @@ const { build } = require('esbuild'); +const buildOptions = require('yargs-parser')(process.argv.slice(2), { + boolean: ['debug'], +}); build({ entryPoints: ['client/admin-sortable2.ts'], bundle: true, - minify: false, - outfile: 'adminsortable2/static/adminsortable2/js/adminsortable2.js', + minify: !buildOptions.debug, + sourcemap: buildOptions.debug, + outfile: 'adminsortable2/static/adminsortable2/js/adminsortable2' + (buildOptions.debug ? '' : '.min') + '.js', plugins: [], - sourcemap: false, target: ['es2020', 'chrome84', 'firefox84', 'safari14', 'edge84'] }).catch(() => process.exit(1)); diff --git a/docs/source/contributing.rst b/docs/source/contributing.rst index 9cee5cb..e8563fb 100644 --- a/docs/source/contributing.rst +++ b/docs/source/contributing.rst @@ -19,22 +19,23 @@ Writing Code Before hacking into the code, adopt your IDE to respect the projects's `.editorconfig`_ file. When installing from GitHub, you *must* build the JavaScript client using the esbuild_ TypeScript -compiler: +compiler. Ensure that you have a recent version of NodeJS (18+) installed. Then run the following +commands: .. code-block:: shell git clone https://github.com/jrief/django-admin-sortable2.git cd django-admin-sortable2 - npm install --also=dev + npm install --include=dev npm run build - # and optionally for a minimized version - npm run minify + # for an unminimized version including a sourcemap, run + npm run build -- --debug This then builds and bundles the JavaScript file -``adminsortable2/static/adminsortable2/js/adminsortable2.js`` which later on is imported by the -sortable-admin mixin classes. The minimized version can be imported as -``adminsortable2/static/adminsortable2/js/adminsortable2.min.js`` +``adminsortable2/static/adminsortable2/js/adminsortable2.min.js`` which later on is imported by the +sortable-admin mixin classes. The unminimized version can be imported as +``adminsortable2/static/adminsortable2/js/adminsortable2.js`` .. _.editorconfig: https://editorconfig.org/ .. _esbuild: https://esbuild.github.io/ diff --git a/package-lock.json b/package-lock.json index 8b1d346..814c00b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,148 +1,756 @@ { "name": "django-admin-sortable2", + "lockfileVersion": 2, "requires": true, - "lockfileVersion": 1, - "dependencies": { - "@jridgewell/gen-mapping": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", - "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", + "packages": { + "": { + "name": "django-admin-sortable2", + "license": "MIT", + "devDependencies": { + "@types/sortablejs": "^1.15.8", + "esbuild": "^0.21.2", + "playwright": "^1.44.0", + "sortablejs": "^1.15.2", + "tslib": "^2.6.2", + "typescript": "^4.9.5", + "yargs-parser": "^21.1.1" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.2.tgz", + "integrity": "sha512-/c7hocx0pm14bHQlqUVKmxwdT/e5/KkyoY1W8F9lk/8CkE037STDDz8PXUP/LE6faj2HqchvDs9GcShxFhI78Q==", + "cpu": [ + "ppc64" + ], "dev": true, - "requires": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" } }, - "@jridgewell/resolve-uri": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz", - "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==", - "dev": true + "node_modules/@esbuild/android-arm": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.2.tgz", + "integrity": "sha512-G1ve3b4FeyJeyCjB4MX1CiWyTaIJwT9wAYE+8+IRA53YoN/reC/Bf2GDRXAzDTnh69Fpl+1uIKg76DiB3U6vwQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } }, - "@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true + "node_modules/@esbuild/android-arm64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.2.tgz", + "integrity": "sha512-SGZKngoTWVUriO5bDjI4WDGsNx2VKZoXcds+ita/kVYB+8IkSCKDRDaK+5yu0b5S0eq6B3S7fpiEvpsa2ammlQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } }, - "@jridgewell/source-map": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.2.tgz", - "integrity": "sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==", + "node_modules/@esbuild/android-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.2.tgz", + "integrity": "sha512-1wzzNoj2QtNkAYwIcWJ66UTRA80+RTQ/kuPMtEuP0X6dp5Ar23Dn566q3aV61h4EYrrgGlOgl/HdcqN/2S/2vg==", + "cpu": [ + "x64" + ], "dev": true, - "requires": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" } }, - "@jridgewell/sourcemap-codec": { - "version": "1.4.14", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", - "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==", - "dev": true + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.2.tgz", + "integrity": "sha512-ZyMkPWc5eTROcLOA10lEqdDSTc6ds6nuh3DeHgKip/XJrYjZDfnkCVSty8svWdy+SC1f77ULtVeIqymTzaB6/Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } }, - "@jridgewell/trace-mapping": { - "version": "0.3.15", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", - "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.2.tgz", + "integrity": "sha512-K4ZdVq1zP9v51h/cKVna7im7G0zGTKKB6bP2yJiSmHjjOykbd8DdhrSi8V978sF69rkwrn8zCyL2t6I3ei6j9A==", + "cpu": [ + "x64" + ], "dev": true, - "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" } }, - "@types/sortablejs": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.13.0.tgz", - "integrity": "sha512-C3064MH72iEfeGCYEGCt7FCxXoAXaMPG0QPnstcxvPmbl54erpISu06d++FY37Smja64iWy5L8wOyHHBghWbJQ==", - "dev": true + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.2.tgz", + "integrity": "sha512-4kbOGdpA61CXqadD+Gb/Pw3YXamQGiz9mal/h93rFVSjr5cgMnmJd/gbfPRm+3BMifvnaOfS1gNWaIDxkE2A3A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } }, - "acorn": { - "version": "8.8.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", - "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", - "dev": true + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.2.tgz", + "integrity": "sha512-ShS+R09nuHzDBfPeMUliKZX27Wrmr8UFp93aFf/S8p+++x5BZ+D344CLKXxmY6qzgTL3mILSImPCNJOzD6+RRg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } }, - "buffer-from": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "node_modules/@esbuild/linux-arm": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.2.tgz", + "integrity": "sha512-nnGXjOAv+7cM3LYRx4tJsYdgy8dGDGkAzF06oIDGppWbUkUKN9SmgQA8H0KukpU0Pjrj9XmgbWqMVSX/U7eeTA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } }, - "commander": { - "version": "2.20.3", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.2.tgz", + "integrity": "sha512-Hdu8BL+AmO+eCDvvT6kz/fPQhvuHL8YK4ExKZfANWsNe1kFGOHw7VJvS/FKSLFqheXmB3rTF3xFQIgUWPYsGnA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } }, - "esbuild": { - "version": "0.11.23", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.11.23.tgz", - "integrity": "sha512-iaiZZ9vUF5wJV8ob1tl+5aJTrwDczlvGP0JoMmnpC2B0ppiMCu8n8gmy5ZTGl5bcG081XBVn+U+jP+mPFm5T5Q==", + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.2.tgz", + "integrity": "sha512-m73BOCW2V9lcj7RtEMi+gBfHC6n3+VHpwQXP5offtQMPLDkpVolYn1YGXxOZ9hp4h3UPRKuezL7WkBsw+3EB3Q==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.2.tgz", + "integrity": "sha512-84eYHwwWHq3myIY/6ikALMcnwkf6Qo7NIq++xH0x+cJuUNpdwh8mlpUtRY+JiGUc60yu7ElWBbVHGWTABTclGw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.2.tgz", + "integrity": "sha512-9siSZngT0/ZKG+AH+/agwKF29LdCxw4ODi/PiE0F52B2rtLozlDP92umf8G2GPoVV611LN4pZ+nSTckebOscUA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.2.tgz", + "integrity": "sha512-y0T4aV2CA+ic04ULya1A/8M2RDpDSK2ckgTj6jzHKFJvCq0jQg8afQQIn4EM0G8u2neyOiNHgSF9YKPfuqKOVw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.2.tgz", + "integrity": "sha512-x5ssCdXmZC86L2Li1qQPF/VaC4VP20u/Zm8jlAu9IiVOVi79YsSz6cpPDYZl1rfKSHYCJW9XBfFCo66S5gVPSA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.2.tgz", + "integrity": "sha512-NP7fTpGSFWdXyvp8iAFU04uFh9ARoplFVM/m+8lTRpaYG+2ytHPZWyscSsMM6cvObSIK2KoPHXiZD4l99WaxbQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.2.tgz", + "integrity": "sha512-giZ/uOxWDKda44ZuyfKbykeXznfuVNkTgXOUOPJIjbayJV6FRpQ4zxUy9JMBPLaK9IJcdWtaoeQrYBMh3Rr4vQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.2.tgz", + "integrity": "sha512-IeFMfGFSQfIj1d4XU+6lkbFzMR+mFELUUVYrZ+jvWzG4NGvs6o53ReEHLHpYkjRbdEjJy2W3lTekTxrFHW7YJg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.2.tgz", + "integrity": "sha512-48QhWD6WxcebNNaE4FCwgvQVUnAycuTd+BdvA/oZu+/MmbpU8pY2dMEYlYzj5uNHWIG5jvdDmFXu0naQeOWUoA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.2.tgz", + "integrity": "sha512-90r3nTBLgdIgD4FCVV9+cR6Hq2Dzs319icVsln+NTmTVwffWcCqXGml8rAoocHuJ85kZK36DCteii96ba/PX8g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.2.tgz", + "integrity": "sha512-sNndlsBT8OeE/MZDSGpRDJlWuhjuUz/dn80nH0EP4ZzDUYvMDVa7G87DVpweBrn4xdJYyXS/y4CQNrf7R2ODXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.2.tgz", + "integrity": "sha512-Ti2QChGNFzWhUNNVuU4w21YkYTErsNh3h+CzvlEhzgRbwsJ7TrWQqRzW3bllLKKvTppuF3DJ3XP1GEg11AfrEQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.2.tgz", + "integrity": "sha512-VEfTCZicoZnZ6sGkjFPGRFFJuL2fZn2bLhsekZl1CJslflp2cJS/VoKs1jMk+3pDfsGW6CfQVUckP707HwbXeQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@types/sortablejs": { + "version": "1.15.8", + "resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.15.8.tgz", + "integrity": "sha512-b79830lW+RZfwaztgs1aVPgbasJ8e7AXtZYHTELNXZPsERt4ymJdjV4OccDbHQAvHrCcFpbF78jkm0R6h/pZVg==", "dev": true }, - "playwright": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.25.1.tgz", - "integrity": "sha512-kOlW7mllnQ70ALTwAor73q/FhdH9EEXLUqjdzqioYLcSVC4n4NBfDqeCikGuayFZrLECLkU6Hcbziy/szqTXSA==", + "node_modules/esbuild": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.2.tgz", + "integrity": "sha512-LmHPAa5h4tSxz+g/D8IHY6wCjtIiFx8I7/Q0Aq+NmvtoYvyMnJU0KQJcqB6QH30X9x/W4CemgUtPgQDZFca5SA==", "dev": true, - "requires": { - "playwright-core": "1.25.1" + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.2", + "@esbuild/android-arm": "0.21.2", + "@esbuild/android-arm64": "0.21.2", + "@esbuild/android-x64": "0.21.2", + "@esbuild/darwin-arm64": "0.21.2", + "@esbuild/darwin-x64": "0.21.2", + "@esbuild/freebsd-arm64": "0.21.2", + "@esbuild/freebsd-x64": "0.21.2", + "@esbuild/linux-arm": "0.21.2", + "@esbuild/linux-arm64": "0.21.2", + "@esbuild/linux-ia32": "0.21.2", + "@esbuild/linux-loong64": "0.21.2", + "@esbuild/linux-mips64el": "0.21.2", + "@esbuild/linux-ppc64": "0.21.2", + "@esbuild/linux-riscv64": "0.21.2", + "@esbuild/linux-s390x": "0.21.2", + "@esbuild/linux-x64": "0.21.2", + "@esbuild/netbsd-x64": "0.21.2", + "@esbuild/openbsd-x64": "0.21.2", + "@esbuild/sunos-x64": "0.21.2", + "@esbuild/win32-arm64": "0.21.2", + "@esbuild/win32-ia32": "0.21.2", + "@esbuild/win32-x64": "0.21.2" + } + }, + "node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/playwright": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.44.0.tgz", + "integrity": "sha512-F9b3GUCLQ3Nffrfb6dunPOkE5Mh68tR7zN32L4jCk4FjQamgesGay7/dAAe1WaMEGV04DkdJfcJzjoCKygUaRQ==", + "dev": true, "dependencies": { - "playwright-core": { - "version": "1.25.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.25.1.tgz", - "integrity": "sha512-lSvPCmA2n7LawD2Hw7gSCLScZ+vYRkhU8xH0AapMyzwN+ojoDqhkH/KIEUxwNu2PjPoE/fcE0wLAksdOhJ2O5g==", - "dev": true - } + "playwright-core": "1.44.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" } }, - "sortablejs": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.0.tgz", - "integrity": "sha512-bv9qgVMjUMf89wAvM6AxVvS/4MX3sPeN0+agqShejLU5z5GX4C75ow1O2e5k4L6XItUyAK3gH6AxSbXrOM5e8w==", + "node_modules/playwright-core": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.0.tgz", + "integrity": "sha512-ZTbkNpFfYcGWohvTTl+xewITm7EOuqIqex0c7dNZ+aXsbrLj0qI8XlGKfPpipjm0Wny/4Lt4CJsWJk1stVS5qQ==", + "dev": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/sortablejs": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.2.tgz", + "integrity": "sha512-FJF5jgdfvoKn1MAKSdGs33bIqLi3LmsgVTliuX6iITj834F+JRQZN90Z93yql8h0K2t0RwDPBmxwlbZfDcxNZA==", + "dev": true + }, + "node_modules/tslib": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + } + }, + "dependencies": { + "@esbuild/aix-ppc64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.2.tgz", + "integrity": "sha512-/c7hocx0pm14bHQlqUVKmxwdT/e5/KkyoY1W8F9lk/8CkE037STDDz8PXUP/LE6faj2HqchvDs9GcShxFhI78Q==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.2.tgz", + "integrity": "sha512-G1ve3b4FeyJeyCjB4MX1CiWyTaIJwT9wAYE+8+IRA53YoN/reC/Bf2GDRXAzDTnh69Fpl+1uIKg76DiB3U6vwQ==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.2.tgz", + "integrity": "sha512-SGZKngoTWVUriO5bDjI4WDGsNx2VKZoXcds+ita/kVYB+8IkSCKDRDaK+5yu0b5S0eq6B3S7fpiEvpsa2ammlQ==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.2.tgz", + "integrity": "sha512-1wzzNoj2QtNkAYwIcWJ66UTRA80+RTQ/kuPMtEuP0X6dp5Ar23Dn566q3aV61h4EYrrgGlOgl/HdcqN/2S/2vg==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.2.tgz", + "integrity": "sha512-ZyMkPWc5eTROcLOA10lEqdDSTc6ds6nuh3DeHgKip/XJrYjZDfnkCVSty8svWdy+SC1f77ULtVeIqymTzaB6/Q==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.2.tgz", + "integrity": "sha512-K4ZdVq1zP9v51h/cKVna7im7G0zGTKKB6bP2yJiSmHjjOykbd8DdhrSi8V978sF69rkwrn8zCyL2t6I3ei6j9A==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.2.tgz", + "integrity": "sha512-4kbOGdpA61CXqadD+Gb/Pw3YXamQGiz9mal/h93rFVSjr5cgMnmJd/gbfPRm+3BMifvnaOfS1gNWaIDxkE2A3A==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.2.tgz", + "integrity": "sha512-ShS+R09nuHzDBfPeMUliKZX27Wrmr8UFp93aFf/S8p+++x5BZ+D344CLKXxmY6qzgTL3mILSImPCNJOzD6+RRg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.2.tgz", + "integrity": "sha512-nnGXjOAv+7cM3LYRx4tJsYdgy8dGDGkAzF06oIDGppWbUkUKN9SmgQA8H0KukpU0Pjrj9XmgbWqMVSX/U7eeTA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.2.tgz", + "integrity": "sha512-Hdu8BL+AmO+eCDvvT6kz/fPQhvuHL8YK4ExKZfANWsNe1kFGOHw7VJvS/FKSLFqheXmB3rTF3xFQIgUWPYsGnA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.2.tgz", + "integrity": "sha512-m73BOCW2V9lcj7RtEMi+gBfHC6n3+VHpwQXP5offtQMPLDkpVolYn1YGXxOZ9hp4h3UPRKuezL7WkBsw+3EB3Q==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.2.tgz", + "integrity": "sha512-84eYHwwWHq3myIY/6ikALMcnwkf6Qo7NIq++xH0x+cJuUNpdwh8mlpUtRY+JiGUc60yu7ElWBbVHGWTABTclGw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.2.tgz", + "integrity": "sha512-9siSZngT0/ZKG+AH+/agwKF29LdCxw4ODi/PiE0F52B2rtLozlDP92umf8G2GPoVV611LN4pZ+nSTckebOscUA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.2.tgz", + "integrity": "sha512-y0T4aV2CA+ic04ULya1A/8M2RDpDSK2ckgTj6jzHKFJvCq0jQg8afQQIn4EM0G8u2neyOiNHgSF9YKPfuqKOVw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.2.tgz", + "integrity": "sha512-x5ssCdXmZC86L2Li1qQPF/VaC4VP20u/Zm8jlAu9IiVOVi79YsSz6cpPDYZl1rfKSHYCJW9XBfFCo66S5gVPSA==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.2.tgz", + "integrity": "sha512-NP7fTpGSFWdXyvp8iAFU04uFh9ARoplFVM/m+8lTRpaYG+2ytHPZWyscSsMM6cvObSIK2KoPHXiZD4l99WaxbQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.2.tgz", + "integrity": "sha512-giZ/uOxWDKda44ZuyfKbykeXznfuVNkTgXOUOPJIjbayJV6FRpQ4zxUy9JMBPLaK9IJcdWtaoeQrYBMh3Rr4vQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.2.tgz", + "integrity": "sha512-IeFMfGFSQfIj1d4XU+6lkbFzMR+mFELUUVYrZ+jvWzG4NGvs6o53ReEHLHpYkjRbdEjJy2W3lTekTxrFHW7YJg==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.2.tgz", + "integrity": "sha512-48QhWD6WxcebNNaE4FCwgvQVUnAycuTd+BdvA/oZu+/MmbpU8pY2dMEYlYzj5uNHWIG5jvdDmFXu0naQeOWUoA==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.2.tgz", + "integrity": "sha512-90r3nTBLgdIgD4FCVV9+cR6Hq2Dzs319icVsln+NTmTVwffWcCqXGml8rAoocHuJ85kZK36DCteii96ba/PX8g==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.2.tgz", + "integrity": "sha512-sNndlsBT8OeE/MZDSGpRDJlWuhjuUz/dn80nH0EP4ZzDUYvMDVa7G87DVpweBrn4xdJYyXS/y4CQNrf7R2ODXg==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.2.tgz", + "integrity": "sha512-Ti2QChGNFzWhUNNVuU4w21YkYTErsNh3h+CzvlEhzgRbwsJ7TrWQqRzW3bllLKKvTppuF3DJ3XP1GEg11AfrEQ==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.2.tgz", + "integrity": "sha512-VEfTCZicoZnZ6sGkjFPGRFFJuL2fZn2bLhsekZl1CJslflp2cJS/VoKs1jMk+3pDfsGW6CfQVUckP707HwbXeQ==", + "dev": true, + "optional": true + }, + "@types/sortablejs": { + "version": "1.15.8", + "resolved": "https://registry.npmjs.org/@types/sortablejs/-/sortablejs-1.15.8.tgz", + "integrity": "sha512-b79830lW+RZfwaztgs1aVPgbasJ8e7AXtZYHTELNXZPsERt4ymJdjV4OccDbHQAvHrCcFpbF78jkm0R6h/pZVg==", "dev": true }, - "source-map-support": { - "version": "0.5.21", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", - "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "esbuild": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.2.tgz", + "integrity": "sha512-LmHPAa5h4tSxz+g/D8IHY6wCjtIiFx8I7/Q0Aq+NmvtoYvyMnJU0KQJcqB6QH30X9x/W4CemgUtPgQDZFca5SA==", "dev": true, "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "@esbuild/aix-ppc64": "0.21.2", + "@esbuild/android-arm": "0.21.2", + "@esbuild/android-arm64": "0.21.2", + "@esbuild/android-x64": "0.21.2", + "@esbuild/darwin-arm64": "0.21.2", + "@esbuild/darwin-x64": "0.21.2", + "@esbuild/freebsd-arm64": "0.21.2", + "@esbuild/freebsd-x64": "0.21.2", + "@esbuild/linux-arm": "0.21.2", + "@esbuild/linux-arm64": "0.21.2", + "@esbuild/linux-ia32": "0.21.2", + "@esbuild/linux-loong64": "0.21.2", + "@esbuild/linux-mips64el": "0.21.2", + "@esbuild/linux-ppc64": "0.21.2", + "@esbuild/linux-riscv64": "0.21.2", + "@esbuild/linux-s390x": "0.21.2", + "@esbuild/linux-x64": "0.21.2", + "@esbuild/netbsd-x64": "0.21.2", + "@esbuild/openbsd-x64": "0.21.2", + "@esbuild/sunos-x64": "0.21.2", + "@esbuild/win32-arm64": "0.21.2", + "@esbuild/win32-ia32": "0.21.2", + "@esbuild/win32-x64": "0.21.2" } }, - "terser": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.0.tgz", - "integrity": "sha512-L1BJiXVmheAQQy+as0oF3Pwtlo4s3Wi1X2zNZ2NxOB4wx9bdS9Vk67XQENLFdLYGCK/Z2di53mTj/hBafR+dTA==", + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "playwright": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.44.0.tgz", + "integrity": "sha512-F9b3GUCLQ3Nffrfb6dunPOkE5Mh68tR7zN32L4jCk4FjQamgesGay7/dAAe1WaMEGV04DkdJfcJzjoCKygUaRQ==", "dev": true, "requires": { - "@jridgewell/source-map": "^0.3.2", - "acorn": "^8.5.0", - "commander": "^2.20.0", - "source-map-support": "~0.5.20" + "fsevents": "2.3.2", + "playwright-core": "1.44.0" } }, + "playwright-core": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.0.tgz", + "integrity": "sha512-ZTbkNpFfYcGWohvTTl+xewITm7EOuqIqex0c7dNZ+aXsbrLj0qI8XlGKfPpipjm0Wny/4Lt4CJsWJk1stVS5qQ==", + "dev": true + }, + "sortablejs": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.2.tgz", + "integrity": "sha512-FJF5jgdfvoKn1MAKSdGs33bIqLi3LmsgVTliuX6iITj834F+JRQZN90Z93yql8h0K2t0RwDPBmxwlbZfDcxNZA==", + "dev": true + }, "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", "dev": true }, "typescript": { - "version": "4.8.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz", - "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==", + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true + }, + "yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", "dev": true } } diff --git a/package.json b/package.json index f3a3c44..8393fe5 100644 --- a/package.json +++ b/package.json @@ -3,16 +3,15 @@ "private": true, "license": "MIT", "scripts": { - "build": "node client/build.cjs", - "minify": "terser --compress --mangle --output adminsortable2/static/adminsortable2/js/adminsortable2.min.js -- adminsortable2/static/adminsortable2/js/adminsortable2.js" + "build": "node client/build.cjs" }, "devDependencies": { - "@types/sortablejs": "^1.10.7", - "esbuild": "^0.11.23", - "playwright": "^1.20.2", - "sortablejs": "^1.15.0", - "terser": "^5.15.0", - "tslib": "^2.2.0", - "typescript": "^4.1.4" + "@types/sortablejs": "^1.15.8", + "esbuild": "^0.21.2", + "playwright": "^1.44.0", + "sortablejs": "^1.15.2", + "tslib": "^2.6.2", + "typescript": "^4.9.5", + "yargs-parser": "^21.1.1" } } diff --git a/testapp/requirements.txt b/testapp/requirements.txt index a1c9815..272644c 100644 --- a/testapp/requirements.txt +++ b/testapp/requirements.txt @@ -1,26 +1,26 @@ asgiref==3.6.0 -attrs==21.4.0 -certifi==2023.7.22 -charset-normalizer==2.0.12 +attrs==23.2.0 +certifi==2024.2.2 +charset-normalizer==3.3.2 jinja2 idna==3.3 iniconfig==2.0.0 -greenlet==2.0.1 +greenlet==3.0.3 packaging==21.3 -playwright==1.31.1 -pluggy==1.0.0 +playwright==1.43.0 +pluggy==1.5.0 py==1.11.0 -pyee==9.0.4 +pyee==11.1.0 pyparsing==3.0.9 -pytest==7.2.2 -pytest-base-url==2.0.0 -pytest-django==4.5.2 -pytest-mock==3.7.0 -pytest-playwright==0.3.2 +pytest==7.4.4 +pytest-base-url==2.1.0 +pytest-django==4.8.0 +pytest-mock==3.14.0 +pytest-playwright==0.5.0 python-slugify==6.1.2 requests==2.31.0 -sqlparse==0.4.4 +sqlparse==0.5.0 text-unidecode==1.3 tomli==2.0.1 -urllib3==1.26.18 +urllib3==2.2.1 websockets==10.1 diff --git a/testapp/settings.py b/testapp/settings.py index 83b7399..1afc4ad 100644 --- a/testapp/settings.py +++ b/testapp/settings.py @@ -22,9 +22,9 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': Path(__file__).parent / 'demo.sqlite3', + 'NAME': Path(__file__).parent.parent / 'workdir/demo.sqlite3', 'TEST': { - 'NAME': Path(__file__).parent / 'test.sqlite3', # live_server requires a file rather than :memory: + 'NAME': Path(__file__).parent.parent / 'workdir/test.sqlite3', # live_server requires a file rather than :memory: 'OPTIONS': { 'timeout': 20, }, diff --git a/testapp/test_e2e_inline.py b/testapp/test_e2e_inline.py index a09cb48..520161d 100644 --- a/testapp/test_e2e_inline.py +++ b/testapp/test_e2e_inline.py @@ -1,4 +1,5 @@ import pytest +from playwright.sync_api import expect from testapp.models import Book @@ -24,19 +25,21 @@ def get_end_order(direction): @pytest.fixture def adminpage(live_server, page, slug): - page.goto(f'{live_server.url}/admin/testapp/{slug}/{js_the_good_parts_id}/change/') + url = f'{live_server.url}/admin/testapp/{slug}/{js_the_good_parts_id}/change/' + page.goto(url) return page -def is_fieldset_ordered(inline_elem, direction): +def expect_fieldset_is_ordered(inline_elem, direction): + expect(inline_elem).to_be_visible() start_order = get_start_order(direction) - for counter, row in enumerate(inline_elem.query_selector_all('div.inline-related.has_original')): - order_field = row.query_selector('fieldset input._reorder_') - assert order_field is not None + inline_related = inline_elem.locator('div.inline-related.has_original') + for counter in range(inline_related.count()): + row = inline_related.nth(counter) + order_field = row.locator('fieldset input._reorder_') + expect(order_field).to_be_hidden() order = start_order + direction * counter - if order_field.input_value() != str(order): - return False - return True + expect(order_field).to_have_value(str(order)) @pytest.fixture @@ -53,55 +56,68 @@ def chapter(slug): return '#chapter' +@pytest.fixture +def drag_selector(slug): + if slug in ['book5']: + return '> td > p' + return '> h3' + + @pytest.mark.parametrize('slug', slugs) -def test_drag_down(adminpage, slug, direction, chapter): - inline_locator = adminpage.locator(f'{chapter}_set-group') - assert is_fieldset_ordered(inline_locator.element_handle(), direction) +def test_drag_down(adminpage, slug, direction, chapter, drag_selector): + group_locator = adminpage.locator(f'{chapter}_set-group') + expect_fieldset_is_ordered(group_locator, direction) start_order = get_start_order(direction) - assert inline_locator.locator(f'{chapter}_set-0 input._reorder_').input_value() == str(start_order) - drag_handle = inline_locator.locator(f'{chapter}_set-0 :is(h3, p)') - drag_handle.drag_to(inline_locator.locator(f'{chapter}_set-4')) - assert inline_locator.locator(f'{chapter}_set-0 input._reorder_').input_value() == str(start_order + direction * 4) - assert inline_locator.locator(f'{chapter}_set-1 input._reorder_').input_value() == str(start_order) - assert is_fieldset_ordered(inline_locator.element_handle(), direction) + expect(group_locator.locator(f'{chapter}_set-0 input._reorder_')).to_have_value(str(start_order)) + if slug in ['book6']: + adminpage.screenshot(path=f'../workdir/screenshot-{slug}-before.png') + drag_kwargs = {'source_position': {'x': 200, 'y': 10}, 'target_position': {'x': 200, 'y': 10}} + drag_handle = group_locator.locator(f'{chapter}_set-0 {drag_selector}') + expect(drag_handle).to_be_visible() + drag_handle.drag_to(group_locator.locator(f'{chapter}_set-4'), **drag_kwargs) + if slug in ['book6']: + adminpage.screenshot(path=f'../workdir/screenshot-{slug}-after.png') + expect(group_locator.locator(f'{chapter}_set-0 input._reorder_')).to_have_value(str(start_order + direction * 4)) + expect(group_locator.locator(f'{chapter}_set-1 input._reorder_')).to_have_value(str(start_order)) + expect_fieldset_is_ordered(group_locator, direction) @pytest.mark.parametrize('slug', slugs) -def test_drag_up(adminpage, slug, direction, chapter): - inline_locator = adminpage.locator(f'{chapter}_set-group') - assert is_fieldset_ordered(inline_locator.element_handle(), direction) +def test_drag_up(adminpage, slug, direction, chapter, drag_selector): + group_locator = adminpage.locator(f'{chapter}_set-group') + expect_fieldset_is_ordered(group_locator, direction) start_order = get_start_order(direction) - reorder_field = inline_locator.locator(f'{chapter}_set-5 input._reorder_') - assert reorder_field.input_value() == str(start_order + direction * 5) - drag_handle = inline_locator.locator(f'{chapter}_set-5 :is(h3, p)') - drag_handle.drag_to(inline_locator.locator(f'{chapter}_set-1')) - assert inline_locator.locator(f'{chapter}_set-5 input._reorder_').input_value() == str(start_order + direction) - assert inline_locator.locator(f'{chapter}_set-1 input._reorder_').input_value() == str(start_order + direction * 2) - assert is_fieldset_ordered(inline_locator.element_handle(), direction) + expect(group_locator.locator(f'{chapter}_set-5 input._reorder_')).to_have_value(str(start_order + direction * 5)) + drag_kwargs = {'source_position': {'x': 200, 'y': 10}, 'target_position': {'x': 200, 'y': 10}} + drag_handle = group_locator.locator(f'{chapter}_set-5 {drag_selector}') + drag_handle.drag_to(group_locator.locator(f'{chapter}_set-1'), **drag_kwargs) + expect(group_locator.locator(f'{chapter}_set-5 input._reorder_')).to_have_value(str(start_order + direction)) + expect(group_locator.locator(f'{chapter}_set-1 input._reorder_')).to_have_value(str(start_order + direction * 2)) + expect_fieldset_is_ordered(group_locator, direction) @pytest.mark.parametrize('slug', ['book1', 'book2', 'book5']) -def test_move_end(adminpage, slug, direction, chapter): +def test_move_end(adminpage, slug, direction, chapter, drag_selector): inline_locator = adminpage.locator(f'{chapter}_set-group') - assert is_fieldset_ordered(inline_locator.element_handle(), direction) + expect_fieldset_is_ordered(inline_locator, direction) start_order = get_start_order(direction) end_order = get_end_order(direction) - assert inline_locator.locator(f'{chapter}_set-2 input._reorder_').input_value() == str(start_order + direction * 2) - move_end_button = inline_locator.locator(f'{chapter}_set-2 :is(h3, p) .move-end').element_handle() + expect(inline_locator.locator(f'{chapter}_set-2 input._reorder_')).to_have_value(str(start_order + direction * 2)) + move_end_button = inline_locator.locator(f'{chapter}_set-2 {drag_selector} .move-end').element_handle() move_end_button.click() - assert inline_locator.locator(f'{chapter}_set-2 input._reorder_').input_value() == str(end_order) - assert inline_locator.locator(f'{chapter}_set-3 input._reorder_').input_value() == str(start_order + direction * 2) - assert is_fieldset_ordered(inline_locator.element_handle(), direction) + expect(inline_locator.locator(f'{chapter}_set-2 input._reorder_')).to_have_value(str(end_order)) + expect(inline_locator.locator(f'{chapter}_set-3 input._reorder_')).to_have_value(str(start_order + direction * 2)) + expect_fieldset_is_ordered(inline_locator, direction) @pytest.mark.parametrize('slug', ['book1', 'book2', 'book5']) -def test_move_begin(adminpage, slug, direction, chapter): +def test_move_begin(adminpage, slug, direction, chapter, drag_selector): inline_locator = adminpage.locator(f'{chapter}_set-group') - assert is_fieldset_ordered(inline_locator.element_handle(), direction) + expect_fieldset_is_ordered(inline_locator, direction) start_order = get_start_order(direction) - assert inline_locator.locator(f'{chapter}_set-8 input._reorder_').input_value() == str(start_order + direction * 8) - move_end_button = inline_locator.locator(f'{chapter}_set-8 :is(h3, p) .move-begin').element_handle() + expect(inline_locator.locator(f'{chapter}_set-8 input._reorder_')).to_have_value(str(start_order + direction * 8)) + move_end_button = inline_locator.locator(f'{chapter}_set-8 {drag_selector} .move-begin') move_end_button.click() - assert inline_locator.locator(f'{chapter}_set-8 input._reorder_').input_value() == str(start_order) - assert inline_locator.locator(f'{chapter}_set-3 input._reorder_').input_value() == str(start_order + direction * 4) - assert is_fieldset_ordered(inline_locator.element_handle(), direction) + expect(inline_locator.locator(f'{chapter}_set-8 input._reorder_')).to_have_value(str(start_order)) + expect(inline_locator.locator(f'{chapter}_set-3 input._reorder_')).to_have_value(str(start_order + direction * 4)) + expect_fieldset_is_ordered(inline_locator, direction)