Skip to content

Commit

Permalink
Merge pull request #390 from jrief/django-5-support
Browse files Browse the repository at this point in the history
Prepare for Django 5 support
  • Loading branch information
jrief authored May 15, 2024
2 parents 65397bd + 9410039 commit 8cac5c3
Show file tree
Hide file tree
Showing 12 changed files with 813 additions and 183 deletions.
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -59,4 +58,5 @@ jobs:
done
- name: Test with pytest
run: |
mkdir -p workdir
python -m pytest testapp
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*.pot
*.pyc
*.egg-info
*.sqlite3
*.coverage
*.tsbuildinfo
*~
Expand All @@ -17,6 +16,7 @@ build
docs/_build
dist
node_modules/
workdir/*
htmlcov
adminsortable2/static/adminsortable2/js/adminsortable2.*
adminsortable2/templates/adminsortable2/edit_inline
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion adminsortable2/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.1.10'
__version__ = '2.1.11'
9 changes: 6 additions & 3 deletions client/build.cjs
Original file line number Diff line number Diff line change
@@ -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));
15 changes: 8 additions & 7 deletions docs/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
Loading

0 comments on commit 8cac5c3

Please sign in to comment.